aicodeswitch 5.2.13 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/restore.js +67 -4
- package/bin/utils/managed-fields.js +12 -0
- package/dist/server/agent-map/activity-extractor.js +8 -0
- package/dist/server/agent-map/agent-map-service.js +364 -65
- package/dist/server/coding-plan.js +3 -0
- package/dist/server/config-managed-fields.js +20 -1
- package/dist/server/config-metadata.js +78 -1
- package/dist/server/conversions/index.js +10 -2
- package/dist/server/conversions/thinking/providers.js +12 -7
- package/dist/server/fs-database.js +10 -1
- package/dist/server/main.js +412 -37
- package/dist/server/original-config-reader.js +71 -1
- package/dist/server/performance-tracker.js +78 -8
- package/dist/server/proxy-server.js +159 -34
- package/dist/server/session-migration.js +1 -0
- package/dist/server/transformers/chunk-collector.js +112 -25
- package/dist/ui/assets/index-BeM4AIzn.js +1187 -0
- package/dist/ui/assets/index-DqRzbMIU.css +1 -0
- package/dist/ui/assets/three-CFpmPosW.js +3802 -0
- package/dist/ui/index.html +3 -2
- package/package.json +3 -1
- package/scripts/dev.js +76 -30
- package/dist/server/tools-service.js +0 -203
- package/dist/server/websocket-service.js +0 -148
- package/dist/ui/assets/index-4liE4bV8.css +0 -1
- package/dist/ui/assets/index-CJMAVkIN.js +0 -813
|
@@ -1,813 +0,0 @@
|
|
|
1
|
-
var ER=Object.defineProperty;var TR=(e,t,n)=>t in e?ER(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Gu=(e,t,n)=>TR(e,typeof t!="symbol"?t+"":t,n);function AR(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var Ys=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qP={exports:{}},Mf={},YP={exports:{}},nt={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var uu=Symbol.for("react.element"),OR=Symbol.for("react.portal"),IR=Symbol.for("react.fragment"),NR=Symbol.for("react.strict_mode"),_R=Symbol.for("react.profiler"),MR=Symbol.for("react.provider"),RR=Symbol.for("react.context"),DR=Symbol.for("react.forward_ref"),LR=Symbol.for("react.suspense"),zR=Symbol.for("react.memo"),$R=Symbol.for("react.lazy"),I1=Symbol.iterator;function BR(e){return e===null||typeof e!="object"?null:(e=I1&&e[I1]||e["@@iterator"],typeof e=="function"?e:null)}var GP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},XP=Object.assign,QP={};function ml(e,t,n){this.props=e,this.context=t,this.refs=QP,this.updater=n||GP}ml.prototype.isReactComponent={};ml.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ml.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function JP(){}JP.prototype=ml.prototype;function Hy(e,t,n){this.props=e,this.context=t,this.refs=QP,this.updater=n||GP}var Vy=Hy.prototype=new JP;Vy.constructor=Hy;XP(Vy,ml.prototype);Vy.isPureReactComponent=!0;var N1=Array.isArray,ZP=Object.prototype.hasOwnProperty,qy={current:null},e2={key:!0,ref:!0,__self:!0,__source:!0};function t2(e,t,n){var r,i={},a=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(a=""+t.key),t)ZP.call(t,r)&&!e2.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:uu,type:e,key:a,ref:s,props:i,_owner:qy.current}}function FR(e,t){return{$$typeof:uu,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Yy(e){return typeof e=="object"&&e!==null&&e.$$typeof===uu}function UR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var _1=/\/+/g;function fm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?UR(""+e.key):t.toString(36)}function zd(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case uu:case OR:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+fm(s,0):r,N1(i)?(n="",e!=null&&(n=e.replace(_1,"$&/")+"/"),zd(i,t,n,"",function(u){return u})):i!=null&&(Yy(i)&&(i=FR(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(_1,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",N1(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+fm(a,l);s+=zd(a,t,n,c,i)}else if(c=BR(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+fm(a,l++),s+=zd(a,t,n,c,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Xu(e,t,n){if(e==null)return e;var r=[],i=0;return zd(e,r,"","",function(a){return t.call(n,a,i++)}),r}function WR(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Jn={current:null},$d={transition:null},KR={ReactCurrentDispatcher:Jn,ReactCurrentBatchConfig:$d,ReactCurrentOwner:qy};function n2(){throw Error("act(...) is not supported in production builds of React.")}nt.Children={map:Xu,forEach:function(e,t,n){Xu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xu(e,function(){t++}),t},toArray:function(e){return Xu(e,function(t){return t})||[]},only:function(e){if(!Yy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};nt.Component=ml;nt.Fragment=IR;nt.Profiler=_R;nt.PureComponent=Hy;nt.StrictMode=NR;nt.Suspense=LR;nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=KR;nt.act=n2;nt.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=XP({},e.props),i=e.key,a=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,s=qy.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)ZP.call(t,c)&&!e2.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:uu,type:e.type,key:i,ref:a,props:r,_owner:s}};nt.createContext=function(e){return e={$$typeof:RR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:MR,_context:e},e.Consumer=e};nt.createElement=t2;nt.createFactory=function(e){var t=t2.bind(null,e);return t.type=e,t};nt.createRef=function(){return{current:null}};nt.forwardRef=function(e){return{$$typeof:DR,render:e}};nt.isValidElement=Yy;nt.lazy=function(e){return{$$typeof:$R,_payload:{_status:-1,_result:e},_init:WR}};nt.memo=function(e,t){return{$$typeof:zR,type:e,compare:t===void 0?null:t}};nt.startTransition=function(e){var t=$d.transition;$d.transition={};try{e()}finally{$d.transition=t}};nt.unstable_act=n2;nt.useCallback=function(e,t){return Jn.current.useCallback(e,t)};nt.useContext=function(e){return Jn.current.useContext(e)};nt.useDebugValue=function(){};nt.useDeferredValue=function(e){return Jn.current.useDeferredValue(e)};nt.useEffect=function(e,t){return Jn.current.useEffect(e,t)};nt.useId=function(){return Jn.current.useId()};nt.useImperativeHandle=function(e,t,n){return Jn.current.useImperativeHandle(e,t,n)};nt.useInsertionEffect=function(e,t){return Jn.current.useInsertionEffect(e,t)};nt.useLayoutEffect=function(e,t){return Jn.current.useLayoutEffect(e,t)};nt.useMemo=function(e,t){return Jn.current.useMemo(e,t)};nt.useReducer=function(e,t,n){return Jn.current.useReducer(e,t,n)};nt.useRef=function(e){return Jn.current.useRef(e)};nt.useState=function(e){return Jn.current.useState(e)};nt.useSyncExternalStore=function(e,t,n){return Jn.current.useSyncExternalStore(e,t,n)};nt.useTransition=function(){return Jn.current.useTransition()};nt.version="18.3.1";YP.exports=nt;var f=YP.exports;const r2=hl(f),i2=AR({__proto__:null,default:r2},[f]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var HR=f,VR=Symbol.for("react.element"),qR=Symbol.for("react.fragment"),YR=Object.prototype.hasOwnProperty,GR=HR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,XR={key:!0,ref:!0,__self:!0,__source:!0};function a2(e,t,n){var r,i={},a=null,s=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)YR.call(t,r)&&!XR.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:VR,type:e,key:a,ref:s,props:i,_owner:GR.current}}Mf.Fragment=qR;Mf.jsx=a2;Mf.jsxs=a2;qP.exports=Mf;var o=qP.exports,Ag={},o2={exports:{}},Sr={},s2={exports:{}},l2={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(R,$){var P=R.length;R.push($);e:for(;0<P;){var F=P-1>>>1,re=R[F];if(0<i(re,$))R[F]=$,R[P]=re,P=F;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var $=R[0],P=R.pop();if(P!==$){R[0]=P;e:for(var F=0,re=R.length,N=re>>>1;F<N;){var pe=2*(F+1)-1,ve=R[pe],X=pe+1,oe=R[X];if(0>i(ve,P))X<re&&0>i(oe,ve)?(R[F]=oe,R[X]=P,F=X):(R[F]=ve,R[pe]=P,F=pe);else if(X<re&&0>i(oe,P))R[F]=oe,R[X]=P,F=X;else break e}}return $}function i(R,$){var P=R.sortIndex-$.sortIndex;return P!==0?P:R.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],p=1,d=null,h=3,m=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(R){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=R)r(u),$.sortIndex=$.expirationTime,t(c,$);else break;$=n(u)}}function w(R){if(y=!1,j(R),!g)if(n(c)!==null)g=!0,B(k);else{var $=n(u);$!==null&&W(w,$.startTime-R)}}function k(R,$){g=!1,y&&(y=!1,v(A),A=-1),m=!0;var P=h;try{for(j($),d=n(c);d!==null&&(!(d.expirationTime>$)||R&&!I());){var F=d.callback;if(typeof F=="function"){d.callback=null,h=d.priorityLevel;var re=F(d.expirationTime<=$);$=e.unstable_now(),typeof re=="function"?d.callback=re:d===n(c)&&r(c),j($)}else r(c);d=n(c)}if(d!==null)var N=!0;else{var pe=n(u);pe!==null&&W(w,pe.startTime-$),N=!1}return N}finally{d=null,h=P,m=!1}}var S=!1,E=null,A=-1,D=5,T=-1;function I(){return!(e.unstable_now()-T<D)}function _(){if(E!==null){var R=e.unstable_now();T=R;var $=!0;try{$=E(!0,R)}finally{$?G():(S=!1,E=null)}}else S=!1}var G;if(typeof b=="function")G=function(){b(_)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,O=K.port2;K.port1.onmessage=_,G=function(){O.postMessage(null)}}else G=function(){x(_,0)};function B(R){E=R,S||(S=!0,G())}function W(R,$){A=x(function(){R(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,B(k))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var $=3;break;default:$=h}var P=h;h=$;try{return R()}finally{h=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,$){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var P=h;h=R;try{return $()}finally{h=P}},e.unstable_scheduleCallback=function(R,$,P){var F=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?F+P:F):P=F,R){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=P+re,R={id:p++,callback:$,priorityLevel:R,startTime:P,expirationTime:re,sortIndex:-1},P>F?(R.sortIndex=P,t(u,R),n(c)===null&&R===n(u)&&(y?(v(A),A=-1):y=!0,W(w,P-F))):(R.sortIndex=re,t(c,R),g||m||(g=!0,B(k))),R},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(R){var $=h;return function(){var P=h;h=$;try{return R.apply(this,arguments)}finally{h=P}}}})(l2);s2.exports=l2;var QR=s2.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var JR=f,br=QR;function ye(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var c2=new Set,Ec={};function Qo(e,t){Gs(e,t),Gs(e+"Capture",t)}function Gs(e,t){for(Ec[e]=t,e=0;e<t.length;e++)c2.add(t[e])}var Xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Og=Object.prototype.hasOwnProperty,ZR=/^[: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]*$/,M1={},R1={};function eD(e){return Og.call(R1,e)?!0:Og.call(M1,e)?!1:ZR.test(e)?R1[e]=!0:(M1[e]=!0,!1)}function tD(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nD(e,t,n,r){if(t===null||typeof t>"u"||tD(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Zn(e,t,n,r,i,a,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var On={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){On[e]=new Zn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];On[t]=new Zn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){On[e]=new Zn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){On[e]=new Zn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){On[e]=new Zn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){On[e]=new Zn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){On[e]=new Zn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){On[e]=new Zn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){On[e]=new Zn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gy=/[\-:]([a-z])/g;function Xy(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gy,Xy);On[t]=new Zn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gy,Xy);On[t]=new Zn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gy,Xy);On[t]=new Zn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){On[e]=new Zn(e,1,!1,e.toLowerCase(),null,!1,!1)});On.xlinkHref=new Zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){On[e]=new Zn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qy(e,t,n,r){var i=On.hasOwnProperty(t)?On[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(nD(t,n,i,r)&&(n=null),r||i===null?eD(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ia=JR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Qu=Symbol.for("react.element"),xs=Symbol.for("react.portal"),bs=Symbol.for("react.fragment"),Jy=Symbol.for("react.strict_mode"),Ig=Symbol.for("react.profiler"),u2=Symbol.for("react.provider"),d2=Symbol.for("react.context"),Zy=Symbol.for("react.forward_ref"),Ng=Symbol.for("react.suspense"),_g=Symbol.for("react.suspense_list"),ex=Symbol.for("react.memo"),xa=Symbol.for("react.lazy"),p2=Symbol.for("react.offscreen"),D1=Symbol.iterator;function Rl(e){return e===null||typeof e!="object"?null:(e=D1&&e[D1]||e["@@iterator"],typeof e=="function"?e:null)}var Kt=Object.assign,hm;function rc(e){if(hm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);hm=t&&t[1]||""}return`
|
|
34
|
-
`+hm+e}var mm=!1;function gm(e,t){if(!e||mm)return"";mm=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
35
|
-
`),a=r.stack.split(`
|
|
36
|
-
`),s=i.length-1,l=a.length-1;1<=s&&0<=l&&i[s]!==a[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==a[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==a[l]){var c=`
|
|
37
|
-
`+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{mm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?rc(e):""}function rD(e){switch(e.tag){case 5:return rc(e.type);case 16:return rc("Lazy");case 13:return rc("Suspense");case 19:return rc("SuspenseList");case 0:case 2:case 15:return e=gm(e.type,!1),e;case 11:return e=gm(e.type.render,!1),e;case 1:return e=gm(e.type,!0),e;default:return""}}function Mg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case bs:return"Fragment";case xs:return"Portal";case Ig:return"Profiler";case Jy:return"StrictMode";case Ng:return"Suspense";case _g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d2:return(e.displayName||"Context")+".Consumer";case u2:return(e._context.displayName||"Context")+".Provider";case Zy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ex:return t=e.displayName||null,t!==null?t:Mg(e.type)||"Memo";case xa:t=e._payload,e=e._init;try{return Mg(e(t))}catch{}}return null}function iD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Mg(t);case 8:return t===Jy?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Fa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function f2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function aD(e){var t=f2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ju(e){e._valueTracker||(e._valueTracker=aD(e))}function h2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=f2(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ap(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rg(e,t){var n=t.checked;return Kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function L1(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Fa(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function m2(e,t){t=t.checked,t!=null&&Qy(e,"checked",t,!1)}function Dg(e,t){m2(e,t);var n=Fa(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Lg(e,t.type,n):t.hasOwnProperty("defaultValue")&&Lg(e,t.type,Fa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function z1(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Lg(e,t,n){(t!=="number"||ap(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ic=Array.isArray;function Ls(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Fa(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function zg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ye(91));return Kt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $1(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ye(92));if(ic(n)){if(1<n.length)throw Error(ye(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Fa(n)}}function g2(e,t){var n=Fa(t.value),r=Fa(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function B1(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function v2(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $g(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?v2(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Zu,y2=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Zu=Zu||document.createElement("div"),Zu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Zu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Tc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oD=["Webkit","ms","Moz","O"];Object.keys(dc).forEach(function(e){oD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),dc[t]=dc[e]})});function x2(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||dc.hasOwnProperty(e)&&dc[e]?(""+t).trim():t+"px"}function b2(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=x2(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var sD=Kt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bg(e,t){if(t){if(sD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ye(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ye(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ye(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ye(62))}}function Fg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ug=null;function tx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wg=null,zs=null,$s=null;function F1(e){if(e=fu(e)){if(typeof Wg!="function")throw Error(ye(280));var t=e.stateNode;t&&(t=$f(t),Wg(e.stateNode,e.type,t))}}function j2(e){zs?$s?$s.push(e):$s=[e]:zs=e}function w2(){if(zs){var e=zs,t=$s;if($s=zs=null,F1(e),t)for(e=0;e<t.length;e++)F1(t[e])}}function S2(e,t){return e(t)}function k2(){}var vm=!1;function C2(e,t,n){if(vm)return e(t,n);vm=!0;try{return S2(e,t,n)}finally{vm=!1,(zs!==null||$s!==null)&&(k2(),w2())}}function Ac(e,t){var n=e.stateNode;if(n===null)return null;var r=$f(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ye(231,t,typeof n));return n}var Kg=!1;if(Xi)try{var Dl={};Object.defineProperty(Dl,"passive",{get:function(){Kg=!0}}),window.addEventListener("test",Dl,Dl),window.removeEventListener("test",Dl,Dl)}catch{Kg=!1}function lD(e,t,n,r,i,a,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var pc=!1,op=null,sp=!1,Hg=null,cD={onError:function(e){pc=!0,op=e}};function uD(e,t,n,r,i,a,s,l,c){pc=!1,op=null,lD.apply(cD,arguments)}function dD(e,t,n,r,i,a,s,l,c){if(uD.apply(this,arguments),pc){if(pc){var u=op;pc=!1,op=null}else throw Error(ye(198));sp||(sp=!0,Hg=u)}}function Jo(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function P2(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 U1(e){if(Jo(e)!==e)throw Error(ye(188))}function pD(e){var t=e.alternate;if(!t){if(t=Jo(e),t===null)throw Error(ye(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return U1(i),e;if(a===r)return U1(i),t;a=a.sibling}throw Error(ye(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(ye(189))}}if(n.alternate!==r)throw Error(ye(190))}if(n.tag!==3)throw Error(ye(188));return n.stateNode.current===n?e:t}function E2(e){return e=pD(e),e!==null?T2(e):null}function T2(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=T2(e);if(t!==null)return t;e=e.sibling}return null}var A2=br.unstable_scheduleCallback,W1=br.unstable_cancelCallback,fD=br.unstable_shouldYield,hD=br.unstable_requestPaint,en=br.unstable_now,mD=br.unstable_getCurrentPriorityLevel,nx=br.unstable_ImmediatePriority,O2=br.unstable_UserBlockingPriority,lp=br.unstable_NormalPriority,gD=br.unstable_LowPriority,I2=br.unstable_IdlePriority,Rf=null,wi=null;function vD(e){if(wi&&typeof wi.onCommitFiberRoot=="function")try{wi.onCommitFiberRoot(Rf,e,void 0,(e.current.flags&128)===128)}catch{}}var ti=Math.clz32?Math.clz32:bD,yD=Math.log,xD=Math.LN2;function bD(e){return e>>>=0,e===0?32:31-(yD(e)/xD|0)|0}var ed=64,td=4194304;function ac(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function cp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=ac(l):(a&=s,a!==0&&(r=ac(a)))}else s=n&~i,s!==0?r=ac(s):a!==0&&(r=ac(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ti(t),i=1<<n,r|=e[n],t&=~i;return r}function jD(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wD(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-ti(a),l=1<<s,c=i[s];c===-1?(!(l&n)||l&r)&&(i[s]=jD(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Vg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function N2(){var e=ed;return ed<<=1,!(ed&4194240)&&(ed=64),e}function ym(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function du(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ti(t),e[t]=n}function SD(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-ti(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function rx(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ti(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var bt=0;function _2(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var M2,ix,R2,D2,L2,qg=!1,nd=[],Oa=null,Ia=null,Na=null,Oc=new Map,Ic=new Map,Sa=[],kD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function K1(e,t){switch(e){case"focusin":case"focusout":Oa=null;break;case"dragenter":case"dragleave":Ia=null;break;case"mouseover":case"mouseout":Na=null;break;case"pointerover":case"pointerout":Oc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ic.delete(t.pointerId)}}function Ll(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=fu(t),t!==null&&ix(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function CD(e,t,n,r,i){switch(t){case"focusin":return Oa=Ll(Oa,e,t,n,r,i),!0;case"dragenter":return Ia=Ll(Ia,e,t,n,r,i),!0;case"mouseover":return Na=Ll(Na,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Oc.set(a,Ll(Oc.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,Ic.set(a,Ll(Ic.get(a)||null,e,t,n,r,i)),!0}return!1}function z2(e){var t=jo(e.target);if(t!==null){var n=Jo(t);if(n!==null){if(t=n.tag,t===13){if(t=P2(n),t!==null){e.blockedOn=t,L2(e.priority,function(){R2(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Bd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ug=r,n.target.dispatchEvent(r),Ug=null}else return t=fu(n),t!==null&&ix(t),e.blockedOn=n,!1;t.shift()}return!0}function H1(e,t,n){Bd(e)&&n.delete(t)}function PD(){qg=!1,Oa!==null&&Bd(Oa)&&(Oa=null),Ia!==null&&Bd(Ia)&&(Ia=null),Na!==null&&Bd(Na)&&(Na=null),Oc.forEach(H1),Ic.forEach(H1)}function zl(e,t){e.blockedOn===t&&(e.blockedOn=null,qg||(qg=!0,br.unstable_scheduleCallback(br.unstable_NormalPriority,PD)))}function Nc(e){function t(i){return zl(i,e)}if(0<nd.length){zl(nd[0],e);for(var n=1;n<nd.length;n++){var r=nd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Oa!==null&&zl(Oa,e),Ia!==null&&zl(Ia,e),Na!==null&&zl(Na,e),Oc.forEach(t),Ic.forEach(t),n=0;n<Sa.length;n++)r=Sa[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Sa.length&&(n=Sa[0],n.blockedOn===null);)z2(n),n.blockedOn===null&&Sa.shift()}var Bs=ia.ReactCurrentBatchConfig,up=!0;function ED(e,t,n,r){var i=bt,a=Bs.transition;Bs.transition=null;try{bt=1,ax(e,t,n,r)}finally{bt=i,Bs.transition=a}}function TD(e,t,n,r){var i=bt,a=Bs.transition;Bs.transition=null;try{bt=4,ax(e,t,n,r)}finally{bt=i,Bs.transition=a}}function ax(e,t,n,r){if(up){var i=Yg(e,t,n,r);if(i===null)Tm(e,t,r,dp,n),K1(e,r);else if(CD(i,e,t,n,r))r.stopPropagation();else if(K1(e,r),t&4&&-1<kD.indexOf(e)){for(;i!==null;){var a=fu(i);if(a!==null&&M2(a),a=Yg(e,t,n,r),a===null&&Tm(e,t,r,dp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Tm(e,t,r,null,n)}}var dp=null;function Yg(e,t,n,r){if(dp=null,e=tx(r),e=jo(e),e!==null)if(t=Jo(e),t===null)e=null;else if(n=t.tag,n===13){if(e=P2(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return dp=e,null}function $2(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(mD()){case nx:return 1;case O2:return 4;case lp:case gD:return 16;case I2:return 536870912;default:return 16}default:return 16}}var Pa=null,ox=null,Fd=null;function B2(){if(Fd)return Fd;var e,t=ox,n=t.length,r,i="value"in Pa?Pa.value:Pa.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[a-r];r++);return Fd=i.slice(e,1<r?1-r:void 0)}function Ud(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 rd(){return!0}function V1(){return!1}function kr(e){function t(n,r,i,a,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?rd:V1,this.isPropagationStopped=V1,this}return Kt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=rd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=rd)},persist:function(){},isPersistent:rd}),t}var gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sx=kr(gl),pu=Kt({},gl,{view:0,detail:0}),AD=kr(pu),xm,bm,$l,Df=Kt({},pu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lx,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!==$l&&($l&&e.type==="mousemove"?(xm=e.screenX-$l.screenX,bm=e.screenY-$l.screenY):bm=xm=0,$l=e),xm)},movementY:function(e){return"movementY"in e?e.movementY:bm}}),q1=kr(Df),OD=Kt({},Df,{dataTransfer:0}),ID=kr(OD),ND=Kt({},pu,{relatedTarget:0}),jm=kr(ND),_D=Kt({},gl,{animationName:0,elapsedTime:0,pseudoElement:0}),MD=kr(_D),RD=Kt({},gl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),DD=kr(RD),LD=Kt({},gl,{data:0}),Y1=kr(LD),zD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$D={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"},BD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function FD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=BD[e])?!!t[e]:!1}function lx(){return FD}var UD=Kt({},pu,{key:function(e){if(e.key){var t=zD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ud(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$D[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lx,charCode:function(e){return e.type==="keypress"?Ud(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ud(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),WD=kr(UD),KD=Kt({},Df,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),G1=kr(KD),HD=Kt({},pu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lx}),VD=kr(HD),qD=Kt({},gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),YD=kr(qD),GD=Kt({},Df,{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}),XD=kr(GD),QD=[9,13,27,32],cx=Xi&&"CompositionEvent"in window,fc=null;Xi&&"documentMode"in document&&(fc=document.documentMode);var JD=Xi&&"TextEvent"in window&&!fc,F2=Xi&&(!cx||fc&&8<fc&&11>=fc),X1=" ",Q1=!1;function U2(e,t){switch(e){case"keyup":return QD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function W2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var js=!1;function ZD(e,t){switch(e){case"compositionend":return W2(t);case"keypress":return t.which!==32?null:(Q1=!0,X1);case"textInput":return e=t.data,e===X1&&Q1?null:e;default:return null}}function eL(e,t){if(js)return e==="compositionend"||!cx&&U2(e,t)?(e=B2(),Fd=ox=Pa=null,js=!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 F2&&t.locale!=="ko"?null:t.data;default:return null}}var tL={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 J1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tL[e.type]:t==="textarea"}function K2(e,t,n,r){j2(r),t=pp(t,"onChange"),0<t.length&&(n=new sx("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var hc=null,_c=null;function nL(e){tE(e,0)}function Lf(e){var t=ks(e);if(h2(t))return e}function rL(e,t){if(e==="change")return t}var H2=!1;if(Xi){var wm;if(Xi){var Sm="oninput"in document;if(!Sm){var Z1=document.createElement("div");Z1.setAttribute("oninput","return;"),Sm=typeof Z1.oninput=="function"}wm=Sm}else wm=!1;H2=wm&&(!document.documentMode||9<document.documentMode)}function ej(){hc&&(hc.detachEvent("onpropertychange",V2),_c=hc=null)}function V2(e){if(e.propertyName==="value"&&Lf(_c)){var t=[];K2(t,_c,e,tx(e)),C2(nL,t)}}function iL(e,t,n){e==="focusin"?(ej(),hc=t,_c=n,hc.attachEvent("onpropertychange",V2)):e==="focusout"&&ej()}function aL(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Lf(_c)}function oL(e,t){if(e==="click")return Lf(t)}function sL(e,t){if(e==="input"||e==="change")return Lf(t)}function lL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ri=typeof Object.is=="function"?Object.is:lL;function Mc(e,t){if(ri(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Og.call(t,i)||!ri(e[i],t[i]))return!1}return!0}function tj(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nj(e,t){var n=tj(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=tj(n)}}function q2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?q2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Y2(){for(var e=window,t=ap();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ap(e.document)}return t}function ux(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function cL(e){var t=Y2(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&q2(n.ownerDocument.documentElement,n)){if(r!==null&&ux(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=nj(n,a);var s=nj(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uL=Xi&&"documentMode"in document&&11>=document.documentMode,ws=null,Gg=null,mc=null,Xg=!1;function rj(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xg||ws==null||ws!==ap(r)||(r=ws,"selectionStart"in r&&ux(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),mc&&Mc(mc,r)||(mc=r,r=pp(Gg,"onSelect"),0<r.length&&(t=new sx("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ws)))}function id(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ss={animationend:id("Animation","AnimationEnd"),animationiteration:id("Animation","AnimationIteration"),animationstart:id("Animation","AnimationStart"),transitionend:id("Transition","TransitionEnd")},km={},G2={};Xi&&(G2=document.createElement("div").style,"AnimationEvent"in window||(delete Ss.animationend.animation,delete Ss.animationiteration.animation,delete Ss.animationstart.animation),"TransitionEvent"in window||delete Ss.transitionend.transition);function zf(e){if(km[e])return km[e];if(!Ss[e])return e;var t=Ss[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in G2)return km[e]=t[n];return e}var X2=zf("animationend"),Q2=zf("animationiteration"),J2=zf("animationstart"),Z2=zf("transitionend"),eE=new Map,ij="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function qa(e,t){eE.set(e,t),Qo(t,[e])}for(var Cm=0;Cm<ij.length;Cm++){var Pm=ij[Cm],dL=Pm.toLowerCase(),pL=Pm[0].toUpperCase()+Pm.slice(1);qa(dL,"on"+pL)}qa(X2,"onAnimationEnd");qa(Q2,"onAnimationIteration");qa(J2,"onAnimationStart");qa("dblclick","onDoubleClick");qa("focusin","onFocus");qa("focusout","onBlur");qa(Z2,"onTransitionEnd");Gs("onMouseEnter",["mouseout","mouseover"]);Gs("onMouseLeave",["mouseout","mouseover"]);Gs("onPointerEnter",["pointerout","pointerover"]);Gs("onPointerLeave",["pointerout","pointerover"]);Qo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Qo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Qo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Qo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Qo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Qo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oc="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(" "),fL=new Set("cancel close invalid load scroll toggle".split(" ").concat(oc));function aj(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,dD(r,t,void 0,e),e.currentTarget=null}function tE(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;aj(i,l,u),a=c}else for(s=0;s<r.length;s++){if(l=r[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;aj(i,l,u),a=c}}}if(sp)throw e=Hg,sp=!1,Hg=null,e}function It(e,t){var n=t[tv];n===void 0&&(n=t[tv]=new Set);var r=e+"__bubble";n.has(r)||(nE(t,e,2,!1),n.add(r))}function Em(e,t,n){var r=0;t&&(r|=4),nE(n,e,r,t)}var ad="_reactListening"+Math.random().toString(36).slice(2);function Rc(e){if(!e[ad]){e[ad]=!0,c2.forEach(function(n){n!=="selectionchange"&&(fL.has(n)||Em(n,!1,e),Em(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ad]||(t[ad]=!0,Em("selectionchange",!1,t))}}function nE(e,t,n,r){switch($2(t)){case 1:var i=ED;break;case 4:i=TD;break;default:i=ax}n=i.bind(null,t,n,e),i=void 0,!Kg||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Tm(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;l!==null;){if(s=jo(l),s===null)return;if(c=s.tag,c===5||c===6){r=a=s;continue e}l=l.parentNode}}r=r.return}C2(function(){var u=a,p=tx(n),d=[];e:{var h=eE.get(e);if(h!==void 0){var m=sx,g=e;switch(e){case"keypress":if(Ud(n)===0)break e;case"keydown":case"keyup":m=WD;break;case"focusin":g="focus",m=jm;break;case"focusout":g="blur",m=jm;break;case"beforeblur":case"afterblur":m=jm;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=q1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=ID;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=VD;break;case X2:case Q2:case J2:m=MD;break;case Z2:m=YD;break;case"scroll":m=AD;break;case"wheel":m=XD;break;case"copy":case"cut":case"paste":m=DD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=G1}var y=(t&4)!==0,x=!y&&e==="scroll",v=y?h!==null?h+"Capture":null:h;y=[];for(var b=u,j;b!==null;){j=b;var w=j.stateNode;if(j.tag===5&&w!==null&&(j=w,v!==null&&(w=Ac(b,v),w!=null&&y.push(Dc(b,w,j)))),x)break;b=b.return}0<y.length&&(h=new m(h,g,null,n,p),d.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Ug&&(g=n.relatedTarget||n.fromElement)&&(jo(g)||g[Qi]))break e;if((m||h)&&(h=p.window===p?p:(h=p.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?jo(g):null,g!==null&&(x=Jo(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(y=q1,w="onMouseLeave",v="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(y=G1,w="onPointerLeave",v="onPointerEnter",b="pointer"),x=m==null?h:ks(m),j=g==null?h:ks(g),h=new y(w,b+"leave",m,n,p),h.target=x,h.relatedTarget=j,w=null,jo(p)===u&&(y=new y(v,b+"enter",g,n,p),y.target=j,y.relatedTarget=x,w=y),x=w,m&&g)t:{for(y=m,v=g,b=0,j=y;j;j=os(j))b++;for(j=0,w=v;w;w=os(w))j++;for(;0<b-j;)y=os(y),b--;for(;0<j-b;)v=os(v),j--;for(;b--;){if(y===v||v!==null&&y===v.alternate)break t;y=os(y),v=os(v)}y=null}else y=null;m!==null&&oj(d,h,m,y,!1),g!==null&&x!==null&&oj(d,x,g,y,!0)}}e:{if(h=u?ks(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var k=rL;else if(J1(h))if(H2)k=sL;else{k=aL;var S=iL}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=oL);if(k&&(k=k(e,u))){K2(d,k,n,p);break e}S&&S(e,h,u),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&Lg(h,"number",h.value)}switch(S=u?ks(u):window,e){case"focusin":(J1(S)||S.contentEditable==="true")&&(ws=S,Gg=u,mc=null);break;case"focusout":mc=Gg=ws=null;break;case"mousedown":Xg=!0;break;case"contextmenu":case"mouseup":case"dragend":Xg=!1,rj(d,n,p);break;case"selectionchange":if(uL)break;case"keydown":case"keyup":rj(d,n,p)}var E;if(cx)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else js?U2(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(F2&&n.locale!=="ko"&&(js||A!=="onCompositionStart"?A==="onCompositionEnd"&&js&&(E=B2()):(Pa=p,ox="value"in Pa?Pa.value:Pa.textContent,js=!0)),S=pp(u,A),0<S.length&&(A=new Y1(A,e,null,n,p),d.push({event:A,listeners:S}),E?A.data=E:(E=W2(n),E!==null&&(A.data=E)))),(E=JD?ZD(e,n):eL(e,n))&&(u=pp(u,"onBeforeInput"),0<u.length&&(p=new Y1("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=E))}tE(d,t)})}function Dc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pp(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Ac(e,n),a!=null&&r.unshift(Dc(e,a,i)),a=Ac(e,t),a!=null&&r.push(Dc(e,a,i))),e=e.return}return r}function os(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function oj(e,t,n,r,i){for(var a=t._reactName,s=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,i?(c=Ac(n,a),c!=null&&s.unshift(Dc(n,c,l))):i||(c=Ac(n,a),c!=null&&s.push(Dc(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var hL=/\r\n?/g,mL=/\u0000|\uFFFD/g;function sj(e){return(typeof e=="string"?e:""+e).replace(hL,`
|
|
38
|
-
`).replace(mL,"")}function od(e,t,n){if(t=sj(t),sj(e)!==t&&n)throw Error(ye(425))}function fp(){}var Qg=null,Jg=null;function Zg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ev=typeof setTimeout=="function"?setTimeout:void 0,gL=typeof clearTimeout=="function"?clearTimeout:void 0,lj=typeof Promise=="function"?Promise:void 0,vL=typeof queueMicrotask=="function"?queueMicrotask:typeof lj<"u"?function(e){return lj.resolve(null).then(e).catch(yL)}:ev;function yL(e){setTimeout(function(){throw e})}function Am(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Nc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Nc(t)}function _a(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function cj(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var vl=Math.random().toString(36).slice(2),yi="__reactFiber$"+vl,Lc="__reactProps$"+vl,Qi="__reactContainer$"+vl,tv="__reactEvents$"+vl,xL="__reactListeners$"+vl,bL="__reactHandles$"+vl;function jo(e){var t=e[yi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qi]||n[yi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=cj(e);e!==null;){if(n=e[yi])return n;e=cj(e)}return t}e=n,n=e.parentNode}return null}function fu(e){return e=e[yi]||e[Qi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ks(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ye(33))}function $f(e){return e[Lc]||null}var nv=[],Cs=-1;function Ya(e){return{current:e}}function Mt(e){0>Cs||(e.current=nv[Cs],nv[Cs]=null,Cs--)}function Tt(e,t){Cs++,nv[Cs]=e.current,e.current=t}var Ua={},Bn=Ya(Ua),or=Ya(!1),Lo=Ua;function Xs(e,t){var n=e.type.contextTypes;if(!n)return Ua;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function sr(e){return e=e.childContextTypes,e!=null}function hp(){Mt(or),Mt(Bn)}function uj(e,t,n){if(Bn.current!==Ua)throw Error(ye(168));Tt(Bn,t),Tt(or,n)}function rE(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ye(108,iD(e)||"Unknown",i));return Kt({},n,r)}function mp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ua,Lo=Bn.current,Tt(Bn,e),Tt(or,or.current),!0}function dj(e,t,n){var r=e.stateNode;if(!r)throw Error(ye(169));n?(e=rE(e,t,Lo),r.__reactInternalMemoizedMergedChildContext=e,Mt(or),Mt(Bn),Tt(Bn,e)):Mt(or),Tt(or,n)}var Bi=null,Bf=!1,Om=!1;function iE(e){Bi===null?Bi=[e]:Bi.push(e)}function jL(e){Bf=!0,iE(e)}function Ga(){if(!Om&&Bi!==null){Om=!0;var e=0,t=bt;try{var n=Bi;for(bt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Bi=null,Bf=!1}catch(i){throw Bi!==null&&(Bi=Bi.slice(e+1)),A2(nx,Ga),i}finally{bt=t,Om=!1}}return null}var Ps=[],Es=0,gp=null,vp=0,Ir=[],Nr=0,zo=null,Wi=1,Ki="";function mo(e,t){Ps[Es++]=vp,Ps[Es++]=gp,gp=e,vp=t}function aE(e,t,n){Ir[Nr++]=Wi,Ir[Nr++]=Ki,Ir[Nr++]=zo,zo=e;var r=Wi;e=Ki;var i=32-ti(r)-1;r&=~(1<<i),n+=1;var a=32-ti(t)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Wi=1<<32-ti(t)+i|n<<i|r,Ki=a+e}else Wi=1<<a|n<<i|r,Ki=e}function dx(e){e.return!==null&&(mo(e,1),aE(e,1,0))}function px(e){for(;e===gp;)gp=Ps[--Es],Ps[Es]=null,vp=Ps[--Es],Ps[Es]=null;for(;e===zo;)zo=Ir[--Nr],Ir[Nr]=null,Ki=Ir[--Nr],Ir[Nr]=null,Wi=Ir[--Nr],Ir[Nr]=null}var yr=null,mr=null,zt=!1,Qr=null;function oE(e,t){var n=Mr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function pj(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,yr=e,mr=_a(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,yr=e,mr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=zo!==null?{id:Wi,overflow:Ki}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Mr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,yr=e,mr=null,!0):!1;default:return!1}}function rv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function iv(e){if(zt){var t=mr;if(t){var n=t;if(!pj(e,t)){if(rv(e))throw Error(ye(418));t=_a(n.nextSibling);var r=yr;t&&pj(e,t)?oE(r,n):(e.flags=e.flags&-4097|2,zt=!1,yr=e)}}else{if(rv(e))throw Error(ye(418));e.flags=e.flags&-4097|2,zt=!1,yr=e}}}function fj(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;yr=e}function sd(e){if(e!==yr)return!1;if(!zt)return fj(e),zt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Zg(e.type,e.memoizedProps)),t&&(t=mr)){if(rv(e))throw sE(),Error(ye(418));for(;t;)oE(e,t),t=_a(t.nextSibling)}if(fj(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ye(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){mr=_a(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}mr=null}}else mr=yr?_a(e.stateNode.nextSibling):null;return!0}function sE(){for(var e=mr;e;)e=_a(e.nextSibling)}function Qs(){mr=yr=null,zt=!1}function fx(e){Qr===null?Qr=[e]:Qr.push(e)}var wL=ia.ReactCurrentBatchConfig;function Bl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ye(309));var r=n.stateNode}if(!r)throw Error(ye(147,e));var i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(s){var l=i.refs;s===null?delete l[a]:l[a]=s},t._stringRef=a,t)}if(typeof e!="string")throw Error(ye(284));if(!n._owner)throw Error(ye(290,e))}return e}function ld(e,t){throw e=Object.prototype.toString.call(t),Error(ye(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function hj(e){var t=e._init;return t(e._payload)}function lE(e){function t(v,b){if(e){var j=v.deletions;j===null?(v.deletions=[b],v.flags|=16):j.push(b)}}function n(v,b){if(!e)return null;for(;b!==null;)t(v,b),b=b.sibling;return null}function r(v,b){for(v=new Map;b!==null;)b.key!==null?v.set(b.key,b):v.set(b.index,b),b=b.sibling;return v}function i(v,b){return v=La(v,b),v.index=0,v.sibling=null,v}function a(v,b,j){return v.index=j,e?(j=v.alternate,j!==null?(j=j.index,j<b?(v.flags|=2,b):j):(v.flags|=2,b)):(v.flags|=1048576,b)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,b,j,w){return b===null||b.tag!==6?(b=Lm(j,v.mode,w),b.return=v,b):(b=i(b,j),b.return=v,b)}function c(v,b,j,w){var k=j.type;return k===bs?p(v,b,j.props.children,w,j.key):b!==null&&(b.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===xa&&hj(k)===b.type)?(w=i(b,j.props),w.ref=Bl(v,b,j),w.return=v,w):(w=Gd(j.type,j.key,j.props,null,v.mode,w),w.ref=Bl(v,b,j),w.return=v,w)}function u(v,b,j,w){return b===null||b.tag!==4||b.stateNode.containerInfo!==j.containerInfo||b.stateNode.implementation!==j.implementation?(b=zm(j,v.mode,w),b.return=v,b):(b=i(b,j.children||[]),b.return=v,b)}function p(v,b,j,w,k){return b===null||b.tag!==7?(b=Io(j,v.mode,w,k),b.return=v,b):(b=i(b,j),b.return=v,b)}function d(v,b,j){if(typeof b=="string"&&b!==""||typeof b=="number")return b=Lm(""+b,v.mode,j),b.return=v,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Qu:return j=Gd(b.type,b.key,b.props,null,v.mode,j),j.ref=Bl(v,null,b),j.return=v,j;case xs:return b=zm(b,v.mode,j),b.return=v,b;case xa:var w=b._init;return d(v,w(b._payload),j)}if(ic(b)||Rl(b))return b=Io(b,v.mode,j,null),b.return=v,b;ld(v,b)}return null}function h(v,b,j,w){var k=b!==null?b.key:null;if(typeof j=="string"&&j!==""||typeof j=="number")return k!==null?null:l(v,b,""+j,w);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Qu:return j.key===k?c(v,b,j,w):null;case xs:return j.key===k?u(v,b,j,w):null;case xa:return k=j._init,h(v,b,k(j._payload),w)}if(ic(j)||Rl(j))return k!==null?null:p(v,b,j,w,null);ld(v,j)}return null}function m(v,b,j,w,k){if(typeof w=="string"&&w!==""||typeof w=="number")return v=v.get(j)||null,l(b,v,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Qu:return v=v.get(w.key===null?j:w.key)||null,c(b,v,w,k);case xs:return v=v.get(w.key===null?j:w.key)||null,u(b,v,w,k);case xa:var S=w._init;return m(v,b,j,S(w._payload),k)}if(ic(w)||Rl(w))return v=v.get(j)||null,p(b,v,w,k,null);ld(b,w)}return null}function g(v,b,j,w){for(var k=null,S=null,E=b,A=b=0,D=null;E!==null&&A<j.length;A++){E.index>A?(D=E,E=null):D=E.sibling;var T=h(v,E,j[A],w);if(T===null){E===null&&(E=D);break}e&&E&&T.alternate===null&&t(v,E),b=a(T,b,A),S===null?k=T:S.sibling=T,S=T,E=D}if(A===j.length)return n(v,E),zt&&mo(v,A),k;if(E===null){for(;A<j.length;A++)E=d(v,j[A],w),E!==null&&(b=a(E,b,A),S===null?k=E:S.sibling=E,S=E);return zt&&mo(v,A),k}for(E=r(v,E);A<j.length;A++)D=m(E,v,A,j[A],w),D!==null&&(e&&D.alternate!==null&&E.delete(D.key===null?A:D.key),b=a(D,b,A),S===null?k=D:S.sibling=D,S=D);return e&&E.forEach(function(I){return t(v,I)}),zt&&mo(v,A),k}function y(v,b,j,w){var k=Rl(j);if(typeof k!="function")throw Error(ye(150));if(j=k.call(j),j==null)throw Error(ye(151));for(var S=k=null,E=b,A=b=0,D=null,T=j.next();E!==null&&!T.done;A++,T=j.next()){E.index>A?(D=E,E=null):D=E.sibling;var I=h(v,E,T.value,w);if(I===null){E===null&&(E=D);break}e&&E&&I.alternate===null&&t(v,E),b=a(I,b,A),S===null?k=I:S.sibling=I,S=I,E=D}if(T.done)return n(v,E),zt&&mo(v,A),k;if(E===null){for(;!T.done;A++,T=j.next())T=d(v,T.value,w),T!==null&&(b=a(T,b,A),S===null?k=T:S.sibling=T,S=T);return zt&&mo(v,A),k}for(E=r(v,E);!T.done;A++,T=j.next())T=m(E,v,A,T.value,w),T!==null&&(e&&T.alternate!==null&&E.delete(T.key===null?A:T.key),b=a(T,b,A),S===null?k=T:S.sibling=T,S=T);return e&&E.forEach(function(_){return t(v,_)}),zt&&mo(v,A),k}function x(v,b,j,w){if(typeof j=="object"&&j!==null&&j.type===bs&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case Qu:e:{for(var k=j.key,S=b;S!==null;){if(S.key===k){if(k=j.type,k===bs){if(S.tag===7){n(v,S.sibling),b=i(S,j.props.children),b.return=v,v=b;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===xa&&hj(k)===S.type){n(v,S.sibling),b=i(S,j.props),b.ref=Bl(v,S,j),b.return=v,v=b;break e}n(v,S);break}else t(v,S);S=S.sibling}j.type===bs?(b=Io(j.props.children,v.mode,w,j.key),b.return=v,v=b):(w=Gd(j.type,j.key,j.props,null,v.mode,w),w.ref=Bl(v,b,j),w.return=v,v=w)}return s(v);case xs:e:{for(S=j.key;b!==null;){if(b.key===S)if(b.tag===4&&b.stateNode.containerInfo===j.containerInfo&&b.stateNode.implementation===j.implementation){n(v,b.sibling),b=i(b,j.children||[]),b.return=v,v=b;break e}else{n(v,b);break}else t(v,b);b=b.sibling}b=zm(j,v.mode,w),b.return=v,v=b}return s(v);case xa:return S=j._init,x(v,b,S(j._payload),w)}if(ic(j))return g(v,b,j,w);if(Rl(j))return y(v,b,j,w);ld(v,j)}return typeof j=="string"&&j!==""||typeof j=="number"?(j=""+j,b!==null&&b.tag===6?(n(v,b.sibling),b=i(b,j),b.return=v,v=b):(n(v,b),b=Lm(j,v.mode,w),b.return=v,v=b),s(v)):n(v,b)}return x}var Js=lE(!0),cE=lE(!1),yp=Ya(null),xp=null,Ts=null,hx=null;function mx(){hx=Ts=xp=null}function gx(e){var t=yp.current;Mt(yp),e._currentValue=t}function av(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Fs(e,t){xp=e,hx=Ts=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rr=!0),e.firstContext=null)}function zr(e){var t=e._currentValue;if(hx!==e)if(e={context:e,memoizedValue:t,next:null},Ts===null){if(xp===null)throw Error(ye(308));Ts=e,xp.dependencies={lanes:0,firstContext:e}}else Ts=Ts.next=e;return t}var wo=null;function vx(e){wo===null?wo=[e]:wo.push(e)}function uE(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,vx(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ji(e,r)}function Ji(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ba=!1;function yx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dE(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function qi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ma(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ut&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ji(e,n)}return i=r.interleaved,i===null?(t.next=t,vx(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ji(e,n)}function Wd(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rx(e,n)}}function mj(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function bp(e,t,n,r){var i=e.updateQueue;ba=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?a=u:s.next=u,s=c;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==s&&(l===null?p.firstBaseUpdate=u:l.next=u,p.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;s=0,p=u=c=null,l=a;do{var h=l.lane,m=l.eventTime;if((r&h)===h){p!==null&&(p=p.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,y=l;switch(h=t,m=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){d=g.call(m,d,h);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,h=typeof g=="function"?g.call(m,d,h):g,h==null)break e;d=Kt({},d,h);break e;case 2:ba=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(u=p=m,c=d):p=p.next=m,s|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(p===null&&(c=d),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Bo|=s,e.lanes=s,e.memoizedState=d}}function gj(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ye(191,i));i.call(r)}}}var hu={},Si=Ya(hu),zc=Ya(hu),$c=Ya(hu);function So(e){if(e===hu)throw Error(ye(174));return e}function xx(e,t){switch(Tt($c,t),Tt(zc,e),Tt(Si,hu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:$g(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=$g(t,e)}Mt(Si),Tt(Si,t)}function Zs(){Mt(Si),Mt(zc),Mt($c)}function pE(e){So($c.current);var t=So(Si.current),n=$g(t,e.type);t!==n&&(Tt(zc,e),Tt(Si,n))}function bx(e){zc.current===e&&(Mt(Si),Mt(zc))}var Ft=Ya(0);function jp(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Im=[];function jx(){for(var e=0;e<Im.length;e++)Im[e]._workInProgressVersionPrimary=null;Im.length=0}var Kd=ia.ReactCurrentDispatcher,Nm=ia.ReactCurrentBatchConfig,$o=0,Ut=null,un=null,yn=null,wp=!1,gc=!1,Bc=0,SL=0;function _n(){throw Error(ye(321))}function wx(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ri(e[n],t[n]))return!1;return!0}function Sx(e,t,n,r,i,a){if($o=a,Ut=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Kd.current=e===null||e.memoizedState===null?EL:TL,e=n(r,i),gc){a=0;do{if(gc=!1,Bc=0,25<=a)throw Error(ye(301));a+=1,yn=un=null,t.updateQueue=null,Kd.current=AL,e=n(r,i)}while(gc)}if(Kd.current=Sp,t=un!==null&&un.next!==null,$o=0,yn=un=Ut=null,wp=!1,t)throw Error(ye(300));return e}function kx(){var e=Bc!==0;return Bc=0,e}function mi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yn===null?Ut.memoizedState=yn=e:yn=yn.next=e,yn}function $r(){if(un===null){var e=Ut.alternate;e=e!==null?e.memoizedState:null}else e=un.next;var t=yn===null?Ut.memoizedState:yn.next;if(t!==null)yn=t,un=e;else{if(e===null)throw Error(ye(310));un=e,e={memoizedState:un.memoizedState,baseState:un.baseState,baseQueue:un.baseQueue,queue:un.queue,next:null},yn===null?Ut.memoizedState=yn=e:yn=yn.next=e}return yn}function Fc(e,t){return typeof t=="function"?t(e):t}function _m(e){var t=$r(),n=t.queue;if(n===null)throw Error(ye(311));n.lastRenderedReducer=e;var r=un,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var l=s=null,c=null,u=a;do{var p=u.lane;if(($o&p)===p)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:p,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,s=r):c=c.next=d,Ut.lanes|=p,Bo|=p}u=u.next}while(u!==null&&u!==a);c===null?s=r:c.next=l,ri(r,t.memoizedState)||(rr=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,Ut.lanes|=a,Bo|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Mm(e){var t=$r(),n=t.queue;if(n===null)throw Error(ye(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);ri(a,t.memoizedState)||(rr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function fE(){}function hE(e,t){var n=Ut,r=$r(),i=t(),a=!ri(r.memoizedState,i);if(a&&(r.memoizedState=i,rr=!0),r=r.queue,Cx(vE.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||yn!==null&&yn.memoizedState.tag&1){if(n.flags|=2048,Uc(9,gE.bind(null,n,r,i,t),void 0,null),bn===null)throw Error(ye(349));$o&30||mE(n,t,i)}return i}function mE(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ut.updateQueue,t===null?(t={lastEffect:null,stores:null},Ut.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gE(e,t,n,r){t.value=n,t.getSnapshot=r,yE(t)&&xE(e)}function vE(e,t,n){return n(function(){yE(t)&&xE(e)})}function yE(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ri(e,n)}catch{return!0}}function xE(e){var t=Ji(e,1);t!==null&&ni(t,e,1,-1)}function vj(e){var t=mi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fc,lastRenderedState:e},t.queue=e,e=e.dispatch=PL.bind(null,Ut,e),[t.memoizedState,e]}function Uc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ut.updateQueue,t===null?(t={lastEffect:null,stores:null},Ut.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function bE(){return $r().memoizedState}function Hd(e,t,n,r){var i=mi();Ut.flags|=e,i.memoizedState=Uc(1|t,n,void 0,r===void 0?null:r)}function Ff(e,t,n,r){var i=$r();r=r===void 0?null:r;var a=void 0;if(un!==null){var s=un.memoizedState;if(a=s.destroy,r!==null&&wx(r,s.deps)){i.memoizedState=Uc(t,n,a,r);return}}Ut.flags|=e,i.memoizedState=Uc(1|t,n,a,r)}function yj(e,t){return Hd(8390656,8,e,t)}function Cx(e,t){return Ff(2048,8,e,t)}function jE(e,t){return Ff(4,2,e,t)}function wE(e,t){return Ff(4,4,e,t)}function SE(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kE(e,t,n){return n=n!=null?n.concat([e]):null,Ff(4,4,SE.bind(null,t,e),n)}function Px(){}function CE(e,t){var n=$r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wx(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function PE(e,t){var n=$r();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&wx(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function EE(e,t,n){return $o&21?(ri(n,t)||(n=N2(),Ut.lanes|=n,Bo|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,rr=!0),e.memoizedState=n)}function kL(e,t){var n=bt;bt=n!==0&&4>n?n:4,e(!0);var r=Nm.transition;Nm.transition={};try{e(!1),t()}finally{bt=n,Nm.transition=r}}function TE(){return $r().memoizedState}function CL(e,t,n){var r=Da(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},AE(e))OE(t,n);else if(n=uE(e,t,n,r),n!==null){var i=Gn();ni(n,e,r,i),IE(n,t,r)}}function PL(e,t,n){var r=Da(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(AE(e))OE(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,l=a(s,n);if(i.hasEagerState=!0,i.eagerState=l,ri(l,s)){var c=t.interleaved;c===null?(i.next=i,vx(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=uE(e,t,i,r),n!==null&&(i=Gn(),ni(n,e,r,i),IE(n,t,r))}}function AE(e){var t=e.alternate;return e===Ut||t!==null&&t===Ut}function OE(e,t){gc=wp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function IE(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rx(e,n)}}var Sp={readContext:zr,useCallback:_n,useContext:_n,useEffect:_n,useImperativeHandle:_n,useInsertionEffect:_n,useLayoutEffect:_n,useMemo:_n,useReducer:_n,useRef:_n,useState:_n,useDebugValue:_n,useDeferredValue:_n,useTransition:_n,useMutableSource:_n,useSyncExternalStore:_n,useId:_n,unstable_isNewReconciler:!1},EL={readContext:zr,useCallback:function(e,t){return mi().memoizedState=[e,t===void 0?null:t],e},useContext:zr,useEffect:yj,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Hd(4194308,4,SE.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Hd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Hd(4,2,e,t)},useMemo:function(e,t){var n=mi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=CL.bind(null,Ut,e),[r.memoizedState,e]},useRef:function(e){var t=mi();return e={current:e},t.memoizedState=e},useState:vj,useDebugValue:Px,useDeferredValue:function(e){return mi().memoizedState=e},useTransition:function(){var e=vj(!1),t=e[0];return e=kL.bind(null,e[1]),mi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ut,i=mi();if(zt){if(n===void 0)throw Error(ye(407));n=n()}else{if(n=t(),bn===null)throw Error(ye(349));$o&30||mE(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,yj(vE.bind(null,r,a,e),[e]),r.flags|=2048,Uc(9,gE.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=mi(),t=bn.identifierPrefix;if(zt){var n=Ki,r=Wi;n=(r&~(1<<32-ti(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Bc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=SL++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},TL={readContext:zr,useCallback:CE,useContext:zr,useEffect:Cx,useImperativeHandle:kE,useInsertionEffect:jE,useLayoutEffect:wE,useMemo:PE,useReducer:_m,useRef:bE,useState:function(){return _m(Fc)},useDebugValue:Px,useDeferredValue:function(e){var t=$r();return EE(t,un.memoizedState,e)},useTransition:function(){var e=_m(Fc)[0],t=$r().memoizedState;return[e,t]},useMutableSource:fE,useSyncExternalStore:hE,useId:TE,unstable_isNewReconciler:!1},AL={readContext:zr,useCallback:CE,useContext:zr,useEffect:Cx,useImperativeHandle:kE,useInsertionEffect:jE,useLayoutEffect:wE,useMemo:PE,useReducer:Mm,useRef:bE,useState:function(){return Mm(Fc)},useDebugValue:Px,useDeferredValue:function(e){var t=$r();return un===null?t.memoizedState=e:EE(t,un.memoizedState,e)},useTransition:function(){var e=Mm(Fc)[0],t=$r().memoizedState;return[e,t]},useMutableSource:fE,useSyncExternalStore:hE,useId:TE,unstable_isNewReconciler:!1};function Yr(e,t){if(e&&e.defaultProps){t=Kt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ov(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Kt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Uf={isMounted:function(e){return(e=e._reactInternals)?Jo(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Gn(),i=Da(e),a=qi(r,i);a.payload=t,n!=null&&(a.callback=n),t=Ma(e,a,i),t!==null&&(ni(t,e,i,r),Wd(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Gn(),i=Da(e),a=qi(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Ma(e,a,i),t!==null&&(ni(t,e,i,r),Wd(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Gn(),r=Da(e),i=qi(n,r);i.tag=2,t!=null&&(i.callback=t),t=Ma(e,i,r),t!==null&&(ni(t,e,r,n),Wd(t,e,r))}};function xj(e,t,n,r,i,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,s):t.prototype&&t.prototype.isPureReactComponent?!Mc(n,r)||!Mc(i,a):!0}function NE(e,t,n){var r=!1,i=Ua,a=t.contextType;return typeof a=="object"&&a!==null?a=zr(a):(i=sr(t)?Lo:Bn.current,r=t.contextTypes,a=(r=r!=null)?Xs(e,i):Ua),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Uf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function bj(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Uf.enqueueReplaceState(t,t.state,null)}function sv(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},yx(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=zr(a):(a=sr(t)?Lo:Bn.current,i.context=Xs(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(ov(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Uf.enqueueReplaceState(i,i.state,null),bp(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function el(e,t){try{var n="",r=t;do n+=rD(r),r=r.return;while(r);var i=n}catch(a){i=`
|
|
39
|
-
Error generating stack: `+a.message+`
|
|
40
|
-
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Rm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function lv(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var OL=typeof WeakMap=="function"?WeakMap:Map;function _E(e,t,n){n=qi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Cp||(Cp=!0,yv=r),lv(e,t)},n}function ME(e,t,n){n=qi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){lv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){lv(e,t),typeof r!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function jj(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new OL;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=KL.bind(null,e,t,n),t.then(e,e))}function wj(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Sj(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=qi(-1,1),t.tag=2,Ma(n,t,1))),n.lanes|=1),e)}var IL=ia.ReactCurrentOwner,rr=!1;function Vn(e,t,n,r){t.child=e===null?cE(t,null,n,r):Js(t,e.child,n,r)}function kj(e,t,n,r,i){n=n.render;var a=t.ref;return Fs(t,i),r=Sx(e,t,n,r,a,i),n=kx(),e!==null&&!rr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Zi(e,t,i)):(zt&&n&&dx(t),t.flags|=1,Vn(e,t,r,i),t.child)}function Cj(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!Mx(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,RE(e,t,a,r,i)):(e=Gd(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:Mc,n(s,r)&&e.ref===t.ref)return Zi(e,t,i)}return t.flags|=1,e=La(a,r),e.ref=t.ref,e.return=t,t.child=e}function RE(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Mc(a,r)&&e.ref===t.ref)if(rr=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(rr=!0);else return t.lanes=e.lanes,Zi(e,t,i)}return cv(e,t,n,r,i)}function DE(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(Os,fr),fr|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Tt(Os,fr),fr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Tt(Os,fr),fr|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Tt(Os,fr),fr|=r;return Vn(e,t,i,n),t.child}function LE(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function cv(e,t,n,r,i){var a=sr(n)?Lo:Bn.current;return a=Xs(t,a),Fs(t,i),n=Sx(e,t,n,r,a,i),r=kx(),e!==null&&!rr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Zi(e,t,i)):(zt&&r&&dx(t),t.flags|=1,Vn(e,t,n,i),t.child)}function Pj(e,t,n,r,i){if(sr(n)){var a=!0;mp(t)}else a=!1;if(Fs(t,i),t.stateNode===null)Vd(e,t),NE(t,n,r),sv(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=zr(u):(u=sr(n)?Lo:Bn.current,u=Xs(t,u));var p=n.getDerivedStateFromProps,d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||c!==u)&&bj(t,s,r,u),ba=!1;var h=t.memoizedState;s.state=h,bp(t,r,s,i),c=t.memoizedState,l!==r||h!==c||or.current||ba?(typeof p=="function"&&(ov(t,n,p,r),c=t.memoizedState),(l=ba||xj(t,n,l,r,h,c,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,dE(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Yr(t.type,l),s.props=u,d=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=zr(c):(c=sr(n)?Lo:Bn.current,c=Xs(t,c));var m=n.getDerivedStateFromProps;(p=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||h!==c)&&bj(t,s,r,c),ba=!1,h=t.memoizedState,s.state=h,bp(t,r,s,i);var g=t.memoizedState;l!==d||h!==g||or.current||ba?(typeof m=="function"&&(ov(t,n,m,r),g=t.memoizedState),(u=ba||xj(t,n,u,r,h,g,c)||!1)?(p||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return uv(e,t,n,r,a,i)}function uv(e,t,n,r,i,a){LE(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&dj(t,n,!1),Zi(e,t,a);r=t.stateNode,IL.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Js(t,e.child,null,a),t.child=Js(t,null,l,a)):Vn(e,t,l,a),t.memoizedState=r.state,i&&dj(t,n,!0),t.child}function zE(e){var t=e.stateNode;t.pendingContext?uj(e,t.pendingContext,t.pendingContext!==t.context):t.context&&uj(e,t.context,!1),xx(e,t.containerInfo)}function Ej(e,t,n,r,i){return Qs(),fx(i),t.flags|=256,Vn(e,t,n,r),t.child}var dv={dehydrated:null,treeContext:null,retryLane:0};function pv(e){return{baseLanes:e,cachePool:null,transitions:null}}function $E(e,t,n){var r=t.pendingProps,i=Ft.current,a=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Tt(Ft,i&1),e===null)return iv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,a?(r=t.mode,a=t.child,s={mode:"hidden",children:s},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=Hf(s,r,0,null),e=Io(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=pv(n),t.memoizedState=dv,e):Ex(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return NL(e,t,s,r,l,i,n);if(a){a=r.fallback,s=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=La(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=La(l,a):(a=Io(a,s,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,s=e.child.memoizedState,s=s===null?pv(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=dv,r}return a=e.child,e=a.sibling,r=La(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ex(e,t){return t=Hf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function cd(e,t,n,r){return r!==null&&fx(r),Js(t,e.child,null,n),e=Ex(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function NL(e,t,n,r,i,a,s){if(n)return t.flags&256?(t.flags&=-257,r=Rm(Error(ye(422))),cd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Hf({mode:"visible",children:r.children},i,0,null),a=Io(a,i,s,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&Js(t,e.child,null,s),t.child.memoizedState=pv(s),t.memoizedState=dv,a);if(!(t.mode&1))return cd(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(ye(419)),r=Rm(a,r,void 0),cd(e,t,s,r)}if(l=(s&e.childLanes)!==0,rr||l){if(r=bn,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,Ji(e,i),ni(r,e,i,-1))}return _x(),r=Rm(Error(ye(421))),cd(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=HL.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,mr=_a(i.nextSibling),yr=t,zt=!0,Qr=null,e!==null&&(Ir[Nr++]=Wi,Ir[Nr++]=Ki,Ir[Nr++]=zo,Wi=e.id,Ki=e.overflow,zo=t),t=Ex(t,r.children),t.flags|=4096,t)}function Tj(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),av(e.return,t,n)}function Dm(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function BE(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Vn(e,t,r.children,n),r=Ft.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tj(e,n,t);else if(e.tag===19)Tj(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Tt(Ft,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&jp(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Dm(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&jp(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Dm(t,!0,n,null,a);break;case"together":Dm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Bo|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ye(153));if(t.child!==null){for(e=t.child,n=La(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=La(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function _L(e,t,n){switch(t.tag){case 3:zE(t),Qs();break;case 5:pE(t);break;case 1:sr(t.type)&&mp(t);break;case 4:xx(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Tt(yp,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Tt(Ft,Ft.current&1),t.flags|=128,null):n&t.child.childLanes?$E(e,t,n):(Tt(Ft,Ft.current&1),e=Zi(e,t,n),e!==null?e.sibling:null);Tt(Ft,Ft.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return BE(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Tt(Ft,Ft.current),r)break;return null;case 22:case 23:return t.lanes=0,DE(e,t,n)}return Zi(e,t,n)}var FE,fv,UE,WE;FE=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};fv=function(){};UE=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,So(Si.current);var a=null;switch(n){case"input":i=Rg(e,i),r=Rg(e,r),a=[];break;case"select":i=Kt({},i,{value:void 0}),r=Kt({},r,{value:void 0}),a=[];break;case"textarea":i=zg(e,i),r=zg(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=fp)}Bg(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ec.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(l=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ec.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&It("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};WE=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fl(e,t){if(!zt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ML(e,t,n){var r=t.pendingProps;switch(px(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mn(t),null;case 1:return sr(t.type)&&hp(),Mn(t),null;case 3:return r=t.stateNode,Zs(),Mt(or),Mt(Bn),jx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(sd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Qr!==null&&(jv(Qr),Qr=null))),fv(e,t),Mn(t),null;case 5:bx(t);var i=So($c.current);if(n=t.type,e!==null&&t.stateNode!=null)UE(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ye(166));return Mn(t),null}if(e=So(Si.current),sd(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[yi]=t,r[Lc]=a,e=(t.mode&1)!==0,n){case"dialog":It("cancel",r),It("close",r);break;case"iframe":case"object":case"embed":It("load",r);break;case"video":case"audio":for(i=0;i<oc.length;i++)It(oc[i],r);break;case"source":It("error",r);break;case"img":case"image":case"link":It("error",r),It("load",r);break;case"details":It("toggle",r);break;case"input":L1(r,a),It("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},It("invalid",r);break;case"textarea":$1(r,a),It("invalid",r)}Bg(n,a),i=null;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="children"?typeof l=="string"?r.textContent!==l&&(a.suppressHydrationWarning!==!0&&od(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&od(r.textContent,l,e),i=["children",""+l]):Ec.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&It("scroll",r)}switch(n){case"input":Ju(r),z1(r,a,!0);break;case"textarea":Ju(r),B1(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=fp)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=v2(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[yi]=t,e[Lc]=r,FE(e,t,!1,!1),t.stateNode=e;e:{switch(s=Fg(n,r),n){case"dialog":It("cancel",e),It("close",e),i=r;break;case"iframe":case"object":case"embed":It("load",e),i=r;break;case"video":case"audio":for(i=0;i<oc.length;i++)It(oc[i],e);i=r;break;case"source":It("error",e),i=r;break;case"img":case"image":case"link":It("error",e),It("load",e),i=r;break;case"details":It("toggle",e),i=r;break;case"input":L1(e,r),i=Rg(e,r),It("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Kt({},r,{value:void 0}),It("invalid",e);break;case"textarea":$1(e,r),i=zg(e,r),It("invalid",e);break;default:i=r}Bg(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?b2(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&y2(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Tc(e,c):typeof c=="number"&&Tc(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ec.hasOwnProperty(a)?c!=null&&a==="onScroll"&&It("scroll",e):c!=null&&Qy(e,a,c,s))}switch(n){case"input":Ju(e),z1(e,r,!1);break;case"textarea":Ju(e),B1(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Fa(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?Ls(e,!!r.multiple,a,!1):r.defaultValue!=null&&Ls(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=fp)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Mn(t),null;case 6:if(e&&t.stateNode!=null)WE(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ye(166));if(n=So($c.current),So(Si.current),sd(t)){if(r=t.stateNode,n=t.memoizedProps,r[yi]=t,(a=r.nodeValue!==n)&&(e=yr,e!==null))switch(e.tag){case 3:od(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&od(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[yi]=t,t.stateNode=r}return Mn(t),null;case 13:if(Mt(Ft),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(zt&&mr!==null&&t.mode&1&&!(t.flags&128))sE(),Qs(),t.flags|=98560,a=!1;else if(a=sd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(ye(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ye(317));a[yi]=t}else Qs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Mn(t),a=!1}else Qr!==null&&(jv(Qr),Qr=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ft.current&1?pn===0&&(pn=3):_x())),t.updateQueue!==null&&(t.flags|=4),Mn(t),null);case 4:return Zs(),fv(e,t),e===null&&Rc(t.stateNode.containerInfo),Mn(t),null;case 10:return gx(t.type._context),Mn(t),null;case 17:return sr(t.type)&&hp(),Mn(t),null;case 19:if(Mt(Ft),a=t.memoizedState,a===null)return Mn(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)Fl(a,!1);else{if(pn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=jp(e),s!==null){for(t.flags|=128,Fl(a,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,s=a.alternate,s===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,e=s.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Tt(Ft,Ft.current&1|2),t.child}e=e.sibling}a.tail!==null&&en()>tl&&(t.flags|=128,r=!0,Fl(a,!1),t.lanes=4194304)}else{if(!r)if(e=jp(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!zt)return Mn(t),null}else 2*en()-a.renderingStartTime>tl&&n!==1073741824&&(t.flags|=128,r=!0,Fl(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(n=a.last,n!==null?n.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=en(),t.sibling=null,n=Ft.current,Tt(Ft,r?n&1|2:n&1),t):(Mn(t),null);case 22:case 23:return Nx(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fr&1073741824&&(Mn(t),t.subtreeFlags&6&&(t.flags|=8192)):Mn(t),null;case 24:return null;case 25:return null}throw Error(ye(156,t.tag))}function RL(e,t){switch(px(t),t.tag){case 1:return sr(t.type)&&hp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zs(),Mt(or),Mt(Bn),jx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bx(t),null;case 13:if(Mt(Ft),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ye(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mt(Ft),null;case 4:return Zs(),null;case 10:return gx(t.type._context),null;case 22:case 23:return Nx(),null;case 24:return null;default:return null}}var ud=!1,Ln=!1,DL=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function As(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xt(e,t,r)}else n.current=null}function hv(e,t,n){try{n()}catch(r){Xt(e,t,r)}}var Aj=!1;function LL(e,t){if(Qg=up,e=Y2(),ux(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,l=-1,c=-1,u=0,p=0,d=e,h=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==a||r!==0&&d.nodeType!==3||(c=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(m=d.firstChild)!==null;)h=d,d=m;for(;;){if(d===e)break t;if(h===n&&++u===i&&(l=s),h===a&&++p===r&&(c=s),(m=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jg={focusedElem:e,selectionRange:n},up=!1,Ie=t;Ie!==null;)if(t=Ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ie=e;else for(;Ie!==null;){t=Ie;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,x=g.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:Yr(t.type,y),x);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var j=t.stateNode.containerInfo;j.nodeType===1?j.textContent="":j.nodeType===9&&j.documentElement&&j.removeChild(j.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ye(163))}}catch(w){Xt(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Ie=e;break}Ie=t.return}return g=Aj,Aj=!1,g}function vc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&hv(t,n,a)}i=i.next}while(i!==r)}}function Wf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function mv(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function KE(e){var t=e.alternate;t!==null&&(e.alternate=null,KE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yi],delete t[Lc],delete t[tv],delete t[xL],delete t[bL])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function HE(e){return e.tag===5||e.tag===3||e.tag===4}function Oj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||HE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fp));else if(r!==4&&(e=e.child,e!==null))for(gv(e,t,n),e=e.sibling;e!==null;)gv(e,t,n),e=e.sibling}function vv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(vv(e,t,n),e=e.sibling;e!==null;)vv(e,t,n),e=e.sibling}var En=null,Xr=!1;function ma(e,t,n){for(n=n.child;n!==null;)VE(e,t,n),n=n.sibling}function VE(e,t,n){if(wi&&typeof wi.onCommitFiberUnmount=="function")try{wi.onCommitFiberUnmount(Rf,n)}catch{}switch(n.tag){case 5:Ln||As(n,t);case 6:var r=En,i=Xr;En=null,ma(e,t,n),En=r,Xr=i,En!==null&&(Xr?(e=En,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):En.removeChild(n.stateNode));break;case 18:En!==null&&(Xr?(e=En,n=n.stateNode,e.nodeType===8?Am(e.parentNode,n):e.nodeType===1&&Am(e,n),Nc(e)):Am(En,n.stateNode));break;case 4:r=En,i=Xr,En=n.stateNode.containerInfo,Xr=!0,ma(e,t,n),En=r,Xr=i;break;case 0:case 11:case 14:case 15:if(!Ln&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&hv(n,t,s),i=i.next}while(i!==r)}ma(e,t,n);break;case 1:if(!Ln&&(As(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Xt(n,t,l)}ma(e,t,n);break;case 21:ma(e,t,n);break;case 22:n.mode&1?(Ln=(r=Ln)||n.memoizedState!==null,ma(e,t,n),Ln=r):ma(e,t,n);break;default:ma(e,t,n)}}function Ij(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new DL),t.forEach(function(r){var i=VL.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Hr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:En=l.stateNode,Xr=!1;break e;case 3:En=l.stateNode.containerInfo,Xr=!0;break e;case 4:En=l.stateNode.containerInfo,Xr=!0;break e}l=l.return}if(En===null)throw Error(ye(160));VE(a,s,i),En=null,Xr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Xt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)qE(t,e),t=t.sibling}function qE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Hr(t,e),di(e),r&4){try{vc(3,e,e.return),Wf(3,e)}catch(y){Xt(e,e.return,y)}try{vc(5,e,e.return)}catch(y){Xt(e,e.return,y)}}break;case 1:Hr(t,e),di(e),r&512&&n!==null&&As(n,n.return);break;case 5:if(Hr(t,e),di(e),r&512&&n!==null&&As(n,n.return),e.flags&32){var i=e.stateNode;try{Tc(i,"")}catch(y){Xt(e,e.return,y)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,s=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&m2(i,a),Fg(l,s);var u=Fg(l,a);for(s=0;s<c.length;s+=2){var p=c[s],d=c[s+1];p==="style"?b2(i,d):p==="dangerouslySetInnerHTML"?y2(i,d):p==="children"?Tc(i,d):Qy(i,p,d,u)}switch(l){case"input":Dg(i,a);break;case"textarea":g2(i,a);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?Ls(i,!!a.multiple,m,!1):h!==!!a.multiple&&(a.defaultValue!=null?Ls(i,!!a.multiple,a.defaultValue,!0):Ls(i,!!a.multiple,a.multiple?[]:"",!1))}i[Lc]=a}catch(y){Xt(e,e.return,y)}}break;case 6:if(Hr(t,e),di(e),r&4){if(e.stateNode===null)throw Error(ye(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(y){Xt(e,e.return,y)}}break;case 3:if(Hr(t,e),di(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Nc(t.containerInfo)}catch(y){Xt(e,e.return,y)}break;case 4:Hr(t,e),di(e);break;case 13:Hr(t,e),di(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(Ox=en())),r&4&&Ij(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Ln=(u=Ln)||p,Hr(t,e),Ln=u):Hr(t,e),di(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!p&&e.mode&1)for(Ie=e,p=e.child;p!==null;){for(d=Ie=p;Ie!==null;){switch(h=Ie,m=h.child,h.tag){case 0:case 11:case 14:case 15:vc(4,h,h.return);break;case 1:As(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(y){Xt(r,n,y)}}break;case 5:As(h,h.return);break;case 22:if(h.memoizedState!==null){_j(d);continue}}m!==null?(m.return=h,Ie=m):_j(d)}p=p.sibling}e:for(p=null,d=e;;){if(d.tag===5){if(p===null){p=d;try{i=d.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=d.stateNode,c=d.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=x2("display",s))}catch(y){Xt(e,e.return,y)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){Xt(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;p===d&&(p=null),d=d.return}p===d&&(p=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Hr(t,e),di(e),r&4&&Ij(e);break;case 21:break;default:Hr(t,e),di(e)}}function di(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(HE(n)){var r=n;break e}n=n.return}throw Error(ye(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Tc(i,""),r.flags&=-33);var a=Oj(e);vv(e,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Oj(e);gv(e,l,s);break;default:throw Error(ye(161))}}catch(c){Xt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zL(e,t,n){Ie=e,YE(e)}function YE(e,t,n){for(var r=(e.mode&1)!==0;Ie!==null;){var i=Ie,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||ud;if(!s){var l=i.alternate,c=l!==null&&l.memoizedState!==null||Ln;l=ud;var u=Ln;if(ud=s,(Ln=c)&&!u)for(Ie=i;Ie!==null;)s=Ie,c=s.child,s.tag===22&&s.memoizedState!==null?Mj(i):c!==null?(c.return=s,Ie=c):Mj(i);for(;a!==null;)Ie=a,YE(a),a=a.sibling;Ie=i,ud=l,Ln=u}Nj(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Ie=a):Nj(e)}}function Nj(e){for(;Ie!==null;){var t=Ie;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ln||Wf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ln)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Yr(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&gj(t,a,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}gj(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var p=u.memoizedState;if(p!==null){var d=p.dehydrated;d!==null&&Nc(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ye(163))}Ln||t.flags&512&&mv(t)}catch(h){Xt(t,t.return,h)}}if(t===e){Ie=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ie=n;break}Ie=t.return}}function _j(e){for(;Ie!==null;){var t=Ie;if(t===e){Ie=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ie=n;break}Ie=t.return}}function Mj(e){for(;Ie!==null;){var t=Ie;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Wf(4,t)}catch(c){Xt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){Xt(t,i,c)}}var a=t.return;try{mv(t)}catch(c){Xt(t,a,c)}break;case 5:var s=t.return;try{mv(t)}catch(c){Xt(t,s,c)}}}catch(c){Xt(t,t.return,c)}if(t===e){Ie=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Ie=l;break}Ie=t.return}}var $L=Math.ceil,kp=ia.ReactCurrentDispatcher,Tx=ia.ReactCurrentOwner,Lr=ia.ReactCurrentBatchConfig,ut=0,bn=null,an=null,An=0,fr=0,Os=Ya(0),pn=0,Wc=null,Bo=0,Kf=0,Ax=0,yc=null,nr=null,Ox=0,tl=1/0,Li=null,Cp=!1,yv=null,Ra=null,dd=!1,Ea=null,Pp=0,xc=0,xv=null,qd=-1,Yd=0;function Gn(){return ut&6?en():qd!==-1?qd:qd=en()}function Da(e){return e.mode&1?ut&2&&An!==0?An&-An:wL.transition!==null?(Yd===0&&(Yd=N2()),Yd):(e=bt,e!==0||(e=window.event,e=e===void 0?16:$2(e.type)),e):1}function ni(e,t,n,r){if(50<xc)throw xc=0,xv=null,Error(ye(185));du(e,n,r),(!(ut&2)||e!==bn)&&(e===bn&&(!(ut&2)&&(Kf|=n),pn===4&&ka(e,An)),lr(e,r),n===1&&ut===0&&!(t.mode&1)&&(tl=en()+500,Bf&&Ga()))}function lr(e,t){var n=e.callbackNode;wD(e,t);var r=cp(e,e===bn?An:0);if(r===0)n!==null&&W1(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&W1(n),t===1)e.tag===0?jL(Rj.bind(null,e)):iE(Rj.bind(null,e)),vL(function(){!(ut&6)&&Ga()}),n=null;else{switch(_2(r)){case 1:n=nx;break;case 4:n=O2;break;case 16:n=lp;break;case 536870912:n=I2;break;default:n=lp}n=nT(n,GE.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function GE(e,t){if(qd=-1,Yd=0,ut&6)throw Error(ye(327));var n=e.callbackNode;if(Us()&&e.callbackNode!==n)return null;var r=cp(e,e===bn?An:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ep(e,r);else{t=r;var i=ut;ut|=2;var a=QE();(bn!==e||An!==t)&&(Li=null,tl=en()+500,Oo(e,t));do try{UL();break}catch(l){XE(e,l)}while(!0);mx(),kp.current=a,ut=i,an!==null?t=0:(bn=null,An=0,t=pn)}if(t!==0){if(t===2&&(i=Vg(e),i!==0&&(r=i,t=bv(e,i))),t===1)throw n=Wc,Oo(e,0),ka(e,r),lr(e,en()),n;if(t===6)ka(e,r);else{if(i=e.current.alternate,!(r&30)&&!BL(i)&&(t=Ep(e,r),t===2&&(a=Vg(e),a!==0&&(r=a,t=bv(e,a))),t===1))throw n=Wc,Oo(e,0),ka(e,r),lr(e,en()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ye(345));case 2:go(e,nr,Li);break;case 3:if(ka(e,r),(r&130023424)===r&&(t=Ox+500-en(),10<t)){if(cp(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Gn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ev(go.bind(null,e,nr,Li),t);break}go(e,nr,Li);break;case 4:if(ka(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ti(r);a=1<<s,s=t[s],s>i&&(i=s),r&=~a}if(r=i,r=en()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$L(r/1960))-r,10<r){e.timeoutHandle=ev(go.bind(null,e,nr,Li),r);break}go(e,nr,Li);break;case 5:go(e,nr,Li);break;default:throw Error(ye(329))}}}return lr(e,en()),e.callbackNode===n?GE.bind(null,e):null}function bv(e,t){var n=yc;return e.current.memoizedState.isDehydrated&&(Oo(e,t).flags|=256),e=Ep(e,t),e!==2&&(t=nr,nr=n,t!==null&&jv(t)),e}function jv(e){nr===null?nr=e:nr.push.apply(nr,e)}function BL(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!ri(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ka(e,t){for(t&=~Ax,t&=~Kf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ti(t),r=1<<n;e[n]=-1,t&=~r}}function Rj(e){if(ut&6)throw Error(ye(327));Us();var t=cp(e,0);if(!(t&1))return lr(e,en()),null;var n=Ep(e,t);if(e.tag!==0&&n===2){var r=Vg(e);r!==0&&(t=r,n=bv(e,r))}if(n===1)throw n=Wc,Oo(e,0),ka(e,t),lr(e,en()),n;if(n===6)throw Error(ye(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,go(e,nr,Li),lr(e,en()),null}function Ix(e,t){var n=ut;ut|=1;try{return e(t)}finally{ut=n,ut===0&&(tl=en()+500,Bf&&Ga())}}function Fo(e){Ea!==null&&Ea.tag===0&&!(ut&6)&&Us();var t=ut;ut|=1;var n=Lr.transition,r=bt;try{if(Lr.transition=null,bt=1,e)return e()}finally{bt=r,Lr.transition=n,ut=t,!(ut&6)&&Ga()}}function Nx(){fr=Os.current,Mt(Os)}function Oo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,gL(n)),an!==null)for(n=an.return;n!==null;){var r=n;switch(px(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&hp();break;case 3:Zs(),Mt(or),Mt(Bn),jx();break;case 5:bx(r);break;case 4:Zs();break;case 13:Mt(Ft);break;case 19:Mt(Ft);break;case 10:gx(r.type._context);break;case 22:case 23:Nx()}n=n.return}if(bn=e,an=e=La(e.current,null),An=fr=t,pn=0,Wc=null,Ax=Kf=Bo=0,nr=yc=null,wo!==null){for(t=0;t<wo.length;t++)if(n=wo[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var s=a.next;a.next=i,r.next=s}n.pending=r}wo=null}return e}function XE(e,t){do{var n=an;try{if(mx(),Kd.current=Sp,wp){for(var r=Ut.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}wp=!1}if($o=0,yn=un=Ut=null,gc=!1,Bc=0,Tx.current=null,n===null||n.return===null){pn=1,Wc=t,an=null;break}e:{var a=e,s=n.return,l=n,c=t;if(t=An,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,p=l,d=p.tag;if(!(p.mode&1)&&(d===0||d===11||d===15)){var h=p.alternate;h?(p.updateQueue=h.updateQueue,p.memoizedState=h.memoizedState,p.lanes=h.lanes):(p.updateQueue=null,p.memoizedState=null)}var m=wj(s);if(m!==null){m.flags&=-257,Sj(m,s,l,a,t),m.mode&1&&jj(a,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var y=new Set;y.add(c),t.updateQueue=y}else g.add(c);break e}else{if(!(t&1)){jj(a,u,t),_x();break e}c=Error(ye(426))}}else if(zt&&l.mode&1){var x=wj(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Sj(x,s,l,a,t),fx(el(c,l));break e}}a=c=el(c,l),pn!==4&&(pn=2),yc===null?yc=[a]:yc.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var v=_E(a,c,t);mj(a,v);break e;case 1:l=c;var b=a.type,j=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(Ra===null||!Ra.has(j)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=ME(a,l,t);mj(a,w);break e}}a=a.return}while(a!==null)}ZE(n)}catch(k){t=k,an===n&&n!==null&&(an=n=n.return);continue}break}while(!0)}function QE(){var e=kp.current;return kp.current=Sp,e===null?Sp:e}function _x(){(pn===0||pn===3||pn===2)&&(pn=4),bn===null||!(Bo&268435455)&&!(Kf&268435455)||ka(bn,An)}function Ep(e,t){var n=ut;ut|=2;var r=QE();(bn!==e||An!==t)&&(Li=null,Oo(e,t));do try{FL();break}catch(i){XE(e,i)}while(!0);if(mx(),ut=n,kp.current=r,an!==null)throw Error(ye(261));return bn=null,An=0,pn}function FL(){for(;an!==null;)JE(an)}function UL(){for(;an!==null&&!fD();)JE(an)}function JE(e){var t=tT(e.alternate,e,fr);e.memoizedProps=e.pendingProps,t===null?ZE(e):an=t,Tx.current=null}function ZE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=RL(n,t),n!==null){n.flags&=32767,an=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{pn=6,an=null;return}}else if(n=ML(n,t,fr),n!==null){an=n;return}if(t=t.sibling,t!==null){an=t;return}an=t=e}while(t!==null);pn===0&&(pn=5)}function go(e,t,n){var r=bt,i=Lr.transition;try{Lr.transition=null,bt=1,WL(e,t,n,r)}finally{Lr.transition=i,bt=r}return null}function WL(e,t,n,r){do Us();while(Ea!==null);if(ut&6)throw Error(ye(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ye(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(SD(e,a),e===bn&&(an=bn=null,An=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||dd||(dd=!0,nT(lp,function(){return Us(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Lr.transition,Lr.transition=null;var s=bt;bt=1;var l=ut;ut|=4,Tx.current=null,LL(e,n),qE(n,e),cL(Jg),up=!!Qg,Jg=Qg=null,e.current=n,zL(n),hD(),ut=l,bt=s,Lr.transition=a}else e.current=n;if(dd&&(dd=!1,Ea=e,Pp=i),a=e.pendingLanes,a===0&&(Ra=null),vD(n.stateNode),lr(e,en()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Cp)throw Cp=!1,e=yv,yv=null,e;return Pp&1&&e.tag!==0&&Us(),a=e.pendingLanes,a&1?e===xv?xc++:(xc=0,xv=e):xc=0,Ga(),null}function Us(){if(Ea!==null){var e=_2(Pp),t=Lr.transition,n=bt;try{if(Lr.transition=null,bt=16>e?16:e,Ea===null)var r=!1;else{if(e=Ea,Ea=null,Pp=0,ut&6)throw Error(ye(331));var i=ut;for(ut|=4,Ie=e.current;Ie!==null;){var a=Ie,s=a.child;if(Ie.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(Ie=u;Ie!==null;){var p=Ie;switch(p.tag){case 0:case 11:case 15:vc(8,p,a)}var d=p.child;if(d!==null)d.return=p,Ie=d;else for(;Ie!==null;){p=Ie;var h=p.sibling,m=p.return;if(KE(p),p===u){Ie=null;break}if(h!==null){h.return=m,Ie=h;break}Ie=m}}}var g=a.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var x=y.sibling;y.sibling=null,y=x}while(y!==null)}}Ie=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,Ie=s;else e:for(;Ie!==null;){if(a=Ie,a.flags&2048)switch(a.tag){case 0:case 11:case 15:vc(9,a,a.return)}var v=a.sibling;if(v!==null){v.return=a.return,Ie=v;break e}Ie=a.return}}var b=e.current;for(Ie=b;Ie!==null;){s=Ie;var j=s.child;if(s.subtreeFlags&2064&&j!==null)j.return=s,Ie=j;else e:for(s=b;Ie!==null;){if(l=Ie,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Wf(9,l)}}catch(k){Xt(l,l.return,k)}if(l===s){Ie=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,Ie=w;break e}Ie=l.return}}if(ut=i,Ga(),wi&&typeof wi.onPostCommitFiberRoot=="function")try{wi.onPostCommitFiberRoot(Rf,e)}catch{}r=!0}return r}finally{bt=n,Lr.transition=t}}return!1}function Dj(e,t,n){t=el(n,t),t=_E(e,t,1),e=Ma(e,t,1),t=Gn(),e!==null&&(du(e,1,t),lr(e,t))}function Xt(e,t,n){if(e.tag===3)Dj(e,e,n);else for(;t!==null;){if(t.tag===3){Dj(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ra===null||!Ra.has(r))){e=el(n,e),e=ME(t,e,1),t=Ma(t,e,1),e=Gn(),t!==null&&(du(t,1,e),lr(t,e));break}}t=t.return}}function KL(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Gn(),e.pingedLanes|=e.suspendedLanes&n,bn===e&&(An&n)===n&&(pn===4||pn===3&&(An&130023424)===An&&500>en()-Ox?Oo(e,0):Ax|=n),lr(e,t)}function eT(e,t){t===0&&(e.mode&1?(t=td,td<<=1,!(td&130023424)&&(td=4194304)):t=1);var n=Gn();e=Ji(e,t),e!==null&&(du(e,t,n),lr(e,n))}function HL(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),eT(e,n)}function VL(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ye(314))}r!==null&&r.delete(t),eT(e,n)}var tT;tT=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||or.current)rr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rr=!1,_L(e,t,n);rr=!!(e.flags&131072)}else rr=!1,zt&&t.flags&1048576&&aE(t,vp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Vd(e,t),e=t.pendingProps;var i=Xs(t,Bn.current);Fs(t,n),i=Sx(null,t,r,e,i,n);var a=kx();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,sr(r)?(a=!0,mp(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,yx(t),i.updater=Uf,t.stateNode=i,i._reactInternals=t,sv(t,r,e,n),t=uv(null,t,r,!0,a,n)):(t.tag=0,zt&&a&&dx(t),Vn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Vd(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=YL(r),e=Yr(r,e),i){case 0:t=cv(null,t,r,e,n);break e;case 1:t=Pj(null,t,r,e,n);break e;case 11:t=kj(null,t,r,e,n);break e;case 14:t=Cj(null,t,r,Yr(r.type,e),n);break e}throw Error(ye(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yr(r,i),cv(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yr(r,i),Pj(e,t,r,i,n);case 3:e:{if(zE(t),e===null)throw Error(ye(387));r=t.pendingProps,a=t.memoizedState,i=a.element,dE(e,t),bp(t,r,null,n);var s=t.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=el(Error(ye(423)),t),t=Ej(e,t,r,n,i);break e}else if(r!==i){i=el(Error(ye(424)),t),t=Ej(e,t,r,n,i);break e}else for(mr=_a(t.stateNode.containerInfo.firstChild),yr=t,zt=!0,Qr=null,n=cE(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qs(),r===i){t=Zi(e,t,n);break e}Vn(e,t,r,n)}t=t.child}return t;case 5:return pE(t),e===null&&iv(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,Zg(r,i)?s=null:a!==null&&Zg(r,a)&&(t.flags|=32),LE(e,t),Vn(e,t,s,n),t.child;case 6:return e===null&&iv(t),null;case 13:return $E(e,t,n);case 4:return xx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Js(t,null,r,n):Vn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yr(r,i),kj(e,t,r,i,n);case 7:return Vn(e,t,t.pendingProps,n),t.child;case 8:return Vn(e,t,t.pendingProps.children,n),t.child;case 12:return Vn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,Tt(yp,r._currentValue),r._currentValue=s,a!==null)if(ri(a.value,s)){if(a.children===i.children&&!or.current){t=Zi(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=qi(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?c.next=c:(c.next=p.next,p.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),av(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)s=a.type===t.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(ye(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),av(s,n,t),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Vn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Fs(t,n),i=zr(i),r=r(i),t.flags|=1,Vn(e,t,r,n),t.child;case 14:return r=t.type,i=Yr(r,t.pendingProps),i=Yr(r.type,i),Cj(e,t,r,i,n);case 15:return RE(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yr(r,i),Vd(e,t),t.tag=1,sr(r)?(e=!0,mp(t)):e=!1,Fs(t,n),NE(t,r,i),sv(t,r,i,n),uv(null,t,r,!0,e,n);case 19:return BE(e,t,n);case 22:return DE(e,t,n)}throw Error(ye(156,t.tag))};function nT(e,t){return A2(e,t)}function qL(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mr(e,t,n,r){return new qL(e,t,n,r)}function Mx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function YL(e){if(typeof e=="function")return Mx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zy)return 11;if(e===ex)return 14}return 2}function La(e,t){var n=e.alternate;return n===null?(n=Mr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Gd(e,t,n,r,i,a){var s=2;if(r=e,typeof e=="function")Mx(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case bs:return Io(n.children,i,a,t);case Jy:s=8,i|=8;break;case Ig:return e=Mr(12,n,t,i|2),e.elementType=Ig,e.lanes=a,e;case Ng:return e=Mr(13,n,t,i),e.elementType=Ng,e.lanes=a,e;case _g:return e=Mr(19,n,t,i),e.elementType=_g,e.lanes=a,e;case p2:return Hf(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case u2:s=10;break e;case d2:s=9;break e;case Zy:s=11;break e;case ex:s=14;break e;case xa:s=16,r=null;break e}throw Error(ye(130,e==null?e:typeof e,""))}return t=Mr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Io(e,t,n,r){return e=Mr(7,e,r,t),e.lanes=n,e}function Hf(e,t,n,r){return e=Mr(22,e,r,t),e.elementType=p2,e.lanes=n,e.stateNode={isHidden:!1},e}function Lm(e,t,n){return e=Mr(6,e,null,t),e.lanes=n,e}function zm(e,t,n){return t=Mr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function GL(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ym(0),this.expirationTimes=ym(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ym(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Rx(e,t,n,r,i,a,s,l,c){return e=new GL(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Mr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yx(a),e}function XL(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function rT(e){if(!e)return Ua;e=e._reactInternals;e:{if(Jo(e)!==e||e.tag!==1)throw Error(ye(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(sr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ye(171))}if(e.tag===1){var n=e.type;if(sr(n))return rE(e,n,t)}return t}function iT(e,t,n,r,i,a,s,l,c){return e=Rx(n,r,!0,e,i,a,s,l,c),e.context=rT(null),n=e.current,r=Gn(),i=Da(n),a=qi(r,i),a.callback=t??null,Ma(n,a,i),e.current.lanes=i,du(e,i,r),lr(e,r),e}function Vf(e,t,n,r){var i=t.current,a=Gn(),s=Da(i);return n=rT(n),t.context===null?t.context=n:t.pendingContext=n,t=qi(a,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ma(i,t,s),e!==null&&(ni(e,i,s,a),Wd(e,i,s)),s}function Tp(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Lj(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Dx(e,t){Lj(e,t),(e=e.alternate)&&Lj(e,t)}function QL(){return null}var aT=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lx(e){this._internalRoot=e}qf.prototype.render=Lx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ye(409));Vf(e,t,null,null)};qf.prototype.unmount=Lx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Fo(function(){Vf(null,e,null,null)}),t[Qi]=null}};function qf(e){this._internalRoot=e}qf.prototype.unstable_scheduleHydration=function(e){if(e){var t=D2();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Sa.length&&t!==0&&t<Sa[n].priority;n++);Sa.splice(n,0,e),n===0&&z2(e)}};function zx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Yf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function zj(){}function JL(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=Tp(s);a.call(u)}}var s=iT(t,r,e,0,null,!1,!1,"",zj);return e._reactRootContainer=s,e[Qi]=s.current,Rc(e.nodeType===8?e.parentNode:e),Fo(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=Tp(c);l.call(u)}}var c=Rx(e,0,!1,null,null,!1,!1,"",zj);return e._reactRootContainer=c,e[Qi]=c.current,Rc(e.nodeType===8?e.parentNode:e),Fo(function(){Vf(t,c,n,r)}),c}function Gf(e,t,n,r,i){var a=n._reactRootContainer;if(a){var s=a;if(typeof i=="function"){var l=i;i=function(){var c=Tp(s);l.call(c)}}Vf(t,s,e,i)}else s=JL(n,t,e,i,r);return Tp(s)}M2=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ac(t.pendingLanes);n!==0&&(rx(t,n|1),lr(t,en()),!(ut&6)&&(tl=en()+500,Ga()))}break;case 13:Fo(function(){var r=Ji(e,1);if(r!==null){var i=Gn();ni(r,e,1,i)}}),Dx(e,1)}};ix=function(e){if(e.tag===13){var t=Ji(e,134217728);if(t!==null){var n=Gn();ni(t,e,134217728,n)}Dx(e,134217728)}};R2=function(e){if(e.tag===13){var t=Da(e),n=Ji(e,t);if(n!==null){var r=Gn();ni(n,e,t,r)}Dx(e,t)}};D2=function(){return bt};L2=function(e,t){var n=bt;try{return bt=e,t()}finally{bt=n}};Wg=function(e,t,n){switch(t){case"input":if(Dg(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=$f(r);if(!i)throw Error(ye(90));h2(r),Dg(r,i)}}}break;case"textarea":g2(e,n);break;case"select":t=n.value,t!=null&&Ls(e,!!n.multiple,t,!1)}};S2=Ix;k2=Fo;var ZL={usingClientEntryPoint:!1,Events:[fu,ks,$f,j2,w2,Ix]},Ul={findFiberByHostInstance:jo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ez={bundleType:Ul.bundleType,version:Ul.version,rendererPackageName:Ul.rendererPackageName,rendererConfig:Ul.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ia.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=E2(e),e===null?null:e.stateNode},findFiberByHostInstance:Ul.findFiberByHostInstance||QL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pd.isDisabled&&pd.supportsFiber)try{Rf=pd.inject(ez),wi=pd}catch{}}Sr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZL;Sr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zx(t))throw Error(ye(200));return XL(e,t,null,n)};Sr.createRoot=function(e,t){if(!zx(e))throw Error(ye(299));var n=!1,r="",i=aT;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Rx(e,1,!1,null,null,n,!1,r,i),e[Qi]=t.current,Rc(e.nodeType===8?e.parentNode:e),new Lx(t)};Sr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ye(188)):(e=Object.keys(e).join(","),Error(ye(268,e)));return e=E2(t),e=e===null?null:e.stateNode,e};Sr.flushSync=function(e){return Fo(e)};Sr.hydrate=function(e,t,n){if(!Yf(t))throw Error(ye(200));return Gf(null,e,t,!0,n)};Sr.hydrateRoot=function(e,t,n){if(!zx(e))throw Error(ye(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=aT;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=iT(t,null,e,1,n??null,i,!1,a,s),e[Qi]=t.current,Rc(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new qf(t)};Sr.render=function(e,t,n){if(!Yf(t))throw Error(ye(200));return Gf(null,e,t,!1,n)};Sr.unmountComponentAtNode=function(e){if(!Yf(e))throw Error(ye(40));return e._reactRootContainer?(Fo(function(){Gf(null,null,e,!1,function(){e._reactRootContainer=null,e[Qi]=null})}),!0):!1};Sr.unstable_batchedUpdates=Ix;Sr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Yf(n))throw Error(ye(200));if(e==null||e._reactInternals===void 0)throw Error(ye(38));return Gf(e,t,n,!1,r)};Sr.version="18.3.1-next-f1338f8080-20240426";function oT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oT)}catch(e){console.error(e)}}oT(),o2.exports=Sr;var mu=o2.exports,$j=mu;Ag.createRoot=$j.createRoot,Ag.hydrateRoot=$j.hydrateRoot;/**
|
|
41
|
-
* @remix-run/router v1.23.3
|
|
42
|
-
*
|
|
43
|
-
* Copyright (c) Remix Software Inc.
|
|
44
|
-
*
|
|
45
|
-
* This source code is licensed under the MIT license found in the
|
|
46
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
-
*
|
|
48
|
-
* @license MIT
|
|
49
|
-
*/function Kc(){return Kc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kc.apply(null,arguments)}var Ta;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ta||(Ta={}));const Bj="popstate";function tz(e){e===void 0&&(e={});function t(i,a){let{pathname:s="/",search:l="",hash:c=""}=Zo(i.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),wv("",{pathname:s,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(i,a){let s=i.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=i.location.href,u=c.indexOf("#");l=u===-1?c:c.slice(0,u)}return l+"#"+(typeof a=="string"?a:Ap(a))}function r(i,a){Xf(i.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")")}return rz(t,n,r,e)}function Wt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xf(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function nz(){return Math.random().toString(36).substr(2,8)}function Fj(e,t){return{usr:e.state,key:e.key,idx:t}}function wv(e,t,n,r){return n===void 0&&(n=null),Kc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Zo(t):t,{state:n,key:t&&t.key||r||nz()})}function Ap(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Zo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function rz(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,l=Ta.Pop,c=null,u=p();u==null&&(u=0,s.replaceState(Kc({},s.state,{idx:u}),""));function p(){return(s.state||{idx:null}).idx}function d(){l=Ta.Pop;let x=p(),v=x==null?null:x-u;u=x,c&&c({action:l,location:y.location,delta:v})}function h(x,v){l=Ta.Push;let b=wv(y.location,x,v);n&&n(b,x),u=p()+1;let j=Fj(b,u),w=y.createHref(b);try{s.pushState(j,"",w)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(w)}a&&c&&c({action:l,location:y.location,delta:1})}function m(x,v){l=Ta.Replace;let b=wv(y.location,x,v);n&&n(b,x),u=p();let j=Fj(b,u),w=y.createHref(b);s.replaceState(j,"",w),a&&c&&c({action:l,location:y.location,delta:0})}function g(x){let v=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof x=="string"?x:Ap(x);return b=b.replace(/ $/,"%20"),Wt(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let y={get action(){return l},get location(){return e(i,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(Bj,d),c=x,()=>{i.removeEventListener(Bj,d),c=null}},createHref(x){return t(i,x)},createURL:g,encodeLocation(x){let v=g(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:m,go(x){return s.go(x)}};return y}var Uj;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Uj||(Uj={}));function iz(e,t,n){return n===void 0&&(n="/"),az(e,t,n)}function az(e,t,n,r){let i=typeof t=="string"?Zo(t):t,a=nl(i.pathname||"/",n);if(a==null)return null;let s=sT(e);oz(s);let l=null,c=vz(a);for(let u=0;l==null&&u<s.length;++u)l=mz(s[u],c);return l}function sT(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,s,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};c.relativePath.startsWith("/")&&(Wt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=za([r,c.relativePath]),p=n.concat(c);a.children&&a.children.length>0&&(Wt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),sT(a.children,t,p,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:fz(u,a.index),routesMeta:p})};return e.forEach((a,s)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,s);else for(let c of lT(a.path))i(a,s,c)}),t}function lT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let s=lT(r.join("/")),l=[];return l.push(...s.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function oz(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:hz(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const sz=/^:[\w-]+$/,lz=3,cz=2,uz=1,dz=10,pz=-2,Wj=e=>e==="*";function fz(e,t){let n=e.split("/"),r=n.length;return n.some(Wj)&&(r+=pz),t&&(r+=cz),n.filter(i=>!Wj(i)).reduce((i,a)=>i+(sz.test(a)?lz:a===""?uz:dz),r)}function hz(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function mz(e,t,n){let{routesMeta:r}=e,i={},a="/",s=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",d=Sv({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},p),h=c.route;if(!d)return null;Object.assign(i,d.params),s.push({params:i,pathname:za([a,d.pathname]),pathnameBase:wz(za([a,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(a=za([a,d.pathnameBase]))}return s}function Sv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=gz(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((u,p,d)=>{let{paramName:h,isOptional:m}=p;if(h==="*"){let y=l[d]||"";s=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const g=l[d];return m&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function gz(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Xf(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function vz(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xf(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function nl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const yz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xz=e=>yz.test(e);function bz(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Zo(e):e,a;if(n)if(xz(n))a=n;else{if(n.includes("//")){let s=n;n=cT(n),Xf(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?a=Kj(n.substring(1),"/"):a=Kj(n,t)}else a=t;return{pathname:a,search:Sz(r),hash:kz(i)}}function Kj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function $m(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function jz(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function $x(e,t){let n=jz(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Bx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Zo(e):(i=Kc({},e),Wt(!i.pathname||!i.pathname.includes("?"),$m("?","pathname","search",i)),Wt(!i.pathname||!i.pathname.includes("#"),$m("#","pathname","hash",i)),Wt(!i.search||!i.search.includes("#"),$m("#","search","hash",i)));let a=e===""||i.pathname==="",s=a?"/":i.pathname,l;if(s==null)l=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}l=d>=0?t[d]:"/"}let c=bz(i,l),u=s&&s!=="/"&&s.endsWith("/"),p=(a||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const cT=e=>e.replace(/\/\/+/g,"/"),za=e=>cT(e.join("/")),wz=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Sz=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kz=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Cz(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const uT=["post","put","patch","delete"];new Set(uT);const Pz=["get",...uT];new Set(Pz);/**
|
|
50
|
-
* React Router v6.30.4
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/function Hc(){return Hc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hc.apply(null,arguments)}const Qf=f.createContext(null),dT=f.createContext(null),aa=f.createContext(null),Jf=f.createContext(null),oa=f.createContext({outlet:null,matches:[],isDataRoute:!1}),pT=f.createContext(null);function Ez(e,t){let{relative:n}=t===void 0?{}:t;yl()||Wt(!1);let{basename:r,navigator:i}=f.useContext(aa),{hash:a,pathname:s,search:l}=eh(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:za([r,s])),i.createHref({pathname:c,search:l,hash:a})}function yl(){return f.useContext(Jf)!=null}function xl(){return yl()||Wt(!1),f.useContext(Jf).location}function fT(e){f.useContext(aa).static||f.useLayoutEffect(e)}function Zf(){let{isDataRoute:e}=f.useContext(oa);return e?Fz():Tz()}function Tz(){yl()||Wt(!1);let e=f.useContext(Qf),{basename:t,future:n,navigator:r}=f.useContext(aa),{matches:i}=f.useContext(oa),{pathname:a}=xl(),s=JSON.stringify($x(i,n.v7_relativeSplatPath)),l=f.useRef(!1);return fT(()=>{l.current=!0}),f.useCallback(function(u,p){if(p===void 0&&(p={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let d=Bx(u,JSON.parse(s),a,p.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:za([t,d.pathname])),(p.replace?r.replace:r.push)(d,p.state,p)},[t,r,s,a,e])}function Az(){let{matches:e}=f.useContext(oa),t=e[e.length-1];return t?t.params:{}}function eh(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=f.useContext(aa),{matches:i}=f.useContext(oa),{pathname:a}=xl(),s=JSON.stringify($x(i,r.v7_relativeSplatPath));return f.useMemo(()=>Bx(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}function Oz(e,t){return Iz(e,t)}function Iz(e,t,n,r){yl()||Wt(!1);let{navigator:i}=f.useContext(aa),{matches:a}=f.useContext(oa),s=a[a.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=xl(),p;if(t){var d;let x=typeof t=="string"?Zo(t):t;c==="/"||(d=x.pathname)!=null&&d.startsWith(c)||Wt(!1),p=x}else p=u;let h=p.pathname||"/",m=h;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=iz(e,{pathname:m}),y=Dz(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:za([c,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:za([c,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,n,r);return t&&y?f.createElement(Jf.Provider,{value:{location:Hc({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Ta.Pop}},y):y}function Nz(){let e=Bz(),t=Cz(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:i},n):null,null)}const _z=f.createElement(Nz,null);class Mz extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(oa.Provider,{value:this.props.routeContext},f.createElement(pT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Rz(e){let{routeContext:t,match:n,children:r}=e,i=f.useContext(Qf);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(oa.Provider,{value:t},r)}function Dz(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let p=s.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);p>=0||Wt(!1),s=s.slice(0,Math.min(s.length,p+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p<s.length;p++){let d=s[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=p),d.route.id){let{loaderData:h,errors:m}=n,g=d.route.loader&&h[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((p,d,h)=>{let m,g=!1,y=null,x=null;n&&(m=l&&d.route.id?l[d.route.id]:void 0,y=d.route.errorElement||_z,c&&(u<0&&h===0?(Uz("route-fallback"),g=!0,x=null):u===h&&(g=!0,x=d.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,h+1)),b=()=>{let j;return m?j=y:g?j=x:d.route.Component?j=f.createElement(d.route.Component,null):d.route.element?j=d.route.element:j=p,f.createElement(Rz,{match:d,routeContext:{outlet:p,matches:v,isDataRoute:n!=null},children:j})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?f.createElement(Mz,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var hT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(hT||{}),mT=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(mT||{});function Lz(e){let t=f.useContext(Qf);return t||Wt(!1),t}function zz(e){let t=f.useContext(dT);return t||Wt(!1),t}function $z(e){let t=f.useContext(oa);return t||Wt(!1),t}function gT(e){let t=$z(),n=t.matches[t.matches.length-1];return n.route.id||Wt(!1),n.route.id}function Bz(){var e;let t=f.useContext(pT),n=zz(),r=gT();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Fz(){let{router:e}=Lz(hT.UseNavigateStable),t=gT(mT.UseNavigateStable),n=f.useRef(!1);return fT(()=>{n.current=!0}),f.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Hc({fromRouteId:t},a)))},[e,t])}const Hj={};function Uz(e,t,n){Hj[e]||(Hj[e]=!0)}function Wz(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Wl(e){let{to:t,replace:n,state:r,relative:i}=e;yl()||Wt(!1);let{future:a,static:s}=f.useContext(aa),{matches:l}=f.useContext(oa),{pathname:c}=xl(),u=Zf(),p=Bx(t,$x(l,a.v7_relativeSplatPath),c,i==="path"),d=JSON.stringify(p);return f.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function Hn(e){Wt(!1)}function Kz(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ta.Pop,navigator:a,static:s=!1,future:l}=e;yl()&&Wt(!1);let c=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:c,navigator:a,static:s,future:Hc({v7_relativeSplatPath:!1},l)}),[c,l,a,s]);typeof r=="string"&&(r=Zo(r));let{pathname:p="/",search:d="",hash:h="",state:m=null,key:g="default"}=r,y=f.useMemo(()=>{let x=nl(p,c);return x==null?null:{location:{pathname:x,search:d,hash:h,state:m,key:g},navigationType:i}},[c,p,d,h,m,g,i]);return y==null?null:f.createElement(aa.Provider,{value:u},f.createElement(Jf.Provider,{children:n,value:y}))}function Hz(e){let{children:t,location:n}=e;return Oz(kv(t),n)}new Promise(()=>{});function kv(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,i)=>{if(!f.isValidElement(r))return;let a=[...t,i];if(r.type===f.Fragment){n.push.apply(n,kv(r.props.children,a));return}r.type!==Hn&&Wt(!1),!r.props.index||!r.props.children||Wt(!1);let s={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=kv(r.props.children,a)),n.push(s)}),n}/**
|
|
59
|
-
* React Router DOM v6.30.4
|
|
60
|
-
*
|
|
61
|
-
* Copyright (c) Remix Software Inc.
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the MIT license found in the
|
|
64
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
-
*
|
|
66
|
-
* @license MIT
|
|
67
|
-
*/function Op(){return Op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Op.apply(null,arguments)}function vT(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Vz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qz(e,t){return e.button===0&&(!t||t==="_self")&&!Vz(e)}const Yz=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Gz=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Xz="6";try{window.__reactRouterVersion=Xz}catch{}const Qz=f.createContext({isTransitioning:!1}),Jz="startTransition",Vj=i2[Jz];function Zz(e){let{basename:t,children:n,future:r,window:i}=e,a=f.useRef();a.current==null&&(a.current=tz({window:i,v5Compat:!0}));let s=a.current,[l,c]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},p=f.useCallback(d=>{u&&Vj?Vj(()=>c(d)):c(d)},[c,u]);return f.useLayoutEffect(()=>s.listen(p),[s,p]),f.useEffect(()=>Wz(r),[r]),f.createElement(Kz,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const e4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",t4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,n4=f.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,h=vT(t,Yz),{basename:m}=f.useContext(aa),g,y=!1;if(typeof u=="string"&&t4.test(u)&&(g=u,e4))try{let j=new URL(window.location.href),w=u.startsWith("//")?new URL(j.protocol+u):new URL(u),k=nl(w.pathname,m);w.origin===j.origin&&k!=null?u=k+w.search+w.hash:y=!0}catch{}let x=Ez(u,{relative:i}),v=i4(u,{replace:s,state:l,target:c,preventScrollReset:p,relative:i,viewTransition:d});function b(j){r&&r(j),j.defaultPrevented||v(j)}return f.createElement("a",Op({},h,{href:g||x,onClick:y||a?r:b,ref:n,target:c}))}),Vr=f.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:s=!1,style:l,to:c,viewTransition:u,children:p}=t,d=vT(t,Gz),h=eh(c,{relative:d.relative}),m=xl(),g=f.useContext(dT),{navigator:y,basename:x}=f.useContext(aa),v=g!=null&&a4(h)&&u===!0,b=y.encodeLocation?y.encodeLocation(h).pathname:h.pathname,j=m.pathname,w=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(j=j.toLowerCase(),w=w?w.toLowerCase():null,b=b.toLowerCase()),w&&x&&(w=nl(w,x)||w);const k=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let S=j===b||!s&&j.startsWith(b)&&j.charAt(k)==="/",E=w!=null&&(w===b||!s&&w.startsWith(b)&&w.charAt(b.length)==="/"),A={isActive:S,isPending:E,isTransitioning:v},D=S?r:void 0,T;typeof a=="function"?T=a(A):T=[a,S?"active":null,E?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let I=typeof l=="function"?l(A):l;return f.createElement(n4,Op({},d,{"aria-current":D,className:T,ref:n,style:I,to:c,viewTransition:u}),typeof p=="function"?p(A):p)});var Cv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Cv||(Cv={}));var qj;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qj||(qj={}));function r4(e){let t=f.useContext(Qf);return t||Wt(!1),t}function i4(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:l}=t===void 0?{}:t,c=Zf(),u=xl(),p=eh(e,{relative:s});return f.useCallback(d=>{if(qz(d,n)){d.preventDefault();let h=r!==void 0?r:Ap(u)===Ap(p);c(e,{replace:h,state:i,preventScrollReset:a,relative:s,viewTransition:l})}},[u,c,p,r,i,n,e,a,s,l])}function a4(e,t){t===void 0&&(t={});let n=f.useContext(Qz);n==null&&Wt(!1);let{basename:r}=r4(Cv.useViewTransitionState),i=eh(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=nl(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=nl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Sv(i.pathname,s)!=null||Sv(i.pathname,a)!=null}function o4(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const s4=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,l4=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,c4={};function Yj(e,t){return(c4.jsx?l4:s4).test(e)}const u4=/[ \t\n\f\r]/g;function d4(e){return typeof e=="object"?e.type==="text"?Gj(e.value):!1:Gj(e)}function Gj(e){return e.replace(u4,"")===""}class gu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}gu.prototype.normal={};gu.prototype.property={};gu.prototype.space=void 0;function yT(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new gu(n,r,t)}function Pv(e){return e.toLowerCase()}class ur{constructor(t,n){this.attribute=n,this.property=t}}ur.prototype.attribute="";ur.prototype.booleanish=!1;ur.prototype.boolean=!1;ur.prototype.commaOrSpaceSeparated=!1;ur.prototype.commaSeparated=!1;ur.prototype.defined=!1;ur.prototype.mustUseProperty=!1;ur.prototype.number=!1;ur.prototype.overloadedBoolean=!1;ur.prototype.property="";ur.prototype.spaceSeparated=!1;ur.prototype.space=void 0;let p4=0;const He=es(),rn=es(),Ev=es(),be=es(),kt=es(),No=es(),pr=es();function es(){return 2**++p4}const Tv=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:rn,commaOrSpaceSeparated:pr,commaSeparated:No,number:be,overloadedBoolean:Ev,spaceSeparated:kt},Symbol.toStringTag,{value:"Module"})),Bm=Object.keys(Tv);class Fx extends ur{constructor(t,n,r,i){let a=-1;if(super(t,n),Xj(this,"space",i),typeof r=="number")for(;++a<Bm.length;){const s=Bm[a];Xj(this,Bm[a],(r&Tv[s])===Tv[s])}}}Fx.prototype.defined=!0;function Xj(e,t,n){n&&(e[t]=n)}function bl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Fx(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Pv(r)]=r,n[Pv(a.attribute)]=r}return new gu(t,n,e.space)}const xT=bl({properties:{ariaActiveDescendant:null,ariaAtomic:rn,ariaAutoComplete:null,ariaBusy:rn,ariaChecked:rn,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:kt,ariaCurrent:null,ariaDescribedBy:kt,ariaDetails:null,ariaDisabled:rn,ariaDropEffect:kt,ariaErrorMessage:null,ariaExpanded:rn,ariaFlowTo:kt,ariaGrabbed:rn,ariaHasPopup:null,ariaHidden:rn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kt,ariaLevel:be,ariaLive:null,ariaModal:rn,ariaMultiLine:rn,ariaMultiSelectable:rn,ariaOrientation:null,ariaOwns:kt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:rn,ariaReadOnly:rn,ariaRelevant:null,ariaRequired:rn,ariaRoleDescription:kt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:rn,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function bT(e,t){return t in e?e[t]:t}function jT(e,t){return bT(e,t.toLowerCase())}const f4=bl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:No,acceptCharset:kt,accessKey:kt,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alpha:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:kt,autoFocus:He,autoPlay:He,blocking:kt,capture:null,charSet:null,checked:He,cite:null,className:kt,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:rn,controls:He,controlsList:kt,coords:be|No,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:Ev,draggable:rn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:kt,height:be,hidden:Ev,high:be,href:null,hrefLang:null,htmlFor:kt,httpEquiv:kt,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:kt,itemRef:kt,itemScope:He,itemType:kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:He,optimum:be,pattern:null,ping:kt,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:kt,required:He,reversed:He,rows:be,rowSpan:be,sandbox:kt,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootCustomElementRegistry:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shadowRootSerializable:He,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:rn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:He,useMap:null,value:rn,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:rn,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:He,disablePictureInPicture:He,disableRemotePlayback:He,exportParts:No,part:kt,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:jT}),h4=bl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:pr,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:kt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:He,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:No,g2:No,glyphName:No,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:pr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pr,rev:pr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pr,requiredFeatures:pr,requiredFonts:pr,requiredFormats:pr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:pr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pr,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:bT}),wT=bl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ST=bl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:jT}),kT=bl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),m4={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},g4=/[A-Z]/g,Qj=/-[a-z]/g,v4=/^data[-\w.:]+$/i;function y4(e,t){const n=Pv(t);let r=t,i=ur;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&v4.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Qj,b4);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Qj.test(a)){let s=a.replace(g4,x4);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Fx}return new i(r,t)}function x4(e){return"-"+e.toLowerCase()}function b4(e){return e.charAt(1).toUpperCase()}const j4=yT([xT,f4,wT,ST,kT],"html"),Ux=yT([xT,h4,wT,ST,kT],"svg");function w4(e){return e.join(" ").trim()}var Wx={},Jj=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,S4=/\n/g,k4=/^\s*/,C4=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,P4=/^:\s*/,E4=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,T4=/^[;\s]*/,A4=/^\s+|\s+$/g,O4=`
|
|
68
|
-
`,Zj="/",ew="*",bo="",I4="comment",N4="declaration";function _4(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var y=g.match(S4);y&&(n+=y.length);var x=g.lastIndexOf(O4);r=~x?g.length-x:r+g.length}function a(){var g={line:n,column:r};return function(y){return y.position=new s(g),u(),y}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(g){var y=new Error(t.source+":"+n+":"+r+": "+g);if(y.reason=g,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function c(g){var y=g.exec(e);if(y){var x=y[0];return i(x),e=e.slice(x.length),y}}function u(){c(k4)}function p(g){var y;for(g=g||[];y=d();)y!==!1&&g.push(y);return g}function d(){var g=a();if(!(Zj!=e.charAt(0)||ew!=e.charAt(1))){for(var y=2;bo!=e.charAt(y)&&(ew!=e.charAt(y)||Zj!=e.charAt(y+1));)++y;if(y+=2,bo===e.charAt(y-1))return l("End of comment missing");var x=e.slice(2,y-2);return r+=2,i(x),e=e.slice(y),r+=2,g({type:I4,comment:x})}}function h(){var g=a(),y=c(C4);if(y){if(d(),!c(P4))return l("property missing ':'");var x=c(E4),v=g({type:N4,property:tw(y[0].replace(Jj,bo)),value:x?tw(x[0].replace(Jj,bo)):bo});return c(T4),v}}function m(){var g=[];p(g);for(var y;y=h();)y!==!1&&(g.push(y),p(g));return g}return u(),m()}function tw(e){return e?e.replace(A4,bo):bo}var M4=_4,R4=Ys&&Ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wx,"__esModule",{value:!0});Wx.default=L4;const D4=R4(M4);function L4(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,D4.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:s,value:l}=a;i?t(s,l,a):l&&(n=n||{},n[s]=l)}),n}var th={};Object.defineProperty(th,"__esModule",{value:!0});th.camelCase=void 0;var z4=/^--[a-zA-Z0-9_-]+$/,$4=/-([a-z])/g,B4=/^[^-]+$/,F4=/^-(webkit|moz|ms|o|khtml)-/,U4=/^-(ms)-/,W4=function(e){return!e||B4.test(e)||z4.test(e)},K4=function(e,t){return t.toUpperCase()},nw=function(e,t){return"".concat(t,"-")},H4=function(e,t){return t===void 0&&(t={}),W4(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(U4,nw):e=e.replace(F4,nw),e.replace($4,K4))};th.camelCase=H4;var V4=Ys&&Ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},q4=V4(Wx),Y4=th;function Av(e,t){var n={};return!e||typeof e!="string"||(0,q4.default)(e,function(r,i){r&&i&&(n[(0,Y4.camelCase)(r,t)]=i)}),n}Av.default=Av;var G4=Av;const X4=hl(G4),CT=PT("end"),Kx=PT("start");function PT(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Q4(e){const t=Kx(e),n=CT(e);if(t&&n)return{start:t,end:n}}function bc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rw(e.position):"start"in e||"end"in e?rw(e):"line"in e||"column"in e?Ov(e):""}function Ov(e){return iw(e&&e.line)+":"+iw(e&&e.column)}function rw(e){return Ov(e&&e.start)+"-"+Ov(e&&e.end)}function iw(e){return e&&typeof e=="number"?e:1}class Un extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=bc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Un.prototype.file="";Un.prototype.name="";Un.prototype.reason="";Un.prototype.message="";Un.prototype.stack="";Un.prototype.column=void 0;Un.prototype.line=void 0;Un.prototype.ancestors=void 0;Un.prototype.cause=void 0;Un.prototype.fatal=void 0;Un.prototype.place=void 0;Un.prototype.ruleId=void 0;Un.prototype.source=void 0;const Hx={}.hasOwnProperty,J4=new Map,Z4=/[A-Z]/g,e$=new Set(["table","tbody","thead","tfoot","tr"]),t$=new Set(["td","th"]),ET="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function n$(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=u$(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=c$(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ux:j4,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=TT(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function TT(e,t,n){if(t.type==="element")return r$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return i$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return o$(e,t,n);if(t.type==="mdxjsEsm")return a$(e,t);if(t.type==="root")return s$(e,t,n);if(t.type==="text")return l$(e,t)}function r$(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ux,e.schema=i),e.ancestors.push(t);const a=OT(e,t.tagName,!1),s=d$(e,t);let l=qx(e,t);return e$.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!d4(c):!0})),AT(e,s,a,t),Vx(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function i$(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Vc(e,t.position)}function a$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vc(e,t.position)}function o$(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ux,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:OT(e,t.name,!0),s=p$(e,t),l=qx(e,t);return AT(e,s,a,t),Vx(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function s$(e,t,n){const r={};return Vx(r,qx(e,t)),e.create(t,e.Fragment,r,n)}function l$(e,t){return t.value}function AT(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Vx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function c$(e,t,n){return r;function r(i,a,s,l){const u=Array.isArray(s.children)?n:t;return l?u(a,s,l):u(a,s)}}function u$(e,t){return n;function n(r,i,a,s){const l=Array.isArray(a.children),c=Kx(r);return t(i,a,s,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function d$(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Hx.call(t.properties,i)){const a=f$(e,i,t.properties[i]);if(a){const[s,l]=a;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&t$.has(t.tagName)?r=l:n[s]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function p$(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Vc(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else Vc(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function qx(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:J4;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=i.get(c)||0;s=c+"-"+u,i.set(c,u+1)}}const l=TT(e,a,s);l!==void 0&&n.push(l)}return n}function f$(e,t,n){const r=y4(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?o4(n):w4(n)),r.property==="style"){let i=typeof n=="object"?n:h$(e,String(n));return e.stylePropertyNameCase==="css"&&(i=m$(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?m4[r.property]||r.property:r.attribute,n]}}function h$(e,t){try{return X4(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Un("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ET+"#cannot-parse-style-attribute",i}}function OT(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const l=Yj(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=s}else r=Yj(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Hx.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vc(e)}function Vc(e,t){const n=new Un("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ET+"#cannot-handle-mdx-estrees-without-createevaluater",n}function m$(e){const t={};let n;for(n in e)Hx.call(e,n)&&(t[g$(n)]=e[n]);return t}function g$(e){let t=e.replace(Z4,v$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function v$(e){return"-"+e.toLowerCase()}const Fm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},y$={};function x$(e,t){const n=y$,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return IT(e,r,i)}function IT(e,t,n){if(b$(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return aw(e.children,t,n)}return Array.isArray(e)?aw(e,t,n):""}function aw(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=IT(e[i],t,n);return r.join("")}function b$(e){return!!(e&&typeof e=="object")}const ow=document.createElement("i");function Yx(e){const t="&"+e+";";ow.innerHTML=t;const n=ow.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Pi(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function _r(e,t){return e.length>0?(Pi(e,e.length,0,t),e):t}const sw={}.hasOwnProperty;function j$(e){const t={};let n=-1;for(;++n<e.length;)w$(t,e[n]);return t}function w$(e,t){let n;for(n in t){const i=(sw.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){sw.call(i,s)||(i[s]=[]);const l=a[s];S$(i[s],Array.isArray(l)?l:l?[l]:[])}}}function S$(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Pi(e,0,0,r)}function NT(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ws(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xi=Xa(/[A-Za-z]/),gr=Xa(/[\dA-Za-z]/),k$=Xa(/[#-'*+\--9=?A-Z^-~]/);function Iv(e){return e!==null&&(e<32||e===127)}const Nv=Xa(/\d/),C$=Xa(/[\dA-Fa-f]/),P$=Xa(/[!-/:-@[-`{-~]/);function Ke(e){return e!==null&&e<-2}function cr(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const E$=Xa(new RegExp("\\p{P}|\\p{S}","u")),T$=Xa(/\s/);function Xa(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function jl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&gr(e.charCodeAt(n+1))&&gr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(s=String.fromCharCode(a,l),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function At(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(c){return gt(c)?(e.enter(n),l(c)):t(c)}function l(c){return gt(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const A$={tokenize:O$};function O$(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),At(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ke(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),s)}}const I$={tokenize:N$},lw={tokenize:_$};function N$(e){const t=this,n=[];let r=0,i,a,s;return l;function l(j){if(r<n.length){const w=n[r];return t.containerState=w[1],e.attempt(w[0].continuation,c,u)(j)}return u(j)}function c(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const w=t.events.length;let k=w,S;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){S=t.events[k][1].end;break}v(r);let E=w;for(;E<t.events.length;)t.events[E][1].end={...S},E++;return Pi(t.events,k+1,0,t.events.slice(w)),t.events.length=E,u(j)}return l(j)}function u(j){if(r===n.length){if(!i)return h(j);if(i.currentConstruct&&i.currentConstruct.concrete)return g(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(lw,p,d)(j)}function p(j){return i&&b(),v(r),h(j)}function d(j){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(j)}function h(j){return t.containerState={},e.attempt(lw,m,g)(j)}function m(j){return r++,n.push([t.currentConstruct,t.containerState]),h(j)}function g(j){if(j===null){i&&b(),v(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),y(j)}function y(j){if(j===null){x(e.exit("chunkFlow"),!0),v(0),e.consume(j);return}return Ke(j)?(e.consume(j),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(j),y)}function x(j,w){const k=t.sliceStream(j);if(w&&k.push(null),j.previous=a,a&&(a.next=j),a=j,i.defineSkip(j.start),i.write(k),t.parser.lazy[j.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const E=t.events.length;let A=E,D,T;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(D){T=t.events[A][1].end;break}D=!0}for(v(r),S=E;S<t.events.length;)t.events[S][1].end={...T},S++;Pi(t.events,A+1,0,t.events.slice(E)),t.events.length=S}}function v(j){let w=n.length;for(;w-- >j;){const k=n[w];t.containerState=k[1],k[0].exit.call(t,e)}n.length=j}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function _$(e,t,n){return At(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cw(e){if(e===null||cr(e)||T$(e))return 1;if(E$(e))return 2}function Gx(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const _v={name:"attention",resolveAll:M$,tokenize:R$};function M$(e,t){let n=-1,r,i,a,s,l,c,u,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},h={...e[n][1].start};uw(d,-c),uw(h,c),s={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=_r(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=_r(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),u=_r(u,Gx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=_r(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=_r(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Pi(e,r-1,n-r+3,u),n=r+u.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function R$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=cw(r);let a;return s;function s(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const u=e.exit("attentionSequence"),p=cw(c),d=!p||p===2&&i||n.includes(c),h=!i||i===2&&p||n.includes(r);return u._open=!!(a===42?d:d&&(i||!h)),u._close=!!(a===42?h:h&&(p||!d)),t(c)}}function uw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const D$={name:"autolink",tokenize:L$};function L$(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return xi(m)?(e.consume(m),s):m===64?n(m):u(m)}function s(m){return m===43||m===45||m===46||gr(m)?(r=1,l(m)):u(m)}function l(m){return m===58?(e.consume(m),r=0,c):(m===43||m===45||m===46||gr(m))&&r++<32?(e.consume(m),l):(r=0,u(m))}function c(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Iv(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),p):k$(m)?(e.consume(m),u):n(m)}function p(m){return gr(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,p):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||gr(m))&&r++<63){const g=m===45?h:d;return e.consume(m),g}return n(m)}}const nh={partial:!0,tokenize:z$};function z$(e,t,n){return r;function r(a){return gt(a)?At(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ke(a)?t(a):n(a)}}const _T={continuation:{tokenize:B$},exit:F$,name:"blockQuote",tokenize:$$};function $$(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return gt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function B$(e,t,n){const r=this;return i;function i(s){return gt(s)?At(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(_T,t,n)(s)}}function F$(e){e.exit("blockQuote")}const MT={name:"characterEscape",tokenize:U$};function U$(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return P$(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const RT={name:"characterReference",tokenize:W$};function W$(e,t,n){const r=this;let i=0,a,s;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,s=gr,p(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=C$,p):(e.enter("characterReferenceValue"),a=7,s=Nv,p(d))}function p(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return s===gr&&!Yx(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<a?(e.consume(d),p):n(d)}}const dw={partial:!0,tokenize:H$},pw={concrete:!0,name:"codeFenced",tokenize:K$};function K$(e,t,n){const r=this,i={partial:!0,tokenize:k};let a=0,s=0,l;return c;function c(S){return u(S)}function u(S){const E=r.events[r.events.length-1];return a=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,l=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(S)}function p(S){return S===l?(s++,e.consume(S),p):s<3?n(S):(e.exit("codeFencedFenceSequence"),gt(S)?At(e,d,"whitespace")(S):d(S))}function d(S){return S===null||Ke(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(dw,y,w)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(S))}function h(S){return S===null||Ke(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):gt(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,m,"whitespace")(S)):S===96&&S===l?n(S):(e.consume(S),h)}function m(S){return S===null||Ke(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||Ke(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===l?n(S):(e.consume(S),g)}function y(S){return e.attempt(i,w,x)(S)}function x(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),v}function v(S){return a>0&>(S)?At(e,b,"linePrefix",a+1)(S):b(S)}function b(S){return S===null||Ke(S)?e.check(dw,y,w)(S):(e.enter("codeFlowValue"),j(S))}function j(S){return S===null||Ke(S)?(e.exit("codeFlowValue"),b(S)):(e.consume(S),j)}function w(S){return e.exit("codeFenced"),t(S)}function k(S,E,A){let D=0;return T;function T(O){return S.enter("lineEnding"),S.consume(O),S.exit("lineEnding"),I}function I(O){return S.enter("codeFencedFence"),gt(O)?At(S,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):_(O)}function _(O){return O===l?(S.enter("codeFencedFenceSequence"),G(O)):A(O)}function G(O){return O===l?(D++,S.consume(O),G):D>=s?(S.exit("codeFencedFenceSequence"),gt(O)?At(S,K,"whitespace")(O):K(O)):A(O)}function K(O){return O===null||Ke(O)?(S.exit("codeFencedFence"),E(O)):A(O)}}}function H$(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Um={name:"codeIndented",tokenize:q$},V$={partial:!0,tokenize:Y$};function q$(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),At(e,a,"linePrefix",5)(u)}function a(u){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?c(u):Ke(u)?e.attempt(V$,s,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ke(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Y$(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ke(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):At(e,a,"linePrefix",5)(s)}function a(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):Ke(s)?i(s):n(s)}}const G$={name:"codeText",previous:Q$,resolve:X$,tokenize:J$};function X$(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Q$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function J$(e,t,n){let r=0,i,a;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(a=e.enter("codeTextSequence"),i=0,p(d)):Ke(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||Ke(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function p(d){return d===96?(e.consume(d),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",u(d))}}class Z${constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Kl(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Kl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Kl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Kl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Kl(this.left,n.reverse())}}}function Kl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function DT(e){const t={};let n=-1,r,i,a,s,l,c,u;const p=new Z$(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,e6(p,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=p.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},l=p.slice(i,n),l.unshift(r),p.splice(i,n-i+1,l))}}return Pi(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!u}function e6(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,c=[],u={};let p,d,h=-1,m=n,g=0,y=0;const x=[y];for(;m;){for(;e.get(++i)[1]!==m;);a.push(i),m._tokenizer||(p=r.sliceStream(m),m.next||p.push(null),d&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(p),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(y=h+1,x.push(y),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):x.pop(),h=x.length;h--;){const v=l.slice(x[h],x[h+1]),b=a.pop();c.push([b,b+v.length-1]),e.splice(b,2,v)}for(c.reverse(),h=-1;++h<c.length;)u[g+c[h][0]]=g+c[h][1],g+=c[h][1]-c[h][0]-1;return u}const t6={resolve:r6,tokenize:i6},n6={partial:!0,tokenize:a6};function r6(e){return DT(e),e}function i6(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):Ke(l)?e.check(n6,s,a)(l):(e.consume(l),i)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function a6(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),At(e,a,"linePrefix")}function a(s){if(s===null||Ke(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function LT(e,t,n,r,i,a,s,l,c){const u=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(v),e.exit(a),h):v===null||v===32||v===41||Iv(v)?n(v):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),y(v))}function h(v){return v===62?(e.enter(a),e.consume(v),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(l),h(v)):v===null||v===60||Ke(v)?n(v):(e.consume(v),v===92?g:m)}function g(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function y(v){return!p&&(v===null||v===41||cr(v))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(v)):p<u&&v===40?(e.consume(v),p++,y):v===41?(e.consume(v),p--,y):v===null||v===32||v===40||Iv(v)?n(v):(e.consume(v),v===92?x:y)}function x(v){return v===40||v===41||v===92?(e.consume(v),y):y(v)}}function zT(e,t,n,r,i,a){const s=this;let l=0,c;return u;function u(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(a),p}function p(m){return l>999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(a),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):Ke(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||Ke(m)||l++>999?(e.exit("chunkString"),p(m)):(e.consume(m),c||(c=!gt(m)),m===92?h:d)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,d):d(m)}}function $T(e,t,n,r,i,a){let s;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,c):n(h)}function c(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(a),u(h))}function u(h){return h===s?(e.exit(a),c(s)):h===null?n(h):Ke(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),At(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===s||h===null||Ke(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?d:p)}function d(h){return h===s||h===92?(e.consume(h),p):p(h)}}function jc(e,t){let n;return r;function r(i){return Ke(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):gt(i)?At(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const o6={name:"definition",tokenize:l6},s6={partial:!0,tokenize:c6};function l6(e,t,n){const r=this;let i;return a;function a(m){return e.enter("definition"),s(m)}function s(m){return zT.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return i=Ws(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return cr(m)?jc(e,u)(m):u(m)}function u(m){return LT(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function p(m){return e.attempt(s6,d,d)(m)}function d(m){return gt(m)?At(e,h,"whitespace")(m):h(m)}function h(m){return m===null||Ke(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function c6(e,t,n){return r;function r(l){return cr(l)?jc(e,i)(l):n(l)}function i(l){return $T(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return gt(l)?At(e,s,"whitespace")(l):s(l)}function s(l){return l===null||Ke(l)?t(l):n(l)}}const u6={name:"hardBreakEscape",tokenize:d6};function d6(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ke(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const p6={name:"headingAtx",resolve:f6,tokenize:h6};function f6(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Pi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function h6(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||cr(p)?(e.exit("atxHeadingSequence"),l(p)):n(p)}function l(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||Ke(p)?(e.exit("atxHeading"),t(p)):gt(p)?At(e,l,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),l(p))}function u(p){return p===null||p===35||cr(p)?(e.exit("atxHeadingText"),l(p)):(e.consume(p),u)}}const m6=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fw=["pre","script","style","textarea"],g6={concrete:!0,name:"htmlFlow",resolveTo:x6,tokenize:b6},v6={partial:!0,tokenize:w6},y6={partial:!0,tokenize:j6};function x6(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function b6(e,t,n){const r=this;let i,a,s,l,c;return u;function u(N){return p(N)}function p(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),h):N===47?(e.consume(N),a=!0,y):N===63?(e.consume(N),i=3,r.interrupt?t:P):xi(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function h(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,l=0,g):xi(N)?(e.consume(N),i=4,r.interrupt?t:P):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:P):n(N)}function g(N){const pe="CDATA[";return N===pe.charCodeAt(l++)?(e.consume(N),l===pe.length?r.interrupt?t:_:g):n(N)}function y(N){return xi(N)?(e.consume(N),s=String.fromCharCode(N),x):n(N)}function x(N){if(N===null||N===47||N===62||cr(N)){const pe=N===47,ve=s.toLowerCase();return!pe&&!a&&fw.includes(ve)?(i=1,r.interrupt?t(N):_(N)):m6.includes(s.toLowerCase())?(i=6,pe?(e.consume(N),v):r.interrupt?t(N):_(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):a?b(N):j(N))}return N===45||gr(N)?(e.consume(N),s+=String.fromCharCode(N),x):n(N)}function v(N){return N===62?(e.consume(N),r.interrupt?t:_):n(N)}function b(N){return gt(N)?(e.consume(N),b):T(N)}function j(N){return N===47?(e.consume(N),T):N===58||N===95||xi(N)?(e.consume(N),w):gt(N)?(e.consume(N),j):T(N)}function w(N){return N===45||N===46||N===58||N===95||gr(N)?(e.consume(N),w):k(N)}function k(N){return N===61?(e.consume(N),S):gt(N)?(e.consume(N),k):j(N)}function S(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),c=N,E):gt(N)?(e.consume(N),S):A(N)}function E(N){return N===c?(e.consume(N),c=null,D):N===null||Ke(N)?n(N):(e.consume(N),E)}function A(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||cr(N)?k(N):(e.consume(N),A)}function D(N){return N===47||N===62||gt(N)?j(N):n(N)}function T(N){return N===62?(e.consume(N),I):n(N)}function I(N){return N===null||Ke(N)?_(N):gt(N)?(e.consume(N),I):n(N)}function _(N){return N===45&&i===2?(e.consume(N),B):N===60&&i===1?(e.consume(N),W):N===62&&i===4?(e.consume(N),F):N===63&&i===3?(e.consume(N),P):N===93&&i===5?(e.consume(N),$):Ke(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(v6,re,G)(N)):N===null||Ke(N)?(e.exit("htmlFlowData"),G(N)):(e.consume(N),_)}function G(N){return e.check(y6,K,re)(N)}function K(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),O}function O(N){return N===null||Ke(N)?G(N):(e.enter("htmlFlowData"),_(N))}function B(N){return N===45?(e.consume(N),P):_(N)}function W(N){return N===47?(e.consume(N),s="",R):_(N)}function R(N){if(N===62){const pe=s.toLowerCase();return fw.includes(pe)?(e.consume(N),F):_(N)}return xi(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),R):_(N)}function $(N){return N===93?(e.consume(N),P):_(N)}function P(N){return N===62?(e.consume(N),F):N===45&&i===2?(e.consume(N),P):_(N)}function F(N){return N===null||Ke(N)?(e.exit("htmlFlowData"),re(N)):(e.consume(N),F)}function re(N){return e.exit("htmlFlow"),t(N)}}function j6(e,t,n){const r=this;return i;function i(s){return Ke(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function w6(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(nh,t,n)}}const S6={name:"htmlText",tokenize:k6};function k6(e,t,n){const r=this;let i,a,s;return l;function l(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),c}function c(P){return P===33?(e.consume(P),u):P===47?(e.consume(P),k):P===63?(e.consume(P),j):xi(P)?(e.consume(P),A):n(P)}function u(P){return P===45?(e.consume(P),p):P===91?(e.consume(P),a=0,g):xi(P)?(e.consume(P),b):n(P)}function p(P){return P===45?(e.consume(P),m):n(P)}function d(P){return P===null?n(P):P===45?(e.consume(P),h):Ke(P)?(s=d,W(P)):(e.consume(P),d)}function h(P){return P===45?(e.consume(P),m):d(P)}function m(P){return P===62?B(P):P===45?h(P):d(P)}function g(P){const F="CDATA[";return P===F.charCodeAt(a++)?(e.consume(P),a===F.length?y:g):n(P)}function y(P){return P===null?n(P):P===93?(e.consume(P),x):Ke(P)?(s=y,W(P)):(e.consume(P),y)}function x(P){return P===93?(e.consume(P),v):y(P)}function v(P){return P===62?B(P):P===93?(e.consume(P),v):y(P)}function b(P){return P===null||P===62?B(P):Ke(P)?(s=b,W(P)):(e.consume(P),b)}function j(P){return P===null?n(P):P===63?(e.consume(P),w):Ke(P)?(s=j,W(P)):(e.consume(P),j)}function w(P){return P===62?B(P):j(P)}function k(P){return xi(P)?(e.consume(P),S):n(P)}function S(P){return P===45||gr(P)?(e.consume(P),S):E(P)}function E(P){return Ke(P)?(s=E,W(P)):gt(P)?(e.consume(P),E):B(P)}function A(P){return P===45||gr(P)?(e.consume(P),A):P===47||P===62||cr(P)?D(P):n(P)}function D(P){return P===47?(e.consume(P),B):P===58||P===95||xi(P)?(e.consume(P),T):Ke(P)?(s=D,W(P)):gt(P)?(e.consume(P),D):B(P)}function T(P){return P===45||P===46||P===58||P===95||gr(P)?(e.consume(P),T):I(P)}function I(P){return P===61?(e.consume(P),_):Ke(P)?(s=I,W(P)):gt(P)?(e.consume(P),I):D(P)}function _(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),i=P,G):Ke(P)?(s=_,W(P)):gt(P)?(e.consume(P),_):(e.consume(P),K)}function G(P){return P===i?(e.consume(P),i=void 0,O):P===null?n(P):Ke(P)?(s=G,W(P)):(e.consume(P),G)}function K(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||cr(P)?D(P):(e.consume(P),K)}function O(P){return P===47||P===62||cr(P)?D(P):n(P)}function B(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function W(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),R}function R(P){return gt(P)?At(e,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):$(P)}function $(P){return e.enter("htmlTextData"),s(P)}}const Xx={name:"labelEnd",resolveAll:T6,resolveTo:A6,tokenize:O6},C6={tokenize:I6},P6={tokenize:N6},E6={tokenize:_6};function T6(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Pi(e,0,e.length,n),e}function A6(e,t){let n=e.length,r=0,i,a,s,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[s][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=_r(l,e.slice(a+1,a+r+3)),l=_r(l,[["enter",p,t]]),l=_r(l,Gx(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),l=_r(l,[["exit",p,t],e[s-2],e[s-1],["exit",u,t]]),l=_r(l,e.slice(s+1)),l=_r(l,[["exit",c,t]]),Pi(e,a,e.length,l),e}function O6(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(h){return a?a._inactive?d(h):(s=r.parser.defined.includes(Ws(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):n(h)}function c(h){return h===40?e.attempt(C6,p,s?p:d)(h):h===91?e.attempt(P6,p,s?u:d)(h):s?p(h):d(h)}function u(h){return e.attempt(E6,p,d)(h)}function p(h){return t(h)}function d(h){return a._balanced=!0,n(h)}}function I6(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return cr(d)?jc(e,a)(d):a(d)}function a(d){return d===41?p(d):LT(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return cr(d)?jc(e,c)(d):p(d)}function l(d){return n(d)}function c(d){return d===34||d===39||d===40?$T(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):p(d)}function u(d){return cr(d)?jc(e,p)(d):p(d)}function p(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function N6(e,t,n){const r=this;return i;function i(l){return zT.call(r,e,a,s,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Ws(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function _6(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const M6={name:"labelStartImage",resolveAll:Xx.resolveAll,tokenize:R6};function R6(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const D6={name:"labelStartLink",resolveAll:Xx.resolveAll,tokenize:L6};function L6(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Wm={name:"lineEnding",tokenize:z6};function z6(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),At(e,t,"linePrefix")}}const Xd={name:"thematicBreak",tokenize:$6};function $6(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ke(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),gt(u)?At(e,l,"whitespace")(u):l(u))}}const tr={continuation:{tokenize:W6},exit:H6,name:"list",tokenize:U6},B6={partial:!0,tokenize:V6},F6={partial:!0,tokenize:K6};function U6(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Nv(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Xd,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return Nv(m)&&++s<10?(e.consume(m),c):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(nh,r.interrupt?n:p,e.attempt(B6,h,d))}function p(m){return r.containerState.initialBlankLine=!0,a++,h(m)}function d(m){return gt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function W6(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(nh,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,At(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!gt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(F6,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,At(e,e.attempt(tr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function K6(e,t,n){const r=this;return At(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function H6(e){e.exit(this.containerState.type)}function V6(e,t,n){const r=this;return At(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!gt(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const hw={name:"setextUnderline",resolveTo:q6,tokenize:Y6};function q6(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Y6(e,t,n){const r=this;let i;return a;function a(u){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),gt(u)?At(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ke(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const G6={tokenize:X6};function X6(e){const t=this,n=e.attempt(nh,r,e.attempt(this.parser.constructs.flowInitial,i,At(e,e.attempt(this.parser.constructs.flow,i,e.attempt(t6,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Q6={resolveAll:FT()},J6=BT("string"),Z6=BT("text");function BT(e){return{resolveAll:FT(e==="text"?e3:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,l);return s;function s(p){return u(p)?a(p):l(p)}function l(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return u(p)?(n.exit("data"),a(p)):(n.consume(p),c)}function u(p){if(p===null)return!0;const d=i[p];let h=-1;if(d)for(;++h<d.length;){const m=d[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function FT(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function e3(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,s=-1,l=0,c;for(;a--;){const u=i[a];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(u===-2)c=!0,l++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const t3={42:tr,43:tr,45:tr,48:tr,49:tr,50:tr,51:tr,52:tr,53:tr,54:tr,55:tr,56:tr,57:tr,62:_T},n3={91:o6},r3={[-2]:Um,[-1]:Um,32:Um},i3={35:p6,42:Xd,45:[hw,Xd],60:g6,61:hw,95:Xd,96:pw,126:pw},a3={38:RT,92:MT},o3={[-5]:Wm,[-4]:Wm,[-3]:Wm,33:M6,38:RT,42:_v,60:[D$,S6],91:D6,92:[u6,MT],93:Xx,95:_v,96:G$},s3={null:[_v,Q6]},l3={null:[42,95]},c3={null:[]},u3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:l3,contentInitial:n3,disable:c3,document:t3,flow:i3,flowInitial:r3,insideSpan:s3,string:a3,text:o3},Symbol.toStringTag,{value:"Module"}));function d3(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],l=[];const c={attempt:E(k),check:E(S),consume:b,enter:j,exit:w,interrupt:E(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:d};let p=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function d(I){return s=_r(s,I),x(),s[s.length-1]!==null?[]:(A(t,0),u.events=Gx(a,u.events,u),u.events)}function h(I,_){return f3(m(I),_)}function m(I){return p3(s,I)}function g(){const{_bufferIndex:I,_index:_,line:G,column:K,offset:O}=r;return{_bufferIndex:I,_index:_,line:G,column:K,offset:O}}function y(I){i[I.line]=I.column,T()}function x(){let I;for(;r._index<s.length;){const _=s[r._index];if(typeof _=="string")for(I=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===I&&r._bufferIndex<_.length;)v(_.charCodeAt(r._bufferIndex));else v(_)}}function v(I){p=p(I)}function b(I){Ke(I)?(r.line++,r.column=1,r.offset+=I===-3?2:1,T()):I!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=I}function j(I,_){const G=_||{};return G.type=I,G.start=g(),u.events.push(["enter",G,u]),l.push(G),G}function w(I){const _=l.pop();return _.end=g(),u.events.push(["exit",_,u]),_}function k(I,_){A(I,_.from)}function S(I,_){_.restore()}function E(I,_){return G;function G(K,O,B){let W,R,$,P;return Array.isArray(K)?re(K):"tokenize"in K?re([K]):F(K);function F(X){return oe;function oe(de){const ie=de!==null&&X[de],J=de!==null&&X.null,xe=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(J)?J:J?[J]:[]];return re(xe)(de)}}function re(X){return W=X,R=0,X.length===0?B:N(X[R])}function N(X){return oe;function oe(de){return P=D(),$=X,X.partial||(u.currentConstruct=X),X.name&&u.parser.constructs.disable.null.includes(X.name)?ve():X.tokenize.call(_?Object.assign(Object.create(u),_):u,c,pe,ve)(de)}}function pe(X){return I($,P),O}function ve(X){return P.restore(),++R<W.length?N(W[R]):B}}}function A(I,_){I.resolveAll&&!a.includes(I)&&a.push(I),I.resolve&&Pi(u.events,_,u.events.length-_,I.resolve(u.events.slice(_),u)),I.resolveTo&&(u.events=I.resolveTo(u.events,u))}function D(){const I=g(),_=u.previous,G=u.currentConstruct,K=u.events.length,O=Array.from(l);return{from:K,restore:B};function B(){r=I,u.previous=_,u.currentConstruct=G,u.events.length=K,l=O,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function p3(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function f3(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
|
|
69
|
-
`;break}case-3:{s=`\r
|
|
70
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function h3(e){const r={constructs:j$([u3,...(e||{}).extensions||[]]),content:i(A$),defined:[],document:i(I$),flow:i(G6),lazy:{},string:i(J6),text:i(Z6)};return r;function i(a){return s;function s(l){return d3(r,a,l)}}}function m3(e){for(;!DT(e););return e}const mw=/[\0\t\n\r]/g;function g3(){let e=1,t="",n=!0,r;return i;function i(a,s,l){const c=[];let u,p,d,h,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(mw.lastIndex=d,u=mw.exec(a),h=u&&u.index!==void 0?u.index:a.length,m=a.charCodeAt(h),!u){t=a.slice(d);break}if(m===10&&d===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<h&&(c.push(a.slice(d,h)),e+=h-d),m){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const v3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function y3(e){return e.replace(v3,x3)}function x3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return NT(n.slice(a?2:1),a?16:10)}return Yx(n)||e}const UT={}.hasOwnProperty;function b3(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),j3(n)(m3(h3(n).document().write(g3()(e,t,!0))))}function j3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ve),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(Le),blockQuote:a(J),characterEscape:D,characterReference:D,codeFenced:a(xe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(xe,s),codeText:a(ae,s),codeTextData:D,data:D,codeFlowValue:D,definition:a(Me),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(se),hardBreakEscape:a($e),hardBreakTrailing:a($e),htmlFlow:a(Ye,s),htmlFlowData:D,htmlText:a(Ye,s),htmlTextData:D,image:a(lt),label:s,link:a(Ve),listItem:a(ke),listItemValue:h,listOrdered:a(rt,d),listUnordered:a(rt),paragraph:a(De),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Le),strong:a(Fe),thematicBreak:a(Z)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:ie,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:X,characterReference:oe,codeFenced:c(x),codeFencedFence:y,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:T,codeIndented:c(v),codeText:c(O),codeTextData:T,data:T,definition:c(),definitionDestinationString:w,definitionLabelString:b,definitionTitleString:j,emphasis:c(),hardBreakEscape:c(_),hardBreakTrailing:c(_),htmlFlow:c(G),htmlFlowData:T,htmlText:c(K),htmlTextData:T,image:c(W),label:$,labelText:R,lineEnding:I,link:c(B),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:pe,resourceDestinationString:P,resourceTitleString:F,resource:re,setextHeading:c(A),setextHeadingLineSequence:E,setextHeadingText:S,strong:c(),thematicBreak:c()}};WT(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let ce={type:"root",children:[]};const M={stack:[ce],tokenStack:[],config:t,enter:l,exit:u,buffer:s,resume:p,data:n},fe=[];let ge=-1;for(;++ge<Y.length;)if(Y[ge][1].type==="listOrdered"||Y[ge][1].type==="listUnordered")if(Y[ge][0]==="enter")fe.push(ge);else{const Te=fe.pop();ge=i(Y,Te,ge)}for(ge=-1;++ge<Y.length;){const Te=t[Y[ge][0]];UT.call(Te,Y[ge][1].type)&&Te[Y[ge][1].type].call(Object.assign({sliceSerialize:Y[ge][2].sliceSerialize},M),Y[ge][1])}if(M.tokenStack.length>0){const Te=M.tokenStack[M.tokenStack.length-1];(Te[1]||gw).call(M,void 0,Te[0])}for(ce.position={start:ga(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:ga(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},ge=-1;++ge<t.transforms.length;)ce=t.transforms[ge](ce)||ce;return ce}function i(Y,ce,M){let fe=ce-1,ge=-1,Te=!1,Ee,Q,ue,Se;for(;++fe<=M;){const je=Y[fe];switch(je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{je[0]==="enter"?ge++:ge--,Se=void 0;break}case"lineEndingBlank":{je[0]==="enter"&&(Ee&&!Se&&!ge&&!ue&&(ue=fe),Se=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Se=void 0}if(!ge&&je[0]==="enter"&&je[1].type==="listItemPrefix"||ge===-1&&je[0]==="exit"&&(je[1].type==="listUnordered"||je[1].type==="listOrdered")){if(Ee){let ze=fe;for(Q=void 0;ze--;){const We=Y[ze];if(We[1].type==="lineEnding"||We[1].type==="lineEndingBlank"){if(We[0]==="exit")continue;Q&&(Y[Q][1].type="lineEndingBlank",Te=!0),We[1].type="lineEnding",Q=ze}else if(!(We[1].type==="linePrefix"||We[1].type==="blockQuotePrefix"||We[1].type==="blockQuotePrefixWhitespace"||We[1].type==="blockQuoteMarker"||We[1].type==="listItemIndent"))break}ue&&(!Q||ue<Q)&&(Ee._spread=!0),Ee.end=Object.assign({},Q?Y[Q][1].start:je[1].end),Y.splice(Q||fe,0,["exit",Ee,je[2]]),fe++,M++}if(je[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},je[1].start),end:void 0};Ee=ze,Y.splice(fe,0,["enter",ze,je[2]]),fe++,M++,ue=void 0,Se=!0}}}return Y[ce][1]._spread=Te,M}function a(Y,ce){return M;function M(fe){l.call(this,Y(fe),fe),ce&&ce.call(this,fe)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(Y,ce,M){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([ce,M||void 0]),Y.position={start:ga(ce.start),end:void 0}}function c(Y){return ce;function ce(M){Y&&Y.call(this,M),u.call(this,M)}}function u(Y,ce){const M=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==Y.type&&(ce?ce.call(this,Y,fe[0]):(fe[1]||gw).call(this,Y,fe[0]));else throw new Error("Cannot close `"+Y.type+"` ("+bc({start:Y.start,end:Y.end})+"): it’s not open");M.position.end=ga(Y.end)}function p(){return x$(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(Y){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function m(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=Y}function g(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=Y}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Y.replace(/(\r?\n|\r)$/g,"")}function b(Y){const ce=this.resume(),M=this.stack[this.stack.length-1];M.label=ce,M.identifier=Ws(this.sliceSerialize(Y)).toLowerCase()}function j(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.title=Y}function w(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.url=Y}function k(Y){const ce=this.stack[this.stack.length-1];if(!ce.depth){const M=this.sliceSerialize(Y).length;ce.depth=M}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function E(Y){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function D(Y){const M=this.stack[this.stack.length-1].children;let fe=M[M.length-1];(!fe||fe.type!=="text")&&(fe=Ze(),fe.position={start:ga(Y.start),end:void 0},M.push(fe)),this.stack.push(fe)}function T(Y){const ce=this.stack.pop();ce.value+=this.sliceSerialize(Y),ce.position.end=ga(Y.end)}function I(Y){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const M=ce.children[ce.children.length-1];M.position.end=ga(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(D.call(this,Y),T.call(this,Y))}function _(){this.data.atHardBreak=!0}function G(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Y}function K(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Y}function O(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.value=Y}function B(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ce,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function W(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ce,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function R(Y){const ce=this.sliceSerialize(Y),M=this.stack[this.stack.length-2];M.label=y3(ce),M.identifier=Ws(ce).toLowerCase()}function $(){const Y=this.stack[this.stack.length-1],ce=this.resume(),M=this.stack[this.stack.length-1];if(this.data.inReference=!0,M.type==="link"){const fe=Y.children;M.children=fe}else M.alt=ce}function P(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.url=Y}function F(){const Y=this.resume(),ce=this.stack[this.stack.length-1];ce.title=Y}function re(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function pe(Y){const ce=this.resume(),M=this.stack[this.stack.length-1];M.label=ce,M.identifier=Ws(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function ve(Y){this.data.characterReferenceType=Y.type}function X(Y){const ce=this.sliceSerialize(Y),M=this.data.characterReferenceType;let fe;M?(fe=NT(ce,M==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=Yx(ce);const ge=this.stack[this.stack.length-1];ge.value+=fe}function oe(Y){const ce=this.stack.pop();ce.position.end=ga(Y.end)}function de(Y){T.call(this,Y);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(Y)}function ie(Y){T.call(this,Y);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(Y)}function J(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function ae(){return{type:"inlineCode",value:""}}function Me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function se(){return{type:"emphasis",children:[]}}function Le(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function Ye(){return{type:"html",value:""}}function lt(){return{type:"image",title:null,url:"",alt:null}}function Ve(){return{type:"link",title:null,url:"",children:[]}}function rt(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function ke(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function De(){return{type:"paragraph",children:[]}}function Fe(){return{type:"strong",children:[]}}function Ze(){return{type:"text",value:""}}function Z(){return{type:"thematicBreak"}}}function ga(e){return{line:e.line,column:e.column,offset:e.offset}}function WT(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?WT(e,r):w3(e,r)}}function w3(e,t){let n;for(n in t)if(UT.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function gw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+bc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+bc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+bc({start:t.start,end:t.end})+") is still open")}function S3(e){const t=this;t.parser=n;function n(r){return b3(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function k3(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function C3(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
71
|
-
`}]}function P3(e,t){const n=t.value?t.value+`
|
|
72
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function E3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function T3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function A3(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=jl(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function O3(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function KT(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function N3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return KT(e,t);const i={src:jl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function _3(e,t){const n={src:jl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function M3(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function R3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return KT(e,t);const i={href:jl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function D3(e,t){const n={href:jl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function L3(e,t,n){const r=e.all(t),i=n?z3(n):HT(t),a={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const p=r[l];(i||l!==0||p.type!=="element"||p.tagName!=="p")&&s.push({type:"text",value:`
|
|
73
|
-
`}),p.type==="element"&&p.tagName==="p"&&!i?s.push(...p.children):s.push(p)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
|
|
74
|
-
`});const u={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,u),e.applyData(t,u)}function z3(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=HT(n[r])}return t}function HT(e){const t=e.spread;return t??e.children.length>1}function $3(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function B3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function F3(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function U3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function W3(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Kx(t.children[1]),c=CT(t.children[t.children.length-1]);l&&c&&(s.position={start:l,end:c}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function K3(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const d=t.children[c],h={},m=s?s[c]:void 0;m&&(h.align=m);let g={type:"element",tagName:a,properties:h,children:[]};d&&(g.children=e.all(d),e.patch(d,g),g=e.applyData(d,g)),u.push(g)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,p),e.applyData(t,p)}function H3(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const vw=9,yw=32;function V3(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(xw(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(xw(t.slice(i),i>0,!1)),a.join("")}function xw(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===vw||a===yw;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===vw||a===yw;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function q3(e,t){const n={type:"text",value:V3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Y3(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const G3={blockquote:k3,break:C3,code:P3,delete:E3,emphasis:T3,footnoteReference:A3,heading:O3,html:I3,imageReference:N3,image:_3,inlineCode:M3,linkReference:R3,link:D3,listItem:L3,list:$3,paragraph:B3,root:F3,strong:U3,table:W3,tableCell:H3,tableRow:K3,text:q3,thematicBreak:Y3,toml:fd,yaml:fd,definition:fd,footnoteDefinition:fd};function fd(){}const VT=-1,rh=0,wc=1,Ip=2,Qx=3,Jx=4,Zx=5,e0=6,qT=7,YT=8,X3=typeof self=="object"?self:globalThis,bw=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new X3[e](t)},Q3=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case rh:case VT:return n(s,i);case wc:{const l=n([],i);for(const c of s)l.push(r(c));return l}case Ip:{const l=n({},i);for(const[c,u]of s)l[r(c)]=r(u);return l}case Qx:return n(new Date(s),i);case Jx:{const{source:l,flags:c}=s;return n(new RegExp(l,c),i)}case Zx:{const l=n(new Map,i);for(const[c,u]of s)l.set(r(c),r(u));return l}case e0:{const l=n(new Set,i);for(const c of s)l.add(r(c));return l}case qT:{const{name:l,message:c}=s;return n(bw(l,c),i)}case YT:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(bw(a,s),i)};return r},jw=e=>Q3(new Map,e)(0),ss="",{toString:J3}={},{keys:Z3}=Object,Hl=e=>{const t=typeof e;if(t!=="object"||!e)return[rh,t];const n=J3.call(e).slice(8,-1);switch(n){case"Array":return[wc,ss];case"Object":return[Ip,ss];case"Date":return[Qx,ss];case"RegExp":return[Jx,ss];case"Map":return[Zx,ss];case"Set":return[e0,ss];case"DataView":return[wc,n]}return n.includes("Array")?[wc,n]:n.includes("Error")?[qT,n]:[Ip,n]},hd=([e,t])=>e===rh&&(t==="function"||t==="symbol"),e8=(e,t,n,r)=>{const i=(s,l)=>{const c=r.push(s)-1;return n.set(l,c),c},a=s=>{if(n.has(s))return n.get(s);let[l,c]=Hl(s);switch(l){case rh:{let p=s;switch(c){case"bigint":l=YT,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return i([VT],s)}return i([l,p],s)}case wc:{if(c){let h=s;return c==="DataView"?h=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(s)),i([c,[...h]],s)}const p=[],d=i([l,p],s);for(const h of s)p.push(a(h));return d}case Ip:{if(c)switch(c){case"BigInt":return i([c,s.toString()],s);case"Boolean":case"Number":case"String":return i([c,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const p=[],d=i([l,p],s);for(const h of Z3(s))(e||!hd(Hl(s[h])))&&p.push([a(h),a(s[h])]);return d}case Qx:return i([l,s.toISOString()],s);case Jx:{const{source:p,flags:d}=s;return i([l,{source:p,flags:d}],s)}case Zx:{const p=[],d=i([l,p],s);for(const[h,m]of s)(e||!(hd(Hl(h))||hd(Hl(m))))&&p.push([a(h),a(m)]);return d}case e0:{const p=[],d=i([l,p],s);for(const h of s)(e||!hd(Hl(h)))&&p.push(a(h));return d}}const{message:u}=s;return i([l,{name:c,message:u}],s)};return a},ww=(e,{json:t,lossy:n}={})=>{const r=[];return e8(!(t||n),!!t,new Map,r)(e),r},Np=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?jw(ww(e,t)):structuredClone(e):(e,t)=>jw(ww(e,t));function t8(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function n8(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function r8(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||t8,r=e.options.footnoteBackLabel||n8,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const p=e.all(u),d=String(u.identifier).toUpperCase(),h=jl(d.toLowerCase());let m=0;const g=[],y=e.footnoteCounts.get(d);for(;y!==void 0&&++m<=y;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,m);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const x=p[p.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const b=x.children[x.children.length-1];b&&b.type==="text"?b.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else p.push(...g);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(p,!0)};e.patch(u,v),l.push(v)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Np(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
75
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
76
|
-
`}]}}const GT=function(e){if(e==null)return s8;if(typeof e=="function")return ih(e);if(typeof e=="object")return Array.isArray(e)?i8(e):a8(e);if(typeof e=="string")return o8(e);throw new Error("Expected function, string, or object as test")};function i8(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=GT(e[n]);return ih(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function a8(e){const t=e;return ih(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function o8(e){return ih(t);function t(n){return n&&n.type===e}}function ih(e){return t;function t(n,r,i){return!!(l8(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function s8(){return!0}function l8(e){return e!==null&&typeof e=="object"&&"type"in e}const XT=[],c8=!0,Sw=!1,u8="skip";function d8(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=GT(i),s=r?-1:1;l(e,void 0,[])();function l(c,u,p){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=XT,g,y,x;if((!t||a(c,u,p[p.length-1]||void 0))&&(m=p8(n(c,p)),m[0]===Sw))return m;if("children"in c&&c.children){const v=c;if(v.children&&m[0]!==u8)for(y=(r?v.children.length:-1)+s,x=p.concat(v);y>-1&&y<v.children.length;){const b=v.children[y];if(g=l(b,y,x)(),g[0]===Sw)return g;y=typeof g[1]=="number"?g[1]:y+s}}return m}}}function p8(e){return Array.isArray(e)?e:typeof e=="number"?[c8,e]:e==null?XT:[e]}function QT(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),d8(e,a,l,i);function l(c,u){const p=u[u.length-1],d=p?p.children.indexOf(c):void 0;return s(c,d,p)}}const Mv={}.hasOwnProperty,f8={};function h8(e,t){const n=t||f8,r=new Map,i=new Map,a=new Map,s={...G3,...n.handlers},l={all:u,applyData:g8,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:c,options:n,patch:m8,wrap:y8};return QT(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const d=p.type==="definition"?r:i,h=String(p.identifier).toUpperCase();d.has(h)||d.set(h,p)}}),l;function c(p,d){const h=p.type,m=l.handlers[h];if(Mv.call(l.handlers,h)&&m)return m(l,p,d);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in p){const{children:y,...x}=p,v=Np(x);return v.children=l.all(p),v}return Np(p)}return(l.options.unknownHandler||v8)(l,p,d)}function u(p){const d=[];if("children"in p){const h=p.children;let m=-1;for(;++m<h.length;){const g=l.one(h[m],p);if(g){if(m&&h[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=kw(g.value)),!Array.isArray(g)&&g.type==="element")){const y=g.children[0];y&&y.type==="text"&&(y.value=kw(y.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function m8(e,t){e.position&&(t.position=Q4(e))}function g8(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,Np(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function v8(e,t){const n=t.data||{},r="value"in t&&!(Mv.call(n,"hProperties")||Mv.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function y8(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
77
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
78
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
79
|
-
`}),n}function kw(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Cw(e,t){const n=h8(e,t),r=n.one(e,void 0),i=r8(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
80
|
-
`},i),a}function x8(e,t){return e&&"run"in e?async function(n,r){const i=Cw(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Cw(n,{file:r,...e||t})}}function Pw(e){if(e)throw e}var Qd=Object.prototype.hasOwnProperty,JT=Object.prototype.toString,Ew=Object.defineProperty,Tw=Object.getOwnPropertyDescriptor,Aw=function(t){return typeof Array.isArray=="function"?Array.isArray(t):JT.call(t)==="[object Array]"},Ow=function(t){if(!t||JT.call(t)!=="[object Object]")return!1;var n=Qd.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Qd.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Qd.call(t,i)},Iw=function(t,n){Ew&&n.name==="__proto__"?Ew(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Nw=function(t,n){if(n==="__proto__")if(Qd.call(t,n)){if(Tw)return Tw(t,n).value}else return;return t[n]},b8=function e(){var t,n,r,i,a,s,l=arguments[0],c=1,u=arguments.length,p=!1;for(typeof l=="boolean"&&(p=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=Nw(l,n),i=Nw(t,n),l!==i&&(p&&i&&(Ow(i)||(a=Aw(i)))?(a?(a=!1,s=r&&Aw(r)?r:[]):s=r&&Ow(r)?r:{},Iw(l,{name:n,newValue:e(p,s,i)})):typeof i<"u"&&Iw(l,{name:n,newValue:i}));return l};const Km=hl(b8);function Rv(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function j8(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(c,...u){const p=e[++a];let d=-1;if(c){s(c);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,p?w8(p,l)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function w8(e,t){let n;return r;function r(...s){const l=e.length>s.length;let c;l&&s.push(i);try{c=e.apply(this,s)}catch(u){const p=u;if(l&&n)throw p;return i(p)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(s,...l){n||(n=!0,t(s,...l))}function a(s){i(null,s)}}const gi={basename:S8,dirname:k8,extname:C8,join:P8,sep:"/"};function S8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');vu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function k8(e){if(vu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function C8(e){vu(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function P8(...e){let t=-1,n;for(;++t<e.length;)vu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":E8(n)}function E8(e){vu(e);const t=e.codePointAt(0)===47;let n=T8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function T8(e,t){let n="",r=0,i=-1,a=0,s=-1,l,c;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else l===46&&a>-1?a++:a=-1}return n}function vu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const A8={cwd:O8};function O8(){return"/"}function Dv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function I8(e){if(typeof e=="string")e=new URL(e);else if(!Dv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return N8(e)}function N8(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Hm=["history","path","basename","stem","extname","dirname"];class ZT{constructor(t){let n;t?Dv(t)?n={path:t}:typeof t=="string"||_8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":A8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Hm.length;){const a=Hm[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Hm.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?gi.basename(this.path):void 0}set basename(t){qm(t,"basename"),Vm(t,"basename"),this.path=gi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?gi.dirname(this.path):void 0}set dirname(t){_w(this.basename,"dirname"),this.path=gi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?gi.extname(this.path):void 0}set extname(t){if(Vm(t,"extname"),_w(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=gi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Dv(t)&&(t=I8(t)),qm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?gi.basename(this.path,this.extname):void 0}set stem(t){qm(t,"stem"),Vm(t,"stem"),this.path=gi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Un(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Vm(e,t){if(e&&e.includes(gi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+gi.sep+"`")}function qm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _w(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function _8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const M8=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},R8={}.hasOwnProperty;class t0 extends M8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=j8()}copy(){const t=new t0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Km(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Xm("data",this.frozen),this.namespace[t]=n,this):R8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Xm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=md(t),r=this.parser||this.Parser;return Ym("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ym("process",this.parser||this.Parser),Gm("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const l=md(t),c=r.parse(l);r.run(c,l,function(p,d,h){if(p||!d||!h)return u(p);const m=d,g=r.stringify(m,h);z8(g)?h.value=g:h.result=g,u(p,h)});function u(p,d){p||!d?s(p):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Ym("processSync",this.parser||this.Parser),Gm("processSync",this.compiler||this.Compiler),this.process(t,i),Rw("processSync","process",n),r;function i(a,s){n=!0,Pw(a),r=s}}run(t,n,r){Mw(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,l){const c=md(n);i.run(t,c,u);function u(p,d,h){const m=d||t;p?l(p):s?s(m):r(void 0,m,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Rw("runSync","run",r),i;function a(s,l){Pw(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=md(n),i=this.compiler||this.Compiler;return Gm("stringify",i),Mw(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Xm("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[p,...d]=u;c(p,d)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(i.settings=Km(!0,i.settings,u.settings))}function l(u){let p=-1;if(u!=null)if(Array.isArray(u))for(;++p<u.length;){const d=u[p];a(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,p){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===u){h=d;break}if(h===-1)r.push([u,...p]);else if(p.length>0){let[m,...g]=p;const y=r[h][1];Rv(y)&&Rv(m)&&(m=Km(!0,y,m)),r[h]=[u,m,...g]}}}}const D8=new t0().freeze();function Ym(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Xm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Mw(e){if(!Rv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Rw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function md(e){return L8(e)?e:new ZT(e)}function L8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function z8(e){return typeof e=="string"||$8(e)}function $8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const B8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Dw=[],Lw={allowDangerousHtml:!0},F8=/^(https?|ircs?|mailto|xmpp)$/i,U8=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Sc(e){const t=W8(e),n=K8(e);return H8(t.runSync(t.parse(n),n),e)}function W8(e){const t=e.rehypePlugins||Dw,n=e.remarkPlugins||Dw,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Lw}:Lw;return D8().use(S3).use(n).use(x8,r).use(t)}function K8(e){const t=e.children||"",n=new ZT;return typeof t=="string"&&(n.value=t),n}function H8(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||V8;for(const p of U8)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+B8+p.id,void 0);return QT(e,u),n$(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(p,d,h){if(p.type==="raw"&&h&&typeof d=="number")return s?h.children.splice(d,1):h.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let m;for(m in Fm)if(Object.hasOwn(Fm,m)&&Object.hasOwn(p.properties,m)){const g=p.properties[m],y=Fm[m];(y===null||y.includes(p.tagName))&&(p.properties[m]=c(String(g||""),m,p))}}if(p.type==="element"){let m=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(p,d,h)),m&&h&&typeof d=="number")return l&&p.children?h.children.splice(d,1,...p.children):h.children.splice(d,1),d}}}function V8(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||F8.test(e.slice(0,t))?e:""}const te=(e,t)=>{if(!t)return e;const n=new URLSearchParams;Object.entries(t).forEach(([i,a])=>{a!=null&&a!==""&&n.set(i,String(a))});const r=n.toString();return r?`${e}?${r}`:e},ne=async(e,t={})=>{const n=localStorage.getItem("auth_token"),r=await fetch(e,{...t,headers:{"Content-Type":"application/json",...n?{"Access-Token":n}:{},...t.headers||{}}});if(!r.ok){if(r.status===401){localStorage.removeItem("auth_token");const l=await r.text(),c=new Error(l||r.statusText);throw c.status=401,c}const a=await r.text();let s=null;try{const l=JSON.parse(a);l.error&&(s=l.error)}catch{}throw new Error(s||a||r.statusText)}return r.status===204?void 0:(r.headers.get("content-type")||"").includes("application/json")?r.json():r.text()},V={getAuthStatus:()=>ne(te("/api/auth/status")),login:e=>ne(te("/api/auth/login"),{method:"POST",body:JSON.stringify({authCode:e})}),checkVersion:()=>ne(te("/api/version/check")),getVendors:()=>ne(te("/api/vendors")),createVendor:e=>ne(te("/api/vendors"),{method:"POST",body:JSON.stringify(e)}),updateVendor:(e,t)=>ne(te(`/api/vendors/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteVendor:e=>ne(te(`/api/vendors/${e}`),{method:"DELETE"}),getAPIServices:e=>ne(te("/api/services",e?{vendorId:e}:void 0)),createAPIService:e=>ne(te("/api/services"),{method:"POST",body:JSON.stringify(e)}),updateAPIService:(e,t)=>ne(te(`/api/services/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAPIService:e=>ne(te(`/api/services/${e}`),{method:"DELETE"}),getRoutes:()=>ne(te("/api/routes")),createRoute:e=>ne(te("/api/routes"),{method:"POST",body:JSON.stringify(e)}),updateRoute:(e,t)=>ne(te(`/api/routes/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRoute:e=>ne(te(`/api/routes/${e}`),{method:"DELETE"}),getToolBindings:()=>ne(te("/api/tool-bindings")),activateToolRoute:(e,t)=>ne(te("/api/tool-bindings/activate"),{method:"POST",body:JSON.stringify({tool:e,routeId:t})}),deactivateToolRoute:e=>ne(te("/api/tool-bindings/deactivate"),{method:"POST",body:JSON.stringify({tool:e})}),getRules:e=>ne(te("/api/rules",e?{routeId:e}:void 0)),createRule:e=>ne(te("/api/rules"),{method:"POST",body:JSON.stringify(e)}),updateRule:(e,t)=>ne(te(`/api/rules/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRule:e=>ne(te(`/api/rules/${e}`),{method:"DELETE"}),resetRuleTokens:e=>ne(te(`/api/rules/${e}/reset-tokens`),{method:"PUT"}),resetRuleRequests:e=>ne(te(`/api/rules/${e}/reset-requests`),{method:"PUT"}),clearRuleBlacklist:e=>ne(te(`/api/rules/${e}/clear-blacklist`),{method:"PUT"}),toggleRuleDisable:e=>ne(te(`/api/rules/${e}/toggle-disable`),{method:"PUT"}),clearRuleStatus:e=>ne(te(`/api/rules/${e}/clear-status`),{method:"POST"}),getRuleStatuses:()=>ne(te("/api/rules/status")),getRulesBlacklistStatus:e=>ne(te(`/api/rules/${e}/blacklist-status`)),getLogs:(e,t)=>ne(te("/api/logs",{limit:e,offset:t})),clearLogs:()=>ne(te("/api/logs"),{method:"DELETE"}),getErrorLogs:(e,t)=>ne(te("/api/error-logs",{limit:e,offset:t})),clearErrorLogs:()=>ne(te("/api/error-logs"),{method:"DELETE"}),getLogsCount:()=>ne(te("/api/logs/count")),getErrorLogsCount:()=>ne(te("/api/error-logs/count")),searchLogs:(e,t,n)=>ne(te("/api/logs/search",{query:e,limit:t,offset:n})),searchLogsCount:e=>ne(te("/api/logs/search/count",{query:e})),queryLogs:async({filters:e,keyword:t,limit:n,offset:r})=>{const i=await ne(te("/api/logs",{targetType:e==null?void 0:e.targetType,vendorId:e==null?void 0:e.vendorId,serviceId:e==null?void 0:e.serviceId,model:e==null?void 0:e.model,routeId:e==null?void 0:e.routeId,keyword:t,limit:n,offset:r}));if(!Array.isArray(i)){const l=i;return{logs:l.logs??[],total:l.total??0}}const a=i;let s=a.length;try{!!(e&&(e.targetType||e.vendorId||e.serviceId||e.model||e.routeId))||(s=(await ne(te("/api/logs/count"))).count)}catch{}return{logs:a,total:s}},queryErrorLogs:async({filters:e,keyword:t,limit:n,offset:r})=>{const i=await ne(te("/api/error-logs",{targetType:e==null?void 0:e.targetType,vendorId:e==null?void 0:e.vendorId,serviceId:e==null?void 0:e.serviceId,model:e==null?void 0:e.model,routeId:e==null?void 0:e.routeId,keyword:t,limit:n,offset:r}));if(!Array.isArray(i)){const l=i;return{logs:l.logs??[],total:l.total??0}}const a=i;let s=a.length;try{!!(e&&(e.targetType||e.vendorId||e.serviceId||e.model||e.routeId))||!!t||(s=(await ne(te("/api/error-logs/count"))).count)}catch{}return{logs:a,total:s}},searchErrorLogs:(e,t,n)=>ne(te("/api/error-logs/search",{query:e,limit:t,offset:n})),searchErrorLogsCount:e=>ne(te("/api/error-logs/search/count",{query:e})),getStatistics:(e=30)=>ne(te("/api/statistics",{days:e})),resetStatistics:()=>ne(te("/api/statistics"),{method:"DELETE"}),getPerformanceServicesOverview:()=>ne(te("/api/performance/services-overview")),getPerformanceVendors:()=>ne(te("/api/performance/vendors")),getPerformanceVendor:e=>ne(te(`/api/performance/vendors/${e}`)),getPerformanceService:e=>ne(te(`/api/performance/services/${e}`)),getPerformanceModel:(e,t)=>ne(te(`/api/performance/services/${e}/models/${encodeURIComponent(t)}`)),getConfig:()=>ne(te("/api/config")),updateConfig:e=>ne(te("/api/config"),{method:"PUT",body:JSON.stringify(e)}),exportData:async e=>(await ne(te("/api/export"),{method:"POST",body:JSON.stringify({password:e})})).data,previewImportData:(e,t)=>ne(te("/api/import/preview"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),importData:(e,t)=>ne(te("/api/import"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),writeClaudeConfig:(e,t,n)=>ne(te("/api/write-config/claude"),{method:"POST",body:JSON.stringify({enableAgentTeams:e,enableBypassPermissionsSupport:t,permissionsDefaultMode:n})}),writeCodexConfig:e=>ne(te("/api/write-config/codex"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e})}),restoreClaudeConfig:()=>ne(te("/api/restore-config/claude"),{method:"POST"}),restoreCodexConfig:()=>ne(te("/api/restore-config/codex"),{method:"POST"}),updateClaudeAgentTeams:e=>ne(te("/api/update-claude-agent-teams"),{method:"POST",body:JSON.stringify({enableAgentTeams:e})}),updateClaudeBypassPermissionsSupport:e=>ne(te("/api/update-claude-bypass-permissions-support"),{method:"POST",body:JSON.stringify({enableBypassPermissionsSupport:e})}),updateCodexReasoningEffort:e=>ne(te("/api/update-codex-reasoning-effort"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e})}),checkClaudeBackup:()=>ne(te("/api/check-backup/claude")),checkCodexBackup:()=>ne(te("/api/check-backup/codex")),checkClaudeVersion:()=>ne(te("/api/tools/status")),getClaudeConfigStatus:()=>ne(te("/api/config-status/claude")),getCodexConfigStatus:()=>ne(te("/api/config-status/codex")),getSessions:async({filters:e,keyword:t,limit:n,offset:r}={})=>{const i=await ne(te("/api/sessions",{targetType:e==null?void 0:e.targetType,vendorId:e==null?void 0:e.vendorId,serviceId:e==null?void 0:e.serviceId,model:e==null?void 0:e.model,routeId:e==null?void 0:e.routeId,keyword:t,limit:n,offset:r}));if(!Array.isArray(i)){const l=i;return{sessions:l.sessions??[],total:l.total??0}}const a=i;let s=a.length;try{!!(e&&(e.targetType||e.vendorId||e.serviceId||e.model||e.routeId))||!!t||(s=(await ne(te("/api/sessions/count"))).count)}catch{}return{sessions:a,total:s}},getSessionsCount:()=>ne(te("/api/sessions/count")),getSession:e=>ne(te(`/api/sessions/${e}`)),getSessionLogs:(e,t)=>ne(te(`/api/sessions/${e}/logs`,{limit:t})),deleteSession:e=>ne(te(`/api/sessions/${e}`),{method:"DELETE"}),clearSessions:()=>ne(te("/api/sessions"),{method:"DELETE"}),cleanupSessions:(e,t)=>ne(te("/api/sessions/cleanup"),{method:"POST",body:JSON.stringify({beforeDays:e,onlyLogs:t})}),getRecommendVendorsMarkdown:()=>ne(te("/api/docs/recommend-vendors")),getReadmeMarkdown:()=>ne(te("/api/docs/readme")),getInstalledSkills:()=>ne(te("/api/skills/installed")),searchSkills:e=>ne(te("/api/skills/search"),{method:"POST",body:JSON.stringify({query:e})}),getSkillDetails:e=>ne(te(`/api/skills/${e}/details`)),installSkill:(e,t)=>ne(te("/api/skills/install"),{method:"POST",body:JSON.stringify({skillId:e.id,name:e.name,description:e.description,tags:e.tags,...t?{targetType:t}:{},githubUrl:e.url})}),enableSkill:(e,t)=>ne(te(`/api/skills/${e}/enable`),{method:"POST",body:JSON.stringify({targetType:t})}),disableSkill:(e,t)=>ne(te(`/api/skills/${e}/disable`),{method:"POST",body:JSON.stringify({targetType:t})}),deleteSkill:e=>ne(te(`/api/skills/${e}`),{method:"DELETE"}),createLocalSkill:e=>ne(te("/api/skills/create-local"),{method:"POST",body:JSON.stringify(e)}),getUpgradeMarkdown:()=>ne(te("/api/docs/upgrade")),getUpgrade:()=>ne(te("/api/upgrade")),acknowledgeUpgrade:()=>ne(te("/api/upgrade/ack"),{method:"POST"}),getToolsStatus:()=>ne(te("/api/tools/status")),getMCPs:()=>ne(te("/api/mcps")),getMCP:e=>ne(te(`/api/mcps/${e}`)),createMCP:e=>ne(te("/api/mcps"),{method:"POST",body:JSON.stringify(e)}),updateMCP:(e,t)=>ne(te(`/api/mcps/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteMCP:e=>ne(te(`/api/mcps/${e}`),{method:"DELETE"}),bindSessionRoute:(e,t)=>ne(te(`/api/sessions/${e}/bind-route`),{method:"PUT",body:JSON.stringify({routeId:t})}),unbindSessionRoute:e=>ne(te(`/api/sessions/${e}/bind-route`),{method:"DELETE"}),getBoundSessions:e=>ne(te(`/api/routes/${e}/bound-sessions`)),migrationPreview:(e,t)=>ne(te(`/api/sessions/${e}/migration-preview`),{method:"POST",body:JSON.stringify(t)}),migrateSession:(e,t)=>ne(te(`/api/sessions/${e}/migrate`),{method:"POST",body:JSON.stringify(t)}),migrateLaunch:(e,t)=>ne(te(`/api/sessions/${e}/migrate-launch`),{method:"POST",body:JSON.stringify(t)}),getApiPathBindings:()=>ne(te("/api/api-path-bindings")),updateApiPathBindings:(e,t)=>ne(te("/api/api-path-bindings"),{method:"PUT",body:JSON.stringify({bindings:e,models:t})}),installTool:(e,t)=>{var u;console.log("[API Client] 开始安装工具:",e);const n=window.location.protocol==="https:"?"wss:":"ws:",r=window.location.host,i=`${n}//${r}/api/tools/install`;console.log("[API Client] 连接 WebSocket:",i);let a=null;try{a=new WebSocket(i)}catch(p){return console.error("[API Client] 创建 WebSocket 失败:",p),(u=t.onError)==null||u.call(t,"创建 WebSocket 连接失败"),()=>{}}a.onopen=()=>{console.log("[API Client] WebSocket 连接已建立"),a==null||a.send(JSON.stringify({type:"install",tool:e}))},a.onmessage=p=>{var d,h,m,g,y,x,v,b,j;try{const w=JSON.parse(p.data);switch(console.log("[API Client] 收到消息:",w.type),w.type){case"start":console.log("[API Client] 安装开始:",w.data),(d=t.onStdout)==null||d.call(t,`
|
|
81
|
-
========== 开始安装 ${w.data.tool} ==========
|
|
82
|
-
`),(h=t.onStdout)==null||h.call(t,`操作系统: ${w.data.os}
|
|
83
|
-
`),(m=t.onStdout)==null||m.call(t,`执行命令: ${w.data.command}
|
|
84
|
-
`),(g=t.onStdout)==null||g.call(t,`子进程已创建 (PID: ${w.data.pid})
|
|
85
|
-
`),(y=t.onStdout)==null||y.call(t,`等待 npm 输出...
|
|
86
|
-
|
|
87
|
-
`);break;case"stdout":(x=t.onStdout)==null||x.call(t,w.data);break;case"stderr":(v=t.onStderr)==null||v.call(t,w.data);break;case"close":console.log("[API Client] 安装完成:",w.data),(b=t.onClose)==null||b.call(t,w.data.code,w.data.success),setTimeout(()=>{a==null||a.close()},1e3);break;case"error":console.error("[API Client] 安装错误:",w.data),(j=t.onError)==null||j.call(t,w.data);break}}catch(w){console.error("[API Client] 解析消息失败:",w,p.data)}},a.onclose=p=>{var d;console.log("[API Client] WebSocket 连接关闭:",p.code,p.reason),p.wasClean||(d=t.onError)==null||d.call(t,"连接意外关闭")},a.onerror=p=>{var d;console.error("[API Client] WebSocket 错误:",p),(d=t.onError)==null||d.call(t,"WebSocket 连接错误")};const s=()=>{console.log("[API Client] 清理 WebSocket 连接"),a&&(a.close(),a=null)},l=p=>{a&&a.readyState===WebSocket.OPEN?(a.send(JSON.stringify({type:"input",data:p})),console.log("[API Client] 发送输入:",p.slice(0,10))):console.warn("[API Client] WebSocket 未连接,无法发送输入")},c=s;return c.sendInput=l,c},getAccessKeys:e=>ne(te("/api/access-keys",e)),createAccessKey:e=>ne(te("/api/access-keys"),{method:"POST",body:JSON.stringify(e)}),getAccessKey:e=>ne(te(`/api/access-keys/${e}`)),updateAccessKey:(e,t)=>ne(te(`/api/access-keys/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAccessKey:e=>ne(te(`/api/access-keys/${e}`),{method:"DELETE"}),regenerateAccessKey:e=>ne(te(`/api/access-keys/${e}/regenerate`),{method:"POST"}),batchUpdateAccessKeyStatus:(e,t)=>ne(te("/api/access-keys/batch/status"),{method:"PUT",body:JSON.stringify({keyIds:e,status:t})}),batchBindAccessKeyPolicy:(e,t)=>ne(te("/api/access-keys/batch/policy"),{method:"PUT",body:JSON.stringify({keyIds:e,policyId:t})}),batchDeleteAccessKeys:e=>ne(te("/api/access-keys/batch"),{method:"DELETE",body:JSON.stringify({keyIds:e})}),getAccessKeyUsage:e=>ne(te(`/api/access-keys/${e}/usage`)),getAccessKeyUsageTrend:(e,t)=>ne(te(`/api/access-keys/${e}/usage/trend`,{days:t})),getAccessKeyLogs:(e,t)=>ne(te(`/api/access-keys/${e}/logs`,t)),getAccessKeySessions:(e,t)=>ne(te(`/api/access-keys/${e}/sessions`,t)),getAccessKeySession:(e,t)=>ne(te(`/api/access-keys/${e}/sessions/${t}`)),getAccessKeySessionLogs:(e,t,n)=>ne(te(`/api/access-keys/${e}/sessions/${t}/logs`,{limit:n})),deleteAccessKeySession:(e,t)=>ne(te(`/api/access-keys/${e}/sessions/${t}`),{method:"DELETE"}),clearAccessKeySessions:e=>ne(te(`/api/access-keys/${e}/sessions`),{method:"DELETE"}),getAccessKeyGuide:(e,t,n)=>ne(te(`/api/access-keys/${e}/guide`,{host:t,port:n})),writeAccessKeyToLocal:(e,t)=>ne(te(`/api/access-keys/${e}/write-local`),{method:"POST",body:JSON.stringify({targets:t})}),getWriteLocalRecords:()=>ne(te("/api/write-local-records")),getPolicies:()=>ne(te("/api/policies")),createPolicy:e=>ne(te("/api/policies"),{method:"POST",body:JSON.stringify(e)}),getPolicy:e=>ne(te(`/api/policies/${e}`)),updatePolicy:(e,t)=>ne(te(`/api/policies/${e}`),{method:"PUT",body:JSON.stringify(t)}),deletePolicy:e=>ne(te(`/api/policies/${e}`),{method:"DELETE"}),duplicatePolicy:e=>ne(te(`/api/policies/${e}/duplicate`),{method:"POST"}),getPolicyKeys:e=>ne(te(`/api/policies/${e}/keys`)),getPolicyTemplates:()=>ne(te("/api/policies/templates")),getAccessKeyRanking:e=>ne(te("/api/statistics/access-keys",e)),getQuotaAlerts:()=>ne(te("/api/statistics/quota-alerts")),lanScan:()=>ne(te("/api/lan/scan")),lanDiscover:(e,t)=>{const n=`http://${e}:${t}/api/lan/discover`;return fetch(n,{signal:AbortSignal.timeout(3e3)}).then(r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()})},lanSync:e=>ne(te("/api/lan/sync"),{method:"POST",body:JSON.stringify(e)}),getAgentMapSessions:()=>ne(te("/api/agent-map/sessions")),getAgentMapSessionEvents:(e,t)=>ne(te(`/api/agent-map/sessions/${e}/events`,t!=null?{since:t}:void 0)),getAgentMapStats:()=>ne(te("/api/agent-map/stats")),getAgentMapSessionMeta:e=>ne(te(`/api/agent-map/sessions/${e}/meta`)),getAgentMapNotify:()=>ne(te("/api/agent-map/notify")),setAgentMapNotify:e=>ne(te("/api/agent-map/notify"),{method:"POST",body:JSON.stringify({enabled:e})}),setAgentMapNotifyFocus:e=>ne(te("/api/agent-map/notify-focus"),{method:"POST",body:JSON.stringify({hidden:e})}),testAgentMapNotify:()=>ne(te("/api/agent-map/notify-test"),{method:"POST"}),streamAgentMap:e=>{const t=new AbortController,n=localStorage.getItem("auth_token");let r=!1,i=0;const a=async()=>{var p,d,h,m;const s=await fetch("/api/agent-map/stream",{method:"GET",signal:t.signal,headers:{Accept:"text/event-stream",...n?{"Access-Token":n}:{}}});if(!s.ok||!s.body)throw new Error(`HTTP ${s.status}`);const l=s.body.getReader(),c=new TextDecoder;let u="";for(;;){const{value:g,done:y}=await l.read();if(y)break;u+=c.decode(g,{stream:!0});let x;for(;(x=u.indexOf(`
|
|
88
|
-
|
|
89
|
-
`))!==-1;){const v=u.slice(0,x);u=u.slice(x+2);const b=v.split(`
|
|
90
|
-
`).find(k=>k.startsWith("data:"));if(!b)continue;const j=b.slice(5).trim();if(!j)continue;let w;try{w=JSON.parse(j)}catch{continue}switch(w.type){case"init":(p=e.onInit)==null||p.call(e,{type:"init",sessions:w.sessions||[],events:w.events||[],stats:w.stats,serverTime:w.serverTime});break;case"session-update":(d=e.onSessionUpdate)==null||d.call(e,w.session);break;case"activity":(h=e.onActivity)==null||h.call(e,w.event);break;case"stats":(m=e.onStats)==null||m.call(e,w.stats);break}}}};return(async()=>{var s;for(;!r;){try{await a(),i=0}catch(c){if((c==null?void 0:c.name)==="AbortError")return;(s=e.onError)==null||s.call(e,c)}if(r)break;i=Math.min(i+1,5);const l=Math.min(1e3*2**(i-1),15e3);await new Promise(c=>setTimeout(c,l))}})(),{abort:()=>{r=!0,t.abort()}}}};var st=(e=>(e.AUTH_TOKEN="authorization",e.API_KEY="x-api-key",e.G_API_KEY="x-goog-api-key",e))(st||{});const Rn={aicodingbus:{name:"AICodingBus",description:"AICodingBus 是一个Token共享平台,用户可以在平台上分享和交换Token。",tags:["官方推荐"],link:"https://aicodingbus.24x7.to/",apiBaseUrl:"https://aicodingbus.24x7.to",authType:st.AUTH_TOKEN,services:[{name:"Claude 标准接口",sourceType:"claude",apiUrl:"https://aicodingbus.24x7.to",models:""},{name:"Chat Completions 标准接口",sourceType:"openai-chat",apiUrl:"https://aicodingbus.24x7.to/v1/chat/completions",models:""},{name:"Responses 标准接口",sourceType:"openai",apiUrl:"https://aicodingbus.24x7.to",models:""}],sortedGroup:-1},minimax:{name:"Minimax",description:"国内优秀的大模型",link:"https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link",authType:st.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://api.minimaxi.com/anthropic",models:"MiniMax-M2.5, MiniMax-M2.7"},{name:"Chat Completions 标准接口(支持Coding Plan的API Key)",sourceType:"openai-chat",apiUrl:"https://api.minimaxi.com/v1/chat/completions",models:"MiniMax-M2.5, MiniMax-M2.7"}]},glm:{name:"GLM",description:"国内优秀的大模型",link:"https://www.bigmodel.cn/invite?icode=kgOTGFRH%2Ftc5Xkyu5N0wHOnfet45IvM%2BqDogImfeLyI%3D",authType:st.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://open.bigmodel.cn/api/anthropic",models:"glm-5.1, glm-5, glm-4.7, glm-4.5-air",modelLimits:{"glm-5.1":131072,"glm-5":131072,"glm-4.7":131072,"glm-4.5-air":98304}},{name:"Chat Completions 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",models:"glm-5.1, glm-5, glm-4.7, glm-4.5-air",modelLimits:{"glm-5.1":131072,"glm-5":131072,"glm-4.7":131072,"glm-4.5-air":98304}}]},kimi:{name:"Kimi",description:"国内优秀大模型",link:"https://www.kimi.ai/",authType:st.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://api.kimi.com/coding"},{name:"Chat Completions 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://api.kimi.com/coding/v1/chat/completions",models:"kimi-for-coding",modelLimits:{"kimi-for-coding":32768}}]},doubao:{name:"火山方舟(豆包)",description:"字节旗下大模型平台。Coding Plan一次性支持GLM、Kimi-K2、Deepseek多个国产模型 邀请码:Y58X463P",link:"https://volcengine.com/L/RcHlm6yxj0w/",authType:st.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://ark.cn-beijing.volces.com/api/coding",models:"ark-code-latest"},{name:"Responses 标准接口 | Coding Plan",sourceType:"openai",apiUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",models:"ark-code-latest"},{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://ark.cn-beijing.volces.com/api/compatible",models:"doubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028"},{name:"Responses 标准接口(付费API)",sourceType:"openai",apiUrl:"https://ark.cn-beijing.volces.com/api/v3",models:"doubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028"},{name:"Chat Completions 标准接口(付费API)",sourceType:"openai-chat",apiUrl:"https://ark.cn-beijing.volces.com/api/v3/chat/completions",models:"doubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028"}]},qwen:{name:"阿里云百炼(千问)",description:"国内优秀大模型",link:"https://help.aliyun.com/zh/model-studio/coding-plan",authType:st.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://coding.dashscope.aliyuncs.com/apps/anthropic",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"Responses 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://coding.dashscope.aliyuncs.com/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"Responses 标准接口(付费API)",sourceType:"openai",apiUrl:"https://dashscope.aliyuncs.com/api/v2/apps/protocols/compatible-mode/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus, kimi-k2.5, glm-4.7, MiniMax-M2.1"},{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://dashscope.aliyuncs.com/apps/anthropic",models:"qwen3-max-2026-01-23, qwen3-coder-plus, kimi-k2.5, glm-4.7, MiniMax-M2.1"}]},deepseek:{name:"DeepSeek",description:"DeepSeek 官方 API",link:"https://platform.deepseek.com",authType:st.AUTH_TOKEN,services:[{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://api.deepseek.com/anthropic",models:"deepseek-v4-flash, deepseek-v4-pro"},{name:"DeepSeek Reasoning Chat 接口(付费API)",sourceType:"openai-chat",apiUrl:"https://api.deepseek.com/v1/chat/completions",models:"deepseek-v4-flash, deepseek-v4-pro"}]},mimo:{name:"Mimo",description:"小米 Mimo 国产大模型",link:"https://platform.xiaomimimo.com?ref=M8BFP3",authType:st.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://token-plan-cn.xiaomimimo.com/anthropic",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"},{name:"Chat Completions 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://token-plan-cn.xiaomimimo.com/v1/chat/completions",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"},{name:"Chat Completions 标准接口(付费API)",sourceType:"openai-chat",apiUrl:"https://api.xiaomimimo.com/v1/chat/completions",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"},{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://api.xiaomimimo.com/anthropic",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"}]},openai:{name:"OpenAI",description:"OpenAI 官方 API",link:"https://platform.openai.com",authType:st.AUTH_TOKEN,services:[{name:"GPT官方接口",sourceType:"openai",apiUrl:"https://api.openai.com"}],sortedGroup:3},anthropic:{name:"Anthropic",description:"Anthropic 官方 API",link:"https://www.anthropic.com",authType:st.API_KEY,services:[{name:"Claude官方接口",sourceType:"claude",apiUrl:"https://api.anthropic.com"}],sortedGroup:3},google:{name:"Google AI",description:"Gemini官方接口",authType:st.G_API_KEY,services:[{name:"Gemini",sourceType:"gemini",apiUrl:"https://generativelanguage.googleapis.com"}],sortedGroup:3},openrouter:{name:"OpenRouter",description:"一站式 AI 模型路由平台",link:"https://openrouter.ai",authType:st.AUTH_TOKEN,apiBaseUrl:"https://openrouter.ai/api",services:[{name:"Claude Code专属接口",sourceType:"claude",apiUrl:"https://openrouter.ai/api",models:"anthropic/claude-fable-5, anthropic/claude-opus-4.8, anthropic/claude-opus-4.6, anthropic/claude-opus-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4.5, anthropic/claude-haiku-4.5"},{name:"Responses 标准接口 (Beta)",sourceType:"openai",apiUrl:"https://openrouter.ai/api/v1",models:"openai/gpt-5.3-codex, openai/gpt-5.4, openai/gpt-5.5, openai/gpt-5.4-mini"},{name:"Chat Completions 标准接口",sourceType:"openai-chat",apiUrl:"https://openrouter.ai/api/v1/chat/completions",models:"openai/gpt-5.5, openai/gpt-5.4, openai/gpt-5.4-mini, openai/gpt-5.3-codex, google/gemini-3-flash-preview, google/gemini-3-pro-preview"},{name:"Claude 标准接口",sourceType:"claude",apiUrl:"https://openrouter.ai/api",models:"anthropic/claude-fable-5, anthropic/claude-opus-4.8, anthropic/claude-opus-4.6, anthropic/claude-sonnet-4.6, anthropic/claude-haiku-4.6",authType:st.AUTH_TOKEN}],sortedGroup:3},agnes:{name:"Agnes",description:"优秀的模型厂商,拥有多种模型,提供免费 API 使用",tags:["永久免费"],link:"https://platform.agnes-ai.com",authType:st.AUTH_TOKEN,services:[{name:"Chat Completions 标准接口(免费)",sourceType:"openai-chat",apiUrl:"https://apihub.agnes-ai.com/v1/chat/completions",models:"agnes-2.0-flash, agnes-1.5-flash",authType:st.AUTH_TOKEN}],sortedGroup:-1}},rl={"claude-code":"Claude Code",codex:"Codex"},gd={claude:"Claude","claude-chat":"Claude Chat",openai:"OpenAI","openai-chat":"OpenAI Chat",gemini:"Gemini","gemini-chat":"Gemini Chat"},q8={"openai-chat":"填写完整的接口地址,如:https://api.openai.com/v1/chat/completions",openai:"填写接口Base URL地址,如:https://api.openai.com,(注,有的服务商需要带/v1)","claude-chat":"填写完整的接口地址,如:https://api.anthropic.com/v1/messages",claude:"只填写 base 地址,如:https://api.anthropic.com",gemini:"只填写 base 地址,如:https://generativelanguage.googleapis.com","gemini-chat":"填写完整的接口地址,如:https://generativelanguage.googleapis.com/v1beta/models/{modelName}:{endPoint} 注意,{modelName}和{endPoint}会在实际运行时被替换,你只需要按此处的格式填写即可"},vd={[st.AUTH_TOKEN]:"AUTH_TOKEN",[st.API_KEY]:"API_KEY",[st.G_API_KEY]:"GOOGLE_API_KEY"},Qm={[st.AUTH_TOKEN]:"使用 Authorization: Bearer <token> 进行认证",[st.API_KEY]:"使用 x-api-key: <token> 进行认证",[st.G_API_KEY]:"使用 x-goog-api-key: <token> 进行认证"},Y8=`#### 🚀 智谱 GLM Coding Plan
|
|
91
|
-
|
|
92
|
-
> 价格便宜,国内速度快,支持多工具(Claude Code等 20+ 大编程工具),而且其中的GLM-4.7是目前国内最强编程模型。适合对模型有一定要求,同时又无法获取国外模型的朋友入手。
|
|
93
|
-
>
|
|
94
|
-
> 链接:[https://www.bigmodel.cn](https://www.bigmodel.cn/invite?icode=kgOTGFRH%2Ftc5Xkyu5N0wHOnfet45IvM%2BqDogImfeLyI%3D) | [一键配置](# "glm")
|
|
95
|
-
|
|
96
|
-
#### 🌌 MiniMax Coding Plan
|
|
97
|
-
|
|
98
|
-
> 国内优秀的大模型,支持Claude Code和Codex等编程工具,其中 M2.1 模型在大模型评测中获得非常高的分数。可作为国内大模型的备选方案。
|
|
99
|
-
> 链接:[https://platform.minimaxi.com/subscribe/coding-plan](https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link) | [一键配置](# "minimax")
|
|
100
|
-
|
|
101
|
-
#### 🧠 Mimo Coding Plan
|
|
102
|
-
|
|
103
|
-
> 小米旗下 Mimo 国产大模型,支持 Claude Code 和 Codex 等编程工具,提供 Coding Plan 和付费 API 两种模式,涵盖 mimo-v2.5-pro、mimo-v2-pro、mimo-v2.5、mimo-v2-omni、mimo-v2-flash 等多个模型,性价比出色。
|
|
104
|
-
> 链接:[https://platform.xiaomimimo.com](https://platform.xiaomimimo.com?ref=M8BFP3) | [一键配置](# "mimo")
|
|
105
|
-
`;function eA(e,t){let n,r;const i=a=>a.replace(/!\[.*?\]\(.*?\)/g,s=>{var c;const l=(c=s.match(/\((.*?)\)/))==null?void 0:c[1];if((l==null?void 0:l.indexOf("public/"))===0){const u=l.replace("public/","/");return s.replace(l,u)}else return s});return function(){const[a,s]=f.useState(i(e));return f.useEffect(()=>{if(r){s(i(r));return}const l=c=>{c&&(r=c,s(i(c)))};n?n.then(l).catch(()=>{}):n=t().then(l).catch(()=>{})},[]),a}}const G8=eA(Y8,V.getRecommendVendorsMarkdown),X8=eA("",V.getUpgradeMarkdown),tA=f.createContext(void 0);function yu(){const e=f.useContext(tA);if(!e)throw new Error("useConfirm must be used within ConfirmProvider");return e}let so=null;function Q8({children:e}){const[t,n]=f.useState(!1),[r,i]=f.useState({message:""}),a=p=>(i(p),n(!0),new Promise(d=>{so=d})),s=()=>{n(!1),so&&(so(!0),so=null)},l=()=>{n(!1),so&&(so(!1),so=null)},u=(()=>{switch(r.type){case"danger":return{icon:"⚠️",iconColor:"#dc3545",buttonClass:"btn-danger"};case"warning":return{icon:"⚠",iconColor:"#ffc107",buttonClass:"btn-warning"};default:return{icon:"ℹ️",iconColor:"#17a2b8",buttonClass:"btn-primary"}}})();return o.jsxs(tA.Provider,{value:{confirm:a},children:[e,t&&o.jsx("div",{className:"modal-overlay",style:{zIndex:1e6},children:o.jsx("div",{className:"modal",style:{maxWidth:"500px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:r.title||"确认操作"})}),o.jsx("div",{style:{padding:"20px"},children:o.jsxs("div",{style:{display:"flex",gap:"15px",alignItems:"flex-start"},children:[o.jsx("span",{style:{fontSize:"32px",flexShrink:0},children:u.icon}),o.jsx("div",{style:{flex:1,whiteSpace:"pre-wrap",lineHeight:"1.6"},children:r.message})]})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:l,children:r.cancelText||"取消"}),o.jsx("button",{className:`btn ${u.buttonClass}`,onClick:s,children:r.confirmText||"确认"})]})]})})})]})}let J8=0;const Lv=new Set;let _p=[];function nA(){Lv.forEach(e=>e([..._p]))}function yd(e,t,n=3e3){const r=++J8,i={id:r,message:e,type:t,duration:n};return _p.push(i),nA(),n>0&&setTimeout(()=>{rA(r)},n),r}function rA(e){_p=_p.filter(t=>t.id!==e),nA()}const U={success(e,t){yd(e,"success",t)},error(e,t){yd(e,"error",t)},warning(e,t){yd(e,"warning",t)},info(e,t){yd(e,"info",t)}};function Z8(){const[e,t]=f.useState([]);f.useEffect(()=>(Lv.add(t),()=>{Lv.delete(t)}),[]);const n=i=>({...{padding:"12px 20px",borderRadius:"8px",marginBottom:"10px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",minWidth:"300px",maxWidth:"500px",animation:"slideIn 0.2s ease-out"},...{success:{backgroundColor:"#d4edda",color:"#155724",border:"1px solid #c3e6cb"},error:{backgroundColor:"#f8d7da",color:"#721c24",border:"1px solid #f5c6cb"},warning:{backgroundColor:"#fff3cd",color:"#856404",border:"1px solid #ffeaa7"},info:{backgroundColor:"#d1ecf1",color:"#0c5460",border:"1px solid #bee5eb"}}[i]}),r=i=>({success:"✓",error:"✕",warning:"⚠",info:"ℹ"})[i];return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:`
|
|
106
|
-
@keyframes slideIn {
|
|
107
|
-
from {
|
|
108
|
-
transform: translateX(50px);
|
|
109
|
-
opacity: 0;
|
|
110
|
-
}
|
|
111
|
-
to {
|
|
112
|
-
transform: translateX(0);
|
|
113
|
-
opacity: 1;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
`}),o.jsx("div",{style:{position:"fixed",top:"20px",right:"20px",zIndex:1000001},children:e.map(i=>o.jsxs("div",{style:n(i.type),children:[o.jsx("span",{style:{fontSize:"18px",fontWeight:"bold"},children:r(i.type)}),o.jsx("span",{style:{flex:1},children:i.message}),o.jsx("button",{onClick:()=>rA(i.id),style:{background:"none",border:"none",color:"inherit",cursor:"pointer",fontSize:"18px",padding:"0",marginLeft:"10px",opacity:.6},onMouseEnter:a=>a.currentTarget.style.opacity="1",onMouseLeave:a=>a.currentTarget.style.opacity="0.6",children:"×"})]},i.id))})]})}function iA({value:e,onChange:t,existingVendors:n=[],disabled:r=!1}){const[i,a]=f.useState(!1),s=f.useRef(null);f.useEffect(()=>{if(!i)return;const u=p=>{s.current&&!s.current.contains(p.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[i]);const l=f.useMemo(()=>{const u=Object.entries(Rn).map(([h,m])=>({key:h,name:m.name,sortedGroup:m.sortedGroup??0}));u.sort((h,m)=>h.sortedGroup-m.sortedGroup);const p=[];let d=null;for(const h of u)d!==null&&h.sortedGroup!==d&&p.push(null),p.push(h),d=h.sortedGroup;return p},[]),c=e?Rn[e]:null;return o.jsxs("div",{ref:s,style:{position:"relative"},children:[o.jsxs("div",{onClick:()=>!r&&a(!i),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",border:`1px solid ${i?"var(--accent-primary)":"var(--border-primary)"}`,borderRadius:"8px",background:"var(--input-bg, var(--bg-primary))",cursor:r?"not-allowed":"pointer",opacity:r?.6:1,transition:"border-color 0.2s",userSelect:"none"},children:[c?o.jsx("span",{style:{fontSize:"14px",color:"var(--text-primary)"},children:c.name}):o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:"请选择供应商"}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",transform:i?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s"},children:"▼"})]}),i&&o.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:999,marginTop:"4px",maxHeight:"320px",overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-primary)",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"},children:l.map((u,p)=>{var g;if(!u)return o.jsx("div",{style:{height:"1px",background:"var(--border-primary)"}},`sep-${p}`);const d=Rn[u.key],h=n.some(y=>y.name===u.name),m=e===u.key;return o.jsxs("div",{onClick:()=>{t(u.key),a(!1)},style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 14px",cursor:"pointer",background:m?"var(--accent-light)":h?"rgba(255, 167, 38, 0.08)":"rgba(76, 175, 80, 0.08)",borderLeft:m?"3px solid var(--accent-primary)":"3px solid transparent",transition:"background 0.15s"},onMouseEnter:y=>{m||(y.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:y=>{m||(y.currentTarget.style.background=h?"rgba(255, 167, 38, 0.08)":"rgba(76, 175, 80, 0.08)")},children:[o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:m?600:400,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[u.name,(g=d==null?void 0:d.tags)==null?void 0:g.map((y,x)=>o.jsx("span",{style:{fontSize:"11px",marginLeft:"6px",padding:"1px 6px",borderRadius:"8px",background:"rgba(229, 57, 53, 0.1)",color:"#e53935",fontWeight:500,verticalAlign:"middle"},children:y},x))]}),(d==null?void 0:d.description)&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.description})]}),o.jsx("span",{style:{fontSize:"11px",padding:"2px 8px",borderRadius:"10px",fontWeight:500,whiteSpace:"nowrap",background:h?"rgba(255, 167, 38, 0.15)":"rgba(76, 175, 80, 0.15)",color:h?"#e67e22":"#4caf50"},children:h?"已配置":"可用"})]},u.key)})})]})}function zw(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0");return`${t}-${n}-${r}T${i}:${a}`}function eB({value:e=[],onChange:t,placeholder:n,inputValue:r,onInputChange:i}){const a=l=>{if(l.key==="Enter"||l.key===","){l.preventDefault();const c=r.trim();c&&!e.includes(c)&&(t([...e,c]),i(""))}else l.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1))},s=l=>{t(e.filter((c,u)=>u!==l))};return o.jsx("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"4px",padding:"8px",minHeight:"40px",background:"var(--bg-secondary)"},children:o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",alignItems:"center"},children:[e.map((l,c)=>o.jsxs("span",{style:{backgroundColor:"var(--accent-light)",color:"var(--text-primary)",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[l,o.jsx("button",{type:"button",onClick:()=>s(c),style:{background:"none",border:"none",color:"var(--text-primary)",cursor:"pointer",fontSize:"16px",lineHeight:"1",padding:"0",marginLeft:"4px"},onMouseOver:u=>u.currentTarget.style.color="var(--accent-danger)",onMouseOut:u=>u.currentTarget.style.color="var(--text-primary)",children:"×"})]},c)),o.jsx("input",{type:"text",value:r,onChange:l=>i(l.target.value),onKeyDown:a,placeholder:n,style:{border:"none",outline:"none",flex:"1",minWidth:"120px",fontSize:"14px"}})]})})}function tB(){var We,Ge;const{confirm:e}=yu(),t=f.useRef(null),[n,r]=f.useState([]),[i,a]=f.useState(null),[s,l]=f.useState(!1),[c,u]=f.useState(!1),[p,d]=f.useState(!1),[h,m]=f.useState(!1),[g,y]=f.useState(null),[x,v]=f.useState(null),[b,j]=f.useState([]),[w,k]=f.useState(""),[S,E]=f.useState({}),[A,D]=f.useState(!1),[T,I]=f.useState(void 0),[_,G]=f.useState(void 0),[K,O]=f.useState(void 0),[B,W]=f.useState(!1),[R,$]=f.useState(void 0),[P,F]=f.useState(void 0),[re,N]=f.useState(void 0),[pe,ve]=f.useState("openai-chat"),[X,oe]=f.useState(!1),[de,ie]=f.useState(st.AUTH_TOKEN),[J,xe]=f.useState(""),[ae,Me]=f.useState(!0),[se,Le]=f.useState(!0),[$e,Ye]=f.useState(!0),lt=H=>{if(ve(H),$e)return;let he;H==="gemini"||H==="gemini-chat"?he=st.G_API_KEY:H==="claude-chat"||H==="claude"?he=st.API_KEY:he=st.AUTH_TOKEN,ie(he),t.current&&(t.current.value=he)},[Ve,rt]=f.useState(""),[ke,De]=f.useState([]),[Fe,Ze]=f.useState(""),Z=G8();f.useEffect(()=>{Y()},[]),f.useEffect(()=>{const H=new Set(b),he={};Object.entries(S).forEach(([Ae,Re])=>{H.has(Ae)&&(he[Ae]=Re)}),Object.keys(he).length!==Object.keys(S).length&&E(he)},[b]);const Y=async()=>{const H=await V.getVendors();return r(H),H.length>0&&!i&&a(H[0]),H},ce=()=>{y(null),xe(""),l(!0)},M=()=>{d(!0)},fe=H=>{y(H),xe(H.authType||""),l(!0)},ge=async H=>{if(await e({message:"确定要删除此供应商吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const we=await V.getRules(),Ae=(H.services||[]).map(Xe=>Xe.id),Re=we.filter(Xe=>Ae.includes(Xe.targetServiceId)).length;if(!await e({message:`二次确认:删除供应商“${H.name}”后,将同时删除关联的 ${Re} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await V.deleteVendor(H.id),Y(),i&&i.id===H.id&&a(null),U.success(`供应商已删除,关联规则清理 ${Re} 条`)}catch(we){const Ae=we instanceof Error?we.message:"删除失败";U.error(Ae)}},Te=async H=>{H.preventDefault();const he=new FormData(H.currentTarget),we={name:he.get("name"),description:he.get("description"),apiKey:he.get("apiKey")||"",apiBaseUrl:he.get("apiBaseUrl")||"",authType:he.get("authType")||void 0,sortOrder:parseInt(he.get("sortOrder"))||0};g?await V.updateVendor(g.id,we):await V.createVendor({...we,services:[]}),l(!1);const Ae=await Y();if(i){const Re=Ae.find(qe=>qe.id===i.id);Re&&a(Re)}},Ee=()=>{v(null),j([]),k(""),E({}),D(!1),I(void 0),G(void 0),O(void 0),W(!1),$(void 0),F(void 0),N(void 0),ve("openai-chat"),ie((i==null?void 0:i.authType)||st.AUTH_TOKEN),Me(!!(i!=null&&i.apiKey)),Le(!!(i!=null&&i.apiBaseUrl)),Ye(!!(i!=null&&i.authType)),oe(!1),u(!0)},Q=H=>{v(H),j(H.supportedModels||[]),k(""),E(H.modelLimits||{}),D(H.enableTokenLimit||!1),I(H.tokenLimit),G(H.tokenResetInterval),O(H.tokenResetBaseTime?new Date(H.tokenResetBaseTime):void 0),W(H.enableRequestLimit||!1),$(H.requestCountLimit),F(H.requestResetInterval),N(H.requestResetBaseTime?new Date(H.requestResetBaseTime):void 0);const he=H.sourceType||"openai-chat";if(ve(he),Me(H.inheritVendorApiKey===!0),Le(H.inheritVendorApiBaseUrl===!0),Ye(H.inheritVendorAuthType===!0),H.inheritVendorAuthType===!0){const we=(i==null?void 0:i.authType)||st.AUTH_TOKEN;ie(we)}else if(H.authType)ie(H.authType);else{let we;he==="gemini"||he==="gemini-chat"?we=st.G_API_KEY:he==="claude-chat"||he==="claude"?we=st.API_KEY:we=st.AUTH_TOKEN,ie(we)}oe(H.isDowngradeCompatibility===!0),u(!0)},ue=async H=>{if(await e({message:"确定要删除此API服务吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const Ae=(await V.getRules()).filter(Xe=>Xe.targetServiceId===H).length;if(!await e({message:`二次确认:删除该 API 服务后,将同时删除关联的 ${Ae} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await V.deleteAPIService(H);const qe=await Y();if(i){const Xe=qe.find(et=>et.id===i.id);Xe&&a(Xe)}U.success(`API服务已删除,关联规则清理 ${Ae} 条`)}catch(we){const Ae=we instanceof Error?we.message:"删除失败";U.error(Ae)}},Se=async H=>{H.preventDefault();let he=[...b];if(w.trim()){const Bt=w.split(",").map(St=>St.trim()).filter(St=>St&&!he.includes(St));he=[...he,...Bt]}const we=new FormData(H.currentTarget),Ae=we.get("sourceType"),Re=we.get("inheritVendorApiBaseUrl")==="on",qe=(we.get("apiUrl")||"").trim(),Xe=Re?(x==null?void 0:x.apiUrl)||"":qe,et=we.get("inheritVendorApiKey")==="on",ct=we.get("apiKey")||"",Wr=et?(x==null?void 0:x.apiKey)||"":ct,kn=we.get("inheritVendorAuthType")==="on",mt={};Object.entries(S).forEach(([Bt,St])=>{Bt&&St&&St>0&&(mt[Bt]=St)});const In={vendorId:i.id,name:we.get("name"),apiUrl:Xe,apiKey:Wr,inheritVendorApiKey:et,inheritVendorApiBaseUrl:Re,inheritVendorAuthType:kn,sourceType:Ae,authType:kn?(x==null?void 0:x.authType)||void 0:we.get("authType")||void 0,supportedModels:he.length>0?he:void 0,modelLimits:Object.keys(mt).length>0?mt:void 0,enableProxy:we.get("enableProxy")==="on",enableCodingPlan:we.get("enableCodingPlan")==="on",isDowngradeCompatibility:pe==="openai"?X:void 0,enableTokenLimit:A,tokenLimit:T,tokenResetInterval:_,tokenResetBaseTime:K?K.getTime():void 0,enableRequestLimit:B,requestCountLimit:R,requestResetInterval:P,requestResetBaseTime:re?re.getTime():void 0};x?await V.updateAPIService(x.id,In):await V.createAPIService(In),u(!1),j([]),k(""),E({}),D(!1),I(void 0),G(void 0),O(void 0),W(!1),$(void 0),F(void 0),N(void 0),Me(!0),Le(!0),oe(!1);const Cn=await Y();if(i){const Bt=Cn.find(St=>St.id===i.id);Bt&&a(Bt)}},je=H=>{if(H){rt(H);const he=Rn[H];he&&he.services.length>0&&De(he.services.map((we,Ae)=>Ae))}else rt(""),De([]);Ze(""),m(!0)},ze=async H=>{H.preventDefault();const he=Ve,we=Fe;if(!he||!we){U.warning("请填写完整信息");return}if(ke.length===0){U.warning("请至少选择一个源类型");return}const Ae=Rn[he];if(!Ae){U.error("未找到对应的供应商配置");return}try{const Re=await V.createVendor({name:Ae.name,description:Ae.description,apiKey:we,authType:Ae.authType??st.AUTH_TOKEN,...Ae.apiBaseUrl?{apiBaseUrl:Ae.apiBaseUrl}:{},sortOrder:0,services:[]});if(console.log("[一键配置] 供应商创建成功:",Re),console.log("[一键配置] 供应商 ID:",Re==null?void 0:Re.id),!Re||!Re.id)throw console.error("[一键配置] 供应商创建失败或缺少 ID:",Re),new Error("供应商创建失败,缺少 ID");const qe=Ae.services.filter((mt,In)=>ke.includes(In));if(console.log("[一键配置] 准备创建服务:",qe.length,"个"),console.log("[一键配置] vendorId:",Re.id),qe.length===0)throw new Error("没有选择任何服务");const Xe=qe.map(async(mt,In)=>{const Cn={vendorId:Re.id,name:mt.name,apiUrl:mt.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:mt.sourceType,authType:mt.authType,supportedModels:mt.models?mt.models.split(",").map(St=>St.trim()):void 0,modelLimits:mt.modelLimits||{},enableCodingPlan:!0};console.log(`[一键配置] 创建服务 ${In+1}/${qe.length}:`,{...Cn,apiKey:"***"});const Bt=await V.createAPIService(Cn);return console.log(`[一键配置] 服务 ${In+1} 创建成功,ID:`,Bt.id),Bt.vendorId||console.error(`[一键配置] 警告:服务 ${Bt.id} 缺少 vendorId!`),Bt}),et=await Promise.all(Xe);console.log("[一键配置] 所有服务创建完成,数量:",et.length);const ct=et.filter(mt=>!mt.vendorId);if(ct.length>0)throw console.error("[一键配置] 发现缺少 vendorId 的服务:",ct),new Error(`有 ${ct.length} 个服务缺少 vendorId`);const kn=(await Y()).find(mt=>mt.id===Re.id);a(kn||{...Re,services:et}),m(!1),U.success(`配置成功! 已创建 ${ke.length} 个API服务`)}catch(Re){console.error("一键配置失败:",Re),U.error(`配置失败: ${Re instanceof Error?Re.message:"未知错误"}`)}};return o.jsxs("div",{className:"vendors-page",children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"供应商管理"}),o.jsx("p",{children:"管理API供应商和服务配置"})]}),o.jsxs("div",{style:{display:"flex",gap:"20px"},children:[o.jsxs("div",{className:"card",style:{flex:"0 0 25%",minWidth:400},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"供应商列表"}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-secondary",style:{background:"#2563EB",color:"#FFFFFF",border:"none",cursor:"pointer"},onClick:M,children:"推荐"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>je(),children:"一键配置"}),o.jsx("button",{className:"btn btn-primary",onClick:ce,children:"新增"})]})]}),n.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无供应商"})}):o.jsx("div",{style:{marginTop:"10px"},children:n.map(H=>o.jsx("div",{onClick:()=>a(H),style:{padding:"12px",marginBottom:"8px",backgroundColor:i&&i.id===H.id?"var(--accent-light)":"var(--bg-secondary)",borderRadius:"4px",cursor:"pointer",border:"1px solid var(--border-secondary)",color:"var(--text-primary)"},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[o.jsxs("div",{style:{flex:1,minWidth:0,overflow:"hidden"},children:[o.jsx("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:H.name}),H.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:H.description})]}),o.jsxs("div",{className:"action-buttons",style:{flexShrink:0},children:[o.jsx("button",{className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:he=>{he.stopPropagation(),fe(H)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:he=>{he.stopPropagation(),ge(H)},children:"删除"})]})]})},H.id))})]}),o.jsxs("div",{className:"card",style:{flex:1},children:[o.jsxs("div",{className:"toolbar",children:[o.jsxs("h3",{children:["供应商",i?`(${i.name})`:null,"API服务"]}),i&&o.jsx("button",{className:"btn btn-primary",onClick:Ee,children:"新增服务"})]}),i?!i.services||i.services.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无API服务"})}):o.jsxs("table",{style:{fontSize:"smaller"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{whiteSpace:"nowrap"},children:"服务名称"}),o.jsx("th",{children:"源类型"}),o.jsx("th",{children:"API地址"}),o.jsx("th",{children:"模型"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:i.services.map(H=>{var he;return o.jsxs("tr",{children:[o.jsx("td",{children:H.name}),o.jsx("td",{children:H.sourceType?gd[H.sourceType]:"-"}),o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:H.apiUrl,children:H.apiUrl}),o.jsx("td",{children:(he=H.supportedModels)!=null&&he.length?`${H.supportedModels.length}个`:"*"}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>Q(H),children:"编辑"}),o.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>ue(H.id),children:"删除"})]})})]},H.id)})})]}):o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"请先选择一个供应商"})})]})]}),s&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>l(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:g?"编辑供应商":"新增供应商"})}),o.jsxs("form",{onSubmit:Te,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:g?g.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"描述"}),o.jsx("textarea",{name:"description",rows:3,defaultValue:g?g.description:""})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API密钥"}),o.jsx("input",{type:"password",name:"apiKey",defaultValue:g&&g.apiKey||"",placeholder:"可选:供应商默认API密钥"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["API认证方式 ",o.jsx("small",{children:"新增服务时默认使用此方式"})]}),o.jsxs("select",{name:"authType",defaultValue:(g==null?void 0:g.authType)||"",onChange:H=>xe(H.target.value),children:[o.jsx("option",{value:"",disabled:!0,children:"无"}),Object.keys(vd).map(H=>o.jsx("option",{value:H,children:vd[H]},H))]}),J&&Qm[J]&&o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Qm[J]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Base URL"}),o.jsx("input",{type:"text",name:"apiBaseUrl",defaultValue:g&&g.apiBaseUrl||"",placeholder:"可选:供应商默认API Base URL"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["排序 ",o.jsx("small",{children:"数值越大越靠前"})]}),o.jsx("input",{type:"number",name:"sortOrder",defaultValue:g&&g.sortOrder||0,min:"0"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>l(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),c&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>u(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{width:800},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:x?"编辑供应商API服务":"新增供应商API服务"})}),o.jsxs("form",{onSubmit:Se,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"服务名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:x?x.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["数据源类型 ",o.jsx("small",{children:"供应商接口返回的数据格式标准类型"})]}),o.jsxs("select",{name:"sourceType",defaultValue:x&&x.sourceType||"",onChange:H=>lt(H.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择源类型"}),Object.keys(gd).map(H=>o.jsx("option",{value:H,children:gd[H]},H))]}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:q8[pe]||""}),pe==="openai"&&o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",marginTop:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:X,onChange:H=>oe(H.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px",marginTop:"2px"}}),o.jsxs("span",{children:[o.jsx("span",{style:{fontWeight:500},children:"降级兼容"}),o.jsx("br",{}),o.jsx("small",{style:{color:"var(--text-muted)"},children:"通过降级请求格式来确保非 OpenAI 官方的 Responses 接口可以被 Codex 正确使用。"})]})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API地址"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorApiBaseUrl",checked:se,onChange:H=>Le(H.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API地址"})]}),!se&&o.jsx("input",{type:"url",name:"apiUrl",defaultValue:x?x.apiUrl:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API密钥"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorApiKey",checked:ae,onChange:H=>Me(H.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API密钥"})]}),!ae&&o.jsx("input",{type:"password",name:"apiKey",defaultValue:x?x.apiKey:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API认证方式"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorAuthType",checked:$e,onChange:H=>Ye(H.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API认证方式"})]}),!$e&&o.jsxs(o.Fragment,{children:[o.jsx("select",{ref:t,name:"authType",defaultValue:x?x.authType||st.AUTH_TOKEN:de,onChange:H=>ie(H.target.value),children:Object.keys(vd).map(H=>o.jsx("option",{value:H,children:vd[H]},H))}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Qm[de]||""})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"支持的模型列表"}),o.jsx(eB,{value:b,onChange:j,inputValue:w,onInputChange:k,placeholder:"输入模型名,按Enter或逗号添加"},(x==null?void 0:x.id)||"new"),o.jsx("div",{style:{display:"block",width:"100%"},children:o.jsx("small",{style:{fontSize:"10px"},children:"留空表示支持所有模型,路由配置中,可直接将模型透传给该供应商服务接口。"})})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["模型输出限制 ",o.jsx("small",{children:"为支持的模型配置最大输出tokens"})]}),o.jsxs("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"16px",background:"var(--bg-secondary)",maxHeight:"300px",overflowY:"auto"},children:[Object.keys(S).length===0&&b.length===0?o.jsx("div",{style:{color:"var(--text-muted)",textAlign:"center",padding:"20px",fontSize:"14px"},children:"暂无模型限制配置,可点击下方按钮添加"}):o.jsxs("div",{children:[b.length>0&&o.jsxs("div",{style:{marginBottom:"12px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginBottom:"8px",fontWeight:500},children:'来自"支持的模型列表"(自动同步)'}),b.map(H=>o.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px",alignItems:"center",padding:"8px",background:"var(--bg-primary)",borderRadius:"4px",border:"1px solid var(--accent-light)"},children:[o.jsxs("div",{style:{flex:2,fontSize:"14px",color:"var(--text-primary)",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"},children:[H,o.jsx("span",{style:{fontSize:"10px",padding:"2px 6px",borderRadius:"3px",background:"var(--accent-light)",color:"var(--accent-primary)"},children:"已同步"})]}),o.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("input",{type:"number",value:S[H]||"",onChange:he=>{const we=he.target.value;if(we===""){const Ae={...S};delete Ae[H],E(Ae)}else E({...S,[H]:parseInt(we)||0})},placeholder:"留空不限",min:"1",style:{width:"100%",padding:"6px 8px",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"14px"}}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",whiteSpace:"nowrap"},children:"tokens"})]}),o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>{const he={...S};delete he[H],E(he)},style:{padding:"4px 8px",fontSize:"12px"},title:"移除此限制(模型仍在支持列表中)",children:"移除限制"})]},`sync-${H}`))]}),Object.keys(S).length>0&&o.jsx("div",{children:Object.entries(S).filter(([H])=>!b.includes(H)).map(([H,he])=>o.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px",alignItems:"center",padding:"8px",background:"var(--bg-primary)",borderRadius:"4px",border:"1px solid var(--border-secondary)"},children:[o.jsx("input",{type:"text",value:H,onChange:we=>{const Ae={...S},Re=we.target.value;delete Ae[H],Ae[Re]=he,E(Ae)},placeholder:"模型名 (如: gpt-4)",style:{flex:2,padding:"6px 8px",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"14px"}}),o.jsx("input",{type:"number",value:he,onChange:we=>{E({...S,[H]:parseInt(we.target.value)||0})},placeholder:"最大tokens",min:"1",style:{flex:1,padding:"6px 8px",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"14px"}}),o.jsx("button",{type:"button",className:"btn btn-sm btn-danger",onClick:()=>{const we={...S};delete we[H],E(we)},style:{padding:"4px 8px",fontSize:"12px"},children:"删除"})]},`custom-${H}`))})]}),o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>{const H=`model-${Date.now()}`;E({...S,[H]:4096})},style:{marginTop:"8px",width:"100%"},children:"+ 添加模型限制"})]}),o.jsx("div",{style:{display:"block",width:"100%",marginTop:"8px"},children:o.jsxs("small",{style:{fontSize:"10px"},children:[o.jsx("strong",{children:"自动同步:"}),"上方添加的模型会自动在此创建限制配置(默认4096),删除模型会同步移除限制。",o.jsx("strong",{children:"手动添加:"}),"可点击下方按钮为特定模型(如 gpt-4)或前缀(如 gpt-4-*)添加限制。 留空则透传前端工具发送的值。支持精确匹配和前缀匹配。 对于o1等新模型,将自动映射到max_completion_tokens字段。"]})})]}),o.jsx("div",{className:"form-group",children:o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:A,onChange:H=>D(H.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Token超量限制"})]})}),A&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token超量值(单位:k)"}),o.jsx("input",{type:"number",value:T||"",onChange:H=>I(H.target.value?parseInt(H.target.value):void 0),min:"1",placeholder:"例如:1000表示1000k tokens"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:_||"",onChange:H=>G(H.target.value?parseInt(H.target.value):void 0),min:"1",placeholder:"例如:720表示30天,168表示7天"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:K?zw(K):"",onChange:H=>{H.target.value?O(new Date(H.target.value)):O(void 0)},className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置下一次重置的精确时间点"})]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:B,onChange:H=>W(H.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"})]})}),B&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量值"}),o.jsx("input",{type:"number",value:R||"",onChange:H=>$(H.target.value?parseInt(H.target.value):void 0),min:"1",placeholder:"例如:100"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:P||"",onChange:H=>F(H.target.value?parseInt(H.target.value):void 0),min:"1",placeholder:"例如:720表示30天,168表示7天"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:re?zw(re):"",onChange:H=>{H.target.value?N(new Date(H.target.value)):N(void 0)},className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置下一次重置的精确时间点"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"enableProxy",defaultChecked:(x==null?void 0:x.enableProxy)||!1,style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用代理"})]}),o.jsx("small",{style:{display:"block",marginTop:"6px",color:"#666",fontSize:"12px",marginLeft:"24px"},children:'勾选后,此 API 服务的请求将通过设置的代理转发。请在"设置"页面配置代理。'})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"enableCodingPlan",defaultChecked:x?!!x.enableCodingPlan:!0,style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用编程套餐限制"})]}),o.jsx("small",{style:{display:"block",marginTop:"6px",color:"#666",fontSize:"12px",marginLeft:"24px"},children:"启用后,此 API 服务仅允许编程工具(如 Claude Code、Codex、Cursor 等)发起的请求通过,普通对话请求将被拒绝。"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>u(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),p&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>d(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"800px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"供应商推荐"})}),o.jsx("div",{className:"modal-body",children:o.jsx("div",{className:"markdown-content",children:o.jsx(Sc,{components:{a:({href:H,children:he,title:we})=>we&&Rn[we]?o.jsx("a",{href:"#",style:{color:"#2563EB",borderBottom:"solid 1px #2563EB",cursor:"pointer"},onClick:Ae=>{Ae.preventDefault(),d(!1),je(we)},children:he}):o.jsx("a",{href:H,style:{color:"#2563EB",borderBottom:"solid 1px #2563EB"},target:"_blank",rel:"noopener noreferrer",children:he})},children:Z})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>d(!1),children:"关闭"})})]})})]}),h&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>m(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"一键配置供应商"})}),o.jsxs("form",{onSubmit:ze,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(iA,{value:Ve,onChange:H=>{if(rt(H),H){const he=Rn[H];he&&he.services.length>0&&De(he.services.map((we,Ae)=>Ae))}else De([])},existingVendors:n})]}),(We=Rn[Ve])!=null&&We.description?o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[Rn[Ve].description,Rn[Ve].link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:Rn[Ve].link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const H=new URL(Rn[Ve].link);return H.protocol+"//"+H.hostname}catch{return Rn[Ve].link}})()})]})]}):null,o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["源类型 ",o.jsx("small",{style:{color:"var(--text-muted)",fontWeight:"normal"},children:"可选择多个"})]}),o.jsx("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"16px",background:"var(--bg-secondary)",minHeight:"100px",display:"flex",flexDirection:"column",gap:"8px"},children:Ve?(Ge=Rn[Ve])==null?void 0:Ge.services.map((H,he)=>{const we=ke.includes(he);return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:we?"var(--accent-light)":"transparent",border:`2px solid ${we?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease",position:"relative",overflow:"hidden"},onMouseEnter:Ae=>{we||(Ae.currentTarget.style.background="var(--bg-hover)",Ae.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:Ae=>{we||(Ae.currentTarget.style.background="transparent",Ae.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"checkbox",checked:we,onChange:Ae=>{Ae.target.checked?De([...ke,he]):De(ke.filter(Re=>Re!==he))},style:{width:"18px",height:"18px",marginRight:"12px",cursor:"pointer",accentColor:"var(--accent-primary)"}}),o.jsxs("span",{style:{fontSize:"14px",fontWeight:we?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[H.name," - ",gd[H.sourceType]]}),we&&o.jsx("span",{style:{marginLeft:"auto",fontSize:"16px",color:"var(--text-primary)"},children:"✓"})]},he)}):o.jsx("div",{style:{color:"var(--text-muted)",textAlign:"center",padding:"30px 20px",fontSize:"14px"},children:"请先选择供应商"})})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Key"}),o.jsx("input",{type:"password",name:"apiKey",value:Fe,onChange:H=>Ze(H.target.value),placeholder:"请输入API密钥",required:!0})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>m(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"确认配置"})]})]})]})})]})]})}function nB({value:e,options:t,onChange:n,disabled:r=!1,placeholder:i="请选择"}){const[a,s]=f.useState(!1),l=f.useRef(null);f.useEffect(()=>{if(!a)return;const u=p=>{l.current&&!l.current.contains(p.target)&&s(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]);const c=t.find(u=>u.value===e);return o.jsxs("div",{ref:l,style:{position:"relative"},children:[o.jsxs("div",{onClick:()=>!r&&s(!a),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:`1px solid ${a?"var(--accent-primary)":"var(--border-primary)"}`,borderRadius:"8px",background:"var(--input-bg, var(--bg-primary))",cursor:r?"not-allowed":"pointer",opacity:r?.6:1,transition:"border-color 0.2s",userSelect:"none",minWidth:0},children:[c?o.jsx("span",{style:{fontSize:"14px",color:"var(--text-primary)"},children:c.label}):o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:i}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",marginLeft:"8px",flexShrink:0,transform:a?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s"},children:"▼"})]}),a&&o.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:999,marginTop:"4px",maxHeight:"360px",overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-primary)",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"},children:t.map(u=>{const p=e===u.value;return o.jsxs("div",{onClick:()=>{n(u.value),s(!1)},style:{padding:"10px 14px",cursor:"pointer",background:p?"var(--accent-light)":"transparent",borderLeft:p?"3px solid var(--accent-primary)":"3px solid transparent",transition:"background 0.15s"},onMouseEnter:d=>{p||(d.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:d=>{p||(d.currentTarget.style.background="transparent")},children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:p?600:400,color:"var(--text-primary)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"},children:[o.jsx("span",{children:u.label}),p&&o.jsx("span",{style:{fontSize:"13px",color:"var(--accent-primary)",flexShrink:0},children:"✓"})]}),u.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px",lineHeight:"1.5"},children:u.description})]},u.value)})})]})}const rB={1:"选择节点",2:"Skills",3:"MCP",4:"供应商",5:"确认同步"};function iB({show:e,onClose:t,onComplete:n}){const[r,i]=f.useState(1),[a,s]=f.useState(!1),[l,c]=f.useState({current:0,total:0}),[u,p]=f.useState([]),[d,h]=f.useState(null),[m,g]=f.useState(""),[y,x]=f.useState("4567"),[v,b]=f.useState(!1),[j,w]=f.useState([]),[k,S]=f.useState(""),[E,A]=f.useState(4567),[D,T]=f.useState("scan"),[I,_]=f.useState([]),[G,K]=f.useState(new Set),[O,B]=f.useState([]),[W,R]=f.useState(new Set),[$,P]=f.useState({}),[F,re]=f.useState(!1),[N,pe]=f.useState(""),[ve,X]=f.useState(!1),[oe,de]=f.useState(!1),[ie,J]=f.useState(!1),xe=f.useCallback(()=>{i(1),s(!1),c({current:0,total:0}),p([]),h(null),g(""),x("4567"),b(!1),_([]),K(new Set),B([]),R(new Set),P({}),re(!1),pe(""),X(!1),de(!1),J(!1),w([]),S(""),A(4567),T("scan")},[]);f.useEffect(()=>{e&&(xe(),ae())},[e]);const ae=async()=>{try{const M=await V.lanScan();w(M.networkInterfaces||[]),A(M.port),M.networkInterfaces.length<=1,S(M.subnet),Me(M.subnet,M.port,M.localIp)}catch(M){console.error("[LAN Scan] 获取网络信息失败:",M)}},Me=async(M,fe,ge)=>{s(!0),p([]),c({current:0,total:0});const Te=Date.now();try{const Ee=[];for(let Se=1;Se<=254;Se++){const je=`${M}.${Se}`;je!==ge&&Ee.push(je)}c({current:0,total:Ee.length});const Q=30,ue=[];for(let Se=0;Se<Ee.length;Se+=Q){const je=Ee.slice(Se,Se+Q),ze=await Promise.allSettled(je.map(async We=>{const Ge=await V.lanDiscover(We,fe);return{ip:We,port:fe,data:Ge}}));for(const We of ze)We.status==="fulfilled"&&ue.push(We.value);p([...ue]),c({current:Math.min(Se+Q,Ee.length),total:Ee.length})}c({current:Ee.length,total:Ee.length})}catch(Ee){console.error("[LAN Scan] 扫描失败:",Ee)}finally{const Ee=Date.now()-Te;Ee<1e3&&await new Promise(Q=>setTimeout(Q,1e3-Ee)),s(!1),de(!0)}},se=M=>{S(M);const fe=j.find(ge=>ge.subnet===M);fe&&Me(fe.subnet,E,fe.address)},Le=()=>{const M=j.find(fe=>fe.subnet===k);M&&(h(null),Me(M.subnet,E,M.address))},$e=async()=>{if(m.trim()){b(!0);try{const M=parseInt(y)||4567,fe=await V.lanDiscover(m.trim(),M),ge={ip:m.trim(),port:M,data:fe};p(Te=>Te.some(Ee=>Ee.ip===m.trim()&&Ee.port===M)?Te:[...Te,ge]),h(ge),U.success("连接成功")}catch{U.error("无法连接,请检查 IP 和端口")}finally{b(!1)}}},Ye=async()=>{if(d){J(!0);try{let M=[],fe=[];try{M=await V.getInstalledSkills()}catch{}try{fe=await V.getMCPs()}catch(ue){console.error("[LAN Sync] 获取本地 MCPs 失败,重复检测可能不准确:",ue)}const ge=new Set(M.map(ue=>ue.name)),Te=new Set(fe.map(ue=>ue.name)),Ee=(d.data.skills||[]).map(ue=>({...ue,isDuplicate:ge.has(ue.name)}));_(Ee);const Q=(d.data.mcps||[]).map(ue=>({...ue,isDuplicate:Te.has(ue.name)}));B(Q),i(2)}finally{J(!1)}}},lt=async()=>{if(!d)return;const M=G.size>0,fe=W.size>0;if(!(!M&&!fe&&!F)){X(!0);try{const ge=await V.lanSync({remoteNode:{ip:d.ip,port:d.port,name:d.data.node.name},skills:I.filter(Te=>G.has(Te.name)&&!Te.isDuplicate).map(({isDuplicate:Te,...Ee})=>Ee),mcps:O.filter(Te=>W.has(Te.name)&&!Te.isDuplicate).map(({isDuplicate:Te,...Ee})=>{const Q=$[Ee.name];return Q&&Ee.env?{...Ee,env:{...Ee.env,...Q}}:Ee}),vendor:{enabled:F,apiKey:N||void 0}});ge.success?(U.success("同步完成"),n(),setTimeout(()=>t(),500)):U.error("同步失败: "+(ge.error||"未知错误"))}catch(ge){U.error("同步失败: "+ge.message)}finally{X(!1)}}},Ve=M=>M.env?Object.entries(M.env).filter(([,fe])=>fe==="***").map(([fe])=>fe):[],rt=(M,fe,ge)=>{P(Te=>({...Te,[M]:{...Te[M]||{},[fe]:ge}}))},ke=M=>{const fe=I.find(ge=>ge.name===M);fe!=null&&fe.isDuplicate||K(ge=>{const Te=new Set(ge);return Te.has(M)?Te.delete(M):Te.add(M),Te})},De=()=>{const M=I.filter(ge=>!ge.isDuplicate),fe=M.every(ge=>G.has(ge.name));K(fe?new Set:new Set(M.map(ge=>ge.name)))},Fe=M=>{const fe=O.find(ge=>ge.name===M);fe!=null&&fe.isDuplicate||R(ge=>{const Te=new Set(ge);return Te.has(M)?Te.delete(M):Te.add(M),Te})},Ze=()=>{const M=O.filter(ge=>!ge.isDuplicate),fe=M.every(ge=>W.has(ge.name));R(fe?new Set:new Set(M.map(ge=>ge.name)))},Z=G.size>0||W.size>0||F,Y=I.filter(M=>!M.isDuplicate),ce=O.filter(M=>!M.isDuplicate);return e?o.jsxs("div",{className:"modal-overlay",onClick:M=>{M.target===M.currentTarget&&!ve&&t()},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>{ve||t()},"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{width:"720px",maxWidth:"90%"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"局域网内同步配置"})}),o.jsx("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 24px",marginBottom:"20px",borderBottom:"1px solid var(--border-secondary)",paddingBottom:"12px"},children:[1,2,3,4,5].map(M=>o.jsxs("span",{style:{fontSize:"13px",color:r===M?"var(--primary-color)":M<r?"var(--text-secondary)":"var(--text-muted)",fontWeight:r===M?600:400,borderBottom:r===M?"2px solid var(--primary-color)":"2px solid transparent",paddingBottom:"10px",cursor:"default",whiteSpace:"nowrap"},children:[M<r?"✓ ":`${M} `,rB[M]]},M))}),o.jsxs("div",{style:{padding:"0 24px",minHeight:"300px",position:"relative"},children:[r===1&&o.jsxs("div",{children:[o.jsx("div",{style:{display:"flex",gap:"24px",marginBottom:"20px"},children:["scan","manual"].map(M=>o.jsx("button",{type:"button",onClick:()=>T(M),style:{padding:"8px 4px",background:"none",border:"none",borderBottom:D===M?"2px solid var(--primary-color)":"none",color:D===M?"var(--primary-color)":"var(--text-muted)",fontWeight:D===M?500:400,fontSize:"14px",cursor:"pointer",transition:"all 0.2s"},children:M==="scan"?"局域网扫描":"手动添加"},M))}),D==="scan"&&o.jsxs(o.Fragment,{children:[j.length>0&&o.jsxs("div",{style:{marginBottom:"16px",padding:"10px 14px",background:"var(--accent-light)",borderRadius:"8px",fontSize:"13px",color:"var(--text-secondary)"},children:[o.jsx("span",{style:{fontWeight:500,color:"var(--accent-primary)"},children:"本机"})," · ",j.map(M=>M.address).join("、")," · ","端口 ",E,j.length>1&&o.jsxs(o.Fragment,{children:[" · ",j.map((M,fe)=>o.jsxs("span",{children:[fe>0?" / ":"",o.jsxs("button",{type:"button",onClick:()=>se(M.subnet),disabled:a,style:{padding:0,border:"none",background:"none",color:k===M.subnet?"var(--primary-color)":"var(--text-muted)",fontSize:"12px",fontWeight:k===M.subnet?600:400,cursor:a?"not-allowed":"pointer",textDecoration:k===M.subnet?"underline":"none"},children:[M.subnet,".0/",M.netmask]})]},M.subnet))]})]}),a&&o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["正在扫描 ",k,".0 网段... ",l.current,"/",l.total]}),o.jsx("div",{style:{width:"100%",height:"6px",background:"var(--bg-secondary)",borderRadius:"3px",overflow:"hidden"},children:o.jsx("div",{style:{width:l.total>0?`${l.current/l.total*100}%`:"0%",height:"100%",background:"var(--primary-color)",borderRadius:"3px",transition:"width 0.3s ease"}})})]}),!a&&oe&&u.length===0&&o.jsxs("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:[o.jsx("p",{style:{fontSize:"16px",marginBottom:"8px"},children:"未发现可用节点"}),o.jsx("p",{style:{fontSize:"14px",marginBottom:"12px"},children:'请确认远端节点已开启"允许局域网拉取配置"'}),o.jsx("button",{type:"button",className:"btn btn-secondary",style:{fontSize:"13px",padding:"6px 16px"},onClick:Le,children:"重新扫描"})]}),u.length>0&&o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666"},children:["已发现 ",u.length," 个节点:"]}),!a&&oe&&o.jsx("button",{type:"button",className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:Le,children:"重新扫描"})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(M=>{var fe,ge;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>h(M),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port,onChange:()=>h(M),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:M.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[M.ip,":",M.port,((fe=M.data.skills)==null?void 0:fe.length)>0&&` · ${M.data.skills.length} Skills`,((ge=M.data.mcps)==null?void 0:ge.length)>0&&` · ${M.data.mcps.length} MCP`]})]})]},`${M.ip}-${M.port}`)})})]})]}),ie&&o.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(255, 255, 255, 0.7)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"8px",zIndex:10},children:[o.jsx("div",{style:{width:"32px",height:"32px",border:"3px solid var(--border-secondary)",borderTop:"3px solid var(--primary-color)",borderRadius:"50%",animation:"spin 1s linear infinite",marginBottom:"12px"}}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"正在准备数据..."}),o.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}),D==="manual"&&o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center",marginBottom:"16px"},children:[o.jsx("input",{type:"text",value:m,onChange:M=>g(M.target.value),placeholder:"IP 地址,如 192.168.1.100",style:{flex:1,padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, var(--bg-card))",color:"var(--text-primary)",fontSize:"14px"}}),o.jsx("input",{type:"text",value:y,onChange:M=>x(M.target.value),placeholder:"端口",style:{width:"80px",padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, var(--bg-card))",color:"var(--text-primary)",fontSize:"14px"}}),o.jsx("button",{className:"btn btn-primary",onClick:$e,disabled:v||!m.trim(),children:v?"连接中...":"连接"})]}),u.length>0&&o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:"已发现的节点:"}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(M=>{var fe,ge;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>h(M),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port,onChange:()=>h(M),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:M.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[M.ip,":",M.port,((fe=M.data.skills)==null?void 0:fe.length)>0&&` · ${M.data.skills.length} Skills`,((ge=M.data.mcps)==null?void 0:ge.length)>0&&` · ${M.data.mcps.length} MCP`]})]})]},`${M.ip}-${M.port}`)})})]})]})]}),r===2&&o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666"},children:["远端节点:",d==null?void 0:d.data.node.name," (",d==null?void 0:d.ip,")"]}),Y.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:De,children:Y.every(M=>G.has(M.name))?"取消全选":"全选"})]}),o.jsx("p",{style:{fontSize:"15px",fontWeight:500,marginBottom:"12px"},children:"选择需要同步的 Skills:"}),I.length===0?o.jsx("div",{style:{textAlign:"center",padding:"30px 0",color:"#999"},children:o.jsx("p",{children:"远端无可用 Skills"})}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"360px",overflowY:"auto"},children:I.map(M=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",border:`1px solid ${M.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",cursor:M.isDuplicate?"not-allowed":"pointer",opacity:M.isDuplicate?.7:1,background:M.isDuplicate?"var(--bg-secondary)":"transparent"},children:[o.jsx("input",{type:"checkbox",checked:G.has(M.name),onChange:()=>ke(M.name),disabled:M.isDuplicate,style:{accentColor:"var(--primary-color)",marginTop:"2px"}}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{fontWeight:500},children:M.name}),M.targets&&M.targets.length>0&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:M.targets.join(", ")})]}),M.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:M.description}),M.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]},M.name))})]}),r===3&&o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[o.jsx("p",{style:{fontSize:"15px",fontWeight:500},children:"选择需要同步的 MCP:"}),ce.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:Ze,children:ce.every(M=>W.has(M.name))?"取消全选":"全选"})]}),O.length===0?o.jsx("div",{style:{textAlign:"center",padding:"30px 0",color:"#999"},children:o.jsx("p",{children:"远端无可用 MCP"})}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"360px",overflowY:"auto"},children:O.map(M=>{const fe=Ve(M),ge=W.has(M.name),Te=ge&&fe.length>0;return o.jsxs("div",{style:{border:`1px solid ${M.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",opacity:M.isDuplicate?.7:1,background:M.isDuplicate?"var(--bg-secondary)":"transparent",overflow:"hidden"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",cursor:M.isDuplicate?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:ge,onChange:()=>Fe(M.name),disabled:M.isDuplicate,style:{accentColor:"var(--primary-color)",marginTop:"2px"}}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{fontWeight:500},children:M.name}),o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:M.type}),fe.length>0&&!M.isDuplicate&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"#fff3e0",color:"#e67e22"},children:"含敏感变量"})]}),M.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:M.description}),M.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]}),Te&&o.jsxs("div",{style:{padding:"8px 12px 12px 36px",borderTop:"1px dashed var(--border-secondary)",background:"var(--bg-secondary)"},children:[o.jsx("p",{style:{fontSize:"12px",color:"#e67e22",marginBottom:"8px"},children:"以下环境变量需要手动填写:"}),fe.map(Ee=>{var Q;return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"6px"},children:[o.jsx("span",{style:{fontSize:"12px",color:"#666",minWidth:"120px",fontFamily:"monospace"},children:Ee}),o.jsx("input",{type:"text",value:((Q=$[M.name])==null?void 0:Q[Ee])||"",onChange:ue=>rt(M.name,Ee,ue.target.value),placeholder:`请输入 ${Ee}`,style:{flex:1,padding:"4px 8px",borderRadius:"4px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, #fff)",color:"var(--text-primary)",fontSize:"12px"}})]},Ee)})]})]},M.name)})})]}),r===4&&o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:"15px",fontWeight:500,marginBottom:"16px"},children:"是否将该节点作为本地供应商?"}),o.jsxs("div",{style:{display:"flex",gap:"24px",marginBottom:"16px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},children:[o.jsx("input",{type:"radio",name:"createVendor",checked:F,onChange:()=>re(!0),style:{accentColor:"var(--primary-color)"}}),o.jsx("span",{children:"是"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},children:[o.jsx("input",{type:"radio",name:"createVendor",checked:!F,onChange:()=>re(!1),style:{accentColor:"var(--primary-color)"}}),o.jsx("span",{children:"否"})]})]}),F&&o.jsxs("div",{style:{padding:"16px",border:"1px solid var(--border-secondary)",borderRadius:"8px",marginBottom:"12px"},children:[o.jsx("label",{style:{fontSize:"14px",fontWeight:500,display:"block",marginBottom:"6px"},children:"API Key(选填)"}),o.jsx("input",{type:"text",value:N,onChange:M=>pe(M.target.value),placeholder:"如果远端节点开启了认证,请填写其接入密钥",style:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, var(--bg-secondary))",color:"var(--text-primary)",boxSizing:"border-box"}}),o.jsx("p",{style:{fontSize:"12px",color:"#999",marginTop:"6px"},children:"不填写则使用空密钥连接。"})]}),F&&o.jsxs("p",{style:{fontSize:"13px",color:"#666"},children:["将创建供应商 ",o.jsxs("strong",{children:[d==null?void 0:d.data.node.name,"@",d==null?void 0:d.ip]}),", 包含 6 个 API 服务(Claude Code、Codex、Claude、Responses、Chat Completions、Gemini)。"]}),!F&&o.jsx("p",{style:{fontSize:"13px",color:"#999"},children:"跳过供应商创建,仅同步 Skills 和 MCP 配置。"})]}),r===5&&!ve&&o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:"16px",fontWeight:600,marginBottom:"16px"},children:"同步预览"}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["Skills(",G.size," 项)"]}),G.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:I.filter(M=>G.has(M.name)).map(M=>{var fe;return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",M.name," ",(fe=M.targets)!=null&&fe.length?`(${M.targets.join(", ")})`:""]},M.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["MCP(",W.size," 项)"]}),W.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:O.filter(M=>W.has(M.name)).map(M=>{const fe=Ve(M),ge=fe.some(Te=>{var Ee,Q;return!((Q=(Ee=$[M.name])==null?void 0:Ee[Te])!=null&&Q.trim())});return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",M.name," (",M.type,")",fe.length>0&&o.jsx("span",{style:{fontSize:"12px",color:ge?"#e74c3c":"#e67e22",marginLeft:"6px"},children:ge?`⚠ ${fe.length} 个敏感变量未填写`:"✓ 敏感变量已填写"})]},M.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:"供应商"}),F?o.jsxs("div",{style:{paddingLeft:"8px"},children:[o.jsxs("div",{style:{fontSize:"14px"},children:["名称:",d==null?void 0:d.data.node.name,"@",d==null?void 0:d.ip]}),o.jsxs("div",{style:{fontSize:"14px"},children:["API Key:",N?"已填写":"未填写"]}),o.jsx("div",{style:{fontSize:"14px"},children:"API 服务:6 个(Claude Code、Codex、Claude、Responses、Chat Completions、Gemini)"})]}):o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"不创建"})]}),!Z&&o.jsx("p",{style:{fontSize:"13px",color:"#e74c3c",textAlign:"center"},children:"未选择任何同步内容"})]}),r===5&&ve&&o.jsxs("div",{style:{textAlign:"center",padding:"60px 0"},children:[o.jsx("div",{style:{width:"40px",height:"40px",border:"3px solid var(--border-secondary)",borderTop:"3px solid var(--primary-color)",borderRadius:"50%",animation:"spin 1s linear infinite",margin:"0 auto 16px"}}),o.jsx("p",{style:{fontSize:"16px",color:"#666"},children:"正在同步..."}),o.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]})]}),o.jsxs("div",{className:"modal-footer",style:{marginTop:"20px"},children:[r>1&&(r<5||!ve)&&o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>i(r-1),disabled:ve,children:"← 上一步"}),o.jsx("div",{style:{flex:1}}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,disabled:ve,children:"取消"}),r===1&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:Ye,disabled:!d||ie,children:ie?"加载中...":"下一步 →"}),r===2&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>i(3),children:"下一步 →"}),r===3&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>i(4),children:"下一步 →"}),r===4&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>i(5),children:"下一步 →"}),r===5&&!ve&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:lt,disabled:!Z,children:"同步"})]})]})})]}):null}const aA=f.createContext(null),aB=async e=>{try{await V.clearRuleStatus(e)}catch(t){throw console.error("[RulesStatus] 清除规则状态失败:",t),t}};function oB(e){const t={};return e.forEach(n=>{t[n.ruleId]={status:n.status,totalTokensUsed:n.totalTokensUsed,totalRequestsUsed:n.totalRequestsUsed,errorMessage:n.errorMessage,errorType:n.errorType,lastUpdate:n.timestamp}}),t}function sB({children:e}){const[t,n]=f.useState({}),r=f.useRef(null),i=f.useRef(null),a=f.useRef(Date.now());f.useEffect(()=>{let p=!0;const d=()=>{r.current&&(r.current.close(),r.current=null);const h=localStorage.getItem("auth_token"),m=h?`/api/rules/status/stream?token=${encodeURIComponent(h)}`:"/api/rules/status/stream",g=new EventSource(m);r.current=g,a.current=Date.now(),g.onmessage=y=>{a.current=Date.now();try{const x=JSON.parse(y.data);if(x.type==="init")n(oB(x.statuses));else if(x.type==="update"){const v=x.status;n(b=>({...b,[v.ruleId]:{status:v.status,totalTokensUsed:v.totalTokensUsed,totalRequestsUsed:v.totalRequestsUsed,errorMessage:v.errorMessage,errorType:v.errorType,lastUpdate:v.timestamp}}))}}catch(x){console.error("[RulesStatus] SSE 数据解析错误:",x)}},g.onerror=()=>{console.warn("[RulesStatus] SSE 连接错误,准备重连..."),g.close(),r.current=null,a.current=0}};return d(),i.current=setInterval(()=>{if(!p)return;const m=Date.now()-a.current;m>=15e3&&(console.warn(`[RulesStatus] 心跳超时(${Math.round(m/1e3)}秒无响应),重新连接 SSE...`),d())},3e3),()=>{p=!1,r.current&&(r.current.close(),r.current=null),i.current&&(clearInterval(i.current),i.current=null)}},[]),f.useEffect(()=>{},[]);const l={ruleStatuses:t,getRuleStatus:c=>t[c],clearRuleStatus:aB};return o.jsx(aA.Provider,{value:l,children:e})}function lB(){const e=f.useContext(aA);return e||{ruleStatuses:{},getRuleStatus:t=>{},clearRuleStatus:async t=>{}}}const cB=[{value:"codex",label:"Codex",icon:"🤖"},{value:"claude-code",label:"Claude Code",icon:"⚡"},{value:"api",label:"所有 API",icon:"🔗"}],uB={codex:" [Codex]","claude-code":" [Claude Code]",api:" [API]"},dB={"claude-code":{claude:0,"claude-chat":1,"openai-chat":2,openai:3,gemini:4,"gemini-chat":5},codex:{openai:0,"openai-chat":1,claude:2,"claude-chat":3,gemini:4,"gemini-chat":5},api:{"openai-chat":0,claude:1,"claude-chat":2,openai:3,gemini:4,"gemini-chat":5}};function oA({show:e,onClose:t,onComplete:n}){const[r,i]=f.useState(""),[a,s]=f.useState(""),[l,c]=f.useState("codex"),[u,p]=f.useState(!1),[d,h]=f.useState([]),[m,g]=f.useState([]);f.useEffect(()=>{e&&(V.getVendors().then(h).catch(()=>{}),V.getRoutes().then(g).catch(()=>{}))},[e]);const y=r?Rn[r]:null,x=y?d.find(S=>S.name===y.name):null,v=!!(x!=null&&x.apiKey),b=!x||!v;if(!e)return null;const j=()=>{u||(i(""),s(""),c("codex"),t())},w=(S,E)=>V.createAPIService({vendorId:S,name:E.name,apiUrl:E.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:E.sourceType,authType:E.authType,supportedModels:E.models?E.models.split(",").map(A=>A.trim()):void 0,modelLimits:E.modelLimits||{},enableCodingPlan:!1}),k=async S=>{var A,D;if(S.preventDefault(),!r){U.warning("请选择供应商");return}if(b&&!a){U.warning("请填写 API Key");return}const E=Rn[r];if(!E){U.error("未找到对应的供应商配置");return}p(!0);try{let T,I;if(x){T=x.id,!v&&a&&await V.updateVendor(T,{...x,apiKey:a});const R=new Set((x.services||[]).map(F=>F.sourceType)),$=E.services.filter(F=>!R.has(F.sourceType)),P=$.length>0?await Promise.all($.map(F=>w(T,F))):[];I=[...x.services||[],...P]}else{const R=await V.createVendor({name:E.name,description:E.description,apiKey:a,authType:E.authType??st.AUTH_TOKEN,...E.apiBaseUrl?{apiBaseUrl:E.apiBaseUrl}:{},sortOrder:0,services:[]});if(!(R!=null&&R.id))throw new Error("供应商创建失败");T=R.id,I=await Promise.all(E.services.map($=>w(T,$)))}const _=E.name+uB[l],G=new Set(m.map(R=>R.name));let K=_;if(G.has(K)){let R=2;for(;G.has(`${_}-${R}`);)R++;K=`${_}-${R}`}const O=await V.createRoute({name:K,description:"由一键配置自动创建"});if(!(O!=null&&O.id))throw new Error("路由创建失败");const B=dB[l],W=(A=[...I].filter(R=>R.sourceType).map(R=>({service:R,priority:B[R.sourceType]??99})).sort((R,$)=>R.priority-$.priority)[0])==null?void 0:A.service;if(W){const R=(D=W.supportedModels)!=null&&D.length?W.supportedModels[0]:void 0;await V.createRule({routeId:O.id,contentType:"default",targetServiceId:W.id,targetModel:R,sortOrder:0})}if(l==="codex"||l==="claude-code")try{await V.activateToolRoute(l,O.id)}catch{}if(l==="api"){let R=null;try{R=await V.getApiPathBindings()}catch{}if(R!=null&&R.bindings){const $=R.bindings.map(P=>P.apiPath==="/v1/models"?P:{...P,routeId:O.id});try{await V.updateApiPathBindings($,R.models||"")}catch{}}}U.success("一键配置完成!路由已激活,可以开始使用"),n==null||n(),j(),setTimeout(()=>{window.location.reload()},300)}catch(T){console.error("一键配置失败:",T),U.error(`配置失败: ${T instanceof Error?T.message:"未知错误"}`)}finally{p(!1)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:j,"aria-label":"关闭",disabled:u,children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"🚀 一键配置"})}),o.jsxs("form",{onSubmit:k,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(iA,{value:r,onChange:S=>i(S),existingVendors:d,disabled:u})]}),(y==null?void 0:y.description)&&o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[y.description,y.link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:y.link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const S=new URL(y.link);return S.protocol+"//"+S.hostname}catch{return y.link}})()})]})]}),b&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Key"}),o.jsx("input",{type:"password",value:a,onChange:S=>s(S.target.value),placeholder:"请输入API密钥",required:!0,disabled:u})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"目标"}),o.jsx("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"12px",background:"var(--bg-secondary)",display:"flex",flexDirection:"column",gap:"8px"},children:cB.map(S=>{const E=l===S.value;return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:E?"var(--accent-light)":"transparent",border:`2px solid ${E?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease"},onMouseEnter:A=>{E||(A.currentTarget.style.background="var(--bg-hover)",A.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:A=>{E||(A.currentTarget.style.background="transparent",A.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"radio",name:"setupTarget",value:S.value,checked:E,onChange:()=>c(S.value),style:{width:"18px",height:"18px",marginRight:"12px",cursor:"pointer",accentColor:"var(--accent-primary)"},disabled:u}),o.jsxs("span",{style:{fontSize:"14px",fontWeight:E?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[S.icon," ",S.label]}),E&&o.jsx("span",{style:{marginLeft:"auto",fontSize:"16px",color:"var(--text-primary)"},children:"✓"})]},S.value)})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:j,disabled:u,children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",disabled:u,children:u?"配置中...":"确认配置"})]})]})]})})]})}const pB=""+new URL("openai-CPEiZpaN.webp",import.meta.url).href,fB=""+new URL("claude-XtpLmGtF.webp",import.meta.url).href,$w=[{value:"compact",label:"压缩对话",icon:"📦"},{value:"image-understanding",label:"图像理解",icon:"🖼"},{value:"high-iq",label:"高智商",icon:"🧠"},{value:"long-context",label:"长上下文",icon:"📄"},{value:"thinking",label:"思考",icon:"💭"},{value:"background",label:"后台",icon:"⚙"},{value:"model-mapping",label:"模型顶替",icon:"🔄"},{value:"default",label:"默认"}],Bw={compact:0,"image-understanding":1,"high-iq":2,"long-context":3,thinking:4,background:5,"model-mapping":6,default:7},Fw={compact:"📦",background:"🧱",thinking:"💭","high-iq":"🧠","long-context":"📄","image-understanding":"🖼️","model-mapping":"🔄"},sA=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],lA=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"max",label:"Max"}],zv=[{value:"default",label:"default",desc:"每次编辑前都会请求批准。适合入门或处理敏感代码。"},{value:"acceptEdits",label:"acceptEdits",desc:"自动编辑选中文本或整个文件;读取、文件编辑及常见文件系统命令(mkdir、touch、mv、cp 等)免询问。"},{value:"plan",label:"plan",desc:"先探索代码并给出方案,确认后再编辑;仅读取免询问。"},{value:"auto",label:"auto",desc:"自动为每个任务选择最佳权限模式;所有操作免询问,带后台安全检查。"},{value:"dontAsk",label:"dontAsk",desc:"仅预先批准的工具免询问。适合锁定的 CI 与脚本。"},{value:"bypassPermissions",label:"bypassPermissions",desc:"运行潜在危险命令前不请求批准;所有操作免询问,带后台安全检查。仅建议在隔离容器与 VM 中使用。"}],hB=e=>sA.some(t=>t.value===e),mB=e=>lA.some(t=>t.value===e),gB=e=>zv.some(t=>t.value===e),vB=e=>hB(e==null?void 0:e.codexModelReasoningEffort)?e.codexModelReasoningEffort:"high",yB=e=>mB(e==null?void 0:e.claudeEffortLevel)?e.claudeEffortLevel:"medium",Jm=e=>{const t=gB(e==null?void 0:e.claudePermissionsDefaultMode)?e.claudePermissionsDefaultMode:"default";return t==="bypassPermissions"&&!(e!=null&&e.enableBypassPermissionsSupport)?"default":t};function Uw(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0");return`${t}-${n}-${r}T${i}:${a}`}function xB(){var y1,x1,b1,j1,w1,S1,k1,C1,P1;const{confirm:e}=yu(),{ruleStatuses:t,clearRuleStatus:n}=lB(),[r,i]=f.useState([]),[a,s]=f.useState([]),[l,c]=f.useState([]),[u,p]=f.useState([]),[d,h]=f.useState([]),[m,g]=f.useState([]),[y,x]=f.useState([]),[v,b]=f.useState(null),[j,w]=f.useState([]),[k,S]=f.useState(""),[E,A]=f.useState(null),[D,T]=f.useState(!1),[I,_]=f.useState(!1),[G,K]=f.useState(null),[O,B]=f.useState(null),[W,R]=f.useState(""),[$,P]=f.useState(""),[F,re]=f.useState(""),[N,pe]=f.useState(""),[ve,X]=f.useState(0),[oe,de]=f.useState((O==null?void 0:O.contentType)||""),[ie,J]=f.useState(void 0),[xe,ae]=f.useState(void 0),[Me,se]=f.useState(void 0),[Le,$e]=f.useState(void 0),[Ye,lt]=f.useState(""),[Ve,rt]=f.useState(void 0),[ke,De]=f.useState(void 0),[Fe,Ze]=f.useState(void 0),[Z,Y]=f.useState(void 0),[ce,M]=f.useState(void 0),[fe,ge]=f.useState(null),[Te,Ee]=f.useState(!1),[Q,ue]=f.useState(!1),[Se,je]=f.useState(void 0),[ze,We]=f.useState(void 0),[Ge,H]=f.useState({}),[he,we]=f.useState(!1),[Ae,Re]=f.useState(""),[qe,Xe]=f.useState(1e3),[et,ct]=f.useState(!1),[Wr,kn]=f.useState(!1),[mt,In]=f.useState(null),[Cn,Bt]=f.useState(!1),[St,ci]=f.useState(!1),[Di,fa]=f.useState(!1),[le,Ot]=f.useState(!1),[gn,dr]=f.useState(""),[ha,Jt]=f.useState(!1),[z,L]=f.useState(""),[Pe,tt]=f.useState(!1),[Be,jt]=f.useState(""),[Zt,Kr]=f.useState(!1),[ro,Nl]=f.useState({}),[io,_l]=f.useState(null),[Qe,qt]=f.useState([]),[YM,d1]=f.useState(!1),[p1,f1]=f.useState(null);f.useEffect(()=>{as(),dm(),pm(),tR(),Cr(),Vu(),h1(),ZM(),v1()},[]);const h1=async()=>{try{const C=await V.getApiPathBindings();w(C.bindings||[]),S(C.models||"")}catch(C){console.error("Failed to load API path bindings:",C)}},m1=async(C,ee)=>{try{const me=await V.updateApiPathBindings(C,ee);w(me.bindings),U.success("路由映射已保存")}catch(me){U.error(me.message||"保存失败")}},GM=(C,ee)=>{const me=j.map(Oe=>Oe.apiPath===C?{...Oe,routeId:ee}:Oe);w(me),m1(me,k)},XM=()=>{m1(j,k)};f.useEffect(()=>{E&&oo(E.id)},[E]),f.useEffect(()=>{g(W?d.filter(C=>C.vendorId===W):[]),P(""),re("")},[W]);const as=async()=>{const C=await V.getRoutes();i(C),C.length>0&&!E&&A(C[0]);const ee={};for(const me of C)try{const Oe=await V.getBoundSessions(me.id);ee[me.id]=Oe.sessions.length}catch{ee[me.id]=0}Nl(ee)},QM=async C=>{_l(C),d1(!0),qt([]);try{const ee=await V.getBoundSessions(C);qt(ee.sessions)}catch{qt([])}finally{d1(!1)}},g1=()=>{_l(null),qt([])},JM=async C=>{if(await e({title:"确认解绑会话",message:"确定要解除该会话的路由绑定吗?解绑后,该会话的后续请求将不再使用此路由。",type:"danger",confirmText:"解绑",cancelText:"取消"})){f1(C);try{const me=await V.unbindSessionRoute(C);me.success?(U.success("已解除绑定"),qt(Oe=>Oe.filter(pt=>pt.id!==C)),Nl(Oe=>{const pt=io;return!pt||!Oe[pt]?Oe:{...Oe,[pt]:Math.max(0,Oe[pt]-1)}})):U.error(me.error||"解绑失败")}catch(me){U.error(me.message||"解绑失败")}finally{f1(null)}}},ZM=async()=>{try{const C=await V.checkClaudeVersion();In(C)}catch(C){console.error("Failed to check Claude version:",C)}},eR=(C,ee)=>{if(!C)return-1;const me=C.split(".").map(Number),Oe=ee.split(".").map(Number);for(let pt=0;pt<3;pt++){const vt=me[pt]||0,Nn=Oe[pt]||0;if(vt>Nn)return 1;if(vt<Nn)return-1}return 0},ao=()=>{var C;return(C=mt==null?void 0:mt.claudeCode)!=null&&C.version?eR(mt.claudeCode.version,"2.1.32")>=0:!1},oo=async C=>{const ee=await V.getRules(C);if(s(ee),v1(),C)try{const Oe=(await V.getRulesBlacklistStatus(C)).reduce((pt,vt)=>(pt[vt.ruleId]=vt,pt),{});H(Oe)}catch(me){console.error("Failed to load blacklist status:",me)}},v1=async()=>{try{const C=await V.getRules();c(C)}catch(C){console.error("Failed to load all rules:",C)}},dm=async()=>{const C=await V.getVendors();p(C)},pm=async()=>{const C=await V.getAPIServices();h(C)},tR=async()=>{const C=await V.getMCPs();x(C)},[it,nR]=f.useState(null),[ui,Hu]=f.useState(null),Cr=async()=>{try{const C=await V.getConfig();b(C),dr(C.claudeDefaultModel||""),Jt(!1),L(C.autocompactPctOverride!=null?String(C.autocompactPctOverride):""),tt(!1),jt(C.codexDefaultModel||""),Kr(!1),lt(typeof C.ruleGlobalTimeout=="number"&&C.ruleGlobalTimeout>0?String(C.ruleGlobalTimeout):"")}catch(C){console.error("Failed to load app config:",C)}},Vu=async()=>{try{const C=await V.getToolBindings();nR(C)}catch(C){console.error("Failed to load tool bindings:",C)}},qu=async(C,ee)=>{Hu(C);try{(await V.activateToolRoute(C,ee)).success?(await Vu(),await as(),U.success("路由已激活")):U.error("激活失败")}catch(me){U.error(`激活失败: ${me.message||"未知错误"}`)}finally{Hu(null)}},Yu=async C=>{Hu(C);try{(await V.deactivateToolRoute(C)).success?(await Vu(),await as(),U.success("路由已停用")):U.error("停用失败")}catch(ee){U.error(`停用失败: ${ee.message||"未知错误"}`)}finally{Hu(null)}},rR=async C=>{C.preventDefault();const ee=new FormData(C.currentTarget),me={name:ee.get("name"),description:ee.get("description")};G?await V.updateRoute(G.id,me):await V.createRoute(me),T(!1),as()},iR=async C=>{if(await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{await V.deleteRoute(C),as(),E&&E.id===C&&(A(null),s([])),U.success("路由已删除")}catch(me){U.error(me.message||"删除失败")}},aR=async C=>{if(C.preventDefault(),oe==="image-understanding"&&he&&!Ae){U.warning("请选择一个MCP工具");return}if(!he&&!$){U.warning("请选择供应商API服务");return}if(!he&&ie!==void 0&&Se!==void 0&&ie>Se){U.warning(`Token超量值 (${ie}k) 不能超过API服务的限制 (${Se}k)`);return}if(!he&&Ve!==void 0&&ze!==void 0&&Ve>ze){U.warning(`请求次数超量值 (${Ve}) 不能超过API服务的限制 (${ze})`);return}const ee=new FormData(C.currentTarget),me={routeId:E.id,contentType:ee.get("contentType"),targetServiceId:he?"":$,targetModel:he?void 0:F||"",replacedModel:N||"",sortOrder:ve,timeout:Le?Le*1e3:void 0,tokenLimit:he?void 0:ie||void 0,resetInterval:he?void 0:xe,tokenResetBaseTime:he?void 0:Me?Me.getTime():void 0,requestCountLimit:he?void 0:Ve,requestResetInterval:he?void 0:ke,requestResetBaseTime:he?void 0:Fe?Fe.getTime():void 0,frequencyLimit:Z,frequencyWindow:ce,useMCP:oe==="image-understanding"?he:!1,mcpId:oe==="image-understanding"&&he?Ae:void 0,sessionTokenThreshold:oe==="long-context"?qe:void 0};O?await V.updateRule(O.id,me):await V.createRule(me),_(!1),E&&oo(E.id)},oR=async C=>{await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"})&&(await V.deleteRule(C),E&&oo(E.id),U.success("规则已删除"))},sR=async C=>{try{const ee=await V.toggleRuleDisable(C);E&&oo(E.id),U.success(ee.isDisabled?"规则已屏蔽":"规则已启用")}catch(ee){U.error("操作失败: "+ee.message)}},lR=async C=>{var ee,me;try{const Oe=[];(ee=Ge[C])!=null&&ee.isBlacklisted&&Oe.push(V.clearRuleBlacklist(C));const pt=(me=t[C])==null?void 0:me.status;(pt==="error"||pt==="suspended")&&Oe.push(n(C)),await Promise.all(Oe),E&&oo(E.id),U.success("已恢复")}catch(Oe){U.error("恢复失败: "+Oe.message)}},cR=async C=>{try{const ee=a.find(vt=>vt.id===C);if(!ee)return;const me=a.filter(vt=>vt.contentType===ee.contentType),pt=Math.max(...me.map(vt=>vt.sortOrder||0))+1;await V.updateRule(C,{sortOrder:pt}),E&&oo(E.id),U.success("优先级已提升至最高")}catch(ee){U.error("操作失败: "+ee.message)}},uR=async C=>{try{if(!a.find(Oe=>Oe.id===C))return;await V.updateRule(C,{sortOrder:0}),E&&oo(E.id),U.success("优先级已降至最低")}catch(ee){U.error("操作失败: "+ee.message)}},dR=async C=>{if(C&&!ao()){U.error("当前 Claude Code 版本不支持 Agent Teams 功能,需要版本 ≥ 2.1.32");return}try{const ee=v||{};await V.updateConfig({...ee,enableAgentTeams:C}),U.success(C?"Agent Teams 设置已保存(重启 Claude Code 后生效)":"Agent Teams 设置已取消(重启 Claude Code 后生效)"),await Cr()}catch(ee){U.error("更新失败: "+ee.message)}},pR=async C=>{try{const ee=v||{},me=Jm(v),Oe=!C&&me==="bypassPermissions"?"default":me;await V.updateConfig({...ee,enableBypassPermissionsSupport:C,claudePermissionsDefaultMode:Oe}),U.success(C?"对 bypassPermissions 的支持设置已保存(重启 Claude Code 后生效)":"对 bypassPermissions 的支持设置已取消(重启 Claude Code 后生效)"),await Cr()}catch(ee){U.error("更新失败: "+ee.message)}},fR=async C=>{try{const ee=v||{};await V.updateConfig({...ee,claudePermissionsDefaultMode:C}),U.success("默认权限模式已保存(重启 Claude Code 后生效)"),await Cr()}catch(ee){U.error("更新失败: "+ee.message)}},hR=async C=>{try{fa(!0);const ee=v||{};await V.updateConfig({...ee,codexModelReasoningEffort:C}),U.success("Reasoning Effort 设置已保存(重启 Codex 后生效)"),await Cr()}catch(ee){U.error("更新失败: "+ee.message)}finally{fa(!1)}},mR=async C=>{try{Ot(!0);const ee=v||{};await V.updateConfig({...ee,claudeEffortLevel:C}),U.success("Effort Level 设置已保存(重启 Claude Code 后生效)"),await Cr()}catch(ee){U.error("更新失败: "+ee.message)}finally{Ot(!1)}},gR=async()=>{try{const C=v||{};await V.updateConfig({...C,claudeDefaultModel:gn.trim()||void 0}),U.success("默认模型已保存(重启 Claude Code 后生效)"),Jt(!1),await Cr()}catch(C){U.error("保存失败: "+C.message)}},vR=async()=>{const C=z.trim();if(C===""){try{const me=v||{};await V.updateConfig({...me,autocompactPctOverride:void 0}),U.success("自动压缩百分比已清除(重启 Claude Code 后生效)"),tt(!1),await Cr()}catch(me){U.error("保存失败: "+me.message)}return}const ee=Number(C);if(!Number.isInteger(ee)||ee<1||ee>100){U.error("自动压缩百分比必须为 1-100 的整数");return}try{const me=v||{};await V.updateConfig({...me,autocompactPctOverride:ee}),U.success("自动压缩百分比已保存(重启 Claude Code 后生效)"),tt(!1),await Cr()}catch(me){U.error("保存失败: "+me.message)}},yR=async()=>{try{const C=v||{};await V.updateConfig({...C,codexDefaultModel:Be.trim()||void 0}),U.success("默认模型已保存(重启 Codex 后生效)"),Kr(!1),await Cr()}catch(C){U.error("保存失败: "+C.message)}},xR=async()=>{try{const C=v||{},ee=Number(Ye),me=Number.isFinite(ee)&&ee>0?ee:void 0;await V.updateConfig({...C,ruleGlobalTimeout:me}),U.success(me?`规则全局超时时间已设置为 ${me} 秒`:"规则全局超时时间已恢复为默认值(300秒)"),await Cr()}catch(C){U.error("更新失败: "+C.message)}},bR=()=>$w,jR=C=>{B(C),de(C.contentType),we(C.useMCP||!1),Re(C.mcpId||"");const ee=d.find(me=>me.id===C.targetServiceId);ee?(ee.vendorId&&(R(ee.vendorId),g(d.filter(me=>me.vendorId===ee.vendorId))),setTimeout(()=>{if(P(ee.id),re(C.targetModel||""),pe(C.replacedModel||""),X(C.sortOrder||0),$e(C.timeout?C.timeout/1e3:void 0),J(C.tokenLimit||void 0),ae(C.resetInterval),se(C.tokenResetBaseTime?new Date(C.tokenResetBaseTime):void 0),rt(C.requestCountLimit),De(C.requestResetInterval),Ze(C.requestResetBaseTime?new Date(C.requestResetBaseTime):void 0),Y(C.frequencyLimit),M(C.frequencyWindow),ee.enableTokenLimit&&ee.tokenLimit){je(ee.tokenLimit);const me=C.tokenLimit===ee.tokenLimit&&C.resetInterval===(ee.tokenResetInterval||void 0)&&C.tokenLimit!==null&&C.resetInterval!==null;Ee(me)}else je(void 0),Ee(!1);if(ee.enableRequestLimit&&ee.requestCountLimit){We(ee.requestCountLimit);const me=C.requestCountLimit===ee.requestCountLimit&&C.requestResetInterval===(ee.requestResetInterval||void 0)&&C.requestCountLimit!==null&&C.requestResetInterval!==null;ue(me)}else We(void 0),ue(!1);ct(!!C.tokenLimit),kn(!!C.requestCountLimit),Xe(C.sessionTokenThreshold??1e3)},0)):(C.useMCP&&(R(""),P(""),re(""),pe(""),X(C.sortOrder||0),$e(C.timeout?C.timeout/1e3:void 0),ct(!1),kn(!1)),Xe(C.sessionTokenThreshold??1e3)),_(!0)},wR=C=>l.some(ee=>{var me;return ee.routeId===C&&((me=t[ee.id])==null?void 0:me.status)==="in_use"}),SR=C=>{var Ml;const ee=Ge[C.id],me=[],Oe=t[C.id];if((Oe==null?void 0:Oe.status)==="in_use")return{status:"in_use",label:"使用中",reason:"正在处理请求"};if((Oe==null?void 0:Oe.status)==="suspended"){const Ue=Oe.errorType==="timeout"?"超时":Oe.errorType==="http"?"HTTP错误":"错误";return{status:"suspended",label:"已挂起",reason:Oe.errorMessage||`${Ue}导致服务暂时不可用`}}if((Oe==null?void 0:Oe.status)==="error")return{status:"error",label:"请求失败",reason:Oe.errorMessage||"请求处理失败"};if(ee!=null&&ee.isBlacklisted){const Ue=ee.blacklistEntry;(Ue==null?void 0:Ue.errorType)==="timeout"?me.push("请求超时"):Ue!=null&&Ue.lastStatusCode&&me.push(`HTTP ${Ue.lastStatusCode}错误`)}const pt=(Oe==null?void 0:Oe.totalTokensUsed)!==void 0?Oe.totalTokensUsed:C.totalTokensUsed;C.tokenLimit&&pt!==void 0&&pt>=C.tokenLimit*1e3&&me.push("Token超限");const vt=(Oe==null?void 0:Oe.totalRequestsUsed)!==void 0?Oe.totalRequestsUsed:C.totalRequestsUsed;if(C.requestCountLimit&&vt!==void 0&&vt>=C.requestCountLimit&&me.push("次数超限"),me.length>0)return{status:"error",label:ee!=null&&ee.isBlacklisted?((Ml=ee.blacklistEntry)==null?void 0:Ml.errorType)==="timeout"?"超时":"服务错误":me[0],reason:me.join(", ")};const Nn=[];if(C.tokenLimit&&pt!==void 0){const Ue=pt/(C.tokenLimit*1e3)*100;Ue>=80&&Nn.push(`Token ${Ue.toFixed(0)}%`)}if(C.requestCountLimit&&vt!==void 0){const Ue=vt/C.requestCountLimit*100;Ue>=80&&Nn.push(`次数 ${Ue.toFixed(0)}%`)}return Nn.length>0?{status:"warning",label:"接近限制",reason:Nn.join(", ")}:{status:"success",label:"正常",reason:""}},kR=()=>{B(null),de("default"),R(""),P(""),re(""),pe(""),X(0),$e(void 0),J(void 0),ae(void 0),se(void 0),rt(void 0),De(void 0),Ze(void 0),Ee(!1),ue(!1),je(void 0),We(void 0),ct(!1),kn(!1),we(!1),Re(""),Xe(1e3),_(!0)};return o.jsxs("div",{className:"routes-page",children:[o.jsxs("div",{className:"page-header",style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[o.jsxs("div",{children:[o.jsx("h1",{children:"路由管理"}),o.jsx("p",{children:"管理API路由和路由配置"})]}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>ci(!0),style:{whiteSpace:"nowrap"},children:"局域网内同步配置"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>Bt(!0),style:{whiteSpace:"nowrap"},children:"一键配置"})]})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column"},children:o.jsxs("div",{style:{display:"flex",gap:"20px"},children:[o.jsxs("div",{className:"card",style:{flex:"0 0 25%",minWidth:300},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"路由"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>T(!0),children:"新建"})]}),r.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无路由规则"})}):o.jsx("div",{style:{marginTop:"10px"},children:r.map(C=>{var ee,me,Oe,pt;return o.jsx("div",{className:wR(C.id)?"route-active-glow":void 0,onClick:()=>A(C),style:{padding:"12px",marginBottom:"8px",backgroundColor:E&&E.id===C.id?"var(--bg-route-item-selected)":"var(--bg-route-item)",borderRadius:"8px",cursor:"pointer",border:"1px solid var(--border-primary)",position:"relative"},children:o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[o.jsx("div",{style:{fontWeight:500,flex:1,minWidth:0},children:C.name}),o.jsxs("div",{style:{display:"flex",gap:"3px",alignItems:"center",flexShrink:0,marginLeft:"8px"},children:[ro[C.id]>0&&o.jsxs("div",{style:{position:"relative"},children:[o.jsx("div",{onClick:vt=>{vt.stopPropagation(),QM(C.id)},style:{width:"18px",height:"18px",borderRadius:"50%",border:"2px solid var(--color-primary, #2980b9)",boxSizing:"border-box",backgroundColor:"transparent",color:"var(--color-primary, #2980b9)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:700,cursor:"pointer",flexShrink:0},children:ro[C.id]>99?"99+":ro[C.id]}),o.jsxs("span",{className:"route-icon-popover",children:[ro[C.id]," 个会话绑定此路由,点击查看"]})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:pB,alt:"Codex",onClick:vt=>{var Nn;vt.stopPropagation(),!ui&&(((Nn=it==null?void 0:it.codex)==null?void 0:Nn.routeId)===C.id?Yu("codex"):qu("codex",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:ui?"wait":"pointer",opacity:((ee=it==null?void 0:it.codex)==null?void 0:ee.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((me=it==null?void 0:it.codex)==null?void 0:me.routeId)===C.id?"Codex 已绑定此路由,点击解绑":"点击将 Codex 绑定到此路由"})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:fB,alt:"Claude Code",onClick:vt=>{var Nn;vt.stopPropagation(),!ui&&(((Nn=it==null?void 0:it["claude-code"])==null?void 0:Nn.routeId)===C.id?Yu("claude-code"):qu("claude-code",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:ui?"wait":"pointer",opacity:((Oe=it==null?void 0:it["claude-code"])==null?void 0:Oe.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((pt=it==null?void 0:it["claude-code"])==null?void 0:pt.routeId)===C.id?"Claude Code 已绑定此路由,点击解绑":"点击将 Claude Code 绑定到此路由"})]})]})]}),C.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-route-muted)",marginTop:"2px"},children:C.description}),o.jsxs("div",{className:"action-buttons",style:{marginTop:"8px"},children:[o.jsx("button",{className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:vt=>{vt.stopPropagation(),K(C),T(!0)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:vt=>{vt.stopPropagation(),iR(C.id)},children:"删除"})]})]})},C.id)})})]}),o.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:o.jsxs("div",{className:"card",style:{flex:1},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"规则列表"}),E&&o.jsx("button",{className:"btn btn-primary",onClick:kR,children:"新建规则"})]}),E?a.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无路由规则"})}):o.jsxs("table",{className:"rules-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"col-priority",children:"优先级"}),o.jsx("th",{children:"类型"}),o.jsx("th",{children:"API服务"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"用量情况"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:[...a].sort((C,ee)=>{const me=Bw[C.contentType]??999,Oe=Bw[ee.contentType]??999;if(me!==Oe)return me-Oe;const pt=C.sortOrder||0;return(ee.sortOrder||0)-pt}).map(C=>{var pt,vt,Nn,Ml;const ee=d.find(Ue=>Ue.id===C.targetServiceId),me=u.find(Ue=>Ue.id===(ee==null?void 0:ee.vendorId)),Oe=(pt=$w.find(Ue=>Ue.value===C.contentType))==null?void 0:pt.label;return o.jsxs("tr",{children:[o.jsx("td",{className:"col-priority",style:C.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{className:"col-priority-box",children:[o.jsx("span",{children:C.sortOrder||0}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>uR(C.id),title:"降至最低优先级",children:"↓"}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>cR(C.id),title:"升至最高优先级",children:"↑"})]})}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{style:{fontSize:"12px",whiteSpace:"nowrap"},children:[C.contentType!=="default"&&Fw[C.contentType]&&o.jsx("span",{style:{fontSize:"14px"},children:Fw[C.contentType]}),o.jsx("span",{children:Oe}),C.contentType==="model-mapping"&&C.replacedModel&&o.jsxs("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:()=>ge(C.id),onMouseLeave:()=>ge(null),children:[o.jsx("span",{style:{cursor:"help",fontSize:"14px",color:"var(--text-info)",fontWeight:"bold"},children:"ⓘ"}),fe===C.id&&o.jsxs("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"calc(100% + 8px)",backgroundColor:"var(--bg-popover, #333)",color:"var(--text-popover, #fff)",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:["被顶替的模型是: ",C.replacedModel,o.jsx("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"-4px",width:"0",height:"0",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid var(--bg-popover, #333)"}})]})]})]})}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:o.jsx("div",{className:"vendor-sevices-col",style:{fontSize:"0.6em"},children:C.useMCP?o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["MCP:",((vt=y.find(Ue=>Ue.id===C.mcpId))==null?void 0:vt.name)||"Unknown"]}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"使用MCP工具"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["供应商:",me?me.name:"Unknown"]}),o.jsxs("div",{children:["服务:",ee?ee.name:"Unknown"]}),o.jsxs("div",{children:["模型:",C.targetModel||"透传模型"]})]})})}),o.jsx("td",{style:{whiteSpace:"nowrap",...C.isDisabled?{opacity:.4}:{}},children:(()=>{var E1,T1,A1,O1;const Ue=SR(C),Kn=Ge[C.id],CR=(Kn==null?void 0:Kn.isBlacklisted)&&!((E1=Ue.reason)!=null&&E1.includes("Token超限"))&&!((T1=Ue.reason)!=null&&T1.includes("次数超限"));if(C.isDisabled)return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("span",{style:{color:"#6c757d",fontWeight:"bold",fontSize:"14px"},children:"⊘"}),o.jsx("span",{style:{fontSize:"13px",color:"#6c757d",fontWeight:"bold"},children:"已屏蔽"})]});const PR=CR||((A1=t[C.id])==null?void 0:A1.status)==="error"||((O1=t[C.id])==null?void 0:O1.status)==="suspended";return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[Ue.status==="success"&&o.jsx("span",{style:{color:"#28a745",fontWeight:"bold",fontSize:"14px"},children:"✓"}),Ue.status==="warning"&&o.jsx("span",{style:{color:"#ffc107",fontWeight:"bold",fontSize:"14px"},children:"⚠"}),Ue.status==="error"&&o.jsx("span",{style:{color:"#dc3545",fontWeight:"bold",fontSize:"14px"},children:"✗"}),Ue.status==="suspended"&&o.jsx("span",{style:{color:"#6f42c1",fontWeight:"bold",fontSize:"14px"},children:"⏸"}),Ue.status==="in_use"&&o.jsx(o.Fragment,{children:o.jsx("span",{style:{color:"#007bff",fontWeight:"bold",fontSize:"14px",animation:"pulse 1.5s ease-in-out infinite"},children:"●"})}),o.jsx("span",{style:{fontSize:"13px",color:Ue.status==="success"?"#28a745":Ue.status==="warning"?"#ffc107":Ue.status==="in_use"?"#007bff":Ue.status==="suspended"?"#6f42c1":"#dc3545",fontWeight:Ue.status!=="success"?"bold":"normal"},children:Ue.label}),Ue.reason&&o.jsxs("div",{style:{position:"relative",display:"inline-block",cursor:"help"},onMouseEnter:()=>ge(C.id+"-status"),onMouseLeave:()=>ge(null),children:[o.jsx("span",{style:{fontSize:"12px",color:"#999",marginLeft:"4px"},children:" ⓘ"}),fe===C.id+"-status"&&o.jsxs("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"calc(100% + 8px)",backgroundColor:"var(--bg-popover, #333)",color:"var(--text-popover, #fff)",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:[Ue.reason,o.jsx("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"-4px",width:"0",height:"0",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid var(--bg-popover, #333)"}})]})]})]}),PR&&o.jsx("button",{className:"btn btn-info",style:{padding:"2px 8px",fontSize:"11px"},onClick:()=>lR(C.id),children:"恢复"})]})})()}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:C.tokenLimit||C.requestCountLimit?o.jsxs("div",{style:{fontSize:"13px"},children:[C.tokenLimit&&o.jsxs("div",{style:{whiteSpace:"nowrap"},children:[o.jsx("span",{style:{fontWeight:"bold",fontSize:"12px"},children:"Tokens:"}),o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{color:(()=>{var Kn;const Ue=((Kn=t[C.id])==null?void 0:Kn.totalTokensUsed)??C.totalTokensUsed;return Ue&&C.tokenLimit&&Ue>=C.tokenLimit*1e3?"red":"inherit"})()},children:[(((((Nn=t[C.id])==null?void 0:Nn.totalTokensUsed)??C.totalTokensUsed)||0)/1e3).toFixed(1),"K/",C.tokenLimit.toFixed(0),"K"]}),(()=>{var Kn;const Ue=((Kn=t[C.id])==null?void 0:Kn.totalTokensUsed)??C.totalTokensUsed;return Ue&&C.tokenLimit&&Ue>=C.tokenLimit*1e3?o.jsx("span",{style:{color:"red",marginLeft:"4px",fontWeight:"bold",fontSize:"11px"},children:"超限"}):null})()]})]}),C.requestCountLimit&&o.jsxs("div",{style:{marginTop:C.tokenLimit?"6px":0},children:[o.jsx("span",{style:{fontWeight:"bold",fontSize:"12px"},children:"次数:"}),o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{color:(()=>{var Kn;const Ue=((Kn=t[C.id])==null?void 0:Kn.totalRequestsUsed)??C.totalRequestsUsed;return Ue&&C.requestCountLimit&&Ue>=C.requestCountLimit?"red":"inherit"})()},children:[(((Ml=t[C.id])==null?void 0:Ml.totalRequestsUsed)??C.totalTokensUsed)||0,"/",C.requestCountLimit]}),(()=>{var Kn;const Ue=((Kn=t[C.id])==null?void 0:Kn.totalRequestsUsed)??C.totalRequestsUsed;return Ue&&C.requestCountLimit&&Ue>=C.requestCountLimit?o.jsx("span",{style:{color:"red",marginLeft:"4px",fontWeight:"bold",fontSize:"11px"},children:"超限"}):null})()]})]})]}):o.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"不限制"})}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",style:{justifyContent:"flex-end"},children:[o.jsx("button",{className:`btn ${C.isDisabled?"btn-success":"btn-warning"}`,onClick:()=>sR(C.id),title:C.isDisabled?"启用规则":"临时屏蔽规则",children:C.isDisabled?"启用":"屏蔽"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>jR(C),children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>oR(C.id),children:"删除"})]})})]},C.id)})})]}):o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"请先选择一个路由"})}),E&&a.length>0&&o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-info-box)",marginTop:"16px",padding:"12px",backgroundColor:"var(--bg-info-box)",borderRadius:"6px",border:"1px solid var(--border-info-box)",lineHeight:"1.6"},children:[o.jsx("strong",{children:"📌 如何配置规则(推荐)"}),o.jsxs("div",{style:{marginTop:"6px"},children:["• 先创建一条 ",o.jsx("strong",{children:"默认"})," 规则作为兜底,避免请求无规则可走",o.jsx("br",{}),"• 再按你的实际场景增加规则:如图像理解、长上下文、思考、高智商等",o.jsx("br",{}),"• 按类型匹配顺序:",o.jsx("strong",{children:"压缩对话 → 图像理解 → 高智商 → 长上下文 → 思考 → 后台 → 模型顶替 → 默认"}),o.jsx("br",{}),"• 如果要“指定模型走指定服务”,再加 ",o.jsx("strong",{children:"模型顶替"})," 规则",o.jsx("br",{}),"• 同一类型可配多条:",o.jsx("strong",{children:"把主力服务放上面(优先级更大),备用服务放下面"}),o.jsx("br",{}),"• 开启智能故障切换后,系统会在主力不可用时自动切到下一个可用规则",o.jsx("br",{}),"• 你只需要记住:",o.jsx("strong",{children:"先分类型,再排顺序,上主下备"})]})]}),E&&a.length>0&&o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-info-box)",marginTop:"12px",padding:"12px",backgroundColor:"var(--bg-info-box)",borderRadius:"6px",border:"1px solid var(--border-info-box)",lineHeight:"1.6"},children:[o.jsx("strong",{children:"💡 智能故障切换机制"}),o.jsxs("div",{style:{marginTop:"6px"},children:["• 当同一请求类型配置多个规则时,系统会按排序优先使用第一个",o.jsx("br",{}),"• 如果某个服务报错(4xx/5xx)或请求超时,将自动切换到下一个可用服务",o.jsx("br",{}),"• 报错或超时的服务会被标记为不可用(默认10秒),可在设置页面修改“故障自动恢复时间”",o.jsx("br",{}),"• 到达恢复时间后自动解除标记,如果再次报错或超时则重新标记",o.jsx("br",{}),"• 确保您的请求始终路由到稳定可用的服务",o.jsx("br",{}),"• 规则状态列会实时显示每个规则的可用性状态",o.jsx("br",{}),"• 如不需要此功能,可在",o.jsx("strong",{children:"设置"}),'页面关闭"启用智能故障切换"选项']})]})]})})]})}),o.jsxs("div",{className:"card",children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"规则配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"rule-global-timeout",style:{marginBottom:0,minWidth:"140px",whiteSpace:"nowrap"},children:"超时时间(秒)"}),o.jsx("input",{id:"rule-global-timeout",type:"number",value:Ye,onChange:C=>lt(C.target.value),onBlur:()=>xR(),min:"1",placeholder:"默认300秒",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置规则的全局超时时间。当单个规则未配置超时时间时,将使用此值作为超时上限。 不设置则默认为300秒(5分钟)。超时后会自动触发故障切换到下一个可用规则。"})]})]}),o.jsxs("div",{className:"card api-binding-card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"api-binding-header",children:o.jsx("h3",{children:"API 路径路由映射"})}),o.jsx("p",{className:"api-binding-desc",children:"将标准 API 路径绑定到路由,使任何兼容该 API 的编程工具都可以通过对应路径使用服务。"}),o.jsxs("div",{className:"api-binding-baseurl-row",children:[o.jsx("span",{className:"api-binding-baseurl-prefix",children:"Base URL"}),o.jsx("span",{className:"api-binding-baseurl-value",children:window.location.origin})]}),o.jsx("div",{className:"api-binding-list",children:j.map(C=>{const ee=C.apiPath==="/v1/models",me=ee?!!k.trim():!!C.routeId;return o.jsxs("div",{className:"api-binding-row",children:[o.jsx("span",{className:`api-binding-status ${me?"api-binding-status--bound":""}`}),o.jsx("span",{className:"api-binding-path",children:C.apiPath==="/v1beta/models"?"/v1beta/models/{model}:{action}":C.apiPath}),o.jsx("span",{className:"api-binding-arrow",children:"→"}),o.jsx("div",{className:"api-binding-control",children:ee?o.jsx("input",{type:"text",value:k,onChange:Oe=>S(Oe.target.value),onBlur:XM,placeholder:"自定义模型列表,英文逗号分隔,留空使用默认列表"}):o.jsxs("select",{value:C.routeId||"",onChange:Oe=>GM(C.apiPath,Oe.target.value||null),children:[o.jsx("option",{value:"",children:"无"}),r.map(Oe=>o.jsx("option",{value:Oe.id,children:Oe.name},Oe.id))]})})]},C.apiPath)})})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"Claude Code 全局配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"tool-binding-block",children:[o.jsxs("div",{className:"tool-binding-label",children:[o.jsx("span",{className:"tool-binding-label-icon",children:"⚡"}),"激活路由"]}),o.jsxs("div",{className:"tool-binding-row",children:[o.jsxs("select",{id:"claude-route-binding",value:((y1=it==null?void 0:it["claude-code"])==null?void 0:y1.routeId)||"",onChange:C=>{const ee=C.target.value||null;ee&&qu("claude-code",ee)},disabled:ui==="claude-code",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var ee;return o.jsxs("option",{value:C.id,children:[C.name,((ee=it==null?void 0:it["claude-code"])==null?void 0:ee.routeId)===C.id?" (已激活)":""]},C.id)})]}),((x1=it==null?void 0:it["claude-code"])==null?void 0:x1.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Yu("claude-code"),disabled:ui==="claude-code",children:ui==="claude-code"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 Claude Code 代理请求。激活后,/claude-code/ 路径的请求将使用该路由的规则。"})]}),!ao()&&((b1=mt==null?void 0:mt.claudeCode)==null?void 0:b1.version)&&o.jsxs("div",{style:{backgroundColor:"var(--bg-warning, #fff3cd)",border:"1px solid var(--border-warning, #ffc107)",borderRadius:"6px",padding:"12px",marginBottom:"12px",fontSize:"13px",color:"var(--text-warning, #856404)"},children:["⚠️ 当前 Claude Code 版本 (",mt.claudeCode.version,") 不支持 Agent Teams 功能。",o.jsx("br",{}),"Agent Teams 功能需要 Claude Code 版本 ≥ 2.1.32。请升级 Claude Code 后再使用此功能。"]}),o.jsxs("div",{style:{marginTop:"20px",marginBottom:"20px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"agent-teams-toggle",checked:(v==null?void 0:v.enableAgentTeams)||!1,onChange:C=>dR(C.target.checked),disabled:!ao(),style:{cursor:ao()?"pointer":"not-allowed",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"agent-teams-toggle",style:{cursor:ao()?"pointer":"not-allowed",fontSize:"14px",userSelect:"none",color:ao()?"inherit":"var(--text-muted)"},children:"开启 Agent Teams 功能"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:ao()?"开启后将启用 Agent Teams 实验性功能,并实时写入配置;重启 Claude Code 后生效。":"Agent Teams 功能需要 Claude Code 版本 ≥ 2.1.32。请升级 Claude Code 后再使用此功能。"})]}),o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"bypass-permissions-support-toggle",checked:(v==null?void 0:v.enableBypassPermissionsSupport)||!1,onChange:C=>pR(C.target.checked),style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"bypass-permissions-support-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启对 bypassPermissions 的支持"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后默认编辑跳过危险模式权限提示,你可以切换到其他模式。该设置会实时写入配置文件,重启 Claude Code 后生效。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认权限模式"}),o.jsx("div",{style:{flex:1,minWidth:0},children:o.jsx(nB,{value:Jm(v),options:zv.filter(C=>C.value!=="bypassPermissions"||(v==null?void 0:v.enableBypassPermissionsSupport)).map(C=>({value:C.value,label:C.label,description:C.desc})),onChange:C=>fR(C)})})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:[(j1=zv.find(C=>C.value===Jm(v)))==null?void 0:j1.desc,v!=null&&v.enableBypassPermissionsSupport?"":" 需先开启上方的 bypassPermissions 支持,才能切换到 bypassPermissions 模式。"," 该设置会实时写入 ~/.claude/settings.json,重启 Claude Code 后生效。"]})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-effort-level",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"Effort Level"}),o.jsx("select",{id:"claude-effort-level",value:yB(v),onChange:C=>mR(C.target.value),disabled:le,style:{flex:1,minWidth:0},children:lA.map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"该设置会实时写入 ~/.claude/settings.json,重启 Claude Code 后生效。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"claude-default-model",type:"text",value:gn,onChange:C=>{dr(C.target.value),Jt(C.target.value!==((v==null?void 0:v.claudeDefaultModel)||""))},onBlur:()=>{ha&&gR()},placeholder:"例如:claude-3-5-sonnet-20241022",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置后写入 ~/.claude/settings.json 的 model 字段,重启 Claude Code 后生效。留空则不写入。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-autocompact-pct",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"Autocompact PCT"}),o.jsx("input",{id:"claude-autocompact-pct",type:"number",min:"1",max:"100",value:z,onChange:C=>{L(C.target.value),tt(C.target.value!==((v==null?void 0:v.autocompactPctOverride)!=null?String(v.autocompactPctOverride):""))},onBlur:()=>{Pe&&vR()},placeholder:"1-100",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置自动压缩百分比阈值(1-100),写入 ~/.claude/settings.json 的 env 字段,重启 Claude Code 后生效。留空则不写入。"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"Codex 全局配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"tool-binding-block",children:[o.jsxs("div",{className:"tool-binding-label",children:[o.jsx("span",{className:"tool-binding-label-icon",children:"⚡"}),"激活路由"]}),o.jsxs("div",{className:"tool-binding-row",children:[o.jsxs("select",{id:"codex-route-binding",value:((w1=it==null?void 0:it.codex)==null?void 0:w1.routeId)||"",onChange:C=>{const ee=C.target.value||null;ee&&qu("codex",ee)},disabled:ui==="codex",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var ee;return o.jsxs("option",{value:C.id,children:[C.name,((ee=it==null?void 0:it.codex)==null?void 0:ee.routeId)===C.id?" (已激活)":""]},C.id)})]}),((S1=it==null?void 0:it.codex)==null?void 0:S1.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Yu("codex"),disabled:ui==="codex",children:ui==="codex"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 Codex 代理请求。激活后,/codex/ 路径的请求将使用该路由的规则。"})]}),o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"codex-reasoning-effort",style:{marginBottom:0,minWidth:"120px",whiteSpace:"nowrap"},children:"Reasoning Effort"}),o.jsx("select",{id:"codex-reasoning-effort",value:vB(v),onChange:C=>hR(C.target.value),disabled:Di,style:{flex:1,minWidth:0},children:sA.map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"该设置会实时写入 ~/.codex/config.toml,重启 Codex 后生效。"}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"codex-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"codex-default-model",type:"text",value:Be,onChange:C=>{jt(C.target.value),Kr(C.target.value!==((v==null?void 0:v.codexDefaultModel)||""))},onBlur:()=>{Zt&&yR()},placeholder:"例如:o1",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置后写入 ~/.codex/config.toml 的 model 字段,重启 Codex 后生效。留空则使用默认值 gpt-5.3-codex。"})]}),o.jsxs("div",{style:{marginTop:"20px",marginBottom:"20px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"codex-enable-memories-toggle",checked:!!(v!=null&&v.codexEnableMemories),onChange:async C=>{try{const ee=v||{};await V.updateConfig({...ee,codexEnableMemories:C.target.checked}),await Cr(),await V.writeCodexConfig(void 0,C.target.checked),U.success("记忆功能设置已保存(重启 Codex 后生效)")}catch(ee){U.error("更新失败: "+ee.message)}},style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"codex-enable-memories-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启记忆功能"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后会在 ~/.codex/config.toml 中添加 features.memories 和 memories 配置段。"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"📝 配置文件自动管理"})}),o.jsxs("div",{style:{padding:"20px",lineHeight:"1.8"},children:[o.jsxs("div",{style:{background:"var(--bg-info-blue)",padding:"15px",borderRadius:"8px",marginBottom:"15px",borderLeft:"4px solid var(--border-info-blue)"},children:[o.jsx("strong",{children:"💡 工作原理"}),o.jsx("p",{style:{marginTop:"8px",marginBottom:"0"},children:"配置文件由服务生命周期统一管理:服务启动时自动写入代理配置,服务停止时自动恢复原始配置;运行中修改全局工具配置会实时写入配置文件。"})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"15px"},children:[o.jsxs("div",{style:{background:"var(--bg-info-green)",padding:"15px",borderRadius:"8px",borderLeft:"4px solid var(--border-info-green)"},children:[o.jsx("strong",{children:"✓ 服务启动"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",marginBottom:"0"},children:[o.jsx("li",{children:"自动备份并覆盖配置文件"}),o.jsx("li",{children:"按全局工具设置写入 Claude/Codex 配置"})]})]}),o.jsxs("div",{style:{background:"var(--bg-info-orange)",padding:"15px",borderRadius:"8px",borderLeft:"4px solid var(--border-info-orange)"},children:[o.jsx("strong",{children:"○ 服务停止"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",marginBottom:"0"},children:[o.jsx("li",{children:"自动恢复原始配置文件"}),o.jsx("li",{children:"删除备份文件"})]})]})]}),o.jsxs("div",{style:{marginTop:"15px",padding:"12px 15px",background:"var(--bg-info-yellow)",borderRadius:"8px",borderLeft:"4px solid var(--border-info-yellow)"},children:[o.jsx("strong",{children:"⚠️ 重要提示"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",marginBottom:"0"},children:[o.jsx("li",{children:"修改路由规则后立即生效;修改全局工具配置后仅需重启对应编程工具(无需重启服务)"}),o.jsx("li",{children:"操作前建议关闭编程工具,避免配置冲突"})]})]}),o.jsxs("details",{style:{marginTop:"15px",cursor:"pointer"},children:[o.jsx("summary",{style:{fontWeight:"bold",color:"#666"},children:"📂 配置文件位置(点击展开)"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",color:"#666"},children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Claude Code:"})," ~/.claude/settings.json, ~/.claude.json"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Codex:"})," ~/.codex/config.toml, ~/.codex/auth.json"]})]})]})]})]}),D&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>T(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:G?"编辑路由":"新建路由"})}),o.jsxs("form",{onSubmit:rR,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"路由名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:G?G.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"描述"}),o.jsx("textarea",{name:"description",rows:3,defaultValue:G?G.description:""})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>T(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),I&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>_(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:O?"编辑规则":"新建规则"})}),o.jsxs("form",{onSubmit:aR,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"对象请求类型"}),o.jsx("select",{name:"contentType",value:oe,required:!0,onChange:C=>{de(C.target.value)},children:bR().map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),oe==="high-iq"&&o.jsxs("div",{style:{background:"var(--bg-info-blue)",padding:"12px",borderRadius:"6px",borderLeft:"4px solid var(--border-info-blue)",marginBottom:"16px"},children:[o.jsx("div",{style:{fontSize:"13px",fontWeight:"bold",marginBottom:"6px"},children:"💡 高智商请求使用方法"}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",lineHeight:"1.6"},children:["在编程工具中输入提示词时:",o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",lineHeight:"1.8"},children:[o.jsxs("li",{children:["使用 ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[!]"})," 标记高智商请求(仅在”最近一条真实用户输入”生效)"]}),o.jsxs("li",{children:["使用 ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[x]"})," 标记退出高智商模式,继续走普通模式"]})]})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"8px",lineHeight:"1.6"},children:[o.jsx("strong",{children:"示例:"}),o.jsx("br",{}),"• ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[!] 重构A模块"}),o.jsx("br",{}),"• ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"继续正常对话(不加 [!])"}),o.jsx("br",{}),"• ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[x] 接下来帮我解决一个简单的问题"})]})]}),oe==="model-mapping"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["被顶替模型 ",o.jsx("small",{children:"(可在日志中找出想要顶替的模型名)"})]}),o.jsx("input",{type:"text",value:N,onChange:C=>pe(C.target.value),placeholder:"例如:gpt-4"})]}),oe==="long-context"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["Session累积Tokens阈值 (单位: k) ",o.jsx("small",{children:"默认1000k (1M tokens)"})]}),o.jsx("input",{type:"number",value:qe??1e3,onChange:C=>Xe(Number(C.target.value)),placeholder:"1000",min:"1"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["当前对话(session)的累积tokens数量超过 ",qe??1e3,"k 时,该对话的新请求将走此规则"]})]}),oe==="image-understanding"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:he,onChange:C=>we(C.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用MCP"})]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"开启后,将使用MCP工具处理图像理解请求,而不是直接调用API服务"})]}),oe==="image-understanding"&&he&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["选择MCP工具 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("div",{style:{maxHeight:"300px",overflowY:"auto",border:"1px solid var(--border-primary)",borderRadius:"6px",padding:"8px"},children:y.length===0?o.jsx("div",{style:{padding:"12px",textAlign:"center",color:"var(--text-muted)"},children:"暂无MCP工具,请先在MCP管理页面添加"}):y.map(C=>o.jsxs("div",{onClick:()=>Re(C.id),style:{padding:"12px",marginBottom:"8px",border:`2px solid ${Ae===C.id?"var(--primary-color)":"var(--border-primary)"}`,borderRadius:"6px",cursor:"pointer",backgroundColor:Ae===C.id?"var(--bg-info-blue)":"var(--bg-card)",transition:"all 0.2s ease"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:C.name}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"11px"},children:C.type==="stdio"?"命令行":C.type.toUpperCase()})]}),C.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px"},children:C.description})]},C.id))})]}),!he&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsxs("select",{value:W,onChange:C=>R(C.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择供应商"}),u.map(C=>o.jsx("option",{value:C.id,children:C.name},C.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsxs("select",{value:$,onChange:C=>{const ee=C.target.value;P(ee),re("");const me=d.find(Oe=>Oe.id===ee);me&&(me.enableTokenLimit&&me.tokenLimit?(J(me.tokenLimit),ae(me.tokenResetInterval),se(me.tokenResetBaseTime?new Date(me.tokenResetBaseTime):void 0),je(me.tokenLimit),Ee(!0),ct(!0)):(je(void 0),Ee(!1),ct(!1)),me.enableRequestLimit&&me.requestCountLimit?(rt(me.requestCountLimit),De(me.requestResetInterval),Ze(me.requestResetBaseTime?new Date(me.requestResetBaseTime):void 0),We(me.requestCountLimit),ue(!0),kn(!0)):(We(void 0),ue(!1),kn(!1)))},required:!0,disabled:!W,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择API服务"}),m.map(C=>o.jsx("option",{value:C.id,children:C.name},C.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsxs("select",{value:F,onChange:C=>re(C.target.value),disabled:!$,children:[o.jsx("option",{value:"",children:"透传模型名"}),(C1=(k1=d.find(C=>C.id===$))==null?void 0:k1.supportedModels)==null?void 0:C1.map(C=>o.jsx("option",{value:C,children:C},C))]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:Te?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:et,onChange:C=>ct(C.target.checked),disabled:Te,style:{marginRight:"8px",cursor:Te?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Tokens超量限制"}),Te&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),Te&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>Ee(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),et&&!Te&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Tokens超量(单位:k)"}),o.jsx("input",{type:"number",value:ie||"",onChange:C=>{const ee=C.target.value?parseInt(C.target.value):void 0;if(ee!==void 0&&Se!==void 0&&ee>Se){U.warning(`Token超量值不能超过API服务的限制 (${Se}k)`);return}J(ee),Te&&ee!==Se&&Ee(!1)},min:"0",max:Se,placeholder:Se?`最大 ${Se}k`:"不限制",disabled:Te}),Se&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",Se,"k,当前值不能超过此限制"]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"当编程工具的请求tokens达到这个量时,在配置了其他规则的情况下,本条规则将失效,从而保护你的余额。例如:输入100表示100k即100,000个tokens"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Tokens超量自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:xe||"",onChange:C=>{ae(C.target.value?parseInt(C.target.value):void 0),Te&&Ee(!1)},min:"1",placeholder:"不自动重置",disabled:Te}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置后,系统将每隔指定小时数自动重置token计数。例如设置5小时,则每5小时重置一次"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:Me?Uw(Me):"",onChange:C=>{C.target.value?se(new Date(C.target.value)):se(void 0),Te&&Ee(!1)},disabled:!xe||Te,className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:'配合"Tokens超量自动重置间隔"使用,设置下一次重置的精确时间点。例如,每月1日0点重置(间隔720小时),或每周一0点重置(间隔168小时)。设置后,系统会基于此时间点自动计算后续重置周期'})]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:Q?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:Wr,onChange:C=>kn(C.target.checked),disabled:Q,style:{marginRight:"8px",cursor:Q?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"}),Q&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),Q&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>ue(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),Wr&&!Q&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量"}),o.jsx("input",{type:"number",value:Ve||"",onChange:C=>{const ee=C.target.value?parseInt(C.target.value):void 0;if(ee!==void 0&&ze!==void 0&&ee>ze){U.warning(`请求次数超量值不能超过API服务的限制 (${ze})`);return}rt(ee),Q&&ee!==ze&&ue(!1)},min:"0",max:ze,placeholder:ze?`最大 ${ze}`:"不限制",disabled:Q}),ze&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",ze,",当前值不能超过此限制"]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"当请求次数达到这个量时,在配置了其他规则的情况下,本条规则将失效"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:ke||"",onChange:C=>{De(C.target.value?parseInt(C.target.value):void 0),Q&&ue(!1)},min:"1",placeholder:"不自动重置",disabled:Q}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置后,系统将每隔指定小时数自动重置请求次数计数。例如设置24小时,则每24小时重置一次"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:Fe?Uw(Fe):"",onChange:C=>{C.target.value?Ze(new Date(C.target.value)):Ze(void 0),Q&&ue(!1)},disabled:!ke||Q,className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:'配合"请求次数自动重置间隔"使用,设置下一次重置的精确时间点。例如,每月1日0点重置(间隔720小时),或每周一0点重置(间隔168小时)。设置后,系统会基于此时间点自动计算后续重置周期'})]})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:!!Z,onChange:C=>{C.target.checked?(Y(10),M(0)):(Y(void 0),M(void 0))},style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求频率限制"})]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"启用后,当同一内容类型的请求频率超过限制时,系统会自动切换到其他同类型规则"})]}),Z&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制次数(并发数)"}),o.jsx("input",{type:"number",value:Z||"",onChange:C=>Y(C.target.value?parseInt(C.target.value):void 0),min:"1",placeholder:"例如: 10"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"在指定时间窗口内允许的最大请求次数"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制时间窗口(秒,0=同一时刻)"}),o.jsx("input",{type:"number",value:ce===0?0:ce||"",onChange:C=>{const ee=C.target.value?parseInt(C.target.value):void 0;M(ee===0?0:ee)},min:"0",placeholder:"0 表示同一时刻"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"时间窗口大小。0 表示同一时刻(并发数),持续累积;设置为 60 则在 60 秒内最多允许 N 次请求"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"超时时间(秒)"}),o.jsx("input",{type:"number",value:Le||"",onChange:C=>$e(C.target.value?parseInt(C.target.value):void 0),min:"1",placeholder:v!=null&&v.ruleGlobalTimeout?`全局${v.ruleGlobalTimeout}秒`:"默认300秒"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["设置此规则的API请求超时时间。不设置则使用全局超时配置(当前为",v!=null&&v.ruleGlobalTimeout?`${v.ruleGlobalTimeout}秒`:"默认300秒","),超时后自动触发故障切换"]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"排序(值越大优先级越高)"}),o.jsx("input",{type:"number",value:ve,onChange:C=>X(parseInt(C.target.value)||0),min:"0",max:"1000"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>_(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),o.jsx(oA,{show:Cn,onClose:()=>Bt(!1),onComplete:()=>{as(),dm(),pm(),Vu(),h1()}}),o.jsx(iB,{show:St,onClose:()=>ci(!1),onComplete:()=>{dm(),pm()}}),io&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:g1,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout",style:{width:"500px",maxWidth:"90vw"},children:[o.jsx("div",{className:"modal-header",children:o.jsxs("h2",{children:["绑定会话 - ",((P1=r.find(C=>C.id===io))==null?void 0:P1.name)||io]})}),o.jsxs("div",{className:"modal-body-scrollable",style:{maxHeight:"460px"},children:[YM?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"加载中..."}):Qe.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:o.jsx("p",{children:"暂无绑定会话"})}):o.jsxs("div",{style:{marginBottom:"12px",fontSize:"13px",color:"var(--text-tertiary)"},children:["以下 ",Qe.length," 个会话绑定了此路由:"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[Qe.slice(0,50).map((C,ee)=>{var me;return o.jsxs("div",{style:{padding:"12px 0",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",borderBottom:ee===Math.min(Qe.length,50)-1?"none":"1px solid var(--border-color)"},children:[o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("div",{style:{fontWeight:500,fontSize:"14px",marginBottom:"4px"},children:((me=C.title)==null?void 0:me.replace(/<\/?session>/g,"").trim())||C.id.slice(0,8)}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{className:`badge ${C.targetType==="claude-code"?"badge-claude-code":"badge-codex"}`,style:{fontSize:"11px"},children:C.targetType==="claude-code"?"Claude Code":"Codex"}),o.jsxs("span",{children:[C.requestCount," 次请求"]}),o.jsxs("span",{children:[C.totalTokens.toLocaleString()," tokens"]})]})]}),o.jsx("button",{type:"button",className:"btn btn-danger",style:{flexShrink:0,padding:"4px 12px",fontSize:"12px"},disabled:p1===C.id,onClick:Oe=>{Oe.stopPropagation(),JM(C.id)},children:p1===C.id?"解绑中...":"解绑"})]},C.id)}),Qe.length>50&&o.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:"var(--text-tertiary)",padding:"8px"},children:["等共 ",Qe.length," 个会话"]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:g1,children:"关闭"})]})]})]})]})}var cA={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ys,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",s="second",l="minute",c="hour",u="day",p="week",d="month",h="quarter",m="year",g="date",y="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(K){var O=["th","st","nd","rd"],B=K%100;return"["+K+(O[(B-20)%10]||O[B]||O[0])+"]"}},j=function(K,O,B){var W=String(K);return!W||W.length>=O?K:""+Array(O+1-W.length).join(B)+K},w={s:j,z:function(K){var O=-K.utcOffset(),B=Math.abs(O),W=Math.floor(B/60),R=B%60;return(O<=0?"+":"-")+j(W,2,"0")+":"+j(R,2,"0")},m:function K(O,B){if(O.date()<B.date())return-K(B,O);var W=12*(B.year()-O.year())+(B.month()-O.month()),R=O.clone().add(W,d),$=B-R<0,P=O.clone().add(W+($?-1:1),d);return+(-(W+(B-R)/($?R-P:P-R))||0)},a:function(K){return K<0?Math.ceil(K)||0:Math.floor(K)},p:function(K){return{M:d,y:m,w:p,d:u,D:g,h:c,m:l,s,ms:a,Q:h}[K]||String(K||"").toLowerCase().replace(/s$/,"")},u:function(K){return K===void 0}},k="en",S={};S[k]=b;var E="$isDayjsObject",A=function(K){return K instanceof _||!(!K||!K[E])},D=function K(O,B,W){var R;if(!O)return k;if(typeof O=="string"){var $=O.toLowerCase();S[$]&&(R=$),B&&(S[$]=B,R=$);var P=O.split("-");if(!R&&P.length>1)return K(P[0])}else{var F=O.name;S[F]=O,R=F}return!W&&R&&(k=R),R||!W&&k},T=function(K,O){if(A(K))return K.clone();var B=typeof O=="object"?O:{};return B.date=K,B.args=arguments,new _(B)},I=w;I.l=D,I.i=A,I.w=function(K,O){return T(K,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var _=function(){function K(B){this.$L=D(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[E]=!0}var O=K.prototype;return O.parse=function(B){this.$d=function(W){var R=W.date,$=W.utc;if(R===null)return new Date(NaN);if(I.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var P=R.match(x);if(P){var F=P[2]-1||0,re=(P[7]||"0").substring(0,3);return $?new Date(Date.UTC(P[1],F,P[3]||1,P[4]||0,P[5]||0,P[6]||0,re)):new Date(P[1],F,P[3]||1,P[4]||0,P[5]||0,P[6]||0,re)}}return new Date(R)}(B),this.init()},O.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},O.$utils=function(){return I},O.isValid=function(){return this.$d.toString()!==y},O.isSame=function(B,W){var R=T(B);return this.startOf(W)<=R&&R<=this.endOf(W)},O.isAfter=function(B,W){return T(B)<this.startOf(W)},O.isBefore=function(B,W){return this.endOf(W)<T(B)},O.$g=function(B,W,R){return I.u(B)?this[W]:this.set(R,B)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(B,W){var R=this,$=!!I.u(W)||W,P=I.p(B),F=function(ie,J){var xe=I.w(R.$u?Date.UTC(R.$y,J,ie):new Date(R.$y,J,ie),R);return $?xe:xe.endOf(u)},re=function(ie,J){return I.w(R.toDate()[ie].apply(R.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(J)),R)},N=this.$W,pe=this.$M,ve=this.$D,X="set"+(this.$u?"UTC":"");switch(P){case m:return $?F(1,0):F(31,11);case d:return $?F(1,pe):F(0,pe+1);case p:var oe=this.$locale().weekStart||0,de=(N<oe?N+7:N)-oe;return F($?ve-de:ve+(6-de),pe);case u:case g:return re(X+"Hours",0);case c:return re(X+"Minutes",1);case l:return re(X+"Seconds",2);case s:return re(X+"Milliseconds",3);default:return this.clone()}},O.endOf=function(B){return this.startOf(B,!1)},O.$set=function(B,W){var R,$=I.p(B),P="set"+(this.$u?"UTC":""),F=(R={},R[u]=P+"Date",R[g]=P+"Date",R[d]=P+"Month",R[m]=P+"FullYear",R[c]=P+"Hours",R[l]=P+"Minutes",R[s]=P+"Seconds",R[a]=P+"Milliseconds",R)[$],re=$===u?this.$D+(W-this.$W):W;if($===d||$===m){var N=this.clone().set(g,1);N.$d[F](re),N.init(),this.$d=N.set(g,Math.min(this.$D,N.daysInMonth())).$d}else F&&this.$d[F](re);return this.init(),this},O.set=function(B,W){return this.clone().$set(B,W)},O.get=function(B){return this[I.p(B)]()},O.add=function(B,W){var R,$=this;B=Number(B);var P=I.p(W),F=function(pe){var ve=T($);return I.w(ve.date(ve.date()+Math.round(pe*B)),$)};if(P===d)return this.set(d,this.$M+B);if(P===m)return this.set(m,this.$y+B);if(P===u)return F(1);if(P===p)return F(7);var re=(R={},R[l]=r,R[c]=i,R[s]=n,R)[P]||1,N=this.$d.getTime()+B*re;return I.w(N,this)},O.subtract=function(B,W){return this.add(-1*B,W)},O.format=function(B){var W=this,R=this.$locale();if(!this.isValid())return R.invalidDate||y;var $=B||"YYYY-MM-DDTHH:mm:ssZ",P=I.z(this),F=this.$H,re=this.$m,N=this.$M,pe=R.weekdays,ve=R.months,X=R.meridiem,oe=function(J,xe,ae,Me){return J&&(J[xe]||J(W,$))||ae[xe].slice(0,Me)},de=function(J){return I.s(F%12||12,J,"0")},ie=X||function(J,xe,ae){var Me=J<12?"AM":"PM";return ae?Me.toLowerCase():Me};return $.replace(v,function(J,xe){return xe||function(ae){switch(ae){case"YY":return String(W.$y).slice(-2);case"YYYY":return I.s(W.$y,4,"0");case"M":return N+1;case"MM":return I.s(N+1,2,"0");case"MMM":return oe(R.monthsShort,N,ve,3);case"MMMM":return oe(ve,N);case"D":return W.$D;case"DD":return I.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return oe(R.weekdaysMin,W.$W,pe,2);case"ddd":return oe(R.weekdaysShort,W.$W,pe,3);case"dddd":return pe[W.$W];case"H":return String(F);case"HH":return I.s(F,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return ie(F,re,!0);case"A":return ie(F,re,!1);case"m":return String(re);case"mm":return I.s(re,2,"0");case"s":return String(W.$s);case"ss":return I.s(W.$s,2,"0");case"SSS":return I.s(W.$ms,3,"0");case"Z":return P}return null}(J)||P.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(B,W,R){var $,P=this,F=I.p(W),re=T(B),N=(re.utcOffset()-this.utcOffset())*r,pe=this-re,ve=function(){return I.m(P,re)};switch(F){case m:$=ve()/12;break;case d:$=ve();break;case h:$=ve()/3;break;case p:$=(pe-N)/6048e5;break;case u:$=(pe-N)/864e5;break;case c:$=pe/i;break;case l:$=pe/r;break;case s:$=pe/n;break;default:$=pe}return R?$:I.a($)},O.daysInMonth=function(){return this.endOf(d).$D},O.$locale=function(){return S[this.$L]},O.locale=function(B,W){if(!B)return this.$L;var R=this.clone(),$=D(B,W,!0);return $&&(R.$L=$),R},O.clone=function(){return I.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},K}(),G=_.prototype;return T.prototype=G,[["$ms",a],["$s",s],["$m",l],["$H",c],["$W",u],["$M",d],["$y",m],["$D",g]].forEach(function(K){G[K[1]]=function(O){return this.$g(O,K[0],K[1])}}),T.extend=function(K,O){return K.$i||(K(O,_,T),K.$i=!0),T},T.locale=D,T.isDayjs=A,T.unix=function(K){return T(1e3*K)},T.en=S[k],T.Ls=S,T.p={},T})})(cA);var bB=cA.exports;const xt=hl(bB);var uA={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ys,function(){return function(n,r,i){n=n||{};var a=r.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(u,p,d,h){return a.fromToBase(u,p,d,h)}i.en.relativeTime=s,a.fromToBase=function(u,p,d,h,m){for(var g,y,x,v=d.$locale().relativeTime||s,b=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],j=b.length,w=0;w<j;w+=1){var k=b[w];k.d&&(g=h?i(u).diff(d,k.d,!0):d.diff(u,k.d,!0));var S=(n.rounding||Math.round)(Math.abs(g));if(x=g>0,S<=k.r||!k.r){S<=1&&w>0&&(k=b[w-1]);var E=v[k.l];m&&(S=m(""+S)),y=typeof E=="string"?E.replace("%d",S):E(S,p,k.l,x);break}}if(p)return y;var A=x?v.future:v.past;return typeof A=="function"?A(y):A.replace("%s",y)},a.to=function(u,p){return l(u,p,this,!0)},a.from=function(u,p){return l(u,p,this)};var c=function(u){return u.$u?i.utc():i()};a.toNow=function(u){return this.to(c(this),u)},a.fromNow=function(u){return this.from(c(this),u)}}})})(uA);var jB=uA.exports;const n0=hl(jB),qc=({currentPage:e,totalItems:t,pageSize:n,onPageChange:r,onPageSizeChange:i,pageSizeOptions:a=[10,20,50,100]})=>{const s=Math.max(1,Math.ceil(t/n)),l=e===1,c=e>=s,u=()=>{l||r(1)},p=()=>{l||r(e-1)},d=()=>{c||r(e+1)},h=()=>{c||r(s)},m=g=>{const y=parseInt(g.target.value,10);i(y)};return o.jsxs("div",{className:"pagination",children:[o.jsxs("div",{className:"pagination-info",children:["共 ",t," 条"]}),o.jsxs("div",{className:"pagination-controls",children:[o.jsx("button",{className:"pagination-btn",onClick:u,disabled:l,children:"首页"}),o.jsx("button",{className:"pagination-btn",onClick:p,disabled:l,children:"上一页"}),o.jsxs("span",{className:"pagination-info",children:["第 ",e," / ",s," 页"]}),o.jsx("button",{className:"pagination-btn",onClick:d,disabled:c,children:"下一页"}),o.jsx("button",{className:"pagination-btn",onClick:h,disabled:c,children:"尾页"})]}),o.jsx("div",{className:"pagination-size",children:o.jsxs("label",{children:["每页显示",o.jsx("select",{className:"pagination-select",value:n,onChange:m,children:a.map(g=>o.jsx("option",{value:g,children:g},g))}),"条"]})})]})},wB=["authorization","x-api-key","api-key","apikey","x-auth-token","auth-token","secret","password","api_secret","jwt","csrf_token","xsrf_token","auth_token","session_token","private_key","client_secret"],SB=e=>{const t=e.toLowerCase();return!!(wB.some(n=>t===n)||t.startsWith("api_")&&(t.endsWith("_key")||t.endsWith("_secret"))||(t.endsWith("_token")||t.endsWith("_key")||t.endsWith("_secret"))&&!["max_tokens","input_tokens","output_tokens","completion_tokens","prompt_tokens","cachereadinputtokens","totaltokens"].some(r=>t.replace(/_/g,"").includes(r.replace(/_/g,""))))},kB=e=>!e||e.length<=8?"***":`${e.slice(0,4)}${"*".repeat(Math.min(e.length-8,20))}${e.slice(-4)}`,$v=e=>{if(e==null)return e;if(Array.isArray(e))return e.map(t=>$v(t));if(typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))SB(n)?t[n]=typeof r=="string"?kB(r):"***":typeof r=="object"?t[n]=$v(r):t[n]=r;return t}return e},Or=({data:e,title:t,collapsed:n=!1})=>{const[r,i]=f.useState(!n),[a,s]=f.useState(!1),l=p=>{try{let d;typeof p=="string"?d=JSON.parse(p):d=p;const h=$v(d);return JSON.stringify(h,null,2)}catch{return typeof p=="string"?p:String(p)}},c=()=>{const p=l(e);navigator.clipboard.writeText(p).then(()=>{s(!0),setTimeout(()=>s(!1),2e3)}).catch(d=>{console.error("Failed to copy JSON:",d)})},u=l(e);return o.jsxs("div",{className:"json-viewer",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[t&&o.jsx("h4",{style:{margin:0,fontSize:"14px",color:"var(--text-primary)"},children:t}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[o.jsx("button",{onClick:()=>i(!r),className:"btn btn-sm btn-secondary",style:{fontSize:"12px",padding:"2px 8px"},children:r?"折叠":"展开"}),o.jsx("button",{onClick:c,className:"btn btn-sm btn-primary",style:{fontSize:"12px",padding:"2px 8px"},children:a?"已复制":"复制"})]})]}),r&&o.jsx("pre",{style:{background:"var(--bg-code)",border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"12px",overflowX:"auto",fontSize:"12px",lineHeight:"1.4",color:"var(--text-primary)",maxHeight:"400px",overflowY:"auto",margin:0},children:o.jsx("code",{children:u})})]})};function xu(e){const t=e.split(`
|
|
117
|
-
`).map(r=>r.trim()).join(`
|
|
118
|
-
`).split(`
|
|
119
|
-
|
|
120
|
-
`).filter(r=>r.trim()),n=[];for(const r of t){let i="",a=[],s=0;r.split(`
|
|
121
|
-
`).forEach(p=>{if(/^[a-z]+:/.test(p)){const d=p.indexOf(":"),h=p.slice(0,d).trim(),m=p.slice(d+1).trim();h==="event"?i=m:h==="data"?(a.push(m),s=1):a.length&&(s=-1)}else s===1&&a.push(p)});const c=a.length>0?a.join(`
|
|
122
|
-
`).trim():void 0;let u;if(c)try{u=JSON.parse(c)}catch{u=c}n.push({event:i,data:u,raw:r})}return n}function bu(e,t){var l,c;let n="",r="",i=!1,a=!1,s=!1;for(const u of e){const p=u.data;if(p){if(u.event==="content_block_start"&&p.content_block){const d=p.content_block.type;d==="thinking"?i=!0:d==="text"&&(a=!0);continue}if(u.event==="content_block_stop"){i=!1,a=!1;continue}if(u.event==="content_block_delta"&&p.delta){p.delta.type==="text_delta"&&a?n+=p.delta.text||"":p.delta.type==="thinking_delta"&&i&&(r+=p.delta.thinking||"");continue}if(u.event==="response.reasoning_text.delta"&&p.delta!==void 0){r+=p.delta||"",s=!0;continue}if(u.event==="response.content_part.done"&&p.part){const d=p.part;d.type==="reasoning_text"&&d.text?s||(r=d.text):d.type==="output_text"&&d.text&&(n+=d.text);continue}if(!u.event&&p.choices){const d=(c=(l=p.choices)==null?void 0:l[0])==null?void 0:c.delta;d&&(typeof d.content=="string"&&(n+=d.content),d.thinking&&typeof d.thinking.content=="string"&&(r+=d.thinking.content));continue}(p.reasoning_content||p.thinking)&&(r+=p.reasoning_content||p.thinking||"")}}return{text:n,thinking:r}}function CB(e,t){if(!e||e.length===0)return{text:"",thinking:""};const n=xu(e);return bu(n)}function dA(e){var t,n;if(console.log("[assembleResponseBody] log:",{id:e.id,hasResponseBody:!!e.responseBody,responseBodyLength:(t=e.responseBody)==null?void 0:t.length,hasStreamChunks:!!e.streamChunks,streamChunksLength:(n=e.streamChunks)==null?void 0:n.length,targetType:e.targetType}),e.responseBody)try{const r=JSON.parse(e.responseBody);return console.log("[assembleResponseBody] returning parsed responseBody"),r}catch{return console.log("[assembleResponseBody] returning raw responseBody (parse failed)"),e.responseBody}if(e.streamChunks&&e.streamChunks.length>0){console.log("[assembleResponseBody] processing streamChunks:",e.streamChunks.length);const{text:r,thinking:i}=CB(e.downstreamResponseBody,e.targetType);if(console.log("[assembleResponseBody] assembled text:",{textLength:r.length,thinkingLength:i.length}),e.targetType==="claude-code"){const s=[];i&&s.push({type:"thinking",thinking:i}),r&&s.push({type:"text",text:r}),s.length===0&&s.push({type:"text",text:"(空内容 - 可能响应未完成或解析失败)"});const l={type:"message",role:"assistant",content:s,model:e.targetModel||e.requestModel,usage:e.usage};return console.log("[assembleResponseBody] returning claude-code format with",s.length,"content blocks"),l}else if(e.targetType==="codex"){const s={id:e.id,object:"chat.completion",created:Math.floor(e.timestamp/1e3),model:e.targetModel||e.requestModel,choices:[{index:0,message:{role:"assistant",content:r||i||"(空内容 - 可能响应未完成或解析失败)"},finish_reason:"stop"}],usage:e.usage};return console.log("[assembleResponseBody] returning codex format"),s}const a={content:r||i||"(空内容 - 可能响应未完成或解析失败)",usage:e.usage};return console.log("[assembleResponseBody] returning generic format"),a}return console.log("[assembleResponseBody] no responseBody or streamChunks, returning null"),null}function PB(e){const t=[];t.push(`# 请求日志详情
|
|
123
|
-
`),t.push("## 基本信息"),t.push(`- **日志ID**: ${e.id}`),t.push(`- **时间**: ${xt(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${rl[e.targetType]||"-"}`),e.tags&&e.tags.length>0&&t.push(`- **标签**: ${e.tags.join(", ")}`),t.push(""),t.push("## 模型信息"),e.requestModel&&t.push(`- **请求模型**: ${e.requestModel}`),e.vendorName&&t.push(`- **供应商**: ${e.vendorName}`),e.targetServiceName&&t.push(`- **供应商API服务**: ${e.targetServiceName}`),e.targetModel&&t.push(`- **供应商模型**: ${e.targetModel}`),t.push(""),t.push("## 请求信息"),t.push(`- **请求方法**: ${e.method}`),t.push(`- **请求路径**: ${e.path}`),t.push(""),e.headers&&(t.push("## 请求头"),t.push("```json"),t.push(JSON.stringify(e.headers,null,2)),t.push("```\n")),e.body&&(t.push("## 请求体"),t.push("```json"),t.push(JSON.stringify(e.body,null,2)),t.push("```\n")),e.upstreamRequest&&(t.push("## 实际转发的请求信息"),t.push("```json"),t.push(JSON.stringify(e.upstreamRequest,null,2)),t.push("```\n")),t.push("## 响应信息"),t.push(`- **状态码**: ${e.statusCode||"Error"}`),t.push(`- **响应时间**: ${e.responseTime?`${e.responseTime}ms`:"-"}`),t.push(""),e.responseHeaders&&(t.push("## 响应头"),t.push("```json"),t.push(JSON.stringify(e.responseHeaders,null,2)),t.push("```\n"));const n=dA(e);if(n&&(t.push("## 响应体"),t.push("```json"),t.push(JSON.stringify(n,null,2)),t.push("```\n")),e.usage&&(t.push("## Token 使用"),t.push(`- **输入**: ${e.usage.inputTokens}`),t.push(`- **输出**: ${e.usage.outputTokens}`),e.usage.totalTokens!==void 0&&t.push(`- **总计**: ${e.usage.totalTokens}`),e.usage.cacheReadInputTokens!==void 0&&t.push(`- **缓存读取**: ${e.usage.cacheReadInputTokens}`),t.push("")),e.error&&(t.push("## 错误信息"),t.push("```"),t.push(e.error),t.push("```\n")),e.downstreamResponseBody&&(t.push("## 实际转发的响应体"),t.push("```json"),t.push(typeof e.downstreamResponseBody=="string"?e.downstreamResponseBody:JSON.stringify(e.downstreamResponseBody,null,2)),t.push("```\n"),typeof e.downstreamResponseBody=="string"&&(e.downstreamResponseBody.includes("event:")||e.downstreamResponseBody.includes("data:")))){const r=xu(e.downstreamResponseBody),{text:i,thinking:a}=bu(r);a&&(t.push(`## 思考内容 (${a.length} 字符)`),t.push("```"),t.push(a),t.push("```\n")),i&&(t.push(`## 回复内容 (${i.length} 字符)`),t.push("```"),t.push(i),t.push("```\n"))}return t.join(`
|
|
124
|
-
`)}function EB(e){const t=[];return t.push(`# 错误日志详情
|
|
125
|
-
`),t.push("## 基本信息"),t.push(`- **ID**: ${e.id}`),t.push(`- **时间**: ${xt(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${rl[e.targetType]||"-"}`),e.tags&&e.tags.length>0&&t.push(`- **标签**: ${e.tags.join(", ")}`),t.push(""),t.push("## 模型信息"),e.requestModel&&t.push(`- **请求模型**: ${e.requestModel}`),e.vendorName&&t.push(`- **供应商**: ${e.vendorName}`),e.targetServiceName&&t.push(`- **供应商API服务**: ${e.targetServiceName}`),e.targetModel&&t.push(`- **供应商模型**: ${e.targetModel}`),t.push(""),t.push("## 请求信息"),t.push(`- **请求方法**: ${e.method}`),t.push(`- **请求路径**: ${e.path}`),t.push(""),e.requestHeaders&&(t.push("## 请求头"),t.push("```json"),t.push(JSON.stringify(e.requestHeaders,null,2)),t.push("```\n")),e.requestBody&&(t.push("## 请求体"),t.push("```json"),t.push(JSON.stringify(e.requestBody,null,2)),t.push("```\n")),e.upstreamRequest&&(t.push("## 实际转发的请求信息"),t.push("```json"),t.push(JSON.stringify(e.upstreamRequest,null,2)),t.push("```\n")),t.push("## 错误信息"),t.push("```"),t.push(e.errorMessage),t.push("```\n"),e.errorStack&&(t.push("## 错误堆栈"),t.push("```"),t.push(e.errorStack),t.push("```\n")),t.push("## 响应信息"),t.push(`- **状态码**: ${e.statusCode||"-"}`),t.push(`- **响应时间**: ${e.responseTime?`${e.responseTime}ms`:"-"}`),t.push(""),e.responseHeaders&&(t.push("## 响应头"),t.push("```json"),t.push(JSON.stringify(e.responseHeaders,null,2)),t.push("```\n")),e.responseBody&&(t.push("## 响应体"),t.push("```json"),t.push(JSON.stringify(e.responseBody,null,2)),t.push("```\n")),t.join(`
|
|
126
|
-
`)}const TB=1e6;function AB(e){return"errorMessage"in e}function OB({events:e}){const{text:t,thinking:n}=bu(e);return console.log("AssembledTextViewFromDownstream",{text:t,thinking:n}),!t&&!n?o.jsx("div",{style:{color:"#7f8c8d",fontStyle:"italic"},children:"无法解析出文本内容"}):o.jsxs("div",{className:"assembled-text-view",children:[n&&o.jsxs("details",{style:{marginBottom:"15px",border:"1px solid var(--border-thinking-box)",borderRadius:"8px",padding:"10px",backgroundColor:"var(--bg-thinking-box)"},open:!0,children:[o.jsxs("summary",{style:{cursor:"pointer",fontWeight:"bold",color:"var(--text-thinking-title)",userSelect:"none"},children:["思考内容 (",n.length," 字符)"]}),o.jsx("pre",{style:{marginTop:"10px",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"monospace",fontSize:"13px",color:"var(--text-thinking-content)",backgroundColor:"var(--bg-thinking-content)",padding:"10px",borderRadius:"4px",border:"1px solid var(--border-thinking-content)"},children:n})]}),t&&o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:"bold",marginBottom:"8px",color:"var(--text-reply-title)"},children:["回复内容 (",t.length," 字符)"]}),o.jsx("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"monospace",fontSize:"13px",color:"var(--text-reply-content)",backgroundColor:"var(--bg-reply-content)",padding:"10px",borderRadius:"4px",border:"1px solid var(--border-reply-content)"},children:t})]})]})}function IB({log:e}){const[t,n]=f.useState(!1),[r,i]=f.useState(!0);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"日志ID"}),o.jsx("input",{type:"text",value:e.id,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"时间"}),o.jsx("input",{type:"text",value:xt(e.timestamp).format("YYYY-MM-DD HH:mm:ss"),readOnly:!0})]}),e.targetType&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"客户端类型"}),o.jsx("input",{type:"text",value:rl[e.targetType]||"-",readOnly:!0})]}),e.tags&&e.tags.length>0&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"标签"}),o.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginTop:"8px"},children:e.tags.map((a,s)=>o.jsx("span",{style:{padding:"4px 12px",backgroundColor:"#3498db",color:"white",borderRadius:"12px",fontSize:"13px",fontWeight:"500"},children:a},s))})]}),e.requestModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求模型"}),o.jsx("input",{type:"text",value:e.requestModel,readOnly:!0})]}),e.vendorName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx("input",{type:"text",value:e.vendorName,readOnly:!0})]}),e.targetServiceName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsx("input",{type:"text",value:e.targetServiceName,readOnly:!0})]}),e.targetModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsx("input",{type:"text",value:e.targetModel,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求方法"}),o.jsx("input",{type:"text",value:e.method,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求路径"}),o.jsx("input",{type:"text",value:e.path,readOnly:!0})]}),e.headers&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求头"}),o.jsx(Or,{data:e.headers,collapsed:!0})]}),e.body&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(Or,{data:e.body,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(Or,{data:e.upstreamRequest})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"状态码"}),o.jsx("input",{type:"text",value:e.statusCode||"Error",readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应时间"}),o.jsx("input",{type:"text",value:e.responseTime?`${e.responseTime}ms`:"-",readOnly:!0})]}),e.responseHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应头"}),o.jsx(Or,{data:e.responseHeaders,collapsed:!0})]}),(()=>{const a=dA(e);return a?o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(Or,{data:a})]}):o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsxs("div",{style:{padding:"10px",color:"#7f8c8d",fontStyle:"italic"},children:["无响应体数据",e.streamChunks===void 0&&e.responseBody===void 0&&o.jsx("div",{style:{marginTop:"5px",fontSize:"12px",color:"#e74c3c"},children:"⚠️ 该日志不包含响应数据(可能是旧版本记录)"})]})]})})(),e.usage&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token 使用"}),o.jsx("textarea",{rows:4,value:`输入: ${e.usage.inputTokens}
|
|
127
|
-
输出: ${e.usage.outputTokens}
|
|
128
|
-
`+(e.usage.totalTokens!==void 0?`总计: ${e.usage.totalTokens}
|
|
129
|
-
`:"")+(e.usage.cacheReadInputTokens!==void 0?`缓存读取: ${e.usage.cacheReadInputTokens}`:""),readOnly:!0})]}),e.error&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"错误信息"}),o.jsx("textarea",{rows:4,value:e.error,readOnly:!0,style:{color:"red"}})]}),e.downstreamResponseBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的响应体"}),o.jsx(Or,{data:e.downstreamResponseBody,collapsed:!0})]}),(()=>{const a=e.downstreamResponseBody;if(!a||!(typeof a=="string"&&(a.includes("event:")||a.includes("data:"))))return null;const l=xu(a);return o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["Stream Events (",l.length,"个)",o.jsx("button",{onClick:()=>n(!t),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},className:"btn btn-sm btn-secondary",children:t?"折叠":"展开"}),o.jsx("button",{onClick:()=>i(!r),style:{marginLeft:"5px",padding:"2px 8px",fontSize:"12px"},className:"btn btn-sm btn-primary",children:r?"隐藏拼装结果":"查看拼装结果"})]}),t&&o.jsx("div",{style:{maxHeight:"400px",overflowY:"auto",border:"1px solid #ddd",padding:"10px",borderRadius:"4px"},children:l.map((c,u)=>o.jsxs("div",{style:{marginBottom:"10px"},children:[o.jsxs("div",{style:{fontWeight:"bold",fontSize:"12px",color:"#7f8c8d",marginBottom:"4px"},children:["Event #",u+1," ",c.event&&`[${c.event}]`]}),o.jsx(Or,{data:c.data||c.raw,collapsed:!0})]},u))}),r&&o.jsx("div",{style:{marginTop:"10px",maxHeight:"400px",overflowY:"auto",border:"1px solid var(--border-secondary)",padding:"10px",borderRadius:"4px",backgroundColor:"var(--bg-assembled-text)"},children:o.jsx(OB,{events:l})})]})})()]})}function NB({log:e}){return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"ID"}),o.jsx("input",{type:"text",value:e.id,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"时间"}),o.jsx("input",{type:"text",value:xt(e.timestamp).format("YYYY-MM-DD HH:mm:ss"),readOnly:!0})]}),e.targetType&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"客户端类型"}),o.jsx("input",{type:"text",value:rl[e.targetType]||"-",readOnly:!0})]}),e.tags&&e.tags.length>0&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"标签"}),o.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginTop:"8px"},children:e.tags.map((t,n)=>o.jsx("span",{style:{padding:"4px 12px",backgroundColor:"#3498db",color:"white",borderRadius:"12px",fontSize:"13px",fontWeight:"500"},children:t},n))})]}),e.requestModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求模型"}),o.jsx("input",{type:"text",value:e.requestModel,readOnly:!0})]}),e.vendorName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx("input",{type:"text",value:e.vendorName,readOnly:!0})]}),e.targetServiceName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsx("input",{type:"text",value:e.targetServiceName,readOnly:!0})]}),e.targetModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsx("input",{type:"text",value:e.targetModel,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求方法"}),o.jsx("input",{type:"text",value:e.method,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求路径"}),o.jsx("input",{type:"text",value:e.path,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"状态码"}),o.jsx("input",{type:"text",value:e.statusCode||"-",readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应时间"}),o.jsx("input",{type:"text",value:e.responseTime?`${e.responseTime}ms`:"-",readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"错误信息"}),o.jsx("textarea",{rows:4,value:e.errorMessage,readOnly:!0,style:{color:"#e74c3c"}})]}),e.errorStack&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"错误堆栈"}),o.jsx("textarea",{rows:8,value:e.errorStack,readOnly:!0,style:{fontSize:"12px",color:"#7f8c8d"}})]}),e.requestHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求头"}),o.jsx(Or,{data:e.requestHeaders,collapsed:!0})]}),e.requestBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(Or,{data:e.requestBody,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(Or,{data:e.upstreamRequest})]}),e.responseHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应头"}),o.jsx(Or,{data:e.responseHeaders,collapsed:!0})]}),e.responseBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(Or,{data:e.responseBody})]})]})}function Mp({log:e,onClose:t,zIndex:n}){const r=n??TB,i=AB(e),a=()=>{const s=i?EB(e):PB(e);navigator.clipboard.writeText(s).then(()=>{U.success("复制成功")}).catch(()=>{U.error("复制失败")})};return o.jsxs("div",{className:"modal-overlay",style:{zIndex:r},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",style:{zIndex:r+1},children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout",style:{width:"800px",zIndex:r},children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:i?"错误日志详情":"请求详情"})}),o.jsx("div",{className:"modal-body-scrollable",children:i?o.jsx(NB,{log:e}):o.jsx(IB,{log:e})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:a,children:"复制"}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"关闭"})]})]})]})}const _B=!1;xt.extend(n0);function MB(){const{confirm:e}=yu(),[t,n]=f.useState("request"),[r,i]=f.useState([]),[a,s]=f.useState([]),[l,c]=f.useState(null),[u,p]=f.useState(null),[d,h]=f.useState(1),[m,g]=f.useState(20),[y,x]=f.useState(0),[v,b]=f.useState(1),[j,w]=f.useState(20),[k,S]=f.useState(0),[E,A]=f.useState(0),[D,T]=f.useState(0),[I,_]=f.useState(!1),[G,K]=f.useState(!1),[O,B]=f.useState(10),[W,R]=f.useState([]),[$,P]=f.useState([]),[F,re]=f.useState([]),[N,pe]=f.useState(""),[ve,X]=f.useState(""),[oe,de]=f.useState(""),[ie,J]=f.useState(""),[xe,ae]=f.useState(""),[Me,se]=f.useState(""),[Le,$e]=f.useState(""),[Ye,lt]=f.useState(""),[Ve,rt]=f.useState(""),ke=f.useRef({activeTab:t,requestLogsPage:d,requestLogsPageSize:m,errorLogsPage:v,errorLogsPageSize:j,appliedSearchQuery:Le,appliedErrorSearchQuery:Ve,filterTargetType:N,filterVendorId:ve,filterServiceId:oe,filterModel:ie,filterRouteId:xe});ke.current={activeTab:t,requestLogsPage:d,requestLogsPageSize:m,errorLogsPage:v,errorLogsPageSize:j,appliedSearchQuery:Le,appliedErrorSearchQuery:Ve,filterTargetType:N,filterVendorId:ve,filterServiceId:oe,filterModel:ie,filterRouteId:xe},f.useEffect(()=>{Ze()},[t,d,m,v,j,Le,Ve,N,ve,oe,ie,xe]),f.useEffect(()=>{De(),Fe()},[]),f.useEffect(()=>{let le=null,Ot=null;return G&&(Ot=setInterval(()=>{B(gn=>gn<=1?10:gn-1)},1e3),le=setInterval(()=>{Ze(),Fe()},1e4)),()=>{le&&clearInterval(le),Ot&&clearInterval(Ot)}},[G,t,d,m,v,j]);const De=async()=>{try{const[le,Ot,gn]=await Promise.all([V.getVendors(),V.getAPIServices(),V.getRoutes()]);R(le),P(Ot),re(gn)}catch(le){console.error("Failed to load filter options:",le)}},Fe=async()=>{try{const[le,Ot]=await Promise.all([V.getLogsCount(),V.getErrorLogsCount()]);A(le.count),T(Ot.count)}catch(le){console.error("Failed to load badge counts:",le)}},Ze=async()=>{const le=ke.current,Ot={targetType:le.filterTargetType||void 0,vendorId:le.filterVendorId||void 0,serviceId:le.filterServiceId||void 0,model:le.filterModel||void 0,routeId:le.filterRouteId||void 0};_(!0);try{if(le.activeTab==="request"){const gn=(le.requestLogsPage-1)*le.requestLogsPageSize,dr=await V.queryLogs({filters:Ot,keyword:le.appliedSearchQuery.trim()||void 0,limit:le.requestLogsPageSize,offset:gn});i(dr.logs),x(dr.total)}else if(le.activeTab==="error"){const gn=(le.errorLogsPage-1)*le.errorLogsPageSize,dr=await V.queryErrorLogs({filters:Ot,keyword:le.appliedErrorSearchQuery.trim()||void 0,limit:le.errorLogsPageSize,offset:gn});s(dr.logs),S(dr.total)}}catch(gn){console.error("Failed to load logs:",gn)}finally{_(!1)}},Z=le=>le?le>=200&&le<300?"badge-success":le>=400&&le<500?"badge-warning":"badge-danger":"badge-danger",Y=le=>{X(le),de(""),J(""),h(1),b(1)},ce=le=>{de(le),J(""),h(1),b(1)},M=()=>{h(1),b(1)},fe=le=>{pe(le),M()},ge=le=>{J(le),M()},Te=le=>{ae(le),M()},Ee=()=>{pe(""),X(""),de(""),J(""),ae(""),se(""),$e(""),lt(""),rt(""),M()},Q=()=>{se(""),$e(""),h(1)},ue=()=>{lt(""),rt(""),b(1)},Se=()=>ve?$.filter(le=>le.vendorId===ve):[],je=()=>{var le;return oe?((le=$.find(Ot=>Ot.id===oe))==null?void 0:le.supportedModels)||[]:[]},ze=!!(N||ve||oe||ie||xe||Le||Ve),We=le=>h(le),Ge=le=>{g(le),h(1)},H=le=>b(le),he=le=>{w(le),b(1)},we=()=>r.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无请求日志"})}):o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"客户端类型"}),o.jsx("th",{children:"路径"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"响应时间"}),o.jsx("th",{children:"Tokens信息"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:r.map(le=>o.jsxs("tr",{children:[o.jsx("td",{children:xt(le.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:rl[le.targetType]?o.jsx("span",{className:`badge ${le.targetType==="claude-code"?"badge-claude-code":le.targetType==="codex"?"badge-codex":"badge-info"}`,children:rl[le.targetType]}):"-"}),o.jsx("td",{children:le.path}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Z(le.statusCode)}`,children:le.statusCode||"Error"})}),o.jsx("td",{children:le.responseTime?`${le.responseTime}ms`:"-"}),o.jsx("td",{children:le.usage?o.jsxs("span",{children:[le.usage.totalTokens?le.usage.totalTokens:le.usage.inputTokens+le.usage.outputTokens," tokens"]}):"-"}),o.jsx("td",{children:o.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[(()=>{const Ot=le.downstreamResponseBody;return typeof Ot=="string"&&(Ot.includes("event:")||Ot.includes("data:"))&&o.jsx("span",{style:{position:"absolute",top:"-4px",right:"-4px",width:"6px",height:"6px",backgroundColor:"#f39c12",borderRadius:"50%",boxShadow:"0 0 0 2px rgba(243, 156, 18, 0.5)"}})})(),o.jsx("button",{className:"btn btn-secondary",onClick:()=>c(le),children:"详情"})]})})]},le.id))})]}),Ae=()=>a.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无错误日志"})}):o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"方法"}),o.jsx("th",{children:"路径"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"错误信息"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:a.map(le=>o.jsxs("tr",{children:[o.jsx("td",{children:xt(le.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:le.method})}),o.jsx("td",{children:le.path}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:le.statusCode||"-"})}),o.jsx("td",{style:{maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#e74c3c"},children:le.errorMessage}),o.jsx("td",{children:o.jsx("button",{className:"btn btn-secondary",onClick:()=>p(le),children:"详情"})})]},le.id))})]}),Re={padding:"15px",background:"var(--bg-secondary)",borderRadius:"12px",marginBottom:"20px",display:"flex",gap:"15px",alignItems:"center",flexWrap:"wrap",border:"1px solid var(--border-primary)"},qe={display:"flex",alignItems:"center",gap:"8px"},Xe={fontWeight:"bold",color:"var(--text-primary)"},et={padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},ct={...et,minWidth:"150px"},Wr={padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"1px solid var(--accent-danger)",background:"var(--accent-danger)",color:"white"},kn={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",width:"320px",fontSize:"14px"},mt={padding:"6px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"none",background:"var(--accent-primary, #3498db)",color:"white"},In={padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},Cn=t==="request",Bt=Cn?Me:Ye,St=le=>Cn?se(le):lt(le),ci=()=>{Cn?($e(Me),h(1)):(rt(Ye),b(1))},Di=Cn?Le:Ve,fa=Cn?Q:ue;return o.jsxs("div",{className:"logs-page",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-content",children:[o.jsxs("div",{className:"page-header-text",children:[o.jsx("h1",{children:"日志"}),o.jsx("p",{children:"查看所有API请求日志"})]}),_B]})}),o.jsxs("div",{className:"card",children:[o.jsx("div",{style:{borderBottom:"1px solid #ecf0f1",marginBottom:"20px"},children:o.jsxs("div",{style:{display:"flex",gap:"0"},children:[o.jsxs("button",{onClick:()=>n("request"),style:{padding:"12px 24px",border:"none",background:t==="request"?"#3498db":"transparent",color:t==="request"?"white":"#7f8c8d",cursor:"pointer",borderBottom:t==="request"?"2px solid #2980b9":"2px solid transparent",fontWeight:t==="request"?"bold":"normal"},children:["请求日志 (",E,")"]}),o.jsxs("button",{onClick:()=>n("error"),style:{padding:"12px 24px",border:"none",background:t==="error"?"#e74c3c":"transparent",color:t==="error"?"white":"#7f8c8d",cursor:"pointer",borderBottom:t==="error"?"2px solid #c0392b":"2px solid transparent",fontWeight:t==="error"?"bold":"normal"},children:["错误日志 (",D,")"]})]})}),o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:t==="error"?"错误日志列表":"请求日志列表"}),o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"0 12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("input",{type:"checkbox",id:"auto-refresh",checked:G,onChange:le=>{K(le.target.checked),le.target.checked&&B(10)},style:{cursor:"pointer"}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",G&&`(⏱ ${O}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{Ze(),Fe(),B(10)},children:"刷新"})]})]}),o.jsxs("div",{style:Re,children:[o.jsxs("div",{style:qe,children:[o.jsx("label",{style:Xe,children:"来源类型:"}),o.jsxs("select",{value:N,onChange:le=>fe(le.target.value),style:et,children:[o.jsx("option",{value:"",children:"全部"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"})]})]}),o.jsxs("div",{style:qe,children:[o.jsx("label",{style:Xe,children:"供应商:"}),o.jsxs("select",{value:ve,onChange:le=>Y(le.target.value),style:ct,children:[o.jsx("option",{value:"",children:"全部供应商"}),W.map(le=>o.jsx("option",{value:le.id,children:le.name},le.id))]})]}),o.jsxs("div",{style:qe,children:[o.jsx("label",{style:Xe,children:"API服务:"}),o.jsxs("select",{value:oe,onChange:le=>ce(le.target.value),disabled:!ve,style:{...ct,background:ve?"var(--bg-card)":"var(--bg-secondary)",cursor:ve?"pointer":"not-allowed",opacity:ve?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),Se().map(le=>o.jsx("option",{value:le.id,children:le.name},le.id))]})]}),o.jsxs("div",{style:qe,children:[o.jsx("label",{style:Xe,children:"模型:"}),o.jsxs("select",{value:ie,onChange:le=>ge(le.target.value),disabled:!oe,style:{...ct,background:oe?"var(--bg-card)":"var(--bg-secondary)",cursor:oe?"pointer":"not-allowed",opacity:oe?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),je().map(le=>o.jsx("option",{value:le,children:le},le))]})]}),o.jsxs("div",{style:qe,children:[o.jsx("label",{style:Xe,children:"路由:"}),o.jsxs("select",{value:xe,onChange:le=>Te(le.target.value),style:ct,children:[o.jsx("option",{value:"",children:"全部路由"}),F.map(le=>o.jsx("option",{value:le.id,children:le.name},le.id))]})]}),ze&&o.jsx("button",{style:Wr,onClick:Ee,children:"清除筛选"}),o.jsxs("div",{style:qe,children:[o.jsx("input",{type:"text",placeholder:Cn?"搜索日志内容...":"搜索错误日志...",value:Bt,onChange:le=>St(le.target.value),onKeyDown:le=>{le.key==="Enter"&&ci()},style:kn}),o.jsx("button",{style:mt,onClick:ci,children:"搜索"}),(Bt||Di)&&o.jsx("button",{style:In,onClick:fa,children:"清空"})]})]}),t==="request"&&o.jsxs(o.Fragment,{children:[I?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):we(),!I&&o.jsx(qc,{currentPage:d,totalItems:y,pageSize:m,onPageChange:We,onPageSizeChange:Ge})]}),t==="error"&&o.jsxs(o.Fragment,{children:[I?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):Ae(),!I&&o.jsx(qc,{currentPage:v,totalItems:k,pageSize:j,onPageChange:H,onPageSizeChange:he})]})]}),l&&o.jsx(Mp,{log:l,onClose:()=>c(null)}),u&&o.jsx(Mp,{log:u,onClose:()=>p(null)})]})}function RB({session:e,onClose:t}){var I;const[n,r]=f.useState(e.targetType==="claude-code"?"codex":"claude-code"),[i,a]=f.useState(!1),[s,l]=f.useState(!0),[c,u]=f.useState(0),[p,d]=f.useState(!1),[h,m]=f.useState(null),[g,y]=f.useState(""),[x,v]=f.useState(null),[b,j]=f.useState(!1),w=e.targetType==="claude-code"?"Claude Code":"Codex",k=n==="claude-code"?"Claude Code":"Codex",S=(()=>{const _=e.lastRequestAt-e.firstRequestAt,G=Math.floor(_/6e4);return G<1?`${Math.max(1,Math.floor(_/1e3))}秒`:G<60?`${G}分钟`:`${Math.floor(G/60)}小时${G%60}分钟`})(),E=async()=>{d(!0),m(null),v(null);try{const _={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:s,maxRounds:c},G=await V.migrationPreview(e.id,_);m(G),y(G.generatedPrompt)}catch(_){U.error(_.message||"预览失败")}finally{d(!1)}},A=async()=>{const _=g||(h==null?void 0:h.generatedPrompt)||"";try{await navigator.clipboard.writeText(_),U.success("已复制到剪贴板!请打开 "+k+",粘贴为第一条消息")}catch{const G=document.querySelector(".migration-prompt-textarea");G?(G.select(),document.execCommand("copy"),U.success("已复制到剪贴板!")):U.error("复制失败,请手动选择内容复制")}},D=async()=>{if(x!=null&&x.command)try{await navigator.clipboard.writeText(x.command),U.success("命令已复制!请在终端中执行")}catch{U.error("复制失败")}},T=async()=>{j(!0),v(null);try{const _={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:s,maxRounds:c},G=await V.migrateLaunch(e.id,_);v(G),G.success&&U.success(`已在新的终端窗口中启动 ${k}`)}catch(_){U.error(_.message||"启动失败")}finally{j(!1)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout migration-modal",style:{width:"900px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"会话迁移"}),o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:["将 ",w," 会话迁移到 ",k]})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{className:"migration-source-info",children:[o.jsx("div",{className:"migration-source-title",children:((I=e.title)==null?void 0:I.replace(/<\/?session>/g,"").trim())||e.id.slice(0,8)}),o.jsxs("div",{className:"migration-source-meta",children:[o.jsx("span",{className:`badge migration-source-badge ${e.targetType==="claude-code"?"migration-badge-claude":"migration-badge-codex"}`,children:e.targetType==="claude-code"?"Claude Code":"Codex"}),o.jsxs("span",{children:[e.requestCount," 轮对话"]}),o.jsxs("span",{children:[e.totalTokens.toLocaleString()," tokens"]}),o.jsx("span",{children:S})]})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"12px",fontWeight:500,color:"var(--text-secondary)",fontSize:"13px"},children:"迁移方向"}),o.jsxs("div",{className:"migration-tool-cards",children:[o.jsxs("div",{className:"migration-tool-card is-source",style:{cursor:"default"},children:[o.jsx("div",{className:"migration-tool-card-icon",children:e.targetType==="claude-code"?o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M8.5 8.5h7v7h-7z"}),o.jsx("path",{d:"M5 12h2"}),o.jsx("path",{d:"M17 12h2"}),o.jsx("path",{d:"M12 5v2"}),o.jsx("path",{d:"M12 17v2"})]}):o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M12 6v4l3 2"}),o.jsx("path",{d:"M9 18h6"}),o.jsx("path",{d:"M9 14h3"})]})}),o.jsx("div",{className:"migration-tool-card-name",children:w}),o.jsx("span",{className:"migration-tool-card-badge",children:"来源"})]}),o.jsx("div",{className:"migration-arrow",children:o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M5 12h14"}),o.jsx("path",{d:"m12 5 7 7-7 7"})]})}),o.jsxs("button",{type:"button",className:`migration-tool-card${n==="claude-code"?" active":""}`,onClick:()=>{r("claude-code"),v(null)},children:[o.jsx("div",{className:"migration-tool-card-icon",children:o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M8.5 8.5h7v7h-7z"}),o.jsx("path",{d:"M5 12h2"}),o.jsx("path",{d:"M17 12h2"}),o.jsx("path",{d:"M12 5v2"}),o.jsx("path",{d:"M12 17v2"})]})}),o.jsx("div",{className:"migration-tool-card-name",children:"Claude Code"}),o.jsx("div",{className:"migration-tool-card-desc",children:e.targetType==="claude-code"&&n==="claude-code"?"同工具新会话":"Anthropic 编程助手"})]}),o.jsxs("button",{type:"button",className:`migration-tool-card${n==="codex"?" active":""}`,onClick:()=>{r("codex"),v(null)},children:[o.jsx("div",{className:"migration-tool-card-icon",children:o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M12 6v4l3 2"}),o.jsx("path",{d:"M9 18h6"}),o.jsx("path",{d:"M9 14h3"})]})}),o.jsx("div",{className:"migration-tool-card-name",children:"Codex"}),o.jsx("div",{className:"migration-tool-card-desc",children:e.targetType==="codex"&&n==="codex"?"同工具新会话":"OpenAI 编程助手"})]})]})]}),o.jsxs("div",{className:"migration-options",style:{marginTop:"12px",display:"flex",gap:"16px",alignItems:"center",flexWrap:"wrap"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:s,onChange:_=>l(_.target.checked)}),"包含工具调用摘要"]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:i,onChange:_=>a(_.target.checked)}),"包含思考过程"]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:{fontSize:"14px",whiteSpace:"nowrap"},children:"最大轮数:"}),o.jsxs("select",{value:c,onChange:_=>u(Number(_.target.value)),style:{padding:"4px 8px",border:"1px solid var(--border-primary)",borderRadius:"6px",fontSize:"14px",backgroundColor:"var(--input-bg)",color:"var(--text-primary)"},children:[o.jsx("option",{value:0,children:"全部"}),o.jsx("option",{value:5,children:"最近 5 轮"}),o.jsx("option",{value:10,children:"最近 10 轮"}),o.jsx("option",{value:20,children:"最近 20 轮"}),o.jsx("option",{value:30,children:"最近 30 轮"})]})]})]}),o.jsx("div",{style:{marginTop:"16px"},children:o.jsx("button",{className:"btn btn-primary",onClick:E,disabled:p,children:p?"加载中...":"预览迁移内容"})}),!h&&!p&&o.jsxs("div",{className:"migration-empty-hint",children:[o.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 20h9"}),o.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 1 1 3 3L7 19l-4 1 1-4Z"})]}),o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:500,color:"var(--text-secondary)",marginBottom:"4px"},children:"请先预览迁移内容"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:"点击上方「预览迁移内容」按钮,确认迁移 Prompt 后即可启动目标工具或复制到剪贴板"})]})]}),h&&o.jsxs("div",{className:"migration-preview-section",style:{marginTop:"16px"},children:[o.jsx("textarea",{className:"migration-prompt-textarea",value:g,onChange:_=>y(_.target.value),style:{width:"100%",minHeight:"400px",padding:"12px",border:"1px solid var(--border-primary)",borderRadius:"8px",fontSize:"13px",fontFamily:"monospace",backgroundColor:"var(--input-bg)",color:"var(--text-primary)",resize:"vertical",lineHeight:1.5}}),o.jsx("div",{className:"migration-preview-footer",style:{marginTop:"10px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:["预估 Tokens: ",h.estimatedTokens.toLocaleString(),h.warnings.map((_,G)=>o.jsxs("span",{style:{color:"#e67e22",marginLeft:"12px"},children:["⚠ ",_]},G)),h.content.extractedRounds>0&&o.jsxs("span",{style:{color:"var(--text-tertiary)",marginLeft:"12px"},children:[h.content.extractedRounds,"/",h.content.totalRounds," 轮"]})]})})]}),x&&o.jsx("div",{className:`migration-launch-result ${x.success?"migration-launch-success":"migration-launch-fallback"}`,style:{marginTop:"16px",padding:"16px",borderRadius:"8px",backgroundColor:x.success?"#27ae6010":"#e67e2210",border:`1px solid ${x.success?"#27ae6040":"#e67e2240"}`},children:x.success?o.jsxs("div",{children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:600,color:"#27ae60",marginBottom:"8px"},children:["✅ 已在新终端窗口中启动 ",k]}),o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:["请在新终端窗口中继续与 ",k," 交互"]})]}):o.jsxs("div",{children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:600,color:"#e67e22",marginBottom:"8px"},children:["⚠️ ",x.reason||"无法自动启动"]}),x.command&&o.jsxs("div",{style:{marginTop:"8px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"请在终端中执行以下命令:"}),o.jsx("pre",{style:{marginTop:"6px",padding:"10px",backgroundColor:"var(--bg-secondary)",borderRadius:"6px",fontSize:"12px",fontFamily:"monospace",overflow:"auto"},children:x.command}),o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:D,style:{marginTop:"6px"},children:"复制命令"})]}),x.fallbackSuggestions&&x.fallbackSuggestions.length>0&&o.jsx("div",{style:{marginTop:"8px",fontSize:"13px",color:"var(--text-tertiary)"},children:x.fallbackSuggestions.map((_,G)=>o.jsxs("div",{children:["• ",_]},G))})]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:T,disabled:b||!h,title:h?"":"请先预览迁移内容",children:b?"启动中...":`🚀 启动 ${k}`}),o.jsx("button",{className:"btn btn-secondary",onClick:A,disabled:!h,title:h?"":"请先预览迁移内容",children:"📋 复制到剪贴板"}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"关闭"})]})]})]})}function DB({session:e,onClose:t,onBound:n}){var v;const[r,i]=f.useState([]),[a,s]=f.useState({}),[l,c]=f.useState(e.routeId||null),[u,p]=f.useState(!1),[d,h]=f.useState(!0),m=e.targetType==="claude-code"?"Claude Code":"Codex";f.useEffect(()=>{(async()=>{try{const j=await V.getRoutes();i(j);const w={};for(const k of j)try{const S=await V.getRules(k.id);w[k.id]=S.length}catch{w[k.id]=0}s(w)}catch{U.error("加载路由列表失败")}finally{h(!1)}})()},[]);const g=async()=>{if(l){p(!0);try{const b=await V.bindSessionRoute(e.id,l);b.success?(U.success("路由绑定成功"),n(),t()):U.error(b.error||"绑定失败")}catch(b){U.error(b.message||"绑定失败")}finally{p(!1)}}},y=async()=>{p(!0);try{const b=await V.unbindSessionRoute(e.id);b.success?(U.success("已解除路由绑定"),n(),t()):U.error(b.error||"解绑失败")}catch(b){U.error(b.message||"解绑失败")}finally{p(!1)}},x=l!==(e.routeId||null);return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal",style:{width:"500px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"路由绑定"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:"为会话指定专用的路由"})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{style:{padding:"12px 16px",backgroundColor:"var(--bg-secondary)",borderRadius:"8px",marginBottom:"20px"},children:[o.jsx("div",{style:{fontWeight:500,marginBottom:"6px"},children:((v=e.title)==null?void 0:v.replace(/<\/?session>/g,"").trim())||e.id.slice(0,8)}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{className:`badge ${e.targetType==="claude-code"?"badge-claude-code":"badge-codex"}`,style:{fontSize:"11px"},children:m}),o.jsxs("span",{children:[e.requestCount," 次请求"]}),o.jsxs("span",{children:[e.totalTokens.toLocaleString()," tokens"]})]})]}),e.routeId&&o.jsx("div",{style:{padding:"10px 14px",backgroundColor:"var(--bg-info, rgba(41, 128, 185, 0.1))",borderRadius:"6px",marginBottom:"16px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"13px"},children:o.jsxs("span",{style:{color:"var(--text-secondary)"},children:["当前绑定:",o.jsx("strong",{children:e.routeName||e.routeId})]})}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"10px",fontWeight:500,color:"var(--text-secondary)",fontSize:"13px"},children:"选择路由"}),d?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"加载中..."}):r.length===0?o.jsxs("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:[o.jsx("p",{children:"暂无可用路由"}),o.jsx("p",{style:{fontSize:"12px",marginTop:"8px"},children:"请先在路由管理页面创建路由"})]}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"300px",overflowY:"auto"},children:r.map(b=>{const j=l===b.id,w=e.routeId===b.id;return o.jsx("div",{onClick:()=>c(b.id),style:{padding:"12px 14px",border:`2px solid ${j?"var(--color-primary, #2980b9)":"var(--border-primary, #e0e0e0)"}`,borderRadius:"8px",cursor:"pointer",backgroundColor:j?"var(--bg-route-item-selected, rgba(41, 128, 185, 0.08))":"var(--bg-primary)",transition:"all 0.15s ease",position:"relative"},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:500,fontSize:"14px",display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{width:"16px",height:"16px",borderRadius:"50%",border:`2px solid ${j?"var(--color-primary, #2980b9)":"var(--border-secondary, #ccc)"}`,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:j&&o.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--color-primary, #2980b9)"}})}),b.name,w&&o.jsx("span",{style:{fontSize:"10px",padding:"1px 6px",borderRadius:"4px",backgroundColor:"var(--color-primary, #2980b9)",color:"white"},children:"当前"})]}),b.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"4px",marginLeft:"24px"},children:b.description})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",flexShrink:0},children:[a[b.id]||0," 条规则"]})]})},b.id)})})]})]}),o.jsxs("div",{className:"modal-footer",children:[e.routeId&&o.jsx("button",{className:"btn btn-danger",onClick:y,disabled:u,children:"解绑"}),o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"取消"}),o.jsx("button",{className:"btn btn-primary",onClick:g,disabled:u||!l||!x,children:u?"处理中...":"确认绑定"})]})]})]})}const LB=Array.from({length:15},(e,t)=>t+1);function zB({onClose:e,onCleared:t}){const[n,r]=f.useState(7),[i,a]=f.useState(!1),[s,l]=f.useState(!1),c=async()=>{l(!0);try{const p=await V.cleanupSessions(n,i);p.sessionsAffected===0?U.info("没有符合条件的会话需要清除"):i?U.success(`已清除 ${p.sessionsAffected} 个会话的日志(共 ${p.logsDeleted} 条),会话记录已保留`):U.success(`已清除 ${p.sessionsAffected} 个会话及其关联日志(共 ${p.logsDeleted} 条)`),t(),e()}catch(p){U.error(p.message||"清除会话失败")}finally{l(!1)}},u=i?`将删除最后请求在 ${n} 天以前的会话所关联的日志,会话记录本身将被保留。`:`将永久删除最后请求在 ${n} 天以前的会话,及其所有关联日志。此操作不可撤销。`;return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:e,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal",style:{width:"480px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"清除会话"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:"按最后请求时间清理过期会话"})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{style:{marginBottom:"20px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"10px",fontWeight:500,color:"var(--text-secondary)",fontSize:"13px"},children:"清除范围"}),o.jsxs("div",{style:{padding:"14px 16px",backgroundColor:"var(--bg-secondary)",borderRadius:"8px",display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[o.jsx("span",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"最后请求在"}),o.jsx("select",{value:n,onChange:p=>r(Number(p.target.value)),disabled:s,style:{padding:"6px 10px",borderRadius:"6px",border:"1px solid var(--border-primary)",backgroundColor:"var(--bg-primary)",color:"var(--text-primary)",fontSize:"14px",cursor:"pointer"},children:LB.map(p=>o.jsx("option",{value:p,children:p},p))}),o.jsx("span",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"天以前的会话"})]})]}),o.jsxs("div",{onClick:()=>!s&&a(p=>!p),style:{padding:"14px 16px",borderRadius:"8px",border:`2px solid ${i?"var(--color-primary, #2980b9)":"var(--border-primary, #e0e0e0)"}`,backgroundColor:i?"var(--bg-route-item-selected, rgba(41, 128, 185, 0.08))":"var(--bg-primary)",cursor:s?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",opacity:s?.6:1},children:[o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:500,fontSize:"14px",color:"var(--text-primary)"},children:"仅清空日志"}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"4px"},children:"开启后保留会话记录,仅删除这些会话的关联日志"})]}),o.jsx("div",{style:{width:"40px",height:"22px",borderRadius:"11px",backgroundColor:i?"var(--color-primary, #2980b9)":"var(--border-secondary, #ccc)",position:"relative",transition:"background-color 0.15s ease",flexShrink:0},children:o.jsx("div",{style:{position:"absolute",top:"2px",left:i?"20px":"2px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#fff",transition:"left 0.15s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})})]}),o.jsxs("div",{style:{marginTop:"20px",padding:"12px 14px",backgroundColor:"rgba(231, 76, 60, 0.08)",border:"1px solid rgba(231, 76, 60, 0.3)",borderRadius:"6px",fontSize:"13px",color:"#c0392b",lineHeight:1.5},children:[o.jsx("strong",{children:"⚠️ 警告:"}),u]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:e,disabled:s,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:c,disabled:s,children:s?"处理中...":"确认清除"})]})]})]})}xt.extend(n0);function $B(e,t,n,r){if(!e)return[];const i=[];if(e.role==="user"){const a=e.content;if(typeof a=="string")i.push({role:"user",content:a,timestamp:t,model:n});else if(Array.isArray(a)){let s=[];const l=()=>{s.length>0&&(i.push({role:"user",content:s.join(`
|
|
130
|
-
`),timestamp:t,model:n}),s=[])};for(const c of a)if((c==null?void 0:c.type)==="text"&&(c!=null&&c.text))s.push(c.text);else if((c==null?void 0:c.type)==="image"||(c==null?void 0:c.type)==="image_url")s.push("[图片]");else if((c==null?void 0:c.type)==="tool_result"){l();let u="";c.content&&(typeof c.content=="string"?u=c.content:Array.isArray(c.content)?u=c.content.map(m=>typeof m=="string"?m:(m==null?void 0:m.type)==="text"&&(m!=null&&m.text)?m.text:(m==null?void 0:m.type)==="image"||(m==null?void 0:m.type)==="image_url"?"[图片]":JSON.stringify(m)).join(`
|
|
131
|
-
`):u=JSON.stringify(c.content));const p=c.tool_use_id&&(r==null?void 0:r.get(c.tool_use_id))||c.name||"",d=c.tool_use_id?c.tool_use_id.slice(-8):"",h=p?`[工具结果: ${p}${d?` · ...${d}`:""}]`:d?`[工具结果: ...${d}]`:"[工具结果]";i.push({role:"user",type:"tool_result",header:h,content:u||h,timestamp:t,model:n})}l()}}else if(e.role==="assistant"){const a=e.content;if(typeof a=="string")a&&i.push({role:"assistant",content:a,timestamp:t,model:n});else if(Array.isArray(a)){let s="",l="";for(const c of a)if(c.type==="text"&&c.text&&(s+=c.text),c.type==="thinking"&&c.thinking&&(l+=c.thinking),c.type==="tool_use"){(s||l)&&(i.push({role:"assistant",content:s,thinking:l||void 0,timestamp:t,model:n}),s="",l="");const u=c.name||"",p=c.id?c.id.slice(-8):"",d=u+(p?` · ...${p}`:""),h=c.input?JSON.stringify(c.input,null,2):"";i.push({role:"assistant",type:"tool_use",header:`[工具调用: ${d}]`,content:h||`[工具调用: ${d}]`,timestamp:t,model:n})}(s||l)&&i.push({role:"assistant",content:s||"",thinking:l||void 0,timestamp:t,model:n})}}return i}function BB(e){var i,a,s,l,c;const t=[],n={timestamp:e.timestamp,model:e.targetModel,tokens:((i=e.usage)==null?void 0:i.totalTokens)||(e.usage?e.usage.inputTokens+e.usage.outputTokens:void 0)},r=e.downstreamResponseBody;if(typeof r=="string"&&(r.includes("event:")||r.includes("data:"))){const u=xu(r),{text:p,thinking:d}=bu(u);if(p||d)return t.push({role:"assistant",content:p||"",thinking:d||void 0,...n}),t}if(e.responseBody)try{const u=typeof e.responseBody=="string"?JSON.parse(e.responseBody):e.responseBody;if(u.content&&Array.isArray(u.content)){let p="",d="";for(const h of u.content)if(h.type==="text"&&h.text&&(p+=h.text),h.type==="thinking"&&h.thinking&&(d+=h.thinking),h.type==="tool_use"){(p||d)&&(t.push({role:"assistant",content:p,thinking:d||void 0,...n}),p="",d="");const m=h.name||"",g=h.id?h.id.slice(-8):"",y=m+(g?` · ...${g}`:""),x=h.input?JSON.stringify(h.input,null,2):"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${y}]`,content:x||`[工具调用: ${y}]`,...n})}if((p||d)&&t.push({role:"assistant",content:p||"",thinking:d||void 0,...n}),t.length>0)return t}if((s=(a=u.choices)==null?void 0:a[0])!=null&&s.message){const p=u.choices[0].message;if(p.content&&t.push({role:"assistant",content:p.content,...n}),p.tool_calls&&Array.isArray(p.tool_calls))for(const d of p.tool_calls){const h=((l=d.function)==null?void 0:l.name)||"",m=d.id?d.id.slice(-8):"",g=h+(m?` · ...${m}`:""),y=((c=d.function)==null?void 0:c.arguments)||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${g}]`,content:y||`[工具调用: ${g}]`,...n})}if(t.length>0)return t}if(u.output){let p="";const d=Array.isArray(u.output)?u.output:[u.output];for(const h of d){if(h.type==="message"&&h.content){const m=Array.isArray(h.content)?h.content:[h.content];for(const g of m)g.type==="output_text"&&g.text?p+=g.text:typeof g=="string"&&(p+=g)}if(h.type==="function_call"){p&&(t.push({role:"assistant",content:p,...n}),p="");const m=h.name||"",g=h.call_id?h.call_id.slice(-8):"",y=m+(g?` · ...${g}`:""),x=h.arguments||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${y}]`,content:x||`[工具调用: ${y}]`,...n})}}if(p&&t.push({role:"assistant",content:p,...n}),t.length>0)return t}}catch{}return t}function r0(e){var i,a;const t=[];let n=0;const r=new Map;for(const s of e){const l=((i=s.body)==null?void 0:i.messages)||[];for(const c of l)if(c.role==="assistant"&&Array.isArray(c.content))for(const u of c.content)u.type==="tool_use"&&u.id&&u.name&&r.set(u.id,u.name)}for(const s of e){const l=((a=s.body)==null?void 0:a.messages)||[],c=l.slice(n);n=l.length;for(const p of c){const d=$B(p,s.timestamp,s.requestModel,r);t.push(...d)}const u=BB(s);t.push(...u)}return FB(t)}function FB(e){const t=[];for(const n of e){if(n.role!=="assistant"){t.push(n);continue}const r=t.findIndex(i=>i.role==="assistant"&&i.type===n.type&&i.content===n.content);if(r===-1)t.push(n);else{const i=t[r],a=!!n.tokens,s=!!i.tokens;a&&!s&&(t[r]=n)}}return t}function ko(e){return(e||"").replace("<session>","").replace("</session>","").trim()||"(无标题)"}function UB({content:e,header:t,forceCollapsible:n,hideContentWhenCollapsed:r}){const i=e.split(`
|
|
132
|
-
`),a=10,s=3,l=f.useRef(null),c=!!n,u=n||i.length>a,p=c?s:a,[d,h]=f.useState(!u),m=()=>{d?(requestAnimationFrame(()=>{const g=l.current,y=g==null?void 0:g.closest(".modal-body-scrollable");if(g&&y){const x=g.getBoundingClientRect(),v=y.getBoundingClientRect();(x.top<v.top||x.top>v.bottom)&&g.scrollIntoView({block:"start"})}}),h(!1)):h(!0)};return u?!d&&r?o.jsx("div",{className:"chat-collapsible-wrapper",ref:l,style:{width:"400px"},children:o.jsxs("div",{className:"chat-collapse-top-bar",children:[t&&o.jsx("div",{className:"chat-tool-header",children:t}),o.jsx("div",{className:"chat-collapse-btn-sticky",children:o.jsxs("button",{className:"chat-collapse-btn",onClick:m,children:["展开 (",i.length," 行)"]})})]})}):o.jsxs("div",{className:"chat-collapsible-wrapper",ref:l,style:!d&&c?{width:"400px"}:void 0,children:[o.jsxs("div",{className:"chat-collapse-top-bar",children:[t&&o.jsx("div",{className:"chat-tool-header",children:t}),o.jsx("div",{className:"chat-collapse-btn-sticky",children:o.jsx("button",{className:"chat-collapse-btn",onClick:m,children:d?"收起":`展开全部 (${i.length} 行)`})})]}),o.jsx("div",{className:"chat-content-text",children:d?e:i.slice(0,p).join(`
|
|
133
|
-
`)}),!d&&o.jsx("div",{className:"chat-collapse-fade",onClick:m,children:o.jsxs("span",{className:"chat-collapse-fade-btn",children:["展开全部 (",i.length," 行)"]})})]}):o.jsxs(o.Fragment,{children:[t&&o.jsx("div",{className:"chat-tool-header",children:t}),o.jsx("div",{className:"chat-content-text",children:e})]})}function WB({logs:e,onFetchNew:t}){const n=[...e].sort((m,g)=>m.timestamp-g.timestamp),[r,i]=f.useState(n),a=r0(r),s=f.useRef(null),[l,c]=f.useState(!1),[u,p]=f.useState(!1);f.useEffect(()=>{i([...e].sort((m,g)=>m.timestamp-g.timestamp))},[e]),f.useEffect(()=>{var y;const m=(y=s.current)==null?void 0:y.parentElement;if(!m)return;const g=()=>{const x=m.scrollHeight-m.scrollTop-m.clientHeight<60;c(x)};return m.addEventListener("scroll",g),g(),()=>m.removeEventListener("scroll",g)},[r]);const d=()=>{var g;const m=(g=s.current)==null?void 0:g.parentElement;m&&m.scrollTo({top:m.scrollHeight,behavior:"smooth"})},h=async()=>{if(l&&t){p(!0);try{const m=await t(),g=new Set(r.map(v=>v.id)),x=[...m].sort((v,b)=>v.timestamp-b.timestamp).filter(v=>!g.has(v.id));x.length>0&&(i(v=>[...v,...x]),requestAnimationFrame(()=>d()))}finally{p(!1)}}else d()};return a.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无对话内容"}):o.jsxs("div",{className:"chat-view-container",ref:s,children:[a.map((m,g)=>o.jsxs("div",{className:`chat-message chat-message--${m.role}${m.type?` chat-message--${m.type}`:""}`,children:[o.jsxs("div",{className:"chat-bubble",children:[m.role==="assistant"&&m.thinking&&o.jsxs("details",{className:"chat-thinking",children:[o.jsxs("summary",{children:["思考内容 (",m.thinking.length," 字符)"]}),o.jsx("pre",{children:m.thinking})]}),m.content&&o.jsx(UB,{content:m.content,header:m.header,forceCollapsible:!!m.type,hideContentWhenCollapsed:m.type==="tool_use"})]}),!m.type&&o.jsxs("div",{className:"chat-meta",children:[xt(m.timestamp).format("HH:mm:ss"),m.model&&` · ${m.model}`,m.tokens&&` · ${m.tokens.toLocaleString()} tokens`]})]},g)),o.jsx("div",{className:"chat-scroll-bottom",children:o.jsx("button",{className:"chat-scroll-bottom-btn",onClick:h,disabled:u,children:u?o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"spin-icon",children:o.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})}):o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})})})})]})}function i0({session:e,logs:t,logsLoading:n,onRefreshLogs:r,onFetchNewLogs:i,onClose:a,onExport:s}){const[l,c]=f.useState("logs"),[u,p]=f.useState(null),d=(g,y)=>{const x=y-g;return x<6e4?`${Math.floor(x/1e3)}秒`:x<36e5?`${Math.floor(x/6e4)}分钟`:`${Math.floor(x/36e5)}小时`},h=g=>g>=1e6?(g/1e6).toFixed(1)+"M":g>=1e3?(g/1e3).toFixed(1)+"k":String(g),m=()=>{if(s){s(e,t,l);return}const y=`${ko(e.title)}.json`;if(l==="chat"){const x=r0(t),v={session:{id:e.id,targetType:e.targetType,title:e.title,firstRequestAt:e.firstRequestAt,lastRequestAt:e.lastRequestAt,requestCount:e.requestCount,totalTokens:e.totalTokens},messages:x.map(k=>({role:k.role,type:k.type,header:k.header,content:k.content,thinking:k.thinking,timestamp:k.timestamp,model:k.model,tokens:k.tokens}))},b=new Blob([JSON.stringify(v,null,2)],{type:"application/json"}),j=URL.createObjectURL(b),w=document.createElement("a");w.href=j,w.download=y,w.click(),URL.revokeObjectURL(j)}else{const x={session:{id:e.id,targetType:e.targetType,title:e.title,firstRequestAt:e.firstRequestAt,lastRequestAt:e.lastRequestAt,requestCount:e.requestCount,totalTokens:e.totalTokens},logs:t},v=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),b=URL.createObjectURL(v),j=document.createElement("a");j.href=b,j.download=y,j.click(),URL.revokeObjectURL(b)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:a,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout",style:{width:"900px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("h2",{children:"会话详情"}),o.jsx("button",{className:"session-refresh-btn",onClick:r,disabled:n,title:"刷新",children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n?"spin-icon":"",children:o.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})})})]}),o.jsxs("div",{className:"session-view-toggle",children:[o.jsx("button",{className:l==="logs"?"active":"",onClick:()=>c("logs"),children:"日志"}),o.jsx("button",{className:l==="chat"?"active":"",onClick:()=>c("chat"),children:"对话"})]})]}),o.jsx("div",{className:"modal-body-scrollable",children:l==="logs"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginBottom:"12px",padding:"10px 12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("div",{style:{fontSize:"15px",fontWeight:500,marginBottom:"8px"},children:ko(e.title)}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px 20px",fontSize:"13px",color:"var(--text-secondary)"},children:[o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"类型"})," ",o.jsx("span",{style:{display:"inline-block",padding:"1px 6px",borderRadius:"4px",fontSize:"12px",background:e.targetType==="claude-code"?"rgba(59,130,246,0.1)":"rgba(34,197,94,0.1)",color:e.targetType==="claude-code"?"var(--color-primary, #3b82f6)":"var(--color-success, #22c55e)"},children:e.targetType==="claude-code"?"Claude Code":"Codex"})]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"请求数"})," ",e.requestCount]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Tokens"})," ",h(e.totalTokens)]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"时长"})," ",d(e.firstRequestAt,e.lastRequestAt)]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"首次请求"})," ",xt(e.firstRequestAt).format("YYYY-MM-DD HH:mm:ss")]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"最后请求"})," ",xt(e.lastRequestAt).format("YYYY-MM-DD HH:mm:ss")]})]})]}),o.jsxs("h3",{style:{marginTop:"0",marginBottom:"10px"},children:["会话日志 (",t.length,")"]}),n?o.jsx("div",{style:{textAlign:"center",padding:"20px"},children:"加载中..."}):t.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"#7f8c8d"},children:"暂无日志"}):o.jsx("div",{style:{border:"1px solid var(--border-color)",borderRadius:"8px",overflow:"hidden"},children:o.jsxs("table",{style:{fontSize:"14px"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"响应时间"}),o.jsx("th",{children:"Tokens"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:[...t].sort((g,y)=>g.timestamp-y.timestamp).map(g=>o.jsxs("tr",{children:[o.jsx("td",{children:xt(g.timestamp).format("HH:mm:ss")}),o.jsx("td",{children:o.jsx("span",{className:`badge ${g.statusCode&&g.statusCode>=200&&g.statusCode<300?"badge-success":g.statusCode&&g.statusCode>=400?"badge-danger":"badge-warning"}`,children:g.statusCode||"Error"})}),o.jsx("td",{children:g.responseTime?`${g.responseTime}ms`:"-"}),o.jsx("td",{children:g.usage?o.jsx("span",{children:g.usage.totalTokens||g.usage.inputTokens+g.usage.outputTokens}):"-"}),o.jsx("td",{children:o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>p(g),children:"详情"})})]},g.id))})]})})]}):o.jsx(o.Fragment,{children:n?o.jsx("div",{style:{textAlign:"center",padding:"20px"},children:"加载中..."}):o.jsx(WB,{logs:t,onFetchNew:i})})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:m,disabled:t.length===0,children:"导出"}),o.jsx("button",{className:"btn btn-secondary",onClick:a,children:"关闭"})]})]}),u&&o.jsx(Mp,{log:u,onClose:()=>p(null)})]})}xt.extend(n0);function KB(){const[e,t]=f.useState([]),[n,r]=f.useState(0),[i,a]=f.useState(1),[s,l]=f.useState(20),[c,u]=f.useState(null),[p,d]=f.useState([]),[h,m]=f.useState(!1),[g,y]=f.useState(""),[x,v]=f.useState(""),[b,j]=f.useState(""),[w,k]=f.useState(""),[S,E]=f.useState(""),[A,D]=f.useState(""),[T,I]=f.useState(""),[_,G]=f.useState([]),[K,O]=f.useState([]),[B,W]=f.useState([]),[R,$]=f.useState(!1),[P,F]=f.useState(10),[re,N]=f.useState(null),[pe,ve]=f.useState(null),[X,oe]=f.useState(!1),de=f.useRef({sessionsPage:i,sessionsPageSize:s,appliedSearchQuery:x,filterTargetType:b,filterVendorId:w,filterServiceId:S,filterModel:A,filterRouteId:T});de.current={sessionsPage:i,sessionsPageSize:s,appliedSearchQuery:x,filterTargetType:b,filterVendorId:w,filterServiceId:S,filterModel:A,filterRouteId:T},f.useEffect(()=>{J()},[i,s,x,b,w,S,A,T]),f.useEffect(()=>{ie()},[]),f.useEffect(()=>{let Z=null,Y=null;return R&&(Y=setInterval(()=>{F(ce=>ce<=1?10:ce-1)},1e3),Z=setInterval(()=>{J()},1e4)),()=>{Z&&clearInterval(Z),Y&&clearInterval(Y)}},[R,i,s]);const ie=async()=>{try{const[Z,Y,ce]=await Promise.all([V.getVendors(),V.getAPIServices(),V.getRoutes()]);G(Z),O(Y),W(ce)}catch(Z){console.error("Failed to load filter options:",Z)}},J=async()=>{const Z=de.current;try{const Y=(Z.sessionsPage-1)*Z.sessionsPageSize,ce=await V.getSessions({filters:{targetType:Z.filterTargetType||void 0,vendorId:Z.filterVendorId||void 0,serviceId:Z.filterServiceId||void 0,model:Z.filterModel||void 0,routeId:Z.filterRouteId||void 0},keyword:Z.appliedSearchQuery.trim()||void 0,limit:Z.sessionsPageSize,offset:Y});t(ce.sessions),r(ce.total)}catch(Y){console.error("Failed to load sessions:",Y)}},xe=async Z=>{u(Z),m(!0);try{const Y=await V.getSessionLogs(Z.id,1e4);d(Y)}catch(Y){console.error("Failed to load session logs:",Y)}finally{m(!1)}},ae=(Z,Y)=>{const ce=Y-Z;return ce<6e4?`${Math.floor(ce/1e3)}秒`:ce<36e5?`${Math.floor(ce/6e4)}分钟`:`${Math.floor(ce/36e5)}小时`},Me=Z=>Z==="claude-code"?o.jsx("span",{className:"badge badge-claude-code",children:"Claude Code"}):Z==="codex"?o.jsx("span",{className:"badge badge-codex",children:"Codex"}):o.jsx("span",{className:"badge",children:Z}),se=Z=>{k(Z),E(""),D(""),a(1)},Le=Z=>{E(Z),D(""),a(1)},$e=()=>w?K.filter(Z=>Z.vendorId===w):[],Ye=()=>{if(!S)return[];const Z=K.find(Y=>Y.id===S);return(Z==null?void 0:Z.supportedModels)||[]},lt=!!(x||b||w||S||A||T),Ve=()=>{y(""),v(""),j(""),k(""),E(""),D(""),I(""),a(1)},rt=(Z,Y,ce)=>{const M=Z;if(ce==="chat"){const ze=r0(Y).map((Re,qe)=>({index:qe+1,role:Re.role,type:Re.type||null,header:Re.header||null,content:Re.content,thinking:Re.thinking||null,timestamp:xt(Re.timestamp).format("YYYY-MM-DD HH:mm:ss"),model:Re.model||null,tokens:Re.tokens||null})),We={session:{id:M.id,title:ko(M.title),targetType:M.targetType,requestCount:M.requestCount,totalTokens:M.totalTokens,firstRequestAt:xt(M.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:xt(M.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:ae(M.firstRequestAt,M.lastRequestAt)},messages:ze,exportedAt:xt().format("YYYY-MM-DD HH:mm:ss")},Ge=JSON.stringify(We,null,2),H=new Blob([Ge],{type:"application/json;charset=utf-8"}),he=URL.createObjectURL(H),we=document.createElement("a");we.href=he;const Ae=ko(M.title).replace(/[\\/:*?"<>|]/g,"_");we.download=`${Ae}_对话.json`,document.body.appendChild(we),we.click(),document.body.removeChild(we),URL.revokeObjectURL(he),U.success("对话数据已导出");return}const fe=Y.map((je,ze)=>{var he,we,Ae,Re;const We=((he=je.body)==null?void 0:he.messages)||[];let Ge="";const H=je.downstreamResponseBody;if(typeof H=="string"&&(H.includes("event:")||H.includes("data:"))){const qe=xu(H),{text:Xe,thinking:et}=bu(qe),ct=[];et&&ct.push(`<details><summary>思考过程</summary>
|
|
134
|
-
|
|
135
|
-
${et}
|
|
136
|
-
|
|
137
|
-
</details>`),Xe&&ct.push(Xe),Ge=ct.join(`
|
|
138
|
-
|
|
139
|
-
`)}if(!Ge&&je.responseBody)try{const qe=typeof je.responseBody=="string"?JSON.parse(je.responseBody):je.responseBody;if(qe.content){if(Array.isArray(qe.content)){const Xe=[];for(const et of qe.content)et.type==="text"&&et.text?Xe.push(et.text):et.type==="thinking"&&et.thinking&&Xe.push(`<details><summary>思考过程</summary>
|
|
140
|
-
|
|
141
|
-
${et.thinking}
|
|
142
|
-
|
|
143
|
-
</details>`);Ge=Xe.join(`
|
|
144
|
-
|
|
145
|
-
`)}typeof qe.content=="string"&&(Ge=qe.content)}!Ge&&((Re=(Ae=(we=qe.choices)==null?void 0:we[0])==null?void 0:Ae.message)!=null&&Re.content)&&(Ge=qe.choices[0].message.content)}catch{}return{index:ze+1,timestamp:xt(je.timestamp).format("YYYY-MM-DD HH:mm:ss"),statusCode:je.statusCode||null,responseTime:je.responseTime||null,requestModel:je.requestModel||null,targetModel:je.targetModel||null,vendorName:je.vendorName||null,serviceName:je.targetServiceName||null,contentType:je.contentType||null,tags:je.tags||[],usage:je.usage||null,messages:We,response:Ge||null}}),ge={session:{id:M.id,title:M.title||null,targetType:M.targetType,requestCount:M.requestCount,totalTokens:M.totalTokens,model:M.model||null,vendorName:M.vendorName||null,serviceName:M.serviceName||null,firstRequestAt:xt(M.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:xt(M.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:ae(M.firstRequestAt,M.lastRequestAt)},logs:fe,exportedAt:xt().format("YYYY-MM-DD HH:mm:ss")},Te=JSON.stringify(ge,null,2),Ee=new Blob([Te],{type:"application/json;charset=utf-8"}),Q=URL.createObjectURL(Ee),ue=document.createElement("a");ue.href=Q;const Se=ko(M.title).replace(/[\\/:*?"<>|]/g,"_");ue.download=`${Se}.json`,document.body.appendChild(ue),ue.click(),document.body.removeChild(ue),URL.revokeObjectURL(Q),U.success("导出成功")},ke=Z=>a(Z),De=Z=>{l(Z),a(1)},Fe={padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",minWidth:"140px"},Ze={fontWeight:"bold",color:"var(--text-primary)"};return o.jsxs("div",{className:"sessions-page",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-content",children:[o.jsxs("div",{className:"page-header-text",children:[o.jsx("h1",{children:"会话"}),o.jsx("p",{children:"查看和管理所有会话记录"})]}),o.jsx("button",{className:"btn btn-danger",onClick:()=>oe(!0),children:"清除会话"})]})}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"会话列表"}),o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("input",{type:"checkbox",id:"auto-refresh",checked:R,onChange:Z=>{$(Z.target.checked),F(10)}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",R&&`(⏱ ${P}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{J(),F(10)},children:"刷新"})]})]}),o.jsxs("div",{style:{padding:"15px",background:"var(--bg-secondary)",borderRadius:"12px",marginBottom:"20px",display:"flex",gap:"15px",alignItems:"center",flexWrap:"wrap",border:"1px solid var(--border-primary)"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:Ze,children:"来源类型:"}),o.jsxs("select",{value:b,onChange:Z=>{j(Z.target.value),a(1)},style:Fe,children:[o.jsx("option",{value:"",children:"全部"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:Ze,children:"供应商:"}),o.jsxs("select",{value:w,onChange:Z=>se(Z.target.value),style:Fe,children:[o.jsx("option",{value:"",children:"全部供应商"}),_.map(Z=>o.jsx("option",{value:Z.id,children:Z.name},Z.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:Ze,children:"API服务:"}),o.jsxs("select",{value:S,onChange:Z=>Le(Z.target.value),disabled:!w,style:{...Fe,background:w?"var(--bg-card)":"var(--bg-secondary)",cursor:w?"pointer":"not-allowed",opacity:w?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),$e().map(Z=>o.jsx("option",{value:Z.id,children:Z.name},Z.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:Ze,children:"模型:"}),o.jsxs("select",{value:A,onChange:Z=>{D(Z.target.value),a(1)},disabled:!S,style:{...Fe,background:S?"var(--bg-card)":"var(--bg-secondary)",cursor:S?"pointer":"not-allowed",opacity:S?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),Ye().map(Z=>o.jsx("option",{value:Z,children:Z},Z))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:Ze,children:"路由:"}),o.jsxs("select",{value:T,onChange:Z=>{I(Z.target.value),a(1)},style:Fe,children:[o.jsx("option",{value:"",children:"全部路由"}),B.map(Z=>o.jsx("option",{value:Z.id,children:Z.name},Z.id))]})]}),lt&&o.jsx("button",{onClick:Ve,style:{padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"1px solid var(--accent-danger)",background:"var(--accent-danger)",color:"white"},children:"清除筛选"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("input",{type:"text",placeholder:"搜索标题或ID...",value:g,onChange:Z=>y(Z.target.value),onKeyDown:Z=>{Z.key==="Enter"&&(v(g),a(1))},style:{padding:"6px 12px",border:"1px solid var(--border-primary)",borderRadius:"8px",fontSize:"14px",width:"320px",background:"var(--bg-card)",color:"var(--text-primary)"}}),o.jsx("button",{onClick:()=>{v(g),a(1)},style:{padding:"6px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"none",background:"var(--accent-primary, #3498db)",color:"white"},children:"搜索"}),(g||x)&&o.jsx("button",{onClick:()=>{y(""),v(""),a(1)},style:{padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},children:"清空"})]})]}),e.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:lt?"没有匹配的会话":"暂无会话记录"})}):o.jsxs(o.Fragment,{children:[o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"标题"}),o.jsx("th",{children:"客户端类型"}),o.jsx("th",{children:"请求数"}),o.jsx("th",{children:"Tokens"}),o.jsx("th",{children:"首次请求"}),o.jsx("th",{children:"最后请求"}),o.jsx("th",{children:"时长"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:e.map(Z=>o.jsxs("tr",{onClick:()=>xe(Z),style:{cursor:"pointer",backgroundColor:(c==null?void 0:c.id)===Z.id?"var(--bg-selected)":void 0},children:[o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ko(Z.title)}),o.jsx("td",{children:Me(Z.targetType)}),o.jsx("td",{children:Z.requestCount}),o.jsx("td",{children:Z.totalTokens.toLocaleString()}),o.jsx("td",{children:xt(Z.firstRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:xt(Z.lastRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:ae(Z.firstRequestAt,Z.lastRequestAt)}),o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",gap:"6px"},children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:Y=>{Y.stopPropagation(),xe(Z)},children:"查看"}),o.jsx("button",{className:"btn btn-sm btn-primary",onClick:Y=>{Y.stopPropagation(),u(Z),m(!0),V.getSessionLogs(Z.id,1e4).then(ce=>d(ce)).catch(console.error).finally(()=>m(!1))},children:"对话"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:"#8e44ad",color:"white",border:"none"},onClick:Y=>{Y.stopPropagation(),N(Z)},title:"迁移到另一个工具",children:"迁移"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:Z.routeId?"#27ae60":"#2980b9",color:"white",border:"none",minWidth:(Z.routeId,void 0)},onClick:Y=>{Y.stopPropagation(),ve(Z)},title:Z.routeId?`已绑定: ${Z.routeName||Z.routeId}`:"绑定路由",children:Z.routeName?Z.routeName.length>8?Z.routeName.slice(0,8)+"…":Z.routeName:"路由"})]})})]},Z.id))})]}),o.jsx(qc,{currentPage:i,pageSize:s,totalItems:n,onPageChange:ke,onPageSizeChange:De})]})]}),c&&o.jsx(i0,{session:c,logs:p,logsLoading:h,onRefreshLogs:async()=>{if(c){m(!0);try{const Z=await V.getSessionLogs(c.id,1e4);d(Z)}catch(Z){console.error("Failed to refresh session logs:",Z)}finally{m(!1)}}},onFetchNewLogs:async()=>{if(!c)return[];const Z=await V.getSessionLogs(c.id,1e4);return d(Z),Z},onClose:()=>{u(null),d([])},onExport:rt}),re&&o.jsx(RB,{session:re,onClose:()=>N(null)}),pe&&o.jsx(DB,{session:pe,onClose:()=>ve(null),onBound:()=>{J()}}),X&&o.jsx(zB,{onClose:()=>oe(!1),onCleared:()=>{a(1),J()}})]})}function il({checked:e,onChange:t,disabled:n,label:r,labelPosition:i="right"}){const a=o.jsx("button",{type:"button",role:"switch","aria-checked":e,className:`switch ${e?"active":""}`,onClick:()=>!n&&t(!e),disabled:n,children:o.jsx("span",{className:"switch-thumb",style:{position:"absolute",top:"2px",left:e?"22px":"2px",width:"20px",height:"20px",borderRadius:"10px",backgroundColor:"#fff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})});return r?i==="left"?o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:n?"not-allowed":"pointer"},children:[o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:r}),a]}):o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:n?"not-allowed":"pointer"},children:[a,o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:r})]}):a}function Ww({skillId:e,targetType:t,enabled:n,onChange:r,disabled:i}){const a=t==="claude-code"?"Claude Code":"Codex";return o.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:o.jsx(il,{checked:n,onChange:s=>r(e,t,s),disabled:i,label:a,labelPosition:"right"})})}function HB(){var O,B,W,R,$,P;const[e,t]=f.useState(null),[n,r]=f.useState(!0),[i,a]=f.useState("10"),[s,l]=f.useState(""),[c,u]=f.useState(""),[p,d]=f.useState(""),[h,m]=f.useState({proxyEnabled:!1,proxyUrl:"",proxyUsername:"",proxyPassword:""}),[g,y]=f.useState(!1),[x,v]=f.useState(null),[b,j]=f.useState(!1),[w,k]=f.useState(!1);f.useEffect(()=>{S()},[]);const S=async()=>{const F=await V.getConfig();t(F),r(F.enableFailover!==!1),a(typeof F.failoverRecoverySeconds=="number"&&F.failoverRecoverySeconds>0?String(Math.floor(F.failoverRecoverySeconds)):"10"),m({proxyEnabled:F.proxyEnabled||!1,proxyUrl:F.proxyUrl||"",proxyUsername:F.proxyUsername||"",proxyPassword:F.proxyPassword||""}),y(F.enableLanDiscovery||!1)},E=async F=>{F.preventDefault();const re=Number(i),N=Number.isFinite(re)&&re>0?Math.floor(re):10,pe={...e,enableFailover:n,failoverRecoverySeconds:N};await V.updateConfig(pe)?(U.success("配置保存成功"),S()):U.error("配置保存失败")},A=async F=>{F.preventDefault();const re=new FormData(F.currentTarget),N={...e,enableLogging:re.get("enableLogging")==="true",logRetentionDays:parseInt(re.get("logRetentionDays")),maxLogSize:parseInt(re.get("maxLogSize"))};await V.updateConfig(N)?(U.success("日志配置保存成功"),S()):U.error("日志配置保存失败")},D=async F=>{F.preventDefault();const re=new FormData(F.currentTarget),N={...e,proxyEnabled:re.get("proxyEnabled")==="true",proxyUrl:re.get("proxyUrl"),proxyUsername:re.get("proxyUsername"),proxyPassword:re.get("proxyPassword")};await V.updateConfig(N)?(U.success("代理配置保存成功"),S()):U.error("代理配置保存失败")},T=async F=>{y(F);const re={...e,enableLanDiscovery:F};await V.updateConfig(re)?(U.success(F?"已开启局域网同步":"已关闭局域网同步"),S()):(y(!F),U.error("配置保存失败"))},I=async()=>{if(!s){U.warning("请输入密码");return}try{const F=await V.exportData(s);d(F),U.success("导出成功,请复制下方数据")}catch(F){U.error("导出失败: "+F.message)}},_=async()=>{if(!s||!c){U.warning("请输入密码和导入数据");return}j(!0);try{const F=await V.previewImportData(c,s);v(F),F.success||U.error(F.message||"预览失败")}catch(F){U.error("预览失败: "+F.message),v({success:!1,message:F.message})}finally{j(!1)}},G=async()=>{if(!s||!c||!(x!=null&&x.success)){U.warning("请先预览数据并确认无误");return}k(!0);try{const F=await V.importData(c,s);F.success?(U.success(F.message+(F.details?` (${F.details})`:"")),u(""),l(""),v(null)):U.error(F.message+(F.details?`: ${F.details}`:""))}catch(F){U.error("导入失败: "+F.message)}finally{k(!1)}},K=()=>{v(null),u(""),l("")};return e?o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"设置"}),o.jsx("p",{children:"管理应用配置和数据导入导出"})]}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{children:"应用配置"}),o.jsxs("form",{onSubmit:E,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用智能故障切换"}),o.jsxs("select",{name:"enableFailover",value:n?"true":"false",onChange:F=>r(F.target.value==="true"),children:[o.jsx("option",{value:"true",children:"是"}),o.jsx("option",{value:"false",children:"否"})]}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"#666",fontSize:"12px"},children:"启用后,当某个服务报错时会自动切换到备用服务,并按下方“故障自动恢复时间”自动恢复"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"故障自动恢复时间(秒)"}),o.jsx("input",{type:"number",name:"failoverRecoverySeconds",min:1,step:1,value:i,onChange:F=>a(F.target.value),disabled:!n}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"#666",fontSize:"12px"},children:"默认 10 秒。仅在“启用智能故障切换”为“是”时可修改"})]}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存配置"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"日志设置"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"配置请求日志的记录和保留策略。"}),o.jsxs("form",{onSubmit:A,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用日志"}),o.jsxs("select",{name:"enableLogging",defaultValue:e.enableLogging?"true":"false",children:[o.jsx("option",{value:"true",children:"是"}),o.jsx("option",{value:"false",children:"否"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"日志保留天数"}),o.jsx("input",{type:"number",name:"logRetentionDays",defaultValue:e.logRetentionDays,required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"最大日志数量"}),o.jsx("input",{type:"number",name:"maxLogSize",defaultValue:e.maxLogSize,required:!0})]}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存日志配置"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"代理设置"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"配置代理服务器,API 服务可选择是否通过代理转发请求。"}),o.jsxs("form",{onSubmit:D,children:[o.jsx("input",{type:"hidden",name:"proxyEnabled",value:h.proxyEnabled?"true":"false"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用代理"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[o.jsx(il,{checked:h.proxyEnabled,onChange:F=>m(re=>({...re,proxyEnabled:F}))}),o.jsx("span",{style:{fontSize:"14px",color:"#666"},children:h.proxyEnabled?"已启用":"未启用"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理地址"}),o.jsx("input",{type:"text",name:"proxyUrl",value:h.proxyUrl,onChange:F=>m(re=>({...re,proxyUrl:F.target.value})),placeholder:"例如: proxy.example.com:8080 或 http://proxy.example.com:8080"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理用户名(可选)"}),o.jsx("input",{type:"text",name:"proxyUsername",value:h.proxyUsername,onChange:F=>m(re=>({...re,proxyUsername:F.target.value})),placeholder:"如果代理需要认证"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理密码(可选)"}),o.jsx("input",{type:"password",name:"proxyPassword",value:h.proxyPassword,onChange:F=>m(re=>({...re,proxyPassword:F.target.value})),placeholder:"如果代理需要认证"})]}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存代理配置"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"局域网同步"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"开启后,同一局域网内的其他 AICodeSwitch 节点可以发现并拉取本节点的 Skills、MCP 配置信息。上游 API Key 等敏感信息不会被传输。"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"允许局域网拉取配置"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[o.jsx(il,{checked:g,onChange:T}),o.jsx("span",{style:{fontSize:"14px",color:"#666"},children:g?"已启用":"未启用"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"数据导出"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"导出所有配置数据,包括供应商、API服务、路由等。数据将使用密码加密。"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"加密密码"}),o.jsx("input",{type:"password",value:s,onChange:F=>l(F.target.value),placeholder:"用于加密导出数据"})]}),o.jsx("button",{className:"btn btn-primary",onClick:I,children:"导出数据"}),p&&o.jsxs("div",{className:"form-group",style:{marginTop:"20px"},children:[o.jsx("label",{children:"导出的数据(请复制保存)"}),o.jsx("textarea",{rows:6,value:p,readOnly:!0,style:{fontFamily:"monospace",fontSize:"12px"}}),o.jsx("button",{className:"btn btn-secondary",style:{marginTop:"10px"},onClick:()=>{navigator.clipboard.writeText(p),U.success("已复制到剪贴板")},children:"复制到剪贴板"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"数据导入"}),o.jsx("p",{style:{color:"#e74c3c",fontSize:"14px",fontWeight:500},children:"警告:导入数据将覆盖所有现有配置!请确保已备份重要数据。"}),x!=null&&x.success?o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginTop:"15px",padding:"15px",backgroundColor:"#e8f4fd",borderRadius:"6px",border:"1px solid #bee5eb"},children:[o.jsx("h4",{style:{margin:"0 0 12px 0",color:"#0c5460",fontSize:"16px"},children:"数据预览"}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"10px",marginBottom:"12px"},children:[o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"供应商"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((O=x.data)==null?void 0:O.vendors)||0})]}),o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"API服务"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((B=x.data)==null?void 0:B.services)||0})]}),o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"路由"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((W=x.data)==null?void 0:W.routes)||0})]}),o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"规则"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((R=x.data)==null?void 0:R.rules)||0})]})]}),o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:[o.jsxs("div",{children:["数据版本: ",($=x.data)==null?void 0:$.version]}),o.jsxs("div",{children:["导出时间: ",(P=x.data)!=null&&P.exportDate?new Date(x.data.exportDate).toLocaleString("zh-CN"):"-"]})]})]}),o.jsxs("div",{style:{marginTop:"15px",padding:"12px",backgroundColor:"#fff3cd",borderRadius:"4px",border:"1px solid #ffeaa7",color:"#856404"},children:[o.jsx("strong",{children:"确认导入?"})," 此操作将覆盖所有现有的供应商、服务、路由和规则配置,且无法撤销。"]}),o.jsxs("div",{style:{marginTop:"15px",display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-danger",onClick:G,disabled:w,children:w?"导入中...":"确认导入"}),o.jsx("button",{className:"btn btn-secondary",onClick:K,disabled:w,children:"取消"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"解密密码"}),o.jsx("input",{type:"password",value:s,onChange:F=>l(F.target.value),placeholder:"用于解密导入数据"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"导入数据"}),o.jsx("textarea",{rows:6,value:c,onChange:F=>u(F.target.value),placeholder:"粘贴导出的加密数据",style:{fontFamily:"monospace",fontSize:"12px"}})]}),o.jsx("button",{className:"btn btn-primary",onClick:_,disabled:b||!s||!c,children:b?"预览中...":"预览数据"}),(x==null?void 0:x.success)===!1&&o.jsxs("div",{style:{marginTop:"10px",padding:"10px",backgroundColor:"#fdeaea",borderRadius:"4px",color:"#e74c3c"},children:[o.jsx("strong",{children:"预览失败:"}),x.message]})]})]})]}):o.jsx("div",{children:"加载中..."})}function VB(){var h,m,g,y,x,v,b,j;const[e,t]=f.useState({claude:!1,codex:!1}),[n,r]=f.useState({claude:!1,codex:!1}),[i,a]=f.useState({claude:null,codex:null}),[s,l]=f.useState("");f.useEffect(()=>{c()},[]);const c=async()=>{try{const[w,k]=await Promise.all([V.getClaudeConfigStatus(),V.getCodexConfigStatus()]);a({claude:w,codex:k})}catch(w){console.error("Failed to check config status:",w)}},u=async w=>{t(k=>({...k,[w]:!0})),l("");try{(w==="claude"?await V.writeClaudeConfig():await V.writeCodexConfig())?(l(`${w==="claude"?"Claude Code":"Codex"}配置文件写入成功!原始文件已备份为 .aicodeswitch_backup 文件。`),await c()):l("写入失败: 操作未成功")}catch(k){l(`写入失败: ${k.message}`)}finally{t(k=>({...k,[w]:!1}))}},p=async w=>{r(k=>({...k,[w]:!0})),l("");try{(w==="claude"?await V.restoreClaudeConfig():await V.restoreCodexConfig())?(l(`${w==="claude"?"Claude Code":"Codex"}配置文件已从备份恢复!`),await c()):l("恢复失败: 操作未成功")}catch(k){l(`恢复失败: ${k.message}`)}finally{r(k=>({...k,[w]:!1}))}},d=w=>{const k=i[w];if(!k)return null;const S=w==="claude"?"Claude Code":"Codex";return k.isOverwritten&&k.isModified?o.jsxs("p",{style:{color:"#f39c12",fontSize:"12px",marginTop:"10px"},children:["⚠️ 检测到",S,"配置已被修改,但备份文件仍然存在。建议先恢复原始配置,再重新写入以确保配置正确。"]}):k.isOverwritten&&!k.isModified?o.jsxs("p",{style:{color:"#27ae60",fontSize:"12px",marginTop:"10px"},children:["✓ ",S,"配置已正确设置为代理模式,且未被修改。"]}):!k.isOverwritten&&k.hasBackup?o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 检测到配置状态不一致。备份文件存在但当前配置不是代理配置,请先恢复或手动删除备份文件。"}):null};return o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"写入配置"}),o.jsx("p",{children:"将Claude Code和Codex的配置文件写入到用户目录"})]}),o.jsxs("div",{className:"card",style:{marginBottom:"20px"},children:[o.jsx("h3",{children:"Claude Code配置"}),o.jsx("p",{style:{color:"#7f8c8d",marginBottom:"15px"},children:"为Claude Code工具写入配置文件。原始文件将被备份为.aicodeswitch_backup文件。"}),o.jsxs("div",{style:{marginBottom:"15px"},children:[o.jsx("h4",{children:"配置文件:"}),o.jsxs("ul",{style:{color:"#7f8c8d",lineHeight:"1.6"},children:[o.jsxs("li",{children:[o.jsx("code",{children:"~/.claude/settings.json"})," - Claude Code设置"]}),o.jsxs("li",{children:[o.jsx("code",{children:"~/.claude.json"})," - Claude Code初始化设置"]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>u("claude"),disabled:e.claude||(((h=i.claude)==null?void 0:h.isOverwritten)??!1),children:e.claude?"写入中...":"写入Claude Code配置"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>p("claude"),disabled:n.claude||!(((m=i.claude)==null?void 0:m.hasBackup)??!1),children:n.claude?"恢复中...":"恢复Claude Code配置"})]}),d("claude"),((g=i.claude)==null?void 0:g.isOverwritten)&&!((y=i.claude)!=null&&y.isModified)&&o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 配置已被覆盖,如需重新写入请先恢复原始配置"})]}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{children:"Codex配置"}),o.jsx("p",{style:{color:"#7f8c8d",marginBottom:"15px"},children:"为Codex工具写入配置文件。原始文件将被备份为.aicodeswitch_backup文件。"}),o.jsxs("div",{style:{marginBottom:"15px"},children:[o.jsx("h4",{children:"配置文件:"}),o.jsxs("ul",{style:{color:"#7f8c8d",lineHeight:"1.6"},children:[o.jsxs("li",{children:[o.jsx("code",{children:"~/.codex/config.toml"})," - Codex配置"]}),o.jsxs("li",{children:[o.jsx("code",{children:"~/.codex/auth.json"})," - Codex认证信息"]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>u("codex"),disabled:e.codex||(((x=i.codex)==null?void 0:x.isOverwritten)??!1),children:e.codex?"写入中...":"写入Codex配置"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>p("codex"),disabled:n.codex||!(((v=i.codex)==null?void 0:v.hasBackup)??!1),children:n.codex?"恢复中...":"恢复Codex配置"})]}),d("codex"),((b=i.codex)==null?void 0:b.isOverwritten)&&!((j=i.codex)!=null&&j.isModified)&&o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 配置已被覆盖,如需重新写入请先恢复原始配置"})]}),s&&o.jsx("div",{style:{marginTop:"20px",padding:"10px",borderRadius:"4px",backgroundColor:s.includes("成功")?"#d4edda":"#f8d7da",color:s.includes("成功")?"#155724":"#721c24",border:`1px solid ${s.includes("成功")?"#c3e6cb":"#f5c6cb"}`},children:s})]})}const qB=`# AI Code Switch
|
|
146
|
-
|
|
147
|
-
## 简介
|
|
148
|
-
|
|
149
|
-
AI Code Switch 是帮助你在本地管理 AI 编程工具接入大模型的工具。
|
|
150
|
-
它可以让你的 Claude Code、Codex 等工具不再局限于官方模型。
|
|
151
|
-
为所有编程工具提供本地API驱动,自动智能的切换不同场景下的模型。
|
|
152
|
-
|
|
153
|
-
**而且它尽可能简单的帮你解决这件事。**
|
|
154
|
-
|
|
155
|
-
- 视频演示:[https://www.bilibili.com/video/BV1uEznBuEJd/](https://www.bilibili.com/video/BV1uEznBuEJd/?from=github)
|
|
156
|
-
- 1分钟让Claude Code接入GLM国产模型:[https://www.bilibili.com/video/BV1a865B8ErA/](https://www.bilibili.com/video/BV1a865B8ErA/)
|
|
157
|
-
- 1分钟让Codex接入免费模型Agnes:[https://www.bilibili.com/video/BV1tQ7Q63Eva/](https://www.bilibili.com/video/BV1tQ7Q63Eva/) Codex接入Deepseek可参考该方法实现
|
|
158
|
-
- 在线教程:[https://space.bilibili.com/37442719/lists/8333248](https://space.bilibili.com/37442719/lists/8333248)
|
|
159
|
-
|
|
160
|
-
## 功能要点
|
|
161
|
-
|
|
162
|
-
* 可登记任意的大模型API接口服务,让你可以在一个面板管理你的大模型厂商
|
|
163
|
-
* 一键切换模型:可以注册多个供应商的多个API接口,当想要切换模型时,只需要点击一个按钮就可以立即切换
|
|
164
|
-
* 自动配置:无需你手动去修改claude code或codex的系统配置文件,aicodeswitch自动帮你修改,你只要启动它,无需配置claude code或codex就可以让它们正常工作
|
|
165
|
-
* 一键配置供应商,省去复杂的供应商配置流程
|
|
166
|
-
* 启动所有已知大模型接口标准,可接入任意客户端,包括但不限于openclaw、hermes、trae等,根据不同需要自主配置接口对应的大模型服务
|
|
167
|
-
* API转流:将兼容openai接口标准的模型,轻松接入到claude code中,支持将符合openai、anthropic、gemini的数据格式转发给claude code或codex
|
|
168
|
-
* 按需中转请求:根据请求类型,让不同的模型来处理不同的任务,节省成本,基于该特性,可以让glm等原生非多模态模型支持图像识别
|
|
169
|
-
* 智能故障切换:当API服务发生故障时,智能切换到其他API服务进行尝试,无需手动切换,特别适用于中转服务商
|
|
170
|
-
* 代理:针对无法直接访问的模型服务,例如地区被ban,支持设置代理来解决
|
|
171
|
-
* tokens超量限制:避免其中一个服务商的用量超过限制,浪费了钱,适合有免费额度的服务商
|
|
172
|
-
* 次数超量限制:次数到达一定量后,切换其他服务商,适合coding plan的服务商
|
|
173
|
-
* 日志:超精细的日志记录和会话记录,帮助你发现编程工具本身的问题,以及专研工具的agent逻辑
|
|
174
|
-
* 统计:丰富且详细的统计数据,用量信息快速掌握,发掘自己的编程习惯
|
|
175
|
-
* Skills管理:一键搜索和安装Skills,一键启用skill到claude code或codex
|
|
176
|
-
* MCP管理:一键安装预设MCP,一键启用MCP
|
|
177
|
-
* 导入和导出:一键备份数据,在多太电脑间共享aicodeswitch配置
|
|
178
|
-
* 服务端部署,自定义API Key,支持B/S架构,让aicodeswitch成为在线服务,提供给团队使用
|
|
179
|
-
* 数据完全本地,自主可控
|
|
180
|
-
* 特殊语法:在发送的提示词最前面添加\`[!]\`来直接切换为高智商模型服务(\`[x]\`关闭),简单快捷
|
|
181
|
-
|
|
182
|
-

|
|
183
|
-
|
|
184
|
-
## 桌面客户端
|
|
185
|
-
|
|
186
|
-
[进入下载](https://github.com/tangshuang/aicodeswitch/releases)
|
|
187
|
-
|
|
188
|
-
## 命令行工具
|
|
189
|
-
|
|
190
|
-
\`\`\`
|
|
191
|
-
# 安装
|
|
192
|
-
npm install -g aicodeswitch
|
|
193
|
-
# 启动服务
|
|
194
|
-
aicos start
|
|
195
|
-
# http://127.0.0.1:4567
|
|
196
|
-
# 启动服务并打开管理界面
|
|
197
|
-
aicos ui
|
|
198
|
-
# 停止服务
|
|
199
|
-
aicos stop
|
|
200
|
-
\`\`\`
|
|
201
|
-
|
|
202
|
-
## 管理界面
|
|
203
|
-
|
|
204
|
-
**配置供应商**
|
|
205
|
-
|
|
206
|
-
* 什么是供应商?
|
|
207
|
-
* 供应商配置有什么用?
|
|
208
|
-
|
|
209
|
-
具体请看下方文档。
|
|
210
|
-
|
|
211
|
-
**路由配置**
|
|
212
|
-
|
|
213
|
-
* 什么是路由?
|
|
214
|
-
* 什么是路由规则?
|
|
215
|
-
|
|
216
|
-
具体请看下方文档。
|
|
217
|
-
|
|
218
|
-
**覆盖配置文件**
|
|
219
|
-
|
|
220
|
-
在aicodeswitch中,点击“写入Claude Code配置”按钮,它会修改Claude Code的配置文件,让Claude Code开始使用aicocdeswitch提供的模型API,而非直接连到官网的模型API。
|
|
221
|
-
|
|
222
|
-
你不用太担心,你可以在写入后,点击“恢复Claude Code配置”按钮,将Claude Code的配置文件恢复到原始状态。
|
|
223
|
-
|
|
224
|
-
Codex的配置覆盖逻辑一模一样。
|
|
225
|
-
|
|
226
|
-
**设置**
|
|
227
|
-
|
|
228
|
-
你可以在设置页面,对aicodedeswitch进行配置。
|
|
229
|
-
|
|
230
|
-
也可以导出配置数据,转移到其他电脑上导入。
|
|
231
|
-
|
|
232
|
-
## 配置供应商
|
|
233
|
-
|
|
234
|
-
### 什么是供应商?
|
|
235
|
-
|
|
236
|
-
所谓供应商,就是提供AI服务的上游服务商。可以是OpenAI、Claude、DeepSeek、GLM 官方服务,也可以是其他中转服务商。
|
|
237
|
-
|
|
238
|
-
### 供应商配置有什么用?
|
|
239
|
-
|
|
240
|
-
通过将你所有的AI服务商统一起来管理,可以帮你:
|
|
241
|
-
|
|
242
|
-
1. 避免频繁修改配置文件,通过aicodeswitch,可以一键切换到不同的供应商的AI服务API
|
|
243
|
-
2. 通过aicodeswitch,将不同供应商的接口数据,转换为工具可以正确使用的接口数据格式,也就是说,你可以将Claude Code接入遵循openai的接口数据协议的其他接口
|
|
244
|
-
3. 避免你忘记曾经注册过那些供应商
|
|
245
|
-
4. 充分榨干不怎么用的供应商的服务,避免充值后不怎么用浪费了
|
|
246
|
-
|
|
247
|
-
### 什么是API服务的“源类型”
|
|
248
|
-
|
|
249
|
-
供应商接口返回的数据格式标准类型,目前支持以下几种:
|
|
250
|
-
|
|
251
|
-
* OpenAI(Responses API标准)
|
|
252
|
-
* OpenAI Chat (Chat Completions API标准)
|
|
253
|
-
* DeepSeek Chat(reasoning_content标准)
|
|
254
|
-
* Claude
|
|
255
|
-
* Claude Chat
|
|
256
|
-
* Gemini
|
|
257
|
-
* Gemini Chat
|
|
258
|
-
|
|
259
|
-
**有什么用?**
|
|
260
|
-
|
|
261
|
-
aicodeswitch内部,会根据“源类型”来转换数据。例如,你的供应商API服务接口是OpenAI Chat的数据格式,而你在路由中配置的“客户端工具“是Claude Code,那么就意味着,这个供应商API的数据,需要经过转换之后才能被Claude Code正确使用。
|
|
262
|
-
|
|
263
|
-
## 路由管理
|
|
264
|
-
|
|
265
|
-
### 什么是路由?
|
|
266
|
-
|
|
267
|
-
路由是aicodeswitch的核心功能,它负责将不同的对象工具(目前指Claude Code和Codex)的请求,路由到不同的供应商API服务上。
|
|
268
|
-
|
|
269
|
-
### 什么是“客户端工具”?
|
|
270
|
-
|
|
271
|
-
目前指Claude Code或Codex。
|
|
272
|
-
|
|
273
|
-
### 什么是“路由规则”?
|
|
274
|
-
|
|
275
|
-
以Claude Code为例,它的请求实际上并非铁板一块,可以被分为多种。比如它的深度思考、长文对话、图片理解等等,都是可以独立对待的。
|
|
276
|
-
|
|
277
|
-
路由规则的目的,就是让你的工具发出的请求,可以根据这个区分,发送给不同的服务商来处理。例如,你默认使用glm-4.7作为写代码的模型,但是,你可以把图片识别的请求发给doubao-code来进行,因为doubao-code的图片识别平均价格可以更低。同样的道理,不同目标的请求可以通过不同的规则来处理,以提升编程的质量和效果。
|
|
278
|
-
|
|
279
|
-
目前,我仅提供了几个比较容易区分的规则,以后,还会添加更多的规则。
|
|
280
|
-
|
|
281
|
-
### 激活路由
|
|
282
|
-
|
|
283
|
-
我们可以为Claude Code添加多个路由,但是,我们必须激活一个路由,才能开始使用。
|
|
284
|
-
而且,所有以Claude Code为对象的路由,在同一时间,只有一个可以被激活。
|
|
285
|
-
|
|
286
|
-
### 切换路由
|
|
287
|
-
|
|
288
|
-
你可以根据你的实际情况来实时切换路由,比如,你可以在发现自己的某个服务商处的余额较少时,立即切换到另外一个服务商。
|
|
289
|
-
|
|
290
|
-
**智能故障切换机制**
|
|
291
|
-
|
|
292
|
-
当同一请求类型配置多个规则时,系统会按排序优先使用第一个,如果某个服务报错(4xx/5xx)或请求超时,将自动切换到下一个可用规则,确保你可以正常使用coding工具。
|
|
293
|
-
|
|
294
|
-
### 数据转流
|
|
295
|
-
|
|
296
|
-
支持将openai的流式响应数据转换成Claude Code的流式数据,并支持实时转换,从而可以让你使用支持openAI的API服务来在Claude Code中使用。
|
|
297
|
-
|
|
298
|
-
*不过,需要注意,如果你的API服务商不支持tools,或者所支持的max_tokens太小,是无法在Claude Code中使用的。*
|
|
299
|
-
|
|
300
|
-
## Skills管理
|
|
301
|
-
|
|
302
|
-
你可以在 aicodeswitch 中集中统一管理 skills,把skills分发给claude code和codex,随时启用和停用skills。
|
|
303
|
-
另外,你可以基于自然语言搜索skills,找到skill之后,支持一键安装。
|
|
304
|
-
|
|
305
|
-
## MCP管理
|
|
306
|
-
|
|
307
|
-
你可以在 aicodeswitch 中集中统一管理 MCP,把MCP分发给claude code和codex,随时启用和停用MCP。
|
|
308
|
-
并且,你还可以通过MCP来实现图像理解。
|
|
309
|
-
|
|
310
|
-
## 日志
|
|
311
|
-
|
|
312
|
-
在**日志**页面,您可以查看:
|
|
313
|
-
|
|
314
|
-
**请求日志**:所有 API 请求的详细记录
|
|
315
|
-
|
|
316
|
-
* 请求来源和目标
|
|
317
|
-
* 请求内容和响应
|
|
318
|
-
* 耗时和状态码
|
|
319
|
-
* 错误信息(如有)
|
|
320
|
-
|
|
321
|
-
**错误日志**:错误和异常记录
|
|
322
|
-
|
|
323
|
-
* 错误类型
|
|
324
|
-
* 错误详情
|
|
325
|
-
* 发生时间
|
|
326
|
-
|
|
327
|
-
**会话日志**:按照会话session来汇集日志
|
|
328
|
-
|
|
329
|
-
**日志筛选**
|
|
330
|
-
|
|
331
|
-
根据提供的选项进行筛选。
|
|
332
|
-
|
|
333
|
-
## 配置文件
|
|
334
|
-
|
|
335
|
-
作为 CLI 工具,你可以在 ~/.aicodeswitch/ 目录下找到工具的相关文件。里面有一个 aicodeswitch.conf 文件,可以进行配置。
|
|
336
|
-
目前仅支持以下配置:
|
|
337
|
-
|
|
338
|
-
\`\`\`
|
|
339
|
-
# aicodeswitch的服务端口
|
|
340
|
-
PORT=4567
|
|
341
|
-
|
|
342
|
-
# 如果提供AUTH,你无法直接登录用户界面,必须输入AUTH的值才能进入,相当于是一个登陆鉴权
|
|
343
|
-
# 如果你在自己的服务器上使用,通过远程接入接口时,就必须提供这个值
|
|
344
|
-
# AUTH=
|
|
345
|
-
\`\`\`
|
|
346
|
-
|
|
347
|
-
> 服务监听地址由 AUTH 模式自动决定,无需也无法通过配置修改:
|
|
348
|
-
> - AUTH 关闭:仅监听 \`127.0.0.1\`(本机访问)
|
|
349
|
-
> - AUTH 开启:监听 \`0.0.0.0\`(允许远端 AccessKey 客户端连接)
|
|
350
|
-
>
|
|
351
|
-
> 写入本地编程工具(Claude Code / Codex)配置文件的地址、以及 UI / CLI 展示的访问地址,统一使用 \`127.0.0.1\`。
|
|
352
|
-
|
|
353
|
-
## 常见问题
|
|
354
|
-
|
|
355
|
-
### 1\\. 如何切换供应商?
|
|
356
|
-
|
|
357
|
-
在路由管理页面修改规则的目标供应商,或调整优先级即可。
|
|
358
|
-
|
|
359
|
-
### 2\\. 如何查看失败的请求?
|
|
360
|
-
|
|
361
|
-
在请求日志页面,筛选状态码不为 200 的记录。
|
|
362
|
-
|
|
363
|
-
### 3\\. 如何备份配置?
|
|
364
|
-
|
|
365
|
-
在系统设置页面使用**导出配置**功能,然后将提供的数据保存到本地文件中。
|
|
366
|
-
|
|
367
|
-
### 4\\. 如何设置日志保留时间?
|
|
368
|
-
|
|
369
|
-
在系统设置页面修改**日志保留天数**配置。
|
|
370
|
-
|
|
371
|
-
## 我的开源
|
|
372
|
-
|
|
373
|
-
* [PCM](https://github.com/tangshuang/pcm): 用户意图识别、精准上下文、多线对话的Agent系统
|
|
374
|
-
* [Lan Transfer](https://github.com/tangshuang/lan-transfer): 免费高效的局域网文件互传工具
|
|
375
|
-
* [MCP Bone](https://github.com/tangshuang/mcp-bone): 远程托管的MCP服管理工具
|
|
376
|
-
* [Anys](https://github.com/tangshuang/anys): 免费前端监控kit
|
|
377
|
-
* [WebCut](https://github.com/tangshuang/webcut): 免费开源的网页端视频剪辑UI框架
|
|
378
|
-
* [indb](https://github.com/tangshuang/indb): 网页端轻量kv数据库操作库
|
|
379
|
-
* [Formast](https://github.com/tangshuang/formast): 复杂业务场景下的企业级JSON驱动表单框架
|
|
380
|
-
|
|
381
|
-
## 关联资源
|
|
382
|
-
|
|
383
|
-
* [Claude Code 深度教程](https://claudecode.tangshuang.net): 100%免费的Claude Code入门到精通教程
|
|
384
|
-
* [AICodingBus](https://aicodingbus.24x7.to): AI Tokens 交换平台
|
|
385
|
-
|
|
386
|
-
## 支持我
|
|
387
|
-
|
|
388
|
-

|
|
389
|
-
|
|
390
|
-
你的支持是我前进的动力!
|
|
391
|
-
|
|
392
|
-
## 许可
|
|
393
|
-
|
|
394
|
-
此项目采用双许可证模式:
|
|
395
|
-
|
|
396
|
-
* **开源使用**:项目默认采用 GPL 3.0 许可证,允许个人免费使用、修改和分发,但所有衍生品必须开源。
|
|
397
|
-
* **商业使用**:如果您希望商业化使用而不遵守 GPL 条款(例如闭源销售),请联系我们购买单独的商业许可证。
|
|
398
|
-
|
|
399
|
-
## 技术支持
|
|
400
|
-
|
|
401
|
-
如有问题或建议,请访问项目 [GitHub 仓库](https://github.com/tangshuang/aicodeswitch/issues)提交 Issue。
|
|
402
|
-
`,YB=()=>o.jsx("div",{className:"markdown-content",children:o.jsx(Sc,{children:qB})});function pA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=pA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function dt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=pA(e))&&(r&&(r+=" "),r+=t);return r}var GB=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function a0(e){if(typeof e!="string")return!1;var t=GB;return t.includes(e)}var XB=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],QB=new Set(XB);function fA(e){return typeof e!="string"?!1:QB.has(e)}function hA(e){return typeof e=="string"&&e.startsWith("data-")}function Xn(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(fA(n)||hA(n))&&(t[n]=e[n]);return t}function Uo(e){if(e==null)return null;if(f.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Xn(t)}return typeof e=="object"&&!Array.isArray(e)?Xn(e):null}function Fn(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(fA(n)||hA(n)||a0(n))&&(t[n]=e[n]);return t}function JB(e){return e==null?null:f.isValidElement(e)?Fn(e.props):typeof e=="object"&&!Array.isArray(e)?Fn(e):null}var ZB=["children","width","height","viewBox","className","style","title","desc"];function Bv(){return Bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bv.apply(null,arguments)}function e5(e,t){if(e==null)return{};var n,r,i=t5(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function t5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var o0=f.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:s,style:l,title:c,desc:u}=e,p=e5(e,ZB),d=a||{width:r,height:i,x:0,y:0},h=dt("recharts-surface",s);return f.createElement("svg",Bv({},Fn(p),{className:h,width:r,height:i,style:l,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),f.createElement("title",null,c),f.createElement("desc",null,u),n)}),n5=["children","className"];function Fv(){return Fv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fv.apply(null,arguments)}function r5(e,t){if(e==null)return{};var n,r,i=i5(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function i5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ht=f.forwardRef((e,t)=>{var{children:n,className:r}=e,i=r5(e,n5),a=dt("recharts-layer",r);return f.createElement("g",Fv({className:a},Fn(i),{ref:t}),n)}),mA=f.createContext(null),a5=()=>f.useContext(mA);function Et(e){return function(){return e}}const gA=Math.cos,Rp=Math.sin,oi=Math.sqrt,Dp=Math.PI,ah=2*Dp,Uv=Math.PI,Wv=2*Uv,vo=1e-6,o5=Wv-vo;function vA(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function s5(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return vA;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class l5{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?vA:s5(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,c=r-t,u=i-n,p=s-t,d=l-n,h=p*p+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>vo)if(!(Math.abs(d*c-u*p)>vo)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-s,g=i-l,y=c*c+u*u,x=m*m+g*g,v=Math.sqrt(y),b=Math.sqrt(h),j=a*Math.tan((Uv-Math.acos((y+h-x)/(2*v*b)))/2),w=j/b,k=j/v;Math.abs(w-1)>vo&&this._append`L${t+w*p},${n+w*d}`,this._append`A${a},${a},0,0,${+(d*m>p*g)},${this._x1=t+k*c},${this._y1=n+k*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=t+l,p=n+c,d=1^s,h=s?i-a:a-i;this._x1===null?this._append`M${u},${p}`:(Math.abs(this._x1-u)>vo||Math.abs(this._y1-p)>vo)&&this._append`L${u},${p}`,r&&(h<0&&(h=h%Wv+Wv),h>o5?this._append`A${r},${r},0,1,${d},${t-l},${n-c}A${r},${r},0,1,${d},${this._x1=u},${this._y1=p}`:h>vo&&this._append`A${r},${r},0,${+(h>=Uv)},${d},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function s0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new l5(t)}function l0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function yA(e){this._context=e}yA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function oh(e){return new yA(e)}function xA(e){return e[0]}function bA(e){return e[1]}function jA(e,t){var n=Et(!0),r=null,i=oh,a=null,s=s0(l);e=typeof e=="function"?e:e===void 0?xA:Et(e),t=typeof t=="function"?t:t===void 0?bA:Et(t);function l(c){var u,p=(c=l0(c)).length,d,h=!1,m;for(r==null&&(a=i(m=s())),u=0;u<=p;++u)!(u<p&&n(d=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(d,u,c),+t(d,u,c));if(m)return a=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Et(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Et(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Et(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function xd(e,t,n){var r=null,i=Et(!0),a=null,s=oh,l=null,c=s0(u);e=typeof e=="function"?e:e===void 0?xA:Et(+e),t=typeof t=="function"?t:Et(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?bA:Et(+n);function u(d){var h,m,g,y=(d=l0(d)).length,x,v=!1,b,j=new Array(y),w=new Array(y);for(a==null&&(l=s(b=c())),h=0;h<=y;++h){if(!(h<y&&i(x=d[h],h,d))===v)if(v=!v)m=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=m;--g)l.point(j[g],w[g]);l.lineEnd(),l.areaEnd()}v&&(j[h]=+e(x,h,d),w[h]=+t(x,h,d),l.point(r?+r(x,h,d):j[h],n?+n(x,h,d):w[h]))}if(b)return l=null,b+""||null}function p(){return jA().defined(i).curve(s).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Et(+d),r=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Et(+d),u):e},u.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Et(+d),u):r},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Et(+d),n=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Et(+d),u):t},u.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Et(+d),u):n},u.lineX0=u.lineY0=function(){return p().x(e).y(t)},u.lineY1=function(){return p().x(e).y(n)},u.lineX1=function(){return p().x(r).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:Et(!!d),u):i},u.curve=function(d){return arguments.length?(s=d,a!=null&&(l=s(a)),u):s},u.context=function(d){return arguments.length?(d==null?a=l=null:l=s(a=d),u):a},u}class wA{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function c5(e){return new wA(e,!0)}function u5(e){return new wA(e,!1)}const c0={draw(e,t){const n=oi(t/Dp);e.moveTo(n,0),e.arc(0,0,n,0,ah)}},d5={draw(e,t){const n=oi(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},SA=oi(1/3),p5=SA*2,f5={draw(e,t){const n=oi(t/p5),r=n*SA;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},h5={draw(e,t){const n=oi(t),r=-n/2;e.rect(r,r,n,n)}},m5=.8908130915292852,kA=Rp(Dp/10)/Rp(7*Dp/10),g5=Rp(ah/10)*kA,v5=-gA(ah/10)*kA,y5={draw(e,t){const n=oi(t*m5),r=g5*n,i=v5*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=ah*a/5,l=gA(s),c=Rp(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},Zm=oi(3),x5={draw(e,t){const n=-oi(t/(Zm*3));e.moveTo(0,n*2),e.lineTo(-Zm*n,-n),e.lineTo(Zm*n,-n),e.closePath()}},Pr=-.5,Er=oi(3)/2,Kv=1/oi(12),b5=(Kv/2+1)*3,j5={draw(e,t){const n=oi(t/b5),r=n/2,i=n*Kv,a=r,s=n*Kv+n,l=-a,c=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(l,c),e.lineTo(Pr*r-Er*i,Er*r+Pr*i),e.lineTo(Pr*a-Er*s,Er*a+Pr*s),e.lineTo(Pr*l-Er*c,Er*l+Pr*c),e.lineTo(Pr*r+Er*i,Pr*i-Er*r),e.lineTo(Pr*a+Er*s,Pr*s-Er*a),e.lineTo(Pr*l+Er*c,Pr*c-Er*l),e.closePath()}};function w5(e,t){let n=null,r=s0(i);e=typeof e=="function"?e:Et(e||c0),t=typeof t=="function"?t:Et(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Et(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Et(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Lp(){}function zp(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function CA(e){this._context=e}CA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:zp(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:zp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function S5(e){return new CA(e)}function PA(e){this._context=e}PA.prototype={areaStart:Lp,areaEnd:Lp,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:zp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function k5(e){return new PA(e)}function EA(e){this._context=e}EA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:zp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function C5(e){return new EA(e)}function TA(e){this._context=e}TA.prototype={areaStart:Lp,areaEnd:Lp,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function P5(e){return new TA(e)}function Kw(e){return e<0?-1:1}function Hw(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),l=(a*i+s*r)/(r+i);return(Kw(a)+Kw(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function Vw(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function eg(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,s-l*n,a,s)}function $p(e){this._context=e}$p.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:eg(this,this._t0,Vw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,eg(this,Vw(this,n=Hw(this,e,t)),n);break;default:eg(this,this._t0,n=Hw(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function AA(e){this._context=new OA(e)}(AA.prototype=Object.create($p.prototype)).point=function(e,t){$p.prototype.point.call(this,t,e)};function OA(e){this._context=e}OA.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function E5(e){return new $p(e)}function T5(e){return new AA(e)}function IA(e){this._context=e}IA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=qw(e),i=qw(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function qw(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function A5(e){return new IA(e)}function sh(e,t){this._context=e,this._t=t}sh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function O5(e){return new sh(e,.5)}function I5(e){return new sh(e,0)}function N5(e){return new sh(e,1)}function Wo(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,l=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Hv(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function _5(e,t){return e[t]}function M5(e){const t=[];return t.key=e,t}function R5(){var e=Et([]),t=Hv,n=Wo,r=_5;function i(a){var s=Array.from(e.apply(this,arguments),M5),l,c=s.length,u=-1,p;for(const d of a)for(l=0,++u;l<c;++l)(s[l][u]=[0,+r(d,s[l].key,u,a)]).data=d;for(l=0,p=l0(t(s));l<c;++l)s[p[l]].index=l;return n(s,p),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Et(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Et(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Hv:typeof a=="function"?a:Et(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Wo,i):n},i}function D5(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}Wo(e,t)}}function L5(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var s=0,l=0;s<i;++s)l+=e[s][n][1]||0;r[n][1]+=r[n][0]=-l/2}Wo(e,t)}}function z5(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var l=0,c=0,u=0;l<s;++l){for(var p=e[t[l]],d=p[r][1]||0,h=p[r-1][1]||0,m=(d-h)/2,g=0;g<l;++g){var y=e[t[g]],x=y[r][1]||0,v=y[r-1][1]||0;m+=x-v}c+=d,u+=m*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,Wo(e,t)}}function Vv(e){return e==="__proto__"}function NA(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function u0(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is((t=e==null?void 0:e.valueOf)==null?void 0:t.call(e),-0)?"-0":String(e)}function _A(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(_A).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function d0(e){if(Array.isArray(e))return e.map(u0);if(typeof e=="symbol")return[e];e=_A(e);const t=[],n=e.length;if(n===0)return t;let r=0,i="",a="",s=!1;for(e.charCodeAt(0)===46&&t.push("");r<n;){const l=e[r];if(a)l==="\\"&&r+1<n?(r++,i+=e[r]):l===a?a="":i+=l;else if(s)l==='"'||l==="'"?a=l:l==="]"?(s=!1,t.push(i),i=""):i+=l;else if(l==="[")s=!0,i&&(t.push(i),i="");else if(l==="."){i&&(t.push(i),i="");const c=e[r+1];(c===void 0||c===".")&&t.push("")}else i+=l;r++}return i&&t.push(i),t}function Ei(e,t,n){if(e==null)return n;switch(typeof t){case"string":{if(Vv(t))return n;const r=e[t];return r===void 0?NA(t)?Ei(e,d0(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=u0(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return $5(e,t,n);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),Vv(t))return n;const r=e[t];return r===void 0?n:r}}}function $5(e,t,n){if(t.length===0)return n;let r=e;for(let i=0;i<t.length;i++){if(r==null||Vv(t[i]))return n;r=r[t[i]]}return r===void 0?n:r}var B5=4;function Aa(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:B5,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Gt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,s)=>{var l=n[s-1];return typeof l=="string"?i+l+a:l!==void 0?i+Aa(l)+a:i+a},"")}var xn=e=>e===0?0:e>0?1:-1,ii=e=>typeof e=="number"&&e!=+e,Ko=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ce=e=>(typeof e=="number"||e instanceof Number)&&!ii(e),Ti=e=>Ce(e)||typeof e=="string",F5=0,Yc=e=>{var t=++F5;return"".concat(e||"").concat(t)},$n=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ce(t)&&typeof t!="string")return r;var a;if(Ko(t)){if(n==null)return r;var s=t.indexOf("%");a=n*parseFloat(t.slice(0,s))/100}else a=+t;return ii(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},MA=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function yt(e,t,n){return Ce(e)&&Ce(t)?Aa(e+n*(t-e)):t}function RA(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Ei(r,t))===n)}var Rt=e=>e===null||typeof e>"u",ju=e=>Rt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function ir(e){return e!=null}function Qa(){}var U5=["type","size","sizeType"];function qv(){return qv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qv.apply(null,arguments)}function Yw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yw(Object(n),!0).forEach(function(r){W5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W5(e,t,n){return(t=K5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function K5(e){var t=H5(e,"string");return typeof t=="symbol"?t:t+""}function H5(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function V5(e,t){if(e==null)return{};var n,r,i=q5(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function q5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var DA={symbolCircle:c0,symbolCross:d5,symbolDiamond:f5,symbolSquare:h5,symbolStar:y5,symbolTriangle:x5,symbolWye:j5},Y5=Math.PI/180,G5=e=>{var t="symbol".concat(ju(e));return DA[t]||c0},X5=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*Y5;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Q5=(e,t)=>{DA["symbol".concat(ju(e))]=t},p0=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=V5(e,U5),a=Gw(Gw({},i),{},{type:t,size:n,sizeType:r}),s="circle";typeof t=="string"&&(s=t);var l=()=>{var h=G5(s),m=w5().type(h).size(X5(n,r,s)),g=m();if(g!==null)return g},{className:c,cx:u,cy:p}=a,d=Fn(a);return Ce(u)&&Ce(p)&&Ce(n)?f.createElement("path",qv({},d,{className:dt("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(p,")"),d:l()})):null};p0.registerSymbol=Q5;var LA=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,f0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(f.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{a0(i)&&typeof n[i]=="function"&&(r[i]=a=>n[i](n,a))}),r},J5=(e,t,n)=>r=>(e(t,n,r),null),wu=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];a0(i)&&typeof a=="function"&&(r||(r={}),r[i]=J5(a,t,n))}),r};function Xw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Z5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xw(Object(n),!0).forEach(function(r){eF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eF(e,t,n){return(t=tF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tF(e){var t=nF(e,"string");return typeof t=="symbol"?t:t+""}function nF(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nn(e,t){var n=Z5({},e),r=t,i=Object.keys(t),a=i.reduce((s,l)=>(s[l]===void 0&&r[l]!==void 0&&(s[l]=r[l]),s),n);return a}function Bp(){return Bp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bp.apply(null,arguments)}function Qw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qw(Object(n),!0).forEach(function(r){rF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rF(e,t,n){return(t=iF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iF(e){var t=aF(e,"string");return typeof t=="symbol"?t:t+""}function aF(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ar=32,oF={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function sF(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function lF(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Ar/2,a=Ar/6,s=Ar/3,l=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return f.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:sF(t.payload),x1:0,y1:i,x2:Ar,y2:i,className:"recharts-legend-icon"});if(c==="line")return f.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(s,`
|
|
403
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(i,`
|
|
404
|
-
H`).concat(Ar,"M").concat(2*s,",").concat(i,`
|
|
405
|
-
A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return f.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Ar/8,"h").concat(Ar,"v").concat(Ar*3/4,"h").concat(-Ar,"z"),className:"recharts-legend-icon"});if(f.isValidElement(t.legendIcon)){var u=zA({},t);return delete u.legendIcon,f.cloneElement(t.legendIcon,u)}return f.createElement(p0,{fill:l,cx:i,cy:i,size:Ar,sizeType:"diameter",type:c})}function cF(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:s,labelStyle:l}=e,c={x:0,y:0,width:Ar,height:Ar},u={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,h)=>{var m=d.formatter||i,g=dt({"recharts-legend-item":!0,["legend-item-".concat(h)]:!0,inactive:d.inactive});if(d.type==="none")return null;var y=typeof l=="object"?zA({},l):{};y.color=d.inactive?a:y.color||d.color;var x=m?m(d.value,d,h):d.value;return f.createElement("li",Bp({className:g,style:u,key:"legend-item-".concat(h)},wu(e,d,h)),f.createElement(o0,{width:n,height:n,viewBox:c,style:p,"aria-label":"".concat(d.value," legend icon")},f.createElement(lF,{data:d,iconType:s,inactiveColor:a})),f.createElement("span",{className:"recharts-legend-item-text",style:y},x))})}var uF=e=>{var t=nn(e,oF),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return f.createElement("ul",{className:"recharts-default-legend",style:a},f.createElement(cF,Bp({},t,{payload:n})))};function dF(e,t){const n=new Map;for(let r=0;r<e.length;r++){const i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function pF(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function $A(e){return e}function fF(e){return function(t){return Ei(t,e)}}function Yv(e){return e==null||typeof e!="object"&&typeof e!="function"}function hF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mF(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function h0(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const gF="[object RegExp]",BA="[object String]",FA="[object Number]",UA="[object Boolean]",WA="[object Arguments]",vF="[object Symbol]",yF="[object Date]",xF="[object Map]",bF="[object Set]",jF="[object Array]",wF="[object ArrayBuffer]",SF="[object Object]",kF="[object DataView]",CF="[object Uint8Array]",PF="[object Uint8ClampedArray]",EF="[object Uint16Array]",TF="[object Uint32Array]",AF="[object Int8Array]",OF="[object Int16Array]",IF="[object Int32Array]",NF="[object Float32Array]",_F="[object Float64Array]",Jw=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function MF(e){return typeof Jw.Buffer<"u"&&Jw.Buffer.isBuffer(e)}function RF(e,t){return Co(e,void 0,e,new Map,t)}function Co(e,t,n,r=new Map,i=void 0){const a=i==null?void 0:i(e,t,n,r);if(a!==void 0)return a;if(Yv(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const s=new Array(e.length);r.set(e,s);for(let l=0;l<e.length;l++)s[l]=Co(e[l],l,n,r,i);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;r.set(e,s);for(const[l,c]of e)s.set(l,Co(c,l,n,r,i));return s}if(e instanceof Set){const s=new Set;r.set(e,s);for(const l of e)s.add(Co(l,void 0,n,r,i));return s}if(MF(e))return e.subarray();if(hF(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,s);for(let l=0;l<e.length;l++)s[l]=Co(e[l],l,n,r,i);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,s),Gr(s,e,n,r,i),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return r.set(e,s),Gr(s,e,n,r,i),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return r.set(e,s),Gr(s,e,n,r,i),s}if(e instanceof Error){const s=structuredClone(e);return r.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,Gr(s,e,n,r,i),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return r.set(e,s),Gr(s,e,n,r,i),s}if(e instanceof Number){const s=new Number(e.valueOf());return r.set(e,s),Gr(s,e,n,r,i),s}if(e instanceof String){const s=new String(e.valueOf());return r.set(e,s),Gr(s,e,n,r,i),s}if(typeof e=="object"&&DF(e)){const s=Object.create(Object.getPrototypeOf(e));return r.set(e,s),Gr(s,e,n,r,i),s}return e}function Gr(e,t,n=e,r,i){const a=[...Object.keys(t),...mF(t)];for(let s=0;s<a.length;s++){const l=a[s],c=Object.getOwnPropertyDescriptor(e,l);(c==null||c.writable)&&(e[l]=Co(t[l],l,n,r,i))}}function DF(e){switch(h0(e)){case WA:case jF:case wF:case kF:case UA:case yF:case NF:case _F:case AF:case OF:case IF:case xF:case FA:case SF:case gF:case bF:case BA:case vF:case CF:case PF:case EF:case TF:return!0;default:return!1}}function LF(e){return Co(e,void 0,e,new Map,void 0)}function Jd(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function KA(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function HA(e,t,n){return typeof n!="function"?HA(e,t,()=>{}):Gv(e,t,function r(i,a,s,l,c,u){const p=n(i,a,s,l,c,u);return p!==void 0?!!p:Gv(i,a,r,u,!1)},new Map,!0)}function Gv(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case"object":return zF(e,t,n,r);case"function":return Object.keys(t).length>0?Gv(e,{...t},n,r,i):Jd(e,t);default:return KA(e)&&i?typeof t=="string"?t==="":!0:Jd(e,t)}}function zF(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return VA(e,t,n,r);if(t instanceof Map)return $F(e,t,n,r);if(t instanceof Set)return BF(e,t,n,r);const i=Object.keys(t);if(e==null||Yv(e))return i.length===0;if(i.length===0)return!0;if(r!=null&&r.has(t))return r.get(t)===e;r==null||r.set(t,e);try{for(let a=0;a<i.length;a++){const s=i[a];if(!Yv(e)&&!(s in e)||t[s]===void 0&&e[s]!==void 0||t[s]===null&&e[s]!==null||!n(e[s],t[s],s,e,t,r))return!1}return!0}finally{r==null||r.delete(t)}}function $F(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(const[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function VA(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;const i=new Set;for(let a=0;a<t.length;a++){const s=t[a];let l=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;const u=e[c];let p=!1;if(n(u,s,a,e,t,r)&&(p=!0),p){i.add(c),l=!0;break}}if(!l)return!1}return!0}function BF(e,t,n,r){return t.size===0?!0:e instanceof Set?VA([...e],[...t],n,r):!1}function qA(e,t){return HA(e,t,()=>{})}function FF(e){return e=LF(e),t=>qA(t,e)}function UF(e,t){return RF(e,(n,r,i,a)=>{if(typeof e=="object"){if(h0(e)==="[object Object]"&&typeof e.constructor!="function"){const s={};return a.set(e,s),Gr(s,e,i,a),s}switch(Object.prototype.toString.call(e)){case FA:case BA:case UA:{const s=new e.constructor(e==null?void 0:e.valueOf());return Gr(s,e),s}case WA:{const s={};return Gr(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}function WF(e){return UF(e)}const KF=/^(?:0|[1-9]\d*)$/;function YA(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return KF.test(e)}}function HF(e){return e!==null&&typeof e=="object"&&h0(e)==="[object Arguments]"}function VF(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&NA(t)&&(e==null?void 0:e[t])==null?n=d0(t):n=[t],n.length===0)return!1;let r=e;for(let i=0;i<n.length;i++){const a=n[i];if((r==null||!Object.hasOwn(r,a))&&!((Array.isArray(r)||HF(r))&&YA(a)&&a<r.length))return!1;r=r[a]}return!0}function qF(e,t){switch(typeof e){case"object":Object.is(e==null?void 0:e.valueOf(),-0)&&(e="-0");break;case"number":e=u0(e);break}return t=WF(t),function(n){const r=Ei(n,e);return r===void 0?VF(n,e):t===void 0?r===void 0:qA(r,t)}}function YF(e){if(e==null)return $A;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?qF(e[0],e[1]):FF(e);case"string":case"symbol":case"number":return fF(e)}}function GF(e){return Number.isSafeInteger(e)&&e>=0}function GA(e){return e!=null&&typeof e!="function"&&GF(e.length)}function XF(e){return typeof e=="object"&&e!==null}function QF(e){return XF(e)&&GA(e)}function Zw(e,t=$A){return QF(e)?dF(Array.from(e),pF(YF(t),1)):[]}function XA(e,t,n){return t===!0?Zw(e,n):typeof t=="function"?Zw(e,t):e}var QA={exports:{}},JA={},ZA={exports:{}},eO={};/**
|
|
406
|
-
* @license React
|
|
407
|
-
* use-sync-external-store-shim.production.js
|
|
408
|
-
*
|
|
409
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
410
|
-
*
|
|
411
|
-
* This source code is licensed under the MIT license found in the
|
|
412
|
-
* LICENSE file in the root directory of this source tree.
|
|
413
|
-
*/var al=f;function JF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ZF=typeof Object.is=="function"?Object.is:JF,eU=al.useState,tU=al.useEffect,nU=al.useLayoutEffect,rU=al.useDebugValue;function iU(e,t){var n=t(),r=eU({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return nU(function(){i.value=n,i.getSnapshot=t,tg(i)&&a({inst:i})},[e,n,t]),tU(function(){return tg(i)&&a({inst:i}),e(function(){tg(i)&&a({inst:i})})},[e]),rU(n),n}function tg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ZF(e,n)}catch{return!0}}function aU(e,t){return t()}var oU=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?aU:iU;eO.useSyncExternalStore=al.useSyncExternalStore!==void 0?al.useSyncExternalStore:oU;ZA.exports=eO;var sU=ZA.exports;/**
|
|
414
|
-
* @license React
|
|
415
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
416
|
-
*
|
|
417
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
418
|
-
*
|
|
419
|
-
* This source code is licensed under the MIT license found in the
|
|
420
|
-
* LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/var lh=f,lU=sU;function cU(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uU=typeof Object.is=="function"?Object.is:cU,dU=lU.useSyncExternalStore,pU=lh.useRef,fU=lh.useEffect,hU=lh.useMemo,mU=lh.useDebugValue;JA.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=pU(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=hU(function(){function c(m){if(!u){if(u=!0,p=m,m=r(m),i!==void 0&&s.hasValue){var g=s.value;if(i(g,m))return d=g}return d=m}if(g=d,uU(p,m))return g;var y=r(m);return i!==void 0&&i(g,y)?(p=m,g):(p=m,d=y)}var u=!1,p,d,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var l=dU(e,a[0],a[1]);return fU(function(){s.hasValue=!0,s.value=l},[l]),mU(l),l};QA.exports=JA;var gU=QA.exports,m0=f.createContext(null),vU=e=>e,wt=()=>{var e=f.useContext(m0);return e?e.store.dispatch:vU},Zd=()=>{},yU=()=>Zd,xU=(e,t)=>e===t;function Ne(e){var t=f.useContext(m0),n=f.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Zd,[t,e]);return gU.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:yU,t?t.store.getState:Zd,t?t.store.getState:Zd,n,xU)}function bU(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function jU(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function wU(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var eS=e=>Array.isArray(e)?e:[e];function SU(e){const t=Array.isArray(e[0])?e[0]:e;return wU(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function kU(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var CU=class{constructor(e){this.value=e}deref(){return this.value}},PU=typeof WeakRef<"u"?WeakRef:CU,EU=0,tS=1;function bd(){return{s:EU,v:void 0,o:null,p:null}}function tO(e,t={}){let n=bd();const{resultEqualityCheck:r}=t;let i,a=0;function s(){var d;let l=n;const{length:c}=arguments;for(let h=0,m=c;h<m;h++){const g=arguments[h];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=l.o;y===null&&(l.o=y=new WeakMap);const x=y.get(g);x===void 0?(l=bd(),y.set(g,l)):l=x}else{let y=l.p;y===null&&(l.p=y=new Map);const x=y.get(g);x===void 0?(l=bd(),y.set(g,l)):l=x}}const u=l;let p;if(l.s===tS)p=l.v;else if(p=e.apply(null,arguments),a++,r){const h=((d=i==null?void 0:i.deref)==null?void 0:d.call(i))??i;h!=null&&r(h,p)&&(p=h,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new PU(p):p}return u.s=tS,u.v=p,p}return s.clearCache=()=>{n=bd(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function TU(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,s=0,l,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),bU(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const p={...n,...c},{memoize:d,memoizeOptions:h=[],argsMemoize:m=tO,argsMemoizeOptions:g=[]}=p,y=eS(h),x=eS(g),v=SU(i),b=d(function(){return a++,u.apply(null,arguments)},...y),j=m(function(){s++;const k=kU(v,arguments);return l=b.apply(null,k),l},...x);return Object.assign(j,{resultFunc:u,memoizedResultFunc:b,dependencies:v,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var q=TU(tO),AU=Object.assign((e,t=q)=>{jU(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((s,l,c)=>(s[n[c]]=l,s),{}))},{withTypes:()=>AU});function OU(e,t=1){const n=[],r=Math.floor(t),i=(a,s)=>{for(let l=0;l<a.length;l++){const c=a[l];Array.isArray(c)&&s<r?i(c,s+1):n.push(c)}};return i(e,0),n}function Xv(e,t,n){return KA(n)&&(typeof t=="number"&&GA(n)&&YA(t)&&t<n.length||typeof t=="string"&&t in n)?Jd(n[t],e):!1}function nS(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const IU=(e,t,n)=>{if(e!==t){const r=nS(e),i=nS(t);if(r===i&&r===0){if(e<t)return n==="desc"?1:-1;if(e>t)return n==="desc"?-1:1}return n==="desc"?i-r:r-i}return 0};function nO(e){return typeof e=="symbol"||e instanceof Symbol}const NU=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_U=/^\w*$/;function MU(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||nO(e)?!0:typeof e=="string"&&(_U.test(e)||!NU.test(e))||t!=null}function RU(e,t,n,r){if(e==null)return[];n=n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(l=>String(l));const i=(l,c)=>{let u=l;for(let p=0;p<c.length&&u!=null;++p)u=u[c[p]];return u},a=(l,c)=>c==null||l==null?c:typeof l=="object"&&"key"in l?Object.hasOwn(c,l.key)?c[l.key]:i(c,l.path):typeof l=="function"?l(c):Array.isArray(l)?i(c,l):typeof c=="object"?c[l]:c,s=t.map(l=>(Array.isArray(l)&&l.length===1&&(l=l[0]),l==null||typeof l=="function"||Array.isArray(l)||MU(l)?l:{key:l,path:d0(l)}));return e.map(l=>({original:l,criteria:s.map(c=>a(c,l))})).slice().sort((l,c)=>{for(let u=0;u<s.length;u++){const p=IU(l.criteria[u],c.criteria[u],n[u]);if(p!==0)return p}return 0}).map(l=>l.original)}function ch(e,...t){const n=t.length;return n>1&&Xv(e,t[0],t[1])?t=[]:n>2&&Xv(t[0],t[1],t[2])&&(t=[t[0]]),RU(e,OU(t),["asc"])}var rO=e=>e.legend.settings,DU=e=>e.legend.size,LU=e=>e.legend.payload,zU=q([LU,rO],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?ch(r,n):r});function $U(){return Ne(zU)}var jd=1;function iO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=f.useState({height:0,left:0,top:0,width:0}),r=f.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),s={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(s.height-t.height)>jd||Math.abs(s.left-t.left)>jd||Math.abs(s.top-t.top)>jd||Math.abs(s.width-t.width)>jd)&&n({height:s.height,left:s.left,top:s.top,width:s.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Pn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var BU=typeof Symbol=="function"&&Symbol.observable||"@@observable",rS=BU,ng=()=>Math.random().toString(36).substring(7).split("").join("."),FU={INIT:`@@redux/INIT${ng()}`,REPLACE:`@@redux/REPLACE${ng()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ng()}`},Fp=FU;function g0(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function aO(e,t,n){if(typeof e!="function")throw new Error(Pn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Pn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Pn(1));return n(aO)(e,t)}let r=e,i=t,a=new Map,s=a,l=0,c=!1;function u(){s===a&&(s=new Map,a.forEach((x,v)=>{s.set(v,x)}))}function p(){if(c)throw new Error(Pn(3));return i}function d(x){if(typeof x!="function")throw new Error(Pn(4));if(c)throw new Error(Pn(5));let v=!0;u();const b=l++;return s.set(b,x),function(){if(v){if(c)throw new Error(Pn(6));v=!1,u(),s.delete(b),a=null}}}function h(x){if(!g0(x))throw new Error(Pn(7));if(typeof x.type>"u")throw new Error(Pn(8));if(typeof x.type!="string")throw new Error(Pn(17));if(c)throw new Error(Pn(9));try{c=!0,i=r(i,x)}finally{c=!1}return(a=s).forEach(b=>{b()}),x}function m(x){if(typeof x!="function")throw new Error(Pn(10));r=x,h({type:Fp.REPLACE})}function g(){const x=d;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(Pn(11));function b(){const w=v;w.next&&w.next(p())}return b(),{unsubscribe:x(b)}},[rS](){return this}}}return h({type:Fp.INIT}),{dispatch:h,subscribe:d,getState:p,replaceReducer:m,[rS]:g}}function UU(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Fp.INIT})>"u")throw new Error(Pn(12));if(typeof n(void 0,{type:Fp.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pn(13))})}function oO(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const s=t[a];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{UU(n)}catch(a){i=a}return function(s={},l){if(i)throw i;let c=!1;const u={};for(let p=0;p<r.length;p++){const d=r[p],h=n[d],m=s[d],g=h(m,l);if(typeof g>"u")throw l&&l.type,new Error(Pn(14));u[d]=g,c=c||g!==m}return c=c||r.length!==Object.keys(s).length,c?u:s}}function Up(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function WU(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Pn(15))};const s={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},l=e.map(c=>c(s));return a=Up(...l)(i.dispatch),{...i,dispatch:a}}}function sO(e){return g0(e)&&"type"in e&&typeof e.type=="string"}var lO=Symbol.for("immer-nothing"),iS=Symbol.for("immer-draftable"),Qn=Symbol.for("immer-state");function Jr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var vr=Object,ol=vr.getPrototypeOf,Wp="constructor",uh="prototype",Qv="configurable",Kp="enumerable",ep="writable",Gc="value",ea=e=>!!e&&!!e[Qn];function ai(e){var t;return e?cO(e)||ph(e)||!!e[iS]||!!((t=e[Wp])!=null&&t[iS])||fh(e)||hh(e):!1}var KU=vr[uh][Wp].toString(),aS=new WeakMap;function cO(e){if(!e||!v0(e))return!1;const t=ol(e);if(t===null||t===vr[uh])return!0;const n=vr.hasOwnProperty.call(t,Wp)&&t[Wp];if(n===Object)return!0;if(!gs(n))return!1;let r=aS.get(n);return r===void 0&&(r=Function.toString.call(n),aS.set(n,r)),r===KU}function dh(e,t,n=!0){Su(e)===0?(n?Reflect.ownKeys(e):vr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Su(e){const t=e[Qn];return t?t.type_:ph(e)?1:fh(e)?2:hh(e)?3:0}var oS=(e,t,n=Su(e))=>n===2?e.has(t):vr[uh].hasOwnProperty.call(e,t),Jv=(e,t,n=Su(e))=>n===2?e.get(t):e[t],Hp=(e,t,n,r=Su(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function HU(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ph=Array.isArray,fh=e=>e instanceof Map,hh=e=>e instanceof Set,v0=e=>typeof e=="object",gs=e=>typeof e=="function",rg=e=>typeof e=="boolean";function VU(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Fi=e=>e.copy_||e.base_,y0=e=>e.modified_?e.copy_:e.base_;function Zv(e,t){if(fh(e))return new Map(e);if(hh(e))return new Set(e);if(ph(e))return Array[uh].slice.call(e);const n=cO(e);if(t===!0||t==="class_only"&&!n){const r=vr.getOwnPropertyDescriptors(e);delete r[Qn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],l=r[s];l[ep]===!1&&(l[ep]=!0,l[Qv]=!0),(l.get||l.set)&&(r[s]={[Qv]:!0,[ep]:!0,[Kp]:l[Kp],[Gc]:e[s]})}return vr.create(ol(e),r)}else{const r=ol(e);if(r!==null&&n)return{...e};const i=vr.create(r);return vr.assign(i,e)}}function x0(e,t=!1){return mh(e)||ea(e)||!ai(e)||(Su(e)>1&&vr.defineProperties(e,{set:wd,add:wd,clear:wd,delete:wd}),vr.freeze(e),t&&dh(e,(n,r)=>{x0(r,!0)},!1)),e}function qU(){Jr(2)}var wd={[Gc]:qU};function mh(e){return e===null||!v0(e)?!0:vr.isFrozen(e)}var Vp="MapSet",ey="Patches",sS="ArrayMethods",uO={};function Ho(e){const t=uO[e];return t||Jr(0,e),t}var lS=e=>!!uO[e],Xc,dO=()=>Xc,YU=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:lS(Vp)?Ho(Vp):void 0,arrayMethodsPlugin_:lS(sS)?Ho(sS):void 0});function cS(e,t){t&&(e.patchPlugin_=Ho(ey),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ty(e){ny(e),e.drafts_.forEach(GU),e.drafts_=null}function ny(e){e===Xc&&(Xc=e.parent_)}var uS=e=>Xc=YU(Xc,e);function GU(e){const t=e[Qn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function dS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Qn].modified_&&(ty(t),Jr(4)),ai(e)&&(e=pS(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Qn].base_,e,t)}else e=pS(t,n);return XU(t,e,!0),ty(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==lO?e:void 0}function pS(e,t){if(mh(t))return t;const n=t[Qn];if(!n)return qp(t,e.handledSet_,e);if(!gh(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);hO(n,e)}return n.copy_}function XU(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&x0(t,n)}function pO(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var gh=(e,t)=>e.scope_===t,QU=[];function fO(e,t,n,r){const i=Fi(e),a=e.type_;if(r!==void 0&&Jv(i,r,a)===t){Hp(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;dh(i,(c,u)=>{if(ea(u)){const p=l.get(u)||[];p.push(c),l.set(u,p)}})}const s=e.draftLocations_.get(t)??QU;for(const l of s)Hp(i,l,n,a)}function JU(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!gh(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const s=y0(a);fO(e,a.draft_??a,s,n),hO(a,i)})}function hO(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}pO(e)}}function ZU(e,t,n){const{scope_:r}=e;if(ea(n)){const i=n[Qn];gh(i,r)&&i.callbacks_.push(function(){tp(e);const s=y0(i);fO(e,n,s,t)})}else ai(n)&&e.callbacks_.push(function(){const a=Fi(e);e.type_===3?a.has(n)&&qp(n,r.handledSet_,r):Jv(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&qp(Jv(e.copy_,t,e.type_),r.handledSet_,r)})}function qp(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ea(e)||t.has(e)||!ai(e)||mh(e)||(t.add(e),dh(e,(r,i)=>{if(ea(i)){const a=i[Qn];if(gh(a,n)){const s=y0(a);Hp(e,r,s,e.type_),pO(a)}}else ai(i)&&qp(i,t,n)})),e}function eW(e,t){const n=ph(e),r={type_:n?1:0,scope_:t?t.scope_:dO(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Yp;n&&(i=[r],a=Qc);const{revoke:s,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=s,[l,r]}var Yp={get(e,t){if(t===Qn)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=Fi(e);if(!oS(i,t,e.type_))return tW(e,i,t);const a=i[t];if(e.finalized_||!ai(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&VU(t))return a;if(a===ig(e.base_,t)){tp(e);const s=e.type_===1?+t:t,l=iy(e.scope_,a,e,s);return e.copy_[s]=l}return a},has(e,t){return t in Fi(e)},ownKeys(e){return Reflect.ownKeys(Fi(e))},set(e,t,n){const r=mO(Fi(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ig(Fi(e),t),a=i==null?void 0:i[Qn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(HU(n,i)&&(n!==void 0||oS(e.base_,t,e.type_)))return!0;tp(e),ry(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),ZU(e,t,n)),!0},deleteProperty(e,t){return tp(e),ig(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),ry(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Fi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[ep]:!0,[Qv]:e.type_!==1||t!=="length",[Kp]:r[Kp],[Gc]:n[t]}},defineProperty(){Jr(11)},getPrototypeOf(e){return ol(e.base_)},setPrototypeOf(){Jr(12)}},Qc={};for(let e in Yp){let t=Yp[e];Qc[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Qc.deleteProperty=function(e,t){return Qc.set.call(this,e,t,void 0)};Qc.set=function(e,t,n){return Yp.set.call(this,e[0],t,n,e[0])};function ig(e,t){const n=e[Qn];return(n?Fi(n):e)[t]}function tW(e,t,n){var i;const r=mO(t,n);return r?Gc in r?r[Gc]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function mO(e,t){if(!(t in e))return;let n=ol(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ol(n)}}function ry(e){e.modified_||(e.modified_=!0,e.parent_&&ry(e.parent_))}function tp(e){e.copy_||(e.assigned_=new Map,e.copy_=Zv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var nW=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(gs(n)&&!gs(r)){const s=r;r=n;const l=this;return function(u=s,...p){return l.produce(u,d=>r.call(this,d,...p))}}gs(r)||Jr(6),i!==void 0&&!gs(i)&&Jr(7);let a;if(ai(n)){const s=uS(this),l=iy(s,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?ty(s):ny(s)}return cS(s,i),dS(a,s)}else if(!n||!v0(n)){if(a=r(n),a===void 0&&(a=n),a===lO&&(a=void 0),this.autoFreeze_&&x0(a,!0),i){const s=[],l=[];Ho(ey).generateReplacementPatches_(n,a,{patches_:s,inversePatches_:l}),i(s,l)}return a}else Jr(1,n)},this.produceWithPatches=(n,r)=>{if(gs(n))return(l,...c)=>this.produceWithPatches(l,u=>n(u,...c));let i,a;return[this.produce(n,r,(l,c)=>{i=l,a=c}),i,a]},rg(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),rg(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),rg(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){ai(t)||Jr(8),ea(t)&&(t=Rr(t));const n=uS(this),r=iy(n,t,void 0);return r[Qn].isManual_=!0,ny(n),r}finishDraft(t,n){const r=t&&t[Qn];(!r||!r.isManual_)&&Jr(9);const{scope_:i}=r;return cS(i,n),dS(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=Ho(ey).applyPatches_;return ea(t)?i(t,n):this.produce(t,a=>i(a,n))}};function iy(e,t,n,r){const[i,a]=fh(t)?Ho(Vp).proxyMap_(t,n):hh(t)?Ho(Vp).proxySet_(t,n):eW(t,n);return((n==null?void 0:n.scope_)??dO()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?JU(n,a,r):a.callbacks_.push(function(c){var p;(p=c.mapSetPlugin_)==null||p.fixSetContents(a);const{patchPlugin_:u}=c;a.modified_&&u&&u.generatePatches_(a,[],c)}),i}function Rr(e){return ea(e)||Jr(10,e),gO(e)}function gO(e){if(!ai(e)||mh(e))return e;const t=e[Qn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Zv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Zv(e,!0);return dh(n,(i,a)=>{Hp(n,i,gO(a))},r),t&&(t.finalized_=!1),n}var rW=new nW,vO=rW.produce;function yO(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var iW=yO(),aW=yO,oW=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Up:Up.apply(null,arguments)};function jr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(xr(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>sO(r)&&r.type===e,n}var xO=class sc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sc.prototype)}static get[Symbol.species](){return sc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sc(...t[0].concat(this)):new sc(...t.concat(this))}};function fS(e){return ai(e)?vO(e,()=>{}):e}function Sd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function sW(e){return typeof e=="boolean"}var lW=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let s=new xO;return n&&(sW(n)?s.push(iW):s.push(aW(n.extraArgument))),s},bO="RTK_autoBatch",Nt=()=>e=>({payload:e,meta:{[bO]:!0}}),hS=e=>t=>{setTimeout(t,e)},cW=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(s),n())},a=e(i),s=setTimeout(i,t)},jO=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,s=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?cW(window.requestAnimationFrame,100):hS(10):e.type==="callback"?e.queueNotification:hS(e.timeout),u=()=>{s=!1,a&&(a=!1,l.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const d=()=>i&&p(),h=r.subscribe(d);return l.add(p),()=>{h(),l.delete(p)}},dispatch(p){var d;try{return i=!((d=p==null?void 0:p.meta)!=null&&d[bO]),a=!i,a&&(s||(s=!0,c(u))),r.dispatch(p)}finally{i=!0}}})},uW=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new xO(e);return r&&i.push(jO(typeof r=="object"?r:void 0)),i};function dW(e){const t=lW(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(g0(n))l=oO(n);else throw new Error(xr(1));let c;typeof r=="function"?c=r(t):c=t();let u=Up;i&&(u=oW({trace:!1,...typeof i=="object"&&i}));const p=WU(...c),d=uW(p);let h=typeof s=="function"?s(d):d();const m=u(...h);return aO(l,a,m)}function wO(e){const t={},n=[];let r;const i={addCase(a,s){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(xr(28));if(l in t)throw new Error(xr(29));return t[l]=s,i},addAsyncThunk(a,s){return s.pending&&(t[a.pending.type]=s.pending),s.rejected&&(t[a.rejected.type]=s.rejected),s.fulfilled&&(t[a.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:a.settled,reducer:s.settled}),i},addMatcher(a,s){return n.push({matcher:a,reducer:s}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function pW(e){return typeof e=="function"}function fW(e,t){let[n,r,i]=wO(t),a;if(pW(e))a=()=>fS(e());else{const l=fS(e);a=()=>l}function s(l=a(),c){let u=[n[c.type],...r.filter(({matcher:p})=>p(c)).map(({reducer:p})=>p)];return u.filter(p=>!!p).length===0&&(u=[i]),u.reduce((p,d)=>{if(d)if(ea(p)){const m=d(p,c);return m===void 0?p:m}else{if(ai(p))return vO(p,h=>d(h,c));{const h=d(p,c);if(h===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return p},l)}return s.getInitialState=a,s}var hW="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",mW=(e=21)=>{let t="",n=e;for(;n--;)t+=hW[Math.random()*64|0];return t},gW=Symbol.for("rtk-slice-createasyncthunk");function vW(e,t){return`${e}/${t}`}function yW({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[gW];return function(i){const{name:a,reducerPath:s=a}=i;if(!a)throw new Error(xr(11));const l=(typeof i.reducers=="function"?i.reducers(bW()):i.reducers)||{},c=Object.keys(l),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(w,k){const S=typeof w=="string"?w:w.type;if(!S)throw new Error(xr(12));if(S in u.sliceCaseReducersByType)throw new Error(xr(13));return u.sliceCaseReducersByType[S]=k,p},addMatcher(w,k){return u.sliceMatchers.push({matcher:w,reducer:k}),p},exposeAction(w,k){return u.actionCreators[w]=k,p},exposeCaseReducer(w,k){return u.sliceCaseReducersByName[w]=k,p}};c.forEach(w=>{const k=l[w],S={reducerName:w,type:vW(a,w),createNotation:typeof i.reducers=="function"};wW(k)?kW(S,k,p,t):jW(S,k,p)});function d(){const[w={},k=[],S=void 0]=typeof i.extraReducers=="function"?wO(i.extraReducers):[i.extraReducers],E={...w,...u.sliceCaseReducersByType};return fW(i.initialState,A=>{for(let D in E)A.addCase(D,E[D]);for(let D of u.sliceMatchers)A.addMatcher(D.matcher,D.reducer);for(let D of k)A.addMatcher(D.matcher,D.reducer);S&&A.addDefaultCase(S)})}const h=w=>w,m=new Map,g=new WeakMap;let y;function x(w,k){return y||(y=d()),y(w,k)}function v(){return y||(y=d()),y.getInitialState()}function b(w,k=!1){function S(A){let D=A[w];return typeof D>"u"&&k&&(D=Sd(g,S,v)),D}function E(A=h){const D=Sd(m,k,()=>new WeakMap);return Sd(D,A,()=>{const T={};for(const[I,_]of Object.entries(i.selectors??{}))T[I]=xW(_,A,()=>Sd(g,A,v),k);return T})}return{reducerPath:w,getSelectors:E,get selectors(){return E(S)},selectSlice:S}}const j={name:a,reducer:x,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:v,...b(s),injectInto(w,{reducerPath:k,...S}={}){const E=k??s;return w.inject({reducerPath:E,reducer:x},S),{...j,...b(E,!0)}}};return j}}function xW(e,t,n,r){function i(a,...s){let l=t(a);return typeof l>"u"&&r&&(l=n()),e(l,...s)}return i.unwrapped=e,i}var Wn=yW();function bW(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function jW({type:e,reducerName:t,createNotation:n},r,i){let a,s;if("reducer"in r){if(n&&!SW(r))throw new Error(xr(17));a=r.reducer,s=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?jr(e,s):jr(e))}function wW(e){return e._reducerDefinitionType==="asyncThunk"}function SW(e){return e._reducerDefinitionType==="reducerWithPrepare"}function kW({type:e,reducerName:t},n,r,i){if(!i)throw new Error(xr(18));const{payloadCreator:a,fulfilled:s,pending:l,rejected:c,settled:u,options:p}=n,d=i(e,a,p);r.exposeAction(t,d),s&&r.addCase(d.fulfilled,s),l&&r.addCase(d.pending,l),c&&r.addCase(d.rejected,c),u&&r.addMatcher(d.settled,u),r.exposeCaseReducer(t,{fulfilled:s||kd,pending:l||kd,rejected:c||kd,settled:u||kd})}function kd(){}var CW="task",SO="listener",kO="completed",b0="cancelled",PW=`task-${b0}`,EW=`task-${kO}`,ay=`${SO}-${b0}`,TW=`${SO}-${kO}`,vh=class{constructor(e){Gu(this,"code");Gu(this,"name","TaskAbortError");Gu(this,"message");this.code=e,this.message=`${CW} ${b0} (reason: ${e})`}},j0=(e,t)=>{if(typeof e!="function")throw new TypeError(xr(32))},Gp=()=>{},CO=(e,t=Gp)=>(e.catch(t),e),PO=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),_o=e=>{if(e.aborted)throw new vh(e.reason)};function EO(e,t){let n=Gp;return new Promise((r,i)=>{const a=()=>i(new vh(e.reason));if(e.aborted){a();return}n=PO(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Gp})}var AW=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof vh?"cancelled":"rejected",error:n}}finally{t==null||t()}},Xp=e=>t=>CO(EO(e,t).then(n=>(_o(e),n))),TO=e=>{const t=Xp(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Ks}=Object,mS={},yh="listenerMiddleware",OW=(e,t)=>{const n=r=>PO(e,()=>r.abort(e.reason));return(r,i)=>{j0(r);const a=new AbortController;n(a);const s=AW(async()=>{_o(e),_o(a.signal);const l=await r({pause:Xp(a.signal),delay:TO(a.signal),signal:a.signal});return _o(a.signal),l},()=>a.abort(EW));return i!=null&&i.autoJoin&&t.push(s.catch(Gp)),{result:Xp(e)(s),cancel(){a.abort(PW)}}}},IW=(e,t)=>{const n=async(r,i)=>{_o(t);let a=()=>{};const l=[new Promise((c,u)=>{let p=e({predicate:r,effect:(d,h)=>{h.unsubscribe(),c([d,h.getState(),h.getOriginalState()])}});a=()=>{p(),u()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await EO(t,Promise.race(l));return _o(t),c}finally{a()}};return(r,i)=>CO(n(r,i))},AO=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=jr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(xr(21));return j0(a),{predicate:i,type:t,effect:a}},OO=Ks(e=>{const{type:t,predicate:n,effect:r}=AO(e);return{id:mW(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(xr(22))}}},{withTypes:()=>OO}),gS=(e,t)=>{const{type:n,effect:r,predicate:i}=AO(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},oy=e=>{e.pending.forEach(t=>{t.abort(ay)})},NW=(e,t)=>()=>{for(const n of t.keys())oy(n);e.clear()},vS=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},IO=Ks(jr(`${yh}/add`),{withTypes:()=>IO}),_W=jr(`${yh}/removeAll`),NO=Ks(jr(`${yh}/remove`),{withTypes:()=>NO}),MW=(...e)=>{console.error(`${yh}/error`,...e)},ku=(e={})=>{const t=new Map,n=new Map,r=m=>{const g=n.get(m)??0;n.set(m,g+1)},i=m=>{const g=n.get(m)??1;g===1?n.delete(m):n.set(m,g-1)},{extra:a,onError:s=MW}=e;j0(s);const l=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),g=>{m.unsubscribe(),g!=null&&g.cancelActive&&oy(m)}),c=m=>{const g=gS(t,m)??OO(m);return l(g)};Ks(c,{withTypes:()=>c});const u=m=>{const g=gS(t,m);return g&&(g.unsubscribe(),m.cancelActive&&oy(g)),!!g};Ks(u,{withTypes:()=>u});const p=async(m,g,y,x)=>{const v=new AbortController,b=IW(c,v.signal),j=[];try{m.pending.add(v),r(m),await Promise.resolve(m.effect(g,Ks({},y,{getOriginalState:x,condition:(w,k)=>b(w,k).then(Boolean),take:b,delay:TO(v.signal),pause:Xp(v.signal),extra:a,signal:v.signal,fork:OW(v.signal,j),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((w,k,S)=>{w!==v&&(w.abort(ay),S.delete(w))})},cancel:()=>{v.abort(ay),m.pending.delete(v)},throwIfCancelled:()=>{_o(v.signal)}})))}catch(w){w instanceof vh||vS(s,w,{raisedBy:"effect"})}finally{await Promise.all(j),v.abort(TW),i(m),m.pending.delete(v)}},d=NW(t,n);return{middleware:m=>g=>y=>{if(!sO(y))return g(y);if(IO.match(y))return c(y.payload);if(_W.match(y)){d();return}if(NO.match(y))return u(y.payload);let x=m.getState();const v=()=>{if(x===mS)throw new Error(xr(23));return x};let b;try{if(b=g(y),t.size>0){const j=m.getState(),w=Array.from(t.values());for(const k of w){let S=!1;try{S=k.predicate(y,j,x)}catch(E){S=!1,vS(s,E,{raisedBy:"predicate"})}S&&p(k,y,m,v)}}}finally{x=mS}return b},startListening:c,stopListening:u,clearListeners:d}};function xr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var RW={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},_O=Wn({name:"chartLayout",initialState:RW,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:DW,setLayout:LW,setChartSize:zW,setScale:$W}=_O.actions,BW=_O.reducer;function MO(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Je(e){return Number.isFinite(e)}function Ai(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function yS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Is(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yS(Object(n),!0).forEach(function(r){FW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FW(e,t,n){return(t=UW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UW(e){var t=WW(e,"string");return typeof t=="symbol"?t:t+""}function WW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ft(e,t,n){return Rt(e)||Rt(t)?n:Ti(t)?Ei(e,t,n):typeof t=="function"?t(e):n}var KW=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:s,layout:l}=t;if((l==="vertical"||l==="horizontal"&&s==="middle")&&a!=="center"&&Ce(e[a]))return Is(Is({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&s!=="middle"&&Ce(e[s]))return Is(Is({},e),{},{[s]:e[s]+(i||0)})}return e},si=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",RO=(e,t,n,r)=>{if(r)return e.map(l=>l.coordinate);var i,a,s=e.map(l=>(l.coordinate===t&&(i=!0),l.coordinate===n&&(a=!0),l.coordinate));return i||s.push(t),a||s.push(n),s},DO=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:s,realScaleType:l,isCategorical:c,categoricalDomain:u,tickCount:p,ticks:d,niceTicks:h,axisType:m}=e;if(!s)return null;var g=l==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,y=i==="category"&&s.bandwidth?s.bandwidth()/g:0;if(y=m==="angleAxis"&&a&&a.length>=2?xn(a[0]-a[1])*2*y:y,d||h){var x=(d||h||[]).map((v,b)=>{var j=r?r.indexOf(v):v,w=s.map(j);return Je(w)?{coordinate:w+y,value:v,offset:y,index:b}:null}).filter(ir);return x}return c&&u?u.map((v,b)=>{var j=s.map(v);return Je(j)?{coordinate:j+y,value:v,index:b,offset:y}:null}).filter(ir):s.ticks&&p!=null?s.ticks(p).map((v,b)=>{var j=s.map(v);return Je(j)?{coordinate:j+y,value:v,index:b,offset:y}:null}).filter(ir):s.domain().map((v,b)=>{var j=s.map(v);return Je(j)?{coordinate:j+y,value:r?r[v]:v,index:b,offset:y}:null}).filter(ir)},HW=(e,t)=>{if(!t||t.length!==2||!Ce(t[0])||!Ce(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Ce(e[0])||e[0]<n)&&(i[0]=n),(!Ce(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},VW=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,s=0,l=0;l<n;++l){var c=e[l],u=c==null?void 0:c[i];if(u!=null){var p=u[1],d=u[0],h=ii(p)?d:p;h>=0?(u[0]=a,a+=h,u[1]=a):(u[0]=s,s+=h,u[1]=s)}}}},qW=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,s=0;s<n;++s){var l=e[s],c=l==null?void 0:l[i];if(c!=null){var u=ii(c[1])?c[0]:c[1];u>=0?(c[0]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},YW={sign:VW,expand:D5,none:Wo,silhouette:L5,wiggle:z5,positive:qW},GW=(e,t,n)=>{var r,i=(r=YW[n])!==null&&r!==void 0?r:Wo,a=R5().keys(t).value((l,c)=>Number(ft(l,c,0))).order(Hv).offset(i),s=a(e);return s.forEach((l,c)=>{l.forEach((u,p)=>{var d=ft(e[p],t[c],0);Array.isArray(d)&&d.length===2&&Ce(d[0])&&Ce(d[1])&&(u[0]=d[0],u[1]=d[1])})}),s};function LO(e){return e==null?void 0:String(e)}function Qp(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:s}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Rt(i[t.dataKey])){var l=RA(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=ft(i,Rt(s)?t.dataKey:s),u=t.scale.map(c);return Ce(u)?u:null}var xS=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:s}=e;if(t.type==="category")return n[s]?n[s].coordinate+r:null;var l=ft(a,t.dataKey,t.scale.domain()[s]);if(Rt(l))return null;var c=t.scale.map(l);return Ce(c)?c-i/2+r:null},XW=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},QW=e=>{var t=e.flat(2).filter(Ce);return[Math.min(...t),Math.max(...t)]},JW=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],ZW=(e,t,n)=>{if(e!=null)return JW(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:s}=a,l=s.reduce((c,u)=>{var p=MO(u,t,n),d=QW(p);return!Je(d[0])||!Je(d[1])?c:[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},bS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,jS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Wa=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=ch(t,p=>p.coordinate),a=1/0,s=1,l=i.length;s<l;s++){var c=i[s],u=i[s-1];a=Math.min(((c==null?void 0:c.coordinate)||0)-((u==null?void 0:u.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function wS(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Is(Is({},t),{},{dataKey:n,payload:r,value:i,name:a})}function Ja(e,t){if(e)return String(e);if(typeof t=="string")return t}var eK=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},tK=(e,t)=>t==="centric"?e.angle:e.radius,sa=e=>e.layout.width,la=e=>e.layout.height,nK=e=>e.layout.scale,zO=e=>e.layout.margin,xh=q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),bh=q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),$O="data-recharts-item-index",BO="data-recharts-item-id",Cu=60;function SS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SS(Object(n),!0).forEach(function(r){rK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rK(e,t,n){return(t=iK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iK(e){var t=aK(e,"string");return typeof t=="symbol"?t:t+""}function aK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oK=e=>e.brush.height;function sK(e){var t=bh(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Cu;return n+i}return n},0)}function lK(e){var t=bh(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Cu;return n+i}return n},0)}function cK(e){var t=xh(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function uK(e){var t=xh(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var fn=q([sa,la,zO,oK,sK,lK,cK,uK,rO,DU],(e,t,n,r,i,a,s,l,c,u)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},d={top:(n.top||0)+s,bottom:(n.bottom||0)+l},h=Cd(Cd({},d),p),m=h.bottom;h.bottom+=r,h=KW(h,c,u);var g=e-h.left-h.right,y=t-h.top-h.bottom;return Cd(Cd({brushBottom:m},h),{},{width:Math.max(g,0),height:Math.max(y,0)})}),dK=q(fn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),w0=q(sa,la,(e,t)=>({x:0,y:0,width:e,height:t})),pK=f.createContext(null),jn=()=>f.useContext(pK)!=null,jh=e=>e.brush,wh=q([jh,fn,zO],(e,t,n)=>({height:e.height,x:Ce(e.x)?e.x:t.left,y:Ce(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Ce(e.width)?e.width:t.width}));function fK(e,t,{signal:n,edges:r}={}){let i,a=null;const s=r!=null&&r.includes("leading"),l=r==null||r.includes("trailing"),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},u=()=>{l&&c(),m()};let p=null;const d=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,u()},t)},h=()=>{p!==null&&(clearTimeout(p),p=null)},m=()=>{h(),i=void 0,a=null},g=()=>{c()},y=function(...x){if(n!=null&&n.aborted)return;i=this,a=x;const v=p==null;d(),s&&v&&c()};return y.schedule=d,y.cancel=m,y.flush=g,n==null||n.addEventListener("abort",m,{once:!0}),y}function hK(e,t=0,n={}){typeof n!="object"&&(n={});const{leading:r=!1,trailing:i=!0,maxWait:a}=n,s=Array(2);r&&(s[0]="leading"),i&&(s[1]="trailing");let l,c=null;const u=fK(function(...h){l=e.apply(this,h),c=null},t,{edges:s}),p=function(...h){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(l=e.apply(this,h),c=Date.now(),u.cancel(),u.schedule(),l):(u.apply(this,h),l)},d=()=>(u.flush(),l);return p.cancel=u.cancel,p.flush=d,p}function mK(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return hK(e,t,{leading:r,maxWait:t,trailing:i})}var Jp=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(n.replace(/%s/g,()=>i[s++]))}},bi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},FO=(e,t,n)=>{var{width:r=bi.width,height:i=bi.height,aspect:a,maxHeight:s}=n,l=Ko(r)?e:Number(r),c=Ko(i)?t:Number(i);return a&&a>0&&(l?c=l/a:c&&(l=c*a),s&&c!=null&&c>s&&(c=s)),{calculatedWidth:l,calculatedHeight:c}},gK={width:0,height:0,overflow:"visible"},vK={width:0,overflowX:"visible"},yK={height:0,overflowY:"visible"},xK={},bK=e=>{var{width:t,height:n}=e,r=Ko(t),i=Ko(n);return r&&i?gK:r?vK:i?yK:xK};function jK(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=bi.width,a=bi.height):i===void 0?i=r&&r>0?void 0:bi.width:a===void 0&&(a=r&&r>0?void 0:bi.height),{width:i,height:a}}function sy(){return sy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sy.apply(null,arguments)}function kS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kS(Object(n),!0).forEach(function(r){wK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wK(e,t,n){return(t=SK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SK(e){var t=kK(e,"string");return typeof t=="symbol"?t:t+""}function kK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var UO=f.createContext(bi.initialDimension);function CK(e){return Ai(e.width)&&Ai(e.height)}function WO(e){var{children:t,width:n,height:r}=e,i=f.useMemo(()=>({width:n,height:r}),[n,r]);return CK(i)?f.createElement(UO.Provider,{value:i},t):null}var S0=()=>f.useContext(UO),PK=f.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=bi.initialDimension,width:i,height:a,minWidth:s=bi.minWidth,minHeight:l,maxHeight:c,children:u,debounce:p=bi.debounce,id:d,className:h,onResize:m,style:g={}}=e,y=f.useRef(null),x=f.useRef();x.current=m,f.useImperativeHandle(t,()=>y.current);var[v,b]=f.useState({containerWidth:r.width,containerHeight:r.height}),j=f.useCallback((A,D)=>{b(T=>{var I=Math.round(A),_=Math.round(D);return T.containerWidth===I&&T.containerHeight===_?T:{containerWidth:I,containerHeight:_}})},[]);f.useEffect(()=>{if(y.current==null||typeof ResizeObserver>"u")return Qa;var A=_=>{var G,K=_[0];if(K!=null){var{width:O,height:B}=K.contentRect;j(O,B),(G=x.current)===null||G===void 0||G.call(x,O,B)}};p>0&&(A=mK(A,p,{trailing:!0,leading:!1}));var D=new ResizeObserver(A),{width:T,height:I}=y.current.getBoundingClientRect();return j(T,I),D.observe(y.current),()=>{D.disconnect()}},[j,p]);var{containerWidth:w,containerHeight:k}=v;Jp(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:S,calculatedHeight:E}=FO(w,k,{width:i,height:a,aspect:n,maxHeight:c});return Jp(S!=null&&S>0||E!=null&&E>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
422
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
423
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
424
|
-
height and width.`,S,E,i,a,s,l,n),f.createElement("div",{id:d?"".concat(d):void 0,className:dt("recharts-responsive-container",h),style:CS(CS({},g),{},{width:i,height:a,minWidth:s,minHeight:l,maxHeight:c}),ref:y},f.createElement("div",{style:bK({width:i,height:a})},f.createElement(WO,{width:S,height:E},u)))}),vs=f.forwardRef((e,t)=>{var n=S0();if(Ai(n.width)&&Ai(n.height))return e.children;var{width:r,height:i}=jK({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:s}=FO(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ce(a)&&Ce(s)?f.createElement(WO,{width:a,height:s},e.children):f.createElement(PK,sy({},e,{width:r,height:i,ref:t}))});function k0(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Sh=()=>{var e,t=jn(),n=Ne(dK),r=Ne(wh),i=(e=Ne(jh))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},EK={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},KO=()=>{var e;return(e=Ne(fn))!==null&&e!==void 0?e:EK},C0=()=>Ne(sa),P0=()=>Ne(la),TK=()=>Ne(e=>e.layout.margin),ot=e=>e.layout.layoutType,Za=()=>Ne(ot),E0=()=>{var e=Za();if(e==="horizontal"||e==="vertical")return e},HO=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},AK=()=>{var e=Za();return e!==void 0},Pu=e=>{var t=wt(),n=jn(),{width:r,height:i}=e,a=S0(),s=r,l=i;return a&&(s=a.width>0?a.width:r,l=a.height>0?a.height:i),f.useEffect(()=>{!n&&Ai(s)&&Ai(l)&&t(zW({width:s,height:l}))},[t,n,s,l]),null},VO=Symbol.for("immer-nothing"),PS=Symbol.for("immer-draftable"),wr=Symbol.for("immer-state");function Zr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Jc=Object.getPrototypeOf;function sl(e){return!!e&&!!e[wr]}function Vo(e){var t;return e?qO(e)||Array.isArray(e)||!!e[PS]||!!((t=e.constructor)!=null&&t[PS])||Eu(e)||Ch(e):!1}var OK=Object.prototype.constructor.toString(),ES=new WeakMap;function qO(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=ES.get(n);return r===void 0&&(r=Function.toString.call(n),ES.set(n,r)),r===OK}function Zp(e,t,n=!0){kh(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function kh(e){const t=e[wr];return t?t.type_:Array.isArray(e)?1:Eu(e)?2:Ch(e)?3:0}function ly(e,t){return kh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function YO(e,t,n){const r=kh(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function IK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Eu(e){return e instanceof Map}function Ch(e){return e instanceof Set}function yo(e){return e.copy_||e.base_}function cy(e,t){if(Eu(e))return new Map(e);if(Ch(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=qO(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[wr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],l=r[s];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[s]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[s]})}return Object.create(Jc(e),r)}else{const r=Jc(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function T0(e,t=!1){return Ph(e)||sl(e)||!Vo(e)||(kh(e)>1&&Object.defineProperties(e,{set:Pd,add:Pd,clear:Pd,delete:Pd}),Object.freeze(e),t&&Object.values(e).forEach(n=>T0(n,!0))),e}function NK(){Zr(2)}var Pd={value:NK};function Ph(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var _K={};function qo(e){const t=_K[e];return t||Zr(0,e),t}var Zc;function GO(){return Zc}function MK(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function TS(e,t){t&&(qo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function uy(e){dy(e),e.drafts_.forEach(RK),e.drafts_=null}function dy(e){e===Zc&&(Zc=e.parent_)}function AS(e){return Zc=MK(Zc,e)}function RK(e){const t=e[wr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function OS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[wr].modified_&&(uy(t),Zr(4)),Vo(e)&&(e=ef(t,e),t.parent_||tf(t,e)),t.patches_&&qo("Patches").generateReplacementPatches_(n[wr].base_,e,t.patches_,t.inversePatches_)):e=ef(t,n,[]),uy(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==VO?e:void 0}function ef(e,t,n){if(Ph(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[wr];if(!i)return Zp(t,(a,s)=>IS(e,i,t,a,s,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return tf(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let s=a,l=!1;i.type_===3&&(s=new Set(a),a.clear(),l=!0),Zp(s,(c,u)=>IS(e,i,a,c,u,n,l),r),tf(e,a,!1),n&&e.patches_&&qo("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function IS(e,t,n,r,i,a,s){if(i==null||typeof i!="object"&&!s)return;const l=Ph(i);if(!(l&&!s)){if(sl(i)){const c=a&&t&&t.type_!==3&&!ly(t.assigned_,r)?a.concat(r):void 0,u=ef(e,i,c);if(YO(n,r,u),sl(u))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(Vo(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;ef(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Eu(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&tf(e,i)}}}function tf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&T0(t,n)}function DK(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:GO(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=A0;n&&(i=[r],a=eu);const{revoke:s,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=s,l}var A0={get(e,t){if(t===wr)return e;const n=yo(e);if(!ly(n,t))return LK(e,n,t);const r=n[t];return e.finalized_||!Vo(r)?r:r===ag(e.base_,t)?(og(e),e.copy_[t]=fy(r,e)):r},has(e,t){return t in yo(e)},ownKeys(e){return Reflect.ownKeys(yo(e))},set(e,t,n){const r=XO(yo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ag(yo(e),t),a=i==null?void 0:i[wr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(IK(n,i)&&(n!==void 0||ly(e.base_,t)))return!0;og(e),py(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ag(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,og(e),py(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=yo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Zr(11)},getPrototypeOf(e){return Jc(e.base_)},setPrototypeOf(){Zr(12)}},eu={};Zp(A0,(e,t)=>{eu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});eu.deleteProperty=function(e,t){return eu.set.call(this,e,t,void 0)};eu.set=function(e,t,n){return A0.set.call(this,e[0],t,n,e[0])};function ag(e,t){const n=e[wr];return(n?yo(n):e)[t]}function LK(e,t,n){var i;const r=XO(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function XO(e,t){if(!(t in e))return;let n=Jc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Jc(n)}}function py(e){e.modified_||(e.modified_=!0,e.parent_&&py(e.parent_))}function og(e){e.copy_||(e.copy_=cy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zK=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const s=this;return function(c=a,...u){return s.produce(c,p=>n.call(this,p,...u))}}typeof n!="function"&&Zr(6),r!==void 0&&typeof r!="function"&&Zr(7);let i;if(Vo(t)){const a=AS(this),s=fy(t,void 0);let l=!0;try{i=n(s),l=!1}finally{l?uy(a):dy(a)}return TS(a,r),OS(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===VO&&(i=void 0),this.autoFreeze_&&T0(i,!0),r){const a=[],s=[];qo("Patches").generateReplacementPatches_(t,i,a,s),r(a,s)}return i}else Zr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...l)=>this.produceWithPatches(s,c=>t(c,...l));let r,i;return[this.produce(t,n,(s,l)=>{r=s,i=l}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Vo(e)||Zr(8),sl(e)&&(e=$K(e));const t=AS(this),n=fy(e,void 0);return n[wr].isManual_=!0,dy(t),n}finishDraft(e,t){const n=e&&e[wr];(!n||!n.isManual_)&&Zr(9);const{scope_:r}=n;return TS(r,t),OS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=qo("Patches").applyPatches_;return sl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function fy(e,t){const n=Eu(e)?qo("MapSet").proxyMap_(e,t):Ch(e)?qo("MapSet").proxySet_(e,t):DK(e,t);return(t?t.scope_:GO()).drafts_.push(n),n}function $K(e){return sl(e)||Zr(10,e),QO(e)}function QO(e){if(!Vo(e)||Ph(e))return e;const t=e[wr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cy(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=cy(e,!0);return Zp(n,(i,a)=>{YO(n,i,QO(a))},r),t&&(t.finalized_=!1),n}var BK=new zK;BK.produce;var FK={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},JO=Wn({name:"legend",initialState:FK,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:Nt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Rr(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Nt()},removeLegendPayload:{reducer(e,t){var n=Rr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Nt()}}}),{setLegendSize:NS,setLegendSettings:UK,addLegendPayload:ZO,replaceLegendPayload:eI,removeLegendPayload:tI}=JO.actions,WK=JO.reducer,KK={};/**
|
|
425
|
-
* @license React
|
|
426
|
-
* use-sync-external-store-with-selector.production.js
|
|
427
|
-
*
|
|
428
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
429
|
-
*
|
|
430
|
-
* This source code is licensed under the MIT license found in the
|
|
431
|
-
* LICENSE file in the root directory of this source tree.
|
|
432
|
-
*/var Tu=f;function HK(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var VK=typeof Object.is=="function"?Object.is:HK,qK=Tu.useSyncExternalStore,YK=Tu.useRef,GK=Tu.useEffect,XK=Tu.useMemo,QK=Tu.useDebugValue;KK.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=YK(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=XK(function(){function c(m){if(!u){if(u=!0,p=m,m=r(m),i!==void 0&&s.hasValue){var g=s.value;if(i(g,m))return d=g}return d=m}if(g=d,VK(p,m))return g;var y=r(m);return i!==void 0&&i(g,y)?(p=m,g):(p=m,d=y)}var u=!1,p,d,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,i]);var l=qK(e,a[0],a[1]);return GK(function(){s.hasValue=!0,s.value=l},[l]),QK(l),l};function JK(e){e()}function ZK(){let e=null,t=null;return{clear(){e=null,t=null},notify(){JK(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var _S={notify(){},get:()=>[]};function e9(e,t){let n,r=_S,i=0,a=!1;function s(y){p();const x=r.subscribe(y);let v=!1;return()=>{v||(v=!0,x(),d())}}function l(){r.notify()}function c(){g.onStateChange&&g.onStateChange()}function u(){return a}function p(){i++,n||(n=e.subscribe(c),r=ZK())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=_S)}function h(){a||(a=!0,p())}function m(){a&&(a=!1,d())}const g={addNestedSub:s,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:u,trySubscribe:h,tryUnsubscribe:m,getListeners:()=>r};return g}var t9=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",n9=t9(),r9=()=>typeof navigator<"u"&&navigator.product==="ReactNative",i9=r9(),a9=()=>n9||i9?f.useLayoutEffect:f.useEffect,o9=a9();function MS(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function s9(e,t){if(MS(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!MS(e[n[i]],t[n[i]]))return!1;return!0}var sg=Symbol.for("react-redux-context"),lg=typeof globalThis<"u"?globalThis:{};function l9(){if(!f.createContext)return{};const e=lg[sg]??(lg[sg]=new Map);let t=e.get(f.createContext);return t||(t=f.createContext(null),e.set(f.createContext,t)),t}var c9=l9();function u9(e){const{children:t,context:n,serverState:r,store:i}=e,a=f.useMemo(()=>{const c=e9(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),s=f.useMemo(()=>i.getState(),[i]);o9(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,s]);const l=n||c9;return f.createElement(l.Provider,{value:a},t)}var d9=u9,p9=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function f9(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function ts(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(p9.has(r)){if(e[r]==null&&t[r]==null)continue;if(!s9(e[r],t[r]))return!1}else if(!f9(e[r],t[r]))return!1;return!0}var h9=["contextPayload"];function hy(){return hy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hy.apply(null,arguments)}function RS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ll(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RS(Object(n),!0).forEach(function(r){m9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m9(e,t,n){return(t=g9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g9(e){var t=v9(e,"string");return typeof t=="symbol"?t:t+""}function v9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function y9(e,t){if(e==null)return{};var n,r,i=x9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function x9(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function b9(e){return e.value}function j9(e){var{contextPayload:t}=e,n=y9(e,h9),r=XA(t,e.payloadUniqBy,b9),i=ll(ll({},n),{},{payload:r});return f.isValidElement(e.content)?f.cloneElement(e.content,i):typeof e.content=="function"?f.createElement(e.content,i):f.createElement(uF,i)}function w9(e,t,n,r,i,a){var{layout:s,align:l,verticalAlign:c}=t,u,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l==="center"&&s==="vertical"?u={left:((r||0)-a.width)/2}:u=l==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(c==="middle"?p={top:((i||0)-a.height)/2}:p=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),ll(ll({},u),p)}function S9(e){var t=wt();return f.useEffect(()=>{t(UK(e))},[t,e]),null}function k9(e){var t=wt();return f.useEffect(()=>(t(NS(e)),()=>{t(NS({width:0,height:0}))}),[t,e]),null}function C9(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var P9={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function E9(e){var t=nn(e,P9),n=$U(),r=a5(),i=TK(),{width:a,height:s,wrapperStyle:l,portal:c}=t,[u,p]=iO([n]),d=C0(),h=P0();if(d==null||h==null)return null;var m=d-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),g=C9(t.layout,s,a,m),y=c?l:ll(ll({position:"absolute",width:(g==null?void 0:g.width)||a||"auto",height:(g==null?void 0:g.height)||s||"auto"},w9(l,t,i,d,h,u)),l),x=c??r;if(x==null||n==null)return null;var v=f.createElement("div",{className:"recharts-legend-wrapper",style:y,ref:p},f.createElement(S9,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&f.createElement(k9,{width:u.width,height:u.height}),f.createElement(j9,hy({},t,g,{margin:i,chartWidth:d,chartHeight:h,contextPayload:n})));return mu.createPortal(v,x)}var lc=f.memo(E9,ts);lc.displayName="Legend";function my(){return my=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},my.apply(null,arguments)}function DS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DS(Object(n),!0).forEach(function(r){T9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T9(e,t,n){return(t=A9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A9(e){var t=O9(e,"string");return typeof t=="symbol"?t:t+""}function O9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I9(e){return Array.isArray(e)&&Ti(e[0])&&Ti(e[1])?e.join(" ~ "):e}var ls={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function N9(e,t){return t==null?e:ch(e,t)}var _9=e=>{var{separator:t=ls.separator,contentStyle:n,itemStyle:r,labelStyle:i=ls.labelStyle,payload:a,formatter:s,itemSorter:l,wrapperClassName:c,labelClassName:u,label:p,labelFormatter:d,accessibilityLayer:h=ls.accessibilityLayer}=e,m=()=>{if(a&&a.length){var k={padding:0,margin:0},S=N9(a,l),E=S.map((A,D)=>{if(!A||A.type==="none")return null;var T=A.formatter||s||I9,{value:I,name:_}=A,G=I,K=_;if(T){var O=T(I,_,A,D,a);if(Array.isArray(O))[G,K]=O;else if(O!=null)G=O;else return null}var B=Vl(Vl({},ls.itemStyle),{},{color:A.color||ls.itemStyle.color},r);return f.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:B},Ti(K)?f.createElement("span",{className:"recharts-tooltip-item-name"},K):null,Ti(K)?f.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,f.createElement("span",{className:"recharts-tooltip-item-value"},G),f.createElement("span",{className:"recharts-tooltip-item-unit"},A.unit||""))});return f.createElement("ul",{className:"recharts-tooltip-item-list",style:k},E)}return null},g=Vl(Vl({},ls.contentStyle),n),y=Vl({margin:0},i),x=!Rt(p),v=x?p:"",b=dt("recharts-default-tooltip",c),j=dt("recharts-tooltip-label",u);x&&d&&a!==void 0&&a!==null&&(v=d(p,a));var w=h?{role:"status","aria-live":"assertive"}:{};return f.createElement("div",my({className:b,style:g},w),f.createElement("p",{className:j,style:y},f.isValidElement(v)?v:"".concat(v)),m())},ql="recharts-tooltip-wrapper",M9={visibility:"hidden"};function R9(e){var{coordinate:t,translateX:n,translateY:r}=e;return dt(ql,{["".concat(ql,"-right")]:Ce(n)&&t&&Ce(t.x)&&n>=t.x,["".concat(ql,"-left")]:Ce(n)&&t&&Ce(t.x)&&n<t.x,["".concat(ql,"-bottom")]:Ce(r)&&t&&Ce(t.y)&&r>=t.y,["".concat(ql,"-top")]:Ce(r)&&t&&Ce(t.y)&&r<t.y})}function LS(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:s,tooltipDimension:l,viewBox:c,viewBoxDimension:u}=e;if(a&&Ce(a[r]))return a[r];var p=n[r]-l-(i>0?i:0),d=n[r]+i;if(t[r])return s[r]?p:d;var h=c[r];if(h==null)return 0;if(s[r]){var m=p,g=h;return m<g?Math.max(d,h):Math.max(p,h)}if(u==null)return 0;var y=d+l,x=h+u;return y>x?Math.max(p,h):Math.max(d,h)}function D9(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function L9(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:s,tooltipBox:l,useTranslate3d:c,viewBox:u}=e,p,d,h;return l.height>0&&l.width>0&&n?(d=LS({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:s,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),h=LS({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:s,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),p=D9({translateX:d,translateY:h,useTranslate3d:c})):p=M9,{cssProperties:p,cssClasses:R9({translateX:d,translateY:h,coordinate:n})}}var z9=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Au={isSsr:z9()};function nI(){var[e,t]=f.useState(()=>Au.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return f.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function zS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zS(Object(n),!0).forEach(function(r){$9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $9(e,t,n){return(t=B9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B9(e){var t=F9(e,"string");return typeof t=="symbol"?t:t+""}function F9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function U9(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function W9(e){var t,n,r,i,a,s,l=nI(),[c,u]=f.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));f.useEffect(()=>{var g=y=>{if(y.key==="Escape"){var x,v,b,j;u({dismissed:!0,dismissedAtCoordinate:{x:(x=(v=e.coordinate)===null||v===void 0?void 0:v.x)!==null&&x!==void 0?x:0,y:(b=(j=e.coordinate)===null||j===void 0?void 0:j.y)!==null&&b!==void 0?b:0}})}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),c.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==c.dismissedAtCoordinate.x||((a=(s=e.coordinate)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0)!==c.dismissedAtCoordinate.y)&&u(cs(cs({},c),{},{dismissed:!1}));var{cssClasses:p,cssProperties:d}=L9({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),h=e.hasPortalFromProps?{}:cs(cs({transition:U9({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},d),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),m=cs(cs({},h),{},{visibility:!c.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return f.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:m,ref:e.innerRef},e.children)}var K9=f.memo(W9),rI=()=>{var e;return(e=Ne(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function gy(){return gy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gy.apply(null,arguments)}function $S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$S(Object(n),!0).forEach(function(r){H9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$S(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function H9(e,t,n){return(t=V9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V9(e){var t=q9(e,"string");return typeof t=="symbol"?t:t+""}function q9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var FS={curveBasisClosed:k5,curveBasisOpen:C5,curveBasis:S5,curveBumpX:c5,curveBumpY:u5,curveLinearClosed:P5,curveLinear:oh,curveMonotoneX:E5,curveMonotoneY:T5,curveNatural:A5,curveStep:O5,curveStepAfter:N5,curveStepBefore:I5},nf=e=>Je(e.x)&&Je(e.y),US=e=>e.base!=null&&nf(e.base)&&nf(e),Yl=e=>e.x,Gl=e=>e.y,Y9=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(ju(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=FS["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return FS[n]||oh},WS={connectNulls:!1,type:"linear"},G9=e=>{var{type:t=WS.type,points:n=[],baseLine:r,layout:i,connectNulls:a=WS.connectNulls}=e,s=Y9(t,i),l=a?n.filter(nf):n;if(Array.isArray(r)){var c,u=n.map((g,y)=>BS(BS({},g),{},{base:r[y]}));i==="vertical"?c=xd().y(Gl).x1(Yl).x0(g=>g.base.x):c=xd().x(Yl).y1(Gl).y0(g=>g.base.y);var p=c.defined(US).curve(s),d=a?u.filter(US):u;return p(d)}var h;i==="vertical"&&Ce(r)?h=xd().y(Gl).x1(Yl).x0(r):Ce(r)?h=xd().x(Yl).y1(Gl).y0(r):h=jA().x(Yl).y(Gl);var m=h.defined(nf).curve(s);return m(l)},Hs=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Za();if((!n||!n.length)&&!r)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},l=n&&n.length?G9(s):r;return f.createElement("path",gy({},Xn(e),f0(e),{className:dt("recharts-curve",t),d:l===null?void 0:l,ref:i}))},X9=["x","y","top","left","width","height","className"];function vy(){return vy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vy.apply(null,arguments)}function KS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Q9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KS(Object(n),!0).forEach(function(r){J9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J9(e,t,n){return(t=Z9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z9(e){var t=eH(e,"string");return typeof t=="symbol"?t:t+""}function eH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tH(e,t){if(e==null)return{};var n,r,i=nH(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function nH(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rH=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),iH=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:s=0,className:l}=e,c=tH(e,X9),u=Q9({x:t,y:n,top:r,left:i,width:a,height:s},c);return!Ce(t)||!Ce(n)||!Ce(a)||!Ce(s)||!Ce(r)||!Ce(i)?null:f.createElement("path",vy({},Fn(u),{className:dt("recharts-cross",l),d:rH(t,n,a,s,r,i)}))};function aH(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function HS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function VS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HS(Object(n),!0).forEach(function(r){oH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oH(e,t,n){return(t=sH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sH(e){var t=lH(e,"string");return typeof t=="symbol"?t:t+""}function lH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cH=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),iI=(e,t,n)=>e.map(r=>"".concat(cH(r)," ").concat(t,"ms ").concat(n)).join(","),uH=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),tu=(e,t)=>Object.keys(t).reduce((n,r)=>VS(VS({},n),{},{[r]:e(r,t[r])}),{});function qS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qS(Object(n),!0).forEach(function(r){dH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dH(e,t,n){return(t=pH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pH(e){var t=fH(e,"string");return typeof t=="symbol"?t:t+""}function fH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rf=(e,t,n)=>e+(t-e)*n,yy=e=>{var{from:t,to:n}=e;return t!==n},aI=(e,t,n)=>{var r=tu((i,a)=>{if(yy(a)){var[s,l]=e(a.from,a.to,a.velocity);return dn(dn({},a),{},{from:s,velocity:l})}return a},t);return n<1?tu((i,a)=>yy(a)&&r[i]!=null?dn(dn({},a),{},{velocity:rf(a.velocity,r[i].velocity,n),from:rf(a.from,r[i].from,n)}):a,t):aI(e,r,n-1)};function hH(e,t,n,r,i,a){var s,l=r.reduce((h,m)=>dn(dn({},h),{},{[m]:{from:e[m],velocity:0,to:t[m]}}),{}),c=()=>tu((h,m)=>m.from,l),u=()=>!Object.values(l).filter(yy).length,p=null,d=h=>{s||(s=h);var m=h-s,g=m/n.dt;l=aI(n,l,g),i(dn(dn(dn({},e),t),c())),s=h,u()||(p=a.setTimeout(d))};return()=>(p=a.setTimeout(d),()=>{var h;(h=p)===null||h===void 0||h()})}function mH(e,t,n,r,i,a,s){var l=null,c=i.reduce((d,h)=>{var m=e[h],g=t[h];return m==null||g==null?d:dn(dn({},d),{},{[h]:[m,g]})},{}),u,p=d=>{u||(u=d);var h=(d-u)/r,m=tu((y,x)=>rf(...x,n(h)),c);if(a(dn(dn(dn({},e),t),m)),h<1)l=s.setTimeout(p);else{var g=tu((y,x)=>rf(...x,n(1)),c);a(dn(dn(dn({},e),t),g))}};return()=>(l=s.setTimeout(p),()=>{var d;(d=l)===null||d===void 0||d()})}const gH=(e,t,n,r,i,a)=>{var s=uH(e,t);return n==null?()=>(i(dn(dn({},e),t)),()=>{}):n.isStepper===!0?hH(e,t,n,s,i,a):mH(e,t,n,r,s,i,a)};var af=1e-4,oI=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],sI=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),YS=(e,t)=>n=>{var r=oI(e,t);return sI(r,n)},vH=(e,t)=>n=>{var r=oI(e,t),i=[...r.map((a,s)=>a*s).slice(1),0];return sI(i,n)},yH=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},xH=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=yH(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},bH=(e,t,n,r)=>{var i=YS(e,n),a=YS(t,r),s=vH(e,n),l=u=>u>1?1:u<0?0:u,c=u=>{for(var p=u>1?1:u,d=p,h=0;h<8;++h){var m=i(d)-p,g=s(d);if(Math.abs(m-p)<af||g<af)return a(d);d=l(d-m/g)}return a(d)};return c.isStepper=!1,c},GS=function(){return bH(...xH(...arguments))},jH=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(s,l,c)=>{var u=-(s-l)*n,p=c*r,d=c+(u-p)*i/1e3,h=c*i/1e3+s;return Math.abs(h-l)<af&&Math.abs(d)<af?[l,0]:[h,d]};return a.isStepper=!0,a.dt=i,a},wH=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return GS(e);case"spring":return jH();default:if(e.split("(")[0]==="cubic-bezier")return GS(e)}return typeof e=="function"?e:null};function SH(e){var t,n=()=>null,r=!1,i=null,a=s=>{if(!r){if(Array.isArray(s)){if(!s.length)return;var l=s,[c,...u]=l;if(typeof c=="number"){i=e.setTimeout(a.bind(null,u),c);return}a(c),i=e.setTimeout(a.bind(null,u));return}typeof s=="string"&&(t=s,n(t)),typeof s=="object"&&(t=s,n(t)),typeof s=="function"&&s()}};return{stop:()=>{r=!0},start:s=>{r=!1,i&&(i(),i=null),a(s)},subscribe:s=>(n=s,()=>{n=()=>null}),getTimeoutController:()=>e}}class kH{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=s=>{s-r>=n?t(s):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function CH(){return SH(new kH)}var PH=f.createContext(CH);function EH(e,t){var n=f.useContext(PH);return f.useMemo(()=>t??n(e),[e,t,n])}var TH={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},XS={t:0},cg={t:1};function wl(e){var t=nn(e,TH),{isActive:n,canBegin:r,duration:i,easing:a,begin:s,onAnimationEnd:l,onAnimationStart:c,children:u}=t,p=nI(),d=n==="auto"?!Au.isSsr&&!p:n,h=EH(t.animationId,t.animationManager),[m,g]=f.useState(d?XS:cg),y=f.useRef(null);return f.useEffect(()=>{d||g(cg)},[d]),f.useEffect(()=>{if(!d||!r)return Qa;var x=gH(XS,cg,wH(a),i,g,h.getTimeoutController()),v=()=>{y.current=x()};return h.start([c,s,v,i,l]),()=>{h.stop(),y.current&&y.current(),l()}},[d,r,i,a,s,c,l,h]),u(m.t)}function Sl(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=f.useRef(Yc(t)),r=f.useRef(e);return r.current!==e&&(n.current=Yc(t),r.current=e),n.current}var AH=["radius"],OH=["radius"],QS,JS,ZS,ek,tk,nk,rk,ik,ak,ok;function sk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sk(Object(n),!0).forEach(function(r){IH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IH(e,t,n){return(t=NH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NH(e){var t=_H(e,"string");return typeof t=="symbol"?t:t+""}function _H(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function of(){return of=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},of.apply(null,arguments)}function ck(e,t){if(e==null)return{};var n,r,i=MH(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function MH(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function pi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var uk=(e,t,n,r,i)=>{var a=Aa(n),s=Aa(r),l=Math.min(Math.abs(a)/2,Math.abs(s)/2),c=s>=0?1:-1,u=a>=0?1:-1,p=s>=0&&a>=0||s<0&&a<0?1:0,d;if(l>0&&Array.isArray(i)){for(var h=[0,0,0,0],m=0,g=4;m<g;m++){var y,x=(y=i[m])!==null&&y!==void 0?y:0;h[m]=x>l?l:x}d=Gt(QS||(QS=pi(["M",",",""])),e,t+c*h[0]),h[0]>0&&(d+=Gt(JS||(JS=pi(["A ",",",",0,0,",",",",",""])),h[0],h[0],p,e+u*h[0],t)),d+=Gt(ZS||(ZS=pi(["L ",",",""])),e+n-u*h[1],t),h[1]>0&&(d+=Gt(ek||(ek=pi(["A ",",",",0,0,",`,
|
|
433
|
-
`,",",""])),h[1],h[1],p,e+n,t+c*h[1])),d+=Gt(tk||(tk=pi(["L ",",",""])),e+n,t+r-c*h[2]),h[2]>0&&(d+=Gt(nk||(nk=pi(["A ",",",",0,0,",`,
|
|
434
|
-
`,",",""])),h[2],h[2],p,e+n-u*h[2],t+r)),d+=Gt(rk||(rk=pi(["L ",",",""])),e+u*h[3],t+r),h[3]>0&&(d+=Gt(ik||(ik=pi(["A ",",",",0,0,",`,
|
|
435
|
-
`,",",""])),h[3],h[3],p,e,t+r-c*h[3])),d+="Z"}else if(l>0&&i===+i&&i>0){var v=Math.min(l,i);d=Gt(ak||(ak=pi(["M ",",",`
|
|
436
|
-
A `,",",",0,0,",",",",",`
|
|
437
|
-
L `,",",`
|
|
438
|
-
A `,",",",0,0,",",",",",`
|
|
439
|
-
L `,",",`
|
|
440
|
-
A `,",",",0,0,",",",",",`
|
|
441
|
-
L `,",",`
|
|
442
|
-
A `,",",",0,0,",",",","," Z"])),e,t+c*v,v,v,p,e+u*v,t,e+n-u*v,t,v,v,p,e+n,t+c*v,e+n,t+r-c*v,v,v,p,e+n-u*v,t+r,e+u*v,t+r,v,v,p,e,t+r-c*v)}else d=Gt(ok||(ok=pi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},dk={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},lI=e=>{var t=nn(e,dk),n=f.useRef(null),[r,i]=f.useState(-1);f.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var W=n.current.getTotalLength();W&&i(W)}catch{}},[]);var{x:a,y:s,width:l,height:c,radius:u,className:p}=t,{animationEasing:d,animationDuration:h,animationBegin:m,isAnimationActive:g,isUpdateAnimationActive:y}=t,x=f.useRef(l),v=f.useRef(c),b=f.useRef(a),j=f.useRef(s),w=f.useMemo(()=>({x:a,y:s,width:l,height:c,radius:u}),[a,s,l,c,u]),k=Sl(w,"rectangle-");if(a!==+a||s!==+s||l!==+l||c!==+c||l===0||c===0)return null;var S=dt("recharts-rectangle",p);if(!y){var E=Fn(t),{radius:A}=E,D=ck(E,AH);return f.createElement("path",of({},D,{x:Aa(a),y:Aa(s),width:Aa(l),height:Aa(c),radius:typeof u=="number"?u:void 0,className:S,d:uk(a,s,l,c,u)}))}var T=x.current,I=v.current,_=b.current,G=j.current,K="0px ".concat(r===-1?1:r,"px"),O="".concat(r,"px ").concat(r,"px"),B=iI(["strokeDasharray"],h,typeof d=="string"?d:dk.animationEasing);return f.createElement(wl,{animationId:k,key:k,canBegin:r>0,duration:h,easing:d,isActive:y,begin:m},W=>{var R=yt(T,l,W),$=yt(I,c,W),P=yt(_,a,W),F=yt(G,s,W);n.current&&(x.current=R,v.current=$,b.current=P,j.current=F);var re;g?W>0?re={transition:B,strokeDasharray:O}:re={strokeDasharray:K}:re={strokeDasharray:O};var N=Fn(t),{radius:pe}=N,ve=ck(N,OH);return f.createElement("path",of({},ve,{radius:typeof u=="number"?u:void 0,className:S,d:uk(P,F,R,$,u),ref:n,style:lk(lk({},re),t.style)}))})};function pk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pk(Object(n),!0).forEach(function(r){RH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RH(e,t,n){return(t=DH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DH(e){var t=LH(e,"string");return typeof t=="symbol"?t:t+""}function LH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sf=Math.PI/180,zH=e=>e*180/Math.PI,on=(e,t,n,r)=>({x:e+Math.cos(-sf*r)*n,y:t+Math.sin(-sf*r)*n}),cI=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},$H=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},BH=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,s=$H({x:n,y:r},{x:i,y:a});if(s<=0)return{radius:s,angle:0};var l=(n-i)/s,c=Math.acos(l);return r>a&&(c=2*Math.PI-c),{radius:s,angle:zH(c),angleInRadian:c}},FH=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},UH=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),s=Math.min(i,a);return e+s*360},WH=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=BH({x:n,y:r},t),{innerRadius:s,outerRadius:l}=t;if(i<s||i>l||i===0)return null;var{startAngle:c,endAngle:u}=FH(t),p=a,d;if(c<=u){for(;p>u;)p-=360;for(;p<c;)p+=360;d=p>=c&&p<=u}else{for(;p>c;)p-=360;for(;p<u;)p+=360;d=p>=u&&p<=c}return d?fk(fk({},t),{},{radius:i,angle:UH(p,t)}):null};function uI(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,s=on(t,n,r,i),l=on(t,n,r,a);return{points:[s,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var hk,mk,gk,vk,yk,xk,bk;function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xy.apply(null,arguments)}function Po(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var KH=(e,t)=>{var n=xn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Ed=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:s,cornerRadius:l,cornerIsExternal:c}=e,u=l*(s?1:-1)+r,p=Math.asin(l/u)/sf,d=c?i:i+a*p,h=on(t,n,u,d),m=on(t,n,r,d),g=c?i-a*p:i,y=on(t,n,u*Math.cos(p*sf),g);return{center:h,circleTangency:m,lineTangency:y,theta:p}},dI=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:s}=e,l=KH(a,s),c=a+l,u=on(t,n,i,a),p=on(t,n,i,c),d=Gt(hk||(hk=Po(["M ",",",`
|
|
443
|
-
A `,",",`,0,
|
|
444
|
-
`,",",`,
|
|
445
|
-
`,",",`
|
|
446
|
-
`])),u.x,u.y,i,i,+(Math.abs(l)>180),+(a>c),p.x,p.y);if(r>0){var h=on(t,n,r,a),m=on(t,n,r,c);d+=Gt(mk||(mk=Po(["L ",",",`
|
|
447
|
-
A `,",",`,0,
|
|
448
|
-
`,",",`,
|
|
449
|
-
`,","," Z"])),m.x,m.y,r,r,+(Math.abs(l)>180),+(a<=c),h.x,h.y)}else d+=Gt(gk||(gk=Po(["L ",","," Z"])),t,n);return d},HH=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:s,cornerIsExternal:l,startAngle:c,endAngle:u}=e,p=xn(u-c),{circleTangency:d,lineTangency:h,theta:m}=Ed({cx:t,cy:n,radius:i,angle:c,sign:p,cornerRadius:a,cornerIsExternal:l}),{circleTangency:g,lineTangency:y,theta:x}=Ed({cx:t,cy:n,radius:i,angle:u,sign:-p,cornerRadius:a,cornerIsExternal:l}),v=l?Math.abs(c-u):Math.abs(c-u)-m-x;if(v<0)return s?Gt(vk||(vk=Po(["M ",",",`
|
|
450
|
-
a`,",",",0,0,1,",`,0
|
|
451
|
-
a`,",",",0,0,1,",`,0
|
|
452
|
-
`])),h.x,h.y,a,a,a*2,a,a,-a*2):dI({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var b=Gt(yk||(yk=Po(["M ",",",`
|
|
453
|
-
A`,",",",0,0,",",",",",`
|
|
454
|
-
A`,",",",0,",",",",",",",`
|
|
455
|
-
A`,",",",0,0,",",",",",`
|
|
456
|
-
`])),h.x,h.y,a,a,+(p<0),d.x,d.y,i,i,+(v>180),+(p<0),g.x,g.y,a,a,+(p<0),y.x,y.y);if(r>0){var{circleTangency:j,lineTangency:w,theta:k}=Ed({cx:t,cy:n,radius:r,angle:c,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:S,lineTangency:E,theta:A}=Ed({cx:t,cy:n,radius:r,angle:u,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),D=l?Math.abs(c-u):Math.abs(c-u)-k-A;if(D<0&&a===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=Gt(xk||(xk=Po(["L",",",`
|
|
457
|
-
A`,",",",0,0,",",",",",`
|
|
458
|
-
A`,",",",0,",",",",",",",`
|
|
459
|
-
A`,",",",0,0,",",",",","Z"])),E.x,E.y,a,a,+(p<0),S.x,S.y,r,r,+(D>180),+(p>0),j.x,j.y,a,a,+(p<0),w.x,w.y)}else b+=Gt(bk||(bk=Po(["L",",","Z"])),t,n);return b},VH={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pI=e=>{var t=nn(e,VH),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:s,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:p,className:d}=t;if(a<i||u===p)return null;var h=dt("recharts-sector",d),m=a-i,g=$n(s,m,0,!0),y;return g>0&&Math.abs(u-p)<360?y=HH({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,m/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:p}):y=dI({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:p}),f.createElement("path",xy({},Fn(t),{className:h,d:y}))};function qH(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(LA(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:s,angle:l}=t,c=on(r,i,a,l),u=on(r,i,s,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return uI(t)}}function YH(e){return nO(e)?NaN:Number(e)}function ug(e){return e?(e=YH(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function fI(e,t,n){n&&typeof n!="number"&&Xv(e,t,n)&&(t=n=void 0),e=ug(e),t===void 0?(t=e,e=0):t=ug(t),n=n===void 0?e<t?1:-1:ug(n);const r=Math.max(Math.ceil((t-e)/(n||1)),0),i=new Array(r);for(let a=0;a<r;a++)i[a]=e,e+=n;return i}var li=e=>e.chartData,Ou=q([li],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Iu=(e,t,n,r)=>r?Ou(e):li(e),hI=(e,t,n)=>n?Ou(e):li(e),GH=q([Iu],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),XH=q([Ou],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),QH=q([li],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function ki(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Je(t)&&Je(n))return!0}return!1}function jk(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function mI(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(Je(n))i=n;else if(typeof n=="function")return;if(Je(r))a=r;else if(typeof r=="function")return;var s=[i,a];if(ki(s))return s}}function JH(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(ki(r))return jk(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,s,l;if(i==="auto")t!=null&&(s=Math.min(...t));else if(Ce(i))s=i;else if(typeof i=="function")try{t!=null&&(s=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&bS.test(i)){var c=bS.exec(i);if(c==null||c[1]==null||t==null)s=void 0;else{var u=+c[1];s=t[0]-u}}else s=t==null?void 0:t[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(Ce(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&jS.test(a)){var p=jS.exec(a);if(p==null||p[1]==null||t==null)l=void 0;else{var d=+p[1];l=t[1]+d}}else l=t==null?void 0:t[1];var h=[s,l];if(ki(h))return t==null?h:jk(h,t,n)}}}var kl=1e9,ZH={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},I0,$t=!0,Br="[DecimalError] ",Mo=Br+"Invalid argument: ",O0=Br+"Exponent out of range: ",Cl=Math.floor,xo=Math.pow,e7=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,hr,vn=1e7,_t=7,gI=9007199254740991,lf=Cl(gI/_t),_e={};_e.absoluteValue=_e.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};_e.comparedTo=_e.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};_e.decimalPlaces=_e.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*_t;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};_e.dividedBy=_e.div=function(e){return Yi(this,new this.constructor(e))};_e.dividedToIntegerBy=_e.idiv=function(e){var t=this,n=t.constructor;return Ct(Yi(t,new n(e),0,1),n.precision)};_e.equals=_e.eq=function(e){return!this.cmp(e)};_e.exponent=function(){return sn(this)};_e.greaterThan=_e.gt=function(e){return this.cmp(e)>0};_e.greaterThanOrEqualTo=_e.gte=function(e){return this.cmp(e)>=0};_e.isInteger=_e.isint=function(){return this.e>this.d.length-2};_e.isNegative=_e.isneg=function(){return this.s<0};_e.isPositive=_e.ispos=function(){return this.s>0};_e.isZero=function(){return this.s===0};_e.lessThan=_e.lt=function(e){return this.cmp(e)<0};_e.lessThanOrEqualTo=_e.lte=function(e){return this.cmp(e)<1};_e.logarithm=_e.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(hr))throw Error(Br+"NaN");if(n.s<1)throw Error(Br+(n.s?"NaN":"-Infinity"));return n.eq(hr)?new r(0):($t=!1,t=Yi(nu(n,a),nu(e,a),a),$t=!0,Ct(t,i))};_e.minus=_e.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?xI(t,e):vI(t,(e.s=-e.s,e))};_e.modulo=_e.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Br+"NaN");return n.s?($t=!1,t=Yi(n,e,0,1).times(e),$t=!0,n.minus(t)):Ct(new r(n),i)};_e.naturalExponential=_e.exp=function(){return yI(this)};_e.naturalLogarithm=_e.ln=function(){return nu(this)};_e.negated=_e.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};_e.plus=_e.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vI(t,e):xI(t,(e.s=-e.s,e))};_e.precision=_e.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Mo+e);if(t=sn(i)+1,r=i.d.length-1,n=r*_t+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};_e.squareRoot=_e.sqrt=function(){var e,t,n,r,i,a,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Br+"NaN")}for(e=sn(l),$t=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=ji(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Cl((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(a=r,r=a.plus(Yi(l,a,s+2)).times(.5),ji(a.d).slice(0,s)===(t=ji(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Ct(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;s+=4}return $t=!0,Ct(r,n)};_e.times=_e.mul=function(e){var t,n,r,i,a,s,l,c,u,p=this,d=p.constructor,h=p.d,m=(e=new d(e)).d;if(!p.s||!e.s)return new d(0);for(e.s*=p.s,n=p.e+e.e,c=h.length,u=m.length,c<u&&(a=h,h=m,m=a,s=c,c=u,u=s),a=[],s=c+u,r=s;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+m[r]*h[i-r-1]+t,a[i--]=l%vn|0,t=l/vn|0;a[i]=(a[i]+t)%vn|0}for(;!a[--s];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,$t?Ct(e,d.precision):e};_e.toDecimalPlaces=_e.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Oi(e,0,kl),t===void 0?t=r.rounding:Oi(t,0,8),Ct(n,e+sn(n)+1,t))};_e.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Yo(r,!0):(Oi(e,0,kl),t===void 0?t=i.rounding:Oi(t,0,8),r=Ct(new i(r),e+1,t),n=Yo(r,!0,e+1)),n};_e.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?Yo(i):(Oi(e,0,kl),t===void 0?t=a.rounding:Oi(t,0,8),r=Ct(new a(i),e+sn(i)+1,t),n=Yo(r.abs(),!1,e+sn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};_e.toInteger=_e.toint=function(){var e=this,t=e.constructor;return Ct(new t(e),sn(e)+1,t.rounding)};_e.toNumber=function(){return+this};_e.toPower=_e.pow=function(e){var t,n,r,i,a,s,l=this,c=l.constructor,u=12,p=+(e=new c(e));if(!e.s)return new c(hr);if(l=new c(l),!l.s){if(e.s<1)throw Error(Br+"Infinity");return l}if(l.eq(hr))return l;if(r=c.precision,e.eq(hr))return Ct(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,a=l.s,s){if((n=p<0?-p:p)<=gI){for(i=new c(hr),t=Math.ceil(r/_t+4),$t=!1;n%2&&(i=i.times(l),Sk(i.d,t)),n=Cl(n/2),n!==0;)l=l.times(l),Sk(l.d,t);return $t=!0,e.s<0?new c(hr).div(i):Ct(i,r)}}else if(a<0)throw Error(Br+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,$t=!1,i=e.times(nu(l,r+u)),$t=!0,i=yI(i),i.s=a,i};_e.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=sn(i),r=Yo(i,n<=a.toExpNeg||n>=a.toExpPos)):(Oi(e,1,kl),t===void 0?t=a.rounding:Oi(t,0,8),i=Ct(new a(i),e,t),n=sn(i),r=Yo(i,e<=n||n<=a.toExpNeg,e)),r};_e.toSignificantDigits=_e.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Oi(e,1,kl),t===void 0?t=r.rounding:Oi(t,0,8)),Ct(new r(n),e,t)};_e.toString=_e.valueOf=_e.val=_e.toJSON=_e[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=sn(e),n=e.constructor;return Yo(e,t<=n.toExpNeg||t>=n.toExpPos)};function vI(e,t){var n,r,i,a,s,l,c,u,p=e.constructor,d=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),$t?Ct(t,d):t;if(c=e.d,u=t.d,s=e.e,i=t.e,c=c.slice(),a=s-i,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,i=s,l=c.length),s=Math.ceil(d/_t),l=s>l?s+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/vn|0,c[a]%=vn;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,$t?Ct(t,d):t}function Oi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Mo+e)}function ji(e){var t,n,r,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;t<i;t++)r=e[t]+"",n=_t-r.length,n&&(a+=ja(n)),a+=r;s=e[t],r=s+"",n=_t-r.length,n&&(a+=ja(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var Yi=function(){function e(r,i){var a,s=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+s,r[l]=a%vn|0,s=a/vn|0;return s&&r.unshift(s),r}function t(r,i,a,s){var l,c;if(a!=s)c=a>s?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var s=0;a--;)r[a]-=s,s=r[a]<i[a]?1:0,r[a]=s*vn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,s){var l,c,u,p,d,h,m,g,y,x,v,b,j,w,k,S,E,A,D=r.constructor,T=r.s==i.s?1:-1,I=r.d,_=i.d;if(!r.s)return new D(r);if(!i.s)throw Error(Br+"Division by zero");for(c=r.e-i.e,E=_.length,k=I.length,m=new D(T),g=m.d=[],u=0;_[u]==(I[u]||0);)++u;if(_[u]>(I[u]||0)&&--c,a==null?b=a=D.precision:s?b=a+(sn(r)-sn(i))+1:b=a,b<0)return new D(0);if(b=b/_t+2|0,u=0,E==1)for(p=0,_=_[0],b++;(u<k||p)&&b--;u++)j=p*vn+(I[u]||0),g[u]=j/_|0,p=j%_|0;else{for(p=vn/(_[0]+1)|0,p>1&&(_=e(_,p),I=e(I,p),E=_.length,k=I.length),w=E,y=I.slice(0,E),x=y.length;x<E;)y[x++]=0;A=_.slice(),A.unshift(0),S=_[0],_[1]>=vn/2&&++S;do p=0,l=t(_,y,E,x),l<0?(v=y[0],E!=x&&(v=v*vn+(y[1]||0)),p=v/S|0,p>1?(p>=vn&&(p=vn-1),d=e(_,p),h=d.length,x=y.length,l=t(d,y,h,x),l==1&&(p--,n(d,E<h?A:_,h))):(p==0&&(l=p=1),d=_.slice()),h=d.length,h<x&&d.unshift(0),n(y,d,x),l==-1&&(x=y.length,l=t(_,y,E,x),l<1&&(p++,n(y,E<x?A:_,x))),x=y.length):l===0&&(p++,y=[0]),g[u++]=p,l&&y[0]?y[x++]=I[w]||0:(y=[I[w]],x=1);while((w++<k||y[0]!==void 0)&&b--)}return g[0]||g.shift(),m.e=c,Ct(m,s?a+sn(m)+1:a)}}();function yI(e,t){var n,r,i,a,s,l,c=0,u=0,p=e.constructor,d=p.precision;if(sn(e)>16)throw Error(O0+sn(e));if(!e.s)return new p(hr);for($t=!1,l=d,s=new p(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(xo(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new p(hr),p.precision=l;;){if(i=Ct(i.times(e),l),n=n.times(++c),s=a.plus(Yi(i,n,l)),ji(s.d).slice(0,l)===ji(a.d).slice(0,l)){for(;u--;)a=Ct(a.times(a),l);return p.precision=d,t==null?($t=!0,Ct(a,d)):a}a=s}}function sn(e){for(var t=e.e*_t,n=e.d[0];n>=10;n/=10)t++;return t}function dg(e,t,n){if(t>e.LN10.sd())throw $t=!0,n&&(e.precision=n),Error(Br+"LN10 precision limit exceeded");return Ct(new e(e.LN10),t)}function ja(e){for(var t="";e--;)t+="0";return t}function nu(e,t){var n,r,i,a,s,l,c,u,p,d=1,h=10,m=e,g=m.d,y=m.constructor,x=y.precision;if(m.s<1)throw Error(Br+(m.s?"NaN":"-Infinity"));if(m.eq(hr))return new y(0);if(t==null?($t=!1,u=x):u=t,m.eq(10))return t==null&&($t=!0),dg(y,u);if(u+=h,y.precision=u,n=ji(g),r=n.charAt(0),a=sn(m),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=ji(m.d),r=n.charAt(0),d++;a=sn(m),r>1?(m=new y("0."+n),a++):m=new y(r+"."+n.slice(1))}else return c=dg(y,u+2,x).times(a+""),m=nu(new y(r+"."+n.slice(1)),u-h).plus(c),y.precision=x,t==null?($t=!0,Ct(m,x)):m;for(l=s=m=Yi(m.minus(hr),m.plus(hr),u),p=Ct(m.times(m),u),i=3;;){if(s=Ct(s.times(p),u),c=l.plus(Yi(s,new y(i),u)),ji(c.d).slice(0,u)===ji(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(dg(y,u+2,x).times(a+""))),l=Yi(l,new y(d),u),y.precision=x,t==null?($t=!0,Ct(l,x)):l;l=c,i+=2}}function wk(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Cl(n/_t),e.d=[],r=(n+1)%_t,n<0&&(r+=_t),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=_t;r<i;)e.d.push(+t.slice(r,r+=_t));t=t.slice(r),r=_t-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),$t&&(e.e>lf||e.e<-lf))throw Error(O0+n)}else e.s=0,e.e=0,e.d=[0];return e}function Ct(e,t,n){var r,i,a,s,l,c,u,p,d=e.d;for(s=1,a=d[0];a>=10;a/=10)s++;if(r=t-s,r<0)r+=_t,i=t,u=d[p=0];else{if(p=Math.ceil((r+1)/_t),a=d.length,p>=a)return e;for(u=a=d[p],s=1;a>=10;a/=10)s++;r%=_t,i=r-_t+s}if(n!==void 0&&(a=xo(10,s-i-1),l=u/a%10|0,c=t<0||d[p+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?u/xo(10,s-i):0:d[p-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=sn(e),d.length=1,t=t-a-1,d[0]=xo(10,(_t-t%_t)%_t),e.e=Cl(-t/_t)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(r==0?(d.length=p,a=1,p--):(d.length=p+1,a=xo(10,_t-r),d[p]=i>0?(u/xo(10,s-i)%xo(10,i)|0)*a:0),c)for(;;)if(p==0){(d[0]+=a)==vn&&(d[0]=1,++e.e);break}else{if(d[p]+=a,d[p]!=vn)break;d[p--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if($t&&(e.e>lf||e.e<-lf))throw Error(O0+sn(e));return e}function xI(e,t){var n,r,i,a,s,l,c,u,p,d,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),$t?Ct(t,m):t;if(c=e.d,d=t.d,r=t.e,u=e.e,c=c.slice(),s=u-r,s){for(p=s<0,p?(n=c,s=-s,l=d.length):(n=d,r=u,l=c.length),i=Math.max(Math.ceil(m/_t),l)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=d.length,p=i<l,p&&(l=i),i=0;i<l;i++)if(c[i]!=d[i]){p=c[i]<d[i];break}s=0}for(p&&(n=c,c=d,d=n,t.s=-t.s),l=c.length,i=d.length-l;i>0;--i)c[l++]=0;for(i=d.length;i>s;){if(c[--i]<d[i]){for(a=i;a&&c[--a]===0;)c[a]=vn-1;--c[a],c[i]+=vn}c[i]-=d[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,$t?Ct(t,m):t):new h(0)}function Yo(e,t,n){var r,i=sn(e),a=ji(e.d),s=a.length;return t?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+ja(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ja(-i-1)+a,n&&(r=n-s)>0&&(a+=ja(r))):i>=s?(a+=ja(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+ja(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=ja(r))),e.s<0?"-"+a:a}function Sk(e,t){if(e.length>t)return e.length=t,!0}function bI(e){var t,n,r;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Mo+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return wk(s,a.toString())}else if(typeof a!="string")throw Error(Mo+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,e7.test(a))wk(s,a);else throw Error(Mo+a)}if(i.prototype=_e,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=bI,i.config=i.set=t7,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function t7(e){if(!e||typeof e!="object")throw Error(Br+"Object expected");var t,n,r,i=["precision",1,kl,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Cl(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Mo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Mo+n+": "+r);return this}var I0=bI(ZH);hr=new I0(1);const at=I0;function jI(e){var t;return e===0?t=1:t=Math.floor(new at(e).abs().log(10).toNumber())+1,t}function wI(e,t,n){for(var r=new at(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var SI=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},N0=(e,t,n)=>{if(e.lte(0))return new at(0);var r=jI(e.toNumber()),i=new at(10).pow(r),a=e.div(i),s=r!==1?.05:.1,l=new at(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=l.mul(i);return t?new at(c.toNumber()):new at(Math.ceil(c.toNumber()))},kI=(e,t,n)=>{var r;if(e.lte(0))return new at(0);var i=[1,2,2.5,5],a=e.toNumber(),s=Math.floor(new at(a).abs().log(10).toNumber()),l=new at(10).pow(s),c=e.div(l).toNumber(),u=i.findIndex(m=>m>=c-1e-10);if(u===-1&&(l=l.mul(10),u=0),u+=n,u>=i.length){var p=Math.floor(u/i.length);u%=i.length,l=l.mul(new at(10).pow(p))}var d=(r=i[u])!==null&&r!==void 0?r:1,h=new at(d).mul(l);return t?h:new at(Math.ceil(h.toNumber()))},n7=(e,t,n)=>{var r=new at(1),i=new at(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new at(10).pow(jI(e)-1),i=new at(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new at(Math.floor(e)))}else e===0?i=new at(Math.floor((t-1)/2)):n||(i=new at(Math.floor(e)));for(var s=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new at(c-s).mul(r)).toNumber());return l},CI=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:N0;if(!Number.isFinite((n-t)/(r-1)))return{step:new at(0),tickMin:new at(0),tickMax:new at(0)};var l=s(new at(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new at(0):(c=new at(t).add(n).div(2),c=c.sub(new at(c).mod(l)));var u=Math.ceil(c.sub(t).div(l).toNumber()),p=Math.ceil(new at(n).sub(c).div(l).toNumber()),d=u+p+1;return d>r?CI(t,n,r,i,a+1,s):(d<r&&(p=n>0?p+(r-d):p,u=n>0?u:u+(r-d)),{step:l,tickMin:c.sub(new at(u).mul(l)),tickMax:c.add(new at(p).mul(l))})},kk=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(i,2),[c,u]=SI([n,r]);if(c===-1/0||u===1/0){var p=u===1/0?[c,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),u];return n>r?p.reverse():p}if(c===u)return n7(c,i,a);var d=s==="snap125"?kI:N0,{step:h,tickMin:m,tickMax:g}=CI(c,u,l,a,0,d),y=wI(m,g.add(new at(.1).mul(h)),h);return n>r?y.reverse():y},Ck=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[l,c]=SI([r,i]);if(l===-1/0||c===1/0)return[r,i];if(l===c)return[l];var u=s==="snap125"?kI:N0,p=Math.max(n,2),d=u(new at(c).sub(l).div(p-1),a,0),h=[...wI(new at(l),new at(c),d),c];return a===!1&&(h=h.map(m=>Math.round(m))),r>i?h.reverse():h},PI=e=>e.rootProps.maxBarSize,r7=e=>e.rootProps.barGap,EI=e=>e.rootProps.barCategoryGap,i7=e=>e.rootProps.barSize,Nu=e=>e.rootProps.stackOffset,TI=e=>e.rootProps.reverseStackOrder,_0=e=>e.options.chartName,M0=e=>e.rootProps.syncId,AI=e=>e.rootProps.syncMethod,R0=e=>e.options.eventEmitter,a7=e=>e.rootProps.baseValue,tn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},lo={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},fi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Eh=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Th(e,t,n){if(n!=="auto")return n;if(e!=null)return si(e,t)?"category":"number"}function Pk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pk(Object(n),!0).forEach(function(r){o7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o7(e,t,n){return(t=s7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s7(e){var t=l7(e,"string");return typeof t=="symbol"?t:t+""}function l7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ek={allowDataOverflow:lo.allowDataOverflow,allowDecimals:lo.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:lo.angleAxisId,includeHidden:!1,name:void 0,reversed:lo.reversed,scale:lo.scale,tick:lo.tick,tickCount:void 0,ticks:void 0,type:lo.type,unit:void 0,niceTicks:"auto"},Tk={allowDataOverflow:fi.allowDataOverflow,allowDecimals:fi.allowDecimals,allowDuplicatedCategory:fi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:fi.radiusAxisId,includeHidden:fi.includeHidden,name:void 0,reversed:fi.reversed,scale:fi.scale,tick:fi.tick,tickCount:fi.tickCount,ticks:void 0,type:fi.type,unit:void 0,niceTicks:"auto"},c7=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},D0=q([c7,HO],(e,t)=>{var n;if(e!=null)return e;var r=(n=Th(t,"angleAxis",Ek.type))!==null&&n!==void 0?n:"category";return cf(cf({},Ek),{},{type:r})}),u7=(e,t)=>e.polarAxis.radiusAxis[t],L0=q([u7,HO],(e,t)=>{var n;if(e!=null)return e;var r=(n=Th(t,"radiusAxis",Tk.type))!==null&&n!==void 0?n:"category";return cf(cf({},Tk),{},{type:r})}),Ah=e=>e.polarOptions,z0=q([sa,la,fn],cI),OI=q([Ah,z0],(e,t)=>{if(e!=null)return $n(e.innerRadius,t,0)}),II=q([Ah,z0],(e,t)=>{if(e!=null)return $n(e.outerRadius,t,t*.8)}),d7=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},NI=q([Ah],d7);q([D0,NI],Eh);var _I=q([z0,OI,II],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});q([L0,_I],Eh);var MI=q([ot,Ah,OI,II,sa,la],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:s,cy:l,startAngle:c,endAngle:u}=t;return{cx:$n(s,i,i/2),cy:$n(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),Vt=(e,t)=>t,_u=(e,t,n)=>n;function Oh(e){return e==null?void 0:e.id}function RI(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,s=new Map;return e.forEach(l=>{var c,u=(c=l.data)!==null&&c!==void 0?c:r;if(!(u==null||u.length===0)){var p=Oh(l);u.forEach((d,h)=>{var m=a==null||i?h:String(ft(d,a,null)),g=ft(d,l.dataKey,0),y;s.has(m)?y=s.get(m):y={},Object.assign(y,{[p]:g}),s.set(m,y)})}}),Array.from(s.values())}function Ih(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Nh=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function _h(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function p7(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var wn=e=>{var t=ot(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Pl=e=>e.tooltip.settings.axisId;function $0(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(a){function s(){return a.apply(this,arguments)}return s.toString=function(){return a.toString()},s}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var s=i[0],l=i[1];return s<=l?a>=s&&a<=l:a>=l&&a<=s},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,s)=>{var l=e(a);if(l!=null){if(e.bandwidth&&s!==null&&s!==void 0&&s.position){var c=e.bandwidth();switch(s.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var DI=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ki(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Je(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function $a(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function f7(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function B0(e){let t,n,r;e.length!==2?(t=$a,n=(l,c)=>$a(e(l),c),r=(l,c)=>e(l)-c):(t=e===$a||e===f7?e:h7,n=e,r=e);function i(l,c,u=0,p=l.length){if(u<p){if(t(c,c)!==0)return p;do{const d=u+p>>>1;n(l[d],c)<0?u=d+1:p=d}while(u<p)}return u}function a(l,c,u=0,p=l.length){if(u<p){if(t(c,c)!==0)return p;do{const d=u+p>>>1;n(l[d],c)<=0?u=d+1:p=d}while(u<p)}return u}function s(l,c,u=0,p=l.length){const d=i(l,c,u,p-1);return d>u&&r(l[d-1],c)>-r(l[d],c)?d-1:d}return{left:i,center:s,right:a}}function h7(){return 0}function LI(e){return e===null?NaN:+e}function*m7(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const g7=B0($a),Mu=g7.right;B0(LI).center;class Ak extends Map{constructor(t,n=x7){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(Ok(this,t))}has(t){return super.has(Ok(this,t))}set(t,n){return super.set(v7(this,t),n)}delete(t){return super.delete(y7(this,t))}}function Ok({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function v7({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function y7({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function x7(e){return e!==null&&typeof e=="object"?e.valueOf():e}function b7(e=$a){if(e===$a)return zI;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function zI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const j7=Math.sqrt(50),w7=Math.sqrt(10),S7=Math.sqrt(2);function uf(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=j7?10:a>=w7?5:a>=S7?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/s,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?uf(e,t,n*2):[l,c,u]}function by(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?uf(t,e,n):uf(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)if(s<0)for(let u=0;u<l;++u)c[u]=(a-u)/-s;else for(let u=0;u<l;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(i+u)/-s;else for(let u=0;u<l;++u)c[u]=(i+u)*s;return c}function jy(e,t,n){return t=+t,e=+e,n=+n,uf(e,t,n)[2]}function wy(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?jy(t,e,n):jy(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Ik(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Nk(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function $I(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?zI:b7(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,p=Math.log(c),d=.5*Math.exp(2*p/3),h=.5*Math.sqrt(p*d*(c-d)/c)*(u-c/2<0?-1:1),m=Math.max(n,Math.floor(t-u*d/c+h)),g=Math.min(r,Math.floor(t+(c-u)*d/c+h));$I(e,t,m,g,i)}const a=e[t];let s=n,l=r;for(Xl(e,n,t),i(e[r],a)>0&&Xl(e,n,r);s<l;){for(Xl(e,s,l),++s,--l;i(e[s],a)<0;)++s;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?Xl(e,n,l):(++l,Xl(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Xl(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function k7(e,t,n){if(e=Float64Array.from(m7(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Nk(e);if(t>=1)return Ik(e);var r,i=(r-1)*t,a=Math.floor(i),s=Ik($I(e,a).subarray(0,a+1)),l=Nk(e.subarray(a+1));return s+(l-s)*(i-a)}}function C7(e,t,n=LI){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),s=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return s+(l-s)*(i-a)}}function P7(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Fr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ca(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Sy=Symbol("implicit");function F0(){var e=new Ak,t=[],n=[],r=Sy;function i(a){let s=e.get(a);if(s===void 0){if(r!==Sy)return r;e.set(a,s=t.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new Ak;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return F0(t,n).unknown(r)},Fr.apply(i,arguments),i}function U0(){var e=F0().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,s,l=!1,c=0,u=0,p=.5;delete e.unknown;function d(){var h=t().length,m=i<r,g=m?i:r,y=m?r:i;a=(y-g)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),g+=(y-g-a*(h-c))*p,s=a*(1-c),l&&(g=Math.round(g),s=Math.round(s));var x=P7(h).map(function(v){return g+a*v});return n(m?x.reverse():x)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,l=!0,d()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,d()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),d()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),d()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,d()):u},e.align=function(h){return arguments.length?(p=Math.max(0,Math.min(1,h)),d()):p},e.copy=function(){return U0(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(p)},Fr.apply(d(),arguments)}function BI(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return BI(t())},e}function E7(){return BI(U0.apply(null,arguments).paddingInner(1))}function W0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function FI(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ru(){}var ru=.7,df=1/ru,Vs="\\s*([+-]?\\d+)\\s*",iu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ci="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",T7=/^#([0-9a-f]{3,8})$/,A7=new RegExp(`^rgb\\(${Vs},${Vs},${Vs}\\)$`),O7=new RegExp(`^rgb\\(${Ci},${Ci},${Ci}\\)$`),I7=new RegExp(`^rgba\\(${Vs},${Vs},${Vs},${iu}\\)$`),N7=new RegExp(`^rgba\\(${Ci},${Ci},${Ci},${iu}\\)$`),_7=new RegExp(`^hsl\\(${iu},${Ci},${Ci}\\)$`),M7=new RegExp(`^hsla\\(${iu},${Ci},${Ci},${iu}\\)$`),_k={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};W0(Ru,au,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Mk,formatHex:Mk,formatHex8:R7,formatHsl:D7,formatRgb:Rk,toString:Rk});function Mk(){return this.rgb().formatHex()}function R7(){return this.rgb().formatHex8()}function D7(){return UI(this).formatHsl()}function Rk(){return this.rgb().formatRgb()}function au(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=T7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Dk(t):n===3?new ar(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Td(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Td(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=A7.exec(e))?new ar(t[1],t[2],t[3],1):(t=O7.exec(e))?new ar(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=I7.exec(e))?Td(t[1],t[2],t[3],t[4]):(t=N7.exec(e))?Td(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_7.exec(e))?$k(t[1],t[2]/100,t[3]/100,1):(t=M7.exec(e))?$k(t[1],t[2]/100,t[3]/100,t[4]):_k.hasOwnProperty(e)?Dk(_k[e]):e==="transparent"?new ar(NaN,NaN,NaN,0):null}function Dk(e){return new ar(e>>16&255,e>>8&255,e&255,1)}function Td(e,t,n,r){return r<=0&&(e=t=n=NaN),new ar(e,t,n,r)}function L7(e){return e instanceof Ru||(e=au(e)),e?(e=e.rgb(),new ar(e.r,e.g,e.b,e.opacity)):new ar}function ky(e,t,n,r){return arguments.length===1?L7(e):new ar(e,t,n,r??1)}function ar(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}W0(ar,ky,FI(Ru,{brighter(e){return e=e==null?df:Math.pow(df,e),new ar(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ru:Math.pow(ru,e),new ar(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ar(Ro(this.r),Ro(this.g),Ro(this.b),pf(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Lk,formatHex:Lk,formatHex8:z7,formatRgb:zk,toString:zk}));function Lk(){return`#${Eo(this.r)}${Eo(this.g)}${Eo(this.b)}`}function z7(){return`#${Eo(this.r)}${Eo(this.g)}${Eo(this.b)}${Eo((isNaN(this.opacity)?1:this.opacity)*255)}`}function zk(){const e=pf(this.opacity);return`${e===1?"rgb(":"rgba("}${Ro(this.r)}, ${Ro(this.g)}, ${Ro(this.b)}${e===1?")":`, ${e})`}`}function pf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ro(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Eo(e){return e=Ro(e),(e<16?"0":"")+e.toString(16)}function $k(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ei(e,t,n,r)}function UI(e){if(e instanceof ei)return new ei(e.h,e.s,e.l,e.opacity);if(e instanceof Ru||(e=au(e)),!e)return new ei;if(e instanceof ei)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,l=a-i,c=(a+i)/2;return l?(t===a?s=(n-r)/l+(n<r)*6:n===a?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?a+i:2-a-i,s*=60):l=c>0&&c<1?0:s,new ei(s,l,c,e.opacity)}function $7(e,t,n,r){return arguments.length===1?UI(e):new ei(e,t,n,r??1)}function ei(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}W0(ei,$7,FI(Ru,{brighter(e){return e=e==null?df:Math.pow(df,e),new ei(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ru:Math.pow(ru,e),new ei(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ar(pg(e>=240?e-240:e+120,i,r),pg(e,i,r),pg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ei(Bk(this.h),Ad(this.s),Ad(this.l),pf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=pf(this.opacity);return`${e===1?"hsl(":"hsla("}${Bk(this.h)}, ${Ad(this.s)*100}%, ${Ad(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bk(e){return e=(e||0)%360,e<0?e+360:e}function Ad(e){return Math.max(0,Math.min(1,e||0))}function pg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const K0=e=>()=>e;function B7(e,t){return function(n){return e+n*t}}function F7(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function U7(e){return(e=+e)==1?WI:function(t,n){return n-t?F7(t,n,e):K0(isNaN(t)?n:t)}}function WI(e,t){var n=t-e;return n?B7(e,n):K0(isNaN(e)?t:e)}const Fk=function e(t){var n=U7(t);function r(i,a){var s=n((i=ky(i)).r,(a=ky(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=WI(i.opacity,a.opacity);return function(p){return i.r=s(p),i.g=l(p),i.b=c(p),i.opacity=u(p),i+""}}return r.gamma=e,r}(1);function W7(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function K7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function H7(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=El(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(l){for(s=0;s<r;++s)a[s]=i[s](l);return a}}function V7(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ff(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function q7(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=El(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Cy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fg=new RegExp(Cy.source,"g");function Y7(e){return function(){return e}}function G7(e){return function(t){return e(t)+""}}function X7(e,t){var n=Cy.lastIndex=fg.lastIndex=0,r,i,a,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Cy.exec(e))&&(i=fg.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[s]?l[s]+=a:l[++s]=a),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:ff(r,i)})),n=fg.lastIndex;return n<t.length&&(a=t.slice(n),l[s]?l[s]+=a:l[++s]=a),l.length<2?c[0]?G7(c[0].x):Y7(t):(t=c.length,function(u){for(var p=0,d;p<t;++p)l[(d=c[p]).i]=d.x(u);return l.join("")})}function El(e,t){var n=typeof t,r;return t==null||n==="boolean"?K0(t):(n==="number"?ff:n==="string"?(r=au(t))?(t=r,Fk):X7:t instanceof au?Fk:t instanceof Date?V7:K7(t)?W7:Array.isArray(t)?H7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?q7:ff)(e,t)}function H0(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Q7(e,t){t===void 0&&(t=e,e=El);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(s){var l=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return a[l](s-l)}}function J7(e){return function(){return e}}function hf(e){return+e}var Uk=[0,1];function Yn(e){return e}function Py(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:J7(isNaN(t)?NaN:.5)}function Z7(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function eV(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=Py(i,r),a=n(s,a)):(r=Py(r,i),a=n(a,s)),function(l){return a(r(l))}}function tV(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=Py(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(l){var c=Mu(e,l,1,r)-1;return a[c](i[c](l))}}function Du(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Mh(){var e=Uk,t=Uk,n=El,r,i,a,s=Yn,l,c,u;function p(){var h=Math.min(e.length,t.length);return s!==Yn&&(s=Z7(e[0],e[h-1])),l=h>2?tV:eV,c=u=null,d}function d(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(r),t,n)))(r(s(h)))}return d.invert=function(h){return s(i((u||(u=l(t,e.map(r),ff)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,hf),p()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),p()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),n=H0,p()},d.clamp=function(h){return arguments.length?(s=h?!0:Yn,p()):s!==Yn},d.interpolate=function(h){return arguments.length?(n=h,p()):n},d.unknown=function(h){return arguments.length?(a=h,d):a},function(h,m){return r=h,i=m,p()}}function V0(){return Mh()(Yn,Yn)}function nV(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function mf(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function cl(e){return e=mf(Math.abs(e)),e?e[1]:NaN}function rV(e,t){return function(n,r){for(var i=n.length,a=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[s=(s+1)%e.length];return a.reverse().join(t)}}function iV(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var aV=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ou(e){if(!(t=aV.exec(e)))throw new Error("invalid format: "+e);var t;return new q0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ou.prototype=q0.prototype;function q0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}q0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function oV(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var gf;function sV(e,t){var n=mf(e,t);if(!n)return gf=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(gf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+mf(e,Math.max(0,t+a-1))[0]}function Wk(e,t){var n=mf(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Kk={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:nV,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Wk(e*100,t),r:Wk,s:sV,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Hk(e){return e}var Vk=Array.prototype.map,qk=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lV(e){var t=e.grouping===void 0||e.thousands===void 0?Hk:rV(Vk.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Hk:iV(Vk.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,h){d=ou(d);var m=d.fill,g=d.align,y=d.sign,x=d.symbol,v=d.zero,b=d.width,j=d.comma,w=d.precision,k=d.trim,S=d.type;S==="n"?(j=!0,S="g"):Kk[S]||(w===void 0&&(w=12),k=!0,S="g"),(v||m==="0"&&g==="=")&&(v=!0,m="0",g="=");var E=(h&&h.prefix!==void 0?h.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),A=(x==="$"?r:/[%p]/.test(S)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),D=Kk[S],T=/[defgprs%]/.test(S);w=w===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function I(_){var G=E,K=A,O,B,W;if(S==="c")K=D(_)+K,_="";else{_=+_;var R=_<0||1/_<0;if(_=isNaN(_)?c:D(Math.abs(_),w),k&&(_=oV(_)),R&&+_==0&&y!=="+"&&(R=!1),G=(R?y==="("?y:l:y==="-"||y==="("?"":y)+G,K=(S==="s"&&!isNaN(_)&&gf!==void 0?qk[8+gf/3]:"")+K+(R&&y==="("?")":""),T){for(O=-1,B=_.length;++O<B;)if(W=_.charCodeAt(O),48>W||W>57){K=(W===46?i+_.slice(O+1):_.slice(O))+K,_=_.slice(0,O);break}}}j&&!v&&(_=t(_,1/0));var $=G.length+_.length+K.length,P=$<b?new Array(b-$+1).join(m):"";switch(j&&v&&(_=t(P+_,P.length?b-K.length:1/0),P=""),g){case"<":_=G+_+K+P;break;case"=":_=G+P+_+K;break;case"^":_=P.slice(0,$=P.length>>1)+G+_+K+P.slice($);break;default:_=P+G+_+K;break}return a(_)}return I.toString=function(){return d+""},I}function p(d,h){var m=Math.max(-8,Math.min(8,Math.floor(cl(h)/3)))*3,g=Math.pow(10,-m),y=u((d=ou(d),d.type="f",d),{suffix:qk[8+m/3]});return function(x){return y(g*x)}}return{format:u,formatPrefix:p}}var Od,Y0,KI;cV({thousands:",",grouping:[3],currency:["$",""]});function cV(e){return Od=lV(e),Y0=Od.format,KI=Od.formatPrefix,Od}function uV(e){return Math.max(0,-cl(Math.abs(e)))}function dV(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(cl(t)/3)))*3-cl(Math.abs(e)))}function pV(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,cl(t)-cl(e))+1}function HI(e,t,n,r){var i=wy(e,t,n),a;switch(r=ou(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=dV(i,s))&&(r.precision=a),KI(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=pV(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=uV(i))&&(r.precision=a-(r.type==="%")*2);break}}return Y0(r)}function eo(e){var t=e.domain;return e.ticks=function(n){var r=t();return by(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return HI(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,s=r[i],l=r[a],c,u,p=10;for(l<s&&(u=s,s=l,l=u,u=i,i=a,a=u);p-- >0;){if(u=jy(s,l,n),u===c)return r[i]=s,r[a]=l,t(r);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function VI(){var e=V0();return e.copy=function(){return Du(e,VI())},Fr.apply(e,arguments),eo(e)}function qI(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,hf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return qI(e).unknown(t)},e=arguments.length?Array.from(e,hf):[0,1],eo(n)}function YI(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}function Yk(e){return Math.log(e)}function Gk(e){return Math.exp(e)}function fV(e){return-Math.log(-e)}function hV(e){return-Math.exp(-e)}function mV(e){return isFinite(e)?+("1e"+e):e<0?0:e}function gV(e){return e===10?mV:e===Math.E?Math.exp:t=>Math.pow(e,t)}function vV(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Xk(e){return(t,n)=>-e(-t,n)}function G0(e){const t=e(Yk,Gk),n=t.domain;let r=10,i,a;function s(){return i=vV(r),a=gV(r),n()[0]<0?(i=Xk(i),a=Xk(a),e(fV,hV)):e(Yk,Gk),t}return t.base=function(l){return arguments.length?(r=+l,s()):r},t.domain=function(l){return arguments.length?(n(l),s()):n()},t.ticks=l=>{const c=n();let u=c[0],p=c[c.length-1];const d=p<u;d&&([u,p]=[p,u]);let h=i(u),m=i(p),g,y;const x=l==null?10:+l;let v=[];if(!(r%1)&&m-h<x){if(h=Math.floor(h),m=Math.ceil(m),u>0){for(;h<=m;++h)for(g=1;g<r;++g)if(y=h<0?g/a(-h):g*a(h),!(y<u)){if(y>p)break;v.push(y)}}else for(;h<=m;++h)for(g=r-1;g>=1;--g)if(y=h>0?g/a(-h):g*a(h),!(y<u)){if(y>p)break;v.push(y)}v.length*2<x&&(v=by(u,p,x))}else v=by(h,m,Math.min(m-h,x)).map(a);return d?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=ou(c)).precision==null&&(c.trim=!0),c=Y0(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return p=>{let d=p/a(Math.round(i(p)));return d*r<r-.5&&(d*=r),d<=u?c(p):""}},t.nice=()=>n(YI(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function GI(){const e=G0(Mh()).domain([1,10]);return e.copy=()=>Du(e,GI()).base(e.base()),Fr.apply(e,arguments),e}function Qk(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Jk(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function X0(e){var t=1,n=e(Qk(t),Jk(t));return n.constant=function(r){return arguments.length?e(Qk(t=+r),Jk(t)):t},eo(n)}function XI(){var e=X0(Mh());return e.copy=function(){return Du(e,XI()).constant(e.constant())},Fr.apply(e,arguments)}function Zk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function yV(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function xV(e){return e<0?-e*e:e*e}function Q0(e){var t=e(Yn,Yn),n=1;function r(){return n===1?e(Yn,Yn):n===.5?e(yV,xV):e(Zk(n),Zk(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},eo(t)}function J0(){var e=Q0(Mh());return e.copy=function(){return Du(e,J0()).exponent(e.exponent())},Fr.apply(e,arguments),e}function bV(){return J0.apply(null,arguments).exponent(.5)}function eC(e){return Math.sign(e)*e*e}function jV(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function QI(){var e=V0(),t=[0,1],n=!1,r;function i(a){var s=jV(e(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return e.invert(eC(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,hf)).map(eC)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return QI(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Fr.apply(i,arguments),eo(i)}function JI(){var e=[],t=[],n=[],r;function i(){var s=0,l=Math.max(1,t.length);for(n=new Array(l-1);++s<l;)n[s-1]=C7(e,s/l);return a}function a(s){return s==null||isNaN(s=+s)?r:t[Mu(n,s)]}return a.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort($a),i()},a.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return JI().domain(e).range(t).unknown(r)},Fr.apply(a,arguments)}function ZI(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[Mu(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},s.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return ZI().domain([e,t]).range(i).unknown(a)},Fr.apply(eo(s),arguments)}function eN(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Mu(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var s=t.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return eN().domain(e).range(t).unknown(n)},Fr.apply(i,arguments)}const hg=new Date,mg=new Date;function hn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),l=i.ceil(a);return a-s<l-a?s:l},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<s)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<s);return c},i.filter=a=>hn(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!a(s););else for(;--l>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(hg.setTime(+a),mg.setTime(+s),e(hg),e(mg),Math.floor(n(hg,mg))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const vf=hn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);vf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?hn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):vf);vf.range;const Hi=1e3,Dr=Hi*60,Vi=Dr*60,ta=Vi*24,Z0=ta*7,tC=ta*30,gg=ta*365,To=hn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Hi)},(e,t)=>(t-e)/Hi,e=>e.getUTCSeconds());To.range;const eb=hn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hi)},(e,t)=>{e.setTime(+e+t*Dr)},(e,t)=>(t-e)/Dr,e=>e.getMinutes());eb.range;const tb=hn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Dr)},(e,t)=>(t-e)/Dr,e=>e.getUTCMinutes());tb.range;const nb=hn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hi-e.getMinutes()*Dr)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getHours());nb.range;const rb=hn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getUTCHours());rb.range;const Lu=hn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dr)/ta,e=>e.getDate()-1);Lu.range;const Rh=hn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ta,e=>e.getUTCDate()-1);Rh.range;const tN=hn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ta,e=>Math.floor(e/ta));tN.range;function ns(e){return hn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Dr)/Z0)}const Dh=ns(0),yf=ns(1),wV=ns(2),SV=ns(3),ul=ns(4),kV=ns(5),CV=ns(6);Dh.range;yf.range;wV.range;SV.range;ul.range;kV.range;CV.range;function rs(e){return hn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Z0)}const Lh=rs(0),xf=rs(1),PV=rs(2),EV=rs(3),dl=rs(4),TV=rs(5),AV=rs(6);Lh.range;xf.range;PV.range;EV.range;dl.range;TV.range;AV.range;const ib=hn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ib.range;const ab=hn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ab.range;const na=hn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());na.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:hn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});na.range;const ra=hn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ra.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:hn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ra.range;function nN(e,t,n,r,i,a){const s=[[To,1,Hi],[To,5,5*Hi],[To,15,15*Hi],[To,30,30*Hi],[a,1,Dr],[a,5,5*Dr],[a,15,15*Dr],[a,30,30*Dr],[i,1,Vi],[i,3,3*Vi],[i,6,6*Vi],[i,12,12*Vi],[r,1,ta],[r,2,2*ta],[n,1,Z0],[t,1,tC],[t,3,3*tC],[e,1,gg]];function l(u,p,d){const h=p<u;h&&([u,p]=[p,u]);const m=d&&typeof d.range=="function"?d:c(u,p,d),g=m?m.range(u,+p+1):[];return h?g.reverse():g}function c(u,p,d){const h=Math.abs(p-u)/d,m=B0(([,,x])=>x).right(s,h);if(m===s.length)return e.every(wy(u/gg,p/gg,d));if(m===0)return vf.every(Math.max(wy(u,p,d),1));const[g,y]=s[h/s[m-1][2]<s[m][2]/h?m-1:m];return g.every(y)}return[l,c]}const[OV,IV]=nN(ra,ab,Lh,tN,rb,tb),[NV,_V]=nN(na,ib,Dh,Lu,nb,eb);function vg(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function yg(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ql(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function MV(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=Jl(i),p=Zl(i),d=Jl(a),h=Zl(a),m=Jl(s),g=Zl(s),y=Jl(l),x=Zl(l),v=Jl(c),b=Zl(c),j={a:W,A:R,b:$,B:P,c:null,d:sC,e:sC,f:rq,g:fq,G:mq,H:eq,I:tq,j:nq,L:rN,m:iq,M:aq,p:F,q:re,Q:uC,s:dC,S:oq,u:sq,U:lq,V:cq,w:uq,W:dq,x:null,X:null,y:pq,Y:hq,Z:gq,"%":cC},w={a:N,A:pe,b:ve,B:X,c:null,d:lC,e:lC,f:bq,g:Oq,G:Nq,H:vq,I:yq,j:xq,L:aN,m:jq,M:wq,p:oe,q:de,Q:uC,s:dC,S:Sq,u:kq,U:Cq,V:Pq,w:Eq,W:Tq,x:null,X:null,y:Aq,Y:Iq,Z:_q,"%":cC},k={a:T,A:I,b:_,B:G,c:K,d:aC,e:aC,f:XV,g:iC,G:rC,H:oC,I:oC,j:VV,L:GV,m:HV,M:qV,p:D,q:KV,Q:JV,s:ZV,S:YV,u:$V,U:BV,V:FV,w:zV,W:UV,x:O,X:B,y:iC,Y:rC,Z:WV,"%":QV};j.x=S(n,j),j.X=S(r,j),j.c=S(t,j),w.x=S(n,w),w.X=S(r,w),w.c=S(t,w);function S(ie,J){return function(xe){var ae=[],Me=-1,se=0,Le=ie.length,$e,Ye,lt;for(xe instanceof Date||(xe=new Date(+xe));++Me<Le;)ie.charCodeAt(Me)===37&&(ae.push(ie.slice(se,Me)),(Ye=nC[$e=ie.charAt(++Me)])!=null?$e=ie.charAt(++Me):Ye=$e==="e"?" ":"0",(lt=J[$e])&&($e=lt(xe,Ye)),ae.push($e),se=Me+1);return ae.push(ie.slice(se,Me)),ae.join("")}}function E(ie,J){return function(xe){var ae=Ql(1900,void 0,1),Me=A(ae,ie,xe+="",0),se,Le;if(Me!=xe.length)return null;if("Q"in ae)return new Date(ae.Q);if("s"in ae)return new Date(ae.s*1e3+("L"in ae?ae.L:0));if(J&&!("Z"in ae)&&(ae.Z=0),"p"in ae&&(ae.H=ae.H%12+ae.p*12),ae.m===void 0&&(ae.m="q"in ae?ae.q:0),"V"in ae){if(ae.V<1||ae.V>53)return null;"w"in ae||(ae.w=1),"Z"in ae?(se=yg(Ql(ae.y,0,1)),Le=se.getUTCDay(),se=Le>4||Le===0?xf.ceil(se):xf(se),se=Rh.offset(se,(ae.V-1)*7),ae.y=se.getUTCFullYear(),ae.m=se.getUTCMonth(),ae.d=se.getUTCDate()+(ae.w+6)%7):(se=vg(Ql(ae.y,0,1)),Le=se.getDay(),se=Le>4||Le===0?yf.ceil(se):yf(se),se=Lu.offset(se,(ae.V-1)*7),ae.y=se.getFullYear(),ae.m=se.getMonth(),ae.d=se.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),Le="Z"in ae?yg(Ql(ae.y,0,1)).getUTCDay():vg(Ql(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(Le+5)%7:ae.w+ae.U*7-(Le+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,yg(ae)):vg(ae)}}function A(ie,J,xe,ae){for(var Me=0,se=J.length,Le=xe.length,$e,Ye;Me<se;){if(ae>=Le)return-1;if($e=J.charCodeAt(Me++),$e===37){if($e=J.charAt(Me++),Ye=k[$e in nC?J.charAt(Me++):$e],!Ye||(ae=Ye(ie,xe,ae))<0)return-1}else if($e!=xe.charCodeAt(ae++))return-1}return ae}function D(ie,J,xe){var ae=u.exec(J.slice(xe));return ae?(ie.p=p.get(ae[0].toLowerCase()),xe+ae[0].length):-1}function T(ie,J,xe){var ae=m.exec(J.slice(xe));return ae?(ie.w=g.get(ae[0].toLowerCase()),xe+ae[0].length):-1}function I(ie,J,xe){var ae=d.exec(J.slice(xe));return ae?(ie.w=h.get(ae[0].toLowerCase()),xe+ae[0].length):-1}function _(ie,J,xe){var ae=v.exec(J.slice(xe));return ae?(ie.m=b.get(ae[0].toLowerCase()),xe+ae[0].length):-1}function G(ie,J,xe){var ae=y.exec(J.slice(xe));return ae?(ie.m=x.get(ae[0].toLowerCase()),xe+ae[0].length):-1}function K(ie,J,xe){return A(ie,t,J,xe)}function O(ie,J,xe){return A(ie,n,J,xe)}function B(ie,J,xe){return A(ie,r,J,xe)}function W(ie){return s[ie.getDay()]}function R(ie){return a[ie.getDay()]}function $(ie){return c[ie.getMonth()]}function P(ie){return l[ie.getMonth()]}function F(ie){return i[+(ie.getHours()>=12)]}function re(ie){return 1+~~(ie.getMonth()/3)}function N(ie){return s[ie.getUTCDay()]}function pe(ie){return a[ie.getUTCDay()]}function ve(ie){return c[ie.getUTCMonth()]}function X(ie){return l[ie.getUTCMonth()]}function oe(ie){return i[+(ie.getUTCHours()>=12)]}function de(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var J=S(ie+="",j);return J.toString=function(){return ie},J},parse:function(ie){var J=E(ie+="",!1);return J.toString=function(){return ie},J},utcFormat:function(ie){var J=S(ie+="",w);return J.toString=function(){return ie},J},utcParse:function(ie){var J=E(ie+="",!0);return J.toString=function(){return ie},J}}}var nC={"-":"",_:" ",0:"0"},Sn=/^\s*\d+/,RV=/^%/,DV=/[\\^$*+?|[\]().{}]/g;function ht(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function LV(e){return e.replace(DV,"\\$&")}function Jl(e){return new RegExp("^(?:"+e.map(LV).join("|")+")","i")}function Zl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function zV(e,t,n){var r=Sn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function $V(e,t,n){var r=Sn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function BV(e,t,n){var r=Sn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function FV(e,t,n){var r=Sn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function UV(e,t,n){var r=Sn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function rC(e,t,n){var r=Sn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function iC(e,t,n){var r=Sn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function WV(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function KV(e,t,n){var r=Sn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function HV(e,t,n){var r=Sn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function aC(e,t,n){var r=Sn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function VV(e,t,n){var r=Sn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function oC(e,t,n){var r=Sn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function qV(e,t,n){var r=Sn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function YV(e,t,n){var r=Sn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function GV(e,t,n){var r=Sn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function XV(e,t,n){var r=Sn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function QV(e,t,n){var r=RV.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function JV(e,t,n){var r=Sn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ZV(e,t,n){var r=Sn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function sC(e,t){return ht(e.getDate(),t,2)}function eq(e,t){return ht(e.getHours(),t,2)}function tq(e,t){return ht(e.getHours()%12||12,t,2)}function nq(e,t){return ht(1+Lu.count(na(e),e),t,3)}function rN(e,t){return ht(e.getMilliseconds(),t,3)}function rq(e,t){return rN(e,t)+"000"}function iq(e,t){return ht(e.getMonth()+1,t,2)}function aq(e,t){return ht(e.getMinutes(),t,2)}function oq(e,t){return ht(e.getSeconds(),t,2)}function sq(e){var t=e.getDay();return t===0?7:t}function lq(e,t){return ht(Dh.count(na(e)-1,e),t,2)}function iN(e){var t=e.getDay();return t>=4||t===0?ul(e):ul.ceil(e)}function cq(e,t){return e=iN(e),ht(ul.count(na(e),e)+(na(e).getDay()===4),t,2)}function uq(e){return e.getDay()}function dq(e,t){return ht(yf.count(na(e)-1,e),t,2)}function pq(e,t){return ht(e.getFullYear()%100,t,2)}function fq(e,t){return e=iN(e),ht(e.getFullYear()%100,t,2)}function hq(e,t){return ht(e.getFullYear()%1e4,t,4)}function mq(e,t){var n=e.getDay();return e=n>=4||n===0?ul(e):ul.ceil(e),ht(e.getFullYear()%1e4,t,4)}function gq(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ht(t/60|0,"0",2)+ht(t%60,"0",2)}function lC(e,t){return ht(e.getUTCDate(),t,2)}function vq(e,t){return ht(e.getUTCHours(),t,2)}function yq(e,t){return ht(e.getUTCHours()%12||12,t,2)}function xq(e,t){return ht(1+Rh.count(ra(e),e),t,3)}function aN(e,t){return ht(e.getUTCMilliseconds(),t,3)}function bq(e,t){return aN(e,t)+"000"}function jq(e,t){return ht(e.getUTCMonth()+1,t,2)}function wq(e,t){return ht(e.getUTCMinutes(),t,2)}function Sq(e,t){return ht(e.getUTCSeconds(),t,2)}function kq(e){var t=e.getUTCDay();return t===0?7:t}function Cq(e,t){return ht(Lh.count(ra(e)-1,e),t,2)}function oN(e){var t=e.getUTCDay();return t>=4||t===0?dl(e):dl.ceil(e)}function Pq(e,t){return e=oN(e),ht(dl.count(ra(e),e)+(ra(e).getUTCDay()===4),t,2)}function Eq(e){return e.getUTCDay()}function Tq(e,t){return ht(xf.count(ra(e)-1,e),t,2)}function Aq(e,t){return ht(e.getUTCFullYear()%100,t,2)}function Oq(e,t){return e=oN(e),ht(e.getUTCFullYear()%100,t,2)}function Iq(e,t){return ht(e.getUTCFullYear()%1e4,t,4)}function Nq(e,t){var n=e.getUTCDay();return e=n>=4||n===0?dl(e):dl.ceil(e),ht(e.getUTCFullYear()%1e4,t,4)}function _q(){return"+0000"}function cC(){return"%"}function uC(e){return+e}function dC(e){return Math.floor(+e/1e3)}var us,sN,lN;Mq({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Mq(e){return us=MV(e),sN=us.format,us.parse,lN=us.utcFormat,us.utcParse,us}function Rq(e){return new Date(e)}function Dq(e){return e instanceof Date?+e:+new Date(+e)}function ob(e,t,n,r,i,a,s,l,c,u){var p=V0(),d=p.invert,h=p.domain,m=u(".%L"),g=u(":%S"),y=u("%I:%M"),x=u("%I %p"),v=u("%a %d"),b=u("%b %d"),j=u("%B"),w=u("%Y");function k(S){return(c(S)<S?m:l(S)<S?g:s(S)<S?y:a(S)<S?x:r(S)<S?i(S)<S?v:b:n(S)<S?j:w)(S)}return p.invert=function(S){return new Date(d(S))},p.domain=function(S){return arguments.length?h(Array.from(S,Dq)):h().map(Rq)},p.ticks=function(S){var E=h();return e(E[0],E[E.length-1],S??10)},p.tickFormat=function(S,E){return E==null?k:u(E)},p.nice=function(S){var E=h();return(!S||typeof S.range!="function")&&(S=t(E[0],E[E.length-1],S??10)),S?h(YI(E,S)):p},p.copy=function(){return Du(p,ob(e,t,n,r,i,a,s,l,c,u))},p}function Lq(){return Fr.apply(ob(NV,_V,na,ib,Dh,Lu,nb,eb,To,sN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function zq(){return Fr.apply(ob(OV,IV,ra,ab,Lh,Rh,rb,tb,To,lN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function zh(){var e=0,t=1,n,r,i,a,s=Yn,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:s(i===0?.5:(d=(a(d)-n)*i,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(s=d,u):s};function p(d){return function(h){var m,g;return arguments.length?([m,g]=h,s=d(m,g),u):[s(0),s(1)]}}return u.range=p(El),u.rangeRound=p(H0),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return a=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),u}}function to(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function cN(){var e=eo(zh()(Yn));return e.copy=function(){return to(e,cN())},ca.apply(e,arguments)}function uN(){var e=G0(zh()).domain([1,10]);return e.copy=function(){return to(e,uN()).base(e.base())},ca.apply(e,arguments)}function dN(){var e=X0(zh());return e.copy=function(){return to(e,dN()).constant(e.constant())},ca.apply(e,arguments)}function sb(){var e=Q0(zh());return e.copy=function(){return to(e,sb()).exponent(e.exponent())},ca.apply(e,arguments)}function $q(){return sb.apply(null,arguments).exponent(.5)}function pN(){var e=[],t=Yn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Mu(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort($a),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>k7(e,a/r))},n.copy=function(){return pN(t).domain(e)},ca.apply(n,arguments)}function $h(){var e=0,t=.5,n=1,r=1,i,a,s,l,c,u=Yn,p,d=!1,h;function m(y){return isNaN(y=+y)?h:(y=.5+((y=+p(y))-a)*(r*y<r*a?l:c),u(d?Math.max(0,Math.min(1,y)):y))}m.domain=function(y){return arguments.length?([e,t,n]=y,i=p(e=+e),a=p(t=+t),s=p(n=+n),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,m):[e,t,n]},m.clamp=function(y){return arguments.length?(d=!!y,m):d},m.interpolator=function(y){return arguments.length?(u=y,m):u};function g(y){return function(x){var v,b,j;return arguments.length?([v,b,j]=x,u=Q7(y,[v,b,j]),m):[u(0),u(.5),u(1)]}}return m.range=g(El),m.rangeRound=g(H0),m.unknown=function(y){return arguments.length?(h=y,m):h},function(y){return p=y,i=y(e),a=y(t),s=y(n),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,m}}function fN(){var e=eo($h()(Yn));return e.copy=function(){return to(e,fN())},ca.apply(e,arguments)}function hN(){var e=G0($h()).domain([.1,1,10]);return e.copy=function(){return to(e,hN()).base(e.base())},ca.apply(e,arguments)}function mN(){var e=X0($h());return e.copy=function(){return to(e,mN()).constant(e.constant())},ca.apply(e,arguments)}function lb(){var e=Q0($h());return e.copy=function(){return to(e,lb()).exponent(e.exponent())},ca.apply(e,arguments)}function Bq(){return lb.apply(null,arguments).exponent(.5)}const gN=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:U0,scaleDiverging:fN,scaleDivergingLog:hN,scaleDivergingPow:lb,scaleDivergingSqrt:Bq,scaleDivergingSymlog:mN,scaleIdentity:qI,scaleImplicit:Sy,scaleLinear:VI,scaleLog:GI,scaleOrdinal:F0,scalePoint:E7,scalePow:J0,scaleQuantile:JI,scaleQuantize:ZI,scaleRadial:QI,scaleSequential:cN,scaleSequentialLog:uN,scaleSequentialPow:sb,scaleSequentialQuantile:pN,scaleSequentialSqrt:$q,scaleSequentialSymlog:dN,scaleSqrt:bV,scaleSymlog:XI,scaleThreshold:eN,scaleTime:Lq,scaleUtc:zq,tickFormat:HI},Symbol.toStringTag,{value:"Module"}));function Fq(e){var t=gN;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(ju(e));if(n in t&&typeof t[n]=="function")return t[n]()}function pC(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Fq(e);if(r!=null)return r.domain(t).range(n),r}}function cb(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?pC(e.scale,n,r):pC(t,n,r)}function Uq(e){return"scale".concat(ju(e))}function Wq(e){return Uq(e)in gN}var vN=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return Wq(r)?r:"point"}};function Kq(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function yN(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var s;return(s=e(a))!==null&&s!==void 0?s:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var s,l,c=Kq(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var u=(s=r[c-1])!==null&&s!==void 0?s:0,p=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-u)<=Math.abs(a-p)?n[c-1]:n[c]}}}function Hq(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):yN(e,void 0)}function fC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fC(Object(n),!0).forEach(function(r){Vq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vq(e,t,n){return(t=qq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qq(e){var t=Yq(e,"string");return typeof t=="symbol"?t:t+""}function Yq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ey=[0,"auto"],ln={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},xN=(e,t)=>e.cartesianAxis.xAxis[t],ua=(e,t)=>{var n=xN(e,t);return n??ln},cn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Ey,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:Cu},bN=(e,t)=>e.cartesianAxis.yAxis[t],da=(e,t)=>{var n=bN(e,t);return n??cn},Gq={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},ub=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Gq},Qt=(e,t,n)=>{switch(t){case"xAxis":return ua(e,n);case"yAxis":return da(e,n);case"zAxis":return ub(e,n);case"angleAxis":return D0(e,n);case"radiusAxis":return L0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Xq=(e,t,n)=>{switch(t){case"xAxis":return ua(e,n);case"yAxis":return da(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Tl=(e,t,n)=>{switch(t){case"xAxis":return ua(e,n);case"yAxis":return da(e,n);case"angleAxis":return D0(e,n);case"radiusAxis":return L0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},jN=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function db(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var zu=e=>e.graphicalItems.cartesianItems,Qq=q([Vt,_u],db),pb=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Al=q([zu,Qt,Qq],pb,{memoizeOptions:{resultEqualityCheck:_h}}),wN=q([Al],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Ih)),SN=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Jq=q([Al],SN),fb=e=>e.map(t=>t.data).filter(Boolean).flat(1),Zq=q([Al],e=>e.some(t=>!t.data)),kN=q([Al],fb,{memoizeOptions:{resultEqualityCheck:_h}}),hb=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},mb=q([kN,Iu],hb),CN=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:ft(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:ft(i,r)}))):e.map(r=>({value:r})),PN=(e,t,n,r,i,a)=>{var{chartData:s=[],dataStartIndex:l,dataEndIndex:c}=r,u=CN(e,t,n);if(i&&(t==null?void 0:t.dataKey)!=null&&a.length>0){var p=s.slice(l,c+1),d=p.map(h=>({value:ft(h,t.dataKey)})).filter(h=>h.value!=null);return[...d,...u]}return u},$u=q([mb,Qt,Al,Iu,Zq,kN],PN);function qs(e){if(Ti(e)||e instanceof Date){var t=Number(e);if(Je(t))return t}}function hC(e){if(Array.isArray(e)){var t=[qs(e[0]),qs(e[1])];return ki(t)?t:void 0}var n=qs(e);if(n!=null)return[n,n]}function Ii(e){return e.map(qs).filter(ir)}function eY(e,t){var n=qs(e),r=qs(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var tY=q([$u],e=>e==null?void 0:e.map(t=>t.value).sort(eY));function EN(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function nY(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!ii(t))r=t;else if(Array.isArray(t)){var i=Ii(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ii(n.flatMap(a=>{var s=ft(e,a.dataKey),l,c;if(Array.isArray(s)?[l,c]=s:l=c=s,!(!Je(l)||!Je(c)))return[r-l,r+c]}))}var mn=e=>{var t=wn(e),n=Pl(e);return Tl(e,t,n)},pl=q([mn],e=>e==null?void 0:e.dataKey),rY=q([wN,Iu,mn],RI),TN=(e,t,n,r)=>{var i={},a=t.reduce((s,l)=>{if(l.stackId==null)return s;var c=s[l.stackId];return c==null&&(c=[]),c.push(l),s[l.stackId]=c,s},i);return Object.fromEntries(Object.entries(a).map(s=>{var[l,c]=s,u=r?[...c].reverse():c,p=u.map(Oh);return[l,{stackedData:GW(e,p,n),graphicalItems:u}]}))},jf=q([rY,wN,Nu,TI],TN),AN=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var s=ZW(e,i,a);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},iY=q([Qt],e=>e.allowDataOverflow),gb=e=>{var t;if(e==null||!("domain"in e))return Ey;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ii(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:Ey},vb=q([Qt],gb),yb=q([vb,iY],mI),aY=q([jf,li,Vt,yb],AN,{memoizeOptions:{resultEqualityCheck:Nh}}),Bh=e=>e.errorBars,oY=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>EN(n,r)),wf=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),s=Math.min(...a),l=Math.max(...a);return[s,l]}},xb=function(t,n,r,i,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],l,c;if(r.length>0&&r.forEach(u=>{var p,d=u.data!=null?[...u.data]:s,h=(p=i[u.id])===null||p===void 0?void 0:p.filter(m=>EN(a,m));d.forEach(m=>{var g,y=ft(m,(g=n.dataKey)!==null&&g!==void 0?g:u.dataKey),x=nY(m,y,h);if(x.length>=2){var v=Math.min(...x),b=Math.max(...x);(l==null||v<l)&&(l=v),(c==null||b>c)&&(c=b)}var j=hC(y);j!=null&&(l=l==null?j[0]:Math.min(l,j[0]),c=c==null?j[1]:Math.max(c,j[1]))})}),(n==null?void 0:n.dataKey)!=null&&r.length===0&&t.forEach(u=>{var p=hC(ft(u,n.dataKey));p!=null&&(l=l==null?p[0]:Math.min(l,p[0]),c=c==null?p[1]:Math.max(c,p[1]))}),Je(l)&&Je(c))return[l,c]},sY=q([mb,Qt,Jq,Bh,Vt,GH],xb,{memoizeOptions:{resultEqualityCheck:Nh}});function lY(e){var{value:t}=e;if(Ti(t)||t instanceof Date)return t}var cY=(e,t,n)=>{var r=e.map(lY).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&MA(r))?fI(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},ON=e=>e.referenceElements.dots,Ol=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),uY=q([ON,Vt,_u],Ol),IN=e=>e.referenceElements.areas,dY=q([IN,Vt,_u],Ol),NN=e=>e.referenceElements.lines,pY=q([NN,Vt,_u],Ol),_N=(e,t)=>{if(e!=null){var n=Ii(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},fY=q(uY,Vt,_N),MN=(e,t)=>{if(e!=null){var n=Ii(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},hY=q([dY,Vt],MN);function mY(e){var t;if(e.x!=null)return Ii([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ii(n)}function gY(e){var t;if(e.y!=null)return Ii([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ii(n)}var RN=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?mY(r):gY(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},vY=q([pY,Vt],RN),yY=q(fY,vY,hY,(e,t,n)=>wf(e,n,t)),bb=(e,t,n,r,i,a,s,l)=>{if(n!=null)return n;var c=s==="vertical"&&l==="xAxis"||s==="horizontal"&&l==="yAxis",u=c?wf(r,a,i):wf(a,i);return JH(t,u,e.allowDataOverflow)},xY=q([Qt,vb,yb,aY,sY,yY,ot,Vt],bb,{memoizeOptions:{resultEqualityCheck:Nh}}),bY=[0,1],jb=(e,t,n,r,i,a,s)=>{if(!((e==null||n==null||n.length===0)&&s===void 0)){var{dataKey:l,type:c}=e,u=si(t,a);if(u&&l==null){var p;return fI(0,(p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)}return c==="category"?cY(r,e,u):i==="expand"&&!u?bY:s}},wb=q([Qt,ot,mb,$u,Nu,Vt,xY],jb),no=q([Qt,jN,_0],vN),Sb=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=gb(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&ki(e)){if(a)return kk(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return Ck(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&ki(e))return kk(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&ki(e))return Ck(e,t.tickCount,t.allowDecimals,"adaptive")}}},kb=q([wb,Tl,no],Sb),Cb=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&ki(t)&&Array.isArray(n)&&n.length>0){var i,a,s=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],u=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(s,l),Math.max(c,u)]}return t},jY=q([Qt,wb,kb,Vt],Cb),wY=q($u,Qt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ii(e.map(d=>d.value))).sort((d,h)=>d-h),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var s=a-i;if(s===0)return 1/0;for(var l=0;l<r.length-1;l++){var c=r[l],u=r[l+1];if(!(c==null||u==null)){var p=u-c;n=Math.min(n,p)}}return n/s}}),DN=q(wY,ot,EI,fn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Je(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var s=$n(n,e*a),l=e*a/2;return l-s-(l-s)/a*s}return 0}),SY=(e,t,n)=>{var r=ua(e,t);return r==null||typeof r.padding!="string"?0:DN(e,"xAxis",t,n,r.padding)},kY=(e,t,n)=>{var r=da(e,t);return r==null||typeof r.padding!="string"?0:DN(e,"yAxis",t,n,r.padding)},CY=q(ua,SY,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),PY=q(da,kY,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),EY=q([fn,CY,wh,jh,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),TY=q([fn,ot,PY,wh,jh,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:s}=i;return a?[r.height-s.bottom,s.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Bu=(e,t,n,r)=>{var i;switch(t){case"xAxis":return EY(e,n,r);case"yAxis":return TY(e,n,r);case"zAxis":return(i=ub(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return NI(e);case"radiusAxis":return _I(e,n);default:return}},LN=q([Qt,Bu],Eh),AY=q([no,jY],DI),Pb=q([Qt,no,AY,LN],cb),zN=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,s=si(e,r);if(s&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},Eb=q([ot,$u,Tl,Vt],zN),Fh=q([Pb],$0);q([Pb],Hq);q([Pb,tY],yN);q([Al,Bh,Vt],oY);function $N(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Uh=(e,t)=>t,Wh=(e,t,n)=>n,OY=q(xh,Uh,Wh,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort($N)),IY=q(bh,Uh,Wh,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort($N)),BN=(e,t)=>({width:e.width,height:t.height}),NY=(e,t)=>{var n=typeof t.width=="number"?t.width:Cu;return{width:n,height:e.height}},FN=q(fn,ua,BN),_Y=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},MY=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},RY=q(la,fn,OY,Uh,Wh,(e,t,n,r,i)=>{var a={},s;return n.forEach(l=>{var c=BN(t,l);s==null&&(s=_Y(t,r,e));var u=r==="top"&&!i||r==="bottom"&&i;a[l.id]=s-Number(u)*c.height,s+=(u?-1:1)*c.height}),a}),DY=q(sa,fn,IY,Uh,Wh,(e,t,n,r,i)=>{var a={},s;return n.forEach(l=>{var c=NY(t,l);s==null&&(s=MY(t,r,e));var u=r==="left"&&!i||r==="right"&&i;a[l.id]=s-Number(u)*c.width,s+=(u?-1:1)*c.width}),a}),LY=(e,t)=>{var n=ua(e,t);if(n!=null)return RY(e,n.orientation,n.mirror)},zY=q([fn,ua,LY,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),$Y=(e,t)=>{var n=da(e,t);if(n!=null)return DY(e,n.orientation,n.mirror)},BY=q([fn,da,$Y,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),UN=q(fn,da,(e,t)=>{var n=typeof t.width=="number"?t.width:Cu;return{width:n,height:e.height}}),mC=(e,t,n)=>{switch(t){case"xAxis":return FN(e,n).width;case"yAxis":return UN(e,n).height;default:return}},WN=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:s}=n,l=si(e,r),c=t.map(p=>p.value),u=c.filter(p=>p!=null);if(s&&l&&a==="category"&&i&&MA(u))return c}},Tb=q([ot,$u,Qt,Vt],WN),gC=q([ot,Xq,no,Fh,Tb,Eb,Bu,kb,Vt],(e,t,n,r,i,a,s,l,c)=>{if(t!=null){var u=si(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:u,niceTicks:l,range:s,realScaleType:n,scale:r}}}),FY=(e,t,n,r,i,a,s,l,c)=>{if(!(t==null||r==null)){var u=si(e,c),{type:p,ticks:d,tickCount:h}=t,m=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,g=p==="category"&&r.bandwidth?r.bandwidth()/m:0;g=c==="angleAxis"&&a!=null&&a.length>=2?xn(a[0]-a[1])*2*g:g;var y=d||i;return y?y.map((x,v)=>{var b=s?s.indexOf(x):x,j=r.map(b);return Je(j)?{index:v,coordinate:j+g,value:x,offset:g}:null}).filter(ir):u&&l?l.map((x,v)=>{var b=r.map(x);return Je(b)?{coordinate:b+g,value:x,index:v,offset:g}:null}).filter(ir):r.ticks?r.ticks(h).map((x,v)=>{var b=r.map(x);return Je(b)?{coordinate:b+g,value:x,index:v,offset:g}:null}).filter(ir):r.domain().map((x,v)=>{var b=r.map(x);return Je(b)?{coordinate:b+g,value:s?s[x]:x,index:v,offset:g}:null}).filter(ir)}},KN=q([ot,Tl,no,Fh,kb,Bu,Tb,Eb,Vt],FY),UY=(e,t,n,r,i,a,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=si(e,s),{tickCount:c}=t,u=0;return u=s==="angleAxis"&&(r==null?void 0:r.length)>=2?xn(r[0]-r[1])*2*u:u,l&&a?a.map((p,d)=>{var h=n.map(p);return Je(h)?{coordinate:h+u,value:p,index:d,offset:u}:null}).filter(ir):n.ticks?n.ticks(c).map((p,d)=>{var h=n.map(p);return Je(h)?{coordinate:h+u,value:p,index:d,offset:u}:null}).filter(ir):n.domain().map((p,d)=>{var h=n.map(p);return Je(h)?{coordinate:h+u,value:i?i[p]:p,index:d,offset:u}:null}).filter(ir)}},Ni=q([ot,Tl,Fh,Bu,Tb,Eb,Vt],UY),_i=q(Qt,Fh,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})}),WY=q([Qt,no,wb,LN],cb),KY=q([WY],$0);q((e,t,n)=>ub(e,n),KY,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})});var HY=q([ot,xh,bh],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),VY=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};q([VY],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var s=Math.abs(a.coordinate-t);s<r&&(r=s,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var HN=e=>e.options.defaultTooltipEventType,VN=e=>e.options.validateTooltipEventTypes;function qN(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Fu(e,t){var n=HN(e),r=VN(e);return qN(t,n,r)}function qY(e){return Ne(t=>Fu(t,e))}var YN=(e,t)=>{var n,r=Number(t);if(!(ii(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},YY=e=>e.tooltip.settings,Ca={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},GY={itemInteraction:{click:Ca,hover:Ca},axisInteraction:{click:Ca,hover:Ca},keyboardInteraction:Ca,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},GN=Wn({name:"tooltip",initialState:GY,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Nt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Rr(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Nt()},removeTooltipEntrySettings:{reducer(e,t){var n=Rr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Nt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:XY,replaceTooltipEntrySettings:QY,removeTooltipEntrySettings:JY,setTooltipSettingsState:ZY,setActiveMouseOverItemIndex:XN,mouseLeaveItem:eG,mouseLeaveChart:QN,setActiveClickItemIndex:tG,setMouseOverAxisIndex:JN,setMouseClickAxisIndex:nG,setSyncInteraction:cc,setKeyboardInteraction:Sf}=GN.actions,rG=GN.reducer;function vC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Id(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vC(Object(n),!0).forEach(function(r){iG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iG(e,t,n){return(t=aG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aG(e){var t=oG(e,"string");return typeof t=="symbol"?t:t+""}function oG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sG(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function lG(e){return e.index!=null}var ZN=(e,t,n,r)=>{if(t==null)return Ca;var i=sG(e,t,n);if(i==null)return Ca;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(lG(i)){if(a)return Id(Id({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Id(Id({},Ca),{},{coordinate:i.coordinate})};function cG(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function uG(e,t){var n=cG(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),s=Math.max(r,i);return n>=a&&n<=s}function dG(e,t,n){if(n==null||t==null)return!0;var r=ft(e,t);return r==null||!ki(n)?!0:uG(r,n)}var kc=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Je(a))return i;var s=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(s,Math.min(a,l)),u=t[c];return u==null||dG(u,n,r)?String(c):null},e_=(e,t,n,r,i,a,s)=>{if(a!=null){var l=s[0],c=l==null?void 0:l.getPosition(a);if(c!=null)return c;var u=i==null?void 0:i[Number(a)];if(u)switch(n){case"horizontal":return{x:u.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:u.coordinate}}}},t_=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(s=>{var l;return((l=s.settings)===null||l===void 0?void 0:l.graphicalItemId)===i})},n_=e=>e.options.tooltipPayloadSearcher,Il=e=>e.tooltip;function yC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yC(Object(n),!0).forEach(function(r){pG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pG(e,t,n){return(t=fG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fG(e){var t=hG(e,"string");return typeof t=="symbol"?t:t+""}function hG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mG(e){if(typeof e=="string"||typeof e=="number")return e}function gG(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function vG(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function bC(e){if(typeof e=="string")return e}function yG(e){if(!(e==null||typeof e!="object")){var t="name"in e?mG(e.name):void 0,n="unit"in e?gG(e.unit):void 0,r="dataKey"in e?vG(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?bC(e.color):void 0,s="fill"in e?bC(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:s}}}function xG(e,t){return e??t}var r_=(e,t,n,r,i,a,s)=>{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:u,dataEndIndex:p}=n,d=[];return e.reduce((h,m)=>{var g,{dataDefinedOnItem:y,settings:x}=m,v=xG(y,l),b=Array.isArray(v)?MO(v,u,p):v,j=(g=x==null?void 0:x.dataKey)!==null&&g!==void 0?g:r,w=x==null?void 0:x.nameKey,k;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&s==="axis"?k=RA(b,r,i):k=a(b,t,c,w),Array.isArray(k))k.forEach(E=>{var A,D,T=yG(E),I=T==null?void 0:T.name,_=T==null?void 0:T.dataKey,G=T==null?void 0:T.payload,K=xC(xC({},x),{},{name:I,unit:T==null?void 0:T.unit,color:(A=T==null?void 0:T.color)!==null&&A!==void 0?A:x==null?void 0:x.color,fill:(D=T==null?void 0:T.fill)!==null&&D!==void 0?D:x==null?void 0:x.fill});h.push(wS({tooltipEntrySettings:K,dataKey:_,payload:G,value:ft(G,_),name:I==null?void 0:String(I)}))});else{var S;h.push(wS({tooltipEntrySettings:x,dataKey:j,payload:k,value:ft(k,j),name:(S=ft(k,w))!==null&&S!==void 0?S:x==null?void 0:x.name}))}return h},d)}},Ab=q([mn,jN,_0],vN),bG=q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),jG=q([wn,Pl],db),is=q([bG,mn,jG],pb,{memoizeOptions:{resultEqualityCheck:_h}}),wG=q([is],e=>e.filter(Ih)),i_=q([is],fb,{memoizeOptions:{resultEqualityCheck:_h}}),SG=q([is],e=>e.some(t=>!t.data)),Go=q([i_,li],hb),kG=q([wG,li,mn],RI),Ob=q([Go,mn,is,li,SG,i_],PN),a_=q([mn],gb),CG=q([mn],e=>e.allowDataOverflow),o_=q([a_,CG],mI),PG=q([is],e=>e.filter(Ih)),EG=q([kG,PG,Nu,TI],TN),TG=q([EG,li,wn,o_],AN),AG=q([is],SN),OG=q([Go,mn,AG,Bh,wn,QH],xb,{memoizeOptions:{resultEqualityCheck:Nh}}),IG=q([ON,wn,Pl],Ol),NG=q([IG,wn],_N),_G=q([IN,wn,Pl],Ol),MG=q([_G,wn],MN),RG=q([NN,wn,Pl],Ol),DG=q([RG,wn],RN),LG=q([NG,DG,MG],wf),zG=q([mn,a_,o_,TG,OG,LG,ot,wn],bb),fl=q([mn,ot,Go,Ob,Nu,wn,zG],jb),$G=q([fl,mn,Ab],Sb),BG=q([mn,fl,$G,wn],Cb),s_=e=>{var t=wn(e),n=Pl(e),r=!1;return Bu(e,t,n,r)},l_=q([mn,s_],Eh),FG=q([mn,Ab,BG,l_],cb),c_=q([FG],$0),UG=q([ot,Ob,mn,wn],WN),WG=q([ot,Ob,mn,wn],zN),KG=(e,t,n,r,i,a,s,l)=>{if(t){var{type:c}=t,u=si(e,l);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,d=c==="category"&&r.bandwidth?r.bandwidth()/p:0;return d=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?xn(i[0]-i[1])*2*d:d,u&&s?s.map((h,m)=>{var g=r.map(h);return Je(g)?{coordinate:g+d,value:h,index:m,offset:d}:null}).filter(ir):r.domain().map((h,m)=>{var g=r.map(h);return Je(g)?{coordinate:g+d,value:a?a[h]:h,index:m,offset:d}:null}).filter(ir)}}},pa=q([ot,mn,Ab,c_,s_,UG,WG,wn],KG),Ib=q([HN,VN,YY],(e,t,n)=>qN(n.shared,e,t)),u_=e=>e.tooltip.settings.trigger,Nb=e=>e.tooltip.settings.defaultIndex,Uu=q([Il,Ib,u_,Nb],ZN),Ka=q([Uu,Go,pl,fl],kc),d_=q([pa,Ka],YN),_b=q([Uu],e=>{if(e)return e.dataKey}),p_=q([Uu],e=>{if(e)return e.graphicalItemId}),f_=q([Il,Ib,u_,Nb],t_),HG=q([sa,la,ot,fn,pa,Nb,f_],e_),VG=q([Uu,HG],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),qG=q([Uu],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),YG=q([f_,Ka,li,pl,d_,n_,Ib],r_),GG=q([YG],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function jC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jC(Object(n),!0).forEach(function(r){XG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XG(e,t,n){return(t=QG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QG(e){var t=JG(e,"string");return typeof t=="symbol"?t:t+""}function JG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZG=()=>Ne(mn),eX=()=>{var e=ZG(),t=Ne(pa),n=Ne(c_);return Wa(!e||!n?void 0:wC(wC({},e),{},{scale:n}),t)};function SC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ds(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SC(Object(n),!0).forEach(function(r){tX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tX(e,t,n){return(t=nX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nX(e){var t=rX(e,"string");return typeof t=="symbol"?t:t+""}function rX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iX=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},aX=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:s}=r;return ds(ds(ds({},r),on(r.cx,r.cy,s,a)),{},{angle:a,radius:s})}var l=i.coordinate,{angle:c}=r;return ds(ds(ds({},r),on(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function oX(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var h_=(e,t,n,r,i)=>{var a,s=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(s<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l<s;l++){var c,u,p,d,h,m=l>0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(u=n[s-1])===null||u===void 0?void 0:u.coordinate,g=(p=n[l])===null||p===void 0?void 0:p.coordinate,y=l>=s-1?(d=n[0])===null||d===void 0?void 0:d.coordinate:(h=n[l+1])===null||h===void 0?void 0:h.coordinate,x=void 0;if(!(m==null||g==null||y==null))if(xn(g-m)!==xn(y-g)){var v=[];if(xn(y-g)===xn(i[1]-i[0])){x=y;var b=g+i[1]-i[0];v[0]=Math.min(b,(b+m)/2),v[1]=Math.max(b,(b+m)/2)}else{x=m;var j=y+i[1]-i[0];v[0]=Math.min(g,(j+g)/2),v[1]=Math.max(g,(j+g)/2)}var w=[Math.min(g,(x+g)/2),Math.max(g,(x+g)/2)];if(e>w[0]&&e<=w[1]||e>=v[0]&&e<=v[1]){var k;return(k=n[l])===null||k===void 0?void 0:k.index}}else{var S=Math.min(m,y),E=Math.max(m,y);if(e>(S+g)/2&&e<=(E+g)/2){var A;return(A=n[l])===null||A===void 0?void 0:A.index}}}else if(t)for(var D=0;D<s;D++){var T=t[D];if(T!=null){var I=t[D+1],_=t[D-1];if(D===0&&I!=null&&e<=(T.coordinate+I.coordinate)/2||D===s-1&&_!=null&&e>(T.coordinate+_.coordinate)/2||D>0&&D<s-1&&_!=null&&I!=null&&e>(T.coordinate+_.coordinate)/2&&e<=(T.coordinate+I.coordinate)/2)return T.index}}return-1},m_=()=>Ne(_0),Mb=(e,t)=>t,g_=(e,t,n)=>n,Rb=(e,t,n,r)=>r,sX=q(pa,e=>ch(e,t=>t.coordinate)),Db=q([Il,Mb,g_,Rb],ZN),Lb=q([Db,Go,pl,fl],kc),lX=(e,t,n)=>{if(t!=null){var r=Il(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},v_=q([Il,Mb,g_,Rb],t_),kf=q([sa,la,ot,fn,pa,Rb,v_],e_),cX=q([Db,kf],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),y_=q([pa,Lb],YN),uX=q([v_,Lb,li,pl,y_,n_,Mb],r_),dX=q([Db,Lb],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),pX=(e,t,n,r,i,a,s)=>{if(!(!e||!n||!r||!i)&&oX(e,s)){var l=eK(e,t),c=h_(l,a,i,n,r),u=iX(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},fX=(e,t,n,r,i,a,s)=>{if(!(!e||!r||!i||!a||!n)){var l=WH(e,n);if(l){var c=tK(l,t),u=h_(c,s,a,r,i),p=aX(t,a,u,l);return{activeIndex:String(u),activeCoordinate:p}}}},hX=(e,t,n,r,i,a,s,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?pX(e,t,r,i,a,s,l):fX(e,t,n,r,i,a,s)},mX=q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),gX=q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(tn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:p7}});function kC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kC(Object(n),!0).forEach(function(r){vX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vX(e,t,n){return(t=yX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yX(e){var t=xX(e,"string");return typeof t=="symbol"?t:t+""}function xX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bX={},jX={zIndexMap:Object.values(tn).reduce((e,t)=>CC(CC({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),bX)},wX=new Set(Object.values(tn));function SX(e){return wX.has(e)}var x_=Wn({name:"zIndex",initialState:jX,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Nt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!SX(n)&&delete e.zIndexMap[n])},prepare:Nt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:Nt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:Nt()}}}),{registerZIndexPortal:kX,unregisterZIndexPortal:xg,registerZIndexPortalElement:CX,unregisterZIndexPortalElement:PX}=x_.actions,EX=x_.reducer;function er(e){var{zIndex:t,children:n}=e,r=AK(),i=r&&t!==void 0&&t!==0,a=jn(),s=f.useRef(void 0),l=f.useRef(new Set),c=wt(),u=Ne(d=>mX(d,t,a));if(f.useLayoutEffect(()=>{if(!i){var d=l.current;d.forEach(m=>{c(xg({zIndex:m}))}),d.clear(),s.current=void 0;return}if(l.current.has(t)||(c(kX({zIndex:t})),l.current.add(t)),u){s.current=u;var h=l.current;h.forEach(m=>{m!==t&&(c(xg({zIndex:m})),h.delete(m))})}},[c,t,i,u]),f.useLayoutEffect(()=>{var d=l.current;return()=>{d.forEach(h=>{c(xg({zIndex:h}))}),d.clear()}},[c]),!i)return n;var p=u??s.current;return p?mu.createPortal(n,p):null}function Ty(){return Ty=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ty.apply(null,arguments)}function PC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PC(Object(n),!0).forEach(function(r){TX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TX(e,t,n){return(t=AX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AX(e){var t=OX(e,"string");return typeof t=="symbol"?t:t+""}function OX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IX(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return f.isValidElement(t)?f.cloneElement(t,r):f.createElement(n,r)}function NX(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:s,layout:l,cursor:c,tooltipEventType:u,chartName:p}=e,d=n,h=r,m=i;if(!c||!d||p!=="ScatterChart"&&u!=="axis")return null;var g,y,x;if(p==="ScatterChart")g=d,y=iH,x=tn.cursorLine;else if(p==="BarChart")g=aH(l,d,a,s),y=lI,x=tn.cursorRectangle;else if(l==="radial"&&LA(d)){var{cx:v,cy:b,radius:j,startAngle:w,endAngle:k}=uI(d);g={cx:v,cy:b,startAngle:w,endAngle:k,innerRadius:j,outerRadius:j},y=pI,x=tn.cursorLine}else g={points:qH(l,d,a)},y=Hs,x=tn.cursorLine;var S=typeof c=="object"&&"className"in c?c.className:void 0,E=Nd(Nd(Nd(Nd({stroke:"#ccc",pointerEvents:"none"},a),g),Uo(c)),{},{payload:h,payloadIndex:m,className:dt("recharts-tooltip-cursor",S)});return f.createElement(er,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:x},f.createElement(IX,{cursor:c,cursorComp:y,cursorProps:E}))}function _X(e){var t=eX(),n=KO(),r=Za(),i=m_();return t==null||n==null||r==null||i==null?null:f.createElement(NX,Ty({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var b_=f.createContext(null),MX=()=>f.useContext(b_),j_={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,p){this.fn=c,this.context=u,this.once=p||!1}function a(c,u,p,d,h){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new i(p,d||c,h),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],m]:c._events[g].push(m):(c._events[g]=m,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],p,d;if(this._eventsCount===0)return u;for(d in p=this._events)t.call(p,d)&&u.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(p)):u},l.prototype.listeners=function(u){var p=n?n+u:u,d=this._events[p];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,m=d.length,g=new Array(m);h<m;h++)g[h]=d[h].fn;return g},l.prototype.listenerCount=function(u){var p=n?n+u:u,d=this._events[p];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,p,d,h,m,g){var y=n?n+u:u;if(!this._events[y])return!1;var x=this._events[y],v=arguments.length,b,j;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),v){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,p),!0;case 3:return x.fn.call(x.context,p,d),!0;case 4:return x.fn.call(x.context,p,d,h),!0;case 5:return x.fn.call(x.context,p,d,h,m),!0;case 6:return x.fn.call(x.context,p,d,h,m,g),!0}for(j=1,b=new Array(v-1);j<v;j++)b[j-1]=arguments[j];x.fn.apply(x.context,b)}else{var w=x.length,k;for(j=0;j<w;j++)switch(x[j].once&&this.removeListener(u,x[j].fn,void 0,!0),v){case 1:x[j].fn.call(x[j].context);break;case 2:x[j].fn.call(x[j].context,p);break;case 3:x[j].fn.call(x[j].context,p,d);break;case 4:x[j].fn.call(x[j].context,p,d,h);break;default:if(!b)for(k=1,b=new Array(v-1);k<v;k++)b[k-1]=arguments[k];x[j].fn.apply(x[j].context,b)}}return!0},l.prototype.on=function(u,p,d){return a(this,u,p,d,!1)},l.prototype.once=function(u,p,d){return a(this,u,p,d,!0)},l.prototype.removeListener=function(u,p,d,h){var m=n?n+u:u;if(!this._events[m])return this;if(!p)return s(this,m),this;var g=this._events[m];if(g.fn)g.fn===p&&(!h||g.once)&&(!d||g.context===d)&&s(this,m);else{for(var y=0,x=[],v=g.length;y<v;y++)(g[y].fn!==p||h&&!g[y].once||d&&g[y].context!==d)&&x.push(g[y]);x.length?this._events[m]=x.length===1?x[0]:x:s(this,m)}return this},l.prototype.removeAllListeners=function(u){var p;return u?(p=n?n+u:u,this._events[p]&&s(this,p)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(j_);var RX=j_.exports;const DX=hl(RX);var su=new DX,Ay="recharts.syncEvent.tooltip",EC="recharts.syncEvent.brush",Kh=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ii(n))return e[n]}},LX={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},w_=Wn({name:"options",initialState:LX,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),zX=w_.reducer,{createEventEmitter:$X}=w_.actions;function BX(e){return e.tooltip.syncInteraction}var FX={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},S_=Wn({name:"chartData",initialState:FX,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:TC,setDataStartEndIndexes:UX,setComputedData:Nae}=S_.actions,WX=S_.reducer,KX=["x","y"];function AC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ps(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AC(Object(n),!0).forEach(function(r){HX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HX(e,t,n){return(t=VX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VX(e){var t=qX(e,"string");return typeof t=="symbol"?t:t+""}function qX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YX(e,t){if(e==null)return{};var n,r,i=GX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function XX(){var e=Ne(M0),t=Ne(R0),n=wt(),r=Ne(AI),i=Ne(pa),a=Za(),s=Sh(),l=Ne(c=>c.rootProps.className);f.useEffect(()=>{if(e==null)return Qa;var c=(u,p,d)=>{if(t!==d&&e===u){if(p.payload.active===!1){n(cc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var h;if(s&&p!==null&&p!==void 0&&(h=p.payload)!==null&&h!==void 0&&h.coordinate&&p.payload.sourceViewBox){var m=p.payload.coordinate,{x:g,y}=m,x=YX(m,KX),{x:v,y:b,width:j,height:w}=p.payload.sourceViewBox,k=ps(ps({},x),{},{x:s.x+(j?(g-v)/j:0)*s.width,y:s.y+(w?(y-b)/w:0)*s.height});n(ps(ps({},p),{},{payload:ps(ps({},p.payload),{},{coordinate:k})}))}else n(p);return}if(i!=null){var S;if(typeof r=="function"){var E={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},A=r(i,E);S=i[A]}else r==="value"&&(S=i.find(B=>String(B.value)===p.payload.label));var{coordinate:D}=p.payload;if(D==null||s==null){n(cc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(S==null){n(cc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:T,y:I}=D,_=Math.min(T,s.x+s.width),G=Math.min(I,s.y+s.height),K={x:a==="horizontal"?S.coordinate:_,y:a==="horizontal"?G:S.coordinate},O=cc({active:p.payload.active,coordinate:K,dataKey:p.payload.dataKey,index:String(S.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(O)}}};return su.on(Ay,c),()=>{su.off(Ay,c)}},[l,n,t,e,r,i,a,s])}function QX(){var e=Ne(M0),t=Ne(R0),n=wt();f.useEffect(()=>{if(e==null)return Qa;var r=(i,a,s)=>{t!==s&&e===i&&n(UX(a))};return su.on(EC,r),()=>{su.off(EC,r)}},[n,t,e])}function JX(){var e=wt();f.useEffect(()=>{e($X())},[e]),XX(),QX()}function ZX(e,t,n,r,i,a){var s=Ne(g=>lX(g,e,t)),l=Ne(p_),c=Ne(R0),u=Ne(M0),p=Ne(AI),d=Ne(BX),h=(d==null?void 0:d.sourceViewBox)!=null,m=Sh();f.useEffect(()=>{if(!h&&u!=null&&c!=null){var g=cc({active:a,coordinate:n,dataKey:s,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:m,graphicalItemId:l});su.emit(Ay,u,g,c)}},[h,n,s,l,i,r,c,u,p,a,m])}function OC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function IC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OC(Object(n),!0).forEach(function(r){eQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eQ(e,t,n){return(t=tQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tQ(e){var t=nQ(e,"string");return typeof t=="symbol"?t:t+""}function nQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rQ(e){return e.dataKey}function iQ(e,t){return f.isValidElement(e)?f.cloneElement(e,t):typeof e=="function"?f.createElement(e,t):f.createElement(_9,t)}var NC=[],aQ={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function ys(e){var t,n,r=nn(e,aQ),{active:i,allowEscapeViewBox:a,animationDuration:s,animationEasing:l,content:c,filterNull:u,isAnimationActive:p,offset:d,payloadUniqBy:h,position:m,reverseDirection:g,useTranslate3d:y,wrapperStyle:x,cursor:v,shared:b,trigger:j,defaultIndex:w,portal:k,axisId:S}=r,E=wt(),A=typeof w=="number"?String(w):w;f.useEffect(()=>{E(ZY({shared:b,trigger:j,axisId:S,active:i,defaultIndex:A}))},[E,b,j,S,i,A]);var D=Sh(),T=rI(),I=qY(b),{activeIndex:_,isActive:G}=(t=Ne(de=>dX(de,I,j,A)))!==null&&t!==void 0?t:{},K=Ne(de=>uX(de,I,j,A)),O=Ne(de=>y_(de,I,j,A)),B=Ne(de=>cX(de,I,j,A)),W=K,R=MX(),$=(n=i??G)!==null&&n!==void 0?n:!1,[P,F]=iO([W,$]),re=I==="axis"?O:void 0;ZX(I,j,B,re,_,$);var N=k??R;if(N==null||D==null||I==null)return null;var pe=W??NC;$||(pe=NC),u&&pe.length&&(pe=XA(pe.filter(de=>de.value!=null&&(de.hide!==!0||r.includeHidden)),h,rQ));var ve=pe.length>0,X=IC(IC({},r),{},{payload:pe,label:re,active:$,activeIndex:_,coordinate:B,accessibilityLayer:T}),oe=f.createElement(K9,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:p,active:$,coordinate:B,hasPayload:ve,offset:d,position:m,reverseDirection:g,useTranslate3d:y,viewBox:D,wrapperStyle:x,lastBoundingBox:P,innerRef:F,hasPortalFromProps:!!k},iQ(c,X));return f.createElement(f.Fragment,null,mu.createPortal(oe,N),$&&f.createElement(_X,{cursor:v,tooltipEventType:I,coordinate:B,payload:pe,index:_}))}var Wu=e=>null;Wu.displayName="Cell";function oQ(e,t,n){return(t=sQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sQ(e){var t=lQ(e,"string");return typeof t=="symbol"?t:t+""}function lQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class cQ{constructor(t){oQ(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function _C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_C(Object(n),!0).forEach(function(r){dQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_C(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dQ(e,t,n){return(t=pQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pQ(e){var t=fQ(e,"string");return typeof t=="symbol"?t:t+""}function fQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hQ={cacheSize:2e3,enableCache:!0},k_=uQ({},hQ),MC=new cQ(k_.cacheSize),mQ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},RC="recharts_measurement_span";function gQ(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",s=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(s,"|").concat(l)}var DC=(e,t)=>{try{var n=document.getElementById(RC);n||(n=document.createElement("span"),n.setAttribute("id",RC),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,mQ,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Cc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Au.isSsr)return{width:0,height:0};if(!k_.enableCache)return DC(t,n);var r=gQ(t,n),i=MC.get(r);if(i)return i;var a=DC(t,n);return MC.set(r,a),a},C_;function vQ(e,t,n){return(t=yQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yQ(e){var t=xQ(e,"string");return typeof t=="symbol"?t:t+""}function xQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var LC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,zC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,bQ=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,jQ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,wQ={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},SQ=["cm","mm","pt","pc","in","Q","px"];function kQ(e){return SQ.includes(e)}var Ns="NaN";function CQ(e,t){return e*wQ[t]}class Tn{static parse(t){var n,[,r,i]=(n=jQ.exec(t))!==null&&n!==void 0?n:[];return r==null?Tn.NaN:new Tn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ii(t)&&(this.unit=""),n!==""&&!bQ.test(n)&&(this.num=NaN,this.unit=""),kQ(n)&&(this.num=CQ(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Tn(NaN,""):new Tn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Tn(NaN,""):new Tn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Tn(NaN,""):new Tn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Tn(NaN,""):new Tn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ii(this.num)}}C_=Tn;vQ(Tn,"NaN",new C_(NaN,""));function P_(e){if(e==null||e.includes(Ns))return Ns;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=LC.exec(t))!==null&&n!==void 0?n:[],s=Tn.parse(r??""),l=Tn.parse(a??""),c=i==="*"?s.multiply(l):s.divide(l);if(c.isNaN())return Ns;t=t.replace(LC,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,p,d,h]=(u=zC.exec(t))!==null&&u!==void 0?u:[],m=Tn.parse(p??""),g=Tn.parse(h??""),y=d==="+"?m.add(g):m.subtract(g);if(y.isNaN())return Ns;t=t.replace(zC,y.toString())}return t}var $C=/\(([^()]*)\)/;function PQ(e){for(var t=e,n;(n=$C.exec(t))!=null;){var[,r]=n;t=t.replace($C,P_(r))}return t}function EQ(e){var t=e.replace(/\s+/g,"");return t=PQ(t),t=P_(t),t}function TQ(e){try{return EQ(e)}catch{return Ns}}function bg(e){var t=TQ(e.slice(5,-1));return t===Ns?"":t}var AQ=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],OQ=["dx","dy","angle","className","breakAll"];function Oy(){return Oy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oy.apply(null,arguments)}function BC(e,t){if(e==null)return{};var n,r,i=IQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function IQ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var E_=/[ \f\n\r\t\v\u2028\u2029]+/,T_=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Rt(t)||(n?i=t.toString().split(""):i=t.toString().split(E_));var a=i.map(l=>({word:l,width:Cc(l,r).width})),s=n?0:Cc(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}};function A_(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function NQ(e){return Rt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var O_=(e,t,n,r)=>e.reduce((i,a)=>{var{word:s,width:l}=a,c=i[i.length-1];if(c&&l!=null&&(t==null||r||c.width+l+n<Number(t)))c.words.push(s),c.width+=l+n;else{var u={words:[s],width:l};i.push(u)}return i},[]),I_=e=>e.reduce((t,n)=>t.width>n.width?t:n),_Q="…",FC=(e,t,n,r,i,a,s,l)=>{var c=e.slice(0,t),u=T_({breakAll:n,style:r,children:c+_Q});if(!u)return[!1,[]];var p=O_(u.wordsWithComputedWidth,a,s,l),d=p.length>i||I_(p).width>Number(a);return[d,p]},MQ=(e,t,n,r,i)=>{var{maxLines:a,children:s,style:l,breakAll:c}=e,u=Ce(a),p=String(s),d=O_(t,r,n,i);if(!u||i)return d;var h=d.length>a||I_(d).width>Number(r);if(!h)return d;for(var m=0,g=p.length-1,y=0,x;m<=g&&y<=p.length-1;){var v=Math.floor((m+g)/2),b=v-1,[j,w]=FC(p,b,c,l,a,r,n,i),[k]=FC(p,v,c,l,a,r,n,i);if(!j&&!k&&(m=v+1),j&&k&&(g=v-1),!j&&k){x=w;break}y++}return x||d},UC=e=>{var t=Rt(e)?[]:e.toString().split(E_);return[{words:t,width:void 0}]},RQ=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:s}=e;if((t||n)&&!Au.isSsr){var l,c,u=T_({breakAll:a,children:r,style:i});if(u){var{wordsWithComputedWidth:p,spaceWidth:d}=u;l=p,c=d}else return UC(r);return MQ({breakAll:a,children:r,maxLines:s,style:i},l,c,t,!!n)}return UC(r)},N_="#808080",DQ={angle:0,breakAll:!1,capHeight:"0.71em",fill:N_,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Hh=f.forwardRef((e,t)=>{var n=nn(e,DQ),{x:r,y:i,lineHeight:a,capHeight:s,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:p}=n,d=BC(n,AQ),h=f.useMemo(()=>RQ({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),{dx:m,dy:g,angle:y,className:x,breakAll:v}=d,b=BC(d,OQ);if(!Ti(r)||!Ti(i)||h.length===0)return null;var j=Number(r)+(Ce(m)?m:0),w=Number(i)+(Ce(g)?g:0);if(!Je(j)||!Je(w))return null;var k;switch(p){case"start":k=bg("calc(".concat(s,")"));break;case"middle":k=bg("calc(".concat((h.length-1)/2," * -").concat(a," + (").concat(s," / 2))"));break;default:k=bg("calc(".concat(h.length-1," * -").concat(a,")"));break}var S=[],E=h[0];if(c&&E!=null){var A=E.width,{width:D}=d;S.push("scale(".concat(Ce(D)&&Ce(A)?D/A:1,")"))}return y&&S.push("rotate(".concat(y,", ").concat(j,", ").concat(w,")")),S.length&&(b.transform=S.join(" ")),f.createElement("text",Oy({},Fn(b),{ref:t,x:j,y:w,className:dt("recharts-text",x),textAnchor:u,fill:l.includes("url")?N_:l}),h.map((T,I)=>{var _=T.words.join(v?"":" ");return f.createElement("tspan",{x:j,dy:I===0?k:a,key:"".concat(_,"-").concat(I)},_)}))});Hh.displayName="Text";function WC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WC(Object(n),!0).forEach(function(r){LQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LQ(e,t,n){return(t=zQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zQ(e){var t=$Q(e,"string");return typeof t=="symbol"?t:t+""}function $Q(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BQ=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:s,height:l,upperWidth:c,lowerWidth:u}=k0(t),p=a,d=a+(c-u)/2,h=(p+d)/2,m=(c+u)/2,g=p+c/2,y=l>=0?1:-1,x=y*r,v=y>0?"end":"start",b=y>0?"start":"end",j=c>=0?1:-1,w=j*r,k=j>0?"end":"start",S=j>0?"start":"end",E=i;if(n==="top"){var A={x:p+c/2,y:s-x,horizontalAnchor:"middle",verticalAnchor:v};return E&&(A.height=Math.max(s-E.y,0),A.width=c),A}if(n==="bottom"){var D={x:d+u/2,y:s+l+x,horizontalAnchor:"middle",verticalAnchor:b};return E&&(D.height=Math.max(E.y+E.height-(s+l),0),D.width=u),D}if(n==="left"){var T={x:h-w,y:s+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return E&&(T.width=Math.max(T.x-E.x,0),T.height=l),T}if(n==="right"){var I={x:h+m+w,y:s+l/2,horizontalAnchor:S,verticalAnchor:"middle"};return E&&(I.width=Math.max(E.x+E.width-I.x,0),I.height=l),I}var _=E?{width:m,height:l}:{};return n==="insideLeft"?hi({x:h+w,y:s+l/2,horizontalAnchor:S,verticalAnchor:"middle"},_):n==="insideRight"?hi({x:h+m-w,y:s+l/2,horizontalAnchor:k,verticalAnchor:"middle"},_):n==="insideTop"?hi({x:p+c/2,y:s+x,horizontalAnchor:"middle",verticalAnchor:b},_):n==="insideBottom"?hi({x:d+u/2,y:s+l-x,horizontalAnchor:"middle",verticalAnchor:v},_):n==="insideTopLeft"?hi({x:p+w,y:s+x,horizontalAnchor:S,verticalAnchor:b},_):n==="insideTopRight"?hi({x:p+c-w,y:s+x,horizontalAnchor:k,verticalAnchor:b},_):n==="insideBottomLeft"?hi({x:d+w,y:s+l-x,horizontalAnchor:S,verticalAnchor:v},_):n==="insideBottomRight"?hi({x:d+u-w,y:s+l-x,horizontalAnchor:k,verticalAnchor:v},_):n&&typeof n=="object"&&(Ce(n.x)||Ko(n.x))&&(Ce(n.y)||Ko(n.y))?hi({x:a+$n(n.x,m),y:s+$n(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},_):hi({x:g,y:s+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},_)},FQ=["labelRef"],UQ=["content"];function KC(e,t){if(e==null)return{};var n,r,i=WQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function WQ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function HC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HC(Object(n),!0).forEach(function(r){KQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KQ(e,t,n){return(t=HQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HQ(e){var t=VQ(e,"string");return typeof t=="symbol"?t:t+""}function VQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ui(){return Ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ui.apply(null,arguments)}var __=f.createContext(null),qQ=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:s,children:l}=e,c=f.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:s}),[t,n,r,i,a,s]);return f.createElement(__.Provider,{value:c},l)},M_=()=>{var e=f.useContext(__),t=Sh();return e||(t?k0(t):void 0)},YQ=f.createContext(null),GQ=()=>{var e=f.useContext(YQ),t=Ne(MI);return e||t},XQ=e=>{var{value:t,formatter:n}=e,r=Rt(e.children)?t:e.children;return typeof n=="function"?n(r):r},zb=e=>e!=null&&typeof e=="function",QQ=(e,t)=>{var n=xn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},JQ=(e,t,n,r,i)=>{var{offset:a,className:s}=e,{cx:l,cy:c,innerRadius:u,outerRadius:p,startAngle:d,endAngle:h,clockWise:m}=i,g=(u+p)/2,y=QQ(d,h),x=y>=0?1:-1,v,b;switch(t){case"insideStart":v=d+x*a,b=m;break;case"insideEnd":v=h-x*a,b=!m;break;case"end":v=h+x*a,b=m;break;default:throw new Error("Unsupported position ".concat(t))}b=y<=0?b:!b;var j=on(l,c,g,v),w=on(l,c,g,v+(b?1:-1)*359),k="M".concat(j.x,",").concat(j.y,`
|
|
460
|
-
A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
|
|
461
|
-
`).concat(w.x,",").concat(w.y),S=Rt(e.id)?Yc("recharts-radial-line-"):e.id;return f.createElement("text",Ui({},r,{dominantBaseline:"central",className:dt("recharts-radial-bar-label",s)}),f.createElement("defs",null,f.createElement("path",{id:S,d:k})),f.createElement("textPath",{xlinkHref:"#".concat(S)},n))},ZQ=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:s,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(n==="outside"){var{x:p,y:d}=on(r,i,s+t,u);return{x:p,y:d,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var h=(a+s)/2,{x:m,y:g}=on(r,i,h,u);return{x:m,y:g,textAnchor:"middle",verticalAnchor:"middle"}},np=e=>e!=null&&"cx"in e&&Ce(e.cx),eJ={angle:0,offset:5,zIndex:tn.label,position:"middle",textBreakAll:!1};function tJ(e){if(!np(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function wa(e){var t=nn(e,eJ),{viewBox:n,parentViewBox:r,position:i,value:a,children:s,content:l,className:c="",textBreakAll:u,labelRef:p}=t,d=GQ(),h=M_(),m=i==="center"?h:d??h,g,y,x;n==null?g=m:np(n)?g=n:g=k0(n);var v=tJ(g);if(!g||Rt(a)&&Rt(s)&&!f.isValidElement(l)&&typeof l!="function")return null;var b=uc(uc({},t),{},{viewBox:g});if(f.isValidElement(l)){var{labelRef:j}=b,w=KC(b,FQ);return f.cloneElement(l,w)}if(typeof l=="function"){var{content:k}=b,S=KC(b,UQ);if(y=f.createElement(l,S),f.isValidElement(y))return y}else y=XQ(t);var E=Fn(t);if(np(g)){if(i==="insideStart"||i==="insideEnd"||i==="end")return JQ(t,i,y,E,g);x=ZQ(g,t.offset,t.position)}else{if(!v)return null;var A=BQ({viewBox:v,position:i,offset:t.offset,parentViewBox:np(r)?void 0:r});x=uc(uc({x:A.x,y:A.y,textAnchor:A.horizontalAnchor,verticalAnchor:A.verticalAnchor},A.width!==void 0?{width:A.width}:{}),A.height!==void 0?{height:A.height}:{})}return f.createElement(er,{zIndex:t.zIndex},f.createElement(Hh,Ui({ref:p,className:dt("recharts-label",c)},E,x,{textAnchor:A_(E.textAnchor)?E.textAnchor:x.textAnchor,breakAll:u}),y))}wa.displayName="Label";var nJ=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?f.createElement(wa,Ui({key:"label-implicit"},r)):Ti(e)?f.createElement(wa,Ui({key:"label-implicit",value:e},r)):f.isValidElement(e)?e.type===wa?f.cloneElement(e,uc({key:"label-implicit"},r)):f.createElement(wa,Ui({key:"label-implicit",content:e},r)):zb(e)?f.createElement(wa,Ui({key:"label-implicit",content:e},r)):e&&typeof e=="object"?f.createElement(wa,Ui({},e,{key:"label-implicit"},r)):null};function rJ(e){var{label:t,labelRef:n}=e,r=M_();return nJ(t,r,n)||null}var iJ=["valueAccessor"],aJ=["dataKey","clockWise","id","textBreakAll","zIndex"];function Cf(){return Cf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cf.apply(null,arguments)}function VC(e,t){if(e==null)return{};var n,r,i=oJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var sJ=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(NQ(t))return t},R_=f.createContext(void 0),$b=R_.Provider,D_=f.createContext(void 0),lJ=D_.Provider;function cJ(){return f.useContext(R_)}function uJ(){return f.useContext(D_)}function rp(e){var{valueAccessor:t=sJ}=e,n=VC(e,iJ),{dataKey:r,clockWise:i,id:a,textBreakAll:s,zIndex:l}=n,c=VC(n,aJ),u=cJ(),p=uJ(),d=u||p;return!d||!d.length?null:f.createElement(er,{zIndex:l??tn.label},f.createElement(Ht,{className:"recharts-label-list"},d.map((h,m)=>{var g,y=Rt(r)?t(h,m):ft(h.payload,r),x=Rt(a)?{}:{id:"".concat(a,"-").concat(m)};return f.createElement(wa,Cf({key:"label-".concat(m)},Fn(h),c,x,{fill:(g=n.fill)!==null&&g!==void 0?g:h.fill,parentViewBox:h.parentViewBox,value:y,textBreakAll:s,viewBox:h.viewBox,index:m,zIndex:0}))})))}rp.displayName="LabelList";function Vh(e){var{label:t}=e;return t?t===!0?f.createElement(rp,{key:"labelList-implicit"}):f.isValidElement(t)||zb(t)?f.createElement(rp,{key:"labelList-implicit",content:t}):typeof t=="object"?f.createElement(rp,Cf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Iy(){return Iy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iy.apply(null,arguments)}var L_=e=>{var{cx:t,cy:n,r,className:i}=e,a=dt("recharts-dot",i);return Ce(t)&&Ce(n)&&Ce(r)?f.createElement("circle",Iy({},Xn(e),f0(e),{className:a,cx:t,cy:n,r})):null},z_=e=>e.graphicalItems.polarItems,dJ=q([Vt,_u],db),qh=q([z_,Qt,dJ],pb),pJ=q([qh],fb),Yh=q([pJ,Ou],hb),fJ=q([Yh,Qt,qh],CN);q([Yh,Qt,qh],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,s=ft(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:s,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:ft(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var qC=()=>{},hJ=q([Yh,Qt,qh,Bh,Vt,XH],xb),mJ=q([Qt,vb,yb,qC,hJ,qC,ot,Vt],bb),$_=q([Qt,ot,Yh,fJ,Nu,Vt,mJ],jb),gJ=q([$_,Tl,no],Sb),vJ=q([Qt,$_,gJ,Vt],Cb);q([no,vJ],DI);var yJ={radiusAxis:{},angleAxis:{}},B_=Wn({name:"polarAxis",initialState:yJ,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:_ae,removeRadiusAxis:Mae,addAngleAxis:Rae,removeAngleAxis:Dae}=B_.actions,xJ=B_.reducer;function F_(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function YC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function GC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YC(Object(n),!0).forEach(function(r){bJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bJ(e,t,n){return(t=jJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jJ(e){var t=wJ(e,"string");return typeof t=="symbol"?t:t+""}function wJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SJ=(e,t)=>t,Bb=q([z_,SJ],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),kJ=[],Fb=(e,t,n)=>(n==null?void 0:n.length)===0?kJ:n,U_=q([Ou,Bb,Fb],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(a=>GC(GC({},t.presentationProps),a.props))),i!=null)return i}}),CJ=q([U_,Bb,Fb],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,s=ft(r,t.nameKey,t.name),l;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:Ja(s,t.dataKey),color:l,payload:r,type:t.legendType}})}),PJ=q([U_,Bb,Fb,fn],(e,t,n,r)=>{if(!(t==null||e==null))return EZ({offset:r,pieSettings:t,displayedData:e,cells:n})}),W_={exports:{}},Pt={};/**
|
|
462
|
-
* @license React
|
|
463
|
-
* react-is.production.js
|
|
464
|
-
*
|
|
465
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
466
|
-
*
|
|
467
|
-
* This source code is licensed under the MIT license found in the
|
|
468
|
-
* LICENSE file in the root directory of this source tree.
|
|
469
|
-
*/var Ub=Symbol.for("react.transitional.element"),Wb=Symbol.for("react.portal"),Gh=Symbol.for("react.fragment"),Xh=Symbol.for("react.strict_mode"),Qh=Symbol.for("react.profiler"),Jh=Symbol.for("react.consumer"),Zh=Symbol.for("react.context"),em=Symbol.for("react.forward_ref"),tm=Symbol.for("react.suspense"),nm=Symbol.for("react.suspense_list"),rm=Symbol.for("react.memo"),im=Symbol.for("react.lazy"),EJ=Symbol.for("react.view_transition"),TJ=Symbol.for("react.client.reference");function Ur(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Ub:switch(e=e.type,e){case Gh:case Qh:case Xh:case tm:case nm:case EJ:return e;default:switch(e=e&&e.$$typeof,e){case Zh:case em:case im:case rm:return e;case Jh:return e;default:return t}}case Wb:return t}}}Pt.ContextConsumer=Jh;Pt.ContextProvider=Zh;Pt.Element=Ub;Pt.ForwardRef=em;Pt.Fragment=Gh;Pt.Lazy=im;Pt.Memo=rm;Pt.Portal=Wb;Pt.Profiler=Qh;Pt.StrictMode=Xh;Pt.Suspense=tm;Pt.SuspenseList=nm;Pt.isContextConsumer=function(e){return Ur(e)===Jh};Pt.isContextProvider=function(e){return Ur(e)===Zh};Pt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ub};Pt.isForwardRef=function(e){return Ur(e)===em};Pt.isFragment=function(e){return Ur(e)===Gh};Pt.isLazy=function(e){return Ur(e)===im};Pt.isMemo=function(e){return Ur(e)===rm};Pt.isPortal=function(e){return Ur(e)===Wb};Pt.isProfiler=function(e){return Ur(e)===Qh};Pt.isStrictMode=function(e){return Ur(e)===Xh};Pt.isSuspense=function(e){return Ur(e)===tm};Pt.isSuspenseList=function(e){return Ur(e)===nm};Pt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Gh||e===Qh||e===Xh||e===tm||e===nm||typeof e=="object"&&e!==null&&(e.$$typeof===im||e.$$typeof===rm||e.$$typeof===Zh||e.$$typeof===Jh||e.$$typeof===em||e.$$typeof===TJ||e.getModuleId!==void 0)};Pt.typeOf=Ur;W_.exports=Pt;var AJ=W_.exports,XC=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",QC=null,jg=null,K_=e=>{if(e===QC&&Array.isArray(jg))return jg;var t=[];return f.Children.forEach(e,n=>{Rt(n)||(AJ.isFragment(n)?t=t.concat(K_(n.props.children)):t.push(n))}),jg=t,QC=e,t};function Kb(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>XC(i)):r=[XC(t)],K_(e).forEach(i=>{var a=Ei(i,"type.displayName")||Ei(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var Hb=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function OJ(e){var n;if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!((n=Object.getOwnPropertyDescriptor(e,Symbol.toStringTag))!=null&&n.writable)?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var JC,ZC,eP,tP,nP;function rP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function iP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rP(Object(n),!0).forEach(function(r){IJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IJ(e,t,n){return(t=NJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NJ(e){var t=_J(e,"string");return typeof t=="symbol"?t:t+""}function _J(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pf(){return Pf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pf.apply(null,arguments)}function ec(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var aP=(e,t,n,r,i)=>{var a=n-r,s;return s=Gt(JC||(JC=ec(["M ",",",""])),e,t),s+=Gt(ZC||(ZC=ec(["L ",",",""])),e+n,t),s+=Gt(eP||(eP=ec(["L ",",",""])),e+n-a/2,t+i),s+=Gt(tP||(tP=ec(["L ",",",""])),e+n-a/2-r,t+i),s+=Gt(nP||(nP=ec(["L ",","," Z"])),e,t),s},MJ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},RJ=e=>{var t=nn(e,MJ),{x:n,y:r,upperWidth:i,lowerWidth:a,height:s,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:p,isUpdateAnimationActive:d}=t,h=f.useRef(null),[m,g]=f.useState(-1),y=f.useRef(i),x=f.useRef(a),v=f.useRef(s),b=f.useRef(n),j=f.useRef(r),w=Sl(e,"trapezoid-");if(f.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var K=h.current.getTotalLength();K&&g(K)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||s!==+s||i===0&&a===0||s===0)return null;var k=dt("recharts-trapezoid",l);if(!d)return f.createElement("g",null,f.createElement("path",Pf({},Fn(t),{className:k,d:aP(n,r,i,a,s)})));var S=y.current,E=x.current,A=v.current,D=b.current,T=j.current,I="0px ".concat(m===-1?1:m,"px"),_="".concat(m,"px ").concat(m,"px"),G=iI(["strokeDasharray"],u,c);return f.createElement(wl,{animationId:w,key:w,canBegin:m>0,duration:u,easing:c,isActive:d,begin:p},K=>{var O=yt(S,i,K),B=yt(E,a,K),W=yt(A,s,K),R=yt(D,n,K),$=yt(T,r,K);h.current&&(y.current=O,x.current=B,v.current=W,b.current=R,j.current=$);var P=K>0?{transition:G,strokeDasharray:_}:{strokeDasharray:I};return f.createElement("path",Pf({},Fn(t),{className:k,d:aP(R,$,O,B,W),ref:h,style:iP(iP({},P),t.style)}))})},DJ=["option","shapeType","activeClassName","inActiveClassName"];function LJ(e,t){if(e==null)return{};var n,r,i=zJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function oP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ef(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oP(Object(n),!0).forEach(function(r){$J(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $J(e,t,n){return(t=BJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BJ(e){var t=FJ(e,"string");return typeof t=="symbol"?t:t+""}function FJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UJ(e,t){return Ef(Ef({},t),e)}function WJ(e,t){return e==="symbols"}function sP(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return f.createElement(lI,n);case"trapezoid":return f.createElement(RJ,n);case"sector":return f.createElement(pI,n);case"symbols":if(WJ(t))return f.createElement(p0,n);break;case"curve":return f.createElement(Hs,n);default:return null}}function KJ(e){return f.isValidElement(e)?e.props:e}function Vb(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=LJ(e,DJ),s;if(f.isValidElement(t))s=f.cloneElement(t,Ef(Ef({},a),KJ(t)));else if(typeof t=="function")s=t(a,a.index);else if(OJ(t)&&typeof t!="boolean"){var l=UJ(t,a);s=f.createElement(sP,{shapeType:n,elementProps:l})}else{var c=a;s=f.createElement(sP,{shapeType:n,elementProps:c})}return a.isActive?f.createElement(Ht,{className:r},s):f.createElement(Ht,{className:i},s)}var qb=(e,t,n)=>{var r=wt();return(i,a)=>s=>{e==null||e(i,a,s),r(XN({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Yb=e=>{var t=wt();return(n,r)=>i=>{e==null||e(n,r,i),t(eG())}},Gb=(e,t,n)=>{var r=wt();return(i,a)=>s=>{e==null||e(i,a,s),r(tG({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function am(e){var{tooltipEntrySettings:t}=e,n=wt(),r=jn(),i=f.useRef(null);return f.useLayoutEffect(()=>{r||(i.current===null?n(XY(t)):i.current!==t&&n(QY({prev:i.current,next:t})),i.current=t)},[t,n,r]),f.useLayoutEffect(()=>()=>{i.current&&(n(JY(i.current)),i.current=null)},[n]),null}function Xb(e){var{legendPayload:t}=e,n=wt(),r=jn(),i=f.useRef(null);return f.useLayoutEffect(()=>{r||(i.current===null?n(ZO(t)):i.current!==t&&n(eI({prev:i.current,next:t})),i.current=t)},[n,r,t]),f.useLayoutEffect(()=>()=>{i.current&&(n(tI(i.current)),i.current=null)},[n]),null}function HJ(e){var{legendPayload:t}=e,n=wt(),r=Ne(ot),i=f.useRef(null);return f.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(ZO(t)):i.current!==t&&n(eI({prev:i.current,next:t})),i.current=t)},[n,r,t]),f.useLayoutEffect(()=>()=>{i.current&&(n(tI(i.current)),i.current=null)},[n]),null}var wg,VJ=()=>{var[e]=f.useState(()=>Yc("uid-"));return e},qJ=(wg=i2.useId)!==null&&wg!==void 0?wg:VJ;function YJ(e,t){var n=qJ();return t||(e?"".concat(e,"-").concat(n):n)}var GJ=f.createContext(void 0),om=e=>{var{id:t,type:n,children:r}=e,i=YJ("recharts-".concat(n),t);return f.createElement(GJ.Provider,{value:i},r(i))},XJ={cartesianItems:[],polarItems:[]},H_=Wn({name:"graphicalItems",initialState:XJ,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Nt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Rr(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Nt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Rr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Nt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Nt()},removePolarGraphicalItem:{reducer(e,t){var n=Rr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Nt()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Rr(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:Nt()}}}),{addCartesianGraphicalItem:QJ,replaceCartesianGraphicalItem:JJ,removeCartesianGraphicalItem:ZJ,addPolarGraphicalItem:eZ,removePolarGraphicalItem:tZ,replacePolarGraphicalItem:nZ}=H_.actions,rZ=H_.reducer,iZ=e=>{var t=wt(),n=f.useRef(null);return f.useLayoutEffect(()=>{n.current===null?t(QJ(e)):n.current!==e&&t(JJ({prev:n.current,next:e})),n.current=e},[t,e]),f.useLayoutEffect(()=>()=>{n.current&&(t(ZJ(n.current)),n.current=null)},[t]),null},Qb=f.memo(iZ),aZ=e=>{var t=wt(),n=f.useRef(null);return f.useLayoutEffect(()=>{n.current===null?t(eZ(e)):n.current!==e&&t(nZ({prev:n.current,next:e})),n.current=e},[t,e]),f.useLayoutEffect(()=>()=>{n.current&&(t(tZ(n.current)),n.current=null)},[t]),null},oZ=f.memo(aZ),sZ=["key"],lZ=["onMouseEnter","onClick","onMouseLeave"],cZ=["id"],uZ=["id"];function Ha(){return Ha=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ha.apply(null,arguments)}function sm(e,t){if(e==null)return{};var n,r,i=dZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function lP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lP(Object(n),!0).forEach(function(r){pZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pZ(e,t,n){return(t=fZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fZ(e){var t=hZ(e,"string");return typeof t=="symbol"?t:t+""}function hZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mZ(e){var t=f.useMemo(()=>Kb(e.children,Wu),[e.children]),n=Ne(r=>CJ(r,e.id,t));return n==null?null:f.createElement(HJ,{legendPayload:n})}function gZ(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(f.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var vZ=f.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:s,name:l,hide:c,tooltipType:u,id:p,activeShape:d}=e,h=gZ(d),m=r.map(y=>{var x=y.tooltipPayload;return h==null||x==null?x:x.map(v=>Lt(Lt({},v),{},{color:h,fill:h}))}),g={dataDefinedOnItem:m,getPosition:y=>{var x;return(x=r[Number(y)])===null||x===void 0?void 0:x.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:s,dataKey:t,nameKey:n,name:Ja(l,t),hide:c,type:u,color:s,unit:"",graphicalItemId:p}};return f.createElement(am,{tooltipEntrySettings:g})}),yZ=(e,t)=>e>t?"start":e<t?"end":"middle",xZ=(e,t,n)=>$n(typeof t=="function"?t(e):t,n,n*.8),bZ=(e,t,n)=>{var{top:r,left:i,width:a,height:s}=t,l=cI(a,s),c=i+$n(e.cx,a,a/2),u=r+$n(e.cy,s,s/2),p=$n(e.innerRadius,l,0),d=xZ(n,e.outerRadius,l),h=e.maxRadius||Math.sqrt(a*a+s*s)/2;return{cx:c,cy:u,innerRadius:p,outerRadius:d,maxRadius:h}},jZ=(e,t)=>{var n=xn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},wZ=(e,t)=>{if(f.isValidElement(e))return f.cloneElement(e,t);if(typeof e=="function")return e(t);var n=dt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=sm(t,sZ);return f.createElement(Hs,Ha({},i,{type:"linear",className:n}))},SZ=(e,t,n)=>{if(f.isValidElement(e))return f.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),f.isValidElement(r)))return r;var i=dt("recharts-pie-label-text",F_(e));return f.createElement(Hh,Ha({},t,{alignmentBaseline:"middle",className:i}),r)};function kZ(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:s}=n;if(!r||!i||!t)return null;var l=Xn(n),c=Uo(i),u=Uo(a),p=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,d=t.map((h,m)=>{var g=(h.startAngle+h.endAngle)/2,y=on(h.cx,h.cy,h.outerRadius+p,g),x=Lt(Lt(Lt(Lt({},l),h),{},{stroke:"none"},c),{},{index:m,textAnchor:yZ(y.x,h.cx)},y),v=Lt(Lt(Lt(Lt({},l),h),{},{fill:"none",stroke:h.fill},u),{},{index:m,points:[on(h.cx,h.cy,h.outerRadius,g),y],key:"line"});return f.createElement(er,{zIndex:tn.label,key:"label-".concat(h.startAngle,"-").concat(h.endAngle,"-").concat(h.midAngle,"-").concat(m)},f.createElement(Ht,null,a&&wZ(a,v),SZ(i,x,ft(h,s))))});return f.createElement(Ht,{className:"recharts-pie-labels"},d)}function CZ(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?f.createElement(Vh,{label:i}):f.createElement(kZ,{sectors:t,props:n,showLabels:r})}function PZ(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:s}=e,l=Ne(Ka),c=Ne(_b),u=Ne(p_),{onMouseEnter:p,onClick:d,onMouseLeave:h}=i,m=sm(i,lZ),g=qb(p,i.dataKey,s),y=Yb(h),x=Gb(d,i.dataKey,s);return t==null||t.length===0?null:f.createElement(f.Fragment,null,t.map((v,b)=>{if((v==null?void 0:v.startAngle)===0&&(v==null?void 0:v.endAngle)===0&&t.length!==1)return null;var j=u==null||u===s,w=String(b)===l&&(c==null||i.dataKey===c)&&j,k=l?r:null,S=n&&w?n:k,E=Lt(Lt({},v),{},{stroke:v.stroke,tabIndex:-1,[$O]:b,[BO]:s});return f.createElement(Ht,Ha({key:"sector-".concat(v==null?void 0:v.startAngle,"-").concat(v==null?void 0:v.endAngle,"-").concat(v.midAngle,"-").concat(b),tabIndex:-1,className:"recharts-pie-sector"},wu(m,v,b),{onMouseEnter:g(v,b),onMouseLeave:y(v,b),onClick:x(v,b)}),f.createElement(Vb,Ha({option:a??S,index:b,shapeType:"sector",isActive:w},E)))}))}function EZ(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:s,startAngle:l,endAngle:c,dataKey:u,nameKey:p,tooltipType:d}=n,h=Math.abs(n.minAngle),m=jZ(l,c),g=Math.abs(m),y=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,x=r.filter(A=>ft(A,u,0)!==0).length,v=(g>=360?x:x-1)*y,b=r.reduce((A,D)=>{var T=ft(D,u,0);return A+(Ce(T)?T:0)},0),j=h>0&&b>0&&r.some(A=>{var D=ft(A,u,0),T=(Ce(D)?D:0)/b;return D!==0&&T*g<h}),w=j?h:0,k=g-x*w-v,S;if(b>0){var E;S=r.map((A,D)=>{var T=ft(A,u,0),I=ft(A,p,D),_=bZ(n,a,A),G=(Ce(T)?T:0)/b,K,O=Lt(Lt({},A),i&&i[D]&&i[D].props),B=O!=null&&"fill"in O&&typeof O.fill=="string"?O.fill:n.fill;D?K=E.endAngle+xn(m)*y*(T!==0?1:0):K=l;var W=K+xn(m)*((T!==0?w:0)+G*k),R=(K+W)/2,$=(_.innerRadius+_.outerRadius)/2,P=[{name:I,value:T,payload:O,dataKey:u,type:d,color:B,fill:B,graphicalItemId:n.id}],F=on(_.cx,_.cy,$,R);return E=Lt(Lt(Lt(Lt({},n.presentationProps),{},{percent:G,cornerRadius:typeof s=="string"?parseFloat(s):s,name:I,tooltipPayload:P,midAngle:R,middleRadius:$,tooltipPosition:F},O),_),{},{value:T,dataKey:u,startAngle:K,endAngle:W,payload:O,paddingAngle:T!==0?xn(m)*y:0}),E})}return S}function TZ(e){var{showLabels:t,sectors:n,children:r}=e,i=f.useMemo(()=>!t||!n?[]:n.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[n,t]);return f.createElement(lJ,{value:t?i:void 0},r)}function AZ(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:s,animationDuration:l,animationEasing:c,activeShape:u,inactiveShape:p,onAnimationStart:d,onAnimationEnd:h}=t,m=Sl(t,"recharts-pie-"),g=n.current,[y,x]=f.useState(!1),v=f.useCallback(()=>{typeof h=="function"&&h(),x(!1)},[h]),b=f.useCallback(()=>{typeof d=="function"&&d(),x(!0)},[d]);return f.createElement(TZ,{showLabels:!y,sectors:i},f.createElement(wl,{animationId:m,begin:s,duration:l,isActive:a,easing:c,onAnimationStart:b,onAnimationEnd:v,key:m},j=>{var w,k=[],S=i&&i[0],E=(w=S==null?void 0:S.startAngle)!==null&&w!==void 0?w:0;return i==null||i.forEach((A,D)=>{var T=g&&g[D],I=D>0?Ei(A,"paddingAngle",0):0;if(T){var _=yt(T.endAngle-T.startAngle,A.endAngle-A.startAngle,j),G=Lt(Lt({},A),{},{startAngle:E+I,endAngle:E+_+I});k.push(G),E=G.endAngle}else{var{endAngle:K,startAngle:O}=A,B=yt(0,K-O,j),W=Lt(Lt({},A),{},{startAngle:E+I,endAngle:E+B+I});k.push(W),E=W.endAngle}}),n.current=k,f.createElement(Ht,null,f.createElement(PZ,{sectors:k,activeShape:u,inactiveShape:p,allOtherPieProps:t,shape:t.shape,id:r}))}),f.createElement(CZ,{showLabels:!y,sectors:i,props:t}),t.children)}var OZ={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:tn.area};function IZ(e){var{id:t}=e,n=sm(e,cZ),{hide:r,className:i,rootTabIndex:a}=e,s=f.useMemo(()=>Kb(e.children,Wu),[e.children]),l=Ne(p=>PJ(p,t,s)),c=f.useRef(null),u=dt("recharts-pie",i);return r||l==null?(c.current=null,f.createElement(Ht,{tabIndex:a,className:u})):f.createElement(er,{zIndex:e.zIndex},f.createElement(vZ,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),f.createElement(Ht,{tabIndex:a,className:u},f.createElement(AZ,{props:Lt(Lt({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function NZ(e){var t=nn(e,OZ),{id:n}=t,r=sm(t,uZ),i=Xn(r);return f.createElement(om,{id:n,type:"pie"},a=>f.createElement(f.Fragment,null,f.createElement(oZ,{type:"pie",id:a,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),f.createElement(mZ,Ha({},r,{id:a})),f.createElement(IZ,Ha({},r,{id:a}))))}var V_=NZ;V_.displayName="Pie";var _Z=["points"];function cP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cP(Object(n),!0).forEach(function(r){MZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MZ(e,t,n){return(t=RZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RZ(e){var t=DZ(e,"string");return typeof t=="symbol"?t:t+""}function DZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tf(){return Tf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tf.apply(null,arguments)}function LZ(e,t){if(e==null)return{};var n,r,i=zZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function $Z(e){var{option:t,dotProps:n,className:r}=e;if(f.isValidElement(t))return f.cloneElement(t,n);if(typeof t=="function")return t(n);var i=dt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:s}=a,l=LZ(a,_Z);return f.createElement(L_,Tf({},l,{className:i}))}function BZ(e,t){return e==null?!1:t?!0:e.length===1}function q_(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:s,needClip:l,clipPathId:c,zIndex:u=tn.scatter}=e;if(!BZ(t,n))return null;var p=Hb(n),d=JB(n),h=t.map((g,y)=>{var x,v,b=Sg(Sg(Sg({r:3},s),d),{},{index:y,cx:(x=g.x)!==null&&x!==void 0?x:void 0,cy:(v=g.y)!==null&&v!==void 0?v:void 0,dataKey:a,value:g.value,payload:g.payload,points:t});return f.createElement($Z,{key:"dot-".concat(y),option:n,dotProps:b,className:i})}),m={};return l&&c!=null&&(m.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(c,")")),f.createElement(er,{zIndex:u},f.createElement(Ht,Tf({className:r},m),h))}function uP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uP(Object(n),!0).forEach(function(r){FZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FZ(e,t,n){return(t=UZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UZ(e){var t=WZ(e,"string");return typeof t=="symbol"?t:t+""}function WZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Y_=0,KZ={xAxis:{},yAxis:{},zAxis:{}},G_=Wn({name:"cartesianAxis",initialState:KZ,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Nt()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:Nt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Nt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Nt()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:Nt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Nt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Nt()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:Nt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Nt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,s=i.widthHistory||[];if(s.length===3&&s[0]===s[2]&&r===s[1]&&r!==i.width&&Math.abs(r-((a=s[0])!==null&&a!==void 0?a:0))<=1)return;var l=[...s,r].slice(-3);e.yAxis[n]=dP(dP({},i),{},{width:r,widthHistory:l})}}}}),{addXAxis:HZ,replaceXAxis:VZ,removeXAxis:qZ,addYAxis:YZ,replaceYAxis:GZ,removeYAxis:XZ,addZAxis:Lae,replaceZAxis:zae,removeZAxis:$ae,updateYAxisWidth:QZ}=G_.actions,JZ=G_.reducer,ZZ=q([fn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),eee=q([ZZ,sa,la],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),lm=()=>Ne(eee),tee=()=>Ne(GG);function pP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pP(Object(n),!0).forEach(function(r){nee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nee(e,t,n){return(t=ree(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ree(e){var t=iee(e,"string");return typeof t=="symbol"?t:t+""}function iee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aee=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:s}=e;if(i===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=kg(kg(kg({},l),Uo(i)),f0(i)),u;return f.isValidElement(i)?u=f.cloneElement(i,c):typeof i=="function"?u=i(c):u=f.createElement(L_,c),f.createElement(Ht,{className:"recharts-active-dot",clipPath:s},u)};function Ny(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:s=tn.activeDot}=e,l=Ne(Ka),c=tee();if(t==null||c==null)return null;var u=t.find(p=>c.includes(p.payload));return Rt(u)?null:f.createElement(er,{zIndex:s},f.createElement(aee,{point:u,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var fP=(e,t,n)=>{var r=n??e;if(!Rt(r))return $n(r,t,0)},oee=(e,t,n)=>{var r={},i=e.filter(Ih),a=e.filter(u=>u.stackId==null),s=i.reduce((u,p)=>{var d=u[p.stackId];return d==null&&(d=[]),d.push(p),u[p.stackId]=d,u},r),l=Object.entries(s).map(u=>{var p,[d,h]=u,m=h.map(y=>y.dataKey),g=fP(t,n,(p=h[0])===null||p===void 0?void 0:p.barSize);return{stackId:d,dataKeys:m,barSize:g}}),c=a.map(u=>{var p=[u.dataKey].filter(h=>h!=null),d=fP(t,n,u.barSize);return{stackId:void 0,dataKeys:p,barSize:d}});return[...l,...c]};function hP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hP(Object(n),!0).forEach(function(r){see(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function see(e,t,n){return(t=lee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lee(e){var t=cee(e,"string");return typeof t=="symbol"?t:t+""}function cee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uee(e,t,n,r,i){var a,s=r.length;if(!(s<1)){var l=$n(e,n,0,!0),c,u=[];if(Je((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,d=n/s,h=r.reduce((b,j)=>b+(j.barSize||0),0);h+=(s-1)*l,h>=n&&(h-=(s-1)*l,l=0),h>=n&&d>0&&(p=!0,d*=.9,h=s*d);var m=(n-h)/2>>0,g={offset:m-l,size:0};c=r.reduce((b,j)=>{var w,k={stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:g.offset+g.size+l,size:p?d:(w=j.barSize)!==null&&w!==void 0?w:0}},S=[...b,k];return g=k.position,S},u)}else{var y=$n(t,n,0,!0);n-2*y-(s-1)*l<=0&&(l=0);var x=(n-2*y-(s-1)*l)/s;x>1&&(x>>=0);var v=Je(i)?Math.min(x,i):x;c=r.reduce((b,j,w)=>[...b,{stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:y+(x+l)*w+(x-v)/2,size:v}}],u)}return c}}var dee=(e,t,n,r,i,a,s)=>{var l=Rt(s)?t:s,c=uee(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(u=>_d(_d({},u),{},{position:_d(_d({},u.position),{},{offset:u.position.offset-i/2})}))),c},pee=(e,t)=>{var n=Oh(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(s=>s.key===n)}}}},fee=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function hee(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Je(e.zIndex)?e.zIndex:t}var X_=e=>{var{chartData:t}=e,n=wt(),r=jn();return f.useEffect(()=>r?()=>{}:(n(TC(t)),()=>{n(TC(void 0))}),[t,n,r]),null},mP={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},Q_=Wn({name:"brush",initialState:mP,reducers:{setBrushSettings(e,t){return t.payload==null?mP:t.payload}}}),{setBrushSettings:Bae}=Q_.actions,mee=Q_.reducer;function gee(e){return(e%180+180)%180}var vee=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=gee(i),s=a*Math.PI/180,l=Math.atan(r/n),c=s>l&&s<Math.PI-l?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},yee={dots:[],areas:[],lines:[]},J_=Wn({name:"referenceElements",initialState:yee,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Rr(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Rr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=Rr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Fae,removeDot:Uae,addArea:Wae,removeArea:Kae,addLine:Hae,removeLine:Vae}=J_.actions,xee=J_.reducer,bee=f.createContext(void 0),jee=e=>{var{children:t}=e,[n]=f.useState("".concat(Yc("recharts"),"-clip")),r=lm();if(r==null)return null;var{x:i,y:a,width:s,height:l}=r;return f.createElement(bee.Provider,{value:n},f.createElement("defs",null,f.createElement("clipPath",{id:n},f.createElement("rect",{x:i,y:a,height:l,width:s}))),t)};function Z_(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function wee(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return vee(r,n)}function See(e,t,n){var r=n==="width",{x:i,y:a,width:s,height:l}=e;return t===1?{start:r?i:a,end:r?i+s:a+l}:{start:r?i+s:a+l,end:r?i:a}}function lu(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function kee(e,t){return Z_(e,t+1)}function Cee(e,t,n,r,i){for(var a=(r||[]).slice(),{start:s,end:l}=t,c=0,u=1,p=s,d=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:Z_(r,u)};var y=c,x,v=()=>(x===void 0&&(x=n(g,y)),x),b=g.coordinate,j=c===0||lu(e,b,v,p,l);j||(c=0,p=s,u+=1),j&&(p=b+e*(v()/2+i),c+=u)},h;u<=a.length;)if(h=d(),h)return h.v;return[]}function Pee(e,t,n,r,i){var a=(r||[]).slice(),s=a.length;if(s===0)return[];for(var{start:l,end:c}=t,u=1;u<=s;u++){for(var p=(s-1)%u,d=l,h=!0,m=function(){var w=r[y];if(w==null)return 0;var k=y,S,E=()=>(S===void 0&&(S=n(w,k)),S),A=w.coordinate,D=y===p||lu(e,A,E,d,c);if(!D)return h=!1,1;D&&(d=A+e*(E()/2+i))},g,y=p;y<s&&(g=m(),!(g!==0&&g===1));y+=u);if(h){for(var x=[],v=p;v<s;v+=u){var b=r[v];b!=null&&x.push(b)}return x}}return[]}function gP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gP(Object(n),!0).forEach(function(r){Eee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eee(e,t,n){return(t=Tee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tee(e){var t=Aee(e,"string");return typeof t=="symbol"?t:t+""}function Aee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oee(e,t,n,r,i){for(var a=(r||[]).slice(),s=a.length,{start:l}=t,{end:c}=t,u=function(h){var m=a[h];if(m==null)return 1;var g=m,y,x=()=>(y===void 0&&(y=n(m,h)),y);if(h===s-1){var v=e*(g.coordinate+e*x()/2-c);a[h]=g=Dn(Dn({},g),{},{tickCoord:v>0?g.coordinate-v*e:g.coordinate})}else a[h]=g=Dn(Dn({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var b=lu(e,g.tickCoord,x,l,c);b&&(c=g.tickCoord-e*(x()/2+i),a[h]=Dn(Dn({},g),{},{isShow:!0}))}},p=s-1;p>=0;p--)u(p);return a}function Iee(e,t,n,r,i,a){var s=(r||[]).slice(),l=s.length,{start:c,end:u}=t;if(a){var p=r[l-1];if(p!=null){var d=n(p,l-1),h=e*(p.coordinate+e*d/2-u);if(s[l-1]=p=Dn(Dn({},p),{},{tickCoord:h>0?p.coordinate-h*e:p.coordinate}),p.tickCoord!=null){var m=lu(e,p.tickCoord,()=>d,c,u);m&&(u=p.tickCoord-e*(d/2+i),s[l-1]=Dn(Dn({},p),{},{isShow:!0}))}}}for(var g=a?l-1:l,y=function(b){var j=s[b];if(j==null)return 1;var w=j,k,S=()=>(k===void 0&&(k=n(j,b)),k);if(b===0){var E=e*(w.coordinate-e*S()/2-c);s[b]=w=Dn(Dn({},w),{},{tickCoord:E<0?w.coordinate-E*e:w.coordinate})}else s[b]=w=Dn(Dn({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var A=lu(e,w.tickCoord,S,c,u);A&&(c=w.tickCoord+e*(S()/2+i),s[b]=Dn(Dn({},w),{},{isShow:!0}))}},x=0;x<g;x++)y(x);return s}function Jb(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:s,orientation:l,interval:c,tickFormatter:u,unit:p,angle:d}=e;if(!i||!i.length||!r)return[];if(Ce(c)||Au.isSsr){var h;return(h=kee(i,Ce(c)?c:0))!==null&&h!==void 0?h:[]}var m=[],g=l==="top"||l==="bottom"?"width":"height",y=p&&g==="width"?Cc(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},x=(k,S)=>{var E=typeof u=="function"?u(k.value,S):k.value;return g==="width"?wee(Cc(E,{fontSize:t,letterSpacing:n}),y,d):Cc(E,{fontSize:t,letterSpacing:n})[g]},v=i[0],b=i[1],j=i.length>=2&&v!=null&&b!=null?xn(b.coordinate-v.coordinate):1,w=See(a,j,g);return c==="equidistantPreserveStart"?Cee(j,w,x,i,s):c==="equidistantPreserveEnd"?Pee(j,w,x,i,s):(c==="preserveStart"||c==="preserveStartEnd"?m=Iee(j,w,x,i,s,c==="preserveStartEnd"):m=Oee(j,w,x,i,s),m.filter(k=>k.isShow))}var Nee=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,s=0;if(t){Array.from(t).forEach(p=>{if(p){var d=p.getBoundingClientRect();d.width>s&&(s=d.width)}});var l=n?n.getBoundingClientRect().width:0,c=i+a,u=s+c+l+(n?r:0);return Math.round(u)}return 0},_ee={xAxis:{},yAxis:{}},eM=Wn({name:"renderedTicks",initialState:_ee,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:Mee,removeRenderedTicks:Ree}=eM.actions,Dee=eM.reducer,Lee=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function zee(e,t){if(e==null)return{};var n,r,i=$ee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $ee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Xo(){return Xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xo.apply(null,arguments)}function vP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vP(Object(n),!0).forEach(function(r){Bee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bee(e,t,n){return(t=Fee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fee(e){var t=Uee(e,"string");return typeof t=="symbol"?t:t+""}function Uee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gi={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:tn.axis};function Wee(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:s,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var u=Yt(Yt(Yt({},c),Xn(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!s||a==="bottom"&&s);u=Yt(Yt({},u),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var d=+(a==="left"&&!s||a==="right"&&s);u=Yt(Yt({},u),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return f.createElement("line",Xo({},u,{className:dt("recharts-cartesian-axis-line",Ei(l,"className"))}))}function Kee(e,t,n,r,i,a,s,l,c){var u,p,d,h,m,g,y=l?-1:1,x=e.tickSize||s,v=Ce(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=p=e.coordinate,h=n+ +!l*i,d=h-y*x,g=d-y*c,m=v;break;case"left":d=h=e.coordinate,p=t+ +!l*r,u=p-y*x,m=u-y*c,g=v;break;case"right":d=h=e.coordinate,p=t+ +l*r,u=p+y*x,m=u+y*c,g=v;break;default:u=p=e.coordinate,h=n+ +l*i,d=h+y*x,g=d+y*c,m=v;break}return{line:{x1:u,y1:d,x2:p,y2:h},tick:{x:m,y:g}}}function Hee(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Vee(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function qee(e){var{option:t,tickProps:n,value:r}=e,i,a=dt(n.className,"recharts-cartesian-axis-tick-value");if(f.isValidElement(t))i=f.cloneElement(t,Yt(Yt({},n),{},{className:a}));else if(typeof t=="function")i=t(Yt(Yt({},n),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=dt(s,F_(t))),i=f.createElement(Hh,Xo({},n,{className:s}),r)}return i}function Yee(e){var{ticks:t,axisType:n,axisId:r}=e,i=wt();return f.useEffect(()=>{if(r==null||n==null)return Qa;var a=t.map(s=>({value:s.value,coordinate:s.coordinate,offset:s.offset,index:s.index}));return i(Mee({ticks:a,axisId:r,axisType:n})),()=>{i(Ree({axisId:r,axisType:n}))}},[i,t,r,n]),null}var Gee=f.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:s,unit:l,padding:c,tickTextProps:u,orientation:p,mirror:d,x:h,y:m,width:g,height:y,tickSize:x,tickMargin:v,fontSize:b,letterSpacing:j,getTicksConfig:w,events:k,axisType:S,axisId:E}=e,A=Jb(Yt(Yt({},w),{},{ticks:n}),b,j),D=Xn(w),T=Uo(r),I=A_(D.textAnchor)?D.textAnchor:Hee(p,d),_=Vee(p,d),G={};typeof i=="object"&&(G=i);var K=Yt(Yt({},D),{},{fill:"none"},G),O=A.map(R=>Yt({entry:R},Kee(R,h,m,g,y,p,x,d,v))),B=O.map(R=>{var{entry:$,line:P}=R;return f.createElement(Ht,{className:"recharts-cartesian-axis-tick",key:"tick-".concat($.value,"-").concat($.coordinate,"-").concat($.tickCoord)},i&&f.createElement("line",Xo({},K,P,{className:dt("recharts-cartesian-axis-tick-line",Ei(i,"className"))})))}),W=O.map((R,$)=>{var P,F,{entry:re,tick:N}=R,pe=Yt(Yt(Yt(Yt({verticalAnchor:_},D),{},{textAnchor:I,stroke:"none",fill:a},N),{},{index:$,payload:re,visibleTicksCount:A.length,tickFormatter:s,padding:c},u),{},{angle:(P=(F=u==null?void 0:u.angle)!==null&&F!==void 0?F:D.angle)!==null&&P!==void 0?P:0}),ve=Yt(Yt({},pe),T);return f.createElement(Ht,Xo({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(re.value,"-").concat(re.coordinate,"-").concat(re.tickCoord)},wu(k,re,$)),r&&f.createElement(qee,{option:r,tickProps:ve,value:"".concat(typeof s=="function"?s(re.value,$):re.value).concat(l||"")}))});return f.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(S,"-ticks")},f.createElement(Yee,{ticks:A,axisId:E,axisType:S}),W.length>0&&f.createElement(er,{zIndex:tn.label},f.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(S,"-tick-labels"),ref:t},W)),B.length>0&&f.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(S,"-tick-lines")},B))}),Xee=f.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:s,ticks:l,axisType:c,axisId:u}=e,p=zee(e,Lee),[d,h]=f.useState(""),[m,g]=f.useState(""),y=f.useRef(null);f.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var v;return Nee({ticks:y.current,label:(v=e.labelRef)===null||v===void 0?void 0:v.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var x=f.useCallback(v=>{if(v){var b=v.getElementsByClassName("recharts-cartesian-axis-tick-value");y.current=b;var j=b[0];if(j){var w=window.getComputedStyle(j),k=w.fontSize,S=w.letterSpacing;(k!==d||S!==m)&&(h(k),g(S))}}},[d,m]);return s||r!=null&&r<=0||i!=null&&i<=0?null:f.createElement(er,{zIndex:e.zIndex},f.createElement(Ht,{className:dt("recharts-cartesian-axis",a)},f.createElement(Wee,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Xn(e)}),f.createElement(Gee,{ref:x,axisType:c,events:p,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:m,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),f.createElement(qQ,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},f.createElement(rJ,{label:e.label,labelRef:e.labelRef}),e.children)))}),Zb=f.forwardRef((e,t)=>{var n=nn(e,Gi);return f.createElement(Xee,Xo({},n,{ref:t}))});Zb.displayName="CartesianAxis";var Qee=["x1","y1","x2","y2","key"],Jee=["offset"],Zee=["xAxisId","yAxisId"],ete=["xAxisId","yAxisId"];function yP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yP(Object(n),!0).forEach(function(r){tte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tte(e,t,n){return(t=nte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nte(e){var t=rte(e,"string");return typeof t=="symbol"?t:t+""}function rte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ao.apply(null,arguments)}function Af(e,t){if(e==null)return{};var n,r,i=ite(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ite(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ate=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:s,ry:l}=e;return f.createElement("rect",{x:r,y:i,ry:l,width:a,height:s,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function tM(e){var{option:t,lineItemProps:n}=e,r;if(f.isValidElement(t))r=f.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:s,x2:l,y2:c,key:u}=n,p=Af(n,Qee),d=(i=Xn(p))!==null&&i!==void 0?i:{},{offset:h}=d,m=Af(d,Jee);r=f.createElement("line",Ao({},m,{x1:a,y1:s,x2:l,y2:c,fill:"none",key:u}))}return r}function ote(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:s}=e,l=Af(e,Zee),c=i.map((u,p)=>{var d=zn(zn({},l),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(p),index:p});return f.createElement(tM,{key:"line-".concat(p),option:r,lineItemProps:d})});return f.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function ste(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:s}=e,l=Af(e,ete),c=i.map((u,p)=>{var d=zn(zn({},l),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(p),index:p});return f.createElement(tM,{option:r,lineItemProps:d,key:"line-".concat(p)})});return f.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function lte(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:s,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var u=l.map(d=>Math.round(d+i-i)).sort((d,h)=>d-h);i!==u[0]&&u.unshift(0);var p=u.map((d,h)=>{var m=u[h+1],g=m==null,y=g?i+s-d:m-d;if(y<=0)return null;var x=h%t.length;return f.createElement("rect",{key:"react-".concat(h),y:d,x:r,height:y,width:a,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return f.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function cte(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:s,height:l,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var u=c.map(d=>Math.round(d+i-i)).sort((d,h)=>d-h);i!==u[0]&&u.unshift(0);var p=u.map((d,h)=>{var m=u[h+1],g=m==null,y=g?i+s-d:m-d;if(y<=0)return null;var x=h%n.length;return f.createElement("rect",{key:"react-".concat(h),x:d,y:a,width:y,height:l,stroke:"none",fill:n[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return f.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var ute=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return RO(Jb(zn(zn(zn({},Gi),n),{},{ticks:DO(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},dte=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return RO(Jb(zn(zn(zn({},Gi),n),{},{ticks:DO(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},pte={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:tn.grid};function _s(e){var t=C0(),n=P0(),r=KO(),i=zn(zn({},nn(e,pte)),{},{x:Ce(e.x)?e.x:r.left,y:Ce(e.y)?e.y:r.top,width:Ce(e.width)?e.width:r.width,height:Ce(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:s,x:l,y:c,width:u,height:p,syncWithTicks:d,horizontalValues:h,verticalValues:m}=i,g=jn(),y=Ne(D=>gC(D,"xAxis",a,g)),x=Ne(D=>gC(D,"yAxis",s,g));if(!Ai(u)||!Ai(p)||!Ce(l)||!Ce(c))return null;var v=i.verticalCoordinatesGenerator||ute,b=i.horizontalCoordinatesGenerator||dte,{horizontalPoints:j,verticalPoints:w}=i;if((!j||!j.length)&&typeof b=="function"){var k=h&&h.length,S=b({yAxis:x?zn(zn({},x),{},{ticks:k?h:x.ticks}):void 0,width:t??u,height:n??p,offset:r},k?!0:d);Jp(Array.isArray(S),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof S,"]")),Array.isArray(S)&&(j=S)}if((!w||!w.length)&&typeof v=="function"){var E=m&&m.length,A=v({xAxis:y?zn(zn({},y),{},{ticks:E?m:y.ticks}):void 0,width:t??u,height:n??p,offset:r},E?!0:d);Jp(Array.isArray(A),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(w=A)}return f.createElement(er,{zIndex:i.zIndex},f.createElement("g",{className:"recharts-cartesian-grid"},f.createElement(ate,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),f.createElement(lte,Ao({},i,{horizontalPoints:j})),f.createElement(cte,Ao({},i,{verticalPoints:w})),f.createElement(ote,Ao({},i,{offset:r,horizontalPoints:j,xAxis:y,yAxis:x})),f.createElement(ste,Ao({},i,{offset:r,verticalPoints:w,xAxis:y,yAxis:x}))))}_s.displayName="CartesianGrid";var fte={},nM=Wn({name:"errorBars",initialState:fte,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:qae,replaceErrorBar:Yae,removeErrorBar:Gae}=nM.actions,hte=nM.reducer,mte=["children"];function gte(e,t){if(e==null)return{};var n,r,i=vte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var yte={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},xte=f.createContext(yte);function rM(e){var{children:t}=e,n=gte(e,mte);return f.createElement(xte.Provider,{value:n},t)}function cm(e,t){var n,r,i=Ne(u=>ua(u,e)),a=Ne(u=>da(u,t)),s=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:ln.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:cn.allowDataOverflow,c=s||l;return{needClip:c,needClipX:s,needClipY:l}}function e1(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=lm(),{needClipX:a,needClipY:s,needClip:l}=cm(t,n);if(!l||!i)return null;var{x:c,y:u,width:p,height:d}=i;return f.createElement("clipPath",{id:"clipPath-".concat(r)},f.createElement("rect",{x:a?c:c-p/2,y:s?u:u-d/2,width:a?p:p*2,height:s?d:d*2}))}var iM=(e,t,n,r)=>_i(e,"xAxis",t,r),aM=(e,t,n,r)=>Ni(e,"xAxis",t,r),oM=(e,t,n,r)=>_i(e,"yAxis",n,r),sM=(e,t,n,r)=>Ni(e,"yAxis",n,r),bte=q([ot,iM,oM,aM,sM],(e,t,n,r,i)=>si(e,"xAxis")?Wa(t,r,!1):Wa(n,i,!1)),jte=(e,t,n,r,i)=>i;function wte(e){return e.type==="line"}var Ste=q([zu,jte],(e,t)=>e.filter(wte).find(n=>n.id===t)),kte=q([ot,iM,oM,aM,sM,Ste,bte,Iu],(e,t,n,r,i,a,s,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:p}=l;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:d,data:h}=a,m;if(h!=null&&h.length>0?m=h:m=c==null?void 0:c.slice(u,p+1),m!=null)return Kte({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:s,displayedData:m})}});function lM(e){var t=Uo(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,s=Number(i),l=Number(a);return(Number.isNaN(s)||s<0)&&(s=n),(Number.isNaN(l)||l<0)&&(l=r),{r:s,strokeWidth:l}}return{r:n,strokeWidth:r}}var Cte=["id"],Pte=["type","layout","connectNulls","needClip","shape"],Ete=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function cu(){return cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cu.apply(null,arguments)}function xP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xP(Object(n),!0).forEach(function(r){Tte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tte(e,t,n){return(t=Ate(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ate(e){var t=Ote(e,"string");return typeof t=="symbol"?t:t+""}function Ote(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function t1(e,t){if(e==null)return{};var n,r,i=Ite(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ite(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Nte=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ja(n,t),payload:e}]},_te=f.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:s,hide:l,unit:c,tooltipType:u,id:p}=e,d={dataDefinedOnItem:n,getPosition:Qa,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Ja(s,t),hide:l,type:u,color:r,unit:c,graphicalItemId:p}};return f.createElement(am,{tooltipEntrySettings:d})}),cM=(e,t)=>"".concat(t,"px ").concat(e,"px");function Mte(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var Rte=(e,t,n)=>{var r=n.reduce((h,m)=>h+m,0);if(!r)return cM(t,e);for(var i=Math.floor(e/r),a=e%r,s=[],l=0,c=0;l<n.length;c+=(u=n[l])!==null&&u!==void 0?u:0,++l){var u,p=n[l];if(p!=null&&c+p>a){s=[...n.slice(0,l),a-c];break}}var d=s.length%2===0?[0,t]:[t];return[...Mte(n,i),...s,...d].map(h=>"".concat(h,"px")).join(", ")};function Dte(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:s}=r,{id:l}=r,c=t1(r,Cte),u=Xn(c);return f.createElement(q_,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:u,needClip:s,clipPathId:t})}function Lte(e){var{showLabels:t,children:n,points:r}=e,i=f.useMemo(()=>r==null?void 0:r.map(a=>{var s,l,c={x:(s=a.x)!==null&&s!==void 0?s:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return vi(vi({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return f.createElement($b,{value:t?i:void 0},n)}function bP(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:s,layout:l,connectNulls:c,needClip:u,shape:p}=a,d=t1(a,Pte),h=vi(vi({},Fn(d)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:r,type:s,layout:l,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return f.createElement(f.Fragment,null,(r==null?void 0:r.length)>1&&f.createElement(Vb,cu({shapeType:"curve",option:p},h,{pathRef:n})),f.createElement(Dte,{points:r,clipPathId:t,props:a}))}function zte(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function $te(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:s,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:p,animationEasing:d,animateNewValues:h,width:m,height:g,onAnimationEnd:y,onAnimationStart:x}=n,v=i.current,b=Sl(s,"recharts-line-"),j=f.useRef(b),[w,k]=f.useState(!1),S=!w,E=f.useCallback(()=>{typeof y=="function"&&y(),k(!1)},[y]),A=f.useCallback(()=>{typeof x=="function"&&x(),k(!0)},[x]),D=zte(r.current),T=f.useRef(0);j.current!==b&&(T.current=a.current,j.current=b);var I=T.current;return f.createElement(Lte,{points:s,showLabels:S},n.children,f.createElement(wl,{animationId:b,begin:u,duration:p,isActive:c,easing:d,onAnimationEnd:E,onAnimationStart:A,key:b},_=>{var G=yt(I,D+I,_),K=Math.min(G,D),O;if(c)if(l){var B="".concat(l).split(/[,\s]+/gim).map($=>parseFloat($));O=Rte(K,D,B)}else O=cM(D,K);else O=l==null?void 0:String(l);if(_>0&&D>0&&(i.current=s,a.current=Math.max(a.current,K)),v){var W=v.length/s.length,R=_===1?s:s.map(($,P)=>{var F=Math.floor(P*W);if(v[F]){var re=v[F];return vi(vi({},$),{},{x:yt(re.x,$.x,_),y:yt(re.y,$.y,_)})}return h?vi(vi({},$),{},{x:yt(m*2,$.x,_),y:yt(g/2,$.y,_)}):vi(vi({},$),{},{x:$.x,y:$.y})});return i.current=R,f.createElement(bP,{props:n,points:R,clipPathId:t,pathRef:r,strokeDasharray:O})}return f.createElement(bP,{props:n,points:s,clipPathId:t,pathRef:r,strokeDasharray:O})}),f.createElement(Vh,{label:n.label}))}function Bte(e){var{clipPathId:t,props:n}=e,r=f.useRef(null),i=f.useRef(0),a=f.useRef(null);return f.createElement($te,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var Fte=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:ft(e.payload,t)}};class Ute extends f.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:s,top:l,left:c,width:u,height:p,id:d,needClip:h,zIndex:m}=this.props;if(t)return null;var g=dt("recharts-line",i),y=d,{r:x,strokeWidth:v}=lM(n),b=Hb(n),j=x*2+v,w=h?"url(#clipPath-".concat(b?"":"dots-").concat(y,")"):void 0;return f.createElement(er,{zIndex:m},f.createElement(Ht,{className:g},h&&f.createElement("defs",null,f.createElement(e1,{clipPathId:y,xAxisId:a,yAxisId:s}),!b&&f.createElement("clipPath",{id:"clipPath-dots-".concat(y)},f.createElement("rect",{x:c-j/2,y:l-j/2,width:u+j,height:p+j}))),f.createElement(rM,{xAxisId:a,yAxisId:s,data:r,dataPointFormatter:Fte,errorBarOffset:0},f.createElement(Bte,{props:this.props,clipPathId:y}))),f.createElement(Ny,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:w}))}}var uM={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:tn.line,type:"linear"};function Wte(e){var t=nn(e,uM),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:s,connectNulls:l,dot:c,hide:u,isAnimationActive:p,label:d,legendType:h,xAxisId:m,yAxisId:g,id:y}=t,x=t1(t,Ete),{needClip:v}=cm(m,g),b=lm(),j=Za(),w=jn(),k=Ne(T=>kte(T,m,g,w,y));if(j!=="horizontal"&&j!=="vertical"||k==null||b==null)return null;var{height:S,width:E,x:A,y:D}=b;return f.createElement(Ute,cu({},x,{id:y,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:s,isAnimationActive:p,hide:u,label:d,legendType:h,xAxisId:m,yAxisId:g,points:k,layout:j,height:S,width:E,left:A,top:D,needClip:v}))}function Kte(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:s,bandSize:l,displayedData:c}=e;return c.map((u,p)=>{var d=ft(u,s);if(t==="horizontal"){var h=Qp({axis:n,ticks:i,bandSize:l,entry:u,index:p}),m=Rt(d)?null:r.scale.map(d);return{x:h,y:m??null,value:d,payload:u}}var g=Rt(d)?null:n.scale.map(d),y=Qp({axis:r,ticks:a,bandSize:l,entry:u,index:p});return g==null||y==null?null:{x:g,y,value:d,payload:u}}).filter(Boolean)}function Hte(e){var t=nn(e,uM),n=jn();return f.createElement(om,{id:t.id,type:"line"},r=>f.createElement(f.Fragment,null,f.createElement(Xb,{legendPayload:Nte(t)}),f.createElement(_te,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),f.createElement(Qb,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),f.createElement(Wte,cu({},t,{id:r}))))}var Pc=f.memo(Hte,ts);Pc.displayName="Line";function Mi(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:Y_}function Ri(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:Y_}var dM=(e,t,n)=>_i(e,"xAxis",Mi(e,t),n),pM=(e,t,n)=>Ni(e,"xAxis",Mi(e,t),n),fM=(e,t,n)=>_i(e,"yAxis",Ri(e,t),n),hM=(e,t,n)=>Ni(e,"yAxis",Ri(e,t),n),Vte=q([ot,dM,fM,pM,hM],(e,t,n,r,i)=>si(e,"xAxis")?Wa(t,r,!1):Wa(n,i,!1)),qte=(e,t)=>t,mM=q([zu,qte],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),gM=e=>{var t=ot(e),n=si(t,"xAxis");return n?"yAxis":"xAxis"},Yte=(e,t)=>{var n=gM(e);return n==="yAxis"?Ri(e,t):Mi(e,t)},Gte=(e,t,n)=>jf(e,gM(e),Yte(e,t),n),Xte=q([mM,Gte],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=Oh(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,s=a==null?void 0:a.find(l=>l.key===i);if(s!=null)return s.map(l=>[l[0],l[1]])}}}),Qte=q([ot,dM,fM,pM,hM,Xte,hI,Vte,mM,a7],(e,t,n,r,i,a,s,l,c,u)=>{var{chartData:p,dataStartIndex:d,dataEndIndex:h}=s;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null)){var{data:m}=c,g;if(m&&m.length>0?g=m:g=p==null?void 0:p.slice(d,h+1),g!=null)return vne({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:g,chartBaseValue:u,bandSize:l})}}),Jte=["id"],Zte=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Do.apply(null,arguments)}function vM(e,t){if(e==null)return{};var n,r,i=ene(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ene(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function jP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ms(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jP(Object(n),!0).forEach(function(r){tne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tne(e,t,n){return(t=nne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nne(e){var t=rne(e,"string");return typeof t=="symbol"?t:t+""}function rne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Of(e,t){return e&&e!=="none"?e:t}var ine=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:s}=e;return[{inactive:s,dataKey:t,type:a,color:Of(r,i),value:Ja(n,t),payload:e}]},ane=f.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:s,hide:l,unit:c,tooltipType:u,id:p}=e,d={dataDefinedOnItem:n,getPosition:Qa,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Ja(s,t),hide:l,type:u,color:Of(r,a),unit:c,graphicalItemId:p}};return f.createElement(am,{tooltipEntrySettings:d})});function one(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:s}=r,l=Xn(r);return f.createElement(q_,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:s,baseProps:l,needClip:i,clipPathId:t})}function sne(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var s,l,c={x:(s=a.x)!==null&&s!==void 0?s:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ms(Ms({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return f.createElement($b,{value:t?i:void 0},n)}function wP(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:s,type:l,stroke:c,connectNulls:u,isRange:p}=a,{id:d}=a,h=vM(a,Jte),m=Xn(h),g=Fn(h);return f.createElement(f.Fragment,null,(t==null?void 0:t.length)>1&&f.createElement(Ht,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},f.createElement(Hs,Do({},g,{id:d,points:t,connectNulls:u,type:l,baseLine:n,layout:s,stroke:"none",className:"recharts-area-area"})),c!=="none"&&f.createElement(Hs,Do({},m,{className:"recharts-area-curve",layout:s,type:l,connectNulls:u,fill:"none",points:t})),c!=="none"&&p&&Array.isArray(n)&&f.createElement(Hs,Do({},m,{className:"recharts-area-curve",layout:s,type:l,connectNulls:u,fill:"none",points:n}))),f.createElement(one,{points:t,props:h,clipPathId:i}))}function lne(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:s}=e,l=(t=a[0])===null||t===void 0?void 0:t.y,c=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!Je(l)||!Je(c))return null;var u=r*Math.abs(l-c),p=Math.max(...a.map(d=>d.x||0));return Ce(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(d=>d.x||0),p)),Ce(p)?f.createElement("rect",{x:0,y:l<c?l:l-u,width:p+(s?parseInt("".concat(s),10):1),height:Math.floor(u)}):null}function cne(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:s}=e,l=(t=a[0])===null||t===void 0?void 0:t.x,c=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!Je(l)||!Je(c))return null;var u=r*Math.abs(l-c),p=Math.max(...a.map(d=>d.y||0));return Ce(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(d=>d.y||0),p)),Ce(p)?f.createElement("rect",{x:l<c?l:l-u,y:0,width:u,height:Math.floor(p+(s?parseInt("".concat(s),10):1))}):null}function une(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?f.createElement(lne,{alpha:t,points:r,baseLine:i,strokeWidth:a}):f.createElement(cne,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function dne(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:s,baseLine:l,isAnimationActive:c,animationBegin:u,animationDuration:p,animationEasing:d,onAnimationStart:h,onAnimationEnd:m}=r,g=f.useMemo(()=>({points:s,baseLine:l}),[s,l]),y=Sl(g,"recharts-area-"),x=E0(),[v,b]=f.useState(!1),j=!v,w=f.useCallback(()=>{typeof m=="function"&&m(),b(!1)},[m]),k=f.useCallback(()=>{typeof h=="function"&&h(),b(!0)},[h]);if(x==null)return null;var S=i.current,E=a.current;return f.createElement(sne,{showLabels:j,points:s},r.children,f.createElement(wl,{animationId:y,begin:u,duration:p,isActive:c,easing:d,onAnimationEnd:w,onAnimationStart:k,key:y},A=>{if(S){var D=S.length/s.length,T=A===1?s:s.map((_,G)=>{var K=Math.floor(G*D);if(S[K]){var O=S[K];return Ms(Ms({},_),{},{x:yt(O.x,_.x,A),y:yt(O.y,_.y,A)})}return _}),I;return Ce(l)?I=yt(E,l,A):Rt(l)||ii(l)?I=yt(E,0,A):I=l.map((_,G)=>{var K=Math.floor(G*D);if(Array.isArray(E)&&E[K]){var O=E[K];return Ms(Ms({},_),{},{x:yt(O.x,_.x,A),y:yt(O.y,_.y,A)})}return _}),A>0&&(i.current=T,a.current=I),f.createElement(wP,{points:T,baseLine:I,needClip:t,clipPathId:n,props:r})}return A>0&&(i.current=s,a.current=l),f.createElement(Ht,null,c&&f.createElement("defs",null,f.createElement("clipPath",{id:"animationClipPath-".concat(n)},f.createElement(une,{alpha:A,points:s,baseLine:l,layout:x,strokeWidth:r.strokeWidth}))),f.createElement(Ht,{clipPath:"url(#animationClipPath-".concat(n,")")},f.createElement(wP,{points:s,baseLine:l,needClip:t,clipPathId:n,props:r})))}),f.createElement(Vh,{label:r.label}))}function pne(e){var{needClip:t,clipPathId:n,props:r}=e,i=f.useRef(null),a=f.useRef();return f.createElement(dne,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class fne extends f.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:s,needClip:l,xAxisId:c,yAxisId:u,width:p,height:d,id:h,baseLine:m,zIndex:g}=this.props;if(t)return null;var y=dt("recharts-area",i),x=h,{r:v,strokeWidth:b}=lM(n),j=Hb(n),w=v*2+b,k=l?"url(#clipPath-".concat(j?"":"dots-").concat(x,")"):void 0;return f.createElement(er,{zIndex:g},f.createElement(Ht,{className:y},l&&f.createElement("defs",null,f.createElement(e1,{clipPathId:x,xAxisId:c,yAxisId:u}),!j&&f.createElement("clipPath",{id:"clipPath-dots-".concat(x)},f.createElement("rect",{x:s-w/2,y:a-w/2,width:p+w,height:d+w}))),f.createElement(pne,{needClip:l,clipPathId:x,props:this.props})),f.createElement(Ny,{points:r,mainColor:Of(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}),this.props.isRange&&Array.isArray(m)&&f.createElement(Ny,{points:m,mainColor:Of(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}))}}var hne={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:tn.area};function mne(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:s,dot:l,fill:c,fillOpacity:u,hide:p,isAnimationActive:d,legendType:h,stroke:m,xAxisId:g,yAxisId:y}=e,x=vM(e,Zte),v=Za(),b=m_(),{needClip:j}=cm(g,y),w=jn(),{points:k,isRange:S,baseLine:E}=(t=Ne(G=>Qte(G,e.id,w)))!==null&&t!==void 0?t:{},A=lm();if(v!=="horizontal"&&v!=="vertical"||A==null||b!=="AreaChart"&&b!=="ComposedChart")return null;var{height:D,width:T,x:I,y:_}=A;return!k||!k.length?null:f.createElement(fne,Do({},x,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:E,connectNulls:s,dot:l,fill:c,fillOpacity:u,height:D,hide:p,layout:v,isAnimationActive:d,isRange:S,legendType:h,needClip:j,points:k,stroke:m,width:T,left:I,top:_,xAxisId:g,yAxisId:y}))}var gne=(e,t,n,r,i)=>{var a=n??t;if(Ce(a))return a;var s=e==="horizontal"?i:r,l=s.scale.domain();if(s.type==="number"){var c=Math.max(l[0],l[1]),u=Math.min(l[0],l[1]);return a==="dataMin"?u:a==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return a==="dataMin"?l[0]:a==="dataMax"?l[1]:l[0]};function vne(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:s,xAxis:l,yAxis:c,displayedData:u,dataStartIndex:p,xAxisTicks:d,yAxisTicks:h,bandSize:m}=e,g=i&&i.length,y=gne(a,s,n,l,c),x=a==="horizontal",v=!1,b=u.map((w,k)=>{var S,E,A,D;if(g)D=i[p+k];else{var T=ft(w,r);Array.isArray(T)?(D=T,v=!0):D=[y,T]}var I=(S=(E=D)===null||E===void 0?void 0:E[1])!==null&&S!==void 0?S:null,_=I==null||g&&!t&&ft(w,r)==null;if(x){var G;return{x:Qp({axis:l,ticks:d,bandSize:m,entry:w,index:k}),y:_?null:(G=c.scale.map(I))!==null&&G!==void 0?G:null,value:D,payload:w}}return{x:_?null:(A=l.scale.map(I))!==null&&A!==void 0?A:null,y:Qp({axis:c,ticks:h,bandSize:m,entry:w,index:k}),value:D,payload:w}}),j;return g||v?j=b.map(w=>{var k,S=Array.isArray(w.value)?w.value[0]:null;if(x){var E;return{x:w.x,y:S!=null&&w.y!=null&&(E=c.scale.map(S))!==null&&E!==void 0?E:null,payload:w.payload}}return{x:S!=null&&(k=l.scale.map(S))!==null&&k!==void 0?k:null,y:w.y,payload:w.payload}}):j=x?c.scale.map(y):l.scale.map(y),{points:b,baseLine:j??0,isRange:v}}function yne(e){var t=nn(e,hne),n=jn();return f.createElement(om,{id:t.id,type:"area"},r=>f.createElement(f.Fragment,null,f.createElement(Xb,{legendPayload:ine(t)}),f.createElement(ane,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),f.createElement(Qb,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:LO(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),f.createElement(mne,Do({},t,{id:r}))))}var _y=f.memo(yne,ts);_y.displayName="Area";var xne="Invariant failed";function bne(e,t){throw new Error(xne)}function My(){return My=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},My.apply(null,arguments)}function n1(e){return f.createElement(Vb,My({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var jne=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Ce(t))return t;var a=Ce(r)||Rt(r);return a?t(r,i):(a||bne(),n)}},wne=(e,t,n)=>n,Sne=(e,t)=>t,Ku=q([zu,Sne],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),kne=q([Ku],e=>e==null?void 0:e.maxBarSize),Cne=(e,t,n,r)=>r,Pne=q([ot,zu,Mi,Ri,wne],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),Ene=(e,t,n)=>{var r=ot(e),i=Mi(e,t),a=Ri(e,t);if(!(i==null||a==null))return r==="horizontal"?jf(e,"yAxis",a,n):jf(e,"xAxis",i,n)},Tne=(e,t)=>{var n=ot(e),r=Mi(e,t),i=Ri(e,t);if(!(r==null||i==null))return n==="horizontal"?mC(e,"xAxis",r):mC(e,"yAxis",i)},Ane=q([Pne,i7,Tne],oee),One=(e,t,n)=>{var r,i,a=Ku(e,t);if(a==null)return 0;var s=Mi(e,t),l=Ri(e,t);if(s==null||l==null)return 0;var c=ot(e),u=PI(e),{maxBarSize:p}=a,d=Rt(p)?u:p,h,m;return c==="horizontal"?(h=_i(e,"xAxis",s,n),m=Ni(e,"xAxis",s,n)):(h=_i(e,"yAxis",l,n),m=Ni(e,"yAxis",l,n)),(r=(i=Wa(h,m,!0))!==null&&i!==void 0?i:d)!==null&&r!==void 0?r:0},yM=(e,t,n)=>{var r=ot(e),i=Mi(e,t),a=Ri(e,t);if(!(i==null||a==null)){var s,l;return r==="horizontal"?(s=_i(e,"xAxis",i,n),l=Ni(e,"xAxis",i,n)):(s=_i(e,"yAxis",a,n),l=Ni(e,"yAxis",a,n)),Wa(s,l)}},Ine=q([Ane,PI,r7,EI,One,yM,kne],dee),Nne=(e,t,n)=>{var r=Mi(e,t);if(r!=null)return _i(e,"xAxis",r,n)},_ne=(e,t,n)=>{var r=Ri(e,t);if(r!=null)return _i(e,"yAxis",r,n)},Mne=(e,t,n)=>{var r=Mi(e,t);if(r!=null)return Ni(e,"xAxis",r,n)},Rne=(e,t,n)=>{var r=Ri(e,t);if(r!=null)return Ni(e,"yAxis",r,n)},Dne=q([Ine,Ku],fee),Lne=q([Ene,Ku],pee),zne=q([fn,w0,Nne,_ne,Mne,Rne,Dne,ot,hI,yM,Lne,Ku,Cne],(e,t,n,r,i,a,s,l,c,u,p,d,h)=>{var{chartData:m,dataStartIndex:g,dataEndIndex:y}=c;if(!(d==null||s==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||u==null)){var{data:x}=d,v;if(x!=null&&x.length>0?v=x:v=m==null?void 0:m.slice(g,y+1),v!=null)return pre({layout:l,barSettings:d,pos:s,parentViewBox:t,bandSize:u,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:v,offset:e,cells:h,dataStartIndex:g})}}),$ne=["index"];function Ry(){return Ry=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ry.apply(null,arguments)}function Bne(e,t){if(e==null)return{};var n,r,i=Fne(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fne(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var xM=f.createContext(void 0),Une=e=>{var t=f.useContext(xM);if(t!=null)return t.stackId;if(e!=null)return LO(e)},Wne=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),Kne=e=>{var t=f.useContext(xM);if(t!=null){var{stackId:n}=t;return"url(#".concat(Wne(n,e),")")}},bM=e=>{var{index:t}=e,n=Bne(e,$ne),r=Kne(t);return f.createElement(Ht,Ry({className:"recharts-bar-stack-layer",clipPath:r},n))},Hne=["onMouseEnter","onMouseLeave","onClick"],Vne=["value","background","tooltipPosition"],qne=["id"],Yne=["onMouseEnter","onClick","onMouseLeave"];function Va(){return Va=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Va.apply(null,arguments)}function SP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SP(Object(n),!0).forEach(function(r){Gne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gne(e,t,n){return(t=Xne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xne(e){var t=Qne(e,"string");return typeof t=="symbol"?t:t+""}function Qne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function If(e,t){if(e==null)return{};var n,r,i=Jne(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jne(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Zne=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:Ja(n,t),payload:e}]},ere=f.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:s,unit:l,tooltipType:c,id:u}=e,p={dataDefinedOnItem:void 0,getPosition:Qa,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:Ja(a,t),hide:s,type:c,color:i,unit:l,graphicalItemId:u}};return f.createElement(am,{tooltipEntrySettings:p})});function tre(e){var t=Ne(Ka),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:s,onMouseLeave:l,onClick:c}=a,u=If(a,Hne),p=qb(s,r,a.id),d=Yb(l),h=Gb(c,r,a.id);if(!i||n==null)return null;var m=Uo(i);return f.createElement(er,{zIndex:hee(i,tn.barBackground)},n.map((g,y)=>{var{value:x,background:v,tooltipPosition:b}=g,j=If(g,Vne);if(!v)return null;var w=p(g,y),k=d(g,y),S=h(g,y),E=qn(qn(qn(qn(qn({option:i,isActive:String(y)===t},j),{},{fill:"#eee"},v),m),wu(u,g,y)),{},{onMouseEnter:w,onMouseLeave:k,onClick:S,dataKey:r,index:y,className:"recharts-bar-background-rectangle"});return f.createElement(n1,Va({key:"background-bar-".concat(y)},E))}))}function nre(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(a=>{var s={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return qn(qn({},s),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:s,fill:a.fill})});return f.createElement($b,{value:t?i:void 0},n)}function rre(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:s}=e,l=Ne(Ka),c=Ne(_b),u=n&&String(i.originalDataIndex)===l&&(c==null||s===c),[p,d]=f.useState(!1),[h,m]=f.useState(!1);f.useEffect(()=>{var j;return u?(d(!0),j=requestAnimationFrame(()=>{m(!0)})):m(!1),()=>{cancelAnimationFrame(j)}},[u]);var g=f.useCallback(()=>{u||d(!1)},[u]),y=u&&h,x=u||p,v;u?n===!0?v=t:v=n:v=t;var b=f.createElement(n1,Va({},r,{name:String(r.name)},i,{isActive:y,option:v,index:a,dataKey:s,onTransitionEnd:g}));return x?f.createElement(er,{zIndex:tn.activeBar},f.createElement(bM,{index:i.originalDataIndex},b)):b}function ire(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return f.createElement(n1,Va({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function are(e){var t,{data:n,props:r}=e,i=(t=Xn(r))!==null&&t!==void 0?t:{},{id:a}=i,s=If(i,qne),{shape:l,dataKey:c,activeBar:u}=r,{onMouseEnter:p,onClick:d,onMouseLeave:h}=r,m=If(r,Yne),g=qb(p,c,a),y=Yb(h),x=Gb(d,c,a);return n?f.createElement(f.Fragment,null,n.map((v,b)=>f.createElement(bM,Va({index:v.originalDataIndex,key:"rectangle-".concat(v==null?void 0:v.x,"-").concat(v==null?void 0:v.y,"-").concat(v==null?void 0:v.value,"-").concat(b),className:"recharts-bar-rectangle"},wu(m,v,b),{onMouseEnter:g(v,b),onMouseLeave:y(v,b),onClick:x(v,b)}),u?f.createElement(rre,{shape:l,activeBar:u,baseProps:s,entry:v,index:b,dataKey:c}):f.createElement(ire,{shape:l,baseProps:s,entry:v,index:b,dataKey:c})))):null}function ore(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:s,animationDuration:l,animationEasing:c,onAnimationEnd:u,onAnimationStart:p}=t,d=n.current,h=Sl(t,"recharts-bar-"),[m,g]=f.useState(!1),y=!m,x=f.useCallback(()=>{typeof u=="function"&&u(),g(!1)},[u]),v=f.useCallback(()=>{typeof p=="function"&&p(),g(!0)},[p]);return f.createElement(nre,{showLabels:y,rects:r},f.createElement(wl,{animationId:h,begin:s,duration:l,isActive:a,easing:c,onAnimationEnd:x,onAnimationStart:v,key:h},b=>{var j=b===1?r:r==null?void 0:r.map((w,k)=>{var S=d&&d[k];if(S)return qn(qn({},w),{},{x:yt(S.x,w.x,b),y:yt(S.y,w.y,b),width:yt(S.width,w.width,b),height:yt(S.height,w.height,b)});if(i==="horizontal"){var E=yt(0,w.height,b),A=yt(w.stackedBarStart,w.y,b);return qn(qn({},w),{},{y:A,height:E})}var D=yt(0,w.width,b),T=yt(w.stackedBarStart,w.x,b);return qn(qn({},w),{},{width:D,x:T})});return b>0&&(n.current=j??null),j==null?null:f.createElement(Ht,null,f.createElement(are,{props:t,data:j}))}),f.createElement(Vh,{label:t.label}),t.children)}function sre(e){var t=f.useRef(null);return f.createElement(ore,{previousRectanglesRef:t,props:e})}var jM=0,lre=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:ft(e,t)}};class cre extends f.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:s,needClip:l,background:c,id:u}=this.props;if(t||n==null)return null;var p=dt("recharts-bar",i),d=u;return f.createElement(Ht,{className:p,id:u},l&&f.createElement("defs",null,f.createElement(e1,{clipPathId:d,xAxisId:a,yAxisId:s})),f.createElement(Ht,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(d,")"):void 0},f.createElement(tre,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),f.createElement(sre,this.props)))}}var ure={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:jM,xAxisId:0,yAxisId:0,zIndex:tn.bar};function dre(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:u,isAnimationActive:p}=e,{needClip:d}=cm(t,n),h=Za(),m=jn(),g=Kb(e.children,Wu),y=Ne(b=>zne(b,e.id,m,g));if(h!=="vertical"&&h!=="horizontal")return null;var x,v=y==null?void 0:y[0];return v==null||v.height==null||v.width==null?x=0:x=h==="vertical"?v.height/2:v.width/2,f.createElement(rM,{xAxisId:t,yAxisId:n,data:y,dataPointFormatter:lre,errorBarOffset:x},f.createElement(cre,Va({},e,{layout:h,needClip:d,data:y,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:u,isAnimationActive:p})))}function pre(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:s,xAxis:l,yAxis:c,xAxisTicks:u,yAxisTicks:p,stackedData:d,displayedData:h,offset:m,cells:g,parentViewBox:y,dataStartIndex:x}=e,v=t==="horizontal"?c:l,b=d?v.scale.domain():null,j=XW({numericAxis:v}),w=v.scale.map(j);return h.map((k,S)=>{var E,A,D,T,I,_;if(d){var G=d[S+x];if(G==null)return null;E=HW(G,b)}else E=ft(k,n),Array.isArray(E)||(E=[j,E]);var K=jne(r,jM)(E[1],S);if(t==="horizontal"){var O,B=c.scale.map(E[0]),W=c.scale.map(E[1]);if(B==null||W==null)return null;A=xS({axis:l,ticks:u,bandSize:s,offset:a.offset,entry:k,index:S}),D=(O=W??B)!==null&&O!==void 0?O:void 0,T=a.size;var R=B-W;if(I=ii(R)?0:R,_={x:A,y:m.top,width:T,height:m.height},Math.abs(K)>0&&Math.abs(I)<Math.abs(K)){var $=xn(I||K)*(Math.abs(K)-Math.abs(I));D-=$,I+=$}}else{var P=l.scale.map(E[0]),F=l.scale.map(E[1]);if(P==null||F==null)return null;if(A=P,D=xS({axis:c,ticks:p,bandSize:s,offset:a.offset,entry:k,index:S}),T=F-P,I=a.size,_={x:m.left,y:D,width:m.width,height:I},Math.abs(K)>0&&Math.abs(T)<Math.abs(K)){var re=xn(T||K)*(Math.abs(K)-Math.abs(T));T+=re}}if(A==null||D==null||T==null||I==null||!i&&(T===0||I===0))return null;var N=qn(qn({},k),{},{stackedBarStart:w,x:A,y:D,width:T,height:I,value:d?E:E[1],payload:k,background:_,tooltipPosition:{x:A+T/2,y:D+I/2},parentViewBox:y,originalDataIndex:S},g&&g[S]&&g[S].props);return N}).filter(Boolean)}function fre(e){var t=nn(e,ure),n=Une(t.stackId),r=jn();return f.createElement(om,{id:t.id,type:"bar"},i=>f.createElement(f.Fragment,null,f.createElement(Xb,{legendPayload:Zne(t)}),f.createElement(ere,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),f.createElement(Qb,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),f.createElement(er,{zIndex:t.zIndex},f.createElement(dre,Va({},t,{id:i})))))}var wM=f.memo(fre,ts);wM.displayName="Bar";var hre=["domain","range"],mre=["domain","range"];function kP(e,t){if(e==null)return{};var n,r,i=gre(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gre(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function CP(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function SM(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=kP(e,hre),{domain:a,range:s}=t,l=kP(t,mre);return!CP(n,a)||!CP(r,s)?!1:ts(i,l)}var vre=["type"],yre=["dangerouslySetInnerHTML","ticks","scale"],xre=["id","scale"];function Dy(){return Dy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dy.apply(null,arguments)}function PP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PP(Object(n),!0).forEach(function(r){bre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bre(e,t,n){return(t=jre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jre(e){var t=wre(e,"string");return typeof t=="symbol"?t:t+""}function wre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ly(e,t){if(e==null)return{};var n,r,i=Sre(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Sre(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kre(e){var t=wt(),n=f.useRef(null),r=E0(),{type:i}=e,a=Ly(e,vre),s=Th(r,"xAxis",i),l=f.useMemo(()=>{if(s!=null)return EP(EP({},a),{},{type:s})},[a,s]);return f.useLayoutEffect(()=>{l!=null&&(n.current===null?t(HZ(l)):n.current!==l&&t(VZ({prev:n.current,next:l})),n.current=l)},[l,t]),f.useLayoutEffect(()=>()=>{n.current&&(t(qZ(n.current)),n.current=null)},[t]),null}var Cre=e=>{var{xAxisId:t,className:n}=e,r=Ne(w0),i=jn(),a="xAxis",s=Ne(v=>KN(v,a,t,i)),l=Ne(v=>FN(v,t)),c=Ne(v=>zY(v,t)),u=Ne(v=>xN(v,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:p,ticks:d,scale:h}=e,m=Ly(e,yre),{id:g,scale:y}=u,x=Ly(u,xre);return f.createElement(Zb,Dy({},m,x,{x:c.x,y:c.y,width:l.width,height:l.height,className:dt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:s,axisType:a,axisId:t}))},Pre={allowDataOverflow:ln.allowDataOverflow,allowDecimals:ln.allowDecimals,allowDuplicatedCategory:ln.allowDuplicatedCategory,angle:ln.angle,axisLine:Gi.axisLine,height:ln.height,hide:!1,includeHidden:ln.includeHidden,interval:ln.interval,label:!1,minTickGap:ln.minTickGap,mirror:ln.mirror,orientation:ln.orientation,padding:ln.padding,reversed:ln.reversed,scale:ln.scale,tick:ln.tick,tickCount:ln.tickCount,tickLine:Gi.tickLine,tickSize:Gi.tickSize,type:ln.type,niceTicks:ln.niceTicks,xAxisId:0},Ere=e=>{var t=nn(e,Pre);return f.createElement(f.Fragment,null,f.createElement(kre,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),f.createElement(Cre,t))},Rs=f.memo(Ere,SM);Rs.displayName="XAxis";var Tre=["type"],Are=["dangerouslySetInnerHTML","ticks","scale"],Ore=["id","scale"];function zy(){return zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zy.apply(null,arguments)}function TP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function AP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TP(Object(n),!0).forEach(function(r){Ire(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ire(e,t,n){return(t=Nre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nre(e){var t=_re(e,"string");return typeof t=="symbol"?t:t+""}function _re(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $y(e,t){if(e==null)return{};var n,r,i=Mre(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Mre(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Rre(e){var t=wt(),n=f.useRef(null),r=E0(),{type:i}=e,a=$y(e,Tre),s=Th(r,"yAxis",i),l=f.useMemo(()=>{if(s!=null)return AP(AP({},a),{},{type:s})},[s,a]);return f.useLayoutEffect(()=>{l!=null&&(n.current===null?t(YZ(l)):n.current!==l&&t(GZ({prev:n.current,next:l})),n.current=l)},[l,t]),f.useLayoutEffect(()=>()=>{n.current&&(t(XZ(n.current)),n.current=null)},[t]),null}function Dre(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=f.useRef(null),s=f.useRef(null),l=Ne(w0),c=jn(),u=wt(),p="yAxis",d=Ne(S=>UN(S,t)),h=Ne(S=>BY(S,t)),m=Ne(S=>KN(S,p,t,c)),g=Ne(S=>bN(S,t));if(f.useLayoutEffect(()=>{if(!(r!=="auto"||!d||zb(i)||f.isValidElement(i)||g==null)){var S=a.current;if(S){var E=S.getCalculatedWidth();Math.round(d.width)!==Math.round(E)&&u(QZ({id:t,width:E}))}}},[m,d,u,i,t,r,g]),d==null||h==null||g==null)return null;var{dangerouslySetInnerHTML:y,ticks:x,scale:v}=e,b=$y(e,Are),{id:j,scale:w}=g,k=$y(g,Ore);return f.createElement(Zb,zy({},b,k,{ref:a,labelRef:s,x:h.x,y:h.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:d.width,height:d.height,className:dt("recharts-".concat(p," ").concat(p),n),viewBox:l,ticks:m,axisType:p,axisId:t}))}var Lre={allowDataOverflow:cn.allowDataOverflow,allowDecimals:cn.allowDecimals,allowDuplicatedCategory:cn.allowDuplicatedCategory,angle:cn.angle,axisLine:Gi.axisLine,hide:!1,includeHidden:cn.includeHidden,interval:cn.interval,label:!1,minTickGap:cn.minTickGap,mirror:cn.mirror,orientation:cn.orientation,padding:cn.padding,reversed:cn.reversed,scale:cn.scale,tick:cn.tick,tickCount:cn.tickCount,tickLine:Gi.tickLine,tickSize:Gi.tickSize,type:cn.type,niceTicks:cn.niceTicks,width:cn.width,yAxisId:0},zre=e=>{var t=nn(e,Lre);return f.createElement(f.Fragment,null,f.createElement(Rre,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),f.createElement(Dre,t))},Ds=f.memo(zre,SM);Ds.displayName="YAxis";var $re=(e,t)=>t,r1=q([$re,ot,MI,wn,l_,pa,sX,fn],hX);function Bre(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function i1(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Bre(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var s=(l,c)=>({relativeX:Math.round((l-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(l=>s(l.clientX,l.clientY)):s(e.clientX,e.clientY)}var kM=jr("mouseClick"),CM=ku();CM.startListening({actionCreator:kM,effect:(e,t)=>{var n=e.payload,r=r1(t.getState(),i1(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(nG({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var By=jr("mouseMove"),PM=ku(),fs=null,co=null,Cg=null;PM.startListening({actionCreator:By,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,s=a==="all"||(a==null?void 0:a.includes("mousemove"));fs!==null&&(cancelAnimationFrame(fs),fs=null),co!==null&&(typeof i!="number"||!s)&&(clearTimeout(co),co=null),Cg=i1(n);var l=()=>{var c=t.getState(),u=Fu(c,c.tooltip.settings.shared);if(!Cg){fs=null,co=null;return}if(u==="axis"){var p=r1(c,Cg);(p==null?void 0:p.activeIndex)!=null?t.dispatch(JN({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(QN())}fs=null,co=null};if(!s){l();return}i==="raf"?fs=requestAnimationFrame(l):typeof i=="number"&&co===null&&(co=setTimeout(l,i))}});function Fre(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var OP={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},EM=Wn({name:"rootProps",initialState:OP,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:OP.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Ure=EM.reducer,{updateOptions:Wre}=EM.actions,Kre=null,Hre={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},TM=Wn({name:"polarOptions",initialState:Kre,reducers:Hre}),{updatePolarOptions:Vre}=TM.actions,qre=TM.reducer,AM=jr("keyDown"),OM=jr("focus"),IM=jr("blur"),um=ku(),hs=null,uo=null,Md=null;um.startListening({actionCreator:AM,effect:(e,t)=>{Md=e.payload,hs!==null&&(cancelAnimationFrame(hs),hs=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");uo!==null&&(typeof r!="number"||!a)&&(clearTimeout(uo),uo=null);var s=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var{keyboardInteraction:u}=l.tooltip,p=Md;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var d=kc(u,Go(l),pl(l),fl(l)),h=d==null?-1:Number(d),m=!Number.isFinite(h)||h<0,g=pa(l),y=Go(l),x=Fu(l,l.tooltip.settings.shared);if(p==="Enter"){if(m)return;var v=kf(l,x,"hover",String(u.index));t.dispatch(Sf({active:!u.active,activeIndex:u.index,activeCoordinate:v}));return}var b=HY(l),j=b==="left-to-right"?1:-1,w=p==="ArrowRight"?1:-1,k;if(m){var S=pl(l),E=fl(l),A=w*j,D=K=>({active:!1,index:String(K),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(k=-1,A>0){for(var T=0;T<y.length;T++)if(kc(D(T),y,S,E)!=null){k=T;break}}else for(var I=y.length-1;I>=0;I--)if(kc(D(I),y,S,E)!=null){k=I;break}if(k<0)return}else{k=h+w*j;var _=(g==null?void 0:g.length)||y.length;if(_===0||k>=_||k<0)return}var G=kf(l,x,"hover",String(k));t.dispatch(Sf({active:!0,activeIndex:k.toString(),activeCoordinate:G}))}finally{hs=null,uo=null}};if(!a){s();return}r==="raf"?hs=requestAnimationFrame(s):typeof r=="number"&&uo===null&&(s(),Md=null,uo=setTimeout(()=>{Md?s():(uo=null,hs=null)},r))}});um.startListening({actionCreator:OM,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",s=Fu(n,n.tooltip.settings.shared),l=kf(n,s,"hover",String(a));t.dispatch(Sf({active:!0,activeIndex:a,activeCoordinate:l}))}}}});um.startListening({actionCreator:IM,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(Sf({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function NM(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Tr=jr("externalEvent"),_M=ku(),Rd=new Map,tc=new Map,Pg=new Map;_M.startListening({actionCreator:Tr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=NM(r);Pg.set(i,{handler:n,reactEvent:a});var s=Rd.get(i);s!==void 0&&(cancelAnimationFrame(s),Rd.delete(i));var l=t.getState(),{throttleDelay:c,throttledEvents:u}=l.eventSettings,p=u,d=p==="all"||(p==null?void 0:p.includes(i)),h=tc.get(i);h!==void 0&&(typeof c!="number"||!d)&&(clearTimeout(h),tc.delete(i));var m=()=>{var x=Pg.get(i);try{if(!x)return;var{handler:v,reactEvent:b}=x,j=t.getState(),w={activeCoordinate:VG(j),activeDataKey:_b(j),activeIndex:Ka(j),activeLabel:d_(j),activeTooltipIndex:Ka(j),isTooltipActive:qG(j)};v&&v(w,b)}finally{Rd.delete(i),tc.delete(i),Pg.delete(i)}};if(!d){m();return}if(c==="raf"){var g=requestAnimationFrame(m);Rd.set(i,g)}else if(typeof c=="number"){if(!tc.has(i)){m();var y=setTimeout(m,c);tc.set(i,y)}}else m()}}});var Yre=q([Il],e=>e.tooltipItemPayloads),Gre=q([Yre,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),MM=jr("touchMove"),RM=ku(),po=null,va=null,IP=null,nc=null;RM.startListening({actionCreator:MM,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){nc=NM(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,s=a==="all"||a.includes("touchmove");po!==null&&(cancelAnimationFrame(po),po=null),va!==null&&(typeof i!="number"||!s)&&(clearTimeout(va),va=null),IP=Array.from(n.touches).map(c=>i1({clientX:c.clientX,clientY:c.clientY,currentTarget:n.currentTarget}));var l=()=>{if(nc!=null){var c=t.getState(),u=Fu(c,c.tooltip.settings.shared);if(u==="axis"){var p,d=(p=IP)===null||p===void 0?void 0:p[0];if(d==null){po=null,va=null;return}var h=r1(c,d);(h==null?void 0:h.activeIndex)!=null&&t.dispatch(JN({activeIndex:h.activeIndex,activeDataKey:void 0,activeCoordinate:h.activeCoordinate}))}else if(u==="item"){var m,g=nc.touches[0];if(document.elementFromPoint==null||g==null)return;var y=document.elementFromPoint(g.clientX,g.clientY);if(!y||!y.getAttribute)return;var x=y.getAttribute($O),v=(m=y.getAttribute(BO))!==null&&m!==void 0?m:void 0,b=is(c).find(k=>k.id===v);if(x==null||b==null||v==null)return;var{dataKey:j}=b,w=Gre(c,x,v);t.dispatch(XN({activeDataKey:j,activeIndex:x,activeCoordinate:w,activeGraphicalItemId:v}))}po=null,va=null}};if(!s){l();return}i==="raf"?po=requestAnimationFrame(l):typeof i=="number"&&va===null&&(l(),nc=null,va=setTimeout(()=>{nc?l():(va=null,po=null)},i))}}});var a1={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},DM=Wn({name:"eventSettings",initialState:a1,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Xre}=DM.actions,Qre=DM.reducer,Jre=oO({brush:mee,cartesianAxis:JZ,chartData:WX,errorBars:hte,eventSettings:Qre,graphicalItems:rZ,layout:BW,legend:WK,options:zX,polarAxis:xJ,polarOptions:qre,referenceElements:xee,renderedTicks:Dee,rootProps:Ure,tooltip:rG,zIndex:EX}),Zre=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return dW({reducer:Jre,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([CM.middleware,PM.middleware,um.middleware,_M.middleware,RM.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(jO({type:"raf"}))},devTools:{serialize:{replacer:Fre},name:"recharts-".concat(n)}})};function LM(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=jn(),a=f.useRef(null);if(i)return n;a.current==null&&(a.current=Zre(t,r));var s=m0;return f.createElement(d9,{context:s,store:a.current},n)}function eie(e){var{layout:t,margin:n}=e,r=wt(),i=jn();return f.useEffect(()=>{i||(r(LW(t)),r(DW(n)))},[r,i,t,n]),null}var zM=f.memo(eie,ts);function $M(e){var t=wt();return f.useEffect(()=>{t(Wre(e))},[t,e]),null}var tie=e=>{var t=wt();return f.useEffect(()=>{t(Xre(e))},[t,e]),null},BM=f.memo(tie,ts);function NP(e){var{zIndex:t,isPanorama:n}=e,r=f.useRef(null),i=wt();return f.useLayoutEffect(()=>(r.current&&i(CX({zIndex:t,element:r.current,isPanorama:n})),()=>{i(PX({zIndex:t,isPanorama:n}))}),[i,t,n]),f.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function _P(e){var{children:t,isPanorama:n}=e,r=Ne(gX);if(!r||r.length===0)return t;var i=r.filter(s=>s<0),a=r.filter(s=>s>0);return f.createElement(f.Fragment,null,i.map(s=>f.createElement(NP,{key:s,zIndex:s,isPanorama:n})),t,a.map(s=>f.createElement(NP,{key:s,zIndex:s,isPanorama:n})))}var nie=["children"];function rie(e,t){if(e==null)return{};var n,r,i=iie(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function iie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Nf(){return Nf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nf.apply(null,arguments)}var aie={width:"100%",height:"100%",display:"block"},oie=f.forwardRef((e,t)=>{var n=C0(),r=P0(),i=rI();if(!Ai(n)||!Ai(r))return null;var{children:a,otherAttributes:s,title:l,desc:c}=e,u,p;return s!=null&&(typeof s.tabIndex=="number"?u=s.tabIndex:u=i?0:void 0,typeof s.role=="string"?p=s.role:p=i?"application":void 0),f.createElement(o0,Nf({},s,{title:l,desc:c,role:p,tabIndex:u,width:n,height:r,style:aie,ref:t}),a)}),sie=e=>{var{children:t}=e,n=Ne(wh);if(!n)return null;var{width:r,height:i,y:a,x:s}=n;return f.createElement(o0,{width:r,height:i,x:s,y:a},t)},MP=f.forwardRef((e,t)=>{var{children:n}=e,r=rie(e,nie),i=jn();return i?f.createElement(sie,null,f.createElement(_P,{isPanorama:!0},n)):f.createElement(oie,Nf({ref:t},r),f.createElement(_P,{isPanorama:!1},n))});function lie(){var e=wt(),[t,n]=f.useState(null),r=Ne(nK);return f.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Je(a)&&a!==r&&e($W(a))}},[t,e,r]),n}function RP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RP(Object(n),!0).forEach(function(r){uie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uie(e,t,n){return(t=die(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function die(e){var t=pie(e,"string");return typeof t=="symbol"?t:t+""}function pie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ba(){return Ba=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ba.apply(null,arguments)}var fie=()=>(JX(),null);function _f(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var hie=f.forwardRef((e,t)=>{var n,r,i=f.useRef(null),[a,s]=f.useState({containerWidth:_f((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:_f((r=e.style)===null||r===void 0?void 0:r.height)}),l=f.useCallback((u,p)=>{s(d=>{var h=Math.round(u),m=Math.round(p);return d.containerWidth===h&&d.containerHeight===m?d:{containerWidth:h,containerHeight:m}})},[]),c=f.useCallback(u=>{if(typeof t=="function"&&t(u),i.current!=null&&(i.current.disconnect(),i.current=null),u!=null&&typeof ResizeObserver<"u"){var{width:p,height:d}=u.getBoundingClientRect();l(p,d);var h=g=>{var y=g[0];if(y!=null){var{width:x,height:v}=y.contentRect;l(x,v)}},m=new ResizeObserver(h);m.observe(u),i.current=m}},[t,l]);return f.useEffect(()=>()=>{var u=i.current;u!=null&&u.disconnect()},[l]),f.createElement(f.Fragment,null,f.createElement(Pu,{width:a.containerWidth,height:a.containerHeight}),f.createElement("div",Ba({ref:c},e)))}),mie=f.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=f.useState({containerWidth:_f(n),containerHeight:_f(r)}),s=f.useCallback((c,u)=>{a(p=>{var d=Math.round(c),h=Math.round(u);return p.containerWidth===d&&p.containerHeight===h?p:{containerWidth:d,containerHeight:h}})},[]),l=f.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:p}=c.getBoundingClientRect();s(u,p)}},[t,s]);return f.createElement(f.Fragment,null,f.createElement(Pu,{width:i.containerWidth,height:i.containerHeight}),f.createElement("div",Ba({ref:l},e)))}),gie=f.forwardRef((e,t)=>{var{width:n,height:r}=e;return f.createElement(f.Fragment,null,f.createElement(Pu,{width:n,height:r}),f.createElement("div",Ba({ref:t},e)))}),vie=f.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?f.createElement(mie,Ba({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?f.createElement(gie,Ba({},e,{width:n,height:r,ref:t})):f.createElement(f.Fragment,null,f.createElement(Pu,{width:n,height:r}),f.createElement("div",Ba({ref:t},e)))});function yie(e){return e?hie:vie}var xie=f.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:s,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:p,onMouseMove:d,onMouseUp:h,onTouchEnd:m,onTouchMove:g,onTouchStart:y,style:x,width:v,responsive:b,dispatchTouchEvents:j=!0}=e,w=f.useRef(null),k=wt(),[S,E]=f.useState(null),[A,D]=f.useState(null),T=lie(),I=S0(),_=(I==null?void 0:I.width)>0?I.width:v,G=(I==null?void 0:I.height)>0?I.height:i,K=f.useCallback(J=>{T(J),typeof t=="function"&&t(J),E(J),D(J),J!=null&&(w.current=J)},[T,t,E,D]),O=f.useCallback(J=>{k(kM(J)),k(Tr({handler:a,reactEvent:J}))},[k,a]),B=f.useCallback(J=>{k(By(J)),k(Tr({handler:u,reactEvent:J}))},[k,u]),W=f.useCallback(J=>{k(QN()),k(Tr({handler:p,reactEvent:J}))},[k,p]),R=f.useCallback(J=>{k(By(J)),k(Tr({handler:d,reactEvent:J}))},[k,d]),$=f.useCallback(()=>{k(OM())},[k]),P=f.useCallback(()=>{k(IM())},[k]),F=f.useCallback(J=>{k(AM(J.key))},[k]),re=f.useCallback(J=>{k(Tr({handler:s,reactEvent:J}))},[k,s]),N=f.useCallback(J=>{k(Tr({handler:l,reactEvent:J}))},[k,l]),pe=f.useCallback(J=>{k(Tr({handler:c,reactEvent:J}))},[k,c]),ve=f.useCallback(J=>{k(Tr({handler:h,reactEvent:J}))},[k,h]),X=f.useCallback(J=>{k(Tr({handler:y,reactEvent:J}))},[k,y]),oe=f.useCallback(J=>{j&&k(MM(J)),k(Tr({handler:g,reactEvent:J}))},[k,j,g]),de=f.useCallback(J=>{k(Tr({handler:m,reactEvent:J}))},[k,m]),ie=yie(b);return f.createElement(b_.Provider,{value:S},f.createElement(mA.Provider,{value:A},f.createElement(ie,{width:_??(x==null?void 0:x.width),height:G??(x==null?void 0:x.height),className:dt("recharts-wrapper",r),style:cie({position:"relative",cursor:"default",width:_,height:G},x),onClick:O,onContextMenu:re,onDoubleClick:N,onFocus:$,onBlur:P,onKeyDown:F,onMouseDown:pe,onMouseEnter:B,onMouseLeave:W,onMouseMove:R,onMouseUp:ve,onTouchEnd:de,onTouchMove:oe,onTouchStart:X,ref:K},f.createElement(fie,null),n)))}),bie=["width","height","responsive","children","className","style","compact","title","desc"];function jie(e,t){if(e==null)return{};var n,r,i=wie(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function wie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var FM=f.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:s,style:l,compact:c,title:u,desc:p}=e,d=jie(e,bie),h=Xn(d);return c?f.createElement(f.Fragment,null,f.createElement(Pu,{width:n,height:r}),f.createElement(MP,{otherAttributes:h,title:u,desc:p},a)):f.createElement(xie,{className:s,style:l,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},f.createElement(MP,{otherAttributes:h,title:u,desc:p,ref:t},f.createElement(jee,null,a)))});function Fy(){return Fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fy.apply(null,arguments)}function DP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DP(Object(n),!0).forEach(function(r){kie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kie(e,t,n){return(t=Cie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cie(e){var t=Pie(e,"string");return typeof t=="symbol"?t:t+""}function Pie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Eie={top:5,right:5,bottom:5,left:5},Tie=Sie({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Eie,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},a1),o1=f.forwardRef(function(t,n){var r,i=nn(t.categoricalChartProps,Tie),{chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:u}=t,p={chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return f.createElement(LM,{preloadedState:{options:p},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},f.createElement(X_,{chartData:u.data}),f.createElement(zM,{layout:i.layout,margin:i.margin}),f.createElement(BM,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),f.createElement($M,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),f.createElement(FM,Fy({},i,{ref:n})))}),Aie=["axis"],Uy=f.forwardRef((e,t)=>f.createElement(o1,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Aie,tooltipPayloadSearcher:Kh,categoricalChartProps:e,ref:t})),Oie=["axis","item"],Iie=f.forwardRef((e,t)=>f.createElement(o1,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Oie,tooltipPayloadSearcher:Kh,categoricalChartProps:e,ref:t}));function Nie(e){var t=wt();return f.useEffect(()=>{t(Vre(e))},[t,e]),null}var _ie=["layout"];function Wy(){return Wy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wy.apply(null,arguments)}function Mie(e,t){if(e==null)return{};var n,r,i=Rie(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Rie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function LP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Die(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LP(Object(n),!0).forEach(function(r){Lie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lie(e,t,n){return(t=zie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zie(e){var t=$ie(e,"string");return typeof t=="symbol"?t:t+""}function $ie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bie={top:5,right:5,bottom:5,left:5},UM=Die({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Bie,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},a1),Fie=f.forwardRef(function(t,n){var r,i=nn(t.categoricalChartProps,UM),{layout:a}=i,s=Mie(i,_ie),{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:p}=t,d={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:p,eventEmitter:void 0};return f.createElement(LM,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},f.createElement(X_,{chartData:i.data}),f.createElement(zM,{layout:a,margin:i.margin}),f.createElement(BM,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),f.createElement($M,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),f.createElement(Nie,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),f.createElement(FM,Wy({},s,{ref:n})))});function zP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $P(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zP(Object(n),!0).forEach(function(r){Uie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uie(e,t,n){return(t=Wie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wie(e){var t=Kie(e,"string");return typeof t=="symbol"?t:t+""}function Kie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hie=["item"],Vie=$P($P({},UM),{},{layout:"centric",startAngle:0,endAngle:360}),qie=f.forwardRef((e,t)=>{var n=nn(e,Vie);return f.createElement(Fie,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Hie,tooltipPayloadSearcher:Kh,categoricalChartProps:n,ref:t})}),Yie=["axis"],Gie=f.forwardRef((e,t)=>f.createElement(o1,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Yie,tooltipPayloadSearcher:Kh,categoricalChartProps:e,ref:t}));const Xie={background:"var(--bg-card)",borderRadius:"16px",border:"1px solid var(--border-primary)",padding:"20px",marginTop:"24px"},Qie={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",cursor:"pointer",fontSize:"13px"},Eg={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"13px"};function Dd(e){return e?e>=1e3?`${(e/1e3).toFixed(2)}s`:`${Math.round(e)}ms`:"-"}function Ld(e){return e?Math.round(e).toLocaleString():"-"}function Jie(e){return`${(e*100).toFixed(1)}%`}function Zie(e,t){return e?e.slice(-t):[]}function eae(){const[e,t]=f.useState("service"),[n,r]=f.useState("ttft"),[i,a]=f.useState(24),[s,l]=f.useState("overview"),[c,u]=f.useState(null),[p,d]=f.useState(null),[h,m]=f.useState(null),[g,y]=f.useState(null),[x,v]=f.useState("desc"),[b,j]=f.useState([]),[w,k]=f.useState([]),[S,E]=f.useState(null),[A,D]=f.useState(null),[T,I]=f.useState(null),[_,G]=f.useState(!1),[K,O]=f.useState(null),B=f.useCallback(async()=>{G(!0),O(null);try{s==="overview"?e==="service"?j(await V.getPerformanceServicesOverview()||[]):k(await V.getPerformanceVendors()||[]):s==="vendor"&&c?E(await V.getPerformanceVendor(c)):s==="service"&&p?D(await V.getPerformanceService(p)):s==="model"&&p&&h&&I(await V.getPerformanceModel(p,h))}catch(se){O((se==null?void 0:se.message)||"加载失败")}finally{G(!1)}},[e,s,c,p,h]);f.useEffect(()=>{B()},[B]);const W=se=>{t(se),l("overview"),u(null),d(null),m(null),E(null),D(null),I(null),y(null)},R=se=>{u(se),d(null),m(null),E(null),D(null),I(null),l("vendor"),y(null)},$=se=>{d(se),m(null),D(null),I(null),l("service"),y(null)},P=se=>{m(se),I(null),l("model"),y(null)},F=()=>{u(null),d(null),m(null),l("overview"),y(null)},re=()=>{d(null),m(null),D(null),l("vendor"),y(null)},N=f.useMemo(()=>s==="overview"&&e==="service"?b.map(se=>({id:se.serviceId,name:se.serviceName||se.serviceId,vendorName:se.vendorName,derived:se.derived,onClick:()=>$(se.serviceId)})):s==="overview"&&e==="vendor"?w.map(se=>({id:se.vendorId,name:se.vendorName||se.vendorId,derived:se.derived,onClick:()=>R(se.vendorId)})):s==="vendor"&&S?S.services.map(se=>({id:se.serviceId,name:se.serviceName||se.serviceId,derived:se.derived,onClick:()=>$(se.serviceId)})):s==="service"&&A?A.models.map(se=>({id:se.model,name:se.model,derived:se.derived,onClick:()=>P(se.model)})):[],[s,e,b,w,S,A]),pe=f.useMemo(()=>{if(!g)return N;const se=x==="asc"?1:-1;return[...N].sort((Le,$e)=>{const Ye=Le.derived[g]??0,lt=$e.derived[g]??0;return(Ye-lt)*se})},[N,g,x]),ve=se=>{g===se?v(Le=>Le==="asc"?"desc":"asc"):(y(se),v("desc"))},X=se=>g!==se?" ⇅":x==="asc"?" ▲":" ▼",oe=(()=>{if(s==="vendor")return S==null?void 0:S.hourly;if(s==="service")return A==null?void 0:A.hourly;if(s==="model")return T==null?void 0:T.hourly})(),ie=Zie(oe,i).map(se=>({hour:se.hour.slice(11),value:n==="ttft"?se.avgTtftMs:se.avgTpm})),J=s==="overview"&&e==="service",xe=s==="overview"&&e==="vendor"?"供应商":s==="service"?"模型":"API 服务",ae=n==="ttft"?"首 Token 返回时间":"吞吐 TPM",Me=s==="model"?T==null?void 0:T.derived:void 0;return o.jsxs("div",{style:Xie,children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",flexWrap:"wrap",gap:"8px"},children:[o.jsx("h3",{style:{margin:0,fontSize:"18px",color:"var(--text-primary)"},children:"⚡ 服务性能 / 测速统计"}),s!=="overview"&&o.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center",flexWrap:"wrap",fontSize:"13px"},children:[o.jsx("span",{onClick:F,style:Tg,children:e==="service"?"全部 API 服务":"全部供应商"}),e==="vendor"&&c&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"›"}),s==="vendor"?o.jsx("span",{style:{color:"var(--text-primary)"},children:(S==null?void 0:S.vendorName)||c}):o.jsx("span",{onClick:re,style:Tg,children:(S==null?void 0:S.vendorName)||c})]}),A&&(s==="service"||s==="model")&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"›"}),s==="service"?o.jsx("span",{style:{color:"var(--text-primary)"},children:A.serviceName||p}):o.jsx("span",{onClick:()=>{m(null),I(null),l("service"),y(null)},style:Tg,children:A.serviceName||p})]}),h&&s==="model"&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"›"}),o.jsx("span",{style:{color:"var(--text-primary)"},children:h})]})]})]}),o.jsx("p",{style:{margin:"0 0 16px 0",color:"var(--text-muted)",fontSize:"13px"},children:"全局统计,与认证模式无关。首 Token 返回时间 = 请求发起到首个 token 的延迟;TPM = 生成阶段每分钟吐出的 token 数(基于真实流量被动采集)。"}),o.jsxs("div",{style:{display:"flex",gap:"12px",marginBottom:"16px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"维度:"}),o.jsxs("select",{style:Eg,value:e,onChange:se=>W(se.target.value),disabled:s!=="overview",children:[o.jsx("option",{value:"service",children:"API 服务"}),o.jsx("option",{value:"vendor",children:"供应商"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"指标:"}),o.jsxs("select",{style:Eg,value:n,onChange:se=>r(se.target.value),children:[o.jsx("option",{value:"ttft",children:"首 Token 返回时间"}),o.jsx("option",{value:"tpm",children:"吞吐 TPM"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"时段:"}),o.jsxs("select",{style:Eg,value:i,onChange:se=>a(Number(se.target.value)),children:[o.jsx("option",{value:24,children:"近 24 小时"}),o.jsx("option",{value:168,children:"近 7 天"}),o.jsx("option",{value:720,children:"近 30 天"})]})]}),o.jsx("button",{style:Qie,onClick:B,children:"🔄 刷新"})]}),K&&o.jsx("div",{style:{color:"#e74c3c",marginBottom:"12px"},children:K}),o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:ms,children:xe}),J&&o.jsx("th",{style:ms,children:"供应商"}),o.jsxs("th",{style:{...ms,cursor:"pointer",userSelect:"none"},onClick:()=>ve("avgTtftMs"),children:["平均首Token",X("avgTtftMs")]}),o.jsxs("th",{style:{...ms,cursor:"pointer",userSelect:"none"},onClick:()=>ve("avgTpm"),children:["平均 TPM",X("avgTpm")]}),o.jsx("th",{style:ms,children:"样本数"}),o.jsxs("th",{style:{...ms,cursor:"pointer",userSelect:"none"},onClick:()=>ve("successRate"),children:["成功率",X("successRate")]})]})}),o.jsxs("tbody",{children:[_&&o.jsx("tr",{children:o.jsx("td",{style:ya,colSpan:J?6:5,align:"center",children:"加载中..."})}),!_&&pe.length===0&&o.jsx("tr",{children:o.jsx("td",{style:{...ya,color:"var(--text-muted)"},colSpan:J?6:5,align:"center",children:"暂无数据"})}),!_&&pe.map(se=>o.jsxs("tr",{style:tae,children:[o.jsx("td",{style:ya,children:o.jsx("span",{style:{color:"var(--text-primary)",cursor:"pointer",textDecoration:"underline"},onClick:se.onClick,children:se.name})}),J&&o.jsx("td",{style:{...ya,color:"var(--text-muted)"},children:se.vendorName||"-"}),o.jsx("td",{style:ya,children:Dd(se.derived.avgTtftMs)}),o.jsx("td",{style:ya,children:se.derived.count>0?Ld(se.derived.avgTpm):"-"}),o.jsx("td",{style:ya,children:se.derived.count}),o.jsx("td",{style:ya,children:Jie(se.derived.successRate)})]},se.id))]})]})}),s!=="overview"&&o.jsxs("div",{style:{marginTop:"24px"},children:[o.jsxs("h4",{style:{margin:"0 0 12px 0",fontSize:"15px",color:"var(--text-primary)"},children:[ae," · 按小时走势",Me&&o.jsxs("span",{style:{marginLeft:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["最小 ",n==="ttft"?Dd(Me.minTtftMs):Ld(Me.minTps?Me.minTps*60:void 0)," / 最大 ",n==="ttft"?Dd(Me.maxTtftMs):Ld(Me.maxTps?Me.maxTps*60:void 0)]})]}),ie.length===0?o.jsx("div",{style:{color:"var(--text-muted)",padding:"24px",textAlign:"center"},children:"暂无走势数据"}):o.jsx(vs,{width:"100%",height:260,children:o.jsxs(Uy,{data:ie,margin:{top:8,right:16,bottom:0,left:8},children:[o.jsx(_s,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Rs,{dataKey:"hour",stroke:"var(--text-muted)",fontSize:12}),o.jsx(Ds,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(ys,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px"},formatter:se=>[n==="ttft"?Dd(Number(se)):Ld(Number(se)),ae]}),o.jsx(Pc,{type:"monotone",dataKey:"value",stroke:"#667eea",strokeWidth:2,dot:!1,name:ae})]})})]})]})}const ms={textAlign:"left",padding:"10px 12px",borderBottom:"2px solid var(--border-primary)",color:"var(--text-muted)",fontWeight:500,fontSize:"12px"},ya={padding:"10px 12px",borderBottom:"1px solid var(--border-primary)",color:"var(--text-primary)"},Tg={color:"var(--text-primary)",cursor:"pointer",textDecoration:"underline",textDecorationColor:"transparent"},tae={transition:"background 0.15s"},BP=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#f97316"];function nae(){const[e,t]=f.useState(null),[n,r]=f.useState(!0),[i,a]=f.useState(30);f.useEffect(()=>{s()},[i]);const s=async()=>{try{r(!0);const d=await V.getStatistics(i);t(d)}catch(d){console.error("Failed to load statistics:",d)}finally{r(!1)}},l=d=>d>=1e6?`${(d/1e6).toFixed(1)}M`:d>=1e3?`${(d/1e3).toFixed(1)}K`:d.toString(),c=d=>{if(d>=60){const h=Math.floor(d/60),m=d%60;return`${h}h ${m}m`}return`${d}m`};if(n)return o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"60vh"},children:o.jsx("div",{style:{fontSize:"18px",color:"var(--text-muted)"},children:"加载统计数据中..."})});if(!e)return o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"60vh"},children:o.jsx("div",{style:{fontSize:"18px",color:"var(--text-muted)"},children:"暂无统计数据"})});const u={"image-understanding":"图像理解","high-iq":"高智商","long-context":"长上下文",thinking:"思考模式",background:"后台任务","model-mapping":"模型顶替",default:"默认请求"},p=e.timeline.map(d=>({date:d.date,codingTime:Math.round(d.totalInputTokens/250+d.totalOutputTokens/100)}));return o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"},children:[o.jsxs("div",{children:[o.jsx("h1",{style:{margin:0,fontSize:"28px",fontWeight:"bold",color:"var(--text-primary)"},children:"📊 数据统计"}),o.jsx("p",{style:{margin:"4px 0 0 0",color:"var(--text-muted)"},children:"查看您的 AI 编程助手使用情况分析"})]}),o.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-primary)",fontWeight:"500"},children:"统计周期:"}),o.jsxs("select",{value:i,onChange:d=>a(Number(d.target.value)),style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"14px",cursor:"pointer"},children:[o.jsx("option",{value:7,children:"最近 7 天"}),o.jsx("option",{value:30,children:"最近 30 天"}),o.jsx("option",{value:90,children:"最近 90 天"})]}),o.jsx("button",{onClick:s,style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"14px",cursor:"pointer"},children:"🔄 刷新"})]})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:"16px",marginBottom:"24px"},children:[o.jsxs("div",{style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"总请求数"}),o.jsx("div",{style:{fontSize:"32px",fontWeight:"bold"},children:l(e.overview.totalRequests)})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"总 Tokens"}),o.jsx("div",{style:{fontSize:"32px",fontWeight:"bold"},children:l(e.overview.totalTokens)})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"编程时长"}),o.jsx("div",{style:{fontSize:"32px",fontWeight:"bold"},children:c(e.overview.totalCodingTime)})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #14a042 0%, #38f9d7 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"成功率"}),o.jsxs("div",{style:{fontSize:"32px",fontWeight:"bold"},children:[e.overview.successRate.toFixed(1),"%"]})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #fa709a 0%, #fee140 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"平均响应时间"}),o.jsxs("div",{style:{fontSize:"32px",fontWeight:"bold"},children:[e.overview.avgResponseTime.toFixed(2),"ms"]})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #30cfd0 0%, #330867 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"配置统计"}),o.jsxs("div",{style:{fontSize:"14px",marginTop:"8px"},children:[e.overview.totalVendors," 供应商 · ",e.overview.totalServices," 服务 · ",e.overview.totalRoutes," 路由"]})]})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))",gap:"20px",marginBottom:"24px"},children:[o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"📈 请求趋势"}),o.jsx(vs,{width:"100%",height:300,children:o.jsxs(Gie,{data:e.timeline,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"colorRequests",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#8884d8",stopOpacity:.8}),o.jsx("stop",{offset:"95%",stopColor:"#8884d8",stopOpacity:0})]})}),o.jsx(_s,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Rs,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>xt(d).format("MM/DD")}),o.jsx(Ds,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(ys,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>xt(d).format("YYYY-MM-DD")}),o.jsx(lc,{}),o.jsx(_y,{type:"monotone",dataKey:"totalRequests",name:"请求数",stroke:"#8884d8",fillOpacity:1,fill:"url(#colorRequests)"})]})})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🔢 Token 使用趋势"}),o.jsx(vs,{width:"100%",height:300,children:o.jsxs(Uy,{data:e.timeline,children:[o.jsx(_s,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Rs,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>xt(d).format("MM/DD")}),o.jsx(Ds,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d?l(Number(d)):""}),o.jsx(ys,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>xt(d).format("YYYY-MM-DD"),formatter:d=>d?l(Number(d)):""}),o.jsx(lc,{}),o.jsx(Pc,{type:"monotone",dataKey:"totalInputTokens",name:"输入 Tokens",stroke:"#10b981",strokeWidth:2,dot:!1}),o.jsx(Pc,{type:"monotone",dataKey:"totalOutputTokens",name:"输出 Tokens",stroke:"#f59e0b",strokeWidth:2,dot:!1})]})})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"⏱️ 每日编程时长趋势"}),o.jsx(vs,{width:"100%",height:300,children:o.jsxs(Uy,{data:p,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"colorCodingTime",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#8b5cf6",stopOpacity:.8}),o.jsx("stop",{offset:"95%",stopColor:"#8b5cf6",stopOpacity:0})]})}),o.jsx(_s,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Rs,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>xt(d).format("MM/DD")}),o.jsx(Ds,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d!=null?d>=60?`${Math.round(Number(d)/60)}h`:`${Number(d)}m`:""}),o.jsx(ys,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>xt(d).format("YYYY-MM-DD"),formatter:d=>d!=null?c(Number(d)):""}),o.jsx(lc,{}),o.jsx(_y,{type:"monotone",dataKey:"codingTime",name:"编程时长",stroke:"#8b5cf6",fillOpacity:1,fill:"url(#colorCodingTime)"}),o.jsx(Pc,{type:"monotone",dataKey:"codingTime",name:"编程时长",stroke:"#8b5cf6",strokeWidth:3,dot:{fill:"#8b5cf6",r:4},activeDot:{r:6}})]})}),o.jsx("div",{style:{marginTop:"12px",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px",fontSize:"14px",color:"var(--text-muted)",textAlign:"center"},children:"💡 编程时长基于 tokens 估算(阅读速度 250 tokens/分钟,编码速度 100 tokens/分钟)"})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🏢 供应商使用分布"}),o.jsx(vs,{width:"100%",height:300,children:o.jsxs(Iie,{data:e.byVendor,children:[o.jsx(_s,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Rs,{dataKey:"vendorName",stroke:"var(--text-muted)",fontSize:12,angle:-45,textAnchor:"end",height:80}),o.jsx(Ds,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(ys,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"}}),o.jsx(lc,{}),o.jsx(wM,{dataKey:"totalRequests",name:"请求数",fill:"#3b82f6"})]})})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"📋 请求类型分布"}),o.jsx(vs,{width:"100%",height:300,children:o.jsxs(qie,{children:[o.jsx(V_,{data:e.contentTypeDistribution,cx:"50%",cy:"50%",labelLine:!0,label:d=>`${u[d.contentType]||d.contentType} (${d.percentage}%)`,outerRadius:80,fill:"#8884d8",dataKey:"count",children:e.contentTypeDistribution.map((d,h)=>o.jsx(Wu,{fill:BP[h%BP.length]},`cell-${h}`))}),o.jsx(ys,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},formatter:(d,h,m)=>{var b,j;const g=d??0,y=((b=m.payload)==null?void 0:b.percentage)??0,x=((j=m.payload)==null?void 0:j.contentType)||"",v=u[x]||x;return`${g} (${y}%) - ${v}`}})]})})]})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(400px, 1fr))",gap:"20px"},children:[o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🎯 按编程工具统计"}),o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--text-muted)",fontSize:"14px"},children:"类型"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"请求数"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"Tokens"})]})}),o.jsx("tbody",{children:e.byTargetType.map(d=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-secondary)"},children:[o.jsx("td",{style:{padding:"12px",color:"var(--text-primary)"},children:d.targetType==="claude-code"?"Claude Code":"Codex"}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalTokens)})]},d.targetType))})]})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🤖 按模型统计"}),o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--text-muted)",fontSize:"14px"},children:"模型"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"请求数"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"Tokens"})]})}),o.jsx("tbody",{children:e.byModel.slice(0,10).map(d=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-secondary)"},children:[o.jsx("td",{style:{padding:"12px",color:"var(--text-primary)",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis"},children:d.modelName}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalTokens)})]},d.modelName))})]})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🔧 按服务商API服务统计"}),o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--text-muted)",fontSize:"14px"},children:"服务"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"请求数"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"Tokens"})]})}),o.jsx("tbody",{children:e.byService.slice(0,10).map(d=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-secondary)"},children:[o.jsxs("td",{style:{padding:"12px",color:"var(--text-primary)"},children:[o.jsx("div",{style:{fontSize:"14px",fontWeight:"bold"},children:d.serviceName}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)"},children:d.vendorName})]}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalTokens)})]},d.serviceId))})]})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"💰 Token 详细统计"}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"输入 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalInputTokens)})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"输出 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalOutputTokens)})]}),e.overview.totalCacheReadTokens>0&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"缓存读取 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalCacheReadTokens)})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"总计 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalTokens)})]}),o.jsxs("div",{style:{marginTop:"8px",padding:"12px",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",borderRadius:"8px",color:"white"},children:[o.jsx("div",{style:{fontSize:"12px",opacity:.9},children:"预估节省"}),o.jsxs("div",{style:{fontSize:"20px",fontWeight:"bold",marginTop:"4px"},children:["$",(e.overview.totalTokens/1e6*15).toFixed(2)]}),o.jsx("div",{style:{fontSize:"12px",opacity:.9,marginTop:"4px"},children:"按 $15/1M tokens 估算"})]})]})]})]}),o.jsx(eae,{})]})}function FP({isOpen:e,onClose:t,title:n,children:r,showCloseButton:i=!0,closeOnOverlayClick:a=!1,maxWidth:s="600px"}){return e?o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},onClick:l=>{a||l.stopPropagation()},children:[i&&o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:s,width:"90%"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:n})}),r]})})]}):null}function rae(){const[e,t]=f.useState(!1),[n,r]=f.useState([]),[i,a]=f.useState(!0),[s,l]=f.useState({skillId:null,skillName:"",isDeleting:!1}),[c,u]=f.useState(!1),[p,d]=f.useState({name:"",description:"",instruction:"",link:"",targets:[]}),[h,m]=f.useState(!1),[g,y]=f.useState(!1),[x,v]=f.useState(""),[b,j]=f.useState(""),[w,k]=f.useState(!1),[S,E]=f.useState([]),[A,D]=f.useState(!1),[T,I]=f.useState({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}),_=async()=>{try{a(!0);const X=await V.getInstalledSkills();r(X)}catch(X){console.error("Failed to load installed skills:",X),U.error("加载已安装 Skills 失败")}finally{a(!1)}};f.useEffect(()=>{_()},[]);const G=async()=>{const X=b.trim();if(!X){U.warning("请输入需求描述后再搜索");return}try{k(!0),D(!0);const de=(await V.searchSkills(X)).sort((ie,J)=>{const xe=ie.stars??0;return(J.stars??0)-xe});E(de)}catch(oe){console.error("Failed to search skills:",oe),U.error("搜索失败,请稍后重试")}finally{k(!1)}},K=X=>{I({skill:X,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},O=()=>{T.isInstalling||I({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},B=(X,oe)=>{I(de=>({...de,selectedTargets:oe?[...de.selectedTargets,X]:de.selectedTargets.filter(ie=>ie!==X)}))},W=async()=>{var X;if(T.skill)try{I(de=>({...de,isInstalling:!0,status:"preparing",message:"正在准备安装...",progress:0})),I(de=>({...de,status:"downloading",message:"正在从GitHub下载..."}));const oe=await V.installSkill(T.skill,T.selectedTargets[0]);if(oe.success){const de=T.selectedTargets,ie=(X=oe.installedSkill)==null?void 0:X.id;if(!ie){I(xe=>({...xe,status:"error",message:"安装返回数据异常"})),U.error("安装返回数据异常");return}let J=0;for(const xe of de)(await V.enableSkill(ie,xe)).success&&J++;I(xe=>({...xe,status:"completed",message:de.length>0?`安装完成!已启用 ${J}/${de.length} 个目标`:"安装完成!可在列表中启用目标",progress:100})),de.length>0?U.success(`已安装到 ${de.map(xe=>xe==="claude-code"?"Claude Code":"Codex").join(", ")}`):U.success("安装完成!可在列表中启用目标"),await _()}else I(de=>({...de,status:"error",message:oe.message?`${oe.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试"})),U.error(oe.message?`${oe.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试")}catch(oe){console.error("Failed to install skill:",oe),I(de=>({...de,status:"error",message:"安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理"})),U.error("安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理")}finally{setTimeout(()=>{I(oe=>({...oe,skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}))},2e3)}},R=async(X,oe,de)=>{try{de?(await V.enableSkill(X,oe),U.success(`已启用 ${oe==="claude-code"?"Claude Code":"Codex"}`)):(await V.disableSkill(X,oe),U.success(`已禁用 ${oe==="claude-code"?"Claude Code":"Codex"}`)),await _()}catch(ie){console.error("Failed to toggle skill:",ie),U.error("操作失败,请稍后重试")}},$=X=>{l({skillId:X.id,skillName:X.name,isDeleting:!1})},P=()=>{s.isDeleting||l({skillId:null,skillName:"",isDeleting:!1})},F=async()=>{if(s.skillId)try{l(X=>({...X,isDeleting:!0})),await V.deleteSkill(s.skillId),U.success("已删除 Skill"),await _(),P()}catch(X){console.error("Failed to delete skill:",X),U.error("删除失败,请稍后重试"),l(oe=>({...oe,isDeleting:!1}))}},re=()=>{try{const X=x.trim();if(!X){U.error("请粘贴 SKILL.md 内容");return}let oe="",de="",ie=X;if(X.startsWith("---")){const J=X.indexOf("---",3);if(J!==-1){const xe=X.slice(3,J),ae=X.match(/^#\s+(.+)$/m);oe=ae?ae[1].trim():"";const Me=xe.split(`
|
|
470
|
-
`);for(const se of Me)se.startsWith("name:")?oe=se.replace("name:","").trim():se.startsWith("description:")&&(de=se.replace("description:","").trim());ie=X.slice(J+3).trim(),ie=ie.replace(/^##\s+指令\n*/,"").trim()}}else{const J=X.match(/^#\s+(.+)$/m);J&&(oe=J[1].trim())}if(!oe){U.error("无法解析 Skill 名称");return}d(J=>({...J,name:oe,description:de||J.description,instruction:ie||J.instruction})),y(!1),v(""),U.success("解析成功")}catch(X){console.error("Failed to parse skill:",X),U.error("解析失败,请检查格式")}},N=async X=>{var oe;if(X.preventDefault(),!p.name.trim()){U.error("请填写 Skill 名称");return}if(!p.description.trim()){U.error("请填写描述");return}if(!p.instruction.trim()){U.error("请填写指令");return}try{m(!0);const de=await V.createLocalSkill({name:p.name.trim(),description:p.description.trim(),instruction:p.instruction.trim(),link:p.link.trim()||void 0,targets:p.targets});if(de.success){U.success("Skill 创建成功"),u(!1),d({name:"",description:"",instruction:"",link:"",targets:[]}),await _();for(const ie of p.targets)(oe=de.installedSkill)!=null&&oe.id&&await V.enableSkill(de.installedSkill.id,ie)}else U.error(de.message||"创建失败")}catch(de){console.error("Failed to create skill:",de),U.error("创建失败,请稍后重试")}finally{m(!1)}},pe=()=>i?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在加载已安装 Skills..."})}):n.length===0?o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"当前没有检测到全局 Skills"}),o.jsx("span",{children:"你可以在“发现”中搜索并安装新的 Skills。"})]}):o.jsx("div",{className:"skills-grid",children:n.map(X=>o.jsxs("div",{className:"card skill-card",style:{display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[o.jsx("div",{className:"skill-title",style:{flex:1},children:X.name}),o.jsxs("div",{style:{display:"flex",gap:"8px",flexShrink:0},children:[X.githubUrl&&o.jsx("a",{href:X.githubUrl,target:"_blank",rel:"noopener noreferrer",className:"btn btn-secondary",style:{padding:"6px 12px",fontSize:"12px",textDecoration:"none",display:"inline-flex",alignItems:"center"},children:"查看详情"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>$(X),style:{padding:"6px 12px",fontSize:"12px"},children:"删除"})]})]}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{className:"skill-description",children:X.description||"暂无描述"}),o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(X.installedAt).toLocaleDateString("zh-CN")]})]}),o.jsxs("div",{style:{marginTop:"auto",paddingTop:"16px",borderTop:"1px solid var(--border-color)",display:"flex",gap:"24px"},children:[o.jsx(Ww,{skillId:X.id,targetType:"claude-code",enabled:X.enabledTargets.includes("claude-code"),onChange:R}),o.jsx(Ww,{skillId:X.id,targetType:"codex",enabled:X.enabledTargets.includes("codex"),onChange:R})]})]},X.id))}),ve=()=>o.jsxs("div",{className:"skills-discover",children:[o.jsxs("div",{className:"card skills-search-card",children:[o.jsxs("div",{className:"skills-search-header",children:[o.jsx("h3",{children:"描述你的需求,我会帮你找到你需要的 Skills"}),o.jsx("p",{children:"例如:帮我写 TypeScript 类型定义、自动生成测试用例、优化 React 性能"})]}),o.jsx("textarea",{rows:4,value:b,onChange:X=>j(X.target.value),placeholder:"请输入你的需求...",className:"skills-search-input"}),o.jsx("div",{className:"skills-search-actions",children:o.jsx("button",{className:"btn btn-primary",onClick:G,disabled:w,children:w?"搜索中...":"搜索"})})]}),o.jsxs("div",{className:"skills-results",children:[w&&o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在进行 AI 搜索..."})}),!w&&A&&S.length===0&&o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"没有找到匹配的 Skills"}),o.jsx("span",{children:"试试换个描述或添加更多细节。"})]}),!w&&S.length>0&&o.jsx("div",{className:"skills-grid",children:S.map(X=>o.jsxs("div",{className:"card skill-card",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[o.jsx("div",{className:"skill-title",style:{flex:1},children:X.name}),X.stars!==void 0&&X.stars>0&&o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",color:"#f39c12",fontSize:"14px",flexShrink:0},children:[o.jsx("span",{children:"⭐"}),o.jsx("span",{style:{fontWeight:"600"},children:X.stars})]})]}),X.tags&&X.tags.length>0&&o.jsx("div",{className:"skill-tags",children:X.tags.map(oe=>o.jsx("span",{className:"badge badge-secondary",children:oe},oe))}),o.jsx("div",{className:"skill-description",children:X.description||"暂无描述"}),o.jsxs("div",{className:"skills-result-actions",children:[X.url?o.jsx("a",{className:"btn btn-secondary",href:X.url,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:"8px"},children:"查看"}):null,o.jsx("button",{className:"btn btn-secondary",onClick:()=>K(X),children:"安装"})]})]},X.id))})]})]});return o.jsxs("div",{children:[o.jsxs("div",{className:"skills-header-row",children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"Skills 管理"}),o.jsx("p",{children:"管理 Claude Code 与 Codex 的全局技能,并发现新的生产力增强 Skills。"})]}),o.jsxs("div",{className:"skills-header-actions",children:[!e&&o.jsx("button",{className:"btn btn-secondary skills-discover-btn",onClick:()=>u(!0),style:{marginRight:"8px"},children:"新增"}),o.jsx("button",{className:"btn btn-secondary skills-discover-btn",onClick:()=>t(X=>!X),children:e?"返回":"发现"})]})]}),e?ve():pe(),T.skill&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:O,disabled:T.isInstalling,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"520px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:T.status==="idle"?"选择安装目标":T.status==="completed"?"安装完成":T.status==="error"?"安装失败":"正在安装"})}),o.jsx("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:T.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{style:{marginBottom:"12px",color:"var(--text-muted)"},children:["即将安装:",o.jsx("strong",{children:T.skill.name})]}),T.skill.description&&o.jsx("p",{style:{marginBottom:"12px",color:"var(--text-muted)",fontSize:"14px"},children:T.skill.description}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)",marginBottom:"12px"},children:"选择安装目标(可多选):"}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:T.selectedTargets.includes("claude-code"),onChange:X=>B("claude-code",X.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"Claude Code"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:T.selectedTargets.includes("codex"),onChange:X=>B("codex",X.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"Codex"})]})]})]})]}):o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsx("div",{style:{height:"8px",backgroundColor:"var(--bg-secondary)",borderRadius:"4px",overflow:"hidden",marginBottom:"16px"},children:o.jsx("div",{style:{width:`${T.progress}%`,height:"100%",backgroundColor:T.status==="error"?"var(--error-color)":"var(--primary-color)",transition:"width 0.3s ease"}})}),o.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",marginBottom:"8px"},children:T.message}),T.status==="error"&&o.jsx("p",{style:{textAlign:"center",color:"var(--error)",fontSize:"14px"},children:T.message})]})}),o.jsx("div",{className:"modal-footer",style:{justifyContent:T.status!=="idle"?"center":"space-between"},children:T.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"btn btn-secondary",onClick:O,disabled:T.isInstalling,children:"取消"}),o.jsx("button",{className:"btn btn-primary",onClick:W,disabled:T.isInstalling,children:"确定安装"})]}):T.status==="completed"||T.status==="error"?o.jsx("button",{className:"btn btn-primary",onClick:O,children:"关闭"}):o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("div",{className:"spinner",style:{width:"16px",height:"16px",border:"2px solid var(--bg-secondary)",borderTopColor:"var(--primary-color)",borderRadius:"50%"}}),o.jsx("span",{style:{color:"var(--text-muted)"},children:"正在处理..."})]})})]})})]}),s.skillId&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000001},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:P,disabled:s.isDeleting,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"400px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"确认删除"})}),o.jsxs("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:[o.jsxs("p",{style:{color:"var(--text-muted)"},children:["确定要删除 Skill ",o.jsx("strong",{children:s.skillName})," 吗?"]}),o.jsx("p",{style:{color:"var(--text-muted)",fontSize:"14px",marginTop:"8px"},children:"这将删除该Skill及其所有平台的软链接,且无法恢复。"})]}),o.jsxs("div",{className:"modal-footer",style:{justifyContent:"space-between"},children:[o.jsx("button",{className:"btn btn-secondary",onClick:P,disabled:s.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:F,disabled:s.isDeleting,children:s.isDeleting?"删除中...":"确认删除"})]})]})})]}),c&&o.jsx(FP,{isOpen:c,onClose:()=>u(!1),title:"新增 Skill",closeOnOverlayClick:!1,children:o.jsxs("form",{onSubmit:N,children:[o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[o.jsx("small",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"从其他来源复制的 SKILL.md 内容可直接粘贴解析"}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>y(!0),style:{padding:"6px 16px",fontSize:"13px"},children:"解析"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["名称 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsx("input",{type:"text",value:p.name,onChange:X=>d(oe=>({...oe,name:X.target.value})),placeholder:"输入 Skill 名称",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["描述 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsx("input",{type:"text",value:p.description,onChange:X=>d(oe=>({...oe,description:X.target.value})),placeholder:"简要描述这个 Skill 的功能",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["指令 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsx("small",{style:{display:"block",marginBottom:"8px",color:"#666",fontSize:"12px",lineHeight:"1.5"},children:"当这个 Skill 被触发时,你希望模型遵循哪些规则或信息"}),o.jsx("textarea",{value:p.instruction,onChange:X=>d(oe=>({...oe,instruction:X.target.value})),placeholder:`当这个 Skill 被触发时,你希望模型遵循哪些规则或信息,例如:
|
|
471
|
-
# codemap
|
|
472
|
-
## 命令
|
|
473
|
-
## 使用场景
|
|
474
|
-
## 输出解释
|
|
475
|
-
## 示例`,rows:10,style:{fontFamily:"monospace",fontSize:"13px"},required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"链接(可选)"}),o.jsx("input",{type:"url",value:p.link,onChange:X=>d(oe=>({...oe,link:X.target.value})),placeholder:"https://example.com 或 GitHub 仓库地址"}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"#666",fontSize:"12px"},children:"Skill 相关文档或资源链接"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["安装目标 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsxs("div",{style:{display:"flex",gap:"20px",marginTop:"8px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",whiteSpace:"nowrap"},children:[o.jsx("input",{type:"checkbox",checked:p.targets.includes("claude-code"),onChange:X=>{X.target.checked?d(oe=>({...oe,targets:[...oe.targets,"claude-code"]})):d(oe=>({...oe,targets:oe.targets.filter(de=>de!=="claude-code")}))}}),"Claude Code"]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:p.targets.includes("codex"),onChange:X=>{X.target.checked?d(oe=>({...oe,targets:[...oe.targets,"codex"]})):d(oe=>({...oe,targets:oe.targets.filter(de=>de!=="codex")}))}}),"Codex"]})]})]}),o.jsx("div",{style:{marginTop:"16px",padding:"12px",background:"var(--bg-tertiary)",borderRadius:"8px"},children:o.jsxs("small",{style:{color:"var(--text-muted)",fontSize:"12px",lineHeight:"1.6"},children:["💡 提示:Skill 创建后,可通过 ",o.jsxs("code",{style:{background:"var(--bg-secondary)",padding:"2px 6px",borderRadius:"4px"},children:["~/.aicodeswitch/skills/",p.name||"skill-name"]})," 路径对 Skill 内容进行二次编辑"]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>u(!1),disabled:h,children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",disabled:h,children:h?"创建中...":"确认创建"})]})]})}),g&&o.jsxs(FP,{isOpen:g,onClose:()=>{y(!1),v("")},title:"解析 SKILL.md",closeOnOverlayClick:!1,children:[o.jsxs("div",{style:{padding:"20px"},children:[o.jsx("p",{style:{color:"var(--text-muted)",fontSize:"14px",marginBottom:"12px"},children:"直接粘贴从其他地方复制的 SKILL.md 内容,系统将自动解析填充到表单中。"}),o.jsx("textarea",{value:x,onChange:X=>v(X.target.value),placeholder:`---
|
|
476
|
-
name: skill-name
|
|
477
|
-
description: Skill 描述
|
|
478
|
-
---
|
|
479
|
-
|
|
480
|
-
# Skill 名称
|
|
481
|
-
|
|
482
|
-
Skill 描述
|
|
483
|
-
|
|
484
|
-
## 指令
|
|
485
|
-
|
|
486
|
-
技能指令内容...`,rows:15,style:{width:"100%",fontFamily:"monospace",fontSize:"13px",padding:"12px",border:"1px solid var(--border-color)",borderRadius:"8px",background:"var(--bg-primary)",color:"var(--text-primary)",resize:"vertical"}})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{y(!1),v("")},children:"取消"}),o.jsx("button",{type:"button",className:"btn btn-primary",onClick:re,children:"解析并填充"})]})]})]})}const iae=[{id:"glm-vision",name:"GLM 视觉理解",description:"提供图像理解能力,支持多种视觉场景分析",type:"stdio",command:"npx",args:["-y","@z_ai/mcp-server"],env:{Z_AI_MODE:"ZHIPU"},apiKeyIn:"headers"},{id:"glm-web-search",name:"GLM 联网搜索",description:"提供网络搜索能力,实时获取最新信息",type:"http",url:"https://open.bigmodel.cn/api/mcp/web_search_prime/mcp",apiKeyIn:"headers"},{id:"glm-web-reader",name:"GLM 网页读取",description:"提供网页内容读取和解析能力",type:"http",url:"https://open.bigmodel.cn/api/mcp/web_reader/mcp",apiKeyIn:"headers"},{id:"glm-zread",name:"GLM 开源仓库",description:"提供开源仓库代码搜索和阅读能力",type:"http",url:"https://open.bigmodel.cn/api/mcp/zread/mcp",apiKeyIn:"headers"},{id:"minimax-coding-plan",name:"MiniMax Coding Plan",description:"提供网络搜索和图片理解能力",type:"stdio",command:"uvx",args:["-y","minimax-coding-plan-mcp"],env:{MINIMAX_API_HOST:"https://api.minimaxi.com"},apiKeyIn:"env",apiKeyEnvName:"MINIMAX_API_KEY"}];function aae(){var G,K;const[e,t]=f.useState([]),[n,r]=f.useState(!0),[i,a]=f.useState(!1),[s,l]=f.useState(null),[c,u]=f.useState({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),[p,d]=f.useState(!1),[h,m]=f.useState({mcpId:null,mcpName:"",isDeleting:!1}),[g,y]=f.useState({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null}),x=async()=>{try{r(!0);const O=await V.getMCPs();t(O)}catch(O){console.error("Failed to load MCPs:",O),U.error("加载 MCP 工具失败")}finally{r(!1)}};f.useEffect(()=>{x()},[]);const v=()=>{l(null),u({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),a(!0)},b=O=>{l(O),u({name:O.name,description:O.description||"",type:O.type,command:O.command||"",args:O.args?O.args.join(" "):"",url:O.url||"",headers:O.headers?JSON.stringify(O.headers,null,2):"",env:O.env?JSON.stringify(O.env,null,2):"",targets:O.targets||[]}),a(!0)},j=()=>{p||(a(!1),l(null))},w=async O=>{var B,W;if(O.preventDefault(),!c.name.trim()){U.error("请填写 MCP 名称");return}if(c.type==="stdio"&&!c.command){U.error("请填写命令");return}if((c.type==="http"||c.type==="sse")&&!c.url){U.error("请填写 URL");return}try{d(!0);const R={},$={};if(c.env)try{Object.assign(R,JSON.parse(c.env))}catch{U.error("环境变量格式错误,请使用有效的 JSON 格式");return}if(c.headers)try{Object.assign($,JSON.parse(c.headers))}catch{U.error("请求头格式错误,请使用有效的 JSON 格式");return}const P={name:c.name.trim(),description:c.description.trim(),type:c.type,command:(B=c.command)==null?void 0:B.trim(),args:c.args?c.args.trim().split(/\s+/):void 0,url:(W=c.url)==null?void 0:W.trim(),headers:Object.keys($).length>0?$:void 0,env:Object.keys(R).length>0?R:void 0,targets:c.targets};s?(await V.updateMCP(s.id,P),U.success("MCP 工具已更新")):(await V.createMCP(P),U.success("MCP 工具已添加")),a(!1),l(null),await x()}catch(R){console.error("Failed to save MCP:",R),U.error("保存失败,请稍后重试")}finally{d(!1)}},k=O=>{m({mcpId:O.id,mcpName:O.name,isDeleting:!1})},S=()=>{h.isDeleting||m({mcpId:null,mcpName:"",isDeleting:!1})},E=async()=>{if(h.mcpId)try{m(O=>({...O,isDeleting:!0})),await V.deleteMCP(h.mcpId),U.success("已删除 MCP 工具"),await x(),S()}catch(O){console.error("Failed to delete MCP:",O),U.error("删除失败,请稍后重试"),m(B=>({...B,isDeleting:!1}))}},A=()=>{y({isOpen:!0,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},D=()=>{g.installingMCPName||y({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},T=O=>{y(B=>({...B,step:"input-api-key",selectedDefinition:O}))},I=async()=>{var O;if(!g.apiKey.trim()){U.error("请填写 API Key");return}if(g.selectedDefinition)try{const B=g.selectedDefinition;y(pe=>({...pe,step:"installing",message:"正在安装...",installingMCPName:B.name}));const W=B.apiKeyEnvName||"Z_AI_API_KEY",R=B.apiKeyIn==="env",$=[];B.env&&Object.entries(B.env).forEach(([pe,ve])=>{ve!==void 0&&$.push([pe,ve])}),R&&$.push([W,g.apiKey.trim()]);const P=$.length>0?Object.fromEntries($):void 0,re=B.apiKeyIn==="headers"?{Authorization:`Bearer ${g.apiKey.trim()}`}:void 0,N={name:B.name,description:B.description,type:B.type,command:B.command,args:B.args,url:B.url,env:P,headers:re,targets:["claude-code","codex"]};await V.createMCP(N),y(pe=>({...pe,step:"completed",message:`成功安装 ${B.name}`,installingMCPName:null})),U.success(`已安装 ${B.name}`),await x()}catch(B){console.error(`Failed to install ${(O=g.selectedDefinition)==null?void 0:O.id}:`,B),y(W=>({...W,step:"error",message:"安装失败,请稍后重试",installingMCPName:null})),U.error("安装失败,请稍后重试")}},_=O=>{switch(O){case"stdio":return"命令行";case"http":return"HTTP";case"sse":return"SSE";default:return O}};return o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsx("h1",{children:"MCP 管理"}),o.jsx("p",{children:"管理 Model Context Protocol (MCP) 工具,扩展 Claude Code 和 Codex 的能力"})]}),o.jsxs("div",{style:{display:"flex",gap:"12px"},children:[o.jsxs("button",{className:"btn btn-secondary",onClick:A,style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{children:"⚡"}),o.jsx("span",{children:"一键安装 MCP"})]}),o.jsx("button",{className:"btn btn-primary",onClick:v,children:"添加 MCP 工具"})]})]}),n?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在加载 MCP 工具..."})}):e.length===0?o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"当前没有安装 MCP 工具"}),o.jsx("span",{children:'你可以点击"添加 MCP 工具"或"一键安装 MCP"来添加工具。'})]}):o.jsx("div",{className:"mcp-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(400px, 1fr))",gap:"16px",marginTop:"24px"},children:e.map(O=>{var B,W,R;return o.jsxs("div",{className:"card mcp-card",style:{display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flex:1,minWidth:0},children:[o.jsx("div",{className:"mcp-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O.name}),o.jsx("div",{className:"badge badge-secondary",children:_(O.type)})]}),o.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>b(O),style:{padding:"6px 14px",fontSize:"13px"},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>k(O),style:{padding:"6px 14px",fontSize:"13px"},children:"删除"})]})]}),O.description&&o.jsx("div",{className:"mcp-description",style:{marginTop:"12px",color:"var(--text-muted)",fontSize:"14px"},children:O.description}),o.jsxs("div",{style:{marginTop:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(O.createdAt).toLocaleDateString("zh-CN")]}),O.type==="stdio"&&O.command&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",fontFamily:"monospace",color:"var(--text-muted)"},children:["命令: ",O.command," ",(B=O.args)==null?void 0:B.join(" ")]}),(O.type==="http"||O.type==="sse")&&O.url&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["URL: ",O.url]}),o.jsx("div",{style:{marginTop:"auto",paddingTop:"16px",borderTop:"1px solid var(--border-color)",display:"flex",alignItems:"center"},children:o.jsxs("div",{style:{display:"flex",gap:"24px"},children:[o.jsx(il,{checked:((W=O.targets)==null?void 0:W.includes("claude-code"))??!1,onChange:async $=>{const P=O.targets||[],F=$?[...P,"claude-code"]:P.filter(re=>re!=="claude-code");await V.updateMCP(O.id,{targets:F}),await x()},label:"Claude Code",labelPosition:"right"}),o.jsx(il,{checked:((R=O.targets)==null?void 0:R.includes("codex"))??!1,onChange:async $=>{const P=O.targets||[],F=$?[...P,"codex"]:P.filter(re=>re!=="codex");await V.updateMCP(O.id,{targets:F}),await x()},label:"Codex",labelPosition:"right"})]})})]},O.id)})}),i&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:j,disabled:p,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"600px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:s?"编辑 MCP 工具":"添加 MCP 工具"})}),o.jsxs("form",{onSubmit:w,children:[o.jsxs("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:[o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-name",children:["MCP 名称 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"mcp-name",type:"text",value:c.name,onChange:O=>u({...c,name:O.target.value}),placeholder:"例如:GLM 视觉理解",disabled:p})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-description",children:"描述"}),o.jsx("textarea",{id:"mcp-description",rows:2,value:c.description,onChange:O=>u({...c,description:O.target.value}),placeholder:"描述该 MCP 工具的功能",disabled:p})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-type",children:["类型 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsxs("select",{id:"mcp-type",value:c.type,onChange:O=>u({...c,type:O.target.value}),disabled:p,children:[o.jsx("option",{value:"stdio",children:"命令行 (stdio)"}),o.jsx("option",{value:"http",children:"HTTP"}),o.jsx("option",{value:"sse",children:"SSE"})]})]}),c.type==="stdio"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-command",children:["命令 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"mcp-command",type:"text",value:c.command,onChange:O=>u({...c,command:O.target.value}),placeholder:"例如:npx",disabled:p})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-args",children:"参数(空格分隔)"}),o.jsx("input",{id:"mcp-args",type:"text",value:c.args,onChange:O=>u({...c,args:O.target.value}),placeholder:"例如:-y @z_ai/mcp-server",disabled:p})]})]}),(c.type==="http"||c.type==="sse")&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-url",children:["URL ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"mcp-url",type:"url",value:c.url,onChange:O=>u({...c,url:O.target.value}),placeholder:"例如:https://api.example.com/mcp",disabled:p})]}),(c.type==="http"||c.type==="sse")&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-headers",children:"请求头 (JSON)"}),o.jsx("textarea",{id:"mcp-headers",rows:3,value:c.headers,onChange:O=>u({...c,headers:O.target.value}),placeholder:'{\\n "Authorization": "Bearer your-token"\\n}',disabled:p,style:{fontFamily:"monospace",fontSize:"13px"}})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-env",children:"环境变量 (JSON)"}),o.jsx("textarea",{id:"mcp-env",rows:3,value:c.env,onChange:O=>u({...c,env:O.target.value}),placeholder:'{\\n "API_KEY": "your-key"\\n}',disabled:p,style:{fontFamily:"monospace",fontSize:"13px"}})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用目标"}),o.jsxs("div",{style:{display:"flex",gap:"16px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:c.targets.includes("claude-code"),onChange:O=>u({...c,targets:O.target.checked?[...c.targets,"claude-code"]:c.targets.filter(B=>B!=="claude-code")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:p}),o.jsx("span",{children:"Claude Code"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:c.targets.includes("codex"),onChange:O=>u({...c,targets:O.target.checked?[...c.targets,"codex"]:c.targets.filter(B=>B!=="codex")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:p}),o.jsx("span",{children:"Codex"})]})]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",type:"button",onClick:j,disabled:p,children:"取消"}),o.jsx("button",{className:"btn btn-primary",type:"submit",disabled:p,children:p?"保存中...":s?"保存":"添加"})]})]})]})})]}),h.mcpId&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000001},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:S,disabled:h.isDeleting,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"400px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"确认删除"})}),o.jsx("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:o.jsxs("p",{style:{color:"var(--text-muted)"},children:['确定要删除 MCP 工具 "',o.jsx("strong",{children:h.mcpName}),'" 吗?此操作无法撤销。']})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:S,disabled:h.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:E,disabled:h.isDeleting,children:h.isDeleting?"删除中...":"删除"})]})]})})]}),g.isOpen&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000002},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:D,disabled:g.installingMCPName!==null,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"700px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"一键安装 MCP 工具"})}),o.jsxs("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:[g.step==="select"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)",marginBottom:"20px"},children:"点击下方的卡片,快速安装 MCP 工具到您的系统中:"}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:"16px"},children:iae.map(O=>{const B=e.some(W=>W.name===O.name);return o.jsxs("div",{className:"card",style:{padding:"16px",cursor:B?"not-allowed":"pointer",transition:"all 0.2s ease",opacity:B?.7:1},onClick:()=>!B&&T(O),children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},children:[o.jsx("div",{style:{fontWeight:"600",fontSize:"16px"},children:O.name}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[B&&o.jsx("div",{className:"badge badge-success",style:{fontSize:"12px"},children:"已安装"}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"12px"},children:_(O.type)})]})]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-muted)",marginBottom:"12px"},children:O.description}),o.jsx("button",{className:"btn btn-primary",style:{width:"100%"},disabled:B,children:B?"已安装":"安装"})]},O.id)})})]}),g.step==="input-api-key"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{textAlign:"center",marginBottom:"16px"},children:[o.jsx("h3",{style:{fontSize:"18px",marginBottom:"8px"},children:(G=g.selectedDefinition)==null?void 0:G.name}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)"},children:(K=g.selectedDefinition)==null?void 0:K.description})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"quick-install-api-key",children:["API Key ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"quick-install-api-key",type:"password",value:g.apiKey,onChange:O=>y({...g,apiKey:O.target.value}),placeholder:"请输入您的 API Key",disabled:g.installingMCPName!==null,autoFocus:!0}),o.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px"},children:"API Key 将用于此 MCP 工具的认证。您可以访问相应的开放平台获取。"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>y(O=>({...O,step:"select",selectedDefinition:null})),disabled:g.installingMCPName!==null,children:"返回"}),o.jsx("button",{className:"btn btn-primary",onClick:I,disabled:g.installingMCPName!==null||!g.apiKey.trim(),children:g.installingMCPName?"安装中...":"开始安装"})]})]}),g.step==="installing"&&o.jsxs("div",{style:{padding:"20px 0",textAlign:"center"},children:[o.jsx("div",{className:"spinner",style:{width:"32px",height:"32px",margin:"0 auto 16px"}}),o.jsx("p",{style:{color:"var(--text-muted)"},children:g.message}),o.jsxs("p",{style:{fontSize:"14px",marginTop:"8px",color:"var(--text-muted)"},children:["正在安装 ",o.jsx("strong",{children:g.installingMCPName}),"..."]})]}),g.step==="completed"&&o.jsxs("div",{style:{padding:"20px 0",textAlign:"center"},children:[o.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"✅"}),o.jsx("p",{style:{fontSize:"16px",marginBottom:"8px"},children:g.message}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)"},children:"MCP 工具已启用到 Claude Code 和 Codex,您可以在列表中查看详情。"})]}),g.step==="error"&&o.jsxs("div",{style:{padding:"20px 0",textAlign:"center"},children:[o.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"❌"}),o.jsx("p",{style:{fontSize:"16px",marginBottom:"8px"},children:g.message})]})]}),o.jsx("div",{className:"modal-footer",style:{justifyContent:(g.step==="select"||g.step==="input-api-key","center")},children:(g.step==="completed"||g.step==="error")&&o.jsx("button",{className:"btn btn-primary",onClick:D,children:"关闭"})})]})})]})]})}function WM({keyName:e,apiKey:t,guide:n,onClose:r}){const i=a=>{navigator.clipboard.writeText(a).then(()=>U.success("已复制"))};return o.jsxs("div",{className:"modal-overlay",onClick:r,children:[o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"700px",padding:"28px"},onClick:a=>a.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:r,style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 4px",fontSize:"20px"},children:"📋 接入指引"}),o.jsxs("p",{style:{margin:"0 0 22px",color:"var(--text-tertiary)",fontSize:"13px"},children:["密钥「",e,"」的接入配置"]}),n?(()=>{const a=Object.values(n).flatMap(l=>Object.keys(l.envVars||{})),s=Math.max(...a.map(l=>l.length),0);return o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginBottom:"20px"},children:Object.entries(n).map(([l,c])=>{const u=Object.entries(c.envVars);return o.jsxs("div",{className:"ak-guide-section",children:[o.jsx("div",{className:"ak-guide-section-header",children:c.description}),o.jsx("div",{style:{padding:"14px 16px"},children:u.map(([p,d])=>o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0",marginBottom:"8px",fontSize:"13px"},children:[o.jsx("span",{className:"ak-guide-env-name",style:{minWidth:`${s*8.5}px`},children:p}),o.jsx("span",{style:{color:"var(--text-secondary)",margin:"0 8px"},children:"="}),o.jsx("code",{className:"ak-guide-env-value",children:d}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>i(d),style:{flexShrink:0,padding:"4px 8px",marginLeft:"8px"},children:"复制"})]},p))})]},l)})})})():o.jsxs("div",{style:{marginBottom:"20px",textAlign:"center",padding:"30px 0"},children:[o.jsx("div",{style:{fontSize:"36px",marginBottom:"8px"},children:"🔑"}),o.jsx("div",{style:{fontWeight:600,fontSize:"15px",marginBottom:"12px"},children:"API Key"}),o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:o.jsx("code",{style:{padding:"12px 16px",borderRadius:"8px",background:"var(--bg-primary-solid)",fontSize:"14px",fontFamily:'"SF Mono", "Fira Code", monospace',border:"2px dashed var(--color-primary)"},children:t})}),o.jsx("span",{style:{fontSize:"11px",color:"var(--text-tertiary)",display:"block",marginTop:"8px"},children:"完整 Key 仅在创建时展示,此处仅显示掩码"})]}),o.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:o.jsx("button",{onClick:r,className:"ak-modal-btn-secondary",children:"关闭"})})]}),o.jsx("style",{children:`
|
|
487
|
-
.ak-guide-section {
|
|
488
|
-
border-radius: 10px;
|
|
489
|
-
border: 1px solid var(--border-primary);
|
|
490
|
-
overflow: hidden;
|
|
491
|
-
background: var(--bg-primary-solid);
|
|
492
|
-
}
|
|
493
|
-
.ak-guide-section-header {
|
|
494
|
-
padding: 10px 16px;
|
|
495
|
-
border-bottom: 1px solid var(--border-primary);
|
|
496
|
-
background: var(--bg-secondary);
|
|
497
|
-
fontWeight: 600;
|
|
498
|
-
font-size: 14px;
|
|
499
|
-
}
|
|
500
|
-
.ak-guide-env-name {
|
|
501
|
-
color: var(--color-accent, #8b5cf6);
|
|
502
|
-
fontWeight: 600;
|
|
503
|
-
fontFamily: "SF Mono", "Fira Code", monospace;
|
|
504
|
-
flexShrink: 0;
|
|
505
|
-
}
|
|
506
|
-
.ak-guide-env-value {
|
|
507
|
-
flex: 1;
|
|
508
|
-
padding: 6px 10px;
|
|
509
|
-
border-radius: 5px;
|
|
510
|
-
background: var(--bg-secondary);
|
|
511
|
-
wordBreak: break-all;
|
|
512
|
-
fontSize: 12px;
|
|
513
|
-
fontFamily: "SF Mono", "Fira Code", monospace;
|
|
514
|
-
}
|
|
515
|
-
[data-theme="dark"] .ak-guide-section {
|
|
516
|
-
background: #0C1F12;
|
|
517
|
-
border-color: rgba(167, 243, 208, 0.15);
|
|
518
|
-
}
|
|
519
|
-
[data-theme="dark"] .ak-guide-section-header {
|
|
520
|
-
background: rgba(30, 58, 40, 0.95);
|
|
521
|
-
border-color: rgba(167, 243, 208, 0.15);
|
|
522
|
-
}
|
|
523
|
-
[data-theme="dark"] .ak-guide-env-value {
|
|
524
|
-
background: rgba(30, 58, 40, 0.95);
|
|
525
|
-
}
|
|
526
|
-
`})]})}function oae(){const[e,t]=f.useState([]),[n,r]=f.useState([]),[i,a]=f.useState([]),[s,l]=f.useState([]),[c,u]=f.useState([]),[p,d]=f.useState(0),[h,m]=f.useState(1),g=20,[y,x]=f.useState(!0),[v,b]=f.useState(""),[j,w]=f.useState(""),[k,S]=f.useState(new Set),[E,A]=f.useState(!1),[D,T]=f.useState(null),[I,_]=f.useState(""),[G,K]=f.useState(""),[O,B]=f.useState(""),[W,R]=f.useState(!1),[$,P]=f.useState(()=>localStorage.getItem("policies-panel-open")==="true"),[F,re]=f.useState(null),[N,pe]=f.useState(!1),[ve,X]=f.useState(""),[oe,de]=f.useState(""),[ie,J]=f.useState("system"),[xe,ae]=f.useState(""),[Me,se]=f.useState(""),[Le,$e]=f.useState(""),[Ye,lt]=f.useState(""),[Ve,rt]=f.useState(""),[ke,De]=f.useState([]),[Fe,Ze]=f.useState([]),[Z,Y]=f.useState("none"),[ce,M]=f.useState(""),[fe,ge]=f.useState([]),[Te,Ee]=f.useState(!1),Q=f.useRef(null),{confirm:ue}=yu(),Se=f.useRef(null);f.useEffect(()=>{if(!W)return;const z=L=>{Se.current&&!Se.current.contains(L.target)&&R(!1)};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[W]);const je=async()=>{x(!0);try{const z=await V.getAccessKeys({page:h,pageSize:g,status:v||void 0,search:j||void 0});t(z.data),d(z.total)}catch(z){U.error("加载密钥列表失败: "+z.message)}finally{x(!1)}},ze=async()=>{try{const[z,L,Pe]=await Promise.all([V.getPolicies().catch(()=>[]),V.getRoutes().catch(()=>[]),V.getPolicyTemplates().catch(()=>[])]);r(z),a(L),l(Pe)}catch{}};f.useEffect(()=>{je()},[h,v,j]),f.useEffect(()=>{ze()},[]),f.useEffect(()=>{V.getWriteLocalRecords().then(u).catch(()=>{})},[e]);const We=async()=>{if(!I.trim()){U.error("请输入密钥名称");return}try{const z=await V.createAccessKey({name:I.trim(),remark:G||void 0,policyId:O||void 0});A(!1),T(z),_(""),K(""),B(""),je()}catch(z){U.error("创建失败: "+z.message)}},Ge=async z=>{try{await V.updateAccessKey(z.id,{status:z.status==="active"?"disabled":"active"}),U.success(z.status==="active"?"已停用":"已启用"),je()}catch(L){U.error("操作失败: "+L.message)}},H=async z=>{if(await ue({message:`确定删除密钥「${z.name}」吗?`}))try{await V.deleteAccessKey(z.id),U.success("已删除"),je()}catch(Pe){U.error("删除失败: "+Pe.message)}},he=async z=>{if(await ue({message:"重新生成后旧密钥将立即失效,确定继续吗?"}))try{const Pe=await V.regenerateAccessKey(z.id);T({key:{...z,apiKey:Pe.apiKey},apiKey:Pe.apiKey}),je()}catch(Pe){U.error("重新生成失败: "+Pe.message)}},[we,Ae]=f.useState(null),Re=async z=>{try{const L=await V.getAccessKeyGuide(z.id);Ae({key:z,guide:L})}catch(L){U.error("获取指引失败: "+L.message)}},qe=async z=>{if(k.size!==0)try{await V.batchUpdateAccessKeyStatus(Array.from(k),z),U.success(`已批量${z==="active"?"启用":"停用"} ${k.size} 个密钥`),S(new Set),R(!1),je()}catch(L){U.error("批量操作失败: "+L.message)}},Xe=async()=>{if(!(k.size===0||!await ue({message:`确定删除选中的 ${k.size} 个密钥吗?`})))try{await V.batchDeleteAccessKeys(Array.from(k)),U.success(`已删除 ${k.size} 个密钥`),S(new Set),R(!1),je()}catch(L){U.error("批量删除失败: "+L.message)}},et=async z=>{if(!(k.size===0||!z))try{await V.batchBindAccessKeyPolicy(Array.from(k),z),U.success("已批量绑定策略"),S(new Set),R(!1),je()}catch(L){U.error("批量绑定失败: "+L.message)}},ct=z=>{const L=new Set(k);L.has(z)?L.delete(z):L.add(z),S(L)},Wr=()=>S(k.size===e.length?new Set:new Set(e.map(z=>z.id))),kn=z=>navigator.clipboard.writeText(z).then(()=>U.success("已复制")),mt=()=>{X(""),de(""),J(""),ae(""),se(""),$e(""),lt(""),rt(""),De([]),Ze([]),Y("none"),M("")},In=z=>{var L,Pe,tt,Be,jt,Zt,Kr;z?(re(z),X(z.name),de(z.description||""),J(z.routeId||"system"),ae(((L=z.dailyTokenLimit)==null?void 0:L.toString())||""),se(((Pe=z.monthlyTokenLimit)==null?void 0:Pe.toString())||""),$e(((tt=z.dailyRequestLimit)==null?void 0:tt.toString())||""),lt(((Be=z.rpmLimit)==null?void 0:Be.toString())||""),rt(((jt=z.concurrentLimit)==null?void 0:jt.toString())||""),De(z.allowedModels||[]),Ze(z.blockedModels||[]),Y((Zt=z.allowedModels)!=null&&Zt.length?"allow":(Kr=z.blockedModels)!=null&&Kr.length?"block":"none")):(re(null),mt()),pe(!0),Cn()},Cn=async()=>{try{const z=await V.getVendors(),L=new Map;(z||[]).forEach(Pe=>{const tt=Pe.name||"";(Pe.services||[]).forEach(Be=>{(Be.supportedModels||[]).forEach(jt=>{L.has(jt)||L.set(jt,new Set),L.get(jt).add(tt)})})}),ge(Array.from(L.entries()).map(([Pe,tt])=>({name:Pe,vendors:Array.from(tt)})).sort((Pe,tt)=>Pe.name.localeCompare(tt.name)))}catch{}},Bt=Z==="allow"?ke:Fe,St=ce.trim()?fe.filter(z=>z.name.toLowerCase().includes(ce.toLowerCase())&&!Bt.includes(z.name)):fe.filter(z=>!Bt.includes(z.name)),ci=z=>{var Pe,tt,Be,jt,Zt;const L=z.config;X(L.name||""),de(z.description),ae(((Pe=L.dailyTokenLimit)==null?void 0:Pe.toString())||""),se(((tt=L.monthlyTokenLimit)==null?void 0:tt.toString())||""),$e(((Be=L.dailyRequestLimit)==null?void 0:Be.toString())||""),lt(((jt=L.rpmLimit)==null?void 0:jt.toString())||""),rt(((Zt=L.concurrentLimit)==null?void 0:Zt.toString())||""),U.success(`已应用模板: ${z.name}`)},Di=async()=>{if(!ve.trim()){U.error("请输入策略名称");return}const z={name:ve.trim(),description:oe||void 0,routeId:ie==="system"?"system":ie||void 0,dailyTokenLimit:xe?Number(xe):void 0,monthlyTokenLimit:Me?Number(Me):void 0,dailyRequestLimit:Le?Number(Le):void 0,rpmLimit:Ye?Number(Ye):void 0,concurrentLimit:Ve?Number(Ve):void 0,allowedModels:Z==="allow"?ke:void 0,blockedModels:Z==="block"?Fe:void 0};try{F?(await V.updatePolicy(F.id,z),U.success("策略已更新")):(await V.createPolicy(z),U.success("策略已创建")),pe(!1),ze(),je()}catch(L){U.error("保存失败: "+L.message)}},fa=async z=>{if(z.keyCount&&z.keyCount>0){U.error(`有 ${z.keyCount} 个密钥正在使用此策略,请先解除绑定`);return}if(await ue({message:`确定删除策略「${z.name}」吗?`}))try{await V.deletePolicy(z.id),U.success("已删除"),ze(),je()}catch(Pe){U.error("删除失败: "+Pe.message)}},le=async z=>{try{await V.duplicatePolicy(z.id),U.success("已复制"),ze()}catch(L){U.error("复制失败: "+L.message)}},Ot=(z,L)=>{const Pe=ce.trim();Pe&&!z.includes(Pe)&&(L([...z,Pe]),M(""))},gn=z=>{var L;return(L=i.find(Pe=>Pe.id===z))==null?void 0:L.name},dr=z=>{const L=[];return z.dailyTokenLimit&&L.push(`日${z.dailyTokenLimit}k`),z.monthlyTokenLimit&&L.push(`月${z.monthlyTokenLimit}k`),z.dailyRequestLimit&&L.push(`日${z.dailyRequestLimit}次`),z.rpmLimit&&L.push(`RPM ${z.rpmLimit}`),z.concurrentLimit&&L.push(`并发${z.concurrentLimit}`),L.length>0?L.join(", "):"无限制"},ha=Math.ceil(p/g),Jt={padding:"6px 10px",borderRadius:"4px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",boxSizing:"border-box",fontSize:"13px"};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"},children:[o.jsx("h2",{style:{margin:0},children:"API Key"}),o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>{A(!0),ze()},style:{height:"45px"},children:"+ 创建密钥"}),o.jsxs("button",{className:`btn ${$?"btn-primary":"btn-secondary"}`,onClick:()=>{const z=!$;P(z),localStorage.setItem("policies-panel-open",String(z)),z&&ze()},style:{height:"45px",display:"inline-flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{children:"📜 策略管理"}),n.length>0&&o.jsxs("span",{children:["(",n.length,")"]}),o.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"50%",border:"2px solid #fff",background:$?"var(--color-success, #22c55e)":"transparent",flexShrink:0,transition:"all 0.25s"},children:$&&o.jsx("span",{style:{color:"#fff",fontSize:"12px",lineHeight:1},children:"✓"})})]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"0",minHeight:0},children:[o.jsx("div",{style:{flex:1,minWidth:0,transition:"margin-right 0.35s ease",marginRight:$?"24px":"0"},children:o.jsxs("div",{className:"card",style:{marginBottom:"0"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsxs("select",{value:v,onChange:z=>{b(z.target.value),m(1)},style:Jt,children:[o.jsx("option",{value:"",children:"全部状态"}),o.jsx("option",{value:"active",children:"启用"}),o.jsx("option",{value:"disabled",children:"停用"})]}),o.jsx("input",{type:"text",placeholder:"搜索名称或备注...",value:j,onChange:z=>{w(z.target.value),m(1)},style:{...Jt,minWidth:"200px"}})]}),k.size>0&&o.jsxs("div",{ref:Se,style:{position:"relative",flexShrink:0},children:[o.jsxs("button",{className:"ak-action-btn",onClick:()=>R(!W),children:["批量操作 (",k.size,") ▾"]}),W&&o.jsxs("div",{className:"ak-dropdown-menu",children:[o.jsx("button",{className:"dropdown-btn",onClick:()=>qe("active"),children:"批量启用"}),o.jsx("button",{className:"dropdown-btn",onClick:()=>qe("disabled"),children:"批量停用"}),o.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid var(--border-primary)"}}),o.jsxs("select",{style:{width:"100%",border:"none",background:"none",padding:"6px 10px",cursor:"pointer",color:"var(--text-primary)"},onChange:z=>{z.target.value&&et(z.target.value)},children:[o.jsx("option",{value:"",children:"批量绑定策略..."}),n.map(z=>o.jsx("option",{value:z.id,children:z.name},z.id))]}),o.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid var(--border-primary)"}}),o.jsx("button",{className:"dropdown-btn",style:{color:"var(--color-danger)"},onClick:Xe,children:"批量删除"})]})]})]}),y?o.jsx("div",{style:{textAlign:"center",padding:"40px"},children:"加载中..."}):o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"10px 12px",textAlign:"left",width:32},children:o.jsx("input",{type:"checkbox",checked:k.size===e.length&&e.length>0,onChange:Wr})}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left"},children:"名称"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left"},children:"API Key"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left"},children:"策略"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"center",width:60},children:"状态"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left",minWidth:90},children:"创建时间"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left",minWidth:90},children:"最后活跃"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"center",width:120},children:"操作"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:8,style:{padding:"40px",textAlign:"center",color:"var(--text-tertiary)"},children:p===0?"暂无密钥,点击「创建密钥」开始":"无匹配结果"})}):e.map(z=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("td",{style:{padding:"10px 12px"},children:o.jsx("input",{type:"checkbox",checked:k.has(z.id),onChange:()=>ct(z.id)})}),o.jsxs("td",{style:{padding:"10px 12px"},children:[o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[o.jsx("a",{href:`#/access-keys/${z.id}`,style:{color:"var(--color-primary)",textDecoration:"none",fontWeight:500},children:z.name}),(()=>{const L=c.find(Pe=>Pe.accessKeyId===z.id);return L?L.targets.map(Pe=>o.jsx("span",{style:{display:"inline-block",padding:"1px 6px",borderRadius:"8px",fontSize:"11px",lineHeight:"16px",background:Pe==="claude-code"?"#cc7832":"#000",color:"#fff"},children:Pe==="claude-code"?"Claude Code":"Codex"},Pe)):null})()]}),z.remark&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:z.remark})]}),o.jsx("td",{style:{padding:"10px 12px"},children:o.jsx("code",{style:{fontSize:"12px",background:"var(--bg-secondary)",padding:"2px 6px",borderRadius:"3px"},children:z.apiKey})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px"},children:z.policyName||o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"未配置"})}),o.jsx("td",{style:{padding:"10px 12px",textAlign:"center"},children:o.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:z.status==="active"?"#22c55e":"var(--text-tertiary)"},title:z.status==="active"?"启用":"停用"})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:new Date(z.createdAt).toLocaleDateString()}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:z.lastActiveAt?new Date(z.lastActiveAt).toLocaleDateString():"-"}),o.jsx("td",{style:{padding:"10px 12px",textAlign:"center"},children:o.jsxs("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:[o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>Re(z),title:"接入指引",children:"📋"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>Ge(z),title:z.status==="active"?"停用":"启用",children:z.status==="active"?"⏸":"▶"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>he(z),title:"重新生成",children:"🔄"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>H(z),title:"删除",children:"✕"})]})})]},z.id))})]})}),ha>1&&o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"8px",marginTop:"16px"},children:[o.jsx("button",{className:"btn btn-sm",disabled:h<=1,onClick:()=>m(h-1),children:"‹"}),o.jsxs("span",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:[h,"/",ha," · 共 ",p," 个"]}),o.jsx("button",{className:"btn btn-sm",disabled:h>=ha,onClick:()=>m(h+1),children:"›"})]})]})}),o.jsx("div",{style:{width:$?"480px":"0",overflow:"hidden",transition:"width 0.35s ease, opacity 0.35s ease",opacity:$?1:0,flexShrink:0},children:o.jsx("div",{style:{width:"480px",height:"100%"},children:o.jsxs("div",{className:"card",style:{height:"100%",marginBottom:"0",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:"16px",marginBottom:"16px",borderBottom:"1px solid var(--border-primary)",flexShrink:0},children:[o.jsx("h4",{style:{margin:0,fontSize:"16px"},children:"📜 策略管理"}),o.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>In(),children:"+ 创建策略"})]}),o.jsx("div",{style:{overflowY:"auto",flex:1},children:n.length===0?o.jsxs("div",{style:{textAlign:"center",padding:"40px 0",color:"var(--text-tertiary)",fontSize:"14px"},children:["暂无策略",o.jsx("br",{}),"点击「创建策略」开始配置"]}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:n.map(z=>o.jsxs("div",{style:{padding:"16px",borderRadius:"12px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:600,fontSize:"14px",marginBottom:"2px"},children:["📋 ",z.name]}),z.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"12px"},children:z.description})]}),o.jsxs("div",{style:{display:"flex",gap:"4px"},children:[o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>In(z),children:"编辑"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>le(z),children:"复制"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>fa(z),children:"删除"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"16px",fontSize:"12px",color:"var(--text-secondary)"},children:[o.jsxs("span",{children:["🔗 路由: ",z.routeId&&z.routeId!=="system"?gn(z.routeId)||o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"未绑定"}):o.jsx("span",{style:{color:"var(--accent-color, #4a90d9)"},children:"按系统默认"})]}),o.jsxs("span",{children:["🔑 Key: ",z.keyCount||0]}),o.jsxs("span",{children:["📊 配额: ",dr(z)]})]})]},z.id))})})]})})})]}),E&&o.jsx("div",{className:"modal-overlay",onClick:()=>A(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"480px",padding:"28px"},onClick:z=>z.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>A(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 6px",fontSize:"20px"},children:"创建接入密钥"}),o.jsx("p",{style:{margin:"0 0 20px",color:"var(--text-tertiary)",fontSize:"13px"},children:"生成一个以 sk_ 开头的 API Key,分发给团队成员使用"}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["名称 ",o.jsx("span",{style:{color:"var(--color-danger)"},children:"*"})]}),o.jsx("input",{type:"text",value:I,onChange:z=>_(z.target.value),placeholder:"例如:张三 - 前端组",autoFocus:!0,style:{...Jt,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px"}})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["备注 ",o.jsx("span",{style:{color:"var(--text-tertiary)",fontWeight:400,fontSize:"12px"},children:"(可选)"})]}),o.jsx("textarea",{value:G,onChange:z=>K(z.target.value),placeholder:"补充说明信息",style:{...Jt,width:"100%",padding:"10px 14px",minHeight:"52px",fontSize:"14px",borderRadius:"8px",resize:"vertical"}})]}),o.jsxs("div",{style:{marginBottom:"24px"},children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["策略 ",o.jsx("span",{style:{color:"var(--text-tertiary)",fontWeight:400,fontSize:"12px"},children:"(可选)"})]}),o.jsxs("select",{value:O,onChange:z=>B(z.target.value),style:{...Jt,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"",children:"稍后配置"}),n.map(z=>o.jsx("option",{value:z.id,children:z.name},z.id))]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>A(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:We,className:"ak-modal-btn-primary",children:"创建密钥"})]})]})}),D&&o.jsx("div",{className:"modal-overlay",onClick:()=>T(null),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:z=>z.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>T(null),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsxs("div",{style:{textAlign:"center",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"40px",marginBottom:"8px"},children:"🔑"}),o.jsx("h3",{style:{margin:"0",fontSize:"20px",color:"#22c55e"},children:"密钥创建成功"})]}),o.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"16px",border:"2px dashed #22c55e",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"1px"},children:"API Key"}),o.jsx("code",{style:{display:"block",fontSize:"16px",wordBreak:"break-all",lineHeight:1.6,fontFamily:'"SF Mono", "Fira Code", monospace',color:"var(--text-primary)"},children:D.apiKey})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[o.jsx("button",{onClick:()=>kn(D.apiKey),className:"ak-modal-btn-primary",children:"📋 复制 Key"}),o.jsx("button",{onClick:()=>T(null),className:"ak-modal-btn-secondary",children:"完成"})]})]})}),N&&o.jsx("div",{className:"modal-overlay",onClick:()=>pe(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:z=>z.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>pe(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 4px",fontSize:"20px"},children:F?"编辑策略":"创建策略"}),o.jsx("p",{style:{margin:"0 0 22px",color:"var(--text-tertiary)",fontSize:"13px"},children:"配置路由、配额限制和模型过滤规则,多个密钥可复用同一策略"}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"18px"},children:[o.jsxs("div",{children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["名称 ",o.jsx("span",{style:{color:"var(--color-danger)"},children:"*"})]}),o.jsx("input",{type:"text",value:ve,onChange:z=>X(z.target.value),placeholder:"例如:中度限制策略",style:{...Jt,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px"}})]}),o.jsxs("div",{children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["描述 ",o.jsx("span",{style:{color:"var(--text-tertiary)",fontWeight:400,fontSize:"12px"},children:"(可选)"})]}),o.jsx("input",{type:"text",value:oe,onChange:z=>de(z.target.value),placeholder:"适合普通开发者使用",style:{...Jt,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px"}})]})]}),o.jsxs("div",{style:{marginBottom:"18px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"路由绑定"}),o.jsxs("select",{value:ie,onChange:z=>J(z.target.value),style:{...Jt,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"system",children:"按系统默认"}),i.map(z=>o.jsx("option",{value:z.id,children:z.name},z.id))]})]}),o.jsxs("div",{style:{marginBottom:"18px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[o.jsx("label",{style:{fontWeight:600,fontSize:"14px"},children:"配额限制"}),!F&&s.length>0&&o.jsxs("select",{style:{fontSize:"13px",padding:"6px 12px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",cursor:"pointer",color:"var(--text-secondary)"},onChange:z=>{z.target.value&&(ci(s[Number(z.target.value)]),z.target.value="")},children:[o.jsx("option",{value:"",children:"📋 使用模板..."}),s.map((z,L)=>o.jsxs("option",{value:String(L),children:[z.name," — ",z.description]},L))]})]}),o.jsx("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"16px",border:"1px solid var(--border-primary)"},children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"12px"},children:[o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"日 Token (k)"}),o.jsx("input",{type:"number",value:xe,onChange:z=>ae(z.target.value),placeholder:"不限",style:{...Jt,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"月 Token (k)"}),o.jsx("input",{type:"number",value:Me,onChange:z=>se(z.target.value),placeholder:"不限",style:{...Jt,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"日请求 (次)"}),o.jsx("input",{type:"number",value:Le,onChange:z=>$e(z.target.value),placeholder:"不限",style:{...Jt,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"RPM"}),o.jsx("input",{type:"number",value:Ye,onChange:z=>lt(z.target.value),placeholder:"不限",style:{...Jt,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"并发"}),o.jsx("input",{type:"number",value:Ve,onChange:z=>rt(z.target.value),placeholder:"不限",style:{...Jt,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]})]})})]}),o.jsxs("div",{style:{marginBottom:"24px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"模型过滤"}),o.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"14px",border:"1px solid var(--border-primary)"},children:[o.jsx("div",{style:{display:"flex",gap:"16px",marginBottom:Z!=="none"?"12px":"0"},children:[{value:"none",label:"不限制",desc:"允许所有模型"},{value:"allow",label:"白名单",desc:"仅允许指定模型"},{value:"block",label:"黑名单",desc:"禁止指定模型"}].map(z=>o.jsxs("label",{className:`policy-model-opt ${Z===z.value?"policy-model-opt--active":""}`,children:[o.jsx("input",{type:"radio",name:"modelMode",value:z.value,checked:Z===z.value,onChange:()=>Y(z.value),style:{display:"none"}}),o.jsx("div",{style:{fontWeight:600,fontSize:"14px",marginBottom:"2px"},children:z.label}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)"},children:z.desc})]},z.value))}),Z!=="none"&&o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[o.jsxs("div",{style:{position:"relative",flex:1},children:[o.jsx("input",{ref:Q,type:"text",value:ce,onChange:z=>{M(z.target.value),Ee(!0)},onFocus:()=>Ee(!0),onBlur:()=>setTimeout(()=>Ee(!1),150),placeholder:fe.length>0?"搜索或输入模型名...":"输入模型名,回车确认...",autoFocus:!0,onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),Ot(Z==="allow"?ke:Fe,Z==="allow"?De:Ze)),z.key==="Escape"&&Ee(!1)},style:{...Jt,width:"100%",padding:"8px 12px",borderRadius:"6px",fontSize:"13px"}}),Te&&St.length>0&&o.jsx("div",{className:"ak-model-suggest",children:St.map(z=>o.jsxs("button",{className:"ak-model-suggest-item",onMouseDown:L=>{var Be;L.preventDefault();const Pe=Z==="allow"?ke:Fe,tt=Z==="allow"?De:Ze;Pe.includes(z.name)||tt([...Pe,z.name]),M(""),Ee(!1),(Be=Q.current)==null||Be.focus()},children:[o.jsx("span",{children:z.name}),o.jsx("span",{children:z.vendors.join(", ")})]},z.name))})]}),o.jsx("button",{className:"btn btn-primary btn-sm",style:{padding:"8px 14px",borderRadius:"6px"},onClick:()=>Ot(Z==="allow"?ke:Fe,Z==="allow"?De:Ze),children:"添加"})]}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",minHeight:"24px"},children:[(Z==="allow"?ke:Fe).length===0&&o.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)",padding:"4px 0"},children:Z==="allow"?"尚未添加模型,至少需要添加一个模型才能生效":"尚未添加模型,不添加则不对任何模型进行屏蔽"}),(Z==="allow"?ke:Fe).map((z,L)=>o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",background:"var(--bg-secondary)",borderRadius:"16px",fontSize:"13px",border:"1px solid var(--border-primary)"},children:[z,o.jsx("button",{style:{border:"none",background:"none",cursor:"pointer",padding:"0 2px",color:"var(--text-tertiary)",fontSize:"14px",lineHeight:1},onClick:()=>{(Z==="allow"?De:Ze)((Z==="allow"?ke:Fe).filter((Be,jt)=>jt!==L))},children:"×"})]},L))]})]})]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>pe(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Di,className:"ak-modal-btn-primary",children:F?"保存修改":"创建策略"})]})]})}),we&&o.jsx(WM,{keyName:we.key.name,apiKey:we.key.apiKey,guide:we.guide,onClose:()=>Ae(null)}),o.jsx("style",{children:`
|
|
527
|
-
.dropdown-btn {
|
|
528
|
-
display: block; width: 100%; padding: 6px 10px; text-align: left;
|
|
529
|
-
border: none; background: none; cursor: pointer; font-size: 13px;
|
|
530
|
-
color: var(--text-primary);
|
|
531
|
-
}
|
|
532
|
-
.dropdown-btn:hover { background: var(--bg-secondary); }
|
|
533
|
-
|
|
534
|
-
/* 操作按钮 - 列表/策略面板中的小按钮 */
|
|
535
|
-
.ak-action-btn {
|
|
536
|
-
padding: 4px 10px; border-radius: 6px;
|
|
537
|
-
border: 1px solid var(--border-primary);
|
|
538
|
-
background: var(--bg-secondary);
|
|
539
|
-
color: var(--text-secondary);
|
|
540
|
-
cursor: pointer; font-size: 13px;
|
|
541
|
-
transition: all 0.15s;
|
|
542
|
-
}
|
|
543
|
-
.ak-action-btn:hover {
|
|
544
|
-
background: var(--bg-route-item-hover);
|
|
545
|
-
border-color: var(--text-secondary);
|
|
546
|
-
}
|
|
547
|
-
.ak-action-btn--danger {
|
|
548
|
-
color: var(--accent-danger);
|
|
549
|
-
}
|
|
550
|
-
.ak-action-btn--danger:hover {
|
|
551
|
-
background: rgba(220, 38, 38, 0.1);
|
|
552
|
-
border-color: var(--accent-danger);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/* 模型自动补全下拉 */
|
|
556
|
-
.ak-model-suggest {
|
|
557
|
-
position: absolute; left: 0; right: 0; bottom: 100%; z-index: 50;
|
|
558
|
-
margin-top: 4px; max-height: 240px; overflow-y: auto;
|
|
559
|
-
background: var(--bg-primary-solid); border: 1px solid var(--border-primary);
|
|
560
|
-
border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
|
|
561
|
-
padding: 4px 0;
|
|
562
|
-
}
|
|
563
|
-
.ak-model-suggest-item {
|
|
564
|
-
display: flex; justify-content: space-between; align-items: center; gap: 8px;
|
|
565
|
-
width: 100%; padding: 7px 12px;
|
|
566
|
-
border: none; background: none; cursor: pointer;
|
|
567
|
-
font-size: 13px; color: var(--text-primary); text-align: left;
|
|
568
|
-
}
|
|
569
|
-
.ak-model-suggest-item > span:first-child {
|
|
570
|
-
font-family: "SF Mono", "Fira Code", monospace;
|
|
571
|
-
white-space: nowrap;
|
|
572
|
-
}
|
|
573
|
-
.ak-model-suggest-item > span:last-child {
|
|
574
|
-
color: #999; font-size: 11px; white-space: nowrap; flex-shrink: 0;
|
|
575
|
-
}
|
|
576
|
-
[data-theme="dark"] .ak-model-suggest-item > span:last-child {
|
|
577
|
-
color: #888;
|
|
578
|
-
}
|
|
579
|
-
.ak-model-suggest-item:hover {
|
|
580
|
-
background: var(--bg-secondary);
|
|
581
|
-
}
|
|
582
|
-
[data-theme="dark"] .ak-model-suggest {
|
|
583
|
-
background: #0C1F12;
|
|
584
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
585
|
-
}
|
|
586
|
-
[data-theme="dark"] .ak-model-suggest-item:hover {
|
|
587
|
-
background: rgba(30, 58, 40, 0.95);
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
/* 批量操作按钮 */
|
|
591
|
-
.ak-action-btn[onClick] {
|
|
592
|
-
padding: 6px 12px;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
/* 下拉菜单 */
|
|
596
|
-
.ak-dropdown-menu {
|
|
597
|
-
position: absolute; right: 0; top: 100%; z-index: 100;
|
|
598
|
-
background: var(--bg-primary-solid);
|
|
599
|
-
border: 1px solid var(--border-primary);
|
|
600
|
-
border-radius: 6px;
|
|
601
|
-
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
602
|
-
min-width: 140px; padding: 4px 0;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
/* 弹窗按钮 */
|
|
606
|
-
.ak-modal-btn-primary {
|
|
607
|
-
padding: 10px 28px; border-radius: 8px; border: none;
|
|
608
|
-
background: var(--color-primary, #3b82f6); color: #fff;
|
|
609
|
-
cursor: pointer; font-size: 14px; font-weight: 600;
|
|
610
|
-
transition: opacity 0.15s;
|
|
611
|
-
}
|
|
612
|
-
.ak-modal-btn-primary:hover { opacity: 0.9; }
|
|
613
|
-
|
|
614
|
-
.ak-modal-btn-secondary {
|
|
615
|
-
padding: 10px 24px; border-radius: 8px;
|
|
616
|
-
border: 1px solid var(--border-primary);
|
|
617
|
-
background: var(--bg-secondary);
|
|
618
|
-
color: var(--text-primary);
|
|
619
|
-
cursor: pointer; font-size: 14px; font-weight: 500;
|
|
620
|
-
transition: all 0.15s;
|
|
621
|
-
}
|
|
622
|
-
.ak-modal-btn-secondary:hover {
|
|
623
|
-
background: var(--bg-route-item-hover);
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
/* 模型过滤选项 */
|
|
627
|
-
.policy-model-opt {
|
|
628
|
-
cursor: pointer; padding: 10px 14px; border-radius: 8px;
|
|
629
|
-
flex: 1; text-align: center; transition: all 0.2s;
|
|
630
|
-
border: 1px solid var(--border-primary);
|
|
631
|
-
background: transparent;
|
|
632
|
-
}
|
|
633
|
-
.policy-model-opt:hover {
|
|
634
|
-
background: rgba(59,130,246,0.05);
|
|
635
|
-
}
|
|
636
|
-
.policy-model-opt--active {
|
|
637
|
-
border: 2px solid var(--color-primary, #3b82f6);
|
|
638
|
-
background: rgba(59,130,246,0.12);
|
|
639
|
-
}
|
|
640
|
-
.policy-model-opt--active:hover {
|
|
641
|
-
background: rgba(59,130,246,0.18);
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
/* ========== 深色模式 ========== */
|
|
645
|
-
[data-theme="dark"] .ak-action-btn {
|
|
646
|
-
background: rgba(30, 58, 40, 0.95);
|
|
647
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
648
|
-
color: #A7F3D0;
|
|
649
|
-
}
|
|
650
|
-
[data-theme="dark"] .ak-action-btn:hover {
|
|
651
|
-
background: rgba(40, 75, 52, 0.95);
|
|
652
|
-
border-color: rgba(167, 243, 208, 0.4);
|
|
653
|
-
}
|
|
654
|
-
[data-theme="dark"] .ak-action-btn--danger {
|
|
655
|
-
color: #EF4444;
|
|
656
|
-
}
|
|
657
|
-
[data-theme="dark"] .ak-action-btn--danger:hover {
|
|
658
|
-
background: rgba(239, 68, 68, 0.15);
|
|
659
|
-
border-color: rgba(239, 68, 68, 0.5);
|
|
660
|
-
}
|
|
661
|
-
[data-theme="dark"] .ak-dropdown-menu {
|
|
662
|
-
background: #0C1F12;
|
|
663
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
664
|
-
}
|
|
665
|
-
[data-theme="dark"] .ak-modal-btn-secondary {
|
|
666
|
-
background: rgba(30, 58, 40, 0.95);
|
|
667
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
668
|
-
color: #ECFEF5;
|
|
669
|
-
}
|
|
670
|
-
[data-theme="dark"] .ak-modal-btn-secondary:hover {
|
|
671
|
-
background: rgba(40, 75, 52, 0.95);
|
|
672
|
-
border-color: rgba(167, 243, 208, 0.35);
|
|
673
|
-
}
|
|
674
|
-
[data-theme="dark"] .policy-model-opt:hover {
|
|
675
|
-
background: rgba(96,165,250,0.12);
|
|
676
|
-
}
|
|
677
|
-
[data-theme="dark"] .policy-model-opt--active {
|
|
678
|
-
background: rgba(96,165,250,0.28);
|
|
679
|
-
border-color: #60a5fa;
|
|
680
|
-
}
|
|
681
|
-
[data-theme="dark"] .policy-model-opt--active:hover {
|
|
682
|
-
background: rgba(96,165,250,0.38);
|
|
683
|
-
}
|
|
684
|
-
[data-theme="dark"] .page-container select option {
|
|
685
|
-
background: #0C1F12;
|
|
686
|
-
color: #ECFEF5;
|
|
687
|
-
}
|
|
688
|
-
[data-theme="dark"] .page-container textarea,
|
|
689
|
-
[data-theme="dark"] .page-container input[type="text"],
|
|
690
|
-
[data-theme="dark"] .page-container input[type="number"] {
|
|
691
|
-
color-scheme: dark;
|
|
692
|
-
}
|
|
693
|
-
`})]})}function sae(){var dr,ha,Jt,z;const{id:e}=Az(),t=Zf(),{confirm:n}=yu(),[r,i]=f.useState(null),[a,s]=f.useState([]),[l,c]=f.useState([]),[u,p]=f.useState(!0),[d,h]=f.useState("info"),[m,g]=f.useState(null),[y,x]=f.useState([]),[v,b]=f.useState(30),[j,w]=f.useState([]),[k,S]=f.useState(0),[E,A]=f.useState(1),[D,T]=f.useState(20),[I,_]=f.useState(""),[G,K]=f.useState(""),[O,B]=f.useState(""),[W,R]=f.useState(""),[$,P]=f.useState(null),[F,re]=f.useState(!1),[N,pe]=f.useState(10),ve=f.useRef(null),[X,oe]=f.useState(!1),[de,ie]=f.useState(""),[J,xe]=f.useState(""),[ae,Me]=f.useState(""),[se,Le]=f.useState(null),[$e,Ye]=f.useState(!1),[lt,Ve]=f.useState({"claude-code":!0,codex:!0}),[rt,ke]=f.useState(!1),[De,Fe]=f.useState([]),[Ze,Z]=f.useState(0),[Y,ce]=f.useState(1),[M,fe]=f.useState(20),[ge,Te]=f.useState(""),[Ee,Q]=f.useState(""),[ue,Se]=f.useState(null),[je,ze]=f.useState([]),[We,Ge]=f.useState(!1),[H,he]=f.useState(!1),[we,Ae]=f.useState(10),Re=f.useRef(null),qe=f.useCallback(async()=>{if(e)try{const[L,Pe,tt]=await Promise.all([V.getAccessKey(e).catch(()=>null),V.getPolicies().catch(()=>[]),V.getRoutes().catch(()=>[])]);if(!L){U.error("密钥不存在"),t("/access-keys");return}i(L),s(Pe),c(tt),ie(L.name),xe(L.remark||""),Me(L.policyId||"")}catch(L){U.error("加载数据失败: "+L.message)}finally{p(!1)}},[e,t]),Xe=f.useCallback(async()=>{if(e)try{const[L,Pe]=await Promise.all([V.getAccessKeyUsage(e).catch(()=>null),V.getAccessKeyUsageTrend(e,v).catch(()=>[])]);g(L),x(Pe)}catch{}},[e,v]),et=f.useCallback(async()=>{if(e)try{const L=await V.getAccessKeyLogs(e,{page:E,pageSize:D,startDate:I||void 0,endDate:G||void 0,contentType:O||void 0,search:W||void 0});w(L.data),S(L.total)}catch{}},[e,E,D,I,G,O,W]),ct=f.useCallback(async()=>{if(e)try{const L=await V.getAccessKeySessions(e,{page:Y,pageSize:M,targetType:Ee||void 0,search:ge||void 0});Fe(L.data),Z(L.total)}catch{}},[e,Y,M,Ee,ge]);f.useEffect(()=>{qe()},[qe]),f.useEffect(()=>{d==="stats"&&Xe(),d==="logs"&&et(),d==="sessions"&&ct()},[d,Xe,et,ct]),f.useEffect(()=>{if(F&&d==="logs")return ve.current=setInterval(()=>{pe(L=>L<=1?(et(),10):L-1)},1e3),()=>{ve.current&&clearInterval(ve.current)};ve.current&&clearInterval(ve.current),pe(10)},[F,d,et]),f.useEffect(()=>{if(H&&d==="sessions")return Re.current=setInterval(()=>{Ae(L=>L<=1?(ct(),10):L-1)},1e3),()=>{Re.current&&clearInterval(Re.current)};Re.current&&clearInterval(Re.current),Ae(10)},[H,d,ct]);const Wr=async()=>{if(!(!e||!de.trim()))try{await V.updateAccessKey(e,{name:de.trim(),remark:J||void 0,policyId:ae||void 0}),U.success("已保存"),oe(!1),qe()}catch(L){U.error("保存失败: "+L.message)}},kn=async()=>{if(r)try{await V.updateAccessKey(r.id,{status:r.status==="active"?"disabled":"active"}),U.success(r.status==="active"?"已停用":"已启用"),qe()}catch(L){U.error("操作失败: "+L.message)}},mt=async()=>{if(!(!r||!await n({message:"确定删除此密钥吗?删除后不可恢复。"})))try{await V.deleteAccessKey(r.id),U.success("已删除"),t("/access-keys")}catch(Pe){U.error("删除失败: "+Pe.message)}},In=async()=>{if(r)try{const L=await V.getAccessKeyGuide(r.id);Le({key:r,guide:L})}catch(L){U.error("获取指引失败: "+L.message)}},Cn=async()=>{var L,Pe;if(r)try{const tt=await V.getAccessKeyGuide(r.id),Be=((Pe=(L=tt==null?void 0:tt.claudeCode)==null?void 0:L.envVars)==null?void 0:Pe.ANTHROPIC_AUTH_TOKEN)||r.apiKey;await navigator.clipboard.writeText(Be),U.success("已复制到剪贴板")}catch{try{await navigator.clipboard.writeText(r.apiKey),U.success("已复制到剪贴板")}catch{U.error("复制失败")}}},Bt=async()=>{if(!r)return;const L=Object.entries(lt).filter(([,Pe])=>Pe).map(([Pe])=>Pe);if(L.length===0){U.error("请选择至少一个目标");return}ke(!0);try{await V.writeAccessKeyToLocal(r.id,L),U.success("已写入本地配置文件"),Ye(!1)}catch(Pe){U.error("写入失败: "+(Pe.message||"未知错误"))}finally{ke(!1)}},St=L=>L>=1e6?(L/1e6).toFixed(1)+"M":L>=1e3?(L/1e3).toFixed(1)+"k":String(L),ci=L=>L?new Date(L).toLocaleString():"-",Di={width:"100%",padding:"8px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",boxSizing:"border-box",fontSize:"14px"};if(u)return o.jsx("div",{style:{textAlign:"center",padding:"40px"},children:"加载中..."});if(!r)return null;const fa=m&&m.lifetime.totalRequests>0?((m.lifetime.totalRequests-m.lifetime.errorCount)/m.lifetime.totalRequests*100).toFixed(1):"-",le=Math.max(...y.map(L=>L.tokens),1),Ot=Math.max(...y.map(L=>L.requests),1),gn=[{key:"info",label:"基本信息"},{key:"policy",label:"策略"},{key:"stats",label:"统计"},{key:"logs",label:"日志"},{key:"sessions",label:"会话"}];return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"20px"},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>t("/access-keys"),children:"← 返回"}),o.jsx("h2",{style:{flex:1},children:r.name}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:()=>oe(!0),children:"编辑"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:()=>Ye(!0),children:"💾 写入本地"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:kn,children:r.status==="active"?"停用":"启用"}),o.jsx("button",{className:"ak-action-btn ak-action-btn--danger",style:{padding:"6px 14px"},onClick:mt,children:"删除"})]}),o.jsx("div",{className:"ak-tab-bar",style:{display:"flex",gap:"0",borderBottom:"2px solid var(--border-primary)",marginBottom:"20px"},children:gn.map(L=>o.jsx("button",{className:`ak-tab-btn ${d===L.key?"ak-tab-btn--active":""}`,onClick:()=>h(L.key),children:L.label},L.key))}),d==="info"&&o.jsx("div",{className:"card",children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr",gap:"16px 20px",alignItems:"start"},children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"API Key"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("code",{style:{fontSize:"14px",padding:"4px 8px",background:"var(--bg-secondary)",borderRadius:"4px"},children:r.apiKey}),o.jsx("button",{className:"ak-action-btn",onClick:Cn,title:"复制",children:"📋"}),o.jsx("button",{className:"ak-action-btn",onClick:In,children:"接入指引"})]}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"策略"}),o.jsx("div",{style:{fontSize:"14px"},children:r.policyName||o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"未配置"})}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"状态"}),o.jsxs("div",{style:{fontSize:"14px",display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:r.status==="active"?"var(--color-success, #22c55e)":"var(--text-tertiary)"}}),r.status==="active"?"启用":"停用"]}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"创建时间"}),o.jsx("div",{style:{fontSize:"14px"},children:ci(r.createdAt)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"最后活跃"}),o.jsx("div",{style:{fontSize:"14px"},children:ci(r.lastActiveAt)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"备注"}),o.jsx("div",{style:{fontSize:"14px",color:r.remark?"var(--text-primary)":"var(--text-tertiary)"},children:r.remark||"无"}),m&&o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"累计 Token"}),o.jsx("div",{style:{fontSize:"14px"},children:St(m.lifetime.totalTokens)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"累计请求"}),o.jsx("div",{style:{fontSize:"14px"},children:m.lifetime.totalRequests})]})]})}),d==="policy"&&(()=>{var Kr,ro,Nl,io,_l;const L=a.find(Qe=>Qe.id===r.policyId),Pe=L!=null&&L.routeId&&L.routeId!=="system"?(Kr=l.find(Qe=>Qe.id===L.routeId))==null?void 0:Kr.name:void 0,tt=Qe=>{const qt=[];return Qe.dailyTokenLimit&&qt.push(`日 ${Qe.dailyTokenLimit}k Token`),Qe.weeklyTokenLimit&&qt.push(`周 ${Qe.weeklyTokenLimit}k Token`),Qe.monthlyTokenLimit&&qt.push(`月 ${Qe.monthlyTokenLimit}k Token`),Qe.customTokenLimit&&Qe.customTokenResetHours&&qt.push(`${Qe.customTokenResetHours}h ${Qe.customTokenLimit}k Token`),Qe.dailyRequestLimit&&qt.push(`日 ${Qe.dailyRequestLimit} 次请求`),Qe.weeklyRequestLimit&&qt.push(`周 ${Qe.weeklyRequestLimit} 次请求`),Qe.monthlyRequestLimit&&qt.push(`月 ${Qe.monthlyRequestLimit} 次请求`),Qe.customRequestLimit&&Qe.customRequestResetHours&&qt.push(`${Qe.customRequestResetHours}h ${Qe.customRequestLimit} 次请求`),Qe.rpmLimit&&qt.push(`RPM ${Qe.rpmLimit}`),Qe.concurrentLimit&&qt.push(`并发 ${Qe.concurrentLimit}`),qt.length>0?qt:null},Be=(ro=L==null?void 0:L.allowedModels)!=null&&ro.length?L.allowedModels:(Nl=L==null?void 0:L.blockedModels)!=null&&Nl.length?L.blockedModels:null,jt=(io=L==null?void 0:L.allowedModels)!=null&&io.length?"allow":(_l=L==null?void 0:L.blockedModels)!=null&&_l.length?"block":"none";if(!L)return o.jsxs("div",{className:"card",style:{textAlign:"center",padding:"60px 20px"},children:[o.jsx("div",{style:{fontSize:"36px",marginBottom:"12px"},children:"📋"}),o.jsx("div",{style:{fontSize:"16px",fontWeight:500,marginBottom:"8px"},children:"未绑定策略"}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px"},children:"可在「编辑」弹窗中为此密钥绑定策略,以启用配额限制和模型过滤"})]});const Zt=tt(L);return o.jsxs("div",{className:"card",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[o.jsxs("div",{children:[o.jsxs("h3",{style:{margin:"0 0 4px",fontSize:"18px"},children:["📋 ",L.name]}),L.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px"},children:L.description})]}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:"只读 · 如需修改请前往策略管理"})]}),o.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center",marginBottom:"20px",paddingBottom:"20px",borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px"},children:"绑定路由:"}),o.jsx("div",{style:{fontSize:"14px"},children:Pe?o.jsx("span",{children:Pe}):o.jsx("span",{style:{color:"var(--accent-color, #4a90d9)"},children:"按系统默认"})})]}),o.jsxs("div",{style:{marginBottom:"20px",paddingBottom:"20px",borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("h4",{style:{margin:"0 0 12px",fontSize:"15px"},children:"📊 配额限制"}),Zt?o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:Zt.map((Qe,qt)=>o.jsx("span",{style:{display:"inline-block",padding:"6px 12px",borderRadius:"6px",background:"var(--bg-secondary)",fontSize:"13px",border:"1px solid var(--border-primary)"},children:Qe},qt))}):o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px"},children:"无限制"})]}),o.jsxs("div",{children:[o.jsx("h4",{style:{margin:"0 0 12px",fontSize:"15px"},children:"🏷️ 模型过滤"}),jt==="none"?o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px"},children:"不限制,允许所有模型"}):o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:"13px",marginBottom:"10px",color:"var(--text-secondary)"},children:jt==="allow"?"✅ 白名单模式 — 仅允许以下模型":"🚫 黑名单模式 — 禁止以下模型"}),o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Be.map((Qe,qt)=>o.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"5px 12px",background:"var(--bg-secondary)",borderRadius:"16px",fontSize:"13px",border:"1px solid var(--border-primary)"},children:Qe},qt))})]})]})]})})(),d==="stats"&&o.jsxs("div",{children:[m&&o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:"12px",marginBottom:"20px"},children:[{label:"累计 Token",value:St(m.lifetime.totalTokens)},{label:"累计请求",value:String(m.lifetime.totalRequests)},{label:"成功率",value:fa+"%"},{label:"错误数",value:String(m.lifetime.errorCount)},{label:"输入 Token",value:St(m.lifetime.inputTokens)},{label:"输出 Token",value:St(m.lifetime.outputTokens)}].map(L=>o.jsxs("div",{className:"card",style:{padding:"16px",textAlign:"center",marginBottom:"0"},children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px",marginBottom:"4px"},children:L.label}),o.jsx("div",{style:{fontSize:"20px",fontWeight:600},children:L.value})]},L.label))}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[o.jsx("h4",{style:{margin:0},children:"消耗趋势"}),o.jsx("div",{style:{display:"flex",gap:"4px"},children:[7,30,90].map(L=>o.jsxs("button",{className:`ak-action-btn ${v===L?"ak-action-btn--active":""}`,style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>b(L),children:[L,"天"]},L))})]}),y.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无趋势数据"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"8px"},children:"Token 消耗"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"80px"},children:y.slice(-v).map((L,Pe)=>o.jsx("div",{style:{flex:1,minWidth:0,height:le>0?`${Math.max(2,L.tokens/le*100)}%`:"2px",background:"var(--color-primary, #3b82f6)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${L.date}: ${St(L.tokens)}`},Pe))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(dr=y[0])==null?void 0:dr.date}),o.jsx("span",{children:(ha=y[y.length-1])==null?void 0:ha.date})]})]}),o.jsxs("div",{style:{marginBottom:"8px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"8px"},children:"请求量"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"60px"},children:y.slice(-v).map((L,Pe)=>o.jsx("div",{style:{flex:1,minWidth:0,height:Ot>0?`${Math.max(2,L.requests/Ot*100)}%`:"2px",background:"var(--color-success, #22c55e)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${L.date}: ${L.requests} 请求`},Pe))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(Jt=y[0])==null?void 0:Jt.date}),o.jsx("span",{children:(z=y[y.length-1])==null?void 0:z.date})]})]}),o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"8px"},children:"错误数"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"40px"},children:y.slice(-v).map((L,Pe)=>{const tt=Math.max(...y.map(Be=>Be.errors),1);return o.jsx("div",{style:{flex:1,minWidth:0,height:tt>0?`${Math.max(2,L.errors/tt*100)}%`:"2px",background:L.errors>0?"var(--accent-danger, #ef4444)":"var(--border-primary)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${L.date}: ${L.errors} 错误`},Pe)})})]})]})]})]}),d==="logs"&&o.jsxs("div",{children:[o.jsx("div",{className:"card",style:{marginBottom:"16px",padding:"12px 16px"},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1,minWidth:0},children:[o.jsx("input",{type:"text",placeholder:"搜索路径、模型...",value:W,onChange:L=>{R(L.target.value),A(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px",width:"180px"}}),o.jsxs("select",{value:O,onChange:L=>{B(L.target.value),A(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"},children:[o.jsx("option",{value:"",children:"全部类型"}),o.jsx("option",{value:"default",children:"默认"}),o.jsx("option",{value:"thinking",children:"思考"}),o.jsx("option",{value:"long-context",children:"长上下文"}),o.jsx("option",{value:"image-understanding",children:"图像理解"}),o.jsx("option",{value:"background",children:"后台"}),o.jsx("option",{value:"compact",children:"压缩"}),o.jsx("option",{value:"high-iq",children:"高智商"})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("label",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:"开始"}),o.jsx("input",{type:"date",value:I,onChange:L=>{_(L.target.value),A(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"}})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("label",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:"结束"}),o.jsx("input",{type:"date",value:G,onChange:L=>{K(L.target.value),A(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"}})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexShrink:0},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"13px",cursor:"pointer",color:"var(--text-tertiary)"},children:[o.jsx("input",{type:"checkbox",checked:F,onChange:L=>re(L.target.checked)}),"自动刷新 ",F&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",N,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>et(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:j.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无请求记录"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"时间"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"路径"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"模型"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"Token"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"耗时"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"center"},children:"状态"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"类型"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"center"},children:"操作"})]})}),o.jsx("tbody",{children:j.map(L=>{var Be,jt,Zt;const Pe=((Be=L.usage)==null?void 0:Be.totalTokens)||(((jt=L.usage)==null?void 0:jt.inputTokens)||0)+(((Zt=L.usage)==null?void 0:Zt.outputTokens)||0),tt=(L.statusCode||200)<400;return o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>P(L),children:[o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(L.timestamp).toLocaleString()}),o.jsx("td",{style:{padding:"8px 6px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:L.path||"-"}),o.jsx("td",{style:{padding:"8px 6px"},children:L.targetModel||L.requestModel||"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:St(Pe)}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:L.responseTime?(L.responseTime/1e3).toFixed(1)+"s":"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"center"},children:o.jsx("span",{style:{display:"inline-block",padding:"2px 6px",borderRadius:"4px",fontSize:"12px",background:tt?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",color:tt?"var(--color-success, #22c55e)":"var(--accent-danger, #ef4444)"},children:L.statusCode||200})}),o.jsx("td",{style:{padding:"8px 6px"},children:L.contentType||"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"center"},children:o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px"},onClick:Kr=>{Kr.stopPropagation(),P(L)},children:"详情"})})]},L.id)})})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(qc,{currentPage:E,totalItems:k,pageSize:D,onPageChange:A,onPageSizeChange:L=>{T(L),A(1)}})})]})})]}),d==="sessions"&&(()=>{const L=(Be,jt)=>{const Zt=jt-Be;return Zt<6e4?`${Math.floor(Zt/1e3)}秒`:Zt<36e5?`${Math.floor(Zt/6e4)}分钟`:`${Math.floor(Zt/36e5)}小时`},Pe=async Be=>{Se(Be),Ge(!0);try{const jt=await V.getAccessKeySessionLogs(e,Be.id,1e4);ze(jt)}catch{U.error("加载会话日志失败")}finally{Ge(!1)}},tt=async()=>{if(!(!ue||We)){Ge(!0);try{const Be=await V.getAccessKeySessionLogs(e,ue.id,1e4);ze(Be)}catch{}finally{Ge(!1)}}};return o.jsxs("div",{children:[o.jsx("div",{className:"card",style:{marginBottom:"16px",padding:"12px 16px"},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1,minWidth:0},children:[o.jsx("input",{type:"text",placeholder:"搜索标题或ID...",value:ge,onChange:Be=>{Te(Be.target.value),ce(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px",width:"200px"}}),o.jsxs("select",{value:Ee,onChange:Be=>{Q(Be.target.value),ce(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"},children:[o.jsx("option",{value:"",children:"全部类型"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexShrink:0},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"13px",cursor:"pointer",color:"var(--text-tertiary)"},children:[o.jsx("input",{type:"checkbox",checked:H,onChange:Be=>he(Be.target.checked)}),"自动刷新 ",H&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",we,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>ct(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:De.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无会话记录"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"标题"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"类型"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"请求数"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"Tokens"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"首次请求"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"最后请求"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"时长"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"center"},children:"操作"})]})}),o.jsx("tbody",{children:De.map(Be=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>Pe(Be),children:[o.jsx("td",{style:{padding:"8px 6px",maxWidth:"250px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ko(Be.title)}),o.jsx("td",{style:{padding:"8px 6px"},children:o.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",background:Be.targetType==="claude-code"?"rgba(59,130,246,0.1)":"rgba(34,197,94,0.1)",color:Be.targetType==="claude-code"?"var(--color-primary, #3b82f6)":"var(--color-success, #22c55e)"},children:Be.targetType==="claude-code"?"Claude Code":"Codex"})}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:Be.requestCount}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:St(Be.totalTokens)}),o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(Be.firstRequestAt).toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(Be.lastRequestAt).toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),o.jsx("td",{style:{padding:"8px 6px"},children:L(Be.firstRequestAt,Be.lastRequestAt)}),o.jsxs("td",{style:{padding:"8px 6px",textAlign:"center"},children:[o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px"},onClick:jt=>{jt.stopPropagation(),Pe(Be)},children:"详情"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px",marginLeft:"4px"},onClick:jt=>{jt.stopPropagation(),Se(Be),Ge(!0),V.getAccessKeySessionLogs(e,Be.id,1e4).then(Zt=>{ze(Zt),Ge(!1)}).catch(()=>Ge(!1))},children:"对话"})]})]},Be.id))})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(qc,{currentPage:Y,totalItems:Ze,pageSize:M,onPageChange:ce,onPageSizeChange:Be=>{fe(Be),ce(1)}})})]})}),ue&&o.jsx(i0,{session:ue,logs:je,logsLoading:We,onRefreshLogs:tt,onFetchNewLogs:async()=>ue?await V.getAccessKeySessionLogs(e,ue.id,1e4):[],onClose:()=>{Se(null),ze([])}})]})})(),X&&o.jsx("div",{className:"modal-overlay",onClick:()=>oe(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"480px",padding:"28px"},onClick:L=>L.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>oe(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 20px",fontSize:"20px"},children:"编辑密钥"}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"名称"}),o.jsx("input",{type:"text",value:de,onChange:L=>ie(L.target.value),style:Di})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"备注"}),o.jsx("textarea",{value:J,onChange:L=>xe(L.target.value),style:{...Di,minHeight:"60px",resize:"vertical"}})]}),o.jsxs("div",{style:{marginBottom:"24px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"策略"}),o.jsxs("select",{value:ae,onChange:L=>Me(L.target.value),style:{...Di,cursor:"pointer"},children:[o.jsx("option",{value:"",children:"未配置"}),a.map(L=>o.jsx("option",{value:L.id,children:L.name},L.id))]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>oe(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Wr,className:"ak-modal-btn-primary",children:"保存"})]})]})}),$&&o.jsx(Mp,{log:$,onClose:()=>P(null)}),se&&o.jsx(WM,{keyName:se.key.name,apiKey:se.key.apiKey,guide:se.guide,onClose:()=>Le(null)}),$e&&o.jsx("div",{className:"modal-overlay",onClick:()=>Ye(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"420px",padding:"28px"},onClick:L=>L.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>Ye(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 16px",fontSize:"20px"},children:"写入本地配置"}),o.jsx("p",{style:{margin:"0 0 16px",fontSize:"14px",color:"var(--text-secondary)"},children:"将此密钥写入本地工具配置文件(仅更新认证字段,不影响其他配置)"}),o.jsx("div",{style:{marginBottom:"20px"},children:[{key:"claude-code",label:"Claude Code",desc:"~/.claude/settings.json → ANTHROPIC_AUTH_TOKEN"},{key:"codex",label:"Codex",desc:"~/.codex/auth.json → OPENAI_API_KEY"}].map(L=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px",marginBottom:"8px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:lt[L.key]?"var(--bg-secondary)":"transparent",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:lt[L.key],onChange:Pe=>Ve(tt=>({...tt,[L.key]:Pe.target.checked})),style:{marginTop:"2px"}}),o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:L.label}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:L.desc})]})]},L.key))}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>Ye(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Bt,className:"ak-modal-btn-primary",disabled:rt,children:rt?"写入中...":"确认写入"})]})]})}),o.jsx("style",{children:`
|
|
694
|
-
.ak-tab-btn {
|
|
695
|
-
padding: 10px 24px;
|
|
696
|
-
border: none;
|
|
697
|
-
background: transparent;
|
|
698
|
-
color: var(--text-tertiary);
|
|
699
|
-
font-size: 14px;
|
|
700
|
-
font-weight: 500;
|
|
701
|
-
cursor: pointer;
|
|
702
|
-
border-bottom: 2px solid transparent;
|
|
703
|
-
margin-bottom: -2px;
|
|
704
|
-
transition: all 0.15s;
|
|
705
|
-
}
|
|
706
|
-
.ak-tab-btn:hover {
|
|
707
|
-
color: var(--text-secondary);
|
|
708
|
-
}
|
|
709
|
-
.ak-tab-btn--active {
|
|
710
|
-
color: var(--color-primary, #3b82f6);
|
|
711
|
-
border-bottom-color: var(--color-primary, #3b82f6);
|
|
712
|
-
font-weight: 600;
|
|
713
|
-
}
|
|
714
|
-
.ak-action-btn {
|
|
715
|
-
padding: 4px 10px; border-radius: 6px;
|
|
716
|
-
border: 1px solid var(--border-primary);
|
|
717
|
-
background: var(--bg-secondary);
|
|
718
|
-
color: var(--text-secondary);
|
|
719
|
-
cursor: pointer; font-size: 13px;
|
|
720
|
-
transition: all 0.15s;
|
|
721
|
-
}
|
|
722
|
-
.ak-action-btn:hover {
|
|
723
|
-
background: var(--bg-route-item-hover);
|
|
724
|
-
border-color: var(--text-secondary);
|
|
725
|
-
}
|
|
726
|
-
.ak-action-btn--active {
|
|
727
|
-
background: var(--color-primary, #3b82f6);
|
|
728
|
-
color: #fff;
|
|
729
|
-
border-color: var(--color-primary, #3b82f6);
|
|
730
|
-
}
|
|
731
|
-
.ak-action-btn--danger {
|
|
732
|
-
color: var(--accent-danger);
|
|
733
|
-
}
|
|
734
|
-
.ak-action-btn--danger:hover {
|
|
735
|
-
background: rgba(220, 38, 38, 0.1);
|
|
736
|
-
border-color: var(--accent-danger);
|
|
737
|
-
}
|
|
738
|
-
.ak-modal-btn-primary {
|
|
739
|
-
padding: 10px 28px; border-radius: 8px; border: none;
|
|
740
|
-
background: var(--color-primary, #3b82f6); color: #fff;
|
|
741
|
-
cursor: pointer; font-size: 14px; font-weight: 600;
|
|
742
|
-
transition: opacity 0.15s;
|
|
743
|
-
}
|
|
744
|
-
.ak-modal-btn-primary:hover { opacity: 0.9; }
|
|
745
|
-
.ak-modal-btn-secondary {
|
|
746
|
-
padding: 10px 24px; border-radius: 8px;
|
|
747
|
-
border: 1px solid var(--border-primary);
|
|
748
|
-
background: var(--bg-secondary);
|
|
749
|
-
color: var(--text-primary);
|
|
750
|
-
cursor: pointer; font-size: 14px; font-weight: 500;
|
|
751
|
-
transition: all 0.15s;
|
|
752
|
-
}
|
|
753
|
-
.ak-modal-btn-secondary:hover {
|
|
754
|
-
background: var(--bg-route-item-hover);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
/* 深色模式 */
|
|
758
|
-
[data-theme="dark"] .ak-action-btn {
|
|
759
|
-
background: rgba(30, 58, 40, 0.95);
|
|
760
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
761
|
-
color: #A7F3D0;
|
|
762
|
-
}
|
|
763
|
-
[data-theme="dark"] .ak-action-btn:hover {
|
|
764
|
-
background: rgba(40, 75, 52, 0.95);
|
|
765
|
-
border-color: rgba(167, 243, 208, 0.4);
|
|
766
|
-
}
|
|
767
|
-
[data-theme="dark"] .ak-action-btn--danger {
|
|
768
|
-
color: #EF4444;
|
|
769
|
-
}
|
|
770
|
-
[data-theme="dark"] .ak-action-btn--danger:hover {
|
|
771
|
-
background: rgba(239, 68, 68, 0.15);
|
|
772
|
-
border-color: rgba(239, 68, 68, 0.5);
|
|
773
|
-
}
|
|
774
|
-
[data-theme="dark"] .ak-modal-btn-secondary {
|
|
775
|
-
background: rgba(30, 58, 40, 0.95);
|
|
776
|
-
border-color: rgba(167, 243, 208, 0.2);
|
|
777
|
-
color: #ECFEF5;
|
|
778
|
-
}
|
|
779
|
-
[data-theme="dark"] .ak-modal-btn-secondary:hover {
|
|
780
|
-
background: rgba(40, 75, 52, 0.95);
|
|
781
|
-
border-color: rgba(167, 243, 208, 0.35);
|
|
782
|
-
}
|
|
783
|
-
[data-theme="dark"] .page-container select option {
|
|
784
|
-
background: #0C1F12;
|
|
785
|
-
color: #ECFEF5;
|
|
786
|
-
}
|
|
787
|
-
[data-theme="dark"] .page-container textarea,
|
|
788
|
-
[data-theme="dark"] .page-container input[type="text"],
|
|
789
|
-
[data-theme="dark"] .page-container input[type="date"] {
|
|
790
|
-
color-scheme: dark;
|
|
791
|
-
}
|
|
792
|
-
`})]})}function s1({size:e=16,x:t,y:n,style:r,className:i,title:a}){return o.jsxs("svg",{viewBox:"0 0 24 24",width:e,height:e,x:t,y:n,style:r,className:i,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":a??"Claude Code",children:[o.jsx("title",{children:a??"Claude Code"}),o.jsx("path",{clipRule:"evenodd",d:"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z",fill:"#D97757",fillRule:"evenodd"})]})}function l1({size:e=16,x:t,y:n,style:r,className:i,title:a}){const l=`codex-grad-${f.useId().replace(/[:]/g,"")}`;return o.jsxs("svg",{viewBox:"0 0 24 24",width:e,height:e,x:t,y:n,style:r,className:i,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":a??"Codex",children:[o.jsx("title",{children:a??"Codex"}),o.jsx("path",{d:"M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z",fill:`url(#${l})`}),o.jsx("defs",{children:o.jsxs("linearGradient",{id:l,gradientUnits:"userSpaceOnUse",x1:"12",x2:"12",y1:"3",y2:"21",children:[o.jsx("stop",{stopColor:"#B1A7FF"}),o.jsx("stop",{offset:".5",stopColor:"#7A9DFF"}),o.jsx("stop",{offset:"1",stopColor:"#3941FF"})]})})]})}function KM({agent:e,...t}){return e==="codex"?o.jsx(l1,{...t}):o.jsx(s1,{...t})}const HM=f.createContext(null);function lae(){const e=f.useContext(HM);if(!e)throw new Error("useAgentNotifications must be used inside <AgentNotificationsProvider>");return e}function cae({children:e}){const[t,n]=f.useState(!1);f.useEffect(()=>{V.getAgentMapNotify().then(i=>n(!!i.enabled)).catch(()=>{})},[]);const r=f.useCallback(()=>{n(i=>{const a=!i;return V.setAgentMapNotify(a).catch(()=>{}),a})},[]);return o.jsx(HM.Provider,{value:{enabled:t,toggle:r},children:e})}const zi=1e3,$i=700,ip=36e5,c1=864e5,VM=.4,qM=4,u1={Read:"📖",Edit:"📝",Write:"📝",MultiEdit:"📝",Bash:"🔧",Glob:"🔍",Grep:"🔍",WebFetch:"🌐",WebSearch:"🌐",Agent:"🤖",Task:"🤖",NotebookEdit:"📓"},uae={active:"进行中",idle:"空闲",completed:"已完成",error:"异常"},UP=8,dae=96,WP=[{key:"all",label:"全部",ms:0},{key:"1h",label:"近 1 小时",ms:ip},{key:"6h",label:"近 6 小时",ms:6*ip},{key:"24h",label:"近 24 小时",ms:24*ip},{key:"7d",label:"近 7 天",ms:7*c1}];function KP(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}const fo=[[0,20],[2/24,60],[1,420],[5,620],[10,760],[30,860]],pae=[{days:1,r:420,tier:0,label:"1 天"},{days:5,r:620,tier:1,label:"5 天"},{days:10,r:760,tier:2,label:"10 天"}];function fae(e){if(!Number.isFinite(e)||e<=0)return fo[0][1];for(let t=1;t<fo.length;t++)if(e<=fo[t][0]){const[n,r]=fo[t-1],[i,a]=fo[t],s=(e-n)/(i-n);return r+(a-r)*s}return fo[fo.length-1][1]}function HP(e,t,n){const r=zi/2,i=$i/2,a=n-t,s=Number.isFinite(a)&&a>0?a/c1:0,l=fae(s),c=(KP(e)%360+(KP(e+"~j")%40-20))*(Math.PI/180);return{x:r+Math.cos(c)*l,y:i+Math.sin(c)*l}}function Ky(e){const t=Date.now()-e;return t<6e4?`${Math.floor(t/1e3)}秒前`:t<36e5?`${Math.floor(t/6e4)}分钟前`:t<864e5?`${Math.floor(t/36e5)}小时前`:`${Math.floor(t/864e5)}天前`}function hae({item:e,pos:t,selected:n}){const r=e.requestCount||0,i=Math.min(r/100,1),a=UP+(dae-UP)*i,s=Math.round(a*.85);return o.jsxs("g",{transform:`translate(${t.x} ${t.y})`,className:`am-node am-node--${e.status}${n?" am-node--selected":""}`,"data-sid":e.sessionId,children:[o.jsx("circle",{r:a+6,className:"am-node-glow"}),o.jsx("circle",{r:a,className:"am-node-circle",vectorEffect:"non-scaling-stroke"}),e.agent==="codex"?o.jsx(l1,{size:s,x:-s/2,y:-s/2}):o.jsx(s1,{size:s,x:-s/2,y:-s/2}),o.jsx("text",{textAnchor:"middle",dy:a+16,className:"am-node-title",children:(e.title||e.sessionId.slice(-8)).slice(0,18)}),o.jsx("text",{textAnchor:"middle",dy:a+32,className:"am-node-activity",children:e.lastToolName?`${u1[e.lastToolName]||"•"} ${e.lastToolName}`:(e.lastActivitySummary||"").slice(0,20)||Ky(e.lastRequestAt)}),e.source==="access-key"&&o.jsxs("text",{textAnchor:"middle",dy:a+48,className:"am-node-source",children:["🔑 ",e.keyName||"key"]})]})}function mae({view:e,onView:t}){const n=i=>{const a=zi/2,s=$i/2,{zoom:l,panX:c,panY:u}=e,p=Math.min(qM,Math.max(VM,l*i)),d=(a-c)/l,h=(s-u)/l;t({zoom:p,panX:a-d*p,panY:s-h*p})},r=Math.round(e.zoom*100);return o.jsxs("div",{className:"am-zoom",children:[o.jsx("button",{className:"am-zoom-btn",onClick:()=>n(1/1.2),title:"缩小",children:"−"}),o.jsxs("span",{className:"am-zoom-pct",children:[r,"%"]}),o.jsx("button",{className:"am-zoom-btn",onClick:()=>n(1.2),title:"放大",children:"+"}),o.jsx("button",{className:"am-zoom-btn",onClick:()=>t({zoom:1,panX:0,panY:0}),title:"重置缩放",children:"⟲"})]})}function gae(e,t,n,r){const a=Math.max(1,n-t)/r,s=new Array(r).fill(0);for(const l of e){if(l.ts<t||l.ts>n)continue;let c=Math.floor((l.ts-t)/a);c<0&&(c=0),c>=r&&(c=r-1),s[c]++}return s.map((l,c)=>({index:c,start:t+c*a,end:t+(c+1)*a,count:l}))}function VP(e,t){const n=new Date(e);return t<=c1?`${n.getHours().toString().padStart(2,"0")}:00`:`${n.getMonth()+1}/${n.getDate()}`}function vae(e){if(e.length===0)return"";if(e.length===1)return`M ${e[0].x} ${e[0].y}`;const t=[`M ${e[0].x} ${e[0].y}`];for(let n=0;n<e.length-1;n++){const r=e[n-1]||e[n],i=e[n],a=e[n+1],s=e[n+2]||a,l=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,u=a.x-(s.x-i.x)/6,p=a.y-(s.y-i.y)/6;t.push(`C ${l.toFixed(2)} ${c.toFixed(2)}, ${u.toFixed(2)} ${p.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`)}return t.join(" ")}function yae({events:e,start:t,end:n}){const c=f.useMemo(()=>gae(e,t,n,28),[e,t,n]).map(y=>y.count),u=Math.max(1,...c),p=c.reduce((y,x)=>y+x,0),d=n-t,h=c.map((y,x)=>({x:c.length===1?220/2:x/(c.length-1)*218+1,y:41-y/u*(44-2*3)})),m=vae(h),g=h.length>0?`${m} L ${h[h.length-1].x.toFixed(2)} 44 L ${h[0].x.toFixed(2)} 44 Z`:"";return o.jsxs("div",{className:"am-trend",title:`区间内活动趋势:共 ${p} 次活动`,children:[o.jsx("span",{className:"am-trend-label",children:"活动趋势"}),o.jsxs("svg",{className:"am-trend-svg",viewBox:"0 0 220 44",preserveAspectRatio:"none",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"am-trend-grad",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:"var(--accent-primary)",stopOpacity:"0.35"}),o.jsx("stop",{offset:"100%",stopColor:"var(--accent-primary)",stopOpacity:"0.02"})]})}),g&&o.jsx("path",{d:g,fill:"url(#am-trend-grad)",stroke:"none"}),m&&o.jsx("path",{d:m,fill:"none",stroke:"var(--accent-primary)",strokeWidth:"1.5",vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round"})]}),o.jsxs("span",{className:"am-trend-axis",children:[VP(t,d)," – ",VP(n,d)]})]})}function xae({events:e}){if(e.length===0)return o.jsx("div",{className:"am-empty",children:"暂无活动记录(发起一次请求后会出现)"});const t=[...e].sort((r,i)=>i.ts-r.ts),n=[];for(const r of t){const i=`${r.kind}|${r.toolName||""}|${r.summary||""}`,a=n[n.length-1];if(a&&a.key===i){a.count+=1;continue}n.push({key:i,kind:r.kind,toolName:r.toolName,summary:r.summary||r.kind,count:1,ts:r.ts})}return o.jsx("div",{className:"am-path",children:n.map((r,i)=>{const a=r.kind==="prompt"?"💬":r.kind==="thinking"?"💭":r.kind==="error"?"⚠️":r.kind==="cancelled"?"🚫":r.kind==="response"?"💬":u1[r.toolName||""]||"•";return o.jsxs("div",{className:`am-path-item am-path-item--${r.kind}`,children:[o.jsxs("div",{className:"am-path-rail",children:[o.jsx("div",{className:"am-path-dot"}),i<n.length-1&&o.jsx("div",{className:"am-path-line"})]}),o.jsxs("div",{className:"am-path-body",children:[o.jsxs("div",{className:"am-path-head",children:[o.jsx("span",{className:"am-path-icon",children:a}),o.jsx("span",{className:"am-path-summary",children:r.summary}),o.jsx("span",{className:"am-path-time",children:new Date(r.ts).toLocaleTimeString()}),r.count>1&&o.jsxs("span",{className:"am-path-count",children:["×",r.count]})]}),r.kind==="prompt"&&o.jsx("div",{className:"am-path-prompt",children:r.summary})]})]},r.key+i)})})}function bae({events:e,onSelectSession:t}){return e.length===0?o.jsx("div",{className:"am-feed-empty",children:"等待实时活动…"}):o.jsx("div",{className:"am-feed",children:e.slice(0,80).map(n=>o.jsxs("div",{className:`am-feed-row am-feed-row--${n.kind}${t?" am-feed-row--clickable":""}`,onClick:t?()=>t(n.sessionId):void 0,title:t?"点击定位到地图节点并展开详情":void 0,children:[o.jsx("span",{className:"am-feed-time",children:new Date(n.ts).toLocaleTimeString()}),o.jsx(KM,{agent:n.agent,size:13,className:"am-feed-agent"}),o.jsx("span",{className:"am-feed-icon",children:n.kind==="prompt"?"💬":n.kind==="error"?"⚠️":n.kind==="cancelled"?"🚫":u1[n.toolName||""]||"•"}),o.jsx("span",{className:"am-feed-summary",children:n.summary})]},n.id))})}function Dt({icon:e,label:t,desc:n}){return o.jsxs("div",{className:"am-legend-row",children:[o.jsx("span",{className:"am-legend-ic",children:e}),o.jsxs("span",{className:"am-legend-text",children:[o.jsx("span",{className:"am-legend-label",children:t}),o.jsx("span",{className:"am-legend-desc",children:n})]})]})}function ho({title:e,children:t}){return o.jsxs("div",{className:"am-legend-group",children:[o.jsx("div",{className:"am-legend-group-title",children:e}),t]})}function jae({onClose:e}){return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"am-popover-overlay",onClick:e}),o.jsxs("div",{className:"am-popover am-popover--wide",children:[o.jsxs("div",{className:"am-popover-head",children:[o.jsx("span",{children:"🗺️ 地图符号说明"}),o.jsx("button",{className:"am-popover-close",onClick:e,"aria-label":"关闭",children:"×"})]}),o.jsxs("div",{className:"am-popover-body am-legend-grid",children:[o.jsxs("div",{className:"am-legend-col",children:[o.jsxs(ho,{title:"客户端类型(节点中心图标)",children:[o.jsx(Dt,{icon:o.jsx(s1,{size:16}),label:"Claude Code",desc:"该 Session 来自 Claude Code 客户端"}),o.jsx(Dt,{icon:o.jsx(l1,{size:16}),label:"Codex",desc:"该 Session 来自 Codex 客户端"})]}),o.jsxs(ho,{title:"节点状态(外环颜色 + 光晕)",children:[o.jsx(Dt,{icon:o.jsx("i",{className:"am-dot am-dot--active"}),label:"进行中",desc:"最近 60 秒内有请求,或有在途请求(脉冲发光)"}),o.jsx(Dt,{icon:o.jsx("i",{className:"am-dot am-dot--idle"}),label:"空闲",desc:"超过 60 秒无新请求,但 10 分钟内有过活动"}),o.jsx(Dt,{icon:o.jsx("i",{className:"am-dot am-dot--completed"}),label:"已完成",desc:"超过 10 分钟无活动,且末轮正常结束(变暗、虚线)"}),o.jsx(Dt,{icon:o.jsx("i",{className:"am-dot am-dot--error"}),label:"异常",desc:"末次请求失败(上游 5xx),红色脉冲"})]}),o.jsxs(ho,{title:"距离分档(同心圆)",children:[o.jsx(Dt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"var(--accent-success)"}}),label:"1 天临界",desc:"圈内在 1 天内开始的会话;圈外是更早(1 天以上)的会话"}),o.jsx(Dt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"var(--accent-warning)"}}),label:"5 天临界",desc:"1–5 天前开始的会话落在本圈与 1 天圈之间"}),o.jsx(Dt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"#6BA8E5"}}),label:"10 天临界(最外圈)",desc:"5–10 天前开始的会话落在本圈与 5 天圈之间;超过 10 天的会话落在本圈之外(最外围)"})]})]}),o.jsxs("div",{className:"am-legend-col",children:[o.jsxs(ho,{title:"节点装饰",children:[o.jsx(Dt,{icon:o.jsx("span",{children:"🔑"}),label:"接入密钥来源",desc:"节点下方钥匙标记,走 AccessKey 接入密钥流量"}),o.jsx(Dt,{icon:o.jsx("span",{className:"am-ic-center"}),label:"中心点",desc:"画布中心圆点,进行中节点会与它连线"})]}),o.jsxs(ho,{title:"节点位置与尺寸",children:[o.jsx(Dt,{icon:o.jsx("span",{children:"🎯"}),label:"距中心距离 = 会话开始时间",desc:"以会话开始时间(firstRequestAt)按龄分档:1 天内居内侧(分布最宽),1–5 天、5–10 天依次外扩,10 天以上在最外围(缩到约 40% 可见)。内圈带宽最大、越往外越紧凑,落定后不漂移"}),o.jsx(Dt,{icon:o.jsx("span",{children:"🔵"}),label:"节点大小 = 对话轮数",desc:"默认较小,仅随对话轮数(requestCount)增长并封顶,越大代表历史对话轮数越多"})]}),o.jsxs(ho,{title:"操作",children:[o.jsx(Dt,{icon:o.jsx("span",{className:"am-ic-mouse",children:"🖱"}),label:"缩放 / 平移",desc:"滚轮缩放(光标处为锚点);在节点或空白处按下拖拽即可平移画布,短按选中节点"}),o.jsx(Dt,{icon:o.jsx("span",{className:"am-ic-chart",children:"📈"}),label:"时间筛选",desc:"点 topbar「时间筛选」按预设区间过滤;趋势曲线仅作参考"})]})]}),o.jsx("div",{className:"am-legend-col",children:o.jsxs(ho,{title:"活动路径 / 活动流图标",children:[o.jsx(Dt,{icon:o.jsx("span",{children:"💬"}),label:"提问 / 回复",desc:"用户提问或模型回复"}),o.jsx(Dt,{icon:o.jsx("span",{children:"💭"}),label:"思考",desc:"模型推理思考过程"}),o.jsx(Dt,{icon:o.jsx("span",{children:"⚠️"}),label:"错误",desc:"请求失败"}),o.jsx(Dt,{icon:o.jsx("span",{children:"📖"}),label:"Read",desc:"读取文件"}),o.jsx(Dt,{icon:o.jsx("span",{children:"📝"}),label:"Edit / Write",desc:"编辑 / 写入文件"}),o.jsx(Dt,{icon:o.jsx("span",{children:"🔧"}),label:"Bash",desc:"执行终端命令"}),o.jsx(Dt,{icon:o.jsx("span",{children:"🔍"}),label:"Grep / Glob",desc:"搜索内容 / 匹配文件"}),o.jsx(Dt,{icon:o.jsx("span",{children:"🌐"}),label:"WebFetch / WebSearch",desc:"抓取网页 / 联网搜索"}),o.jsx(Dt,{icon:o.jsx("span",{children:"🤖"}),label:"Agent / Task",desc:"调用子 Agent"})]})})]})]})]})}function wae(){const[e,t]=f.useState(new Map),[n,r]=f.useState([]),[i,a]=f.useState(null),[s,l]=f.useState(null),[c,u]=f.useState([]),[p,d]=f.useState(null),[h,m]=f.useState([]),[g,y]=f.useState(!1),[x,v]=f.useState(null),[b,j]=f.useState({loading:!1}),[w,k]=f.useState(!0),S=f.useCallback(()=>k(Q=>!Q),[]),[E,A]=f.useState(!1),[D,T]=f.useState(!1),{enabled:I,toggle:_}=lae(),[G,K]=f.useState(!1),[O,B]=f.useState(!1),[W,R]=f.useState({zoom:1,panX:0,panY:0}),$=f.useRef(W);$.current=W;const[P,F]=f.useState("all"),re=f.useRef(null),N=f.useRef(null);f.useEffect(()=>{const Q=V.streamAgentMap({onInit:ue=>{K(!0);const Se=new Map;for(const je of ue.sessions)Se.set(je.sessionId,je);t(Se),r(ue.events),a(ue.stats)},onSessionUpdate:ue=>{t(Se=>{const je=new Map(Se);return je.set(ue.sessionId,ue),je})},onActivity:ue=>{r(Se=>[ue,...Se].slice(0,500))},onStats:ue=>a(ue),onError:()=>K(!1)});return()=>Q.abort()},[]);const pe=f.useCallback(async Q=>{try{const ue=await V.getAgentMapSessionEvents(Q);u(ue)}catch{u([])}},[]),ve=f.useCallback(async(Q,ue,Se)=>Q==="access-key"&&Se?V.getAccessKeySessionLogs(Se,ue,1e4):V.getSessionLogs(ue,1e4),[]),X=f.useCallback(Q=>{const ue=Q.source==="access-key"?"access-key":"global";d({id:Q.sessionId,targetType:Q.agent,title:Q.title,firstRequestAt:Q.firstRequestAt,lastRequestAt:Q.lastRequestAt,requestCount:Q.requestCount,totalTokens:Q.totalTokens}),m([]),v({source:ue,keyId:Q.keyId,sessionId:Q.sessionId}),y(!0),ve(ue,Q.sessionId,Q.keyId).then(Se=>m(Se)).catch(Se=>console.error("Failed to load session logs:",Se)).finally(()=>y(!1))},[ve]),oe=f.useCallback(()=>{d(null),m([]),v(null),y(!1)},[]);f.useEffect(()=>{s?pe(s):u([])},[s,pe]);const de=s?e.get(s):null;f.useEffect(()=>{s&&pe(s)},[de==null?void 0:de.lastRequestAt]),f.useEffect(()=>{if(!s){j({loading:!1});return}const Q=e.get(s);if(!Q){j({loading:!1});return}if(Q.source==="access-key"){j({loading:!1,unavailable:!0});return}if(Q.projectPath){j({loading:!1,projectPath:Q.projectPath});return}j({loading:!0});let ue=!0;return V.getAgentMapSessionMeta(s).then(Se=>{ue&&j({loading:!1,projectPath:Se.projectPath})}).catch(()=>{ue&&j({loading:!1})}),()=>{ue=!1}},[s,de==null?void 0:de.projectPath]);const ie=f.useCallback((Q,ue)=>{const Se=re.current;if(!Se)return null;const je=Se.getScreenCTM();if(!je)return null;const ze=Se.createSVGPoint();ze.x=Q,ze.y=ue;const We=ze.matrixTransform(je.inverse());return{x:We.x,y:We.y}},[]);f.useEffect(()=>{const Q=re.current;if(!Q)return;const ue=Se=>{Se.preventDefault();const je=ie(Se.clientX,Se.clientY);if(!je)return;const{zoom:ze,panX:We,panY:Ge}=$.current,H=Se.deltaY<0?1.15:1/1.15,he=Math.min(qM,Math.max(VM,ze*H)),we=(je.x-We)/ze,Ae=(je.y-Ge)/ze;R({zoom:he,panX:je.x-we*he,panY:je.y-Ae*he})};return Q.addEventListener("wheel",ue,{passive:!1}),()=>Q.removeEventListener("wheel",ue)},[ie,e.size]);const J=f.useRef(null),xe=Q=>{var ze,We;if(Q.button!==0)return;B(!0);let ue=Q.target,Se=null;for(;ue&&ue!==Q.currentTarget;){const Ge=ue.getAttribute&&ue.getAttribute("data-sid");if(Ge){Se=Ge;break}ue=ue.parentElement}const je=ie(Q.clientX,Q.clientY);J.current={startClient:{x:Q.clientX,y:Q.clientY},startVB:je||{x:0,y:0},panX:$.current.panX,panY:$.current.panY,moved:!1,sid:Se},(We=(ze=Q.currentTarget).setPointerCapture)==null||We.call(ze,Q.pointerId)},ae=Q=>{const ue=J.current;if(!ue)return;!ue.moved&&Math.hypot(Q.clientX-ue.startClient.x,Q.clientY-ue.startClient.y)>5&&(ue.moved=!0,l(null));const Se=ie(Q.clientX,Q.clientY);Se&&R(je=>({...je,panX:ue.panX+(Se.x-ue.startVB.x),panY:ue.panY+(Se.y-ue.startVB.y)}))},Me=()=>{B(!1);const Q=J.current;J.current=null,!(!Q||Q.moved)&&l(Q.sid)},se=()=>{J.current||B(!1)},Le=f.useMemo(()=>Array.from(e.values()),[e]),$e=Math.floor(Date.now()/3e4)*3e4,Ye=WP.find(Q=>Q.key===P).ms,lt=P!=="all",Ve=f.useMemo(()=>P==="all"?null:{start:$e-Ye,end:$e},[P,$e,Ye]),rt=f.useMemo(()=>Ve?Le.filter(Q=>Q.lastRequestAt>=Ve.start&&Q.lastRequestAt<=Ve.end):Le,[Le,Ve]),ke=f.useMemo(()=>{const Q={};for(const ue of rt)Q[ue.sessionId]=HP(ue.sessionId,ue.firstRequestAt,$e);return Q},[rt,$e]),De=f.useCallback(Q=>{const ue=e.get(Q);if(!ue)return;l(Q),F("all");const Se=HP(Q,ue.firstRequestAt,Date.now());R(je=>({zoom:je.zoom,panX:zi/2-Se.x*je.zoom,panY:$i/2-Se.y*je.zoom}))},[e]),Fe=f.useRef(null),[Ze,Z]=f.useState({visibility:"hidden"}),[Y,ce]=f.useState("right"),[M,fe]=f.useState(0);f.useEffect(()=>{const Q=()=>fe(ue=>(ue+1)%1e6);return window.addEventListener("resize",Q),window.addEventListener("scroll",Q,!0),()=>{window.removeEventListener("resize",Q),window.removeEventListener("scroll",Q,!0)}},[]),f.useLayoutEffect(()=>{if(!s)return;const Q=Fe.current,ue=N.current,Se=re.current;if(!Q||!ue||!Se)return;const je=ke[s];if(!je)return;const ze=ue.getScreenCTM();if(!ze)return;const We=Se.createSVGPoint();We.x=je.x,We.y=je.y;const Ge=We.matrixTransform(ze),H=Q.getBoundingClientRect(),he=10,we=16,Ae=30,Re=window.innerWidth,qe=window.innerHeight;let Xe="right",et;Ge.x+Ae+we+H.width<=Re-he?(et=Ge.x+Ae+we,Xe="right"):Ge.x-Ae-we-H.width>=he?(et=Ge.x-Ae-we-H.width,Xe="left"):et=Math.max(he,Math.min(Ge.x,Re-H.width-he));let ct=Ge.y-H.height/2;ct=Math.max(he,Math.min(ct,qe-H.height-he)),ce(Xe),Z({left:et,top:ct,visibility:"visible"})},[s,ke,W,e,c,M]);const ge=n.length?n[n.length-1].ts:$e,Te=P==="all"?Math.min(ge,$e-24*ip):$e-Ye,Ee=$e;return o.jsxs("div",{className:"am-page",children:[o.jsxs("div",{className:"am-header",children:[o.jsxs("div",{className:"am-title",children:[o.jsx("h2",{children:"🗺️ 任务雷达"}),o.jsx("span",{className:`am-conn${G?" am-conn--on":""}`,children:G?"● 实时":"○ 连接中"})]}),o.jsxs("div",{className:"am-stats",children:[o.jsxs("span",{className:"am-stat am-stat--active",children:["进行中 ",o.jsx("b",{children:(i==null?void 0:i.activeSessions)??0})]}),o.jsxs("span",{className:"am-stat am-stat--idle",children:["空闲 ",o.jsx("b",{children:(i==null?void 0:i.idleSessions)??0})]}),o.jsxs("span",{className:"am-stat am-stat--completed",children:["已完成 ",o.jsx("b",{children:(i==null?void 0:i.completedSessions)??0})]}),o.jsxs("span",{className:"am-stat am-stat--error",children:["异常 ",o.jsx("b",{children:(i==null?void 0:i.errorSessions)??0})]}),o.jsxs("span",{className:"am-stat",children:["在途 ",o.jsx("b",{children:(i==null?void 0:i.inFlightRequests)??0})]}),o.jsxs("span",{className:"am-stat",children:["显示 ",o.jsx("b",{children:rt.length}),"/",Le.length]})]}),o.jsxs("div",{className:"am-actions",children:[o.jsxs("button",{className:"am-btn am-toggle-btn",onClick:()=>{T(Q=>!Q),A(!1)},title:D?"收起时间筛选":"展开时间筛选",children:[o.jsx("span",{children:"时间筛选"}),o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.18s",transform:D?"rotate(180deg)":"none"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),o.jsxs("button",{className:"am-btn am-toggle-btn",onClick:()=>{A(Q=>!Q),T(!1)},title:"符号说明",children:[o.jsx("span",{children:"符号说明"}),o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.18s",transform:E?"rotate(180deg)":"none"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),o.jsxs("div",{className:"am-notify-switch",title:I?"已开启:本页处于后台时,Agent 一轮工作结束会弹系统通知(服务端 OS 通知,浏览器关掉也能弹)":"开启:本页处于后台时,Agent 一轮工作结束会弹系统通知",children:[o.jsx(il,{checked:I,onChange:_,label:"🔔 通知",labelPosition:"left"}),I&&o.jsx("button",{type:"button",className:"am-notify-test",onClick:()=>V.testAgentMapNotify(),title:"发一条测试通知,验证系统是否真的弹(若没弹,请在系统设置里允许 AICodeSwitch/终端 的通知)",children:"测试"})]})]}),E&&o.jsx(jae,{onClose:()=>A(!1)})]}),D&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"am-popover-overlay",onClick:()=>T(!1)}),o.jsxs("div",{className:"am-popover am-popover--time",children:[o.jsxs("div",{className:"am-popover-head",children:[o.jsx("span",{children:"🕒 时间筛选"}),o.jsx("button",{className:"am-popover-close",onClick:()=>T(!1),"aria-label":"关闭",children:"×"})]}),o.jsxs("div",{className:"am-timefilter",children:[o.jsx("div",{className:"am-timepresets",children:WP.map(Q=>o.jsx("button",{className:`am-chip${P===Q.key?" am-chip--active":""}`,onClick:()=>F(Q.key),children:Q.label},Q.key))}),o.jsx(yae,{events:n,start:Te,end:Ee})]}),lt&&o.jsxs("div",{className:"am-timefilter-hint",children:["已筛选:",new Date(Ve.start).toLocaleString()," → 现在 · 显示 ",rt.length,"/",Le.length]})]})]}),o.jsxs("div",{className:"am-main",children:[o.jsxs("div",{className:"am-canvas-wrap",children:[Le.length===0?o.jsxs("div",{className:"am-empty-canvas",children:[o.jsx("div",{className:"am-empty-icon",children:"🌌"}),o.jsx("p",{children:"暂无 Session"}),o.jsx("p",{className:"am-empty-hint",children:"启动 Claude Code 或 Codex 开始编程,节点会实时出现在这里"})]}):o.jsxs("svg",{ref:re,className:"am-canvas",viewBox:`0 0 ${zi} ${$i}`,preserveAspectRatio:"xMidYMid meet",onPointerDown:xe,onPointerMove:ae,onPointerUp:Me,onPointerLeave:se,onPointerCancel:Me,style:{cursor:O?"grabbing":"grab",touchAction:"none"},children:[o.jsx("rect",{x:0,y:0,width:zi,height:$i,fill:"transparent"}),o.jsxs("g",{ref:N,transform:`translate(${W.panX} ${W.panY}) scale(${W.zoom})`,children:[o.jsx("circle",{cx:zi/2,cy:$i/2,r:4,className:"am-center-mark"}),pae.map(Q=>o.jsxs("g",{className:`am-ring am-ring--t${Q.tier}`,children:[o.jsx("circle",{cx:zi/2,cy:$i/2,r:Q.r,fill:"none"}),o.jsx("text",{x:zi/2,y:$i/2-Q.r-6,textAnchor:"middle",className:"am-ring-label",children:Q.label})]},`ring-${Q.days}`)),rt.filter(Q=>Q.status==="active").map(Q=>{const ue=ke[Q.sessionId];return ue?o.jsx("line",{x1:zi/2,y1:$i/2,x2:ue.x,y2:ue.y,className:"am-link am-link--active"},`l-${Q.sessionId}`):null}),[...rt].sort((Q,ue)=>{const Se=je=>je.status==="active"||je.status==="error"||je.sessionId===s?1:0;return Se(Q)-Se(ue)}).map(Q=>{const ue=ke[Q.sessionId];return ue?o.jsx(hae,{item:Q,pos:ue,selected:Q.sessionId===s},Q.sessionId):null})]})]}),o.jsxs("div",{className:"am-legend",children:[o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--active"})," 进行中"]}),o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--idle"})," 空闲"]}),o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--completed"})," 已完成"]}),o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--error"})," 异常"]})]}),o.jsx(mae,{view:W,onView:R})]}),o.jsxs("div",{className:"am-feed-wrap",children:[o.jsx("button",{className:"am-feed-toggle",onClick:S,title:w?"收起活动流":"展开活动流","aria-label":w?"收起活动流":"展开活动流",children:o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:w?o.jsx("polyline",{points:"9 18 15 12 9 6"}):o.jsx("polyline",{points:"15 18 9 12 15 6"})})}),w&&o.jsxs("aside",{className:"am-feed-sidebar",children:[o.jsxs("div",{className:"am-feed-head",children:[o.jsx("span",{children:"📜 全局活动流"}),o.jsx("span",{className:"am-feed-count",children:n.length})]}),o.jsx(bae,{events:n,onSelectSession:De})]})]})]}),de&&o.jsxs("div",{ref:Fe,className:`am-detail am-detail--popover am-detail--${Y}`,style:Ze,children:[o.jsxs("div",{className:"am-detail-head",children:[o.jsxs("span",{className:`am-badge am-badge--${de.status}`,children:[o.jsx(KM,{agent:de.agent,size:14})," ",uae[de.status]]}),o.jsx("button",{className:"am-detail-close",onClick:()=>l(null),children:"×"})]}),o.jsx("h3",{className:"am-detail-title",children:de.title||de.sessionId}),o.jsxs("div",{className:"am-detail-meta",children:[o.jsxs("div",{children:["请求轮次:",o.jsx("b",{children:de.requestCount})]}),o.jsxs("div",{children:["累计 Tokens:",o.jsx("b",{children:de.totalTokens.toLocaleString()})]}),o.jsxs("div",{children:["最近模型:",o.jsx("b",{children:de.lastModel||"-"})]}),o.jsxs("div",{className:"am-detail-path",children:["项目路径:",b.projectPath?o.jsx("code",{title:b.projectPath,children:b.projectPath}):b.unavailable?o.jsx("span",{className:"am-detail-path-na",children:"接入密钥会话,无法读取本地项目信息"}):b.loading?o.jsx("span",{className:"am-detail-path-na",children:"解析中…"}):o.jsx("span",{className:"am-detail-path-na",children:"未识别"})]}),o.jsxs("div",{children:["首/末:",o.jsx("b",{children:Ky(de.firstRequestAt)})," · ",o.jsx("b",{children:Ky(de.lastRequestAt)})]}),de.inFlight>0&&o.jsxs("div",{className:"am-detail-inflight",children:["● 正在处理 ",de.inFlight," 个请求…"]})]}),o.jsx("div",{className:"am-detail-section-title",children:"活动路径"}),o.jsx(xae,{events:c}),o.jsxs("div",{className:"am-detail-footer",children:[o.jsx("button",{className:"am-btn am-btn--ghost",onClick:()=>pe(de.sessionId),children:"刷新活动"}),o.jsx("button",{className:"am-btn am-btn--ghost",disabled:de.source==="access-key"&&!de.keyId,onClick:()=>X(de),children:"会话详情"})]})]}),p&&x&&o.jsx(i0,{session:p,logs:h,logsLoading:g,onRefreshLogs:async()=>{if(x){y(!0);try{const Q=await ve(x.source,x.sessionId,x.keyId);m(Q)}catch(Q){console.error("Failed to refresh session logs:",Q)}finally{y(!1)}}},onFetchNewLogs:async()=>{if(!x)return[];const Q=await ve(x.source,x.sessionId,x.keyId);return m(Q),Q},onClose:oe})]})}function Sae({output:e,onInput:t,readOnly:n=!0,placeholder:r="$ ",waitingForInput:i=!1}){const a=f.useRef(null),s=f.useRef(null),[l,c]=f.useState("");f.useEffect(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},[e,l]),f.useEffect(()=>{i&&!n&&s.current&&s.current.focus()},[i,n]);const u=p=>{if(p.key==="Enter"&&t){const d=l;d.trim()&&(t(d+`
|
|
793
|
-
`),c(""))}};return o.jsxs("div",{ref:a,style:{backgroundColor:"#1e1e1e",color:"#d4d4d4",fontFamily:'Consolas, "Courier New", monospace',fontSize:"14px",padding:"16px",borderRadius:"8px",overflow:"auto",maxHeight:"400px",minHeight:"200px",border:i?"2px solid #4ec9b0":"1px solid #3e3e3e",cursor:"text",transition:"border-color 0.3s"},children:[e.map((p,d)=>o.jsx("div",{style:{marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:p},d)),!n&&t&&o.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:"8px"},children:[o.jsx("span",{style:{marginRight:"8px",color:"#4ec9b0"},children:r}),o.jsx("input",{ref:s,type:"password",value:l,onChange:p=>c(p.target.value),onKeyDown:u,style:{backgroundColor:"transparent",border:"none",color:"#d4d4d4",fontFamily:'Consolas, "Courier New", monospace',fontSize:"14px",outline:"none",flex:1},autoFocus:!0,placeholder:i?"请输入密码...":""})]}),i&&o.jsx("div",{style:{marginTop:"8px",fontSize:"12px",color:"#4ec9b0"},children:"💡 请输入您的系统密码以继续安装"})]})}function kae({status:e,onClose:t,onInstallComplete:n}){const[r,i]=f.useState("idle"),[a,s]=f.useState(null),[l,c]=f.useState([]),[u,p]=f.useState(""),[d,h]=f.useState(!1),m=f.useRef(null);f.useEffect(()=>()=>{m.current&&m.current()},[]);const g=f.useCallback(()=>{i("idle"),s(null),c([]),p(""),h(!1)},[]),y=f.useCallback(A=>{const D=A==="claude-code"?"@anthropic-ai/claude-code":"@openai/codex",T=window.navigator.platform;let I=[];return T.includes("Win")?I=["打开命令提示符(CMD)或 PowerShell","执行以下命令:",`npm install -g ${D}`]:I=["打开终端","执行以下命令(需要输入管理员密码):",`sudo npm install -g ${D}`,"输入您的系统密码"],I},[]),x=f.useCallback(A=>{if(r!=="installing"){console.log(`[Frontend] 开始安装 ${A}`),s(A),i("installing"),p(""),h(!1),c([`正在连接到服务器...
|
|
794
|
-
`,`准备安装 ${A==="claude-code"?"Claude Code":"Codex"}...
|
|
795
|
-
`,`请稍候...
|
|
796
|
-
`]);try{m.current=V.installTool(A,{onStdout:T=>{console.log("[Frontend] stdout:",T),c(I=>[...I,T])},onStderr:T=>{console.log("[Frontend] stderr:",T),c(I=>[...I,T]),(T.includes("password")||T.includes("Password")||T.includes("密码"))&&h(!0)},onClose:(T,I)=>{console.log(`[Frontend] 安装完成,退出码: ${T}, 成功: ${I}`),h(!1),c(_=>[..._,I?`
|
|
797
|
-
✓ 安装成功!`:`
|
|
798
|
-
✗ 安装失败 (退出码: ${T})`]),i(I?"completed":"error"),p(I?"":`安装失败,退出码: ${T}`),I&&setTimeout(()=>{n()},1500)},onError:T=>{console.error("[Frontend] 安装错误:",T),c(I=>[...I,`[ERROR] ${T}`]),h(!1),i("error"),p(T)}});const D=setTimeout(()=>{i(T=>T==="installing"&&l.length<=3?(console.error("[Frontend] 连接超时"),c(I=>[...I,`
|
|
799
|
-
[ERROR] 连接服务器超时!`]),p("连接服务器超时"),"error"):T)},15e3);m.current||(m.current=()=>clearTimeout(D))}catch(D){console.error("[Frontend] 启动安装失败:",D),c(T=>[...T,`[ERROR] 启动安装失败: ${D}`]),i("error"),p(String(D))}}},[r,n]),v=f.useCallback(A=>{var D;console.log("[Frontend] 发送用户输入:",A.slice(0,10)),(D=m.current)!=null&&D.sendInput&&(m.current.sendInput(A),c(T=>[...T,`
|
|
800
|
-
$ ${"•".repeat(A.length)}
|
|
801
|
-
`]),h(!1))},[]),b=!e.claudeCode.installed||!e.codex.installed,j=r==="idle",w=r==="installing",k=r==="completed",S=r==="error",E=a?y(a):[];return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",disabled:w,style:w?{opacity:.3,cursor:"not-allowed"}:void 0,children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"800px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"🔧 工具安装检测"})}),o.jsxs("div",{style:{padding:"20px 0"},children:[j&&o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6",color:"var(--text-secondary)"},children:"检测到您的系统中缺少以下 AI 编程工具。"}),o.jsxs("div",{style:{marginBottom:"20px"},children:[o.jsx("div",{style:{padding:"12px",marginBottom:"12px",borderRadius:"6px",backgroundColor:e.claudeCode.installed?"#f0fdf4":"#fef3c7",border:`1px solid ${e.claudeCode.installed?"#86efac":"#fbbf24"}`},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:"500",marginBottom:"4px"},children:["Claude Code ",e.claudeCode.installed&&`(${e.claudeCode.version})`]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:e.claudeCode.installed?"✓ 已安装":"✗ 未安装"})]}),!e.claudeCode.installed&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>x("claude-code"),disabled:w,style:{fontSize:"13px",padding:"6px 12px"},children:"安装"})]})}),o.jsx("div",{style:{padding:"12px",borderRadius:"6px",backgroundColor:e.codex.installed?"#f0fdf4":"#fef3c7",border:`1px solid ${e.codex.installed?"#86efac":"#fbbf24"}`},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:"500",marginBottom:"4px"},children:["Codex ",e.codex.installed&&`(${e.codex.version})`]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:e.codex.installed?"✓ 已安装":"✗ 未安装"})]}),!e.codex.installed&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>x("codex"),disabled:w,style:{fontSize:"13px",padding:"6px 12px"},children:"安装"})]})})]}),b&&o.jsxs("div",{style:{padding:"12px",borderRadius:"6px",backgroundColor:"#fffbeb",border:"1px solid #fbbf24",fontSize:"13px",lineHeight:"1.6"},children:[o.jsx("strong",{children:"⚠️ 注意:"}),o.jsxs("ul",{style:{margin:"8px 0 0 0",paddingLeft:"20px"},children:[o.jsx("li",{children:"在 macOS 和 Linux 上安装需要管理员权限,可能需要输入 sudo 密码"}),o.jsx("li",{children:"如果提示输入密码,请在下方的终端输入框中输入"}),o.jsx("li",{children:"Windows 用户通常会自动完成安装"}),o.jsx("li",{children:"安装过程可能需要几分钟时间,请耐心等待"})]})]})]}),(w||S)&&o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6"},children:S?o.jsxs(o.Fragment,{children:["安装 ",o.jsx("strong",{children:a==="claude-code"?"Claude Code":"Codex"})," 时出错"]}):o.jsxs(o.Fragment,{children:["正在安装 ",o.jsx("strong",{children:a==="claude-code"?"Claude Code":"Codex"}),"..."]})}),o.jsx(Sae,{output:l,readOnly:!1,onInput:v,waitingForInput:d,placeholder:d?"密码:":"$ "}),S&&E.length>0&&o.jsxs("div",{style:{marginTop:"16px",padding:"16px",borderRadius:"6px",backgroundColor:"#f0f9ff",border:"1px solid #7dd3fc"},children:[o.jsx("div",{style:{fontWeight:"600",marginBottom:"12px",color:"#0369a1"},children:"📖 手动安装步骤"}),o.jsx("ol",{style:{margin:0,paddingLeft:"20px",lineHeight:"1.8"},children:E.map((A,D)=>o.jsx("li",{style:{marginBottom:D<E.length-1?"8px":"0"},children:A},D))}),o.jsx("div",{style:{marginTop:"12px",fontSize:"13px",color:"#0369a1"},children:"💡 如果自动安装失败,您可以在终端中手动执行上述命令来安装工具。"})]}),S&&u&&o.jsxs("div",{style:{marginTop:"12px",padding:"12px",borderRadius:"6px",backgroundColor:"#fee",border:"1px solid #fcc",fontSize:"13px"},children:[o.jsx("strong",{children:"错误:"})," ",u]})]}),k&&o.jsxs("div",{style:{padding:"20px",borderRadius:"6px",backgroundColor:"#f0fdf4",border:"1px solid #86efac",textAlign:"center"},children:[o.jsx("div",{style:{fontSize:"48px",marginBottom:"12px"},children:"✓"}),o.jsx("div",{style:{fontWeight:"500",marginBottom:"8px"},children:"安装完成!"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"您现在可以正常使用 AI Code Switch 了"})]})]}),j&&o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"稍后安装"}),o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>{e.claudeCode.installed?e.codex.installed||x("codex"):x("claude-code")},disabled:e.claudeCode.installed&&e.codex.installed,children:"一键安装所需工具"})]}),k&&o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:t,children:"完成"})}),S&&o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"关闭"}),o.jsx("button",{type:"button",className:"btn btn-primary",onClick:g,children:"重试"})]})]})}),o.jsx("style",{children:`
|
|
802
|
-
@keyframes spin {
|
|
803
|
-
0% { transform: rotate(0deg); }
|
|
804
|
-
100% { transform: rotate(360deg); }
|
|
805
|
-
}
|
|
806
|
-
`})]})}function Cae({toolName:e="both",onInstallClick:t,onClose:n}){const[r,i]=f.useState(!1),a=()=>{i(!0),setTimeout(()=>{n()},300)},s=()=>e==="claude-code"?"Claude Code":e==="codex"?"Codex":"Claude Code / Codex";return o.jsx("div",{className:`notification-bar ${r?"notification-bar-closing":""}`,style:{position:"fixed",top:"20px",right:"20px",backgroundColor:"#fef3c7",border:"1px solid #fbbf24",borderRadius:"8px",padding:"16px 20px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,maxWidth:"400px",transition:"all 0.3s ease",opacity:r?0:1,transform:r?"translateX(100%)":"translateX(0)"},children:o.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[o.jsx("div",{style:{fontSize:"24px",flexShrink:0},children:"⚠️"}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:"600",marginBottom:"4px",fontSize:"15px"},children:"工具未安装"}),o.jsxs("div",{style:{fontSize:"13px",color:"#666",marginBottom:"12px",lineHeight:"1.5"},children:["检测到您的系统中缺少 ",o.jsx("strong",{children:s()}),"。"]}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[o.jsx("button",{type:"button",className:"btn btn-primary",onClick:t,style:{fontSize:"13px",padding:"6px 14px"},children:"立即安装"}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:a,style:{fontSize:"13px",padding:"6px 14px"},children:"稍后"})]})]}),o.jsx("button",{type:"button",onClick:a,style:{background:"none",border:"none",fontSize:"20px",color:"#999",cursor:"pointer",padding:"0",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="#f0f0f0"},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="transparent"},children:"×"})]})})}function qr({children:e,text:t,showTooltip:n}){const[r,i]=f.useState(!1),[a,s]=f.useState(null),l=f.useRef(null),c=()=>{if(n){if(l.current){const p=l.current.getBoundingClientRect();s({left:p.right+12,top:p.top+p.height/2})}i(!0)}},u=()=>{i(!1)};return o.jsxs("div",{ref:l,className:"nav-item-with-tooltip",onMouseEnter:c,onMouseLeave:u,children:[e,n&&r&&a&&mu.createPortal(o.jsx("div",{className:"nav-tooltip",style:{left:a.left,top:a.top},children:t}),document.body)]})}const Pae=""+new URL("logo-CRx_w1Ov.png",import.meta.url).href,Eae=`升级到 v6.0.0 版本将会有破坏性影响,你需要注意:
|
|
807
|
-
|
|
808
|
-
* 我们升级了日志系统,以解决老的日志系统所带来的存储问题。新日志系统会迁移你的日志数据,但是,为了确保日志数据不丢失,我们会在下一个版本中才删除老的日志文件,这也就意味着你的电脑上可能同时存在两份日志文件,占用空间。为了节约你的电脑磁盘空间,你可以在运行一段时间感觉正常之后,删除 \`~/.aicodeswitch/fs-db/logs\` 目录来移除老的日志文件。
|
|
809
|
-
|
|
810
|
-
本次升级带来了新的大功能:
|
|
811
|
-
|
|
812
|
-
* 「任务雷达」功能,帮助你时刻掌握当前任务状态,历史任务分布,通过对任务雷达的分析,你可以掌握自己的编程习惯,从而作出适当的调整。
|
|
813
|
-
`;function Tae(){const e=Zf(),[t,n]=f.useState("light"),[r,i]=f.useState(!1),[a,s]=f.useState(!1),[l,c]=f.useState(!1),[u,p]=f.useState(!1),[d,h]=f.useState(!1),[m,g]=f.useState(null),[y,x]=f.useState(null),[v,b]=f.useState(!1),j=X8(),[w,k]=f.useState(!1),[S,E]=f.useState(!1),[A,D]=f.useState(""),[T,I]=f.useState(""),[_,G]=f.useState(!0),[K,O]=f.useState(!1),[B,W]=f.useState(""),[R,$]=f.useState(!1),[P,F]=f.useState(!1),[re,N]=f.useState(!1),[pe,ve]=f.useState(null),[X,oe]=f.useState(!1);f.useEffect(()=>{const ke=localStorage.getItem("theme")||"light";n(ke),document.documentElement.setAttribute("data-theme",ke),localStorage.getItem("sidebar-collapsed")==="true"&&p(!0)},[]),f.useEffect(()=>{const ke=async()=>{try{const Fe=await V.checkVersion();h(Fe.hasUpdate),g(Fe.latestVersion),x(Fe.currentVersion)}catch(Fe){console.error("Failed to check version:",Fe)}};ke();const De=setInterval(ke,6e4);return()=>clearInterval(De)},[]),f.useEffect(()=>{(async()=>{try{const De=await V.getAuthStatus();if(k(De.enabled),!De.enabled){E(!0),G(!1);return}if(!localStorage.getItem("auth_token")){G(!1);return}try{await V.getVendors(),E(!0)}catch{}}catch(De){console.error("Failed to check auth status:",De)}finally{G(!1)}})()},[]),f.useEffect(()=>{(async()=>{if(!R)try{const De=await V.getUpgrade();De.shouldShow&&De.content&&(W(De.content),O(!0)),$(!0)}catch(De){console.error("Failed to check upgrade:",De)}})()},[R]),f.useEffect(()=>{const ke=async()=>{if(X)return;if(localStorage.getItem("tools_install_completed")==="true"){oe(!0);return}try{const Fe=await V.getToolsStatus();ve(Fe),!Fe.claudeCode.installed||!Fe.codex.installed?N(!0):localStorage.setItem("tools_install_completed","true"),oe(!0)}catch(Fe){console.error("Failed to check tools status:",Fe),oe(!0)}};(!_&&S||!_&&!w)&&ke()},[X,_,S,w]),f.useEffect(()=>{(async()=>{try{(await V.getVendors()).length===0&&!a&&(i(!0),s(!0))}catch(De){console.error("Failed to check vendors:",De)}})()},[a]);const de=()=>{const ke=t==="light"?"dark":"light";n(ke),document.documentElement.setAttribute("data-theme",ke),localStorage.setItem("theme",ke)},ie=()=>{p(!u),localStorage.setItem("sidebar-collapsed",(!u).toString())},J=f.useRef(null),[xe,ae]=f.useState({scrollable:!1,atTop:!0,atBottom:!0});f.useEffect(()=>{const ke=J.current;if(!ke)return;const De=()=>{const Y=ke.scrollHeight-ke.clientHeight>2;ae({scrollable:Y,atTop:ke.scrollTop<=1,atBottom:ke.scrollTop+ke.clientHeight>=ke.scrollHeight-1})};De();let Fe=0;const Ze=()=>{cancelAnimationFrame(Fe),Fe=requestAnimationFrame(De)},Z=new ResizeObserver(Ze);return Z.observe(ke),ke.addEventListener("scroll",Ze,{passive:!0}),()=>{cancelAnimationFrame(Fe),Z.disconnect(),ke.removeEventListener("scroll",Ze)}},[w,u]);const Me=xe.scrollable,se=()=>{i(!1),e("/vendors")},Le=async()=>{try{await V.acknowledgeUpgrade()}catch(ke){console.error("Failed to acknowledge upgrade:",ke)}O(!1)},$e=()=>{N(!1)},Ye=()=>{N(!1),F(!0)},lt=()=>{F(!1)},Ve=async()=>{try{const ke=await V.getToolsStatus();ve(ke),ke.claudeCode.installed&&ke.codex.installed&&(localStorage.setItem("tools_install_completed","true"),N(!1)),setTimeout(()=>{F(!1),(!ke.claudeCode.installed||!ke.codex.installed)&&N(!0)},500)}catch(ke){console.error("Failed to refresh tools status:",ke)}},rt=async ke=>{if(ke.preventDefault(),I(""),!A.trim()){I("请输入鉴权码");return}try{const De=await V.login(A);localStorage.setItem("auth_token",De.token),E(!0),D("")}catch(De){De instanceof Error?I(De.message||"登录失败,请检查鉴权码"):I("登录失败,请检查鉴权码")}};return _?o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",fontSize:"18px",color:"var(--text-secondary)"},children:"加载中..."}):w&&!S?o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>{},"aria-label":"关闭",disabled:!0,style:{opacity:.3,cursor:"not-allowed"},children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"400px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"🔐 系统鉴权"})}),o.jsxs("form",{onSubmit:rt,children:[o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6",color:"var(--text-secondary)"},children:"系统已启用鉴权保护,请输入鉴权码以继续访问。"}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500"},children:"鉴权码"}),o.jsx("input",{type:"password",value:A,onChange:ke=>D(ke.target.value),placeholder:"请输入鉴权码",style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-color)",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box"},autoFocus:!0})]}),T&&o.jsx("div",{style:{padding:"10px 12px",backgroundColor:"#fee",border:"1px solid #fcc",borderRadius:"6px",color:"#c33",fontSize:"14px",marginBottom:"16px"},children:T})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%"},children:"登录"})})]})]})})]}):o.jsxs("div",{className:"app",children:[o.jsxs("nav",{className:`sidebar ${u?"collapsed":""}`,children:[o.jsxs("div",{className:"logo",children:[o.jsx("img",{src:Pae,alt:"AI Code Switch Logo",className:"logo-image"}),o.jsx("h2",{children:"AI Code Switch"})]}),o.jsxs("div",{className:"nav-menu-wrap",children:[o.jsxs("ul",{className:"nav-menu",ref:J,children:[o.jsx("li",{children:o.jsx(qr,{text:"路由管理",showTooltip:u,children:o.jsxs(Vr,{to:"/routes",children:[o.jsx("span",{className:"nav-icon",children:"🌏"}),o.jsx("span",{className:"nav-text",children:"路由管理"})]})})}),o.jsx("li",{children:o.jsx(qr,{text:"供应商管理",showTooltip:u,children:o.jsxs(Vr,{to:"/vendors",children:[o.jsx("span",{className:"nav-icon",children:"🏭"}),o.jsx("span",{className:"nav-text",children:"供应商管理"})]})})}),o.jsx("li",{children:o.jsx(qr,{text:"Skills 管理",showTooltip:u,children:o.jsxs(Vr,{to:"/skills",children:[o.jsx("span",{className:"nav-icon",children:"🧩"}),o.jsx("span",{className:"nav-text",children:"Skills 管理"})]})})}),o.jsx("li",{children:o.jsx(qr,{text:"MCP 管理",showTooltip:u,children:o.jsxs(Vr,{to:"/mcp",children:[o.jsx("span",{className:"nav-icon",children:"🧰"}),o.jsx("span",{className:"nav-text",children:"MCP 管理"})]})})}),w&&o.jsxs(o.Fragment,{children:[o.jsx("li",{className:"nav-divider",children:o.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-primary)",margin:"4px 8px"}})}),o.jsx("li",{children:o.jsx(qr,{text:"API Key",showTooltip:u,children:o.jsxs(Vr,{to:"/access-keys",children:[o.jsx("span",{className:"nav-icon",children:"🔑"}),o.jsx("span",{className:"nav-text",children:"API Key"})]})})})]}),o.jsx("li",{className:"nav-divider",children:o.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-primary)",margin:"4px 8px"}})}),o.jsx("li",{children:o.jsx(qr,{text:"任务雷达",showTooltip:u,children:o.jsxs(Vr,{to:"/agent-map",children:[o.jsx("span",{className:"nav-icon",children:"🗺️"}),o.jsx("span",{className:"nav-text",children:"任务雷达"})]})})}),o.jsx("li",{children:o.jsx(qr,{text:"数据统计",showTooltip:u,children:o.jsxs(Vr,{to:"/statistics",children:[o.jsx("span",{className:"nav-icon",children:"📊"}),o.jsx("span",{className:"nav-text",children:"数据统计"})]})})}),!w&&o.jsxs(o.Fragment,{children:[o.jsx("li",{children:o.jsx(qr,{text:"会话",showTooltip:u,children:o.jsxs(Vr,{to:"/sessions",children:[o.jsx("span",{className:"nav-icon",children:"💬"}),o.jsx("span",{className:"nav-text",children:"会话"})]})})}),o.jsx("li",{children:o.jsx(qr,{text:"日志",showTooltip:u,children:o.jsxs(Vr,{to:"/logs",children:[o.jsx("span",{className:"nav-icon",children:"🪵"}),o.jsx("span",{className:"nav-text",children:"日志"})]})})})]}),o.jsx("li",{children:o.jsx(qr,{text:"设置",showTooltip:u,children:o.jsxs(Vr,{to:"/settings",children:[o.jsx("span",{className:"nav-icon",children:"⚙️"}),o.jsx("span",{className:"nav-text",children:"设置"})]})})}),o.jsx("li",{children:o.jsx(qr,{text:"使用说明",showTooltip:u,children:o.jsxs(Vr,{to:"/usage",children:[o.jsx("span",{className:"nav-icon",children:"📖"}),o.jsx("span",{className:"nav-text",children:"使用说明"})]})})})]}),Me&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`nav-scroll-shadow nav-scroll-shadow--top${xe.atTop?" is-hidden":""}`,"aria-hidden":"true"}),o.jsx("div",{className:`nav-scroll-shadow nav-scroll-shadow--bottom${xe.atBottom?" is-hidden":""}`,"aria-hidden":"true",children:o.jsx("span",{className:"nav-scroll-wheel",children:o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"6",y:"3",width:"12",height:"18",rx:"6"}),o.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"})]})})})]})]}),o.jsxs("div",{className:"theme-toggle",children:[o.jsx("button",{onClick:de,className:"theme-mode-btn",children:t==="dark"?"🌙":"☀️"}),o.jsx("a",{href:"https://github.com/tangshuang/aicodeswitch",target:"_blank",rel:"noopener noreferrer",className:"github-link",title:"GitHub",children:o.jsx("svg",{viewBox:"0 0 16 16",width:"20",height:"20",fill:"currentColor",children:o.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})})}),y&&o.jsx("div",{className:`version-info-wrapper ${d?"has-update":""}`,onClick:()=>b(!0),style:{cursor:"pointer"},children:o.jsxs("div",{className:"version-info",children:["v",y,d&&o.jsx("span",{className:"version-badge"})]})}),o.jsx("button",{onClick:ie,className:"sidebar-toggle-btn",title:u?"展开侧边栏":"收起侧边栏",children:u?"»":"«"})]})]}),o.jsx("main",{className:"main-content",children:o.jsxs(Hz,{children:[o.jsx(Hn,{path:"/",element:o.jsx(Wl,{to:"/routes",replace:!0})}),o.jsx(Hn,{path:"/agent-map",element:o.jsx(wae,{})}),o.jsx(Hn,{path:"/statistics",element:o.jsx(nae,{})}),o.jsx(Hn,{path:"/routes",element:o.jsx(xB,{})}),o.jsx(Hn,{path:"/vendors",element:o.jsx(tB,{})}),o.jsx(Hn,{path:"/skills",element:o.jsx(rae,{})}),o.jsx(Hn,{path:"/mcp",element:o.jsx(aae,{})}),o.jsx(Hn,{path:"/access-keys",element:w?o.jsx(oae,{}):o.jsx(Wl,{to:"/"})}),o.jsx(Hn,{path:"/access-keys/:id",element:w?o.jsx(sae,{}):o.jsx(Wl,{to:"/"})}),o.jsx(Hn,{path:"/sessions",element:w?o.jsx(Wl,{to:"/"}):o.jsx(KB,{})}),o.jsx(Hn,{path:"/logs",element:w?o.jsx(Wl,{to:"/"}):o.jsx(MB,{})}),o.jsx(Hn,{path:"/write-config",element:o.jsx(VB,{})}),o.jsx(Hn,{path:"/settings",element:o.jsx(HB,{})}),o.jsx(Hn,{path:"/usage",element:o.jsx(YB,{})})]})}),r&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>i(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"⚠️ 需要配置供应商"})}),o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6"},children:"检测到系统中没有配置任何API供应商。在没有供应商的情况下,路由将无法正常工作。"}),o.jsx("p",{style:{marginBottom:"0",lineHeight:"1.6",fontWeight:"500"},children:"请先添加至少一个供应商,然后再配置路由规则。"})]}),o.jsxs("div",{className:"modal-footer",style:{justifyContent:"space-between"},children:[o.jsx("button",{type:"button",className:"btn",style:{background:"linear-gradient(135deg, #8B5CF6, #7C3AED)",color:"white",position:"relative",overflow:"hidden"},onClick:()=>{i(!1),c(!0)},children:"一键配置"}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>i(!1),children:"稍后"}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:se,children:"前往供应商管理"})]})]})]})})]}),o.jsx(oA,{show:l,onClose:()=>c(!1),onComplete:()=>s(!0)}),K&&o.jsx("div",{className:"modal-overlay",children:o.jsx("div",{className:"modal",style:{maxWidth:"800px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"📋 升级提示"})}),o.jsx("div",{className:"modal-body",children:o.jsx("div",{className:"markdown-content",children:o.jsx(Sc,{children:B})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:Le,children:"我知道了"})})]})})}),re&&pe&&o.jsx(Cae,{toolName:!pe.claudeCode.installed&&!pe.codex.installed?"both":pe.claudeCode.installed?"codex":"claude-code",onInstallClick:Ye,onClose:$e}),P&&pe&&o.jsx(kae,{status:pe,onClose:lt,onInstallComplete:Ve}),v&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>b(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"700px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"📦 版本信息"})}),o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px",backgroundColor:"var(--bg-secondary)",borderRadius:"8px",marginBottom:"20px"},children:[o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"当前版本"}),o.jsxs("div",{style:{fontSize:"18px",fontWeight:"600"},children:["v",y]})]}),d?o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{fontSize:"24px",color:"var(--text-secondary)"},children:"→"}),o.jsxs("div",{style:{textAlign:"right"},children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"最新版本"}),o.jsxs("div",{style:{fontSize:"18px",fontWeight:"600"},children:["v",m]})]})]}):o.jsx("div",{style:{padding:"6px 12px",backgroundColor:"#d4edda",color:"#155724",borderRadius:"4px",fontSize:"14px",fontWeight:"500"},children:"已是最新版本"})]}),d&&o.jsxs("div",{style:{padding:"16px",backgroundColor:"var(--bg-info-blue)",border:"1px solid var(--border-info-blue)",borderRadius:"8px",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"14px",marginBottom:"8px",fontWeight:"500",color:"var(--text-primary)"},children:"更新命令:"}),o.jsx("code",{style:{display:"block",padding:"8px 12px",backgroundColor:"var(--bg-secondary)",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"13px",color:"var(--accent-danger)"},children:"npm i -g aicodeswitch@latest"})]}),d?j?o.jsx("div",{className:"markdown-content",style:{maxHeight:"400px",overflow:"auto"},children:o.jsx(Sc,{children:j})}):null:o.jsxs("div",{className:"markdown-content",children:[o.jsx("h4",{style:{marginBottom:12},children:"当前版本提示:"}),o.jsx(Sc,{children:Eae})]})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>b(!1),children:"关闭"})})]})})]})]})}function Aae(){return o.jsx(Zz,{children:o.jsx(Q8,{children:o.jsx(sB,{children:o.jsxs(cae,{children:[o.jsx(Tae,{}),o.jsx(Z8,{})]})})})})}Ag.createRoot(document.getElementById("root")).render(o.jsx(r2.StrictMode,{children:o.jsx(Aae,{})}));
|