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.
@@ -0,0 +1,1187 @@
1
+ var HL=Object.defineProperty;var VL=(e,t,n)=>t in e?HL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Be=(e,t,n)=>VL(e,typeof t!="symbol"?t+"":t,n);import{E as qL,V as rt,M as Os,T as Ns,S as Kw,Q as tu,a as Rn,R as YL,P as GL,b as G2,c as Gx,O as X2,I as XL,F as Hw,d as Ny,e as Vs,W as QL,B as Xx,f as Q2,g as ZL,h as xp,U as Z2,i as bp,j as Ra,k as zu,L as JL,l as ez,C as tz,m as nz,A as rz,n as Vw,o as iz,p as az,q as oz,r as sz,D as lz,s as cz,t as qw,u as Yw,v as Ms,w as oc,x as uz,y as dz,z as pz,G as fz,H as hz,J as Gw,K as Xw,N as mz,X as gz,Y as yz,Z as vz}from"./three-CFpmPosW.js";function xz(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 bl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J2={exports:{}},bh={},eE={exports:{}},at={};/**
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 $u=Symbol.for("react.element"),bz=Symbol.for("react.portal"),wz=Symbol.for("react.fragment"),jz=Symbol.for("react.strict_mode"),Sz=Symbol.for("react.profiler"),kz=Symbol.for("react.provider"),Cz=Symbol.for("react.context"),Pz=Symbol.for("react.forward_ref"),Az=Symbol.for("react.suspense"),Ez=Symbol.for("react.memo"),Tz=Symbol.for("react.lazy"),Qw=Symbol.iterator;function Iz(e){return e===null||typeof e!="object"?null:(e=Qw&&e[Qw]||e["@@iterator"],typeof e=="function"?e:null)}var tE={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nE=Object.assign,rE={};function Fl(e,t,n){this.props=e,this.context=t,this.refs=rE,this.updater=n||tE}Fl.prototype.isReactComponent={};Fl.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")};Fl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function iE(){}iE.prototype=Fl.prototype;function Qx(e,t,n){this.props=e,this.context=t,this.refs=rE,this.updater=n||tE}var Zx=Qx.prototype=new iE;Zx.constructor=Qx;nE(Zx,Fl.prototype);Zx.isPureReactComponent=!0;var Zw=Array.isArray,aE=Object.prototype.hasOwnProperty,Jx={current:null},oE={key:!0,ref:!0,__self:!0,__source:!0};function sE(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)aE.call(t,r)&&!oE.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:$u,type:e,key:a,ref:s,props:i,_owner:Jx.current}}function Oz(e,t){return{$$typeof:$u,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function e0(e){return typeof e=="object"&&e!==null&&e.$$typeof===$u}function Nz(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Jw=/\/+/g;function og(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Nz(""+e.key):t.toString(36)}function wp(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 $u:case bz:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+og(s,0):r,Zw(i)?(n="",e!=null&&(n=e.replace(Jw,"$&/")+"/"),wp(i,t,n,"",function(u){return u})):i!=null&&(e0(i)&&(i=Oz(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(Jw,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Zw(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+og(a,l);s+=wp(a,t,n,c,i)}else if(c=Iz(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+og(a,l++),s+=wp(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 Cd(e,t,n){if(e==null)return e;var r=[],i=0;return wp(e,r,"","",function(a){return t.call(n,a,i++)}),r}function Mz(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 ir={current:null},jp={transition:null},_z={ReactCurrentDispatcher:ir,ReactCurrentBatchConfig:jp,ReactCurrentOwner:Jx};function lE(){throw Error("act(...) is not supported in production builds of React.")}at.Children={map:Cd,forEach:function(e,t,n){Cd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Cd(e,function(){t++}),t},toArray:function(e){return Cd(e,function(t){return t})||[]},only:function(e){if(!e0(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};at.Component=Fl;at.Fragment=wz;at.Profiler=Sz;at.PureComponent=Qx;at.StrictMode=jz;at.Suspense=Az;at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_z;at.act=lE;at.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=nE({},e.props),i=e.key,a=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,s=Jx.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)aE.call(t,c)&&!oE.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:$u,type:e.type,key:i,ref:a,props:r,_owner:s}};at.createContext=function(e){return e={$$typeof:Cz,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:kz,_context:e},e.Consumer=e};at.createElement=sE;at.createFactory=function(e){var t=sE.bind(null,e);return t.type=e,t};at.createRef=function(){return{current:null}};at.forwardRef=function(e){return{$$typeof:Pz,render:e}};at.isValidElement=e0;at.lazy=function(e){return{$$typeof:Tz,_payload:{_status:-1,_result:e},_init:Mz}};at.memo=function(e,t){return{$$typeof:Ez,type:e,compare:t===void 0?null:t}};at.startTransition=function(e){var t=jp.transition;jp.transition={};try{e()}finally{jp.transition=t}};at.unstable_act=lE;at.useCallback=function(e,t){return ir.current.useCallback(e,t)};at.useContext=function(e){return ir.current.useContext(e)};at.useDebugValue=function(){};at.useDeferredValue=function(e){return ir.current.useDeferredValue(e)};at.useEffect=function(e,t){return ir.current.useEffect(e,t)};at.useId=function(){return ir.current.useId()};at.useImperativeHandle=function(e,t,n){return ir.current.useImperativeHandle(e,t,n)};at.useInsertionEffect=function(e,t){return ir.current.useInsertionEffect(e,t)};at.useLayoutEffect=function(e,t){return ir.current.useLayoutEffect(e,t)};at.useMemo=function(e,t){return ir.current.useMemo(e,t)};at.useReducer=function(e,t,n){return ir.current.useReducer(e,t,n)};at.useRef=function(e){return ir.current.useRef(e)};at.useState=function(e){return ir.current.useState(e)};at.useSyncExternalStore=function(e,t,n){return ir.current.useSyncExternalStore(e,t,n)};at.useTransition=function(){return ir.current.useTransition()};at.version="18.3.1";eE.exports=at;var h=eE.exports;const cE=Bl(h),uE=xz({__proto__:null,default:cE},[h]);/**
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 Rz=h,Dz=Symbol.for("react.element"),Lz=Symbol.for("react.fragment"),zz=Object.prototype.hasOwnProperty,$z=Rz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Bz={key:!0,ref:!0,__self:!0,__source:!0};function dE(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)zz.call(t,r)&&!Bz.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:Dz,type:e,key:a,ref:s,props:i,_owner:$z.current}}bh.Fragment=Lz;bh.jsx=dE;bh.jsxs=dE;J2.exports=bh;var o=J2.exports,My={},pE={exports:{}},Or={},fE={exports:{}},hE={};/**
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(N,W){var P=N.length;N.push(W);e:for(;0<P;){var U=P-1>>>1,le=N[U];if(0<i(le,W))N[U]=W,N[P]=le,P=U;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var W=N[0],P=N.pop();if(P!==W){N[0]=P;e:for(var U=0,le=N.length,E=le>>>1;U<E;){var he=2*(U+1)-1,ye=N[he],Q=he+1,ie=N[Q];if(0>i(ye,P))Q<le&&0>i(ie,ye)?(N[U]=ie,N[Q]=P,U=Q):(N[U]=ye,N[he]=P,U=he);else if(Q<le&&0>i(ie,P))N[U]=ie,N[Q]=P,U=Q;else break e}}return W}function i(N,W){var P=N.sortIndex-W.sortIndex;return P!==0?P:N.id-W.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,f=3,m=!1,g=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,y=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 w(N){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=N)r(u),W.sortIndex=W.expirationTime,t(c,W);else break;W=n(u)}}function j(N){if(v=!1,w(N),!g)if(n(c)!==null)g=!0,$(k);else{var W=n(u);W!==null&&H(j,W.startTime-N)}}function k(N,W){g=!1,v&&(v=!1,y(T),T=-1),m=!0;var P=f;try{for(w(W),d=n(c);d!==null&&(!(d.expirationTime>W)||N&&!_());){var U=d.callback;if(typeof U=="function"){d.callback=null,f=d.priorityLevel;var le=U(d.expirationTime<=W);W=e.unstable_now(),typeof le=="function"?d.callback=le:d===n(c)&&r(c),w(W)}else r(c);d=n(c)}if(d!==null)var E=!0;else{var he=n(u);he!==null&&H(j,he.startTime-W),E=!1}return E}finally{d=null,f=P,m=!1}}var S=!1,A=null,T=-1,D=5,O=-1;function _(){return!(e.unstable_now()-O<D)}function R(){if(A!==null){var N=e.unstable_now();O=N;var W=!0;try{W=A(!0,N)}finally{W?X():(S=!1,A=null)}}else S=!1}var X;if(typeof b=="function")X=function(){b(R)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,I=V.port2;V.port1.onmessage=R,X=function(){I.postMessage(null)}}else X=function(){x(R,0)};function $(N){A=N,S||(S=!0,X())}function H(N,W){T=x(function(){N(e.unstable_now())},W)}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(N){N.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,$(k))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(N){switch(f){case 1:case 2:case 3:var W=3;break;default:W=f}var P=f;f=W;try{return N()}finally{f=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,W){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var P=f;f=N;try{return W()}finally{f=P}},e.unstable_scheduleCallback=function(N,W,P){var U=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?U+P:U):P=U,N){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=P+le,N={id:p++,callback:W,priorityLevel:N,startTime:P,expirationTime:le,sortIndex:-1},P>U?(N.sortIndex=P,t(u,N),n(c)===null&&N===n(u)&&(v?(y(T),T=-1):v=!0,H(j,P-U))):(N.sortIndex=le,t(c,N),g||m||(g=!0,$(k))),N},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(N){var W=f;return function(){var P=f;f=W;try{return N.apply(this,arguments)}finally{f=P}}}})(hE);fE.exports=hE;var Fz=fE.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 Uz=h,Er=Fz;function be(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 mE=new Set,nu={};function vs(e,t){wl(e,t),wl(e+"Capture",t)}function wl(e,t){for(nu[e]=t,e=0;e<t.length;e++)mE.add(t[e])}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_y=Object.prototype.hasOwnProperty,Wz=/^[: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]*$/,ej={},tj={};function Kz(e){return _y.call(tj,e)?!0:_y.call(ej,e)?!1:Wz.test(e)?tj[e]=!0:(ej[e]=!0,!1)}function Hz(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 Vz(e,t,n,r){if(t===null||typeof t>"u"||Hz(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 ar(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 $n={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$n[e]=new ar(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$n[t]=new ar(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$n[e]=new ar(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$n[e]=new ar(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){$n[e]=new ar(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$n[e]=new ar(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$n[e]=new ar(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$n[e]=new ar(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$n[e]=new ar(e,5,!1,e.toLowerCase(),null,!1,!1)});var t0=/[\-:]([a-z])/g;function n0(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(t0,n0);$n[t]=new ar(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(t0,n0);$n[t]=new ar(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(t0,n0);$n[t]=new ar(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$n[e]=new ar(e,1,!1,e.toLowerCase(),null,!1,!1)});$n.xlinkHref=new ar("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$n[e]=new ar(e,1,!1,e.toLowerCase(),null,!0,!0)});function r0(e,t,n,r){var i=$n.hasOwnProperty(t)?$n[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Vz(t,n,i,r)&&(n=null),r||i===null?Kz(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 ba=Uz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Pd=Symbol.for("react.element"),qs=Symbol.for("react.portal"),Ys=Symbol.for("react.fragment"),i0=Symbol.for("react.strict_mode"),Ry=Symbol.for("react.profiler"),gE=Symbol.for("react.provider"),yE=Symbol.for("react.context"),a0=Symbol.for("react.forward_ref"),Dy=Symbol.for("react.suspense"),Ly=Symbol.for("react.suspense_list"),o0=Symbol.for("react.memo"),Da=Symbol.for("react.lazy"),vE=Symbol.for("react.offscreen"),nj=Symbol.iterator;function sc(e){return e===null||typeof e!="object"?null:(e=nj&&e[nj]||e["@@iterator"],typeof e=="function"?e:null)}var qt=Object.assign,sg;function Ic(e){if(sg===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);sg=t&&t[1]||""}return`
34
+ `+sg+e}var lg=!1;function cg(e,t){if(!e||lg)return"";lg=!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{lg=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ic(e):""}function qz(e){switch(e.tag){case 5:return Ic(e.type);case 16:return Ic("Lazy");case 13:return Ic("Suspense");case 19:return Ic("SuspenseList");case 0:case 2:case 15:return e=cg(e.type,!1),e;case 11:return e=cg(e.type.render,!1),e;case 1:return e=cg(e.type,!0),e;default:return""}}function zy(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 Ys:return"Fragment";case qs:return"Portal";case Ry:return"Profiler";case i0:return"StrictMode";case Dy:return"Suspense";case Ly:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yE:return(e.displayName||"Context")+".Consumer";case gE:return(e._context.displayName||"Context")+".Provider";case a0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case o0:return t=e.displayName||null,t!==null?t:zy(e.type)||"Memo";case Da:t=e._payload,e=e._init;try{return zy(e(t))}catch{}}return null}function Yz(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 zy(t);case 8:return t===i0?"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 ro(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gz(e){var t=xE(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 Ad(e){e._valueTracker||(e._valueTracker=Gz(e))}function bE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xE(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fp(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 $y(e,t){var n=t.checked;return qt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function rj(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ro(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 wE(e,t){t=t.checked,t!=null&&r0(e,"checked",t,!1)}function By(e,t){wE(e,t);var n=ro(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")?Fy(e,t.type,n):t.hasOwnProperty("defaultValue")&&Fy(e,t.type,ro(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ij(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 Fy(e,t,n){(t!=="number"||Fp(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Oc=Array.isArray;function cl(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=""+ro(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 Uy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(be(91));return qt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function aj(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(be(92));if(Oc(n)){if(1<n.length)throw Error(be(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ro(n)}}function jE(e,t){var n=ro(t.value),r=ro(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 oj(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function SE(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 Wy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?SE(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ed,kE=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(Ed=Ed||document.createElement("div"),Ed.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ed.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ru(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lc={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},Xz=["Webkit","ms","Moz","O"];Object.keys(Lc).forEach(function(e){Xz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Lc[t]=Lc[e]})});function CE(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Lc.hasOwnProperty(e)&&Lc[e]?(""+t).trim():t+"px"}function PE(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=CE(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Qz=qt({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 Ky(e,t){if(t){if(Qz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(be(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(be(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(be(61))}if(t.style!=null&&typeof t.style!="object")throw Error(be(62))}}function Hy(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 Vy=null;function s0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qy=null,ul=null,dl=null;function sj(e){if(e=Uu(e)){if(typeof qy!="function")throw Error(be(280));var t=e.stateNode;t&&(t=Ch(t),qy(e.stateNode,e.type,t))}}function AE(e){ul?dl?dl.push(e):dl=[e]:ul=e}function EE(){if(ul){var e=ul,t=dl;if(dl=ul=null,sj(e),t)for(e=0;e<t.length;e++)sj(t[e])}}function TE(e,t){return e(t)}function IE(){}var ug=!1;function OE(e,t,n){if(ug)return e(t,n);ug=!0;try{return TE(e,t,n)}finally{ug=!1,(ul!==null||dl!==null)&&(IE(),EE())}}function iu(e,t){var n=e.stateNode;if(n===null)return null;var r=Ch(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(be(231,t,typeof n));return n}var Yy=!1;if(pa)try{var lc={};Object.defineProperty(lc,"passive",{get:function(){Yy=!0}}),window.addEventListener("test",lc,lc),window.removeEventListener("test",lc,lc)}catch{Yy=!1}function Zz(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 zc=!1,Up=null,Wp=!1,Gy=null,Jz={onError:function(e){zc=!0,Up=e}};function e4(e,t,n,r,i,a,s,l,c){zc=!1,Up=null,Zz.apply(Jz,arguments)}function t4(e,t,n,r,i,a,s,l,c){if(e4.apply(this,arguments),zc){if(zc){var u=Up;zc=!1,Up=null}else throw Error(be(198));Wp||(Wp=!0,Gy=u)}}function xs(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 NE(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 lj(e){if(xs(e)!==e)throw Error(be(188))}function n4(e){var t=e.alternate;if(!t){if(t=xs(e),t===null)throw Error(be(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 lj(i),e;if(a===r)return lj(i),t;a=a.sibling}throw Error(be(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(be(189))}}if(n.alternate!==r)throw Error(be(190))}if(n.tag!==3)throw Error(be(188));return n.stateNode.current===n?e:t}function ME(e){return e=n4(e),e!==null?_E(e):null}function _E(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_E(e);if(t!==null)return t;e=e.sibling}return null}var RE=Er.unstable_scheduleCallback,cj=Er.unstable_cancelCallback,r4=Er.unstable_shouldYield,i4=Er.unstable_requestPaint,nn=Er.unstable_now,a4=Er.unstable_getCurrentPriorityLevel,l0=Er.unstable_ImmediatePriority,DE=Er.unstable_UserBlockingPriority,Kp=Er.unstable_NormalPriority,o4=Er.unstable_LowPriority,LE=Er.unstable_IdlePriority,wh=null,Ri=null;function s4(e){if(Ri&&typeof Ri.onCommitFiberRoot=="function")try{Ri.onCommitFiberRoot(wh,e,void 0,(e.current.flags&128)===128)}catch{}}var li=Math.clz32?Math.clz32:u4,l4=Math.log,c4=Math.LN2;function u4(e){return e>>>=0,e===0?32:31-(l4(e)/c4|0)|0}var Td=64,Id=4194304;function Nc(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 Hp(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=Nc(l):(a&=s,a!==0&&(r=Nc(a)))}else s=n&~i,s!==0?r=Nc(s):a!==0&&(r=Nc(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-li(t),i=1<<n,r|=e[n],t&=~i;return r}function d4(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 p4(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-li(a),l=1<<s,c=i[s];c===-1?(!(l&n)||l&r)&&(i[s]=d4(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Xy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function zE(){var e=Td;return Td<<=1,!(Td&4194240)&&(Td=64),e}function dg(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Bu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-li(t),e[t]=n}function f4(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-li(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function c0(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-li(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var wt=0;function $E(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var BE,u0,FE,UE,WE,Qy=!1,Od=[],Va=null,qa=null,Ya=null,au=new Map,ou=new Map,Ba=[],h4="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 uj(e,t){switch(e){case"focusin":case"focusout":Va=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ya=null;break;case"pointerover":case"pointerout":au.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ou.delete(t.pointerId)}}function cc(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=Uu(t),t!==null&&u0(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function m4(e,t,n,r,i){switch(t){case"focusin":return Va=cc(Va,e,t,n,r,i),!0;case"dragenter":return qa=cc(qa,e,t,n,r,i),!0;case"mouseover":return Ya=cc(Ya,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return au.set(a,cc(au.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,ou.set(a,cc(ou.get(a)||null,e,t,n,r,i)),!0}return!1}function KE(e){var t=Do(e.target);if(t!==null){var n=xs(t);if(n!==null){if(t=n.tag,t===13){if(t=NE(n),t!==null){e.blockedOn=t,WE(e.priority,function(){FE(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 Sp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Vy=r,n.target.dispatchEvent(r),Vy=null}else return t=Uu(n),t!==null&&u0(t),e.blockedOn=n,!1;t.shift()}return!0}function dj(e,t,n){Sp(e)&&n.delete(t)}function g4(){Qy=!1,Va!==null&&Sp(Va)&&(Va=null),qa!==null&&Sp(qa)&&(qa=null),Ya!==null&&Sp(Ya)&&(Ya=null),au.forEach(dj),ou.forEach(dj)}function uc(e,t){e.blockedOn===t&&(e.blockedOn=null,Qy||(Qy=!0,Er.unstable_scheduleCallback(Er.unstable_NormalPriority,g4)))}function su(e){function t(i){return uc(i,e)}if(0<Od.length){uc(Od[0],e);for(var n=1;n<Od.length;n++){var r=Od[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Va!==null&&uc(Va,e),qa!==null&&uc(qa,e),Ya!==null&&uc(Ya,e),au.forEach(t),ou.forEach(t),n=0;n<Ba.length;n++)r=Ba[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ba.length&&(n=Ba[0],n.blockedOn===null);)KE(n),n.blockedOn===null&&Ba.shift()}var pl=ba.ReactCurrentBatchConfig,Vp=!0;function y4(e,t,n,r){var i=wt,a=pl.transition;pl.transition=null;try{wt=1,d0(e,t,n,r)}finally{wt=i,pl.transition=a}}function v4(e,t,n,r){var i=wt,a=pl.transition;pl.transition=null;try{wt=4,d0(e,t,n,r)}finally{wt=i,pl.transition=a}}function d0(e,t,n,r){if(Vp){var i=Zy(e,t,n,r);if(i===null)wg(e,t,r,qp,n),uj(e,r);else if(m4(i,e,t,n,r))r.stopPropagation();else if(uj(e,r),t&4&&-1<h4.indexOf(e)){for(;i!==null;){var a=Uu(i);if(a!==null&&BE(a),a=Zy(e,t,n,r),a===null&&wg(e,t,r,qp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wg(e,t,r,null,n)}}var qp=null;function Zy(e,t,n,r){if(qp=null,e=s0(r),e=Do(e),e!==null)if(t=xs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=NE(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 qp=e,null}function HE(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(a4()){case l0:return 1;case DE:return 4;case Kp:case o4:return 16;case LE:return 536870912;default:return 16}default:return 16}}var Wa=null,p0=null,kp=null;function VE(){if(kp)return kp;var e,t=p0,n=t.length,r,i="value"in Wa?Wa.value:Wa.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 kp=i.slice(e,1<r?1-r:void 0)}function Cp(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 Nd(){return!0}function pj(){return!1}function Nr(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)?Nd:pj,this.isPropagationStopped=pj,this}return qt(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=Nd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Nd)},persist:function(){},isPersistent:Nd}),t}var Ul={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},f0=Nr(Ul),Fu=qt({},Ul,{view:0,detail:0}),x4=Nr(Fu),pg,fg,dc,jh=qt({},Fu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:h0,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!==dc&&(dc&&e.type==="mousemove"?(pg=e.screenX-dc.screenX,fg=e.screenY-dc.screenY):fg=pg=0,dc=e),pg)},movementY:function(e){return"movementY"in e?e.movementY:fg}}),fj=Nr(jh),b4=qt({},jh,{dataTransfer:0}),w4=Nr(b4),j4=qt({},Fu,{relatedTarget:0}),hg=Nr(j4),S4=qt({},Ul,{animationName:0,elapsedTime:0,pseudoElement:0}),k4=Nr(S4),C4=qt({},Ul,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),P4=Nr(C4),A4=qt({},Ul,{data:0}),hj=Nr(A4),E4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T4={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"},I4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function O4(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=I4[e])?!!t[e]:!1}function h0(){return O4}var N4=qt({},Fu,{key:function(e){if(e.key){var t=E4[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Cp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?T4[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:h0,charCode:function(e){return e.type==="keypress"?Cp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Cp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),M4=Nr(N4),_4=qt({},jh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mj=Nr(_4),R4=qt({},Fu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:h0}),D4=Nr(R4),L4=qt({},Ul,{propertyName:0,elapsedTime:0,pseudoElement:0}),z4=Nr(L4),$4=qt({},jh,{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}),B4=Nr($4),F4=[9,13,27,32],m0=pa&&"CompositionEvent"in window,$c=null;pa&&"documentMode"in document&&($c=document.documentMode);var U4=pa&&"TextEvent"in window&&!$c,qE=pa&&(!m0||$c&&8<$c&&11>=$c),gj=" ",yj=!1;function YE(e,t){switch(e){case"keyup":return F4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function GE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gs=!1;function W4(e,t){switch(e){case"compositionend":return GE(t);case"keypress":return t.which!==32?null:(yj=!0,gj);case"textInput":return e=t.data,e===gj&&yj?null:e;default:return null}}function K4(e,t){if(Gs)return e==="compositionend"||!m0&&YE(e,t)?(e=VE(),kp=p0=Wa=null,Gs=!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 qE&&t.locale!=="ko"?null:t.data;default:return null}}var H4={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 vj(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!H4[e.type]:t==="textarea"}function XE(e,t,n,r){AE(r),t=Yp(t,"onChange"),0<t.length&&(n=new f0("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bc=null,lu=null;function V4(e){sT(e,0)}function Sh(e){var t=Zs(e);if(bE(t))return e}function q4(e,t){if(e==="change")return t}var QE=!1;if(pa){var mg;if(pa){var gg="oninput"in document;if(!gg){var xj=document.createElement("div");xj.setAttribute("oninput","return;"),gg=typeof xj.oninput=="function"}mg=gg}else mg=!1;QE=mg&&(!document.documentMode||9<document.documentMode)}function bj(){Bc&&(Bc.detachEvent("onpropertychange",ZE),lu=Bc=null)}function ZE(e){if(e.propertyName==="value"&&Sh(lu)){var t=[];XE(t,lu,e,s0(e)),OE(V4,t)}}function Y4(e,t,n){e==="focusin"?(bj(),Bc=t,lu=n,Bc.attachEvent("onpropertychange",ZE)):e==="focusout"&&bj()}function G4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sh(lu)}function X4(e,t){if(e==="click")return Sh(t)}function Q4(e,t){if(e==="input"||e==="change")return Sh(t)}function Z4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ui=typeof Object.is=="function"?Object.is:Z4;function cu(e,t){if(ui(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(!_y.call(t,i)||!ui(e[i],t[i]))return!1}return!0}function wj(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jj(e,t){var n=wj(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=wj(n)}}function JE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?JE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eT(){for(var e=window,t=Fp();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fp(e.document)}return t}function g0(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 J4(e){var t=eT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&JE(n.ownerDocument.documentElement,n)){if(r!==null&&g0(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=jj(n,a);var s=jj(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 e$=pa&&"documentMode"in document&&11>=document.documentMode,Xs=null,Jy=null,Fc=null,ev=!1;function Sj(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ev||Xs==null||Xs!==Fp(r)||(r=Xs,"selectionStart"in r&&g0(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}),Fc&&cu(Fc,r)||(Fc=r,r=Yp(Jy,"onSelect"),0<r.length&&(t=new f0("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Xs)))}function Md(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qs={animationend:Md("Animation","AnimationEnd"),animationiteration:Md("Animation","AnimationIteration"),animationstart:Md("Animation","AnimationStart"),transitionend:Md("Transition","TransitionEnd")},yg={},tT={};pa&&(tT=document.createElement("div").style,"AnimationEvent"in window||(delete Qs.animationend.animation,delete Qs.animationiteration.animation,delete Qs.animationstart.animation),"TransitionEvent"in window||delete Qs.transitionend.transition);function kh(e){if(yg[e])return yg[e];if(!Qs[e])return e;var t=Qs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tT)return yg[e]=t[n];return e}var nT=kh("animationend"),rT=kh("animationiteration"),iT=kh("animationstart"),aT=kh("transitionend"),oT=new Map,kj="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 lo(e,t){oT.set(e,t),vs(t,[e])}for(var vg=0;vg<kj.length;vg++){var xg=kj[vg],t$=xg.toLowerCase(),n$=xg[0].toUpperCase()+xg.slice(1);lo(t$,"on"+n$)}lo(nT,"onAnimationEnd");lo(rT,"onAnimationIteration");lo(iT,"onAnimationStart");lo("dblclick","onDoubleClick");lo("focusin","onFocus");lo("focusout","onBlur");lo(aT,"onTransitionEnd");wl("onMouseEnter",["mouseout","mouseover"]);wl("onMouseLeave",["mouseout","mouseover"]);wl("onPointerEnter",["pointerout","pointerover"]);wl("onPointerLeave",["pointerout","pointerover"]);vs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));vs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));vs("onBeforeInput",["compositionend","keypress","textInput","paste"]);vs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));vs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));vs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mc="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(" "),r$=new Set("cancel close invalid load scroll toggle".split(" ").concat(Mc));function Cj(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,t4(r,t,void 0,e),e.currentTarget=null}function sT(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;Cj(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;Cj(i,l,u),a=c}}}if(Wp)throw e=Gy,Wp=!1,Gy=null,e}function _t(e,t){var n=t[av];n===void 0&&(n=t[av]=new Set);var r=e+"__bubble";n.has(r)||(lT(t,e,2,!1),n.add(r))}function bg(e,t,n){var r=0;t&&(r|=4),lT(n,e,r,t)}var _d="_reactListening"+Math.random().toString(36).slice(2);function uu(e){if(!e[_d]){e[_d]=!0,mE.forEach(function(n){n!=="selectionchange"&&(r$.has(n)||bg(n,!1,e),bg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_d]||(t[_d]=!0,bg("selectionchange",!1,t))}}function lT(e,t,n,r){switch(HE(t)){case 1:var i=y4;break;case 4:i=v4;break;default:i=d0}n=i.bind(null,t,n,e),i=void 0,!Yy||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 wg(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=Do(l),s===null)return;if(c=s.tag,c===5||c===6){r=a=s;continue e}l=l.parentNode}}r=r.return}OE(function(){var u=a,p=s0(n),d=[];e:{var f=oT.get(e);if(f!==void 0){var m=f0,g=e;switch(e){case"keypress":if(Cp(n)===0)break e;case"keydown":case"keyup":m=M4;break;case"focusin":g="focus",m=hg;break;case"focusout":g="blur",m=hg;break;case"beforeblur":case"afterblur":m=hg;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=fj;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=w4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=D4;break;case nT:case rT:case iT:m=k4;break;case aT:m=z4;break;case"scroll":m=x4;break;case"wheel":m=B4;break;case"copy":case"cut":case"paste":m=P4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=mj}var v=(t&4)!==0,x=!v&&e==="scroll",y=v?f!==null?f+"Capture":null:f;v=[];for(var b=u,w;b!==null;){w=b;var j=w.stateNode;if(w.tag===5&&j!==null&&(w=j,y!==null&&(j=iu(b,y),j!=null&&v.push(du(b,j,w)))),x)break;b=b.return}0<v.length&&(f=new m(f,g,null,n,p),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==Vy&&(g=n.relatedTarget||n.fromElement)&&(Do(g)||g[fa]))break e;if((m||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?Do(g):null,g!==null&&(x=xs(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=fj,j="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(v=mj,j="onPointerLeave",y="onPointerEnter",b="pointer"),x=m==null?f:Zs(m),w=g==null?f:Zs(g),f=new v(j,b+"leave",m,n,p),f.target=x,f.relatedTarget=w,j=null,Do(p)===u&&(v=new v(y,b+"enter",g,n,p),v.target=w,v.relatedTarget=x,j=v),x=j,m&&g)t:{for(v=m,y=g,b=0,w=v;w;w=_s(w))b++;for(w=0,j=y;j;j=_s(j))w++;for(;0<b-w;)v=_s(v),b--;for(;0<w-b;)y=_s(y),w--;for(;b--;){if(v===y||y!==null&&v===y.alternate)break t;v=_s(v),y=_s(y)}v=null}else v=null;m!==null&&Pj(d,f,m,v,!1),g!==null&&x!==null&&Pj(d,x,g,v,!0)}}e:{if(f=u?Zs(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var k=q4;else if(vj(f))if(QE)k=Q4;else{k=G4;var S=Y4}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=X4);if(k&&(k=k(e,u))){XE(d,k,n,p);break e}S&&S(e,f,u),e==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&Fy(f,"number",f.value)}switch(S=u?Zs(u):window,e){case"focusin":(vj(S)||S.contentEditable==="true")&&(Xs=S,Jy=u,Fc=null);break;case"focusout":Fc=Jy=Xs=null;break;case"mousedown":ev=!0;break;case"contextmenu":case"mouseup":case"dragend":ev=!1,Sj(d,n,p);break;case"selectionchange":if(e$)break;case"keydown":case"keyup":Sj(d,n,p)}var A;if(m0)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Gs?YE(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(qE&&n.locale!=="ko"&&(Gs||T!=="onCompositionStart"?T==="onCompositionEnd"&&Gs&&(A=VE()):(Wa=p,p0="value"in Wa?Wa.value:Wa.textContent,Gs=!0)),S=Yp(u,T),0<S.length&&(T=new hj(T,e,null,n,p),d.push({event:T,listeners:S}),A?T.data=A:(A=GE(n),A!==null&&(T.data=A)))),(A=U4?W4(e,n):K4(e,n))&&(u=Yp(u,"onBeforeInput"),0<u.length&&(p=new hj("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=A))}sT(d,t)})}function du(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yp(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=iu(e,n),a!=null&&r.unshift(du(e,a,i)),a=iu(e,t),a!=null&&r.push(du(e,a,i))),e=e.return}return r}function _s(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Pj(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=iu(n,a),c!=null&&s.unshift(du(n,c,l))):i||(c=iu(n,a),c!=null&&s.push(du(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var i$=/\r\n?/g,a$=/\u0000|\uFFFD/g;function Aj(e){return(typeof e=="string"?e:""+e).replace(i$,`
38
+ `).replace(a$,"")}function Rd(e,t,n){if(t=Aj(t),Aj(e)!==t&&n)throw Error(be(425))}function Gp(){}var tv=null,nv=null;function rv(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 iv=typeof setTimeout=="function"?setTimeout:void 0,o$=typeof clearTimeout=="function"?clearTimeout:void 0,Ej=typeof Promise=="function"?Promise:void 0,s$=typeof queueMicrotask=="function"?queueMicrotask:typeof Ej<"u"?function(e){return Ej.resolve(null).then(e).catch(l$)}:iv;function l$(e){setTimeout(function(){throw e})}function jg(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),su(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);su(t)}function Ga(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 Tj(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 Wl=Math.random().toString(36).slice(2),Ii="__reactFiber$"+Wl,pu="__reactProps$"+Wl,fa="__reactContainer$"+Wl,av="__reactEvents$"+Wl,c$="__reactListeners$"+Wl,u$="__reactHandles$"+Wl;function Do(e){var t=e[Ii];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fa]||n[Ii]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tj(e);e!==null;){if(n=e[Ii])return n;e=Tj(e)}return t}e=n,n=e.parentNode}return null}function Uu(e){return e=e[Ii]||e[fa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Zs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(be(33))}function Ch(e){return e[pu]||null}var ov=[],Js=-1;function co(e){return{current:e}}function Lt(e){0>Js||(e.current=ov[Js],ov[Js]=null,Js--)}function Ot(e,t){Js++,ov[Js]=e.current,e.current=t}var io={},qn=co(io),fr=co(!1),rs=io;function jl(e,t){var n=e.type.contextTypes;if(!n)return io;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 hr(e){return e=e.childContextTypes,e!=null}function Xp(){Lt(fr),Lt(qn)}function Ij(e,t,n){if(qn.current!==io)throw Error(be(168));Ot(qn,t),Ot(fr,n)}function cT(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(be(108,Yz(e)||"Unknown",i));return qt({},n,r)}function Qp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||io,rs=qn.current,Ot(qn,e),Ot(fr,fr.current),!0}function Oj(e,t,n){var r=e.stateNode;if(!r)throw Error(be(169));n?(e=cT(e,t,rs),r.__reactInternalMemoizedMergedChildContext=e,Lt(fr),Lt(qn),Ot(qn,e)):Lt(fr),Ot(fr,n)}var ta=null,Ph=!1,Sg=!1;function uT(e){ta===null?ta=[e]:ta.push(e)}function d$(e){Ph=!0,uT(e)}function uo(){if(!Sg&&ta!==null){Sg=!0;var e=0,t=wt;try{var n=ta;for(wt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ta=null,Ph=!1}catch(i){throw ta!==null&&(ta=ta.slice(e+1)),RE(l0,uo),i}finally{wt=t,Sg=!1}}return null}var el=[],tl=0,Zp=null,Jp=0,$r=[],Br=0,is=null,ia=1,aa="";function Ao(e,t){el[tl++]=Jp,el[tl++]=Zp,Zp=e,Jp=t}function dT(e,t,n){$r[Br++]=ia,$r[Br++]=aa,$r[Br++]=is,is=e;var r=ia;e=aa;var i=32-li(r)-1;r&=~(1<<i),n+=1;var a=32-li(t)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,ia=1<<32-li(t)+i|n<<i|r,aa=a+e}else ia=1<<a|n<<i|r,aa=e}function y0(e){e.return!==null&&(Ao(e,1),dT(e,1,0))}function v0(e){for(;e===Zp;)Zp=el[--tl],el[tl]=null,Jp=el[--tl],el[tl]=null;for(;e===is;)is=$r[--Br],$r[Br]=null,aa=$r[--Br],$r[Br]=null,ia=$r[--Br],$r[Br]=null}var Pr=null,Sr=null,Bt=!1,ii=null;function pT(e,t){var n=Ur(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 Nj(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,Pr=e,Sr=Ga(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pr=e,Sr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=is!==null?{id:ia,overflow:aa}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ur(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Pr=e,Sr=null,!0):!1;default:return!1}}function sv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function lv(e){if(Bt){var t=Sr;if(t){var n=t;if(!Nj(e,t)){if(sv(e))throw Error(be(418));t=Ga(n.nextSibling);var r=Pr;t&&Nj(e,t)?pT(r,n):(e.flags=e.flags&-4097|2,Bt=!1,Pr=e)}}else{if(sv(e))throw Error(be(418));e.flags=e.flags&-4097|2,Bt=!1,Pr=e}}}function Mj(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pr=e}function Dd(e){if(e!==Pr)return!1;if(!Bt)return Mj(e),Bt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!rv(e.type,e.memoizedProps)),t&&(t=Sr)){if(sv(e))throw fT(),Error(be(418));for(;t;)pT(e,t),t=Ga(t.nextSibling)}if(Mj(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(be(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Sr=Ga(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Sr=null}}else Sr=Pr?Ga(e.stateNode.nextSibling):null;return!0}function fT(){for(var e=Sr;e;)e=Ga(e.nextSibling)}function Sl(){Sr=Pr=null,Bt=!1}function x0(e){ii===null?ii=[e]:ii.push(e)}var p$=ba.ReactCurrentBatchConfig;function pc(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(be(309));var r=n.stateNode}if(!r)throw Error(be(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(be(284));if(!n._owner)throw Error(be(290,e))}return e}function Ld(e,t){throw e=Object.prototype.toString.call(t),Error(be(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function _j(e){var t=e._init;return t(e._payload)}function hT(e){function t(y,b){if(e){var w=y.deletions;w===null?(y.deletions=[b],y.flags|=16):w.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function i(y,b){return y=Ja(y,b),y.index=0,y.sibling=null,y}function a(y,b,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<b?(y.flags|=2,b):w):(y.flags|=2,b)):(y.flags|=1048576,b)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,w,j){return b===null||b.tag!==6?(b=Ig(w,y.mode,j),b.return=y,b):(b=i(b,w),b.return=y,b)}function c(y,b,w,j){var k=w.type;return k===Ys?p(y,b,w.props.children,j,w.key):b!==null&&(b.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Da&&_j(k)===b.type)?(j=i(b,w.props),j.ref=pc(y,b,w),j.return=y,j):(j=Np(w.type,w.key,w.props,null,y.mode,j),j.ref=pc(y,b,w),j.return=y,j)}function u(y,b,w,j){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=Og(w,y.mode,j),b.return=y,b):(b=i(b,w.children||[]),b.return=y,b)}function p(y,b,w,j,k){return b===null||b.tag!==7?(b=Go(w,y.mode,j,k),b.return=y,b):(b=i(b,w),b.return=y,b)}function d(y,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=Ig(""+b,y.mode,w),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Pd:return w=Np(b.type,b.key,b.props,null,y.mode,w),w.ref=pc(y,null,b),w.return=y,w;case qs:return b=Og(b,y.mode,w),b.return=y,b;case Da:var j=b._init;return d(y,j(b._payload),w)}if(Oc(b)||sc(b))return b=Go(b,y.mode,w,null),b.return=y,b;Ld(y,b)}return null}function f(y,b,w,j){var k=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return k!==null?null:l(y,b,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Pd:return w.key===k?c(y,b,w,j):null;case qs:return w.key===k?u(y,b,w,j):null;case Da:return k=w._init,f(y,b,k(w._payload),j)}if(Oc(w)||sc(w))return k!==null?null:p(y,b,w,j,null);Ld(y,w)}return null}function m(y,b,w,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return y=y.get(w)||null,l(b,y,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Pd:return y=y.get(j.key===null?w:j.key)||null,c(b,y,j,k);case qs:return y=y.get(j.key===null?w:j.key)||null,u(b,y,j,k);case Da:var S=j._init;return m(y,b,w,S(j._payload),k)}if(Oc(j)||sc(j))return y=y.get(w)||null,p(b,y,j,k,null);Ld(b,j)}return null}function g(y,b,w,j){for(var k=null,S=null,A=b,T=b=0,D=null;A!==null&&T<w.length;T++){A.index>T?(D=A,A=null):D=A.sibling;var O=f(y,A,w[T],j);if(O===null){A===null&&(A=D);break}e&&A&&O.alternate===null&&t(y,A),b=a(O,b,T),S===null?k=O:S.sibling=O,S=O,A=D}if(T===w.length)return n(y,A),Bt&&Ao(y,T),k;if(A===null){for(;T<w.length;T++)A=d(y,w[T],j),A!==null&&(b=a(A,b,T),S===null?k=A:S.sibling=A,S=A);return Bt&&Ao(y,T),k}for(A=r(y,A);T<w.length;T++)D=m(A,y,T,w[T],j),D!==null&&(e&&D.alternate!==null&&A.delete(D.key===null?T:D.key),b=a(D,b,T),S===null?k=D:S.sibling=D,S=D);return e&&A.forEach(function(_){return t(y,_)}),Bt&&Ao(y,T),k}function v(y,b,w,j){var k=sc(w);if(typeof k!="function")throw Error(be(150));if(w=k.call(w),w==null)throw Error(be(151));for(var S=k=null,A=b,T=b=0,D=null,O=w.next();A!==null&&!O.done;T++,O=w.next()){A.index>T?(D=A,A=null):D=A.sibling;var _=f(y,A,O.value,j);if(_===null){A===null&&(A=D);break}e&&A&&_.alternate===null&&t(y,A),b=a(_,b,T),S===null?k=_:S.sibling=_,S=_,A=D}if(O.done)return n(y,A),Bt&&Ao(y,T),k;if(A===null){for(;!O.done;T++,O=w.next())O=d(y,O.value,j),O!==null&&(b=a(O,b,T),S===null?k=O:S.sibling=O,S=O);return Bt&&Ao(y,T),k}for(A=r(y,A);!O.done;T++,O=w.next())O=m(A,y,T,O.value,j),O!==null&&(e&&O.alternate!==null&&A.delete(O.key===null?T:O.key),b=a(O,b,T),S===null?k=O:S.sibling=O,S=O);return e&&A.forEach(function(R){return t(y,R)}),Bt&&Ao(y,T),k}function x(y,b,w,j){if(typeof w=="object"&&w!==null&&w.type===Ys&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Pd:e:{for(var k=w.key,S=b;S!==null;){if(S.key===k){if(k=w.type,k===Ys){if(S.tag===7){n(y,S.sibling),b=i(S,w.props.children),b.return=y,y=b;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Da&&_j(k)===S.type){n(y,S.sibling),b=i(S,w.props),b.ref=pc(y,S,w),b.return=y,y=b;break e}n(y,S);break}else t(y,S);S=S.sibling}w.type===Ys?(b=Go(w.props.children,y.mode,j,w.key),b.return=y,y=b):(j=Np(w.type,w.key,w.props,null,y.mode,j),j.ref=pc(y,b,w),j.return=y,y=j)}return s(y);case qs:e:{for(S=w.key;b!==null;){if(b.key===S)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(y,b.sibling),b=i(b,w.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Og(w,y.mode,j),b.return=y,y=b}return s(y);case Da:return S=w._init,x(y,b,S(w._payload),j)}if(Oc(w))return g(y,b,w,j);if(sc(w))return v(y,b,w,j);Ld(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(y,b.sibling),b=i(b,w),b.return=y,y=b):(n(y,b),b=Ig(w,y.mode,j),b.return=y,y=b),s(y)):n(y,b)}return x}var kl=hT(!0),mT=hT(!1),ef=co(null),tf=null,nl=null,b0=null;function w0(){b0=nl=tf=null}function j0(e){var t=ef.current;Lt(ef),e._currentValue=t}function cv(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 fl(e,t){tf=e,b0=nl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ur=!0),e.firstContext=null)}function Vr(e){var t=e._currentValue;if(b0!==e)if(e={context:e,memoizedValue:t,next:null},nl===null){if(tf===null)throw Error(be(308));nl=e,tf.dependencies={lanes:0,firstContext:e}}else nl=nl.next=e;return t}var Lo=null;function S0(e){Lo===null?Lo=[e]:Lo.push(e)}function gT(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,S0(t)):(n.next=i.next,i.next=n),t.interleaved=n,ha(e,r)}function ha(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 La=!1;function k0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yT(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 ca(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ft&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ha(e,n)}return i=r.interleaved,i===null?(t.next=t,S0(r)):(t.next=i.next,i.next=t),r.interleaved=t,ha(e,n)}function Pp(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,c0(e,n)}}function Rj(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 nf(e,t,n,r){var i=e.updateQueue;La=!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 f=l.lane,m=l.eventTime;if((r&f)===f){p!==null&&(p=p.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(f=t,m=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){d=g.call(m,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,f=typeof g=="function"?g.call(m,d,f):g,f==null)break e;d=qt({},d,f);break e;case 2:La=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else m={eventTime:m,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(u=p=m,c=d):p=p.next=m,s|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,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);os|=s,e.lanes=s,e.memoizedState=d}}function Dj(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(be(191,i));i.call(r)}}}var Wu={},Di=co(Wu),fu=co(Wu),hu=co(Wu);function zo(e){if(e===Wu)throw Error(be(174));return e}function C0(e,t){switch(Ot(hu,t),Ot(fu,e),Ot(Di,Wu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Wy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Wy(t,e)}Lt(Di),Ot(Di,t)}function Cl(){Lt(Di),Lt(fu),Lt(hu)}function vT(e){zo(hu.current);var t=zo(Di.current),n=Wy(t,e.type);t!==n&&(Ot(fu,e),Ot(Di,n))}function P0(e){fu.current===e&&(Lt(Di),Lt(fu))}var Kt=co(0);function rf(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 kg=[];function A0(){for(var e=0;e<kg.length;e++)kg[e]._workInProgressVersionPrimary=null;kg.length=0}var Ap=ba.ReactCurrentDispatcher,Cg=ba.ReactCurrentBatchConfig,as=0,Ht=null,gn=null,jn=null,af=!1,Uc=!1,mu=0,f$=0;function Bn(){throw Error(be(321))}function E0(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ui(e[n],t[n]))return!1;return!0}function T0(e,t,n,r,i,a){if(as=a,Ht=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ap.current=e===null||e.memoizedState===null?y$:v$,e=n(r,i),Uc){a=0;do{if(Uc=!1,mu=0,25<=a)throw Error(be(301));a+=1,jn=gn=null,t.updateQueue=null,Ap.current=x$,e=n(r,i)}while(Uc)}if(Ap.current=of,t=gn!==null&&gn.next!==null,as=0,jn=gn=Ht=null,af=!1,t)throw Error(be(300));return e}function I0(){var e=mu!==0;return mu=0,e}function Pi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?Ht.memoizedState=jn=e:jn=jn.next=e,jn}function qr(){if(gn===null){var e=Ht.alternate;e=e!==null?e.memoizedState:null}else e=gn.next;var t=jn===null?Ht.memoizedState:jn.next;if(t!==null)jn=t,gn=e;else{if(e===null)throw Error(be(310));gn=e,e={memoizedState:gn.memoizedState,baseState:gn.baseState,baseQueue:gn.baseQueue,queue:gn.queue,next:null},jn===null?Ht.memoizedState=jn=e:jn=jn.next=e}return jn}function gu(e,t){return typeof t=="function"?t(e):t}function Pg(e){var t=qr(),n=t.queue;if(n===null)throw Error(be(311));n.lastRenderedReducer=e;var r=gn,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((as&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,Ht.lanes|=p,os|=p}u=u.next}while(u!==null&&u!==a);c===null?s=r:c.next=l,ui(r,t.memoizedState)||(ur=!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,Ht.lanes|=a,os|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ag(e){var t=qr(),n=t.queue;if(n===null)throw Error(be(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);ui(a,t.memoizedState)||(ur=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function xT(){}function bT(e,t){var n=Ht,r=qr(),i=t(),a=!ui(r.memoizedState,i);if(a&&(r.memoizedState=i,ur=!0),r=r.queue,O0(ST.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||jn!==null&&jn.memoizedState.tag&1){if(n.flags|=2048,yu(9,jT.bind(null,n,r,i,t),void 0,null),kn===null)throw Error(be(349));as&30||wT(n,t,i)}return i}function wT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ht.updateQueue,t===null?(t={lastEffect:null,stores:null},Ht.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jT(e,t,n,r){t.value=n,t.getSnapshot=r,kT(t)&&CT(e)}function ST(e,t,n){return n(function(){kT(t)&&CT(e)})}function kT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ui(e,n)}catch{return!0}}function CT(e){var t=ha(e,1);t!==null&&ci(t,e,1,-1)}function Lj(e){var t=Pi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gu,lastRenderedState:e},t.queue=e,e=e.dispatch=g$.bind(null,Ht,e),[t.memoizedState,e]}function yu(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ht.updateQueue,t===null?(t={lastEffect:null,stores:null},Ht.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 PT(){return qr().memoizedState}function Ep(e,t,n,r){var i=Pi();Ht.flags|=e,i.memoizedState=yu(1|t,n,void 0,r===void 0?null:r)}function Ah(e,t,n,r){var i=qr();r=r===void 0?null:r;var a=void 0;if(gn!==null){var s=gn.memoizedState;if(a=s.destroy,r!==null&&E0(r,s.deps)){i.memoizedState=yu(t,n,a,r);return}}Ht.flags|=e,i.memoizedState=yu(1|t,n,a,r)}function zj(e,t){return Ep(8390656,8,e,t)}function O0(e,t){return Ah(2048,8,e,t)}function AT(e,t){return Ah(4,2,e,t)}function ET(e,t){return Ah(4,4,e,t)}function TT(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 IT(e,t,n){return n=n!=null?n.concat([e]):null,Ah(4,4,TT.bind(null,t,e),n)}function N0(){}function OT(e,t){var n=qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&E0(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function NT(e,t){var n=qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&E0(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function MT(e,t,n){return as&21?(ui(n,t)||(n=zE(),Ht.lanes|=n,os|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ur=!0),e.memoizedState=n)}function h$(e,t){var n=wt;wt=n!==0&&4>n?n:4,e(!0);var r=Cg.transition;Cg.transition={};try{e(!1),t()}finally{wt=n,Cg.transition=r}}function _T(){return qr().memoizedState}function m$(e,t,n){var r=Za(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},RT(e))DT(t,n);else if(n=gT(e,t,n,r),n!==null){var i=tr();ci(n,e,r,i),LT(n,t,r)}}function g$(e,t,n){var r=Za(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(RT(e))DT(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,ui(l,s)){var c=t.interleaved;c===null?(i.next=i,S0(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=gT(e,t,i,r),n!==null&&(i=tr(),ci(n,e,r,i),LT(n,t,r))}}function RT(e){var t=e.alternate;return e===Ht||t!==null&&t===Ht}function DT(e,t){Uc=af=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function LT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,c0(e,n)}}var of={readContext:Vr,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useInsertionEffect:Bn,useLayoutEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useMutableSource:Bn,useSyncExternalStore:Bn,useId:Bn,unstable_isNewReconciler:!1},y$={readContext:Vr,useCallback:function(e,t){return Pi().memoizedState=[e,t===void 0?null:t],e},useContext:Vr,useEffect:zj,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ep(4194308,4,TT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ep(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ep(4,2,e,t)},useMemo:function(e,t){var n=Pi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pi();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=m$.bind(null,Ht,e),[r.memoizedState,e]},useRef:function(e){var t=Pi();return e={current:e},t.memoizedState=e},useState:Lj,useDebugValue:N0,useDeferredValue:function(e){return Pi().memoizedState=e},useTransition:function(){var e=Lj(!1),t=e[0];return e=h$.bind(null,e[1]),Pi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ht,i=Pi();if(Bt){if(n===void 0)throw Error(be(407));n=n()}else{if(n=t(),kn===null)throw Error(be(349));as&30||wT(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,zj(ST.bind(null,r,a,e),[e]),r.flags|=2048,yu(9,jT.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Pi(),t=kn.identifierPrefix;if(Bt){var n=aa,r=ia;n=(r&~(1<<32-li(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=mu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=f$++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},v$={readContext:Vr,useCallback:OT,useContext:Vr,useEffect:O0,useImperativeHandle:IT,useInsertionEffect:AT,useLayoutEffect:ET,useMemo:NT,useReducer:Pg,useRef:PT,useState:function(){return Pg(gu)},useDebugValue:N0,useDeferredValue:function(e){var t=qr();return MT(t,gn.memoizedState,e)},useTransition:function(){var e=Pg(gu)[0],t=qr().memoizedState;return[e,t]},useMutableSource:xT,useSyncExternalStore:bT,useId:_T,unstable_isNewReconciler:!1},x$={readContext:Vr,useCallback:OT,useContext:Vr,useEffect:O0,useImperativeHandle:IT,useInsertionEffect:AT,useLayoutEffect:ET,useMemo:NT,useReducer:Ag,useRef:PT,useState:function(){return Ag(gu)},useDebugValue:N0,useDeferredValue:function(e){var t=qr();return gn===null?t.memoizedState=e:MT(t,gn.memoizedState,e)},useTransition:function(){var e=Ag(gu)[0],t=qr().memoizedState;return[e,t]},useMutableSource:xT,useSyncExternalStore:bT,useId:_T,unstable_isNewReconciler:!1};function ti(e,t){if(e&&e.defaultProps){t=qt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function uv(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:qt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Eh={isMounted:function(e){return(e=e._reactInternals)?xs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=tr(),i=Za(e),a=ca(r,i);a.payload=t,n!=null&&(a.callback=n),t=Xa(e,a,i),t!==null&&(ci(t,e,i,r),Pp(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=tr(),i=Za(e),a=ca(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Xa(e,a,i),t!==null&&(ci(t,e,i,r),Pp(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=tr(),r=Za(e),i=ca(n,r);i.tag=2,t!=null&&(i.callback=t),t=Xa(e,i,r),t!==null&&(ci(t,e,r,n),Pp(t,e,r))}};function $j(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?!cu(n,r)||!cu(i,a):!0}function zT(e,t,n){var r=!1,i=io,a=t.contextType;return typeof a=="object"&&a!==null?a=Vr(a):(i=hr(t)?rs:qn.current,r=t.contextTypes,a=(r=r!=null)?jl(e,i):io),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Eh,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&&Eh.enqueueReplaceState(t,t.state,null)}function dv(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},k0(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Vr(a):(a=hr(t)?rs:qn.current,i.context=jl(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(uv(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&&Eh.enqueueReplaceState(i,i.state,null),nf(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Pl(e,t){try{var n="",r=t;do n+=qz(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 Eg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function pv(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var b$=typeof WeakMap=="function"?WeakMap:Map;function $T(e,t,n){n=ca(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){lf||(lf=!0,jv=r),pv(e,t)},n}function BT(e,t,n){n=ca(-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(){pv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){pv(e,t),typeof r!="function"&&(Qa===null?Qa=new Set([this]):Qa.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Fj(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new b$;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=_$.bind(null,e,t,n),t.then(e,e))}function Uj(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 Wj(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=ca(-1,1),t.tag=2,Xa(n,t,1))),n.lanes|=1),e)}var w$=ba.ReactCurrentOwner,ur=!1;function Jn(e,t,n,r){t.child=e===null?mT(t,null,n,r):kl(t,e.child,n,r)}function Kj(e,t,n,r,i){n=n.render;var a=t.ref;return fl(t,i),r=T0(e,t,n,r,a,i),n=I0(),e!==null&&!ur?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ma(e,t,i)):(Bt&&n&&y0(t),t.flags|=1,Jn(e,t,r,i),t.child)}function Hj(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!B0(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,FT(e,t,a,r,i)):(e=Np(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:cu,n(s,r)&&e.ref===t.ref)return ma(e,t,i)}return t.flags|=1,e=Ja(a,r),e.ref=t.ref,e.return=t,t.child=e}function FT(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(cu(a,r)&&e.ref===t.ref)if(ur=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(ur=!0);else return t.lanes=e.lanes,ma(e,t,i)}return fv(e,t,n,r,i)}function UT(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},Ot(il,wr),wr|=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,Ot(il,wr),wr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Ot(il,wr),wr|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Ot(il,wr),wr|=r;return Jn(e,t,i,n),t.child}function WT(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function fv(e,t,n,r,i){var a=hr(n)?rs:qn.current;return a=jl(t,a),fl(t,i),n=T0(e,t,n,r,a,i),r=I0(),e!==null&&!ur?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ma(e,t,i)):(Bt&&r&&y0(t),t.flags|=1,Jn(e,t,n,i),t.child)}function Vj(e,t,n,r,i){if(hr(n)){var a=!0;Qp(t)}else a=!1;if(fl(t,i),t.stateNode===null)Tp(e,t),zT(t,n,r),dv(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=Vr(u):(u=hr(n)?rs:qn.current,u=jl(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),La=!1;var f=t.memoizedState;s.state=f,nf(t,r,s,i),c=t.memoizedState,l!==r||f!==c||fr.current||La?(typeof p=="function"&&(uv(t,n,p,r),c=t.memoizedState),(l=La||$j(t,n,l,r,f,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,yT(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ti(t.type,l),s.props=u,d=t.pendingProps,f=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=Vr(c):(c=hr(n)?rs:qn.current,c=jl(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||f!==c)&&Bj(t,s,r,c),La=!1,f=t.memoizedState,s.state=f,nf(t,r,s,i);var g=t.memoizedState;l!==d||f!==g||fr.current||La?(typeof m=="function"&&(uv(t,n,m,r),g=t.memoizedState),(u=La||$j(t,n,u,r,f,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&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===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&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return hv(e,t,n,r,a,i)}function hv(e,t,n,r,i,a){WT(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Oj(t,n,!1),ma(e,t,a);r=t.stateNode,w$.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=kl(t,e.child,null,a),t.child=kl(t,null,l,a)):Jn(e,t,l,a),t.memoizedState=r.state,i&&Oj(t,n,!0),t.child}function KT(e){var t=e.stateNode;t.pendingContext?Ij(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ij(e,t.context,!1),C0(e,t.containerInfo)}function qj(e,t,n,r,i){return Sl(),x0(i),t.flags|=256,Jn(e,t,n,r),t.child}var mv={dehydrated:null,treeContext:null,retryLane:0};function gv(e){return{baseLanes:e,cachePool:null,transitions:null}}function HT(e,t,n){var r=t.pendingProps,i=Kt.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),Ot(Kt,i&1),e===null)return lv(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=Oh(s,r,0,null),e=Go(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=gv(n),t.memoizedState=mv,e):M0(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return j$(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=Ja(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=Ja(l,a):(a=Go(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?gv(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=mv,r}return a=e.child,e=a.sibling,r=Ja(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 M0(e,t){return t=Oh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function zd(e,t,n,r){return r!==null&&x0(r),kl(t,e.child,null,n),e=M0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function j$(e,t,n,r,i,a,s){if(n)return t.flags&256?(t.flags&=-257,r=Eg(Error(be(422))),zd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Oh({mode:"visible",children:r.children},i,0,null),a=Go(a,i,s,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&kl(t,e.child,null,s),t.child.memoizedState=gv(s),t.memoizedState=mv,a);if(!(t.mode&1))return zd(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(be(419)),r=Eg(a,r,void 0),zd(e,t,s,r)}if(l=(s&e.childLanes)!==0,ur||l){if(r=kn,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,ha(e,i),ci(r,e,i,-1))}return $0(),r=Eg(Error(be(421))),zd(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=R$.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Sr=Ga(i.nextSibling),Pr=t,Bt=!0,ii=null,e!==null&&($r[Br++]=ia,$r[Br++]=aa,$r[Br++]=is,ia=e.id,aa=e.overflow,is=t),t=M0(t,r.children),t.flags|=4096,t)}function Yj(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),cv(e.return,t,n)}function Tg(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 VT(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Jn(e,t,r.children,n),r=Kt.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&&Yj(e,n,t);else if(e.tag===19)Yj(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(Ot(Kt,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&&rf(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tg(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&&rf(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tg(t,!0,n,null,a);break;case"together":Tg(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Tp(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ma(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),os|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(be(153));if(t.child!==null){for(e=t.child,n=Ja(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ja(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function S$(e,t,n){switch(t.tag){case 3:KT(t),Sl();break;case 5:vT(t);break;case 1:hr(t.type)&&Qp(t);break;case 4:C0(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ot(ef,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ot(Kt,Kt.current&1),t.flags|=128,null):n&t.child.childLanes?HT(e,t,n):(Ot(Kt,Kt.current&1),e=ma(e,t,n),e!==null?e.sibling:null);Ot(Kt,Kt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return VT(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ot(Kt,Kt.current),r)break;return null;case 22:case 23:return t.lanes=0,UT(e,t,n)}return ma(e,t,n)}var qT,yv,YT,GT;qT=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}};yv=function(){};YT=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,zo(Di.current);var a=null;switch(n){case"input":i=$y(e,i),r=$y(e,r),a=[];break;case"select":i=qt({},i,{value:void 0}),r=qt({},r,{value:void 0}),a=[];break;case"textarea":i=Uy(e,i),r=Uy(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Gp)}Ky(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"&&(nu.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"&&(nu.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&_t("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)}};GT=function(e,t,n,r){n!==r&&(t.flags|=4)};function fc(e,t){if(!Bt)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 Fn(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 k$(e,t,n){var r=t.pendingProps;switch(v0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fn(t),null;case 1:return hr(t.type)&&Xp(),Fn(t),null;case 3:return r=t.stateNode,Cl(),Lt(fr),Lt(qn),A0(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Dd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ii!==null&&(Cv(ii),ii=null))),yv(e,t),Fn(t),null;case 5:P0(t);var i=zo(hu.current);if(n=t.type,e!==null&&t.stateNode!=null)YT(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(be(166));return Fn(t),null}if(e=zo(Di.current),Dd(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Ii]=t,r[pu]=a,e=(t.mode&1)!==0,n){case"dialog":_t("cancel",r),_t("close",r);break;case"iframe":case"object":case"embed":_t("load",r);break;case"video":case"audio":for(i=0;i<Mc.length;i++)_t(Mc[i],r);break;case"source":_t("error",r);break;case"img":case"image":case"link":_t("error",r),_t("load",r);break;case"details":_t("toggle",r);break;case"input":rj(r,a),_t("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},_t("invalid",r);break;case"textarea":aj(r,a),_t("invalid",r)}Ky(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&&Rd(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Rd(r.textContent,l,e),i=["children",""+l]):nu.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&_t("scroll",r)}switch(n){case"input":Ad(r),ij(r,a,!0);break;case"textarea":Ad(r),oj(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Gp)}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=SE(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[Ii]=t,e[pu]=r,qT(e,t,!1,!1),t.stateNode=e;e:{switch(s=Hy(n,r),n){case"dialog":_t("cancel",e),_t("close",e),i=r;break;case"iframe":case"object":case"embed":_t("load",e),i=r;break;case"video":case"audio":for(i=0;i<Mc.length;i++)_t(Mc[i],e);i=r;break;case"source":_t("error",e),i=r;break;case"img":case"image":case"link":_t("error",e),_t("load",e),i=r;break;case"details":_t("toggle",e),i=r;break;case"input":rj(e,r),i=$y(e,r),_t("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=qt({},r,{value:void 0}),_t("invalid",e);break;case"textarea":aj(e,r),i=Uy(e,r),_t("invalid",e);break;default:i=r}Ky(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?PE(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&kE(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&ru(e,c):typeof c=="number"&&ru(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(nu.hasOwnProperty(a)?c!=null&&a==="onScroll"&&_t("scroll",e):c!=null&&r0(e,a,c,s))}switch(n){case"input":Ad(e),ij(e,r,!1);break;case"textarea":Ad(e),oj(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ro(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?cl(e,!!r.multiple,a,!1):r.defaultValue!=null&&cl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Gp)}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 Fn(t),null;case 6:if(e&&t.stateNode!=null)GT(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(be(166));if(n=zo(hu.current),zo(Di.current),Dd(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ii]=t,(a=r.nodeValue!==n)&&(e=Pr,e!==null))switch(e.tag){case 3:Rd(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Rd(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ii]=t,t.stateNode=r}return Fn(t),null;case 13:if(Lt(Kt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Bt&&Sr!==null&&t.mode&1&&!(t.flags&128))fT(),Sl(),t.flags|=98560,a=!1;else if(a=Dd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(be(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(be(317));a[Ii]=t}else Sl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fn(t),a=!1}else ii!==null&&(Cv(ii),ii=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||Kt.current&1?yn===0&&(yn=3):$0())),t.updateQueue!==null&&(t.flags|=4),Fn(t),null);case 4:return Cl(),yv(e,t),e===null&&uu(t.stateNode.containerInfo),Fn(t),null;case 10:return j0(t.type._context),Fn(t),null;case 17:return hr(t.type)&&Xp(),Fn(t),null;case 19:if(Lt(Kt),a=t.memoizedState,a===null)return Fn(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)fc(a,!1);else{if(yn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=rf(e),s!==null){for(t.flags|=128,fc(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 Ot(Kt,Kt.current&1|2),t.child}e=e.sibling}a.tail!==null&&nn()>Al&&(t.flags|=128,r=!0,fc(a,!1),t.lanes=4194304)}else{if(!r)if(e=rf(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fc(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Bt)return Fn(t),null}else 2*nn()-a.renderingStartTime>Al&&n!==1073741824&&(t.flags|=128,r=!0,fc(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=nn(),t.sibling=null,n=Kt.current,Ot(Kt,r?n&1|2:n&1),t):(Fn(t),null);case 22:case 23:return z0(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?wr&1073741824&&(Fn(t),t.subtreeFlags&6&&(t.flags|=8192)):Fn(t),null;case 24:return null;case 25:return null}throw Error(be(156,t.tag))}function C$(e,t){switch(v0(t),t.tag){case 1:return hr(t.type)&&Xp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cl(),Lt(fr),Lt(qn),A0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return P0(t),null;case 13:if(Lt(Kt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(be(340));Sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lt(Kt),null;case 4:return Cl(),null;case 10:return j0(t.type._context),null;case 22:case 23:return z0(),null;case 24:return null;default:return null}}var $d=!1,Kn=!1,P$=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function rl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Jt(e,t,r)}else n.current=null}function vv(e,t,n){try{n()}catch(r){Jt(e,t,r)}}var Gj=!1;function A$(e,t){if(tv=Vp,e=eT(),g0(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,f=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;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++u===i&&(l=s),f===a&&++p===r&&(c=s),(m=d.nextSibling)!==null)break;d=f,f=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(nv={focusedElem:e,selectionRange:n},Vp=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;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 v=g.memoizedProps,x=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:ti(t.type,v),x);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(be(163))}}catch(j){Jt(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return g=Gj,Gj=!1,g}function Wc(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&&vv(t,n,a)}i=i.next}while(i!==r)}}function Th(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 xv(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 XT(e){var t=e.alternate;t!==null&&(e.alternate=null,XT(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ii],delete t[pu],delete t[av],delete t[c$],delete t[u$])),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 QT(e){return e.tag===5||e.tag===3||e.tag===4}function Xj(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||QT(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 bv(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=Gp));else if(r!==4&&(e=e.child,e!==null))for(bv(e,t,n),e=e.sibling;e!==null;)bv(e,t,n),e=e.sibling}function wv(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(wv(e,t,n),e=e.sibling;e!==null;)wv(e,t,n),e=e.sibling}var Mn=null,ri=!1;function Ia(e,t,n){for(n=n.child;n!==null;)ZT(e,t,n),n=n.sibling}function ZT(e,t,n){if(Ri&&typeof Ri.onCommitFiberUnmount=="function")try{Ri.onCommitFiberUnmount(wh,n)}catch{}switch(n.tag){case 5:Kn||rl(n,t);case 6:var r=Mn,i=ri;Mn=null,Ia(e,t,n),Mn=r,ri=i,Mn!==null&&(ri?(e=Mn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Mn.removeChild(n.stateNode));break;case 18:Mn!==null&&(ri?(e=Mn,n=n.stateNode,e.nodeType===8?jg(e.parentNode,n):e.nodeType===1&&jg(e,n),su(e)):jg(Mn,n.stateNode));break;case 4:r=Mn,i=ri,Mn=n.stateNode.containerInfo,ri=!0,Ia(e,t,n),Mn=r,ri=i;break;case 0:case 11:case 14:case 15:if(!Kn&&(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)&&vv(n,t,s),i=i.next}while(i!==r)}Ia(e,t,n);break;case 1:if(!Kn&&(rl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Jt(n,t,l)}Ia(e,t,n);break;case 21:Ia(e,t,n);break;case 22:n.mode&1?(Kn=(r=Kn)||n.memoizedState!==null,Ia(e,t,n),Kn=r):Ia(e,t,n);break;default:Ia(e,t,n)}}function Qj(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new P$),t.forEach(function(r){var i=D$.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Zr(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:Mn=l.stateNode,ri=!1;break e;case 3:Mn=l.stateNode.containerInfo,ri=!0;break e;case 4:Mn=l.stateNode.containerInfo,ri=!0;break e}l=l.return}if(Mn===null)throw Error(be(160));ZT(a,s,i),Mn=null,ri=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){Jt(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)JT(t,e),t=t.sibling}function JT(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Zr(t,e),xi(e),r&4){try{Wc(3,e,e.return),Th(3,e)}catch(v){Jt(e,e.return,v)}try{Wc(5,e,e.return)}catch(v){Jt(e,e.return,v)}}break;case 1:Zr(t,e),xi(e),r&512&&n!==null&&rl(n,n.return);break;case 5:if(Zr(t,e),xi(e),r&512&&n!==null&&rl(n,n.return),e.flags&32){var i=e.stateNode;try{ru(i,"")}catch(v){Jt(e,e.return,v)}}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&&wE(i,a),Hy(l,s);var u=Hy(l,a);for(s=0;s<c.length;s+=2){var p=c[s],d=c[s+1];p==="style"?PE(i,d):p==="dangerouslySetInnerHTML"?kE(i,d):p==="children"?ru(i,d):r0(i,p,d,u)}switch(l){case"input":By(i,a);break;case"textarea":jE(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?cl(i,!!a.multiple,m,!1):f!==!!a.multiple&&(a.defaultValue!=null?cl(i,!!a.multiple,a.defaultValue,!0):cl(i,!!a.multiple,a.multiple?[]:"",!1))}i[pu]=a}catch(v){Jt(e,e.return,v)}}break;case 6:if(Zr(t,e),xi(e),r&4){if(e.stateNode===null)throw Error(be(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(v){Jt(e,e.return,v)}}break;case 3:if(Zr(t,e),xi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{su(t.containerInfo)}catch(v){Jt(e,e.return,v)}break;case 4:Zr(t,e),xi(e);break;case 13:Zr(t,e),xi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(D0=nn())),r&4&&Qj(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Kn=(u=Kn)||p,Zr(t,e),Kn=u):Zr(t,e),xi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!p&&e.mode&1)for(Ne=e,p=e.child;p!==null;){for(d=Ne=p;Ne!==null;){switch(f=Ne,m=f.child,f.tag){case 0:case 11:case 14:case 15:Wc(4,f,f.return);break;case 1:rl(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){Jt(r,n,v)}}break;case 5:rl(f,f.return);break;case 22:if(f.memoizedState!==null){Jj(d);continue}}m!==null?(m.return=f,Ne=m):Jj(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=CE("display",s))}catch(v){Jt(e,e.return,v)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){Jt(e,e.return,v)}}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:Zr(t,e),xi(e),r&4&&Qj(e);break;case 21:break;default:Zr(t,e),xi(e)}}function xi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(QT(n)){var r=n;break e}n=n.return}throw Error(be(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ru(i,""),r.flags&=-33);var a=Xj(e);wv(e,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Xj(e);bv(e,l,s);break;default:throw Error(be(161))}}catch(c){Jt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function E$(e,t,n){Ne=e,eI(e)}function eI(e,t,n){for(var r=(e.mode&1)!==0;Ne!==null;){var i=Ne,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||$d;if(!s){var l=i.alternate,c=l!==null&&l.memoizedState!==null||Kn;l=$d;var u=Kn;if($d=s,(Kn=c)&&!u)for(Ne=i;Ne!==null;)s=Ne,c=s.child,s.tag===22&&s.memoizedState!==null?eS(i):c!==null?(c.return=s,Ne=c):eS(i);for(;a!==null;)Ne=a,eI(a),a=a.sibling;Ne=i,$d=l,Kn=u}Zj(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Ne=a):Zj(e)}}function Zj(e){for(;Ne!==null;){var t=Ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Kn||Th(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Kn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ti(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Dj(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}Dj(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&&su(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(be(163))}Kn||t.flags&512&&xv(t)}catch(f){Jt(t,t.return,f)}}if(t===e){Ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function Jj(e){for(;Ne!==null;){var t=Ne;if(t===e){Ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function eS(e){for(;Ne!==null;){var t=Ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Th(4,t)}catch(c){Jt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){Jt(t,i,c)}}var a=t.return;try{xv(t)}catch(c){Jt(t,a,c)}break;case 5:var s=t.return;try{xv(t)}catch(c){Jt(t,s,c)}}}catch(c){Jt(t,t.return,c)}if(t===e){Ne=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Ne=l;break}Ne=t.return}}var T$=Math.ceil,sf=ba.ReactCurrentDispatcher,_0=ba.ReactCurrentOwner,Hr=ba.ReactCurrentBatchConfig,ft=0,kn=null,ln=null,zn=0,wr=0,il=co(0),yn=0,vu=null,os=0,Ih=0,R0=0,Kc=null,cr=null,D0=0,Al=1/0,Zi=null,lf=!1,jv=null,Qa=null,Bd=!1,Ka=null,cf=0,Hc=0,Sv=null,Ip=-1,Op=0;function tr(){return ft&6?nn():Ip!==-1?Ip:Ip=nn()}function Za(e){return e.mode&1?ft&2&&zn!==0?zn&-zn:p$.transition!==null?(Op===0&&(Op=zE()),Op):(e=wt,e!==0||(e=window.event,e=e===void 0?16:HE(e.type)),e):1}function ci(e,t,n,r){if(50<Hc)throw Hc=0,Sv=null,Error(be(185));Bu(e,n,r),(!(ft&2)||e!==kn)&&(e===kn&&(!(ft&2)&&(Ih|=n),yn===4&&Fa(e,zn)),mr(e,r),n===1&&ft===0&&!(t.mode&1)&&(Al=nn()+500,Ph&&uo()))}function mr(e,t){var n=e.callbackNode;p4(e,t);var r=Hp(e,e===kn?zn:0);if(r===0)n!==null&&cj(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&cj(n),t===1)e.tag===0?d$(tS.bind(null,e)):uT(tS.bind(null,e)),s$(function(){!(ft&6)&&uo()}),n=null;else{switch($E(r)){case 1:n=l0;break;case 4:n=DE;break;case 16:n=Kp;break;case 536870912:n=LE;break;default:n=Kp}n=lI(n,tI.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function tI(e,t){if(Ip=-1,Op=0,ft&6)throw Error(be(327));var n=e.callbackNode;if(hl()&&e.callbackNode!==n)return null;var r=Hp(e,e===kn?zn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=uf(e,r);else{t=r;var i=ft;ft|=2;var a=rI();(kn!==e||zn!==t)&&(Zi=null,Al=nn()+500,Yo(e,t));do try{N$();break}catch(l){nI(e,l)}while(!0);w0(),sf.current=a,ft=i,ln!==null?t=0:(kn=null,zn=0,t=yn)}if(t!==0){if(t===2&&(i=Xy(e),i!==0&&(r=i,t=kv(e,i))),t===1)throw n=vu,Yo(e,0),Fa(e,r),mr(e,nn()),n;if(t===6)Fa(e,r);else{if(i=e.current.alternate,!(r&30)&&!I$(i)&&(t=uf(e,r),t===2&&(a=Xy(e),a!==0&&(r=a,t=kv(e,a))),t===1))throw n=vu,Yo(e,0),Fa(e,r),mr(e,nn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(be(345));case 2:Eo(e,cr,Zi);break;case 3:if(Fa(e,r),(r&130023424)===r&&(t=D0+500-nn(),10<t)){if(Hp(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){tr(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=iv(Eo.bind(null,e,cr,Zi),t);break}Eo(e,cr,Zi);break;case 4:if(Fa(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-li(r);a=1<<s,s=t[s],s>i&&(i=s),r&=~a}if(r=i,r=nn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*T$(r/1960))-r,10<r){e.timeoutHandle=iv(Eo.bind(null,e,cr,Zi),r);break}Eo(e,cr,Zi);break;case 5:Eo(e,cr,Zi);break;default:throw Error(be(329))}}}return mr(e,nn()),e.callbackNode===n?tI.bind(null,e):null}function kv(e,t){var n=Kc;return e.current.memoizedState.isDehydrated&&(Yo(e,t).flags|=256),e=uf(e,t),e!==2&&(t=cr,cr=n,t!==null&&Cv(t)),e}function Cv(e){cr===null?cr=e:cr.push.apply(cr,e)}function I$(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(!ui(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 Fa(e,t){for(t&=~R0,t&=~Ih,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-li(t),r=1<<n;e[n]=-1,t&=~r}}function tS(e){if(ft&6)throw Error(be(327));hl();var t=Hp(e,0);if(!(t&1))return mr(e,nn()),null;var n=uf(e,t);if(e.tag!==0&&n===2){var r=Xy(e);r!==0&&(t=r,n=kv(e,r))}if(n===1)throw n=vu,Yo(e,0),Fa(e,t),mr(e,nn()),n;if(n===6)throw Error(be(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Eo(e,cr,Zi),mr(e,nn()),null}function L0(e,t){var n=ft;ft|=1;try{return e(t)}finally{ft=n,ft===0&&(Al=nn()+500,Ph&&uo())}}function ss(e){Ka!==null&&Ka.tag===0&&!(ft&6)&&hl();var t=ft;ft|=1;var n=Hr.transition,r=wt;try{if(Hr.transition=null,wt=1,e)return e()}finally{wt=r,Hr.transition=n,ft=t,!(ft&6)&&uo()}}function z0(){wr=il.current,Lt(il)}function Yo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,o$(n)),ln!==null)for(n=ln.return;n!==null;){var r=n;switch(v0(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Xp();break;case 3:Cl(),Lt(fr),Lt(qn),A0();break;case 5:P0(r);break;case 4:Cl();break;case 13:Lt(Kt);break;case 19:Lt(Kt);break;case 10:j0(r.type._context);break;case 22:case 23:z0()}n=n.return}if(kn=e,ln=e=Ja(e.current,null),zn=wr=t,yn=0,vu=null,R0=Ih=os=0,cr=Kc=null,Lo!==null){for(t=0;t<Lo.length;t++)if(n=Lo[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}Lo=null}return e}function nI(e,t){do{var n=ln;try{if(w0(),Ap.current=of,af){for(var r=Ht.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}af=!1}if(as=0,jn=gn=Ht=null,Uc=!1,mu=0,_0.current=null,n===null||n.return===null){yn=1,vu=t,ln=null;break}e:{var a=e,s=n.return,l=n,c=t;if(t=zn,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 f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var m=Uj(s);if(m!==null){m.flags&=-257,Wj(m,s,l,a,t),m.mode&1&&Fj(a,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){Fj(a,u,t),$0();break e}c=Error(be(426))}}else if(Bt&&l.mode&1){var x=Uj(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Wj(x,s,l,a,t),x0(Pl(c,l));break e}}a=c=Pl(c,l),yn!==4&&(yn=2),Kc===null?Kc=[a]:Kc.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=$T(a,c,t);Rj(a,y);break e;case 1:l=c;var b=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Qa===null||!Qa.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var j=BT(a,l,t);Rj(a,j);break e}}a=a.return}while(a!==null)}aI(n)}catch(k){t=k,ln===n&&n!==null&&(ln=n=n.return);continue}break}while(!0)}function rI(){var e=sf.current;return sf.current=of,e===null?of:e}function $0(){(yn===0||yn===3||yn===2)&&(yn=4),kn===null||!(os&268435455)&&!(Ih&268435455)||Fa(kn,zn)}function uf(e,t){var n=ft;ft|=2;var r=rI();(kn!==e||zn!==t)&&(Zi=null,Yo(e,t));do try{O$();break}catch(i){nI(e,i)}while(!0);if(w0(),ft=n,sf.current=r,ln!==null)throw Error(be(261));return kn=null,zn=0,yn}function O$(){for(;ln!==null;)iI(ln)}function N$(){for(;ln!==null&&!r4();)iI(ln)}function iI(e){var t=sI(e.alternate,e,wr);e.memoizedProps=e.pendingProps,t===null?aI(e):ln=t,_0.current=null}function aI(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=C$(n,t),n!==null){n.flags&=32767,ln=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{yn=6,ln=null;return}}else if(n=k$(n,t,wr),n!==null){ln=n;return}if(t=t.sibling,t!==null){ln=t;return}ln=t=e}while(t!==null);yn===0&&(yn=5)}function Eo(e,t,n){var r=wt,i=Hr.transition;try{Hr.transition=null,wt=1,M$(e,t,n,r)}finally{Hr.transition=i,wt=r}return null}function M$(e,t,n,r){do hl();while(Ka!==null);if(ft&6)throw Error(be(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(be(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(f4(e,a),e===kn&&(ln=kn=null,zn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Bd||(Bd=!0,lI(Kp,function(){return hl(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Hr.transition,Hr.transition=null;var s=wt;wt=1;var l=ft;ft|=4,_0.current=null,A$(e,n),JT(n,e),J4(nv),Vp=!!tv,nv=tv=null,e.current=n,E$(n),i4(),ft=l,wt=s,Hr.transition=a}else e.current=n;if(Bd&&(Bd=!1,Ka=e,cf=i),a=e.pendingLanes,a===0&&(Qa=null),s4(n.stateNode),mr(e,nn()),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(lf)throw lf=!1,e=jv,jv=null,e;return cf&1&&e.tag!==0&&hl(),a=e.pendingLanes,a&1?e===Sv?Hc++:(Hc=0,Sv=e):Hc=0,uo(),null}function hl(){if(Ka!==null){var e=$E(cf),t=Hr.transition,n=wt;try{if(Hr.transition=null,wt=16>e?16:e,Ka===null)var r=!1;else{if(e=Ka,Ka=null,cf=0,ft&6)throw Error(be(331));var i=ft;for(ft|=4,Ne=e.current;Ne!==null;){var a=Ne,s=a.child;if(Ne.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(Ne=u;Ne!==null;){var p=Ne;switch(p.tag){case 0:case 11:case 15:Wc(8,p,a)}var d=p.child;if(d!==null)d.return=p,Ne=d;else for(;Ne!==null;){p=Ne;var f=p.sibling,m=p.return;if(XT(p),p===u){Ne=null;break}if(f!==null){f.return=m,Ne=f;break}Ne=m}}}var g=a.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var x=v.sibling;v.sibling=null,v=x}while(v!==null)}}Ne=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,Ne=s;else e:for(;Ne!==null;){if(a=Ne,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Wc(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,Ne=y;break e}Ne=a.return}}var b=e.current;for(Ne=b;Ne!==null;){s=Ne;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,Ne=w;else e:for(s=b;Ne!==null;){if(l=Ne,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Th(9,l)}}catch(k){Jt(l,l.return,k)}if(l===s){Ne=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,Ne=j;break e}Ne=l.return}}if(ft=i,uo(),Ri&&typeof Ri.onPostCommitFiberRoot=="function")try{Ri.onPostCommitFiberRoot(wh,e)}catch{}r=!0}return r}finally{wt=n,Hr.transition=t}}return!1}function nS(e,t,n){t=Pl(n,t),t=$T(e,t,1),e=Xa(e,t,1),t=tr(),e!==null&&(Bu(e,1,t),mr(e,t))}function Jt(e,t,n){if(e.tag===3)nS(e,e,n);else for(;t!==null;){if(t.tag===3){nS(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Qa===null||!Qa.has(r))){e=Pl(n,e),e=BT(t,e,1),t=Xa(t,e,1),e=tr(),t!==null&&(Bu(t,1,e),mr(t,e));break}}t=t.return}}function _$(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=tr(),e.pingedLanes|=e.suspendedLanes&n,kn===e&&(zn&n)===n&&(yn===4||yn===3&&(zn&130023424)===zn&&500>nn()-D0?Yo(e,0):R0|=n),mr(e,t)}function oI(e,t){t===0&&(e.mode&1?(t=Id,Id<<=1,!(Id&130023424)&&(Id=4194304)):t=1);var n=tr();e=ha(e,t),e!==null&&(Bu(e,t,n),mr(e,n))}function R$(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),oI(e,n)}function D$(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(be(314))}r!==null&&r.delete(t),oI(e,n)}var sI;sI=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||fr.current)ur=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ur=!1,S$(e,t,n);ur=!!(e.flags&131072)}else ur=!1,Bt&&t.flags&1048576&&dT(t,Jp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Tp(e,t),e=t.pendingProps;var i=jl(t,qn.current);fl(t,n),i=T0(null,t,r,e,i,n);var a=I0();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,hr(r)?(a=!0,Qp(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,k0(t),i.updater=Eh,t.stateNode=i,i._reactInternals=t,dv(t,r,e,n),t=hv(null,t,r,!0,a,n)):(t.tag=0,Bt&&a&&y0(t),Jn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Tp(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=z$(r),e=ti(r,e),i){case 0:t=fv(null,t,r,e,n);break e;case 1:t=Vj(null,t,r,e,n);break e;case 11:t=Kj(null,t,r,e,n);break e;case 14:t=Hj(null,t,r,ti(r.type,e),n);break e}throw Error(be(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),fv(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),Vj(e,t,r,i,n);case 3:e:{if(KT(t),e===null)throw Error(be(387));r=t.pendingProps,a=t.memoizedState,i=a.element,yT(e,t),nf(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=Pl(Error(be(423)),t),t=qj(e,t,r,n,i);break e}else if(r!==i){i=Pl(Error(be(424)),t),t=qj(e,t,r,n,i);break e}else for(Sr=Ga(t.stateNode.containerInfo.firstChild),Pr=t,Bt=!0,ii=null,n=mT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Sl(),r===i){t=ma(e,t,n);break e}Jn(e,t,r,n)}t=t.child}return t;case 5:return vT(t),e===null&&lv(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,rv(r,i)?s=null:a!==null&&rv(r,a)&&(t.flags|=32),WT(e,t),Jn(e,t,s,n),t.child;case 6:return e===null&&lv(t),null;case 13:return HT(e,t,n);case 4:return C0(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=kl(t,null,r,n):Jn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),Kj(e,t,r,i,n);case 7:return Jn(e,t,t.pendingProps,n),t.child;case 8:return Jn(e,t,t.pendingProps.children,n),t.child;case 12:return Jn(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,Ot(ef,r._currentValue),r._currentValue=s,a!==null)if(ui(a.value,s)){if(a.children===i.children&&!fr.current){t=ma(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=ca(-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),cv(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(be(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),cv(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}Jn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,fl(t,n),i=Vr(i),r=r(i),t.flags|=1,Jn(e,t,r,n),t.child;case 14:return r=t.type,i=ti(r,t.pendingProps),i=ti(r.type,i),Hj(e,t,r,i,n);case 15:return FT(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ti(r,i),Tp(e,t),t.tag=1,hr(r)?(e=!0,Qp(t)):e=!1,fl(t,n),zT(t,r,i),dv(t,r,i,n),hv(null,t,r,!0,e,n);case 19:return VT(e,t,n);case 22:return UT(e,t,n)}throw Error(be(156,t.tag))};function lI(e,t){return RE(e,t)}function L$(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 Ur(e,t,n,r){return new L$(e,t,n,r)}function B0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function z$(e){if(typeof e=="function")return B0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===a0)return 11;if(e===o0)return 14}return 2}function Ja(e,t){var n=e.alternate;return n===null?(n=Ur(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 Np(e,t,n,r,i,a){var s=2;if(r=e,typeof e=="function")B0(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ys:return Go(n.children,i,a,t);case i0:s=8,i|=8;break;case Ry:return e=Ur(12,n,t,i|2),e.elementType=Ry,e.lanes=a,e;case Dy:return e=Ur(13,n,t,i),e.elementType=Dy,e.lanes=a,e;case Ly:return e=Ur(19,n,t,i),e.elementType=Ly,e.lanes=a,e;case vE:return Oh(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gE:s=10;break e;case yE:s=9;break e;case a0:s=11;break e;case o0:s=14;break e;case Da:s=16,r=null;break e}throw Error(be(130,e==null?e:typeof e,""))}return t=Ur(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Go(e,t,n,r){return e=Ur(7,e,r,t),e.lanes=n,e}function Oh(e,t,n,r){return e=Ur(22,e,r,t),e.elementType=vE,e.lanes=n,e.stateNode={isHidden:!1},e}function Ig(e,t,n){return e=Ur(6,e,null,t),e.lanes=n,e}function Og(e,t,n){return t=Ur(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $$(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=dg(0),this.expirationTimes=dg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dg(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function F0(e,t,n,r,i,a,s,l,c){return e=new $$(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ur(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},k0(a),e}function B$(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function cI(e){if(!e)return io;e=e._reactInternals;e:{if(xs(e)!==e||e.tag!==1)throw Error(be(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(hr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(be(171))}if(e.tag===1){var n=e.type;if(hr(n))return cT(e,n,t)}return t}function uI(e,t,n,r,i,a,s,l,c){return e=F0(n,r,!0,e,i,a,s,l,c),e.context=cI(null),n=e.current,r=tr(),i=Za(n),a=ca(r,i),a.callback=t??null,Xa(n,a,i),e.current.lanes=i,Bu(e,i,r),mr(e,r),e}function Nh(e,t,n,r){var i=t.current,a=tr(),s=Za(i);return n=cI(n),t.context===null?t.context=n:t.pendingContext=n,t=ca(a,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Xa(i,t,s),e!==null&&(ci(e,i,s,a),Pp(e,i,s)),s}function df(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 rS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function U0(e,t){rS(e,t),(e=e.alternate)&&rS(e,t)}function F$(){return null}var dI=typeof reportError=="function"?reportError:function(e){console.error(e)};function W0(e){this._internalRoot=e}Mh.prototype.render=W0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(be(409));Nh(e,t,null,null)};Mh.prototype.unmount=W0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ss(function(){Nh(null,e,null,null)}),t[fa]=null}};function Mh(e){this._internalRoot=e}Mh.prototype.unstable_scheduleHydration=function(e){if(e){var t=UE();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ba.length&&t!==0&&t<Ba[n].priority;n++);Ba.splice(n,0,e),n===0&&KE(e)}};function K0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _h(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function iS(){}function U$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=df(s);a.call(u)}}var s=uI(t,r,e,0,null,!1,!1,"",iS);return e._reactRootContainer=s,e[fa]=s.current,uu(e.nodeType===8?e.parentNode:e),ss(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=df(c);l.call(u)}}var c=F0(e,0,!1,null,null,!1,!1,"",iS);return e._reactRootContainer=c,e[fa]=c.current,uu(e.nodeType===8?e.parentNode:e),ss(function(){Nh(t,c,n,r)}),c}function Rh(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=df(s);l.call(c)}}Nh(t,s,e,i)}else s=U$(n,t,e,i,r);return df(s)}BE=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Nc(t.pendingLanes);n!==0&&(c0(t,n|1),mr(t,nn()),!(ft&6)&&(Al=nn()+500,uo()))}break;case 13:ss(function(){var r=ha(e,1);if(r!==null){var i=tr();ci(r,e,1,i)}}),U0(e,1)}};u0=function(e){if(e.tag===13){var t=ha(e,134217728);if(t!==null){var n=tr();ci(t,e,134217728,n)}U0(e,134217728)}};FE=function(e){if(e.tag===13){var t=Za(e),n=ha(e,t);if(n!==null){var r=tr();ci(n,e,t,r)}U0(e,t)}};UE=function(){return wt};WE=function(e,t){var n=wt;try{return wt=e,t()}finally{wt=n}};qy=function(e,t,n){switch(t){case"input":if(By(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=Ch(r);if(!i)throw Error(be(90));bE(r),By(r,i)}}}break;case"textarea":jE(e,n);break;case"select":t=n.value,t!=null&&cl(e,!!n.multiple,t,!1)}};TE=L0;IE=ss;var W$={usingClientEntryPoint:!1,Events:[Uu,Zs,Ch,AE,EE,L0]},hc={findFiberByHostInstance:Do,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},K$={bundleType:hc.bundleType,version:hc.version,rendererPackageName:hc.rendererPackageName,rendererConfig:hc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ba.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ME(e),e===null?null:e.stateNode},findFiberByHostInstance:hc.findFiberByHostInstance||F$,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 Fd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fd.isDisabled&&Fd.supportsFiber)try{wh=Fd.inject(K$),Ri=Fd}catch{}}Or.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W$;Or.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!K0(t))throw Error(be(200));return B$(e,t,null,n)};Or.createRoot=function(e,t){if(!K0(e))throw Error(be(299));var n=!1,r="",i=dI;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=F0(e,1,!1,null,null,n,!1,r,i),e[fa]=t.current,uu(e.nodeType===8?e.parentNode:e),new W0(t)};Or.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(be(188)):(e=Object.keys(e).join(","),Error(be(268,e)));return e=ME(t),e=e===null?null:e.stateNode,e};Or.flushSync=function(e){return ss(e)};Or.hydrate=function(e,t,n){if(!_h(t))throw Error(be(200));return Rh(null,e,t,!0,n)};Or.hydrateRoot=function(e,t,n){if(!K0(e))throw Error(be(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=dI;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=uI(t,null,e,1,n??null,i,!1,a,s),e[fa]=t.current,uu(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 Mh(t)};Or.render=function(e,t,n){if(!_h(t))throw Error(be(200));return Rh(null,e,t,!1,n)};Or.unmountComponentAtNode=function(e){if(!_h(e))throw Error(be(40));return e._reactRootContainer?(ss(function(){Rh(null,null,e,!1,function(){e._reactRootContainer=null,e[fa]=null})}),!0):!1};Or.unstable_batchedUpdates=L0;Or.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!_h(n))throw Error(be(200));if(e==null||e._reactInternals===void 0)throw Error(be(38));return Rh(e,t,n,!1,r)};Or.version="18.3.1-next-f1338f8080-20240426";function pI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pI)}catch(e){console.error(e)}}pI(),pE.exports=Or;var Ku=pE.exports,aS=Ku;My.createRoot=aS.createRoot,My.hydrateRoot=aS.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 xu(){return xu=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},xu.apply(null,arguments)}var Ha;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ha||(Ha={}));const oS="popstate";function H$(e){e===void 0&&(e={});function t(i,a){let{pathname:s="/",search:l="",hash:c=""}=bs(i.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Pv("",{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:pf(a))}function r(i,a){Dh(i.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")")}return q$(t,n,r,e)}function Vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Dh(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function V$(){return Math.random().toString(36).substr(2,8)}function sS(e,t){return{usr:e.state,key:e.key,idx:t}}function Pv(e,t,n,r){return n===void 0&&(n=null),xu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bs(t):t,{state:n,key:t&&t.key||r||V$()})}function pf(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 bs(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 q$(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,l=Ha.Pop,c=null,u=p();u==null&&(u=0,s.replaceState(xu({},s.state,{idx:u}),""));function p(){return(s.state||{idx:null}).idx}function d(){l=Ha.Pop;let x=p(),y=x==null?null:x-u;u=x,c&&c({action:l,location:v.location,delta:y})}function f(x,y){l=Ha.Push;let b=Pv(v.location,x,y);n&&n(b,x),u=p()+1;let w=sS(b,u),j=v.createHref(b);try{s.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(j)}a&&c&&c({action:l,location:v.location,delta:1})}function m(x,y){l=Ha.Replace;let b=Pv(v.location,x,y);n&&n(b,x),u=p();let w=sS(b,u),j=v.createHref(b);s.replaceState(w,"",j),a&&c&&c({action:l,location:v.location,delta:0})}function g(x){let y=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof x=="string"?x:pf(x);return b=b.replace(/ $/,"%20"),Vt(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let v={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(oS,d),c=x,()=>{i.removeEventListener(oS,d),c=null}},createHref(x){return t(i,x)},createURL:g,encodeLocation(x){let y=g(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:m,go(x){return s.go(x)}};return v}var lS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(lS||(lS={}));function Y$(e,t,n){return n===void 0&&(n="/"),G$(e,t,n)}function G$(e,t,n,r){let i=typeof t=="string"?bs(t):t,a=El(i.pathname||"/",n);if(a==null)return null;let s=fI(e);X$(s);let l=null,c=s3(a);for(let u=0;l==null&&u<s.length;++u)l=a3(s[u],c);return l}function fI(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("/")&&(Vt(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=eo([r,c.relativePath]),p=n.concat(c);a.children&&a.children.length>0&&(Vt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),fI(a.children,t,p,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:r3(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 hI(a.path))i(a,s,c)}),t}function hI(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=hI(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 X$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:i3(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Q$=/^:[\w-]+$/,Z$=3,J$=2,e3=1,t3=10,n3=-2,cS=e=>e==="*";function r3(e,t){let n=e.split("/"),r=n.length;return n.some(cS)&&(r+=n3),t&&(r+=J$),n.filter(i=>!cS(i)).reduce((i,a)=>i+(Q$.test(a)?Z$:a===""?e3:t3),r)}function i3(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 a3(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=Av({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},p),f=c.route;if(!d)return null;Object.assign(i,d.params),s.push({params:i,pathname:eo([a,d.pathname]),pathnameBase:p3(eo([a,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(a=eo([a,d.pathnameBase]))}return s}function Av(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=o3(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:f,isOptional:m}=p;if(f==="*"){let v=l[d]||"";s=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[d];return m&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function o3(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Dh(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 s3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Dh(!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 El(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 l3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,c3=e=>l3.test(e);function u3(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?bs(e):e,a;if(n)if(c3(n))a=n;else{if(n.includes("//")){let s=n;n=mI(n),Dh(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?a=uS(n.substring(1),"/"):a=uS(n,t)}else a=t;return{pathname:a,search:f3(r),hash:h3(i)}}function uS(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 Ng(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 d3(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function H0(e,t){let n=d3(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function V0(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=bs(e):(i=xu({},e),Vt(!i.pathname||!i.pathname.includes("?"),Ng("?","pathname","search",i)),Vt(!i.pathname||!i.pathname.includes("#"),Ng("#","pathname","hash",i)),Vt(!i.search||!i.search.includes("#"),Ng("#","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 f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=u3(i,l),u=s&&s!=="/"&&s.endsWith("/"),p=(a||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const mI=e=>e.replace(/\/\/+/g,"/"),eo=e=>mI(e.join("/")),p3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),f3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,h3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function m3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const gI=["post","put","patch","delete"];new Set(gI);const g3=["get",...gI];new Set(g3);/**
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 bu(){return bu=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},bu.apply(null,arguments)}const Lh=h.createContext(null),yI=h.createContext(null),wa=h.createContext(null),zh=h.createContext(null),ja=h.createContext({outlet:null,matches:[],isDataRoute:!1}),vI=h.createContext(null);function y3(e,t){let{relative:n}=t===void 0?{}:t;Kl()||Vt(!1);let{basename:r,navigator:i}=h.useContext(wa),{hash:a,pathname:s,search:l}=Bh(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:eo([r,s])),i.createHref({pathname:c,search:l,hash:a})}function Kl(){return h.useContext(zh)!=null}function Hl(){return Kl()||Vt(!1),h.useContext(zh).location}function xI(e){h.useContext(wa).static||h.useLayoutEffect(e)}function $h(){let{isDataRoute:e}=h.useContext(ja);return e?O3():v3()}function v3(){Kl()||Vt(!1);let e=h.useContext(Lh),{basename:t,future:n,navigator:r}=h.useContext(wa),{matches:i}=h.useContext(ja),{pathname:a}=Hl(),s=JSON.stringify(H0(i,n.v7_relativeSplatPath)),l=h.useRef(!1);return xI(()=>{l.current=!0}),h.useCallback(function(u,p){if(p===void 0&&(p={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let d=V0(u,JSON.parse(s),a,p.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:eo([t,d.pathname])),(p.replace?r.replace:r.push)(d,p.state,p)},[t,r,s,a,e])}function x3(){let{matches:e}=h.useContext(ja),t=e[e.length-1];return t?t.params:{}}function Bh(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(wa),{matches:i}=h.useContext(ja),{pathname:a}=Hl(),s=JSON.stringify(H0(i,r.v7_relativeSplatPath));return h.useMemo(()=>V0(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}function b3(e,t){return w3(e,t)}function w3(e,t,n,r){Kl()||Vt(!1);let{navigator:i}=h.useContext(wa),{matches:a}=h.useContext(ja),s=a[a.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=Hl(),p;if(t){var d;let x=typeof t=="string"?bs(t):t;c==="/"||(d=x.pathname)!=null&&d.startsWith(c)||Vt(!1),p=x}else p=u;let f=p.pathname||"/",m=f;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=Y$(e,{pathname:m}),v=P3(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:eo([c,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:eo([c,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,n,r);return t&&v?h.createElement(zh.Provider,{value:{location:bu({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Ha.Pop}},v):v}function j3(){let e=I3(),t=m3(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 h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:i},n):null,null)}const S3=h.createElement(j3,null);class k3 extends h.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?h.createElement(ja.Provider,{value:this.props.routeContext},h.createElement(vI.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function C3(e){let{routeContext:t,match:n,children:r}=e,i=h.useContext(Lh);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(ja.Provider,{value:t},r)}function P3(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||Vt(!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:f,errors:m}=n,g=d.route.loader&&f[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,f)=>{let m,g=!1,v=null,x=null;n&&(m=l&&d.route.id?l[d.route.id]:void 0,v=d.route.errorElement||S3,c&&(u<0&&f===0?(N3("route-fallback"),g=!0,x=null):u===f&&(g=!0,x=d.route.hydrateFallbackElement||null)));let y=t.concat(s.slice(0,f+1)),b=()=>{let w;return m?w=v:g?w=x:d.route.Component?w=h.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=p,h.createElement(C3,{match:d,routeContext:{outlet:p,matches:y,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?h.createElement(k3,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var bI=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(bI||{}),wI=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}(wI||{});function A3(e){let t=h.useContext(Lh);return t||Vt(!1),t}function E3(e){let t=h.useContext(yI);return t||Vt(!1),t}function T3(e){let t=h.useContext(ja);return t||Vt(!1),t}function jI(e){let t=T3(),n=t.matches[t.matches.length-1];return n.route.id||Vt(!1),n.route.id}function I3(){var e;let t=h.useContext(vI),n=E3(),r=jI();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function O3(){let{router:e}=A3(bI.UseNavigateStable),t=jI(wI.UseNavigateStable),n=h.useRef(!1);return xI(()=>{n.current=!0}),h.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,bu({fromRouteId:t},a)))},[e,t])}const dS={};function N3(e,t,n){dS[e]||(dS[e]=!0)}function M3(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function mc(e){let{to:t,replace:n,state:r,relative:i}=e;Kl()||Vt(!1);let{future:a,static:s}=h.useContext(wa),{matches:l}=h.useContext(ja),{pathname:c}=Hl(),u=$h(),p=V0(t,H0(l,a.v7_relativeSplatPath),c,i==="path"),d=JSON.stringify(p);return h.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function Zn(e){Vt(!1)}function _3(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Ha.Pop,navigator:a,static:s=!1,future:l}=e;Kl()&&Vt(!1);let c=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:c,navigator:a,static:s,future:bu({v7_relativeSplatPath:!1},l)}),[c,l,a,s]);typeof r=="string"&&(r=bs(r));let{pathname:p="/",search:d="",hash:f="",state:m=null,key:g="default"}=r,v=h.useMemo(()=>{let x=El(p,c);return x==null?null:{location:{pathname:x,search:d,hash:f,state:m,key:g},navigationType:i}},[c,p,d,f,m,g,i]);return v==null?null:h.createElement(wa.Provider,{value:u},h.createElement(zh.Provider,{children:n,value:v}))}function R3(e){let{children:t,location:n}=e;return b3(Ev(t),n)}new Promise(()=>{});function Ev(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(r,i)=>{if(!h.isValidElement(r))return;let a=[...t,i];if(r.type===h.Fragment){n.push.apply(n,Ev(r.props.children,a));return}r.type!==Zn&&Vt(!1),!r.props.index||!r.props.children||Vt(!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=Ev(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 ff(){return ff=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},ff.apply(null,arguments)}function SI(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 D3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function L3(e,t){return e.button===0&&(!t||t==="_self")&&!D3(e)}const z3=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],$3=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],B3="6";try{window.__reactRouterVersion=B3}catch{}const F3=h.createContext({isTransitioning:!1}),U3="startTransition",pS=uE[U3];function W3(e){let{basename:t,children:n,future:r,window:i}=e,a=h.useRef();a.current==null&&(a.current=H$({window:i,v5Compat:!0}));let s=a.current,[l,c]=h.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},p=h.useCallback(d=>{u&&pS?pS(()=>c(d)):c(d)},[c,u]);return h.useLayoutEffect(()=>s.listen(p),[s,p]),h.useEffect(()=>M3(r),[r]),h.createElement(_3,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const K3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",H3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,V3=h.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,f=SI(t,z3),{basename:m}=h.useContext(wa),g,v=!1;if(typeof u=="string"&&H3.test(u)&&(g=u,K3))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=El(j.pathname,m);j.origin===w.origin&&k!=null?u=k+j.search+j.hash:v=!0}catch{}let x=y3(u,{relative:i}),y=Y3(u,{replace:s,state:l,target:c,preventScrollReset:p,relative:i,viewTransition:d});function b(w){r&&r(w),w.defaultPrevented||y(w)}return h.createElement("a",ff({},f,{href:g||x,onClick:v||a?r:b,ref:n,target:c}))}),Jr=h.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=SI(t,$3),f=Bh(c,{relative:d.relative}),m=Hl(),g=h.useContext(yI),{navigator:v,basename:x}=h.useContext(wa),y=g!=null&&G3(f)&&u===!0,b=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,w=m.pathname,j=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(w=w.toLowerCase(),j=j?j.toLowerCase():null,b=b.toLowerCase()),j&&x&&(j=El(j,x)||j);const k=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let S=w===b||!s&&w.startsWith(b)&&w.charAt(k)==="/",A=j!=null&&(j===b||!s&&j.startsWith(b)&&j.charAt(b.length)==="/"),T={isActive:S,isPending:A,isTransitioning:y},D=S?r:void 0,O;typeof a=="function"?O=a(T):O=[a,S?"active":null,A?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let _=typeof l=="function"?l(T):l;return h.createElement(V3,ff({},d,{"aria-current":D,className:O,ref:n,style:_,to:c,viewTransition:u}),typeof p=="function"?p(T):p)});var Tv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Tv||(Tv={}));var fS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(fS||(fS={}));function q3(e){let t=h.useContext(Lh);return t||Vt(!1),t}function Y3(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:l}=t===void 0?{}:t,c=$h(),u=Hl(),p=Bh(e,{relative:s});return h.useCallback(d=>{if(L3(d,n)){d.preventDefault();let f=r!==void 0?r:pf(u)===pf(p);c(e,{replace:f,state:i,preventScrollReset:a,relative:s,viewTransition:l})}},[u,c,p,r,i,n,e,a,s,l])}function G3(e,t){t===void 0&&(t={});let n=h.useContext(F3);n==null&&Vt(!1);let{basename:r}=q3(Tv.useViewTransitionState),i=Bh(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=El(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=El(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Av(i.pathname,s)!=null||Av(i.pathname,a)!=null}function X3(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Q3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Z3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,J3={};function hS(e,t){return(J3.jsx?Z3:Q3).test(e)}const e6=/[ \t\n\f\r]/g;function t6(e){return typeof e=="object"?e.type==="text"?mS(e.value):!1:mS(e)}function mS(e){return e.replace(e6,"")===""}class Hu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Hu.prototype.normal={};Hu.prototype.property={};Hu.prototype.space=void 0;function kI(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Hu(n,r,t)}function Iv(e){return e.toLowerCase()}class vr{constructor(t,n){this.attribute=n,this.property=t}}vr.prototype.attribute="";vr.prototype.booleanish=!1;vr.prototype.boolean=!1;vr.prototype.commaOrSpaceSeparated=!1;vr.prototype.commaSeparated=!1;vr.prototype.defined=!1;vr.prototype.mustUseProperty=!1;vr.prototype.number=!1;vr.prototype.overloadedBoolean=!1;vr.prototype.property="";vr.prototype.spaceSeparated=!1;vr.prototype.space=void 0;let n6=0;const Ve=ws(),sn=ws(),Ov=ws(),we=ws(),Ct=ws(),Xo=ws(),br=ws();function ws(){return 2**++n6}const Nv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ve,booleanish:sn,commaOrSpaceSeparated:br,commaSeparated:Xo,number:we,overloadedBoolean:Ov,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),Mg=Object.keys(Nv);class q0 extends vr{constructor(t,n,r,i){let a=-1;if(super(t,n),gS(this,"space",i),typeof r=="number")for(;++a<Mg.length;){const s=Mg[a];gS(this,Mg[a],(r&Nv[s])===Nv[s])}}}q0.prototype.defined=!0;function gS(e,t,n){n&&(e[t]=n)}function Vl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new q0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Iv(r)]=r,n[Iv(a.attribute)]=r}return new Hu(t,n,e.space)}const CI=Vl({properties:{ariaActiveDescendant:null,ariaAtomic:sn,ariaAutoComplete:null,ariaBusy:sn,ariaChecked:sn,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:Ct,ariaCurrent:null,ariaDescribedBy:Ct,ariaDetails:null,ariaDisabled:sn,ariaDropEffect:Ct,ariaErrorMessage:null,ariaExpanded:sn,ariaFlowTo:Ct,ariaGrabbed:sn,ariaHasPopup:null,ariaHidden:sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ct,ariaLevel:we,ariaLive:null,ariaModal:sn,ariaMultiLine:sn,ariaMultiSelectable:sn,ariaOrientation:null,ariaOwns:Ct,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:sn,ariaReadOnly:sn,ariaRelevant:null,ariaRequired:sn,ariaRoleDescription:Ct,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:sn,ariaSetSize:we,ariaSort:null,ariaValueMax:we,ariaValueMin:we,ariaValueNow:we,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function PI(e,t){return t in e?e[t]:t}function AI(e,t){return PI(e,t.toLowerCase())}const r6=Vl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Xo,acceptCharset:Ct,accessKey:Ct,action:null,allow:null,allowFullScreen:Ve,allowPaymentRequest:Ve,allowUserMedia:Ve,alpha:Ve,alt:null,as:null,async:Ve,autoCapitalize:null,autoComplete:Ct,autoFocus:Ve,autoPlay:Ve,blocking:Ct,capture:null,charSet:null,checked:Ve,cite:null,className:Ct,closedBy:null,colorSpace:null,cols:we,colSpan:we,command:null,commandFor:null,content:null,contentEditable:sn,controls:Ve,controlsList:Ct,coords:we|Xo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ve,defer:Ve,dir:null,dirName:null,disabled:Ve,download:Ov,draggable:sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ve,formTarget:null,headers:Ct,height:we,hidden:Ov,high:we,href:null,hrefLang:null,htmlFor:Ct,httpEquiv:Ct,id:null,imageSizes:null,imageSrcSet:null,inert:Ve,inputMode:null,integrity:null,is:null,isMap:Ve,itemId:null,itemProp:Ct,itemRef:Ct,itemScope:Ve,itemType:Ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ve,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:Ve,muted:Ve,name:null,nonce:null,noModule:Ve,noValidate:Ve,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:Ve,optimum:we,pattern:null,ping:Ct,placeholder:null,playsInline:Ve,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ve,referrerPolicy:null,rel:Ct,required:Ve,reversed:Ve,rows:we,rowSpan:we,sandbox:Ct,scope:null,scoped:Ve,seamless:Ve,selected:Ve,shadowRootClonable:Ve,shadowRootCustomElementRegistry:Ve,shadowRootDelegatesFocus:Ve,shadowRootMode:null,shadowRootSerializable:Ve,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:we,step:null,style:null,tabIndex:we,target:null,title:null,translate:null,type:null,typeMustMatch:Ve,useMap:null,value:sn,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ct,axis:null,background:null,bgColor:null,border:we,borderColor:null,bottomMargin:we,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ve,declare:Ve,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:Ve,noHref:Ve,noShade:Ve,noWrap:Ve,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:sn,standby:null,summary:null,text:null,topMargin:we,valueType:null,version:null,vAlign:null,vLink:null,vSpace:we,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ve,disablePictureInPicture:Ve,disableRemotePlayback:Ve,exportParts:Xo,part:Ct,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:AI}),i6=Vl({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:br,accentHeight:we,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:we,amplitude:we,arabicForm:null,ascent:we,attributeName:null,attributeType:null,azimuth:we,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:we,by:null,calcMode:null,capHeight:we,className:Ct,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:we,diffuseConstant:we,direction:null,display:null,dur:null,divisor:we,dominantBaseline:null,download:Ve,dx:null,dy:null,edgeMode:null,editable:null,elevation:we,enableBackground:null,end:null,event:null,exponent:we,externalResourcesRequired:null,fill:null,fillOpacity:we,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:Xo,g2:Xo,glyphName:Xo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:we,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:we,horizOriginX:we,horizOriginY:we,id:null,ideographic:we,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:we,k:we,k1:we,k2:we,k3:we,k4:we,kernelMatrix:br,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:we,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:we,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:we,overlineThickness:we,paintOrder:null,panose1:null,path:null,pathLength:we,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:br,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:br,rev:br,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:br,requiredFeatures:br,requiredFonts:br,requiredFormats:br,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:we,specularExponent:we,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:we,strikethroughThickness:we,string:null,stroke:null,strokeDashArray:br,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:we,strokeOpacity:we,strokeWidth:null,style:null,surfaceScale:we,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:br,tabIndex:we,tableValues:null,target:null,targetX:we,targetY:we,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:br,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:we,underlineThickness:we,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:we,values:null,vAlphabetic:we,vMathematical:we,vectorEffect:null,vHanging:we,vIdeographic:we,version:null,vertAdvY:we,vertOriginX:we,vertOriginY:we,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:we,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:PI}),EI=Vl({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()}}),TI=Vl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:AI}),II=Vl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),a6={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"},o6=/[A-Z]/g,yS=/-[a-z]/g,s6=/^data[-\w.:]+$/i;function l6(e,t){const n=Iv(t);let r=t,i=vr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&s6.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(yS,u6);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!yS.test(a)){let s=a.replace(o6,c6);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=q0}return new i(r,t)}function c6(e){return"-"+e.toLowerCase()}function u6(e){return e.charAt(1).toUpperCase()}const d6=kI([CI,r6,EI,TI,II],"html"),Y0=kI([CI,i6,EI,TI,II],"svg");function p6(e){return e.join(" ").trim()}var G0={},vS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,f6=/\n/g,h6=/^\s*/,m6=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,g6=/^:\s*/,y6=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,v6=/^[;\s]*/,x6=/^\s+|\s+$/g,b6=`
68
+ `,xS="/",bS="*",_o="",w6="comment",j6="declaration";function S6(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 v=g.match(f6);v&&(n+=v.length);var x=g.lastIndexOf(b6);r=~x?g.length-x:r+g.length}function a(){var g={line:n,column:r};return function(v){return v.position=new s(g),u(),v}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(g){var v=new Error(t.source+":"+n+":"+r+": "+g);if(v.reason=g,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function c(g){var v=g.exec(e);if(v){var x=v[0];return i(x),e=e.slice(x.length),v}}function u(){c(h6)}function p(g){var v;for(g=g||[];v=d();)v!==!1&&g.push(v);return g}function d(){var g=a();if(!(xS!=e.charAt(0)||bS!=e.charAt(1))){for(var v=2;_o!=e.charAt(v)&&(bS!=e.charAt(v)||xS!=e.charAt(v+1));)++v;if(v+=2,_o===e.charAt(v-1))return l("End of comment missing");var x=e.slice(2,v-2);return r+=2,i(x),e=e.slice(v),r+=2,g({type:w6,comment:x})}}function f(){var g=a(),v=c(m6);if(v){if(d(),!c(g6))return l("property missing ':'");var x=c(y6),y=g({type:j6,property:wS(v[0].replace(vS,_o)),value:x?wS(x[0].replace(vS,_o)):_o});return c(v6),y}}function m(){var g=[];p(g);for(var v;v=f();)v!==!1&&(g.push(v),p(g));return g}return u(),m()}function wS(e){return e?e.replace(x6,_o):_o}var k6=S6,C6=bl&&bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(G0,"__esModule",{value:!0});G0.default=A6;const P6=C6(k6);function A6(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,P6.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 Fh={};Object.defineProperty(Fh,"__esModule",{value:!0});Fh.camelCase=void 0;var E6=/^--[a-zA-Z0-9_-]+$/,T6=/-([a-z])/g,I6=/^[^-]+$/,O6=/^-(webkit|moz|ms|o|khtml)-/,N6=/^-(ms)-/,M6=function(e){return!e||I6.test(e)||E6.test(e)},_6=function(e,t){return t.toUpperCase()},jS=function(e,t){return"".concat(t,"-")},R6=function(e,t){return t===void 0&&(t={}),M6(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(N6,jS):e=e.replace(O6,jS),e.replace(T6,_6))};Fh.camelCase=R6;var D6=bl&&bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},L6=D6(G0),z6=Fh;function Mv(e,t){var n={};return!e||typeof e!="string"||(0,L6.default)(e,function(r,i){r&&i&&(n[(0,z6.camelCase)(r,t)]=i)}),n}Mv.default=Mv;var $6=Mv;const B6=Bl($6),OI=NI("end"),X0=NI("start");function NI(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 F6(e){const t=X0(e),n=OI(e);if(t&&n)return{start:t,end:n}}function Vc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?SS(e.position):"start"in e||"end"in e?SS(e):"line"in e||"column"in e?_v(e):""}function _v(e){return kS(e&&e.line)+":"+kS(e&&e.column)}function SS(e){return _v(e&&e.start)+"-"+_v(e&&e.end)}function kS(e){return e&&typeof e=="number"?e:1}class Yn 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=Vc(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}}Yn.prototype.file="";Yn.prototype.name="";Yn.prototype.reason="";Yn.prototype.message="";Yn.prototype.stack="";Yn.prototype.column=void 0;Yn.prototype.line=void 0;Yn.prototype.ancestors=void 0;Yn.prototype.cause=void 0;Yn.prototype.fatal=void 0;Yn.prototype.place=void 0;Yn.prototype.ruleId=void 0;Yn.prototype.source=void 0;const Q0={}.hasOwnProperty,U6=new Map,W6=/[A-Z]/g,K6=new Set(["table","tbody","thead","tfoot","tr"]),H6=new Set(["td","th"]),MI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function V6(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=e8(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=J6(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"?Y0:d6,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=_I(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function _I(e,t,n){if(t.type==="element")return q6(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Y6(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return X6(e,t,n);if(t.type==="mdxjsEsm")return G6(e,t);if(t.type==="root")return Q6(e,t,n);if(t.type==="text")return Z6(e,t)}function q6(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Y0,e.schema=i),e.ancestors.push(t);const a=DI(e,t.tagName,!1),s=t8(e,t);let l=J0(e,t);return K6.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!t6(c):!0})),RI(e,s,a,t),Z0(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function Y6(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)}wu(e,t.position)}function G6(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wu(e,t.position)}function X6(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Y0,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:DI(e,t.name,!0),s=n8(e,t),l=J0(e,t);return RI(e,s,a,t),Z0(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function Q6(e,t,n){const r={};return Z0(r,J0(e,t)),e.create(t,e.Fragment,r,n)}function Z6(e,t){return t.value}function RI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Z0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function J6(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 e8(e,t){return n;function n(r,i,a,s){const l=Array.isArray(a.children),c=X0(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 t8(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Q0.call(t.properties,i)){const a=r8(e,i,t.properties[i]);if(a){const[s,l]=a;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&H6.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 n8(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 wu(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 wu(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function J0(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:U6;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=_I(e,a,s);l!==void 0&&n.push(l)}return n}function r8(e,t,n){const r=l6(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?X3(n):p6(n)),r.property==="style"){let i=typeof n=="object"?n:i8(e,String(n));return e.stylePropertyNameCase==="css"&&(i=a8(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?a6[r.property]||r.property:r.attribute,n]}}function i8(e,t){try{return B6(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Yn("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=MI+"#cannot-parse-style-attribute",i}}function DI(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=hS(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=hS(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Q0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);wu(e)}function wu(e,t){const n=new Yn("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=MI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function a8(e){const t={};let n;for(n in e)Q0.call(e,n)&&(t[o8(n)]=e[n]);return t}function o8(e){let t=e.replace(W6,s8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function s8(e){return"-"+e.toLowerCase()}const _g={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"]},l8={};function c8(e,t){const n=l8,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return LI(e,r,i)}function LI(e,t,n){if(u8(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 CS(e.children,t,n)}return Array.isArray(e)?CS(e,t,n):""}function CS(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=LI(e[i],t,n);return r.join("")}function u8(e){return!!(e&&typeof e=="object")}const PS=document.createElement("i");function eb(e){const t="&"+e+";";PS.innerHTML=t;const n=PS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function $i(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 Fr(e,t){return e.length>0?($i(e,e.length,0,t),e):t}const AS={}.hasOwnProperty;function d8(e){const t={};let n=-1;for(;++n<e.length;)p8(t,e[n]);return t}function p8(e,t){let n;for(n in t){const i=(AS.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){AS.call(i,s)||(i[s]=[]);const l=a[s];f8(i[s],Array.isArray(l)?l:l?[l]:[])}}}function f8(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);$i(e,0,0,r)}function zI(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 ml(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Oi=po(/[A-Za-z]/),kr=po(/[\dA-Za-z]/),h8=po(/[#-'*+\--9=?A-Z^-~]/);function Rv(e){return e!==null&&(e<32||e===127)}const Dv=po(/\d/),m8=po(/[\dA-Fa-f]/),g8=po(/[!-/:-@[-`{-~]/);function We(e){return e!==null&&e<-2}function gr(e){return e!==null&&(e<0||e===32)}function vt(e){return e===-2||e===-1||e===32}const y8=po(new RegExp("\\p{P}|\\p{S}","u")),v8=po(/\s/);function po(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ql(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&kr(e.charCodeAt(n+1))&&kr(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 Nt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(c){return vt(c)?(e.enter(n),l(c)):t(c)}function l(c){return vt(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const x8={tokenize:b8};function b8(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"),Nt(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 We(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),s)}}const w8={tokenize:j8},ES={tokenize:S8};function j8(e){const t=this,n=[];let r=0,i,a,s;return l;function l(w){if(r<n.length){const j=n[r];return t.containerState=j[1],e.attempt(j[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const j=t.events.length;let k=j,S;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){S=t.events[k][1].end;break}y(r);let A=j;for(;A<t.events.length;)t.events[A][1].end={...S},A++;return $i(t.events,k+1,0,t.events.slice(j)),t.events.length=A,u(w)}return l(w)}function u(w){if(r===n.length){if(!i)return f(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ES,p,d)(w)}function p(w){return i&&b(),y(r),f(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(w)}function f(w){return t.containerState={},e.attempt(ES,m,g)(w)}function m(w){return r++,n.push([t.currentConstruct,t.containerState]),f(w)}function g(w){if(w===null){i&&b(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),v(w)}function v(w){if(w===null){x(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return We(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),v)}function x(w,j){const k=t.sliceStream(w);if(j&&k.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.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 A=t.events.length;let T=A,D,O;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){O=t.events[T][1].end;break}D=!0}for(y(r),S=A;S<t.events.length;)t.events[S][1].end={...O},S++;$i(t.events,T+1,0,t.events.slice(A)),t.events.length=S}}function y(w){let j=n.length;for(;j-- >w;){const k=n[j];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function S8(e,t,n){return Nt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function TS(e){if(e===null||gr(e)||v8(e))return 1;if(y8(e))return 2}function tb(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 Lv={name:"attention",resolveAll:k8,tokenize:C8};function k8(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},f={...e[n][1].start};IS(d,-c),IS(f,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:f},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=Fr(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Fr(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),u=Fr(u,tb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Fr(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=Fr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,$i(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 C8(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=TS(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=TS(c),d=!p||p===2&&i||n.includes(c),f=!i||i===2&&p||n.includes(r);return u._open=!!(a===42?d:d&&(i||!f)),u._close=!!(a===42?f:f&&(p||!d)),t(c)}}function IS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const P8={name:"autolink",tokenize:A8};function A8(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 Oi(m)?(e.consume(m),s):m===64?n(m):u(m)}function s(m){return m===43||m===45||m===46||kr(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||kr(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||Rv(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),p):h8(m)?(e.consume(m),u):n(m)}function p(m){return kr(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):f(m)}function f(m){if((m===45||kr(m))&&r++<63){const g=m===45?f:d;return e.consume(m),g}return n(m)}}const Uh={partial:!0,tokenize:E8};function E8(e,t,n){return r;function r(a){return vt(a)?Nt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||We(a)?t(a):n(a)}}const $I={continuation:{tokenize:I8},exit:O8,name:"blockQuote",tokenize:T8};function T8(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 vt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function I8(e,t,n){const r=this;return i;function i(s){return vt(s)?Nt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt($I,t,n)(s)}}function O8(e){e.exit("blockQuote")}const BI={name:"characterEscape",tokenize:N8};function N8(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 g8(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const FI={name:"characterReference",tokenize:M8};function M8(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=kr,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=m8,p):(e.enter("characterReferenceValue"),a=7,s=Dv,p(d))}function p(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return s===kr&&!eb(r.sliceSerialize(f))?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 OS={partial:!0,tokenize:R8},NS={concrete:!0,name:"codeFenced",tokenize:_8};function _8(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 A=r.events[r.events.length-1];return a=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[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"),vt(S)?Nt(e,d,"whitespace")(S):d(S))}function d(S){return S===null||We(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(OS,v,j)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||We(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):vt(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Nt(e,m,"whitespace")(S)):S===96&&S===l?n(S):(e.consume(S),f)}function m(S){return S===null||We(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||We(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===l?n(S):(e.consume(S),g)}function v(S){return e.attempt(i,j,x)(S)}function x(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return a>0&&vt(S)?Nt(e,b,"linePrefix",a+1)(S):b(S)}function b(S){return S===null||We(S)?e.check(OS,v,j)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||We(S)?(e.exit("codeFlowValue"),b(S)):(e.consume(S),w)}function j(S){return e.exit("codeFenced"),t(S)}function k(S,A,T){let D=0;return O;function O(I){return S.enter("lineEnding"),S.consume(I),S.exit("lineEnding"),_}function _(I){return S.enter("codeFencedFence"),vt(I)?Nt(S,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):R(I)}function R(I){return I===l?(S.enter("codeFencedFenceSequence"),X(I)):T(I)}function X(I){return I===l?(D++,S.consume(I),X):D>=s?(S.exit("codeFencedFenceSequence"),vt(I)?Nt(S,V,"whitespace")(I):V(I)):T(I)}function V(I){return I===null||We(I)?(S.exit("codeFencedFence"),A(I)):T(I)}}}function R8(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 Rg={name:"codeIndented",tokenize:L8},D8={partial:!0,tokenize:z8};function L8(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Nt(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):We(u)?e.attempt(D8,s,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||We(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function z8(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):We(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Nt(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):We(s)?i(s):n(s)}}const $8={name:"codeText",previous:F8,resolve:B8,tokenize:U8};function B8(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 F8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function U8(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)):We(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||We(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 W8{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&&gc(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),gc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),gc(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);gc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);gc(this.left,n.reverse())}}}function gc(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 UI(e){const t={};let n=-1,r,i,a,s,l,c,u;const p=new W8(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,K8(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 $i(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!u}function K8(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,f=-1,m=n,g=0,v=0;const x=[v];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;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(v=f+1,x.push(v),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(),f=x.length;f--;){const y=l.slice(x[f],x[f+1]),b=a.pop();c.push([b,b+y.length-1]),e.splice(b,2,y)}for(c.reverse(),f=-1;++f<c.length;)u[g+c[f][0]]=g+c[f][1],g+=c[f][1]-c[f][0]-1;return u}const H8={resolve:q8,tokenize:Y8},V8={partial:!0,tokenize:G8};function q8(e){return UI(e),e}function Y8(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):We(l)?e.check(V8,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 G8(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Nt(e,a,"linePrefix")}function a(s){if(s===null||We(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 WI(e,t,n,r,i,a,s,l,c){const u=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(y),e.exit(a),f):y===null||y===32||y===41||Rv(y)?n(y):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(y))}function f(y){return y===62?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||We(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function v(y){return!p&&(y===null||y===41||gr(y))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(y)):p<u&&y===40?(e.consume(y),p++,v):y===41?(e.consume(y),p--,v):y===null||y===32||y===40||Rv(y)?n(y):(e.consume(y),y===92?x:v)}function x(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}function KI(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):We(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||We(m)||l++>999?(e.exit("chunkString"),p(m)):(e.consume(m),c||(c=!vt(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),l++,d):d(m)}}function HI(e,t,n,r,i,a){let s;return l;function l(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),s=f===40?41:f,c):n(f)}function c(f){return f===s?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(a),u(f))}function u(f){return f===s?(e.exit(a),c(s)):f===null?n(f):We(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Nt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===s||f===null||We(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:p)}function d(f){return f===s||f===92?(e.consume(f),p):p(f)}}function qc(e,t){let n;return r;function r(i){return We(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):vt(i)?Nt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const X8={name:"definition",tokenize:Z8},Q8={partial:!0,tokenize:J8};function Z8(e,t,n){const r=this;let i;return a;function a(m){return e.enter("definition"),s(m)}function s(m){return KI.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return i=ml(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 gr(m)?qc(e,u)(m):u(m)}function u(m){return WI(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function p(m){return e.attempt(Q8,d,d)(m)}function d(m){return vt(m)?Nt(e,f,"whitespace")(m):f(m)}function f(m){return m===null||We(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function J8(e,t,n){return r;function r(l){return gr(l)?qc(e,i)(l):n(l)}function i(l){return HI(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return vt(l)?Nt(e,s,"whitespace")(l):s(l)}function s(l){return l===null||We(l)?t(l):n(l)}}const eB={name:"hardBreakEscape",tokenize:tB};function tB(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return We(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const nB={name:"headingAtx",resolve:rB,tokenize:iB};function rB(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"},$i(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function iB(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||gr(p)?(e.exit("atxHeadingSequence"),l(p)):n(p)}function l(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||We(p)?(e.exit("atxHeading"),t(p)):vt(p)?Nt(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||gr(p)?(e.exit("atxHeadingText"),l(p)):(e.consume(p),u)}}const aB=["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"],MS=["pre","script","style","textarea"],oB={concrete:!0,name:"htmlFlow",resolveTo:cB,tokenize:uB},sB={partial:!0,tokenize:pB},lB={partial:!0,tokenize:dB};function cB(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 uB(e,t,n){const r=this;let i,a,s,l,c;return u;function u(E){return p(E)}function p(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),d}function d(E){return E===33?(e.consume(E),f):E===47?(e.consume(E),a=!0,v):E===63?(e.consume(E),i=3,r.interrupt?t:P):Oi(E)?(e.consume(E),s=String.fromCharCode(E),x):n(E)}function f(E){return E===45?(e.consume(E),i=2,m):E===91?(e.consume(E),i=5,l=0,g):Oi(E)?(e.consume(E),i=4,r.interrupt?t:P):n(E)}function m(E){return E===45?(e.consume(E),r.interrupt?t:P):n(E)}function g(E){const he="CDATA[";return E===he.charCodeAt(l++)?(e.consume(E),l===he.length?r.interrupt?t:R:g):n(E)}function v(E){return Oi(E)?(e.consume(E),s=String.fromCharCode(E),x):n(E)}function x(E){if(E===null||E===47||E===62||gr(E)){const he=E===47,ye=s.toLowerCase();return!he&&!a&&MS.includes(ye)?(i=1,r.interrupt?t(E):R(E)):aB.includes(s.toLowerCase())?(i=6,he?(e.consume(E),y):r.interrupt?t(E):R(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):a?b(E):w(E))}return E===45||kr(E)?(e.consume(E),s+=String.fromCharCode(E),x):n(E)}function y(E){return E===62?(e.consume(E),r.interrupt?t:R):n(E)}function b(E){return vt(E)?(e.consume(E),b):O(E)}function w(E){return E===47?(e.consume(E),O):E===58||E===95||Oi(E)?(e.consume(E),j):vt(E)?(e.consume(E),w):O(E)}function j(E){return E===45||E===46||E===58||E===95||kr(E)?(e.consume(E),j):k(E)}function k(E){return E===61?(e.consume(E),S):vt(E)?(e.consume(E),k):w(E)}function S(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),c=E,A):vt(E)?(e.consume(E),S):T(E)}function A(E){return E===c?(e.consume(E),c=null,D):E===null||We(E)?n(E):(e.consume(E),A)}function T(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||gr(E)?k(E):(e.consume(E),T)}function D(E){return E===47||E===62||vt(E)?w(E):n(E)}function O(E){return E===62?(e.consume(E),_):n(E)}function _(E){return E===null||We(E)?R(E):vt(E)?(e.consume(E),_):n(E)}function R(E){return E===45&&i===2?(e.consume(E),$):E===60&&i===1?(e.consume(E),H):E===62&&i===4?(e.consume(E),U):E===63&&i===3?(e.consume(E),P):E===93&&i===5?(e.consume(E),W):We(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(sB,le,X)(E)):E===null||We(E)?(e.exit("htmlFlowData"),X(E)):(e.consume(E),R)}function X(E){return e.check(lB,V,le)(E)}function V(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),I}function I(E){return E===null||We(E)?X(E):(e.enter("htmlFlowData"),R(E))}function $(E){return E===45?(e.consume(E),P):R(E)}function H(E){return E===47?(e.consume(E),s="",N):R(E)}function N(E){if(E===62){const he=s.toLowerCase();return MS.includes(he)?(e.consume(E),U):R(E)}return Oi(E)&&s.length<8?(e.consume(E),s+=String.fromCharCode(E),N):R(E)}function W(E){return E===93?(e.consume(E),P):R(E)}function P(E){return E===62?(e.consume(E),U):E===45&&i===2?(e.consume(E),P):R(E)}function U(E){return E===null||We(E)?(e.exit("htmlFlowData"),le(E)):(e.consume(E),U)}function le(E){return e.exit("htmlFlow"),t(E)}}function dB(e,t,n){const r=this;return i;function i(s){return We(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 pB(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Uh,t,n)}}const fB={name:"htmlText",tokenize:hB};function hB(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),w):Oi(P)?(e.consume(P),T):n(P)}function u(P){return P===45?(e.consume(P),p):P===91?(e.consume(P),a=0,g):Oi(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),f):We(P)?(s=d,H(P)):(e.consume(P),d)}function f(P){return P===45?(e.consume(P),m):d(P)}function m(P){return P===62?$(P):P===45?f(P):d(P)}function g(P){const U="CDATA[";return P===U.charCodeAt(a++)?(e.consume(P),a===U.length?v:g):n(P)}function v(P){return P===null?n(P):P===93?(e.consume(P),x):We(P)?(s=v,H(P)):(e.consume(P),v)}function x(P){return P===93?(e.consume(P),y):v(P)}function y(P){return P===62?$(P):P===93?(e.consume(P),y):v(P)}function b(P){return P===null||P===62?$(P):We(P)?(s=b,H(P)):(e.consume(P),b)}function w(P){return P===null?n(P):P===63?(e.consume(P),j):We(P)?(s=w,H(P)):(e.consume(P),w)}function j(P){return P===62?$(P):w(P)}function k(P){return Oi(P)?(e.consume(P),S):n(P)}function S(P){return P===45||kr(P)?(e.consume(P),S):A(P)}function A(P){return We(P)?(s=A,H(P)):vt(P)?(e.consume(P),A):$(P)}function T(P){return P===45||kr(P)?(e.consume(P),T):P===47||P===62||gr(P)?D(P):n(P)}function D(P){return P===47?(e.consume(P),$):P===58||P===95||Oi(P)?(e.consume(P),O):We(P)?(s=D,H(P)):vt(P)?(e.consume(P),D):$(P)}function O(P){return P===45||P===46||P===58||P===95||kr(P)?(e.consume(P),O):_(P)}function _(P){return P===61?(e.consume(P),R):We(P)?(s=_,H(P)):vt(P)?(e.consume(P),_):D(P)}function R(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),i=P,X):We(P)?(s=R,H(P)):vt(P)?(e.consume(P),R):(e.consume(P),V)}function X(P){return P===i?(e.consume(P),i=void 0,I):P===null?n(P):We(P)?(s=X,H(P)):(e.consume(P),X)}function V(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||gr(P)?D(P):(e.consume(P),V)}function I(P){return P===47||P===62||gr(P)?D(P):n(P)}function $(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function H(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),N}function N(P){return vt(P)?Nt(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):W(P)}function W(P){return e.enter("htmlTextData"),s(P)}}const nb={name:"labelEnd",resolveAll:vB,resolveTo:xB,tokenize:bB},mB={tokenize:wB},gB={tokenize:jB},yB={tokenize:SB};function vB(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&&$i(e,0,e.length,n),e}function xB(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=Fr(l,e.slice(a+1,a+r+3)),l=Fr(l,[["enter",p,t]]),l=Fr(l,tb(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),l=Fr(l,[["exit",p,t],e[s-2],e[s-1],["exit",u,t]]),l=Fr(l,e.slice(s+1)),l=Fr(l,[["exit",c,t]]),$i(e,a,e.length,l),e}function bB(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(f){return a?a._inactive?d(f):(s=r.parser.defined.includes(ml(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),c):n(f)}function c(f){return f===40?e.attempt(mB,p,s?p:d)(f):f===91?e.attempt(gB,p,s?u:d)(f):s?p(f):d(f)}function u(f){return e.attempt(yB,p,d)(f)}function p(f){return t(f)}function d(f){return a._balanced=!0,n(f)}}function wB(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 gr(d)?qc(e,a)(d):a(d)}function a(d){return d===41?p(d):WI(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return gr(d)?qc(e,c)(d):p(d)}function l(d){return n(d)}function c(d){return d===34||d===39||d===40?HI(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):p(d)}function u(d){return gr(d)?qc(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 jB(e,t,n){const r=this;return i;function i(l){return KI.call(r,e,a,s,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(ml(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function SB(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 kB={name:"labelStartImage",resolveAll:nb.resolveAll,tokenize:CB};function CB(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 PB={name:"labelStartLink",resolveAll:nb.resolveAll,tokenize:AB};function AB(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 Dg={name:"lineEnding",tokenize:EB};function EB(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Nt(e,t,"linePrefix")}}const Mp={name:"thematicBreak",tokenize:TB};function TB(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||We(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),vt(u)?Nt(e,l,"whitespace")(u):l(u))}}const lr={continuation:{tokenize:MB},exit:RB,name:"list",tokenize:NB},IB={partial:!0,tokenize:DB},OB={partial:!0,tokenize:_B};function NB(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:Dv(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(Mp,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 Dv(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(Uh,r.interrupt?n:p,e.attempt(IB,f,d))}function p(m){return r.containerState.initialBlankLine=!0,a++,f(m)}function d(m){return vt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function MB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Uh,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Nt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!vt(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(OB,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Nt(e,e.attempt(lr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function _B(e,t,n){const r=this;return Nt(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 RB(e){e.exit(this.containerState.type)}function DB(e,t,n){const r=this;return Nt(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!vt(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const _S={name:"setextUnderline",resolveTo:LB,tokenize:zB};function LB(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 zB(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"),vt(u)?Nt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||We(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const $B={tokenize:BB};function BB(e){const t=this,n=e.attempt(Uh,r,e.attempt(this.parser.constructs.flowInitial,i,Nt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(H8,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 FB={resolveAll:qI()},UB=VI("string"),WB=VI("text");function VI(e){return{resolveAll:qI(e==="text"?KB: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 f=-1;if(d)for(;++f<d.length;){const m=d[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function qI(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 KB(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 HB={42:lr,43:lr,45:lr,48:lr,49:lr,50:lr,51:lr,52:lr,53:lr,54:lr,55:lr,56:lr,57:lr,62:$I},VB={91:X8},qB={[-2]:Rg,[-1]:Rg,32:Rg},YB={35:nB,42:Mp,45:[_S,Mp],60:oB,61:_S,95:Mp,96:NS,126:NS},GB={38:FI,92:BI},XB={[-5]:Dg,[-4]:Dg,[-3]:Dg,33:kB,38:FI,42:Lv,60:[P8,fB],91:PB,92:[eB,BI],93:nb,95:Lv,96:$8},QB={null:[Lv,FB]},ZB={null:[42,95]},JB={null:[]},e5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ZB,contentInitial:VB,disable:JB,document:HB,flow:YB,flowInitial:qB,insideSpan:QB,string:GB,text:XB},Symbol.toStringTag,{value:"Module"}));function t5(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:A(k),check:A(S),consume:b,enter:w,exit:j,interrupt:A(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:d};let p=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function d(_){return s=Fr(s,_),x(),s[s.length-1]!==null?[]:(T(t,0),u.events=tb(a,u.events,u),u.events)}function f(_,R){return r5(m(_),R)}function m(_){return n5(s,_)}function g(){const{_bufferIndex:_,_index:R,line:X,column:V,offset:I}=r;return{_bufferIndex:_,_index:R,line:X,column:V,offset:I}}function v(_){i[_.line]=_.column,O()}function x(){let _;for(;r._index<s.length;){const R=s[r._index];if(typeof R=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<R.length;)y(R.charCodeAt(r._bufferIndex));else y(R)}}function y(_){p=p(_)}function b(_){We(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,O()):_!==-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=_}function w(_,R){const X=R||{};return X.type=_,X.start=g(),u.events.push(["enter",X,u]),l.push(X),X}function j(_){const R=l.pop();return R.end=g(),u.events.push(["exit",R,u]),R}function k(_,R){T(_,R.from)}function S(_,R){R.restore()}function A(_,R){return X;function X(V,I,$){let H,N,W,P;return Array.isArray(V)?le(V):"tokenize"in V?le([V]):U(V);function U(Q){return ie;function ie(je){const Z=je!==null&&Q[je],re=je!==null&&Q.null,pe=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(re)?re:re?[re]:[]];return le(pe)(je)}}function le(Q){return H=Q,N=0,Q.length===0?$:E(Q[N])}function E(Q){return ie;function ie(je){return P=D(),W=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?ye():Q.tokenize.call(R?Object.assign(Object.create(u),R):u,c,he,ye)(je)}}function he(Q){return _(W,P),I}function ye(Q){return P.restore(),++N<H.length?E(H[N]):$}}}function T(_,R){_.resolveAll&&!a.includes(_)&&a.push(_),_.resolve&&$i(u.events,R,u.events.length-R,_.resolve(u.events.slice(R),u)),_.resolveTo&&(u.events=_.resolveTo(u.events,u))}function D(){const _=g(),R=u.previous,X=u.currentConstruct,V=u.events.length,I=Array.from(l);return{from:V,restore:$};function $(){r=_,u.previous=R,u.currentConstruct=X,u.events.length=V,l=I,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function n5(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 r5(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 i5(e){const r={constructs:d8([e5,...(e||{}).extensions||[]]),content:i(x8),defined:[],document:i(w8),flow:i($B),lazy:{},string:i(UB),text:i(WB)};return r;function i(a){return s;function s(l){return t5(r,a,l)}}}function a5(e){for(;!UI(e););return e}const RS=/[\0\t\n\r]/g;function o5(){let e=1,t="",n=!0,r;return i;function i(a,s,l){const c=[];let u,p,d,f,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(RS.lastIndex=d,u=RS.exec(a),f=u&&u.index!==void 0?u.index:a.length,m=a.charCodeAt(f),!u){t=a.slice(d);break}if(m===10&&d===f&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<f&&(c.push(a.slice(d,f)),e+=f-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=f+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const s5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function l5(e){return e.replace(s5,c5)}function c5(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return zI(n.slice(a?2:1),a?16:10)}return eb(n)||e}const YI={}.hasOwnProperty;function u5(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),d5(n)(a5(i5(n).document().write(o5()(e,t,!0))))}function d5(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ke),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(ne),blockQuote:a(re),characterEscape:D,characterReference:D,codeFenced:a(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(pe,s),codeText:a(se,s),codeTextData:D,data:D,codeFlowValue:D,definition:a(_e),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(ke),hardBreakEscape:a(Le),hardBreakTrailing:a(Le),htmlFlow:a(qe,s),htmlFlowData:D,htmlText:a(qe,s),htmlTextData:D,image:a(ze),label:s,link:a(Ke),listItem:a(Ye),listItemValue:f,listOrdered:a(pt,d),listUnordered:a(pt),paragraph:a(Qe),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(ne),strong:a(Ze),thematicBreak:a(J)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:Z,autolinkProtocol:je,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:Q,characterReference:ie,codeFenced:c(x),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:O,codeIndented:c(y),codeText:c(I),codeTextData:O,data:O,definition:c(),definitionDestinationString:j,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c(X),htmlFlowData:O,htmlText:c(V),htmlTextData:O,image:c(H),label:W,labelText:N,lineEnding:_,link:c($),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:he,resourceDestinationString:P,resourceTitleString:U,resource:le,setextHeading:c(T),setextHeadingLineSequence:A,setextHeadingText:S,strong:c(),thematicBreak:c()}};GI(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Y){let ue={type:"root",children:[]};const M={stack:[ue],tokenStack:[],config:t,enter:l,exit:u,buffer:s,resume:p,data:n},fe=[];let ee=-1;for(;++ee<Y.length;)if(Y[ee][1].type==="listOrdered"||Y[ee][1].type==="listUnordered")if(Y[ee][0]==="enter")fe.push(ee);else{const xe=fe.pop();ee=i(Y,xe,ee)}for(ee=-1;++ee<Y.length;){const xe=t[Y[ee][0]];YI.call(xe,Y[ee][1].type)&&xe[Y[ee][1].type].call(Object.assign({sliceSerialize:Y[ee][2].sliceSerialize},M),Y[ee][1])}if(M.tokenStack.length>0){const xe=M.tokenStack[M.tokenStack.length-1];(xe[1]||DS).call(M,void 0,xe[0])}for(ue.position={start:Oa(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:Oa(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},ee=-1;++ee<t.transforms.length;)ue=t.transforms[ee](ue)||ue;return ue}function i(Y,ue,M){let fe=ue-1,ee=-1,xe=!1,Se,De,$e,He;for(;++fe<=M;){const Ie=Y[fe];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?ee++:ee--,He=void 0;break}case"lineEndingBlank":{Ie[0]==="enter"&&(Se&&!He&&!ee&&!$e&&($e=fe),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!ee&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||ee===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(Se){let Xe=fe;for(De=void 0;Xe--;){const L=Y[Xe];if(L[1].type==="lineEnding"||L[1].type==="lineEndingBlank"){if(L[0]==="exit")continue;De&&(Y[De][1].type="lineEndingBlank",xe=!0),L[1].type="lineEnding",De=Xe}else if(!(L[1].type==="linePrefix"||L[1].type==="blockQuotePrefix"||L[1].type==="blockQuotePrefixWhitespace"||L[1].type==="blockQuoteMarker"||L[1].type==="listItemIndent"))break}$e&&(!De||$e<De)&&(Se._spread=!0),Se.end=Object.assign({},De?Y[De][1].start:Ie[1].end),Y.splice(De||fe,0,["exit",Se,Ie[2]]),fe++,M++}if(Ie[1].type==="listItemPrefix"){const Xe={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};Se=Xe,Y.splice(fe,0,["enter",Xe,Ie[2]]),fe++,M++,$e=void 0,He=!0}}}return Y[ue][1]._spread=xe,M}function a(Y,ue){return M;function M(fe){l.call(this,Y(fe),fe),ue&&ue.call(this,fe)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(Y,ue,M){this.stack[this.stack.length-1].children.push(Y),this.stack.push(Y),this.tokenStack.push([ue,M||void 0]),Y.position={start:Oa(ue.start),end:void 0}}function c(Y){return ue;function ue(M){Y&&Y.call(this,M),u.call(this,M)}}function u(Y,ue){const M=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==Y.type&&(ue?ue.call(this,Y,fe[0]):(fe[1]||DS).call(this,Y,fe[0]));else throw new Error("Cannot close `"+Y.type+"` ("+Vc({start:Y.start,end:Y.end})+"): it’s not open");M.position.end=Oa(Y.end)}function p(){return c8(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(Y){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(Y),10),this.data.expectingFirstListItemValue=void 0}}function m(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=Y}function g(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=Y}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y.replace(/(\r?\n|\r)$/g,"")}function b(Y){const ue=this.resume(),M=this.stack[this.stack.length-1];M.label=ue,M.identifier=ml(this.sliceSerialize(Y)).toLowerCase()}function w(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.title=Y}function j(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.url=Y}function k(Y){const ue=this.stack[this.stack.length-1];if(!ue.depth){const M=this.sliceSerialize(Y).length;ue.depth=M}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(Y){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(Y).codePointAt(0)===61?1:2}function T(){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=tt(),fe.position={start:Oa(Y.start),end:void 0},M.push(fe)),this.stack.push(fe)}function O(Y){const ue=this.stack.pop();ue.value+=this.sliceSerialize(Y),ue.position.end=Oa(Y.end)}function _(Y){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const M=ue.children[ue.children.length-1];M.position.end=Oa(Y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ue.type)&&(D.call(this,Y),O.call(this,Y))}function R(){this.data.atHardBreak=!0}function X(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y}function V(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y}function I(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.value=Y}function $(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ue,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function H(){const Y=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";Y.type+="Reference",Y.referenceType=ue,delete Y.url,delete Y.title}else delete Y.identifier,delete Y.label;this.data.referenceType=void 0}function N(Y){const ue=this.sliceSerialize(Y),M=this.stack[this.stack.length-2];M.label=l5(ue),M.identifier=ml(ue).toLowerCase()}function W(){const Y=this.stack[this.stack.length-1],ue=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=ue}function P(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.url=Y}function U(){const Y=this.resume(),ue=this.stack[this.stack.length-1];ue.title=Y}function le(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function he(Y){const ue=this.resume(),M=this.stack[this.stack.length-1];M.label=ue,M.identifier=ml(this.sliceSerialize(Y)).toLowerCase(),this.data.referenceType="full"}function ye(Y){this.data.characterReferenceType=Y.type}function Q(Y){const ue=this.sliceSerialize(Y),M=this.data.characterReferenceType;let fe;M?(fe=zI(ue,M==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=eb(ue);const ee=this.stack[this.stack.length-1];ee.value+=fe}function ie(Y){const ue=this.stack.pop();ue.position.end=Oa(Y.end)}function je(Y){O.call(this,Y);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(Y)}function Z(Y){O.call(this,Y);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(Y)}function re(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function ne(){return{type:"heading",depth:0,children:[]}}function Le(){return{type:"break"}}function qe(){return{type:"html",value:""}}function ze(){return{type:"image",title:null,url:"",alt:null}}function Ke(){return{type:"link",title:null,url:"",children:[]}}function pt(Y){return{type:"list",ordered:Y.type==="listOrdered",start:null,spread:Y._spread,children:[]}}function Ye(Y){return{type:"listItem",spread:Y._spread,checked:null,children:[]}}function Qe(){return{type:"paragraph",children:[]}}function Ze(){return{type:"strong",children:[]}}function tt(){return{type:"text",value:""}}function J(){return{type:"thematicBreak"}}}function Oa(e){return{line:e.line,column:e.column,offset:e.offset}}function GI(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?GI(e,r):p5(e,r)}}function p5(e,t){let n;for(n in t)if(YI.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 DS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Vc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Vc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Vc({start:t.start,end:t.end})+") is still open")}function f5(e){const t=this;t.parser=n;function n(r){return u5(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function h5(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 m5(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
71
+ `}]}function g5(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 y5(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function v5(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function x5(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ql(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 b5(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 w5(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function XI(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 j5(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XI(e,t);const i={src:ql(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 S5(e,t){const n={src:ql(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 k5(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 C5(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XI(e,t);const i={href:ql(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 P5(e,t){const n={href:ql(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 A5(e,t,n){const r=e.all(t),i=n?E5(n):QI(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 E5(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=QI(n[r])}return t}function QI(e){const t=e.spread;return t??e.children.length>1}function T5(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 I5(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O5(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function N5(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function M5(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=X0(t.children[1]),c=OI(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 _5(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],f={},m=s?s[c]:void 0;m&&(f.align=m);let g={type:"element",tagName:a,properties:f,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 R5(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const LS=9,zS=32;function D5(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push($S(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push($S(t.slice(i),i>0,!1)),a.join("")}function $S(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===LS||a===zS;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===LS||a===zS;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function L5(e,t){const n={type:"text",value:D5(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function z5(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $5={blockquote:h5,break:m5,code:g5,delete:y5,emphasis:v5,footnoteReference:x5,heading:b5,html:w5,imageReference:j5,image:S5,inlineCode:k5,linkReference:C5,link:P5,listItem:A5,list:T5,paragraph:I5,root:O5,strong:N5,table:M5,tableCell:R5,tableRow:_5,text:L5,thematicBreak:z5,toml:Ud,yaml:Ud,definition:Ud,footnoteDefinition:Ud};function Ud(){}const ZI=-1,Wh=0,Yc=1,hf=2,rb=3,ib=4,ab=5,ob=6,JI=7,eO=8,B5=typeof self=="object"?self:globalThis,BS=(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 B5[e](t)},F5=(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 Wh:case ZI:return n(s,i);case Yc:{const l=n([],i);for(const c of s)l.push(r(c));return l}case hf:{const l=n({},i);for(const[c,u]of s)l[r(c)]=r(u);return l}case rb:return n(new Date(s),i);case ib:{const{source:l,flags:c}=s;return n(new RegExp(l,c),i)}case ab:{const l=n(new Map,i);for(const[c,u]of s)l.set(r(c),r(u));return l}case ob:{const l=n(new Set,i);for(const c of s)l.add(r(c));return l}case JI:{const{name:l,message:c}=s;return n(BS(l,c),i)}case eO: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(BS(a,s),i)};return r},FS=e=>F5(new Map,e)(0),To="",{toString:U5}={},{keys:W5}=Object,yc=e=>{const t=typeof e;if(t!=="object"||!e)return[Wh,t];const n=U5.call(e).slice(8,-1);switch(n){case"Array":return[Yc,To];case"Object":return[hf,To];case"Date":return[rb,To];case"RegExp":return[ib,To];case"Map":return[ab,To];case"Set":return[ob,To];case"DataView":return[Yc,n]}return n.includes("Array")?[Yc,n]:n.includes("Error")?[JI,n]:[hf,n]},Wd=([e,t])=>e===Wh&&(t==="function"||t==="symbol"),K5=(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]=yc(s);switch(l){case Wh:{let p=s;switch(c){case"bigint":l=eO,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return i([ZI],s)}return i([l,p],s)}case Yc:{if(c){let f=s;return c==="DataView"?f=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(s)),i([c,[...f]],s)}const p=[],d=i([l,p],s);for(const f of s)p.push(a(f));return d}case hf:{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 f of W5(s))(e||!Wd(yc(s[f])))&&p.push([a(f),a(s[f])]);return d}case rb:return i([l,isNaN(s.getTime())?To:s.toISOString()],s);case ib:{const{source:p,flags:d}=s;return i([l,{source:p,flags:d}],s)}case ab:{const p=[],d=i([l,p],s);for(const[f,m]of s)(e||!(Wd(yc(f))||Wd(yc(m))))&&p.push([a(f),a(m)]);return d}case ob:{const p=[],d=i([l,p],s);for(const f of s)(e||!Wd(yc(f)))&&p.push(a(f));return d}}const{message:u}=s;return i([l,{name:c,message:u}],s)};return a},US=(e,{json:t,lossy:n}={})=>{const r=[];return K5(!(t||n),!!t,new Map,r)(e),r},mf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?FS(US(e,t)):structuredClone(e):(e,t)=>FS(US(e,t));function H5(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 V5(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function q5(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||H5,r=e.options.footnoteBackLabel||V5,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(),f=ql(d.toLowerCase());let m=0;const g=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++m<=v;){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-"+f+(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 y={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(p,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...mf(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 tO=function(e){if(e==null)return Q5;if(typeof e=="function")return Kh(e);if(typeof e=="object")return Array.isArray(e)?Y5(e):G5(e);if(typeof e=="string")return X5(e);throw new Error("Expected function, string, or object as test")};function Y5(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=tO(e[n]);return Kh(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function G5(e){const t=e;return Kh(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function X5(e){return Kh(t);function t(n){return n&&n.type===e}}function Kh(e){return t;function t(n,r,i){return!!(Z5(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Q5(){return!0}function Z5(e){return e!==null&&typeof e=="object"&&"type"in e}const nO=[],J5=!0,WS=!1,eF="skip";function tF(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=tO(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(f,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=nO,g,v,x;if((!t||a(c,u,p[p.length-1]||void 0))&&(m=nF(n(c,p)),m[0]===WS))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==eF)for(v=(r?y.children.length:-1)+s,x=p.concat(y);v>-1&&v<y.children.length;){const b=y.children[v];if(g=l(b,v,x)(),g[0]===WS)return g;v=typeof g[1]=="number"?g[1]:v+s}}return m}}}function nF(e){return Array.isArray(e)?e:typeof e=="number"?[J5,e]:e==null?nO:[e]}function rO(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),tF(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 zv={}.hasOwnProperty,rF={};function iF(e,t){const n=t||rF,r=new Map,i=new Map,a=new Map,s={...$5,...n.handlers},l={all:u,applyData:oF,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:c,options:n,patch:aF,wrap:lF};return rO(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const d=p.type==="definition"?r:i,f=String(p.identifier).toUpperCase();d.has(f)||d.set(f,p)}}),l;function c(p,d){const f=p.type,m=l.handlers[f];if(zv.call(l.handlers,f)&&m)return m(l,p,d);if(l.options.passThrough&&l.options.passThrough.includes(f)){if("children"in p){const{children:v,...x}=p,y=mf(x);return y.children=l.all(p),y}return mf(p)}return(l.options.unknownHandler||sF)(l,p,d)}function u(p){const d=[];if("children"in p){const f=p.children;let m=-1;for(;++m<f.length;){const g=l.one(f[m],p);if(g){if(m&&f[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=KS(g.value)),!Array.isArray(g)&&g.type==="element")){const v=g.children[0];v&&v.type==="text"&&(v.value=KS(v.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function aF(e,t){e.position&&(t.position=F6(e))}function oF(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,mf(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function sF(e,t){const n=t.data||{},r="value"in t&&!(zv.call(n,"hProperties")||zv.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 lF(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 KS(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function HS(e,t){const n=iF(e,t),r=n.one(e,void 0),i=q5(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 cF(e,t){return e&&"run"in e?async function(n,r){const i=HS(n,{file:r,...t});await e.run(i,r)}:function(n,r){return HS(n,{file:r,...e||t})}}function VS(e){if(e)throw e}var _p=Object.prototype.hasOwnProperty,iO=Object.prototype.toString,qS=Object.defineProperty,YS=Object.getOwnPropertyDescriptor,GS=function(t){return typeof Array.isArray=="function"?Array.isArray(t):iO.call(t)==="[object Array]"},XS=function(t){if(!t||iO.call(t)!=="[object Object]")return!1;var n=_p.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&_p.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||_p.call(t,i)},QS=function(t,n){qS&&n.name==="__proto__"?qS(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ZS=function(t,n){if(n==="__proto__")if(_p.call(t,n)){if(YS)return YS(t,n).value}else return;return t[n]},uF=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=ZS(l,n),i=ZS(t,n),l!==i&&(p&&i&&(XS(i)||(a=GS(i)))?(a?(a=!1,s=r&&GS(r)?r:[]):s=r&&XS(r)?r:{},QS(l,{name:n,newValue:e(p,s,i)})):typeof i<"u"&&QS(l,{name:n,newValue:i}));return l};const Lg=Bl(uF);function $v(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 dF(){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?pF(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 pF(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 Ai={basename:fF,dirname:hF,extname:mF,join:gF,sep:"/"};function fF(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 hF(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 mF(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 gF(...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?".":yF(n)}function yF(e){Vu(e);const t=e.codePointAt(0)===47;let n=vF(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vF(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 xF={cwd:bF};function bF(){return"/"}function Bv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function wF(e){if(typeof e=="string")e=new URL(e);else if(!Bv(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 jF(e)}function jF(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 zg=["history","path","basename","stem","extname","dirname"];class aO{constructor(t){let n;t?Bv(t)?n={path:t}:typeof t=="string"||SF(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<zg.length;){const a=zg[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)zg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ai.basename(this.path):void 0}set basename(t){Bg(t,"basename"),$g(t,"basename"),this.path=Ai.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ai.dirname(this.path):void 0}set dirname(t){JS(this.basename,"dirname"),this.path=Ai.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ai.extname(this.path):void 0}set extname(t){if($g(t,"extname"),JS(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=Ai.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Bv(t)&&(t=wF(t)),Bg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ai.basename(this.path,this.extname):void 0}set stem(t){Bg(t,"stem"),$g(t,"stem"),this.path=Ai.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 Yn(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 $g(e,t){if(e&&e.includes(Ai.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ai.sep+"`")}function Bg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function JS(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function SF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const kF=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},CF={}.hasOwnProperty;class sb extends kF{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=dF()}copy(){const t=new sb;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Lg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Wg("data",this.frozen),this.namespace[t]=n,this):CF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Wg("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=Kd(t),r=this.parser||this.Parser;return Fg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Fg("process",this.parser||this.Parser),Ug("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const l=Kd(t),c=r.parse(l);r.run(c,l,function(p,d,f){if(p||!d||!f)return u(p);const m=d,g=r.stringify(m,f);EF(g)?f.value=g:f.result=g,u(p,f)});function u(p,d){p||!d?s(p):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Fg("processSync",this.parser||this.Parser),Ug("processSync",this.compiler||this.Compiler),this.process(t,i),tk("processSync","process",n),r;function i(a,s){n=!0,VS(a),r=s}}run(t,n,r){ek(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=Kd(n);i.run(t,c,u);function u(p,d,f){const m=d||t;p?l(p):s?s(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),tk("runSync","run",r),i;function a(s,l){VS(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=Kd(n),i=this.compiler||this.Compiler;return Ug("stringify",i),ek(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Wg("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=Lg(!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,f=-1;for(;++d<r.length;)if(r[d][0]===u){f=d;break}if(f===-1)r.push([u,...p]);else if(p.length>0){let[m,...g]=p;const v=r[f][1];$v(v)&&$v(m)&&(m=Lg(!0,v,m)),r[f]=[u,m,...g]}}}}const PF=new sb().freeze();function Fg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ug(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wg(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 ek(e){if(!$v(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function tk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Kd(e){return AF(e)?e:new aO(e)}function AF(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function EF(e){return typeof e=="string"||TF(e)}function TF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const IF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nk=[],rk={allowDangerousHtml:!0},OF=/^(https?|ircs?|mailto|xmpp)$/i,NF=[{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 Gc(e){const t=MF(e),n=_F(e);return RF(t.runSync(t.parse(n),n),e)}function MF(e){const t=e.rehypePlugins||nk,n=e.remarkPlugins||nk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rk}:rk;return PF().use(f5).use(n).use(cF,r).use(t)}function _F(e){const t=e.children||"",n=new aO;return typeof t=="string"&&(n.value=t),n}function RF(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||DF;for(const p of NF)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+IF+p.id,void 0);return rO(e,u),V6(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(p,d,f){if(p.type==="raw"&&f&&typeof d=="number")return s?f.children.splice(d,1):f.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let m;for(m in _g)if(Object.hasOwn(_g,m)&&Object.hasOwn(p.properties,m)){const g=p.properties[m],v=_g[m];(v===null||v.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,f)),m&&f&&typeof d=="number")return l&&p.children?f.children.splice(d,1,...p.children):f.children.splice(d,1),d}}}function DF(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||OF.test(e.slice(0,t))?e:""}const ae=(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},oe=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()},q={getAuthStatus:()=>oe(ae("/api/auth/status")),login:e=>oe(ae("/api/auth/login"),{method:"POST",body:JSON.stringify({authCode:e})}),checkVersion:()=>oe(ae("/api/version/check")),getVendors:()=>oe(ae("/api/vendors")),createVendor:e=>oe(ae("/api/vendors"),{method:"POST",body:JSON.stringify(e)}),updateVendor:(e,t)=>oe(ae(`/api/vendors/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteVendor:e=>oe(ae(`/api/vendors/${e}`),{method:"DELETE"}),getAPIServices:e=>oe(ae("/api/services",e?{vendorId:e}:void 0)),createAPIService:e=>oe(ae("/api/services"),{method:"POST",body:JSON.stringify(e)}),updateAPIService:(e,t)=>oe(ae(`/api/services/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAPIService:e=>oe(ae(`/api/services/${e}`),{method:"DELETE"}),getRoutes:()=>oe(ae("/api/routes")),createRoute:e=>oe(ae("/api/routes"),{method:"POST",body:JSON.stringify(e)}),updateRoute:(e,t)=>oe(ae(`/api/routes/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRoute:e=>oe(ae(`/api/routes/${e}`),{method:"DELETE"}),getToolBindings:()=>oe(ae("/api/tool-bindings")),activateToolRoute:(e,t)=>oe(ae("/api/tool-bindings/activate"),{method:"POST",body:JSON.stringify({tool:e,routeId:t})}),deactivateToolRoute:e=>oe(ae("/api/tool-bindings/deactivate"),{method:"POST",body:JSON.stringify({tool:e})}),getRules:e=>oe(ae("/api/rules",e?{routeId:e}:void 0)),createRule:e=>oe(ae("/api/rules"),{method:"POST",body:JSON.stringify(e)}),updateRule:(e,t)=>oe(ae(`/api/rules/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRule:e=>oe(ae(`/api/rules/${e}`),{method:"DELETE"}),resetRuleTokens:e=>oe(ae(`/api/rules/${e}/reset-tokens`),{method:"PUT"}),resetRuleRequests:e=>oe(ae(`/api/rules/${e}/reset-requests`),{method:"PUT"}),clearRuleBlacklist:e=>oe(ae(`/api/rules/${e}/clear-blacklist`),{method:"PUT"}),toggleRuleDisable:e=>oe(ae(`/api/rules/${e}/toggle-disable`),{method:"PUT"}),clearRuleStatus:e=>oe(ae(`/api/rules/${e}/clear-status`),{method:"POST"}),getRuleStatuses:()=>oe(ae("/api/rules/status")),getRulesBlacklistStatus:e=>oe(ae(`/api/rules/${e}/blacklist-status`)),getLogs:(e,t)=>oe(ae("/api/logs",{limit:e,offset:t})),clearLogs:()=>oe(ae("/api/logs"),{method:"DELETE"}),getErrorLogs:(e,t)=>oe(ae("/api/error-logs",{limit:e,offset:t})),clearErrorLogs:()=>oe(ae("/api/error-logs"),{method:"DELETE"}),getLogsCount:()=>oe(ae("/api/logs/count")),getErrorLogsCount:()=>oe(ae("/api/error-logs/count")),searchLogs:(e,t,n)=>oe(ae("/api/logs/search",{query:e,limit:t,offset:n})),searchLogsCount:e=>oe(ae("/api/logs/search/count",{query:e})),queryLogs:async({filters:e,keyword:t,limit:n,offset:r})=>{const i=await oe(ae("/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 oe(ae("/api/logs/count"))).count)}catch{}return{logs:a,total:s}},queryErrorLogs:async({filters:e,keyword:t,limit:n,offset:r})=>{const i=await oe(ae("/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 oe(ae("/api/error-logs/count"))).count)}catch{}return{logs:a,total:s}},searchErrorLogs:(e,t,n)=>oe(ae("/api/error-logs/search",{query:e,limit:t,offset:n})),searchErrorLogsCount:e=>oe(ae("/api/error-logs/search/count",{query:e})),getStatistics:(e=30)=>oe(ae("/api/statistics",{days:e})),resetStatistics:()=>oe(ae("/api/statistics"),{method:"DELETE"}),getPerformanceServicesOverview:()=>oe(ae("/api/performance/services-overview")),getPerformanceVendors:()=>oe(ae("/api/performance/vendors")),getPerformanceVendor:e=>oe(ae(`/api/performance/vendors/${e}`)),getPerformanceService:e=>oe(ae(`/api/performance/services/${e}`)),getPerformanceModel:(e,t)=>oe(ae(`/api/performance/services/${e}/models/${encodeURIComponent(t)}`)),getConfig:()=>oe(ae("/api/config")),updateConfig:e=>oe(ae("/api/config"),{method:"PUT",body:JSON.stringify(e)}),exportData:async e=>(await oe(ae("/api/export"),{method:"POST",body:JSON.stringify({password:e})})).data,previewImportData:(e,t)=>oe(ae("/api/import/preview"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),importData:(e,t)=>oe(ae("/api/import"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),writeClaudeConfig:(e,t,n)=>oe(ae("/api/write-config/claude"),{method:"POST",body:JSON.stringify({enableAgentTeams:e,enableBypassPermissionsSupport:t,permissionsDefaultMode:n})}),writeCodexConfig:(e,t)=>oe(ae("/api/write-config/codex"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e,enableMemories:t})}),writeOpencodeConfig:e=>oe(ae("/api/write-config/opencode"),{method:"POST",body:JSON.stringify({defaultModel:e})}),restoreClaudeConfig:()=>oe(ae("/api/restore-config/claude"),{method:"POST"}),restoreCodexConfig:()=>oe(ae("/api/restore-config/codex"),{method:"POST"}),restoreOpencodeConfig:()=>oe(ae("/api/restore-config/opencode"),{method:"POST"}),updateClaudeAgentTeams:e=>oe(ae("/api/update-claude-agent-teams"),{method:"POST",body:JSON.stringify({enableAgentTeams:e})}),updateClaudeBypassPermissionsSupport:e=>oe(ae("/api/update-claude-bypass-permissions-support"),{method:"POST",body:JSON.stringify({enableBypassPermissionsSupport:e})}),updateCodexReasoningEffort:e=>oe(ae("/api/update-codex-reasoning-effort"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e})}),checkClaudeBackup:()=>oe(ae("/api/check-backup/claude")),checkCodexBackup:()=>oe(ae("/api/check-backup/codex")),getClaudeConfigStatus:()=>oe(ae("/api/config-status/claude")),getCodexConfigStatus:()=>oe(ae("/api/config-status/codex")),getSessions:async({filters:e,keyword:t,limit:n,offset:r}={})=>{const i=await oe(ae("/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 oe(ae("/api/sessions/count"))).count)}catch{}return{sessions:a,total:s}},getSessionsCount:()=>oe(ae("/api/sessions/count")),getSession:e=>oe(ae(`/api/sessions/${e}`)),getSessionLogs:(e,t)=>oe(ae(`/api/sessions/${e}/logs`,{limit:t})),deleteSession:e=>oe(ae(`/api/sessions/${e}`),{method:"DELETE"}),clearSessions:()=>oe(ae("/api/sessions"),{method:"DELETE"}),cleanupSessions:(e,t)=>oe(ae("/api/sessions/cleanup"),{method:"POST",body:JSON.stringify({beforeDays:e,onlyLogs:t})}),getRecommendVendorsMarkdown:()=>oe(ae("/api/docs/recommend-vendors")),getReadmeMarkdown:()=>oe(ae("/api/docs/readme")),getInstalledSkills:()=>oe(ae("/api/skills/installed")),searchSkills:e=>oe(ae("/api/skills/search"),{method:"POST",body:JSON.stringify({query:e})}),getSkillDetails:e=>oe(ae(`/api/skills/${e}/details`)),installSkill:(e,t)=>oe(ae("/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)=>oe(ae(`/api/skills/${e}/enable`),{method:"POST",body:JSON.stringify({targetType:t})}),disableSkill:(e,t)=>oe(ae(`/api/skills/${e}/disable`),{method:"POST",body:JSON.stringify({targetType:t})}),deleteSkill:e=>oe(ae(`/api/skills/${e}`),{method:"DELETE"}),createLocalSkill:e=>oe(ae("/api/skills/create-local"),{method:"POST",body:JSON.stringify(e)}),getUpgradeMarkdown:()=>oe(ae("/api/docs/upgrade")),getUpgrade:()=>oe(ae("/api/upgrade")),acknowledgeUpgrade:()=>oe(ae("/api/upgrade/ack"),{method:"POST"}),getMCPs:()=>oe(ae("/api/mcps")),getMCP:e=>oe(ae(`/api/mcps/${e}`)),createMCP:e=>oe(ae("/api/mcps"),{method:"POST",body:JSON.stringify(e)}),updateMCP:(e,t)=>oe(ae(`/api/mcps/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteMCP:e=>oe(ae(`/api/mcps/${e}`),{method:"DELETE"}),bindSessionRoute:(e,t)=>oe(ae(`/api/sessions/${e}/bind-route`),{method:"PUT",body:JSON.stringify({routeId:t})}),unbindSessionRoute:e=>oe(ae(`/api/sessions/${e}/bind-route`),{method:"DELETE"}),getBoundSessions:e=>oe(ae(`/api/routes/${e}/bound-sessions`)),migrationPreview:(e,t)=>oe(ae(`/api/sessions/${e}/migration-preview`),{method:"POST",body:JSON.stringify(t)}),migrateSession:(e,t)=>oe(ae(`/api/sessions/${e}/migrate`),{method:"POST",body:JSON.stringify(t)}),migrateLaunch:(e,t)=>oe(ae(`/api/sessions/${e}/migrate-launch`),{method:"POST",body:JSON.stringify(t)}),getApiPathBindings:()=>oe(ae("/api/api-path-bindings")),updateApiPathBindings:(e,t)=>oe(ae("/api/api-path-bindings"),{method:"PUT",body:JSON.stringify({bindings:e,models:t})}),getAccessKeys:e=>oe(ae("/api/access-keys",e)),createAccessKey:e=>oe(ae("/api/access-keys"),{method:"POST",body:JSON.stringify(e)}),getAccessKey:e=>oe(ae(`/api/access-keys/${e}`)),updateAccessKey:(e,t)=>oe(ae(`/api/access-keys/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAccessKey:e=>oe(ae(`/api/access-keys/${e}`),{method:"DELETE"}),regenerateAccessKey:e=>oe(ae(`/api/access-keys/${e}/regenerate`),{method:"POST"}),batchUpdateAccessKeyStatus:(e,t)=>oe(ae("/api/access-keys/batch/status"),{method:"PUT",body:JSON.stringify({keyIds:e,status:t})}),batchBindAccessKeyPolicy:(e,t)=>oe(ae("/api/access-keys/batch/policy"),{method:"PUT",body:JSON.stringify({keyIds:e,policyId:t})}),batchDeleteAccessKeys:e=>oe(ae("/api/access-keys/batch"),{method:"DELETE",body:JSON.stringify({keyIds:e})}),getAccessKeyUsage:e=>oe(ae(`/api/access-keys/${e}/usage`)),getAccessKeyUsageTrend:(e,t)=>oe(ae(`/api/access-keys/${e}/usage/trend`,{days:t})),getAccessKeyLogs:(e,t)=>oe(ae(`/api/access-keys/${e}/logs`,t)),getAccessKeySessions:(e,t)=>oe(ae(`/api/access-keys/${e}/sessions`,t)),getAccessKeySession:(e,t)=>oe(ae(`/api/access-keys/${e}/sessions/${t}`)),getAccessKeySessionLogs:(e,t,n)=>oe(ae(`/api/access-keys/${e}/sessions/${t}/logs`,{limit:n})),deleteAccessKeySession:(e,t)=>oe(ae(`/api/access-keys/${e}/sessions/${t}`),{method:"DELETE"}),clearAccessKeySessions:e=>oe(ae(`/api/access-keys/${e}/sessions`),{method:"DELETE"}),getAccessKeyGuide:(e,t,n)=>oe(ae(`/api/access-keys/${e}/guide`,{host:t,port:n})),writeAccessKeyToLocal:(e,t)=>oe(ae(`/api/access-keys/${e}/write-local`),{method:"POST",body:JSON.stringify({targets:t})}),getWriteLocalRecords:()=>oe(ae("/api/write-local-records")),getPolicies:()=>oe(ae("/api/policies")),createPolicy:e=>oe(ae("/api/policies"),{method:"POST",body:JSON.stringify(e)}),getPolicy:e=>oe(ae(`/api/policies/${e}`)),updatePolicy:(e,t)=>oe(ae(`/api/policies/${e}`),{method:"PUT",body:JSON.stringify(t)}),deletePolicy:e=>oe(ae(`/api/policies/${e}`),{method:"DELETE"}),duplicatePolicy:e=>oe(ae(`/api/policies/${e}/duplicate`),{method:"POST"}),getPolicyKeys:e=>oe(ae(`/api/policies/${e}/keys`)),getPolicyTemplates:()=>oe(ae("/api/policies/templates")),getAccessKeyRanking:e=>oe(ae("/api/statistics/access-keys",e)),getQuotaAlerts:()=>oe(ae("/api/statistics/quota-alerts")),lanScan:()=>oe(ae("/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=>oe(ae("/api/lan/sync"),{method:"POST",body:JSON.stringify(e)}),getAgentMapSessions:()=>oe(ae("/api/agent-map/sessions")),getAgentMapSessionEvents:(e,t)=>oe(ae(`/api/agent-map/sessions/${e}/events`,t!=null?{since:t}:void 0)),getAgentMapStats:()=>oe(ae("/api/agent-map/stats")),getAgentMapSessionMeta:e=>oe(ae(`/api/agent-map/sessions/${e}/meta`)),getAgentMapNotify:()=>oe(ae("/api/agent-map/notify")),setAgentMapNotify:e=>oe(ae("/api/agent-map/notify"),{method:"POST",body:JSON.stringify({enabled:e})}),setAgentMapNotifyFocus:e=>oe(ae("/api/agent-map/notify-focus"),{method:"POST",body:JSON.stringify({hidden:e})}),testAgentMapNotify:()=>oe(ae("/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,f,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:v}=await l.read();if(v)break;u+=c.decode(g,{stream:!0});let x;for(;(x=u.indexOf(`
81
+
82
+ `))!==-1;){const y=u.slice(0,x);u=u.slice(x+2);const b=y.split(`
83
+ `).find(k=>k.startsWith("data:"));if(!b)continue;const w=b.slice(5).trim();if(!w)continue;let j;try{j=JSON.parse(w)}catch{continue}switch(j.type){case"init":(p=e.onInit)==null||p.call(e,{type:"init",sessions:j.sessions||[],events:j.events||[],stats:j.stats,serverTime:j.serverTime});break;case"session-update":(d=e.onSessionUpdate)==null||d.call(e,j.session);break;case"activity":(f=e.onActivity)==null||f.call(e,j.event);break;case"stats":(m=e.onStats)==null||m.call(e,j.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 dt=(e=>(e.AUTH_TOKEN="authorization",e.API_KEY="x-api-key",e.G_API_KEY="x-goog-api-key",e))(dt||{});const Un={aicodingbus:{name:"AICodingBus",description:"AICodingBus 是一个Token共享平台,用户可以在平台上分享和交换Token。",tags:["官方推荐"],link:"https://aicodingbus.24x7.to/",apiBaseUrl:"https://aicodingbus.24x7.to",authType:dt.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:dt.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:dt.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:dt.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:dt.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:dt.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:dt.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:dt.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:dt.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:dt.API_KEY,services:[{name:"Claude官方接口",sourceType:"claude",apiUrl:"https://api.anthropic.com"}],sortedGroup:3},google:{name:"Google AI",description:"Gemini官方接口",authType:dt.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:dt.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:dt.AUTH_TOKEN}],sortedGroup:3},agnes:{name:"Agnes",description:"优秀的模型厂商,拥有多种模型,提供免费 API 使用",tags:["永久免费"],link:"https://platform.agnes-ai.com",authType:dt.AUTH_TOKEN,services:[{name:"Chat Completions 标准接口(免费)",sourceType:"openai-chat",apiUrl:"https://apihub.agnes-ai.com/v1/chat/completions",models:"agnes-2.0-flash",authType:dt.AUTH_TOKEN}],sortedGroup:-1}},Tl={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"},Hd={claude:"Claude","claude-chat":"Claude Chat",openai:"OpenAI","openai-chat":"OpenAI Chat",gemini:"Gemini","gemini-chat":"Gemini Chat"},LF={"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={[dt.AUTH_TOKEN]:"AUTH_TOKEN",[dt.API_KEY]:"API_KEY",[dt.G_API_KEY]:"GOOGLE_API_KEY"},Kg={[dt.AUTH_TOKEN]:"使用 Authorization: Bearer <token> 进行认证",[dt.API_KEY]:"使用 x-api-key: <token> 进行认证",[dt.G_API_KEY]:"使用 x-goog-api-key: <token> 进行认证"},zF=`#### 🚀 智谱 GLM Coding Plan
84
+
85
+ > 价格便宜,国内速度快,支持多工具(Claude Code等 20+ 大编程工具),而且其中的GLM-4.7是目前国内最强编程模型。适合对模型有一定要求,同时又无法获取国外模型的朋友入手。
86
+ >
87
+ > 链接:[https://www.bigmodel.cn](https://www.bigmodel.cn/invite?icode=kgOTGFRH%2Ftc5Xkyu5N0wHOnfet45IvM%2BqDogImfeLyI%3D) | [一键配置](# "glm")
88
+
89
+ #### 🌌 MiniMax Coding Plan
90
+
91
+ > 国内优秀的大模型,支持Claude Code和Codex等编程工具,其中 M2.1 模型在大模型评测中获得非常高的分数。可作为国内大模型的备选方案。
92
+ > 链接:[https://platform.minimaxi.com/subscribe/coding-plan](https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link) | [一键配置](# "minimax")
93
+
94
+ #### 🧠 Mimo Coding Plan
95
+
96
+ > 小米旗下 Mimo 国产大模型,支持 Claude Code 和 Codex 等编程工具,提供 Coding Plan 和付费 API 两种模式,涵盖 mimo-v2.5-pro、mimo-v2-pro、mimo-v2.5、mimo-v2-omni、mimo-v2-flash 等多个模型,性价比出色。
97
+ > 链接:[https://platform.xiaomimimo.com](https://platform.xiaomimimo.com?ref=M8BFP3) | [一键配置](# "mimo")
98
+ `;function oO(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]=h.useState(i(e));return h.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 $F=oO(zF,q.getRecommendVendorsMarkdown),BF=oO("",q.getUpgradeMarkdown),sO=h.createContext(void 0);function qu(){const e=h.useContext(sO);if(!e)throw new Error("useConfirm must be used within ConfirmProvider");return e}let wo=null;function FF({children:e}){const[t,n]=h.useState(!1),[r,i]=h.useState({message:""}),a=p=>(i(p),n(!0),new Promise(d=>{wo=d})),s=()=>{n(!1),wo&&(wo(!0),wo=null)},l=()=>{n(!1),wo&&(wo(!1),wo=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(sO.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 UF=0;const Fv=new Set;let gf=[];function lO(){Fv.forEach(e=>e([...gf]))}function qd(e,t,n=3e3){const r=++UF,i={id:r,message:e,type:t,duration:n};return gf.push(i),lO(),n>0&&setTimeout(()=>{cO(r)},n),r}function cO(e){gf=gf.filter(t=>t.id!==e),lO()}const K={success(e,t){qd(e,"success",t)},error(e,t){qd(e,"error",t)},warning(e,t){qd(e,"warning",t)},info(e,t){qd(e,"info",t)}};function WF(){const[e,t]=h.useState([]);h.useEffect(()=>(Fv.add(t),()=>{Fv.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:`
99
+ @keyframes slideIn {
100
+ from {
101
+ transform: translateX(50px);
102
+ opacity: 0;
103
+ }
104
+ to {
105
+ transform: translateX(0);
106
+ opacity: 1;
107
+ }
108
+ }
109
+ `}),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:()=>cO(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 uO({value:e,onChange:t,existingVendors:n=[],disabled:r=!1}){const[i,a]=h.useState(!1),s=h.useRef(null);h.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=h.useMemo(()=>{const u=Object.entries(Un).map(([f,m])=>({key:f,name:m.name,sortedGroup:m.sortedGroup??0}));u.sort((f,m)=>f.sortedGroup-m.sortedGroup);const p=[];let d=null;for(const f of u)d!==null&&f.sortedGroup!==d&&p.push(null),p.push(f),d=f.sortedGroup;return p},[]),c=e?Un[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=Un[u.key],f=n.some(v=>v.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)":f?"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:v=>{m||(v.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:v=>{m||(v.currentTarget.style.background=f?"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((v,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:v},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:f?"rgba(255, 167, 38, 0.15)":"rgba(76, 175, 80, 0.15)",color:f?"#e67e22":"#4caf50"},children:f?"已配置":"可用"})]},u.key)})})]})}function ik(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 KF({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 HF(){var L,ge;const{confirm:e}=qu(),t=h.useRef(null),[n,r]=h.useState([]),[i,a]=h.useState(null),[s,l]=h.useState(!1),[c,u]=h.useState(!1),[p,d]=h.useState(!1),[f,m]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState([]),[j,k]=h.useState(""),[S,A]=h.useState({}),[T,D]=h.useState(!1),[O,_]=h.useState(void 0),[R,X]=h.useState(void 0),[V,I]=h.useState(void 0),[$,H]=h.useState(!1),[N,W]=h.useState(void 0),[P,U]=h.useState(void 0),[le,E]=h.useState(void 0),[he,ye]=h.useState("openai-chat"),[Q,ie]=h.useState(!1),[je,Z]=h.useState(dt.AUTH_TOKEN),[re,pe]=h.useState(""),[se,_e]=h.useState(!0),[ke,ne]=h.useState(!0),[Le,qe]=h.useState(!0),ze=F=>{if(ye(F),Le)return;let de;F==="gemini"||F==="gemini-chat"?de=dt.G_API_KEY:F==="claude-chat"||F==="claude"?de=dt.API_KEY:de=dt.AUTH_TOKEN,Z(de),t.current&&(t.current.value=de)},[Ke,pt]=h.useState(""),[Ye,Qe]=h.useState([]),[Ze,tt]=h.useState(""),J=$F();h.useEffect(()=>{Y()},[]),h.useEffect(()=>{const F=new Set(b),de={};Object.entries(S).forEach(([Ae,Ee])=>{F.has(Ae)&&(de[Ae]=Ee)}),Object.keys(de).length!==Object.keys(S).length&&A(de)},[b]);const Y=async()=>{const F=await q.getVendors();return r(F),F.length>0&&!i&&a(F[0]),F},ue=()=>{v(null),pe(""),l(!0)},M=()=>{d(!0)},fe=F=>{v(F),pe(F.authType||""),l(!0)},ee=async F=>{if(await e({message:"确定要删除此供应商吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const ve=await q.getRules(),Ae=(F.services||[]).map(nt=>nt.id),Ee=ve.filter(nt=>Ae.includes(nt.targetServiceId)).length;if(!await e({message:`二次确认:删除供应商“${F.name}”后,将同时删除关联的 ${Ee} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await q.deleteVendor(F.id),Y(),i&&i.id===F.id&&a(null),K.success(`供应商已删除,关联规则清理 ${Ee} 条`)}catch(ve){const Ae=ve instanceof Error?ve.message:"删除失败";K.error(Ae)}},xe=async F=>{F.preventDefault();const de=new FormData(F.currentTarget),ve={name:de.get("name"),description:de.get("description"),apiKey:de.get("apiKey")||"",apiBaseUrl:de.get("apiBaseUrl")||"",authType:de.get("authType")||void 0,sortOrder:parseInt(de.get("sortOrder"))||0};g?await q.updateVendor(g.id,ve):await q.createVendor({...ve,services:[]}),l(!1);const Ae=await Y();if(i){const Ee=Ae.find(Ge=>Ge.id===i.id);Ee&&a(Ee)}},Se=()=>{y(null),w([]),k(""),A({}),D(!1),_(void 0),X(void 0),I(void 0),H(!1),W(void 0),U(void 0),E(void 0),ye("openai-chat"),Z((i==null?void 0:i.authType)||dt.AUTH_TOKEN),_e(!!(i!=null&&i.apiKey)),ne(!!(i!=null&&i.apiBaseUrl)),qe(!!(i!=null&&i.authType)),ie(!1),u(!0)},De=F=>{y(F),w(F.supportedModels||[]),k(""),A(F.modelLimits||{}),D(F.enableTokenLimit||!1),_(F.tokenLimit),X(F.tokenResetInterval),I(F.tokenResetBaseTime?new Date(F.tokenResetBaseTime):void 0),H(F.enableRequestLimit||!1),W(F.requestCountLimit),U(F.requestResetInterval),E(F.requestResetBaseTime?new Date(F.requestResetBaseTime):void 0);const de=F.sourceType||"openai-chat";if(ye(de),_e(F.inheritVendorApiKey===!0),ne(F.inheritVendorApiBaseUrl===!0),qe(F.inheritVendorAuthType===!0),F.inheritVendorAuthType===!0){const ve=(i==null?void 0:i.authType)||dt.AUTH_TOKEN;Z(ve)}else if(F.authType)Z(F.authType);else{let ve;de==="gemini"||de==="gemini-chat"?ve=dt.G_API_KEY:de==="claude-chat"||de==="claude"?ve=dt.API_KEY:ve=dt.AUTH_TOKEN,Z(ve)}ie(F.isDowngradeCompatibility===!0),u(!0)},$e=async F=>{if(await e({message:"确定要删除此API服务吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const Ae=(await q.getRules()).filter(nt=>nt.targetServiceId===F).length;if(!await e({message:`二次确认:删除该 API 服务后,将同时删除关联的 ${Ae} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await q.deleteAPIService(F);const Ge=await Y();if(i){const nt=Ge.find(ot=>ot.id===i.id);nt&&a(nt)}K.success(`API服务已删除,关联规则清理 ${Ae} 条`)}catch(ve){const Ae=ve instanceof Error?ve.message:"删除失败";K.error(Ae)}},He=async F=>{F.preventDefault();let de=[...b];if(j.trim()){const Et=j.split(",").map(St=>St.trim()).filter(St=>St&&!de.includes(St));de=[...de,...Et]}const ve=new FormData(F.currentTarget),Ae=ve.get("sourceType"),Ee=ve.get("inheritVendorApiBaseUrl")==="on",Ge=(ve.get("apiUrl")||"").trim(),nt=Ee?(x==null?void 0:x.apiUrl)||"":Ge,ot=ve.get("inheritVendorApiKey")==="on",Je=ve.get("apiKey")||"",tn=ot?(x==null?void 0:x.apiKey)||"":Je,Ut=ve.get("inheritVendorAuthType")==="on",ut={};Object.entries(S).forEach(([Et,St])=>{Et&&St&&St>0&&(ut[Et]=St)});const Wt={vendorId:i.id,name:ve.get("name"),apiUrl:nt,apiKey:tn,inheritVendorApiKey:ot,inheritVendorApiBaseUrl:Ee,inheritVendorAuthType:Ut,sourceType:Ae,authType:Ut?(x==null?void 0:x.authType)||void 0:ve.get("authType")||void 0,supportedModels:de.length>0?de:void 0,modelLimits:Object.keys(ut).length>0?ut:void 0,enableProxy:ve.get("enableProxy")==="on",enableCodingPlan:ve.get("enableCodingPlan")==="on",isDowngradeCompatibility:he==="openai"?Q:void 0,enableTokenLimit:T,tokenLimit:O,tokenResetInterval:R,tokenResetBaseTime:V?V.getTime():void 0,enableRequestLimit:$,requestCountLimit:N,requestResetInterval:P,requestResetBaseTime:le?le.getTime():void 0};x?await q.updateAPIService(x.id,Wt):await q.createAPIService(Wt),u(!1),w([]),k(""),A({}),D(!1),_(void 0),X(void 0),I(void 0),H(!1),W(void 0),U(void 0),E(void 0),_e(!0),ne(!0),ie(!1);const Xt=await Y();if(i){const Et=Xt.find(St=>St.id===i.id);Et&&a(Et)}},Ie=F=>{if(F){pt(F);const de=Un[F];de&&de.services.length>0&&Qe(de.services.map((ve,Ae)=>Ae))}else pt(""),Qe([]);tt(""),m(!0)},Xe=async F=>{F.preventDefault();const de=Ke,ve=Ze;if(!de||!ve){K.warning("请填写完整信息");return}if(Ye.length===0){K.warning("请至少选择一个源类型");return}const Ae=Un[de];if(!Ae){K.error("未找到对应的供应商配置");return}try{const Ee=await q.createVendor({name:Ae.name,description:Ae.description,apiKey:ve,authType:Ae.authType??dt.AUTH_TOKEN,...Ae.apiBaseUrl?{apiBaseUrl:Ae.apiBaseUrl}:{},sortOrder:0,services:[]});if(console.log("[一键配置] 供应商创建成功:",Ee),console.log("[一键配置] 供应商 ID:",Ee==null?void 0:Ee.id),!Ee||!Ee.id)throw console.error("[一键配置] 供应商创建失败或缺少 ID:",Ee),new Error("供应商创建失败,缺少 ID");const Ge=Ae.services.filter((ut,Wt)=>Ye.includes(Wt));if(console.log("[一键配置] 准备创建服务:",Ge.length,"个"),console.log("[一键配置] vendorId:",Ee.id),Ge.length===0)throw new Error("没有选择任何服务");const nt=Ge.map(async(ut,Wt)=>{const Xt={vendorId:Ee.id,name:ut.name,apiUrl:ut.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:ut.sourceType,authType:ut.authType,supportedModels:ut.models?ut.models.split(",").map(St=>St.trim()):void 0,modelLimits:ut.modelLimits||{},enableCodingPlan:!0};console.log(`[一键配置] 创建服务 ${Wt+1}/${Ge.length}:`,{...Xt,apiKey:"***"});const Et=await q.createAPIService(Xt);return console.log(`[一键配置] 服务 ${Wt+1} 创建成功,ID:`,Et.id),Et.vendorId||console.error(`[一键配置] 警告:服务 ${Et.id} 缺少 vendorId!`),Et}),ot=await Promise.all(nt);console.log("[一键配置] 所有服务创建完成,数量:",ot.length);const Je=ot.filter(ut=>!ut.vendorId);if(Je.length>0)throw console.error("[一键配置] 发现缺少 vendorId 的服务:",Je),new Error(`有 ${Je.length} 个服务缺少 vendorId`);const Ut=(await Y()).find(ut=>ut.id===Ee.id);a(Ut||{...Ee,services:ot}),m(!1),K.success(`配置成功! 已创建 ${Ye.length} 个API服务`)}catch(Ee){console.error("一键配置失败:",Ee),K.error(`配置失败: ${Ee instanceof Error?Ee.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:()=>Ie(),children:"一键配置"}),o.jsx("button",{className:"btn btn-primary",onClick:ue,children:"新增"})]})]}),n.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无供应商"})}):o.jsx("div",{style:{marginTop:"10px"},children:n.map(F=>o.jsx("div",{onClick:()=>a(F),style:{padding:"12px",marginBottom:"8px",backgroundColor:i&&i.id===F.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:F.name}),F.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.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:de=>{de.stopPropagation(),fe(F)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:de=>{de.stopPropagation(),ee(F)},children:"删除"})]})]})},F.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:Se,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(F=>{var de;return o.jsxs("tr",{children:[o.jsx("td",{children:F.name}),o.jsx("td",{children:F.sourceType?Hd[F.sourceType]:"-"}),o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:F.apiUrl,children:F.apiUrl}),o.jsx("td",{children:(de=F.supportedModels)!=null&&de.length?`${F.supportedModels.length}个`:"*"}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>De(F),children:"编辑"}),o.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>$e(F.id),children:"删除"})]})})]},F.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:xe,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:F=>pe(F.target.value),children:[o.jsx("option",{value:"",disabled:!0,children:"无"}),Object.keys(Vd).map(F=>o.jsx("option",{value:F,children:Vd[F]},F))]}),re&&Kg[re]&&o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Kg[re]})]}),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:He,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:F=>ze(F.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择源类型"}),Object.keys(Hd).map(F=>o.jsx("option",{value:F,children:Hd[F]},F))]}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:LF[he]||""}),he==="openai"&&o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",marginTop:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:Q,onChange:F=>ie(F.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:ke,onChange:F=>ne(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API地址"})]}),!ke&&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:se,onChange:F=>_e(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API密钥"})]}),!se&&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:Le,onChange:F=>qe(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API认证方式"})]}),!Le&&o.jsxs(o.Fragment,{children:[o.jsx("select",{ref:t,name:"authType",defaultValue:x?x.authType||dt.AUTH_TOKEN:je,onChange:F=>Z(F.target.value),children:Object.keys(Vd).map(F=>o.jsx("option",{value:F,children:Vd[F]},F))}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Kg[je]||""})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"支持的模型列表"}),o.jsx(KF,{value:b,onChange:w,inputValue:j,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(F=>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:[F,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[F]||"",onChange:de=>{const ve=de.target.value;if(ve===""){const Ae={...S};delete Ae[F],A(Ae)}else A({...S,[F]:parseInt(ve)||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 de={...S};delete de[F],A(de)},style:{padding:"4px 8px",fontSize:"12px"},title:"移除此限制(模型仍在支持列表中)",children:"移除限制"})]},`sync-${F}`))]}),Object.keys(S).length>0&&o.jsx("div",{children:Object.entries(S).filter(([F])=>!b.includes(F)).map(([F,de])=>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:F,onChange:ve=>{const Ae={...S},Ee=ve.target.value;delete Ae[F],Ae[Ee]=de,A(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:de,onChange:ve=>{A({...S,[F]:parseInt(ve.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 ve={...S};delete ve[F],A(ve)},style:{padding:"4px 8px",fontSize:"12px"},children:"删除"})]},`custom-${F}`))})]}),o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>{const F=`model-${Date.now()}`;A({...S,[F]: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:T,onChange:F=>D(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Token超量限制"})]})}),T&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token超量值(单位:k)"}),o.jsx("input",{type:"number",value:O||"",onChange:F=>_(F.target.value?parseInt(F.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:R||"",onChange:F=>X(F.target.value?parseInt(F.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:V?ik(V):"",onChange:F=>{F.target.value?I(new Date(F.target.value)):I(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:$,onChange:F=>H(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"})]})}),$&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量值"}),o.jsx("input",{type:"number",value:N||"",onChange:F=>W(F.target.value?parseInt(F.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:F=>U(F.target.value?parseInt(F.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:le?ik(le):"",onChange:F=>{F.target.value?E(new Date(F.target.value)):E(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(Gc,{components:{a:({href:F,children:de,title:ve})=>ve&&Un[ve]?o.jsx("a",{href:"#",style:{color:"#2563EB",borderBottom:"solid 1px #2563EB",cursor:"pointer"},onClick:Ae=>{Ae.preventDefault(),d(!1),Ie(ve)},children:de}):o.jsx("a",{href:F,style:{color:"#2563EB",borderBottom:"solid 1px #2563EB"},target:"_blank",rel:"noopener noreferrer",children:de})},children:J})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>d(!1),children:"关闭"})})]})})]}),f&&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:Xe,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(uO,{value:Ke,onChange:F=>{if(pt(F),F){const de=Un[F];de&&de.services.length>0&&Qe(de.services.map((ve,Ae)=>Ae))}else Qe([])},existingVendors:n})]}),(L=Un[Ke])!=null&&L.description?o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[Un[Ke].description,Un[Ke].link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:Un[Ke].link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const F=new URL(Un[Ke].link);return F.protocol+"//"+F.hostname}catch{return Un[Ke].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:Ke?(ge=Un[Ke])==null?void 0:ge.services.map((F,de)=>{const ve=Ye.includes(de);return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:ve?"var(--accent-light)":"transparent",border:`2px solid ${ve?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease",position:"relative",overflow:"hidden"},onMouseEnter:Ae=>{ve||(Ae.currentTarget.style.background="var(--bg-hover)",Ae.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:Ae=>{ve||(Ae.currentTarget.style.background="transparent",Ae.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"checkbox",checked:ve,onChange:Ae=>{Ae.target.checked?Qe([...Ye,de]):Qe(Ye.filter(Ee=>Ee!==de))},style:{width:"18px",height:"18px",marginRight:"12px",cursor:"pointer",accentColor:"var(--accent-primary)"}}),o.jsxs("span",{style:{fontSize:"14px",fontWeight:ve?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[F.name," - ",Hd[F.sourceType]]}),ve&&o.jsx("span",{style:{marginLeft:"auto",fontSize:"16px",color:"var(--text-primary)"},children:"✓"})]},de)}):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:Ze,onChange:F=>tt(F.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 VF({value:e,options:t,onChange:n,disabled:r=!1,placeholder:i="请选择"}){const[a,s]=h.useState(!1),l=h.useRef(null);h.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 qF={1:"选择节点",2:"Skills",3:"MCP",4:"供应商",5:"确认同步"};function YF({show:e,onClose:t,onComplete:n}){const[r,i]=h.useState(1),[a,s]=h.useState(!1),[l,c]=h.useState({current:0,total:0}),[u,p]=h.useState([]),[d,f]=h.useState(null),[m,g]=h.useState(""),[v,x]=h.useState("4567"),[y,b]=h.useState(!1),[w,j]=h.useState([]),[k,S]=h.useState(""),[A,T]=h.useState(4567),[D,O]=h.useState("scan"),[_,R]=h.useState([]),[X,V]=h.useState(new Set),[I,$]=h.useState([]),[H,N]=h.useState(new Set),[W,P]=h.useState({}),[U,le]=h.useState(!1),[E,he]=h.useState(""),[ye,Q]=h.useState(!1),[ie,je]=h.useState(!1),[Z,re]=h.useState(!1),pe=h.useCallback(()=>{i(1),s(!1),c({current:0,total:0}),p([]),f(null),g(""),x("4567"),b(!1),R([]),V(new Set),$([]),N(new Set),P({}),le(!1),he(""),Q(!1),je(!1),re(!1),j([]),S(""),T(4567),O("scan")},[]);h.useEffect(()=>{e&&(pe(),se())},[e]);const se=async()=>{try{const M=await q.lanScan();j(M.networkInterfaces||[]),T(M.port),M.networkInterfaces.length<=1,S(M.subnet),_e(M.subnet,M.port,M.localIp)}catch(M){console.error("[LAN Scan] 获取网络信息失败:",M)}},_e=async(M,fe,ee)=>{s(!0),p([]),c({current:0,total:0});const xe=Date.now();try{const Se=[];for(let He=1;He<=254;He++){const Ie=`${M}.${He}`;Ie!==ee&&Se.push(Ie)}c({current:0,total:Se.length});const De=30,$e=[];for(let He=0;He<Se.length;He+=De){const Ie=Se.slice(He,He+De),Xe=await Promise.allSettled(Ie.map(async L=>{const ge=await q.lanDiscover(L,fe);return{ip:L,port:fe,data:ge}}));for(const L of Xe)L.status==="fulfilled"&&$e.push(L.value);p([...$e]),c({current:Math.min(He+De,Se.length),total:Se.length})}c({current:Se.length,total:Se.length})}catch(Se){console.error("[LAN Scan] 扫描失败:",Se)}finally{const Se=Date.now()-xe;Se<1e3&&await new Promise(De=>setTimeout(De,1e3-Se)),s(!1),je(!0)}},ke=M=>{S(M);const fe=w.find(ee=>ee.subnet===M);fe&&_e(fe.subnet,A,fe.address)},ne=()=>{const M=w.find(fe=>fe.subnet===k);M&&(f(null),_e(M.subnet,A,M.address))},Le=async()=>{if(m.trim()){b(!0);try{const M=parseInt(v)||4567,fe=await q.lanDiscover(m.trim(),M),ee={ip:m.trim(),port:M,data:fe};p(xe=>xe.some(Se=>Se.ip===m.trim()&&Se.port===M)?xe:[...xe,ee]),f(ee),K.success("连接成功")}catch{K.error("无法连接,请检查 IP 和端口")}finally{b(!1)}}},qe=async()=>{if(d){re(!0);try{let M=[],fe=[];try{M=await q.getInstalledSkills()}catch{}try{fe=await q.getMCPs()}catch($e){console.error("[LAN Sync] 获取本地 MCPs 失败,重复检测可能不准确:",$e)}const ee=new Set(M.map($e=>$e.name)),xe=new Set(fe.map($e=>$e.name)),Se=(d.data.skills||[]).map($e=>({...$e,isDuplicate:ee.has($e.name)}));R(Se);const De=(d.data.mcps||[]).map($e=>({...$e,isDuplicate:xe.has($e.name)}));$(De),i(2)}finally{re(!1)}}},ze=async()=>{if(!d)return;const M=X.size>0,fe=H.size>0;if(!(!M&&!fe&&!U)){Q(!0);try{const ee=await q.lanSync({remoteNode:{ip:d.ip,port:d.port,name:d.data.node.name},skills:_.filter(xe=>X.has(xe.name)&&!xe.isDuplicate).map(({isDuplicate:xe,...Se})=>Se),mcps:I.filter(xe=>H.has(xe.name)&&!xe.isDuplicate).map(({isDuplicate:xe,...Se})=>{const De=W[Se.name];return De&&Se.env?{...Se,env:{...Se.env,...De}}:Se}),vendor:{enabled:U,apiKey:E||void 0}});ee.success?(K.success("同步完成"),n(),setTimeout(()=>t(),500)):K.error("同步失败: "+(ee.error||"未知错误"))}catch(ee){K.error("同步失败: "+ee.message)}finally{Q(!1)}}},Ke=M=>M.env?Object.entries(M.env).filter(([,fe])=>fe==="***").map(([fe])=>fe):[],pt=(M,fe,ee)=>{P(xe=>({...xe,[M]:{...xe[M]||{},[fe]:ee}}))},Ye=M=>{const fe=_.find(ee=>ee.name===M);fe!=null&&fe.isDuplicate||V(ee=>{const xe=new Set(ee);return xe.has(M)?xe.delete(M):xe.add(M),xe})},Qe=()=>{const M=_.filter(ee=>!ee.isDuplicate),fe=M.every(ee=>X.has(ee.name));V(fe?new Set:new Set(M.map(ee=>ee.name)))},Ze=M=>{const fe=I.find(ee=>ee.name===M);fe!=null&&fe.isDuplicate||N(ee=>{const xe=new Set(ee);return xe.has(M)?xe.delete(M):xe.add(M),xe})},tt=()=>{const M=I.filter(ee=>!ee.isDuplicate),fe=M.every(ee=>H.has(ee.name));N(fe?new Set:new Set(M.map(ee=>ee.name)))},J=X.size>0||H.size>0||U,Y=_.filter(M=>!M.isDuplicate),ue=I.filter(M=>!M.isDuplicate);return e?o.jsxs("div",{className:"modal-overlay",onClick:M=>{M.target===M.currentTarget&&!ye&&t()},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>{ye||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} `,qF[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:()=>O(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:[w.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:"本机"})," · ",w.map(M=>M.address).join("、")," · ","端口 ",A,w.length>1&&o.jsxs(o.Fragment,{children:[" · ",w.map((M,fe)=>o.jsxs("span",{children:[fe>0?" / ":"",o.jsxs("button",{type:"button",onClick:()=>ke(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&&ie&&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:ne,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&&ie&&o.jsx("button",{type:"button",className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:ne,children:"重新扫描"})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(M=>{var fe,ee;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:()=>f(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:()=>f(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`,((ee=M.data.mcps)==null?void 0:ee.length)>0&&` · ${M.data.mcps.length} MCP`]})]})]},`${M.ip}-${M.port}`)})})]})]}),Z&&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:v,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:Le,disabled:y||!m.trim(),children:y?"连接中...":"连接"})]}),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,ee;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:()=>f(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:()=>f(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`,((ee=M.data.mcps)==null?void 0:ee.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:Qe,children:Y.every(M=>X.has(M.name))?"取消全选":"全选"})]}),o.jsx("p",{style:{fontSize:"15px",fontWeight:500,marginBottom:"12px"},children:"选择需要同步的 Skills:"}),_.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:_.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:X.has(M.name),onChange:()=>Ye(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:"}),ue.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:tt,children:ue.every(M=>H.has(M.name))?"取消全选":"全选"})]}),I.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:I.map(M=>{const fe=Ke(M),ee=H.has(M.name),xe=ee&&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:ee,onChange:()=>Ze(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:"⚠ 本地已存在,无法重复同步"})]})]}),xe&&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(Se=>{var De;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:Se}),o.jsx("input",{type:"text",value:((De=W[M.name])==null?void 0:De[Se])||"",onChange:$e=>pt(M.name,Se,$e.target.value),placeholder:`请输入 ${Se}`,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"}})]},Se)})]})]},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:U,onChange:()=>le(!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:!U,onChange:()=>le(!1),style:{accentColor:"var(--primary-color)"}}),o.jsx("span",{children:"否"})]})]}),U&&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:E,onChange:M=>he(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:"不填写则使用空密钥连接。"})]}),U&&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)。"]}),!U&&o.jsx("p",{style:{fontSize:"13px",color:"#999"},children:"跳过供应商创建,仅同步 Skills 和 MCP 配置。"})]}),r===5&&!ye&&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(",X.size," 项)"]}),X.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:_.filter(M=>X.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(",H.size," 项)"]}),H.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:I.filter(M=>H.has(M.name)).map(M=>{const fe=Ke(M),ee=fe.some(xe=>{var Se,De;return!((De=(Se=W[M.name])==null?void 0:Se[xe])!=null&&De.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:ee?"#e74c3c":"#e67e22",marginLeft:"6px"},children:ee?`⚠ ${fe.length} 个敏感变量未填写`:"✓ 敏感变量已填写"})]},M.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:"供应商"}),U?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:",E?"已填写":"未填写"]}),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:"不创建"})]}),!J&&o.jsx("p",{style:{fontSize:"13px",color:"#e74c3c",textAlign:"center"},children:"未选择任何同步内容"})]}),r===5&&ye&&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||!ye)&&o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>i(r-1),disabled:ye,children:"← 上一步"}),o.jsx("div",{style:{flex:1}}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,disabled:ye,children:"取消"}),r===1&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:qe,disabled:!d||Z,children:Z?"加载中...":"下一步 →"}),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&&!ye&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:ze,disabled:!J,children:"同步"})]})]})})]}):null}const dO=h.createContext(null),GF=async e=>{try{await q.clearRuleStatus(e)}catch(t){throw console.error("[RulesStatus] 清除规则状态失败:",t),t}};function XF(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 QF({children:e}){const[t,n]=h.useState({}),r=h.useRef(null),i=h.useRef(null),a=h.useRef(Date.now());h.useEffect(()=>{let p=!0;const d=()=>{r.current&&(r.current.close(),r.current=null);const f=localStorage.getItem("auth_token"),m=f?`/api/rules/status/stream?token=${encodeURIComponent(f)}`:"/api/rules/status/stream",g=new EventSource(m);r.current=g,a.current=Date.now(),g.onmessage=v=>{a.current=Date.now();try{const x=JSON.parse(v.data);if(x.type==="init")n(XF(x.statuses));else if(x.type==="update"){const y=x.status;n(b=>({...b,[y.ruleId]:{status:y.status,totalTokensUsed:y.totalTokensUsed,totalRequestsUsed:y.totalRequestsUsed,errorMessage:y.errorMessage,errorType:y.errorType,lastUpdate:y.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)}},[]),h.useEffect(()=>{},[]);const l={ruleStatuses:t,getRuleStatus:c=>t[c],clearRuleStatus:GF};return o.jsx(dO.Provider,{value:l,children:e})}function ZF(){const e=h.useContext(dO);return e||{ruleStatuses:{},getRuleStatus:t=>{},clearRuleStatus:async t=>{}}}const JF=[{value:"codex",label:"Codex",icon:"🤖"},{value:"claude-code",label:"Claude Code",icon:"⚡"},{value:"api",label:"所有 API",icon:"🔗"}],eU={codex:" [Codex]","claude-code":" [Claude Code]",api:" [API]"},tU={"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 pO({show:e,onClose:t,onComplete:n}){const[r,i]=h.useState(""),[a,s]=h.useState(""),[l,c]=h.useState("codex"),[u,p]=h.useState(!1),[d,f]=h.useState([]),[m,g]=h.useState([]);h.useEffect(()=>{e&&(q.getVendors().then(f).catch(()=>{}),q.getRoutes().then(g).catch(()=>{}))},[e]);const v=r?Un[r]:null,x=v?d.find(S=>S.name===v.name):null,y=!!(x!=null&&x.apiKey),b=!x||!y;if(!e)return null;const w=()=>{u||(i(""),s(""),c("codex"),t())},j=(S,A)=>q.createAPIService({vendorId:S,name:A.name,apiUrl:A.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:A.sourceType,authType:A.authType,supportedModels:A.models?A.models.split(",").map(T=>T.trim()):void 0,modelLimits:A.modelLimits||{},enableCodingPlan:!1}),k=async S=>{var T,D;if(S.preventDefault(),!r){K.warning("请选择供应商");return}if(b&&!a){K.warning("请填写 API Key");return}const A=Un[r];if(!A){K.error("未找到对应的供应商配置");return}p(!0);try{let O,_;if(x){O=x.id,!y&&a&&await q.updateVendor(O,{...x,apiKey:a});const N=new Set((x.services||[]).map(U=>U.sourceType)),W=A.services.filter(U=>!N.has(U.sourceType)),P=W.length>0?await Promise.all(W.map(U=>j(O,U))):[];_=[...x.services||[],...P]}else{const N=await q.createVendor({name:A.name,description:A.description,apiKey:a,authType:A.authType??dt.AUTH_TOKEN,...A.apiBaseUrl?{apiBaseUrl:A.apiBaseUrl}:{},sortOrder:0,services:[]});if(!(N!=null&&N.id))throw new Error("供应商创建失败");O=N.id,_=await Promise.all(A.services.map(W=>j(O,W)))}const R=A.name+eU[l],X=new Set(m.map(N=>N.name));let V=R;if(X.has(V)){let N=2;for(;X.has(`${R}-${N}`);)N++;V=`${R}-${N}`}const I=await q.createRoute({name:V,description:"由一键配置自动创建"});if(!(I!=null&&I.id))throw new Error("路由创建失败");const $=tU[l],H=(T=[..._].filter(N=>N.sourceType).map(N=>({service:N,priority:$[N.sourceType]??99})).sort((N,W)=>N.priority-W.priority)[0])==null?void 0:T.service;if(H){const N=(D=H.supportedModels)!=null&&D.length?H.supportedModels[0]:void 0;await q.createRule({routeId:I.id,contentType:"default",targetServiceId:H.id,targetModel:N,sortOrder:0})}if(l==="codex"||l==="claude-code")try{await q.activateToolRoute(l,I.id)}catch{}if(l==="api"){let N=null;try{N=await q.getApiPathBindings()}catch{}if(N!=null&&N.bindings){const W=N.bindings.map(P=>P.apiPath==="/v1/models"?P:{...P,routeId:I.id});try{await q.updateApiPathBindings(W,N.models||"")}catch{}}}K.success("一键配置完成!路由已激活,可以开始使用"),n==null||n(),w(),setTimeout(()=>{window.location.reload()},300)}catch(O){console.error("一键配置失败:",O),K.error(`配置失败: ${O instanceof Error?O.message:"未知错误"}`)}finally{p(!1)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:w,"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(uO,{value:r,onChange:S=>i(S),existingVendors:d,disabled:u})]}),(v==null?void 0:v.description)&&o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[v.description,v.link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:v.link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const S=new URL(v.link);return S.protocol+"//"+S.hostname}catch{return v.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:JF.map(S=>{const A=l===S.value;return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:A?"var(--accent-light)":"transparent",border:`2px solid ${A?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease"},onMouseEnter:T=>{A||(T.currentTarget.style.background="var(--bg-hover)",T.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:T=>{A||(T.currentTarget.style.background="transparent",T.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"radio",name:"setupTarget",value:S.value,checked:A,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:A?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[S.icon," ",S.label]}),A&&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:w,disabled:u,children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",disabled:u,children:u?"配置中...":"确认配置"})]})]})]})})]})}const nU=""+new URL("openai-CPEiZpaN.webp",import.meta.url).href,rU=""+new URL("claude-XtpLmGtF.webp",import.meta.url).href;function lb({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 cb({size:e=16,x:t,y:n,style:r,className:i,title:a}){const l=`codex-grad-${h.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 ub({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??"OpenCode",children:[o.jsx("title",{children:a??"OpenCode"}),o.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z",fillRule:"evenodd",fill:"currentColor"})]})}function fO({agent:e,...t}){return e==="codex"?o.jsx(cb,{...t}):e==="opencode"?o.jsx(ub,{...t}):o.jsx(lb,{...t})}const ak=[{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:"默认"}],ok={compact:0,"image-understanding":1,"high-iq":2,"long-context":3,thinking:4,background:5,"model-mapping":6,default:7},sk={compact:"📦",background:"🧱",thinking:"💭","high-iq":"🧠","long-context":"📄","image-understanding":"🖼️","model-mapping":"🔄"},hO=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],mO=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"max",label:"Max"}],Uv=[{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 中使用。"}],iU=e=>hO.some(t=>t.value===e),aU=e=>mO.some(t=>t.value===e),oU=e=>Uv.some(t=>t.value===e),sU=e=>iU(e==null?void 0:e.codexModelReasoningEffort)?e.codexModelReasoningEffort:"high",lU=e=>aU(e==null?void 0:e.claudeEffortLevel)?e.claudeEffortLevel:"medium",Hg=e=>{const t=oU(e==null?void 0:e.claudePermissionsDefaultMode)?e.claudePermissionsDefaultMode:"default";return t==="bypassPermissions"&&!(e!=null&&e.enableBypassPermissionsSupport)?"default":t};function lk(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 cU(){var Iw,Ow,Nw,Mw,_w,Rw,Dw,Lw,zw,$w;const{confirm:e}=qu(),{ruleStatuses:t,clearRuleStatus:n}=ZF(),[r,i]=h.useState([]),[a,s]=h.useState([]),[l,c]=h.useState([]),[u,p]=h.useState([]),[d,f]=h.useState([]),[m,g]=h.useState([]),[v,x]=h.useState([]),[y,b]=h.useState(null),[w,j]=h.useState([]),[k,S]=h.useState(""),[A,T]=h.useState(null),[D,O]=h.useState(!1),[_,R]=h.useState(!1),[X,V]=h.useState(null),[I,$]=h.useState(null),[H,N]=h.useState(""),[W,P]=h.useState(""),[U,le]=h.useState(""),[E,he]=h.useState(""),[ye,Q]=h.useState(0),[ie,je]=h.useState((I==null?void 0:I.contentType)||""),[Z,re]=h.useState(void 0),[pe,se]=h.useState(void 0),[_e,ke]=h.useState(void 0),[ne,Le]=h.useState(void 0),[qe,ze]=h.useState(""),[Ke,pt]=h.useState(void 0),[Ye,Qe]=h.useState(void 0),[Ze,tt]=h.useState(void 0),[J,Y]=h.useState(void 0),[ue,M]=h.useState(void 0),[fe,ee]=h.useState(null),[xe,Se]=h.useState(!1),[De,$e]=h.useState(!1),[He,Ie]=h.useState(void 0),[Xe,L]=h.useState(void 0),[ge,F]=h.useState({}),[de,ve]=h.useState(!1),[Ae,Ee]=h.useState(""),[Ge,nt]=h.useState(1e3),[ot,Je]=h.useState(!1),[tn,Ut]=h.useState(!1),[ut,Wt]=h.useState(!1),[Xt,Et]=h.useState(!1),[St,gi]=h.useState(!1),[Xi,Ta]=h.useState(!1),[ce,Mt]=h.useState(""),[En,sr]=h.useState(!1),[Qi,an]=h.useState(""),[B,z]=h.useState(!1),[Pe,st]=h.useState(""),[Ue,xt]=h.useState(!1),[Qt,yi]=h.useState(""),[jd,Ps]=h.useState(!1),[xo,ic]=h.useState({}),[it,pn]=h.useState(null),[As,ac]=h.useState([]),[fL,Sw]=h.useState(!1),[kw,Cw]=h.useState(null);h.useEffect(()=>{Es(),ig(),ag(),vL(),xr(),kd(),Pw(),Tw()},[]);const Pw=async()=>{try{const C=await q.getApiPathBindings();j(C.bindings||[]),S(C.models||"")}catch(C){console.error("Failed to load API path bindings:",C)}},Aw=async(C,te)=>{try{const me=await q.updateApiPathBindings(C,te);j(me.bindings),K.success("路由映射已保存")}catch(me){K.error(me.message||"保存失败")}},hL=(C,te)=>{const me=w.map(Oe=>Oe.apiPath===C?{...Oe,routeId:te}:Oe);j(me),Aw(me,k)},mL=()=>{Aw(w,k)};h.useEffect(()=>{A&&bo(A.id)},[A]),h.useEffect(()=>{g(H?d.filter(C=>C.vendorId===H):[]),P(""),le("")},[H]);const Es=async()=>{const C=await q.getRoutes();i(C),C.length>0&&!A&&T(C[0]);const te={};for(const me of C)try{const Oe=await q.getBoundSessions(me.id);te[me.id]=Oe.sessions.length}catch{te[me.id]=0}ic(te)},gL=async C=>{pn(C),Sw(!0),ac([]);try{const te=await q.getBoundSessions(C);ac(te.sessions)}catch{ac([])}finally{Sw(!1)}},Ew=()=>{pn(null),ac([])},yL=async C=>{if(await e({title:"确认解绑会话",message:"确定要解除该会话的路由绑定吗?解绑后,该会话的后续请求将不再使用此路由。",type:"danger",confirmText:"解绑",cancelText:"取消"})){Cw(C);try{const me=await q.unbindSessionRoute(C);me.success?(K.success("已解除绑定"),ac(Oe=>Oe.filter(kt=>kt.id!==C)),ic(Oe=>{const kt=it;return!kt||!Oe[kt]?Oe:{...Oe,[kt]:Math.max(0,Oe[kt]-1)}})):K.error(me.error||"解绑失败")}catch(me){K.error(me.message||"解绑失败")}finally{Cw(null)}}},bo=async C=>{const te=await q.getRules(C);if(s(te),Tw(),C)try{const Oe=(await q.getRulesBlacklistStatus(C)).reduce((kt,on)=>(kt[on.ruleId]=on,kt),{});F(Oe)}catch(me){console.error("Failed to load blacklist status:",me)}},Tw=async()=>{try{const C=await q.getRules();c(C)}catch(C){console.error("Failed to load all rules:",C)}},ig=async()=>{const C=await q.getVendors();p(C)},ag=async()=>{const C=await q.getAPIServices();f(C)},vL=async()=>{const C=await q.getMCPs();x(C)},[Fe,xL]=h.useState(null),[Xn,Sd]=h.useState(null),xr=async()=>{try{const C=await q.getConfig();b(C),Mt(C.claudeDefaultModel||""),sr(!1),an(C.autocompactPctOverride!=null?String(C.autocompactPctOverride):""),z(!1),st(C.codexDefaultModel||""),xt(!1),yi(C.opencodeDefaultModel||""),Ps(!1),ze(typeof C.ruleGlobalTimeout=="number"&&C.ruleGlobalTimeout>0?String(C.ruleGlobalTimeout):"")}catch(C){console.error("Failed to load app config:",C)}},kd=async()=>{try{const C=await q.getToolBindings();xL(C)}catch(C){console.error("Failed to load tool bindings:",C)}},Ts=async(C,te)=>{Sd(C);try{(await q.activateToolRoute(C,te)).success?(await kd(),await Es(),K.success("路由已激活")):K.error("激活失败")}catch(me){K.error(`激活失败: ${me.message||"未知错误"}`)}finally{Sd(null)}},Is=async C=>{Sd(C);try{(await q.deactivateToolRoute(C)).success?(await kd(),await Es(),K.success("路由已停用")):K.error("停用失败")}catch(te){K.error(`停用失败: ${te.message||"未知错误"}`)}finally{Sd(null)}},bL=async C=>{C.preventDefault();const te=new FormData(C.currentTarget),me={name:te.get("name"),description:te.get("description")};X?await q.updateRoute(X.id,me):await q.createRoute(me),O(!1),Es()},wL=async C=>{if(await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{await q.deleteRoute(C),Es(),A&&A.id===C&&(T(null),s([])),K.success("路由已删除")}catch(me){K.error(me.message||"删除失败")}},jL=async C=>{if(C.preventDefault(),ie==="image-understanding"&&de&&!Ae){K.warning("请选择一个MCP工具");return}if(!de&&!W){K.warning("请选择供应商API服务");return}if(!de&&Z!==void 0&&He!==void 0&&Z>He){K.warning(`Token超量值 (${Z}k) 不能超过API服务的限制 (${He}k)`);return}if(!de&&Ke!==void 0&&Xe!==void 0&&Ke>Xe){K.warning(`请求次数超量值 (${Ke}) 不能超过API服务的限制 (${Xe})`);return}const te=new FormData(C.currentTarget),me={routeId:A.id,contentType:te.get("contentType"),targetServiceId:de?"":W,targetModel:de?void 0:U||"",replacedModel:E||"",sortOrder:ye,timeout:ne?ne*1e3:void 0,tokenLimit:de?void 0:Z||void 0,resetInterval:de?void 0:pe,tokenResetBaseTime:de?void 0:_e?_e.getTime():void 0,requestCountLimit:de?void 0:Ke,requestResetInterval:de?void 0:Ye,requestResetBaseTime:de?void 0:Ze?Ze.getTime():void 0,frequencyLimit:J,frequencyWindow:ue,useMCP:ie==="image-understanding"?de:!1,mcpId:ie==="image-understanding"&&de?Ae:void 0,sessionTokenThreshold:ie==="long-context"?Ge:void 0};I?await q.updateRule(I.id,me):await q.createRule(me),R(!1),A&&bo(A.id)},SL=async C=>{await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"})&&(await q.deleteRule(C),A&&bo(A.id),K.success("规则已删除"))},kL=async C=>{try{const te=await q.toggleRuleDisable(C);A&&bo(A.id),K.success(te.isDisabled?"规则已屏蔽":"规则已启用")}catch(te){K.error("操作失败: "+te.message)}},CL=async C=>{var te,me;try{const Oe=[];(te=ge[C])!=null&&te.isBlacklisted&&Oe.push(q.clearRuleBlacklist(C));const kt=(me=t[C])==null?void 0:me.status;(kt==="error"||kt==="suspended")&&Oe.push(n(C)),await Promise.all(Oe),A&&bo(A.id),K.success("已恢复")}catch(Oe){K.error("恢复失败: "+Oe.message)}},PL=async C=>{try{const te=a.find(on=>on.id===C);if(!te)return;const me=a.filter(on=>on.contentType===te.contentType),kt=Math.max(...me.map(on=>on.sortOrder||0))+1;await q.updateRule(C,{sortOrder:kt}),A&&bo(A.id),K.success("优先级已提升至最高")}catch(te){K.error("操作失败: "+te.message)}},AL=async C=>{try{if(!a.find(Oe=>Oe.id===C))return;await q.updateRule(C,{sortOrder:0}),A&&bo(A.id),K.success("优先级已降至最低")}catch(te){K.error("操作失败: "+te.message)}},EL=async C=>{try{const te=y||{};await q.updateConfig({...te,enableAgentTeams:C}),K.success(C?"Agent Teams 设置已保存(重启 Claude Code 后生效)":"Agent Teams 设置已取消(重启 Claude Code 后生效)"),await xr()}catch(te){K.error("更新失败: "+te.message)}},TL=async C=>{try{const te=y||{},me=Hg(y),Oe=!C&&me==="bypassPermissions"?"default":me;await q.updateConfig({...te,enableBypassPermissionsSupport:C,claudePermissionsDefaultMode:Oe}),K.success(C?"对 bypassPermissions 的支持设置已保存(重启 Claude Code 后生效)":"对 bypassPermissions 的支持设置已取消(重启 Claude Code 后生效)"),await xr()}catch(te){K.error("更新失败: "+te.message)}},IL=async C=>{try{const te=y||{};await q.updateConfig({...te,claudePermissionsDefaultMode:C}),K.success("默认权限模式已保存(重启 Claude Code 后生效)"),await xr()}catch(te){K.error("更新失败: "+te.message)}},OL=async C=>{try{gi(!0);const te=y||{};await q.updateConfig({...te,codexModelReasoningEffort:C}),K.success("Reasoning Effort 设置已保存(重启 Codex 后生效)"),await xr()}catch(te){K.error("更新失败: "+te.message)}finally{gi(!1)}},NL=async C=>{try{Ta(!0);const te=y||{};await q.updateConfig({...te,claudeEffortLevel:C}),K.success("Effort Level 设置已保存(重启 Claude Code 后生效)"),await xr()}catch(te){K.error("更新失败: "+te.message)}finally{Ta(!1)}},ML=async()=>{try{const C=y||{};await q.updateConfig({...C,claudeDefaultModel:ce.trim()||void 0}),K.success("默认模型已保存(重启 Claude Code 后生效)"),sr(!1),await xr()}catch(C){K.error("保存失败: "+C.message)}},_L=async()=>{const C=Qi.trim();if(C===""){try{const me=y||{};await q.updateConfig({...me,autocompactPctOverride:void 0}),K.success("自动压缩百分比已清除(重启 Claude Code 后生效)"),z(!1),await xr()}catch(me){K.error("保存失败: "+me.message)}return}const te=Number(C);if(!Number.isInteger(te)||te<1||te>100){K.error("自动压缩百分比必须为 1-100 的整数");return}try{const me=y||{};await q.updateConfig({...me,autocompactPctOverride:te}),K.success("自动压缩百分比已保存(重启 Claude Code 后生效)"),z(!1),await xr()}catch(me){K.error("保存失败: "+me.message)}},RL=async()=>{try{const C=y||{};await q.updateConfig({...C,codexDefaultModel:Pe.trim()||void 0}),K.success("默认模型已保存(重启 Codex 后生效)"),xt(!1),await xr()}catch(C){K.error("保存失败: "+C.message)}},DL=async()=>{try{const C=y||{};await q.updateConfig({...C,opencodeDefaultModel:Qt.trim()||void 0}),K.success("默认模型已保存(重启 OpenCode 后生效)"),Ps(!1),await xr()}catch(C){K.error("保存失败: "+C.message)}},LL=async()=>{try{const C=y||{},te=Number(qe),me=Number.isFinite(te)&&te>0?te:void 0;await q.updateConfig({...C,ruleGlobalTimeout:me}),K.success(me?`规则全局超时时间已设置为 ${me} 秒`:"规则全局超时时间已恢复为默认值(300秒)"),await xr()}catch(C){K.error("更新失败: "+C.message)}},zL=()=>ak,$L=C=>{$(C),je(C.contentType),ve(C.useMCP||!1),Ee(C.mcpId||"");const te=d.find(me=>me.id===C.targetServiceId);te?(te.vendorId&&(N(te.vendorId),g(d.filter(me=>me.vendorId===te.vendorId))),setTimeout(()=>{if(P(te.id),le(C.targetModel||""),he(C.replacedModel||""),Q(C.sortOrder||0),Le(C.timeout?C.timeout/1e3:void 0),re(C.tokenLimit||void 0),se(C.resetInterval),ke(C.tokenResetBaseTime?new Date(C.tokenResetBaseTime):void 0),pt(C.requestCountLimit),Qe(C.requestResetInterval),tt(C.requestResetBaseTime?new Date(C.requestResetBaseTime):void 0),Y(C.frequencyLimit),M(C.frequencyWindow),te.enableTokenLimit&&te.tokenLimit){Ie(te.tokenLimit);const me=C.tokenLimit===te.tokenLimit&&C.resetInterval===(te.tokenResetInterval||void 0)&&C.tokenLimit!==null&&C.resetInterval!==null;Se(me)}else Ie(void 0),Se(!1);if(te.enableRequestLimit&&te.requestCountLimit){L(te.requestCountLimit);const me=C.requestCountLimit===te.requestCountLimit&&C.requestResetInterval===(te.requestResetInterval||void 0)&&C.requestCountLimit!==null&&C.requestResetInterval!==null;$e(me)}else L(void 0),$e(!1);Je(!!C.tokenLimit),Ut(!!C.requestCountLimit),nt(C.sessionTokenThreshold??1e3)},0)):(C.useMCP&&(N(""),P(""),le(""),he(""),Q(C.sortOrder||0),Le(C.timeout?C.timeout/1e3:void 0),Je(!1),Ut(!1)),nt(C.sessionTokenThreshold??1e3)),R(!0)},BL=C=>l.some(te=>{var me;return te.routeId===C&&((me=t[te.id])==null?void 0:me.status)==="in_use"}),FL=C=>{var Tn;const te=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 Re=Oe.errorType==="timeout"?"超时":Oe.errorType==="http"?"HTTP错误":"错误";return{status:"suspended",label:"已挂起",reason:Oe.errorMessage||`${Re}导致服务暂时不可用`}}if((Oe==null?void 0:Oe.status)==="error")return{status:"error",label:"请求失败",reason:Oe.errorMessage||"请求处理失败"};if(te!=null&&te.isBlacklisted){const Re=te.blacklistEntry;(Re==null?void 0:Re.errorType)==="timeout"?me.push("请求超时"):Re!=null&&Re.lastStatusCode&&me.push(`HTTP ${Re.lastStatusCode}错误`)}const kt=(Oe==null?void 0:Oe.totalTokensUsed)!==void 0?Oe.totalTokensUsed:C.totalTokensUsed;C.tokenLimit&&kt!==void 0&&kt>=C.tokenLimit*1e3&&me.push("Token超限");const on=(Oe==null?void 0:Oe.totalRequestsUsed)!==void 0?Oe.totalRequestsUsed:C.totalRequestsUsed;if(C.requestCountLimit&&on!==void 0&&on>=C.requestCountLimit&&me.push("次数超限"),me.length>0)return{status:"error",label:te!=null&&te.isBlacklisted?((Tn=te.blacklistEntry)==null?void 0:Tn.errorType)==="timeout"?"超时":"服务错误":me[0],reason:me.join(", ")};const vi=[];if(C.tokenLimit&&kt!==void 0){const Re=kt/(C.tokenLimit*1e3)*100;Re>=80&&vi.push(`Token ${Re.toFixed(0)}%`)}if(C.requestCountLimit&&on!==void 0){const Re=on/C.requestCountLimit*100;Re>=80&&vi.push(`次数 ${Re.toFixed(0)}%`)}return vi.length>0?{status:"warning",label:"接近限制",reason:vi.join(", ")}:{status:"success",label:"正常",reason:""}},UL=()=>{$(null),je("default"),N(""),P(""),le(""),he(""),Q(0),Le(void 0),re(void 0),se(void 0),ke(void 0),pt(void 0),Qe(void 0),tt(void 0),Se(!1),$e(!1),Ie(void 0),L(void 0),Je(!1),Ut(!1),ve(!1),Ee(""),nt(1e3),R(!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:()=>Et(!0),style:{whiteSpace:"nowrap"},children:"局域网内同步配置"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>Wt(!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:()=>O(!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 te,me,Oe,kt,on,vi;return o.jsx("div",{className:BL(C.id)?"route-active-glow":void 0,onClick:()=>T(C),style:{padding:"12px",marginBottom:"8px",backgroundColor:A&&A.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:[xo[C.id]>0&&o.jsxs("div",{style:{position:"relative"},children:[o.jsx("div",{onClick:Tn=>{Tn.stopPropagation(),gL(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:xo[C.id]>99?"99+":xo[C.id]}),o.jsxs("span",{className:"route-icon-popover",children:[xo[C.id]," 个会话绑定此路由,点击查看"]})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:nU,alt:"Codex",onClick:Tn=>{var Re;Tn.stopPropagation(),!Xn&&(((Re=Fe==null?void 0:Fe.codex)==null?void 0:Re.routeId)===C.id?Is("codex"):Ts("codex",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:Xn?"wait":"pointer",opacity:((te=Fe==null?void 0:Fe.codex)==null?void 0:te.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=Fe==null?void 0:Fe.codex)==null?void 0:me.routeId)===C.id?"Codex 已绑定此路由,点击解绑":"点击将 Codex 绑定到此路由"})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:rU,alt:"Claude Code",onClick:Tn=>{var Re;Tn.stopPropagation(),!Xn&&(((Re=Fe==null?void 0:Fe["claude-code"])==null?void 0:Re.routeId)===C.id?Is("claude-code"):Ts("claude-code",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:Xn?"wait":"pointer",opacity:((Oe=Fe==null?void 0:Fe["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:((kt=Fe==null?void 0:Fe["claude-code"])==null?void 0:kt.routeId)===C.id?"Claude Code 已绑定此路由,点击解绑":"点击将 Claude Code 绑定到此路由"})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("div",{onClick:Tn=>{var Re;Tn.stopPropagation(),!Xn&&(((Re=Fe==null?void 0:Fe.opencode)==null?void 0:Re.routeId)===C.id?Is("opencode"):Ts("opencode",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:Xn?"wait":"pointer",opacity:((on=Fe==null?void 0:Fe.opencode)==null?void 0:on.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#10B981"},children:o.jsx(ub,{size:18})}),o.jsx("span",{className:"route-icon-popover",children:((vi=Fe==null?void 0:Fe.opencode)==null?void 0:vi.routeId)===C.id?"OpenCode 已绑定此路由,点击解绑":"点击将 OpenCode 绑定到此路由"})]})]})]}),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:Tn=>{Tn.stopPropagation(),V(C),O(!0)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:Tn=>{Tn.stopPropagation(),wL(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:"规则列表"}),A&&o.jsx("button",{className:"btn btn-primary",onClick:UL,children:"新建规则"})]}),A?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,te)=>{const me=ok[C.contentType]??999,Oe=ok[te.contentType]??999;if(me!==Oe)return me-Oe;const kt=C.sortOrder||0;return(te.sortOrder||0)-kt}).map(C=>{var kt,on,vi,Tn;const te=d.find(Re=>Re.id===C.targetServiceId),me=u.find(Re=>Re.id===(te==null?void 0:te.vendorId)),Oe=(kt=ak.find(Re=>Re.value===C.contentType))==null?void 0:kt.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:()=>AL(C.id),title:"降至最低优先级",children:"↓"}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>PL(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"&&sk[C.contentType]&&o.jsx("span",{style:{fontSize:"14px"},children:sk[C.contentType]}),o.jsx("span",{children:Oe}),C.contentType==="model-mapping"&&C.replacedModel&&o.jsxs("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:()=>ee(C.id),onMouseLeave:()=>ee(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:",((on=v.find(Re=>Re.id===C.mcpId))==null?void 0:on.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:["服务:",te?te.name:"Unknown"]}),o.jsxs("div",{children:["模型:",C.targetModel||"透传模型"]})]})})}),o.jsx("td",{style:{whiteSpace:"nowrap",...C.isDisabled?{opacity:.4}:{}},children:(()=>{var Bw,Fw,Uw,Ww;const Re=FL(C),Qn=ge[C.id],WL=(Qn==null?void 0:Qn.isBlacklisted)&&!((Bw=Re.reason)!=null&&Bw.includes("Token超限"))&&!((Fw=Re.reason)!=null&&Fw.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 KL=WL||((Uw=t[C.id])==null?void 0:Uw.status)==="error"||((Ww=t[C.id])==null?void 0:Ww.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:[Re.status==="success"&&o.jsx("span",{style:{color:"#28a745",fontWeight:"bold",fontSize:"14px"},children:"✓"}),Re.status==="warning"&&o.jsx("span",{style:{color:"#ffc107",fontWeight:"bold",fontSize:"14px"},children:"⚠"}),Re.status==="error"&&o.jsx("span",{style:{color:"#dc3545",fontWeight:"bold",fontSize:"14px"},children:"✗"}),Re.status==="suspended"&&o.jsx("span",{style:{color:"#6f42c1",fontWeight:"bold",fontSize:"14px"},children:"⏸"}),Re.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:Re.status==="success"?"#28a745":Re.status==="warning"?"#ffc107":Re.status==="in_use"?"#007bff":Re.status==="suspended"?"#6f42c1":"#dc3545",fontWeight:Re.status!=="success"?"bold":"normal"},children:Re.label}),Re.reason&&o.jsxs("div",{style:{position:"relative",display:"inline-block",cursor:"help"},onMouseEnter:()=>ee(C.id+"-status"),onMouseLeave:()=>ee(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:[Re.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)"}})]})]})]}),KL&&o.jsx("button",{className:"btn btn-info",style:{padding:"2px 8px",fontSize:"11px"},onClick:()=>CL(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 Qn;const Re=((Qn=t[C.id])==null?void 0:Qn.totalTokensUsed)??C.totalTokensUsed;return Re&&C.tokenLimit&&Re>=C.tokenLimit*1e3?"red":"inherit"})()},children:[(((((vi=t[C.id])==null?void 0:vi.totalTokensUsed)??C.totalTokensUsed)||0)/1e3).toFixed(1),"K/",C.tokenLimit.toFixed(0),"K"]}),(()=>{var Qn;const Re=((Qn=t[C.id])==null?void 0:Qn.totalTokensUsed)??C.totalTokensUsed;return Re&&C.tokenLimit&&Re>=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 Qn;const Re=((Qn=t[C.id])==null?void 0:Qn.totalRequestsUsed)??C.totalRequestsUsed;return Re&&C.requestCountLimit&&Re>=C.requestCountLimit?"red":"inherit"})()},children:[(((Tn=t[C.id])==null?void 0:Tn.totalRequestsUsed)??C.totalTokensUsed)||0,"/",C.requestCountLimit]}),(()=>{var Qn;const Re=((Qn=t[C.id])==null?void 0:Qn.totalRequestsUsed)??C.totalRequestsUsed;return Re&&C.requestCountLimit&&Re>=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:()=>kL(C.id),title:C.isDisabled?"启用规则":"临时屏蔽规则",children:C.isDisabled?"启用":"屏蔽"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>$L(C),children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>SL(C.id),children:"删除"})]})})]},C.id)})})]}):o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"请先选择一个路由"})}),A&&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:"先分类型,再排顺序,上主下备"})]})]}),A&&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:qe,onChange:C=>ze(C.target.value),onBlur:()=>LL(),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:w.map(C=>{const te=C.apiPath==="/v1/models",me=te?!!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:te?o.jsx("input",{type:"text",value:k,onChange:Oe=>S(Oe.target.value),onBlur:mL,placeholder:"自定义模型列表,英文逗号分隔,留空使用默认列表"}):o.jsxs("select",{value:C.routeId||"",onChange:Oe=>hL(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:((Iw=Fe==null?void 0:Fe["claude-code"])==null?void 0:Iw.routeId)||"",onChange:C=>{const te=C.target.value||null;te&&Ts("claude-code",te)},disabled:Xn==="claude-code",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var te;return o.jsxs("option",{value:C.id,children:[C.name,((te=Fe==null?void 0:Fe["claude-code"])==null?void 0:te.routeId)===C.id?" (已激活)":""]},C.id)})]}),((Ow=Fe==null?void 0:Fe["claude-code"])==null?void 0:Ow.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Is("claude-code"),disabled:Xn==="claude-code",children:Xn==="claude-code"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 Claude Code 代理请求。激活后,/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:(y==null?void 0:y.enableAgentTeams)||!1,onChange:C=>EL(C.target.checked),style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"agent-teams-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启 Agent Teams 功能"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后将启用 Agent Teams 实验性功能,并实时写入配置;重启 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:(y==null?void 0:y.enableBypassPermissionsSupport)||!1,onChange:C=>TL(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(VF,{value:Hg(y),options:Uv.filter(C=>C.value!=="bypassPermissions"||(y==null?void 0:y.enableBypassPermissionsSupport)).map(C=>({value:C.value,label:C.label,description:C.desc})),onChange:C=>IL(C)})})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:[(Nw=Uv.find(C=>C.value===Hg(y)))==null?void 0:Nw.desc,y!=null&&y.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:lU(y),onChange:C=>NL(C.target.value),disabled:Xi,style:{flex:1,minWidth:0},children:mO.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:ce,onChange:C=>{Mt(C.target.value),sr(C.target.value!==((y==null?void 0:y.claudeDefaultModel)||""))},onBlur:()=>{En&&ML()},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:Qi,onChange:C=>{an(C.target.value),z(C.target.value!==((y==null?void 0:y.autocompactPctOverride)!=null?String(y.autocompactPctOverride):""))},onBlur:()=>{B&&_L()},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:((Mw=Fe==null?void 0:Fe.codex)==null?void 0:Mw.routeId)||"",onChange:C=>{const te=C.target.value||null;te&&Ts("codex",te)},disabled:Xn==="codex",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var te;return o.jsxs("option",{value:C.id,children:[C.name,((te=Fe==null?void 0:Fe.codex)==null?void 0:te.routeId)===C.id?" (已激活)":""]},C.id)})]}),((_w=Fe==null?void 0:Fe.codex)==null?void 0:_w.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Is("codex"),disabled:Xn==="codex",children:Xn==="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:sU(y),onChange:C=>OL(C.target.value),disabled:St,style:{flex:1,minWidth:0},children:hO.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:Pe,onChange:C=>{st(C.target.value),xt(C.target.value!==((y==null?void 0:y.codexDefaultModel)||""))},onBlur:()=>{Ue&&RL()},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:!!(y!=null&&y.codexEnableMemories),onChange:async C=>{try{const te=y||{};await q.updateConfig({...te,codexEnableMemories:C.target.checked}),await xr(),await q.writeCodexConfig(void 0,C.target.checked),K.success("记忆功能设置已保存(重启 Codex 后生效)")}catch(te){K.error("更新失败: "+te.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:"OpenCode 全局配置"})}),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:"opencode-route-binding",value:((Rw=Fe==null?void 0:Fe.opencode)==null?void 0:Rw.routeId)||"",onChange:C=>{const te=C.target.value||null;te&&Ts("opencode",te)},disabled:Xn==="opencode",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var te;return o.jsxs("option",{value:C.id,children:[C.name,((te=Fe==null?void 0:Fe.opencode)==null?void 0:te.routeId)===C.id?" (已激活)":""]},C.id)})]}),((Dw=Fe==null?void 0:Fe.opencode)==null?void 0:Dw.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Is("opencode"),disabled:Xn==="opencode",children:Xn==="opencode"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 OpenCode 代理请求。激活后,/opencode/ 路径的请求将使用该路由的规则。"})]}),o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"opencode-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"opencode-default-model",type:"text",value:Qt,onChange:C=>{yi(C.target.value),Ps(C.target.value!==((y==null?void 0:y.opencodeDefaultModel)||""))},onBlur:()=>{jd&&DL()},placeholder:"例如:claude-sonnet-4-20250514",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置后写入 ~/.config/opencode/opencode.json 的 provider.aicodeswitch 模型映射,重启 OpenCode 后生效。留空则使用默认模型。"})]})]}),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"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"OpenCode:"})," ~/.config/opencode/opencode.json(写入 provider.aicodeswitch 段,经 @ai-sdk/openai-compatible 指向 /opencode/v1,使用 OpenAI Chat Completions 格式)"]})]})]})]})]}),D&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>O(!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:X?"编辑路由":"新建路由"})}),o.jsxs("form",{onSubmit:bL,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.jsx("label",{children:"描述"}),o.jsx("textarea",{name:"description",rows:3,defaultValue:X?X.description:""})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>O(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),_&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>R(!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:I?"编辑规则":"新建规则"})}),o.jsxs("form",{onSubmit:jL,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"对象请求类型"}),o.jsx("select",{name:"contentType",value:ie,required:!0,onChange:C=>{je(C.target.value)},children:zL().map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),ie==="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] 接下来帮我解决一个简单的问题"})]})]}),ie==="model-mapping"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["被顶替模型 ",o.jsx("small",{children:"(可在日志中找出想要顶替的模型名)"})]}),o.jsx("input",{type:"text",value:E,onChange:C=>he(C.target.value),placeholder:"例如:gpt-4"})]}),ie==="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:Ge??1e3,onChange:C=>nt(Number(C.target.value)),placeholder:"1000",min:"1"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["当前对话(session)的累积tokens数量超过 ",Ge??1e3,"k 时,该对话的新请求将走此规则"]})]}),ie==="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:de,onChange:C=>ve(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服务"})]}),ie==="image-understanding"&&de&&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:v.length===0?o.jsx("div",{style:{padding:"12px",textAlign:"center",color:"var(--text-muted)"},children:"暂无MCP工具,请先在MCP管理页面添加"}):v.map(C=>o.jsxs("div",{onClick:()=>Ee(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))})]}),!de&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsxs("select",{value:H,onChange:C=>N(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:W,onChange:C=>{const te=C.target.value;P(te),le("");const me=d.find(Oe=>Oe.id===te);me&&(me.enableTokenLimit&&me.tokenLimit?(re(me.tokenLimit),se(me.tokenResetInterval),ke(me.tokenResetBaseTime?new Date(me.tokenResetBaseTime):void 0),Ie(me.tokenLimit),Se(!0),Je(!0)):(Ie(void 0),Se(!1),Je(!1)),me.enableRequestLimit&&me.requestCountLimit?(pt(me.requestCountLimit),Qe(me.requestResetInterval),tt(me.requestResetBaseTime?new Date(me.requestResetBaseTime):void 0),L(me.requestCountLimit),$e(!0),Ut(!0)):(L(void 0),$e(!1),Ut(!1)))},required:!0,disabled:!H,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:U,onChange:C=>le(C.target.value),disabled:!W,children:[o.jsx("option",{value:"",children:"透传模型名"}),(zw=(Lw=d.find(C=>C.id===W))==null?void 0:Lw.supportedModels)==null?void 0:zw.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:xe?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:ot,onChange:C=>Je(C.target.checked),disabled:xe,style:{marginRight:"8px",cursor:xe?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Tokens超量限制"}),xe&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),xe&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>Se(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),ot&&!xe&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Tokens超量(单位:k)"}),o.jsx("input",{type:"number",value:Z||"",onChange:C=>{const te=C.target.value?parseInt(C.target.value):void 0;if(te!==void 0&&He!==void 0&&te>He){K.warning(`Token超量值不能超过API服务的限制 (${He}k)`);return}re(te),xe&&te!==He&&Se(!1)},min:"0",max:He,placeholder:He?`最大 ${He}k`:"不限制",disabled:xe}),He&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",He,"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:pe||"",onChange:C=>{se(C.target.value?parseInt(C.target.value):void 0),xe&&Se(!1)},min:"1",placeholder:"不自动重置",disabled:xe}),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:_e?lk(_e):"",onChange:C=>{C.target.value?ke(new Date(C.target.value)):ke(void 0),xe&&Se(!1)},disabled:!pe||xe,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:De?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:tn,onChange:C=>Ut(C.target.checked),disabled:De,style:{marginRight:"8px",cursor:De?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"}),De&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),De&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>$e(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),tn&&!De&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量"}),o.jsx("input",{type:"number",value:Ke||"",onChange:C=>{const te=C.target.value?parseInt(C.target.value):void 0;if(te!==void 0&&Xe!==void 0&&te>Xe){K.warning(`请求次数超量值不能超过API服务的限制 (${Xe})`);return}pt(te),De&&te!==Xe&&$e(!1)},min:"0",max:Xe,placeholder:Xe?`最大 ${Xe}`:"不限制",disabled:De}),Xe&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",Xe,",当前值不能超过此限制"]}),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:Ye||"",onChange:C=>{Qe(C.target.value?parseInt(C.target.value):void 0),De&&$e(!1)},min:"1",placeholder:"不自动重置",disabled:De}),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:Ze?lk(Ze):"",onChange:C=>{C.target.value?tt(new Date(C.target.value)):tt(void 0),De&&$e(!1)},disabled:!Ye||De,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:!!J,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:"启用后,当同一内容类型的请求频率超过限制时,系统会自动切换到其他同类型规则"})]}),J&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制次数(并发数)"}),o.jsx("input",{type:"number",value:J||"",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:ue===0?0:ue||"",onChange:C=>{const te=C.target.value?parseInt(C.target.value):void 0;M(te===0?0:te)},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:ne||"",onChange:C=>Le(C.target.value?parseInt(C.target.value):void 0),min:"1",placeholder:y!=null&&y.ruleGlobalTimeout?`全局${y.ruleGlobalTimeout}秒`:"默认300秒"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["设置此规则的API请求超时时间。不设置则使用全局超时配置(当前为",y!=null&&y.ruleGlobalTimeout?`${y.ruleGlobalTimeout}秒`:"默认300秒","),超时后自动触发故障切换"]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"排序(值越大优先级越高)"}),o.jsx("input",{type:"number",value:ye,onChange:C=>Q(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:()=>R(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),o.jsx(pO,{show:ut,onClose:()=>Wt(!1),onComplete:()=>{Es(),ig(),ag(),kd(),Pw()}}),o.jsx(YF,{show:Xt,onClose:()=>Et(!1),onComplete:()=>{ig(),ag()}}),it&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:Ew,"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:["绑定会话 - ",(($w=r.find(C=>C.id===it))==null?void 0:$w.name)||it]})}),o.jsxs("div",{className:"modal-body-scrollable",style:{maxHeight:"460px"},children:[fL?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"加载中..."}):As.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:["以下 ",As.length," 个会话绑定了此路由:"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[As.slice(0,50).map((C,te)=>{var me;return o.jsxs("div",{style:{padding:"12px 0",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",borderBottom:te===Math.min(As.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":C.targetType==="opencode"?"badge-opencode":"badge-codex"}`,style:{fontSize:"11px"},children:C.targetType==="claude-code"?"Claude Code":C.targetType==="opencode"?"OpenCode":"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:kw===C.id,onClick:Oe=>{Oe.stopPropagation(),yL(C.id)},children:kw===C.id?"解绑中...":"解绑"})]},C.id)}),As.length>50&&o.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:"var(--text-tertiary)",padding:"8px"},children:["等共 ",As.length," 个会话"]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:Ew,children:"关闭"})]})]})]})]})}var gO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(bl,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",s="second",l="minute",c="hour",u="day",p="week",d="month",f="quarter",m="year",g="date",v="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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(V){var I=["th","st","nd","rd"],$=V%100;return"["+V+(I[($-20)%10]||I[$]||I[0])+"]"}},w=function(V,I,$){var H=String(V);return!H||H.length>=I?V:""+Array(I+1-H.length).join($)+V},j={s:w,z:function(V){var I=-V.utcOffset(),$=Math.abs(I),H=Math.floor($/60),N=$%60;return(I<=0?"+":"-")+w(H,2,"0")+":"+w(N,2,"0")},m:function V(I,$){if(I.date()<$.date())return-V($,I);var H=12*($.year()-I.year())+($.month()-I.month()),N=I.clone().add(H,d),W=$-N<0,P=I.clone().add(H+(W?-1:1),d);return+(-(H+($-N)/(W?N-P:P-N))||0)},a:function(V){return V<0?Math.ceil(V)||0:Math.floor(V)},p:function(V){return{M:d,y:m,w:p,d:u,D:g,h:c,m:l,s,ms:a,Q:f}[V]||String(V||"").toLowerCase().replace(/s$/,"")},u:function(V){return V===void 0}},k="en",S={};S[k]=b;var A="$isDayjsObject",T=function(V){return V instanceof R||!(!V||!V[A])},D=function V(I,$,H){var N;if(!I)return k;if(typeof I=="string"){var W=I.toLowerCase();S[W]&&(N=W),$&&(S[W]=$,N=W);var P=I.split("-");if(!N&&P.length>1)return V(P[0])}else{var U=I.name;S[U]=I,N=U}return!H&&N&&(k=N),N||!H&&k},O=function(V,I){if(T(V))return V.clone();var $=typeof I=="object"?I:{};return $.date=V,$.args=arguments,new R($)},_=j;_.l=D,_.i=T,_.w=function(V,I){return O(V,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var R=function(){function V($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[A]=!0}var I=V.prototype;return I.parse=function($){this.$d=function(H){var N=H.date,W=H.utc;if(N===null)return new Date(NaN);if(_.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var P=N.match(x);if(P){var U=P[2]-1||0,le=(P[7]||"0").substring(0,3);return W?new Date(Date.UTC(P[1],U,P[3]||1,P[4]||0,P[5]||0,P[6]||0,le)):new Date(P[1],U,P[3]||1,P[4]||0,P[5]||0,P[6]||0,le)}}return new Date(N)}($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return _},I.isValid=function(){return this.$d.toString()!==v},I.isSame=function($,H){var N=O($);return this.startOf(H)<=N&&N<=this.endOf(H)},I.isAfter=function($,H){return O($)<this.startOf(H)},I.isBefore=function($,H){return this.endOf(H)<O($)},I.$g=function($,H,N){return _.u($)?this[H]:this.set(N,$)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function($,H){var N=this,W=!!_.u(H)||H,P=_.p($),U=function(Z,re){var pe=_.w(N.$u?Date.UTC(N.$y,re,Z):new Date(N.$y,re,Z),N);return W?pe:pe.endOf(u)},le=function(Z,re){return _.w(N.toDate()[Z].apply(N.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(re)),N)},E=this.$W,he=this.$M,ye=this.$D,Q="set"+(this.$u?"UTC":"");switch(P){case m:return W?U(1,0):U(31,11);case d:return W?U(1,he):U(0,he+1);case p:var ie=this.$locale().weekStart||0,je=(E<ie?E+7:E)-ie;return U(W?ye-je:ye+(6-je),he);case u:case g:return le(Q+"Hours",0);case c:return le(Q+"Minutes",1);case l:return le(Q+"Seconds",2);case s:return le(Q+"Milliseconds",3);default:return this.clone()}},I.endOf=function($){return this.startOf($,!1)},I.$set=function($,H){var N,W=_.p($),P="set"+(this.$u?"UTC":""),U=(N={},N[u]=P+"Date",N[g]=P+"Date",N[d]=P+"Month",N[m]=P+"FullYear",N[c]=P+"Hours",N[l]=P+"Minutes",N[s]=P+"Seconds",N[a]=P+"Milliseconds",N)[W],le=W===u?this.$D+(H-this.$W):H;if(W===d||W===m){var E=this.clone().set(g,1);E.$d[U](le),E.init(),this.$d=E.set(g,Math.min(this.$D,E.daysInMonth())).$d}else U&&this.$d[U](le);return this.init(),this},I.set=function($,H){return this.clone().$set($,H)},I.get=function($){return this[_.p($)]()},I.add=function($,H){var N,W=this;$=Number($);var P=_.p(H),U=function(he){var ye=O(W);return _.w(ye.date(ye.date()+Math.round(he*$)),W)};if(P===d)return this.set(d,this.$M+$);if(P===m)return this.set(m,this.$y+$);if(P===u)return U(1);if(P===p)return U(7);var le=(N={},N[l]=r,N[c]=i,N[s]=n,N)[P]||1,E=this.$d.getTime()+$*le;return _.w(E,this)},I.subtract=function($,H){return this.add(-1*$,H)},I.format=function($){var H=this,N=this.$locale();if(!this.isValid())return N.invalidDate||v;var W=$||"YYYY-MM-DDTHH:mm:ssZ",P=_.z(this),U=this.$H,le=this.$m,E=this.$M,he=N.weekdays,ye=N.months,Q=N.meridiem,ie=function(re,pe,se,_e){return re&&(re[pe]||re(H,W))||se[pe].slice(0,_e)},je=function(re){return _.s(U%12||12,re,"0")},Z=Q||function(re,pe,se){var _e=re<12?"AM":"PM";return se?_e.toLowerCase():_e};return W.replace(y,function(re,pe){return pe||function(se){switch(se){case"YY":return String(H.$y).slice(-2);case"YYYY":return _.s(H.$y,4,"0");case"M":return E+1;case"MM":return _.s(E+1,2,"0");case"MMM":return ie(N.monthsShort,E,ye,3);case"MMMM":return ie(ye,E);case"D":return H.$D;case"DD":return _.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return ie(N.weekdaysMin,H.$W,he,2);case"ddd":return ie(N.weekdaysShort,H.$W,he,3);case"dddd":return he[H.$W];case"H":return String(U);case"HH":return _.s(U,2,"0");case"h":return je(1);case"hh":return je(2);case"a":return Z(U,le,!0);case"A":return Z(U,le,!1);case"m":return String(le);case"mm":return _.s(le,2,"0");case"s":return String(H.$s);case"ss":return _.s(H.$s,2,"0");case"SSS":return _.s(H.$ms,3,"0");case"Z":return P}return null}(re)||P.replace(":","")})},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function($,H,N){var W,P=this,U=_.p(H),le=O($),E=(le.utcOffset()-this.utcOffset())*r,he=this-le,ye=function(){return _.m(P,le)};switch(U){case m:W=ye()/12;break;case d:W=ye();break;case f:W=ye()/3;break;case p:W=(he-E)/6048e5;break;case u:W=(he-E)/864e5;break;case c:W=he/i;break;case l:W=he/r;break;case s:W=he/n;break;default:W=he}return N?W:_.a(W)},I.daysInMonth=function(){return this.endOf(d).$D},I.$locale=function(){return S[this.$L]},I.locale=function($,H){if(!$)return this.$L;var N=this.clone(),W=D($,H,!0);return W&&(N.$L=W),N},I.clone=function(){return _.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},V}(),X=R.prototype;return O.prototype=X,[["$ms",a],["$s",s],["$m",l],["$H",c],["$W",u],["$M",d],["$y",m],["$D",g]].forEach(function(V){X[V[1]]=function(I){return this.$g(I,V[0],V[1])}}),O.extend=function(V,I){return V.$i||(V(I,R,O),V.$i=!0),O},O.locale=D,O.isDayjs=T,O.unix=function(V){return O(1e3*V)},O.en=S[k],O.Ls=S,O.p={},O})})(gO);var uU=gO.exports;const bt=Bl(uU);var yO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(bl,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,f){return a.fromToBase(u,p,d,f)}i.en.relativeTime=s,a.fromToBase=function(u,p,d,f,m){for(var g,v,x,y=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"}],w=b.length,j=0;j<w;j+=1){var k=b[j];k.d&&(g=f?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&&j>0&&(k=b[j-1]);var A=y[k.l];m&&(S=m(""+S)),v=typeof A=="string"?A.replace("%d",S):A(S,p,k.l,x);break}}if(p)return v;var T=x?y.future:y.past;return typeof T=="function"?T(v):T.replace("%s",v)},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)}}})})(yO);var dU=yO.exports;const db=Bl(dU),ju=({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)},f=()=>{c||r(s)},m=g=>{const v=parseInt(g.target.value,10);i(v)};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:f,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))}),"条"]})})]})},pU=["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"],fU=e=>{const t=e.toLowerCase();return!!(pU.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,""))))},hU=e=>!e||e.length<=8?"***":`${e.slice(0,4)}${"*".repeat(Math.min(e.length-8,20))}${e.slice(-4)}`,Wv=e=>{if(e==null)return e;if(Array.isArray(e))return e.map(t=>Wv(t));if(typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))fU(n)?t[n]=typeof r=="string"?hU(r):"***":typeof r=="object"?t[n]=Wv(r):t[n]=r;return t}return e},zr=({data:e,title:t,collapsed:n=!1})=>{const[r,i]=h.useState(!n),[a,s]=h.useState(!1),l=p=>{try{let d;typeof p=="string"?d=JSON.parse(p):d=p;const f=Wv(d);return JSON.stringify(f,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 Yu(e){const t=e.split(`
110
+ `).map(r=>r.trim()).join(`
111
+ `).split(`
112
+
113
+ `).filter(r=>r.trim()),n=[];for(const r of t){let i="",a=[],s=0;r.split(`
114
+ `).forEach(p=>{if(/^[a-z]+:/.test(p)){const d=p.indexOf(":"),f=p.slice(0,d).trim(),m=p.slice(d+1).trim();f==="event"?i=m:f==="data"?(a.push(m),s=1):a.length&&(s=-1)}else s===1&&a.push(p)});const c=a.length>0?a.join(`
115
+ `).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 Gu(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 mU(e,t){if(!e||e.length===0)return{text:"",thinking:""};const n=Yu(e);return Gu(n)}function vO(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}=mU(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 gU(e){const t=[];t.push(`# 请求日志详情
116
+ `),t.push("## 基本信息"),t.push(`- **日志ID**: ${e.id}`),t.push(`- **时间**: ${bt(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${Tl[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=vO(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=Yu(e.downstreamResponseBody),{text:i,thinking:a}=Gu(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(`
117
+ `)}function yU(e){const t=[];return t.push(`# 错误日志详情
118
+ `),t.push("## 基本信息"),t.push(`- **ID**: ${e.id}`),t.push(`- **时间**: ${bt(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${Tl[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(`
119
+ `)}const vU=1e6;function xU(e){return"errorMessage"in e}function bU({events:e}){const{text:t,thinking:n}=Gu(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 wU({log:e}){const[t,n]=h.useState(!1),[r,i]=h.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:bt(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:Tl[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(zr,{data:e.headers,collapsed:!0})]}),e.body&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(zr,{data:e.body,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(zr,{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(zr,{data:e.responseHeaders,collapsed:!0})]}),(()=>{const a=vO(e);return a?o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(zr,{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}
120
+ 输出: ${e.usage.outputTokens}
121
+ `+(e.usage.totalTokens!==void 0?`总计: ${e.usage.totalTokens}
122
+ `:"")+(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(zr,{data:e.downstreamResponseBody,collapsed:!0})]}),(()=>{const a=e.downstreamResponseBody;if(!a||!(typeof a=="string"&&(a.includes("event:")||a.includes("data:"))))return null;const l=Yu(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(zr,{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(bU,{events:l})})]})})()]})}function jU({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:bt(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:Tl[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(zr,{data:e.requestHeaders,collapsed:!0})]}),e.requestBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(zr,{data:e.requestBody,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(zr,{data:e.upstreamRequest})]}),e.responseHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应头"}),o.jsx(zr,{data:e.responseHeaders,collapsed:!0})]}),e.responseBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(zr,{data:e.responseBody})]})]})}function yf({log:e,onClose:t,zIndex:n}){const r=n??vU,i=xU(e),a=()=>{const s=i?yU(e):gU(e);navigator.clipboard.writeText(s).then(()=>{K.success("复制成功")}).catch(()=>{K.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(jU,{log:e}):o.jsx(wU,{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 SU=!1;bt.extend(db);function kU(){const{confirm:e}=qu(),[t,n]=h.useState("request"),[r,i]=h.useState([]),[a,s]=h.useState([]),[l,c]=h.useState(null),[u,p]=h.useState(null),[d,f]=h.useState(1),[m,g]=h.useState(20),[v,x]=h.useState(0),[y,b]=h.useState(1),[w,j]=h.useState(20),[k,S]=h.useState(0),[A,T]=h.useState(0),[D,O]=h.useState(0),[_,R]=h.useState(!1),[X,V]=h.useState(!1),[I,$]=h.useState(10),[H,N]=h.useState([]),[W,P]=h.useState([]),[U,le]=h.useState([]),[E,he]=h.useState(""),[ye,Q]=h.useState(""),[ie,je]=h.useState(""),[Z,re]=h.useState(""),[pe,se]=h.useState(""),[_e,ke]=h.useState(""),[ne,Le]=h.useState(""),[qe,ze]=h.useState(""),[Ke,pt]=h.useState(""),Ye=h.useRef({activeTab:t,requestLogsPage:d,requestLogsPageSize:m,errorLogsPage:y,errorLogsPageSize:w,appliedSearchQuery:ne,appliedErrorSearchQuery:Ke,filterTargetType:E,filterVendorId:ye,filterServiceId:ie,filterModel:Z,filterRouteId:pe});Ye.current={activeTab:t,requestLogsPage:d,requestLogsPageSize:m,errorLogsPage:y,errorLogsPageSize:w,appliedSearchQuery:ne,appliedErrorSearchQuery:Ke,filterTargetType:E,filterVendorId:ye,filterServiceId:ie,filterModel:Z,filterRouteId:pe},h.useEffect(()=>{tt()},[t,d,m,y,w,ne,Ke,E,ye,ie,Z,pe]),h.useEffect(()=>{Qe(),Ze()},[]),h.useEffect(()=>{let ce=null,Mt=null;return X&&(Mt=setInterval(()=>{$(En=>En<=1?10:En-1)},1e3),ce=setInterval(()=>{tt(),Ze()},1e4)),()=>{ce&&clearInterval(ce),Mt&&clearInterval(Mt)}},[X,t,d,m,y,w]);const Qe=async()=>{try{const[ce,Mt,En]=await Promise.all([q.getVendors(),q.getAPIServices(),q.getRoutes()]);N(ce),P(Mt),le(En)}catch(ce){console.error("Failed to load filter options:",ce)}},Ze=async()=>{try{const[ce,Mt]=await Promise.all([q.getLogsCount(),q.getErrorLogsCount()]);T(ce.count),O(Mt.count)}catch(ce){console.error("Failed to load badge counts:",ce)}},tt=async()=>{const ce=Ye.current,Mt={targetType:ce.filterTargetType||void 0,vendorId:ce.filterVendorId||void 0,serviceId:ce.filterServiceId||void 0,model:ce.filterModel||void 0,routeId:ce.filterRouteId||void 0};R(!0);try{if(ce.activeTab==="request"){const En=(ce.requestLogsPage-1)*ce.requestLogsPageSize,sr=await q.queryLogs({filters:Mt,keyword:ce.appliedSearchQuery.trim()||void 0,limit:ce.requestLogsPageSize,offset:En});i(sr.logs),x(sr.total)}else if(ce.activeTab==="error"){const En=(ce.errorLogsPage-1)*ce.errorLogsPageSize,sr=await q.queryErrorLogs({filters:Mt,keyword:ce.appliedErrorSearchQuery.trim()||void 0,limit:ce.errorLogsPageSize,offset:En});s(sr.logs),S(sr.total)}}catch(En){console.error("Failed to load logs:",En)}finally{R(!1)}},J=ce=>ce?ce>=200&&ce<300?"badge-success":ce>=400&&ce<500?"badge-warning":"badge-danger":"badge-danger",Y=ce=>{Q(ce),je(""),re(""),f(1),b(1)},ue=ce=>{je(ce),re(""),f(1),b(1)},M=()=>{f(1),b(1)},fe=ce=>{he(ce),M()},ee=ce=>{re(ce),M()},xe=ce=>{se(ce),M()},Se=()=>{he(""),Q(""),je(""),re(""),se(""),ke(""),Le(""),ze(""),pt(""),M()},De=()=>{ke(""),Le(""),f(1)},$e=()=>{ze(""),pt(""),b(1)},He=()=>ye?W.filter(ce=>ce.vendorId===ye):[],Ie=()=>{var ce;return ie?((ce=W.find(Mt=>Mt.id===ie))==null?void 0:ce.supportedModels)||[]:[]},Xe=!!(E||ye||ie||Z||pe||ne||Ke),L=ce=>f(ce),ge=ce=>{g(ce),f(1)},F=ce=>b(ce),de=ce=>{j(ce),b(1)},ve=()=>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(ce=>o.jsxs("tr",{children:[o.jsx("td",{children:bt(ce.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:Tl[ce.targetType]?o.jsx("span",{className:`badge ${ce.targetType==="claude-code"?"badge-claude-code":ce.targetType==="codex"?"badge-codex":ce.targetType==="opencode"?"badge-opencode":"badge-info"}`,children:Tl[ce.targetType]}):"-"}),o.jsx("td",{children:ce.path}),o.jsx("td",{children:o.jsx("span",{className:`badge ${J(ce.statusCode)}`,children:ce.statusCode||"Error"})}),o.jsx("td",{children:ce.responseTime?`${ce.responseTime}ms`:"-"}),o.jsx("td",{children:ce.usage?o.jsxs("span",{children:[ce.usage.totalTokens?ce.usage.totalTokens:ce.usage.inputTokens+ce.usage.outputTokens," tokens"]}):"-"}),o.jsx("td",{children:o.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[(()=>{const Mt=ce.downstreamResponseBody;return typeof Mt=="string"&&(Mt.includes("event:")||Mt.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(ce),children:"详情"})]})})]},ce.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(ce=>o.jsxs("tr",{children:[o.jsx("td",{children:bt(ce.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:ce.method})}),o.jsx("td",{children:ce.path}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:ce.statusCode||"-"})}),o.jsx("td",{style:{maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#e74c3c"},children:ce.errorMessage}),o.jsx("td",{children:o.jsx("button",{className:"btn btn-secondary",onClick:()=>p(ce),children:"详情"})})]},ce.id))})]}),Ee={padding:"15px",background:"var(--bg-secondary)",borderRadius:"12px",marginBottom:"20px",display:"flex",gap:"15px",alignItems:"center",flexWrap:"wrap",border:"1px solid var(--border-primary)"},Ge={display:"flex",alignItems:"center",gap:"8px"},nt={fontWeight:"bold",color:"var(--text-primary)"},ot={padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},Je={...ot,minWidth:"150px"},tn={padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"1px solid var(--accent-danger)",background:"var(--accent-danger)",color:"white"},Ut={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",width:"320px",fontSize:"14px"},ut={padding:"6px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"none",background:"var(--accent-primary, #3498db)",color:"white"},Wt={padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},Xt=t==="request",Et=Xt?_e:qe,St=ce=>Xt?ke(ce):ze(ce),gi=()=>{Xt?(Le(_e),f(1)):(pt(qe),b(1))},Xi=Xt?ne:Ke,Ta=Xt?De:$e;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请求日志"})]}),SU]})}),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:["请求日志 (",A,")"]}),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:X,onChange:ce=>{V(ce.target.checked),ce.target.checked&&$(10)},style:{cursor:"pointer"}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",X&&`(⏱ ${I}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{tt(),Ze(),$(10)},children:"刷新"})]})]}),o.jsxs("div",{style:Ee,children:[o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"来源类型:"}),o.jsxs("select",{value:E,onChange:ce=>fe(ce.target.value),style:ot,children:[o.jsx("option",{value:"",children:"全部"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"}),o.jsx("option",{value:"opencode",children:"OpenCode"})]})]}),o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"供应商:"}),o.jsxs("select",{value:ye,onChange:ce=>Y(ce.target.value),style:Je,children:[o.jsx("option",{value:"",children:"全部供应商"}),H.map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})]}),o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"API服务:"}),o.jsxs("select",{value:ie,onChange:ce=>ue(ce.target.value),disabled:!ye,style:{...Je,background:ye?"var(--bg-card)":"var(--bg-secondary)",cursor:ye?"pointer":"not-allowed",opacity:ye?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),He().map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})]}),o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"模型:"}),o.jsxs("select",{value:Z,onChange:ce=>ee(ce.target.value),disabled:!ie,style:{...Je,background:ie?"var(--bg-card)":"var(--bg-secondary)",cursor:ie?"pointer":"not-allowed",opacity:ie?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),Ie().map(ce=>o.jsx("option",{value:ce,children:ce},ce))]})]}),o.jsxs("div",{style:Ge,children:[o.jsx("label",{style:nt,children:"路由:"}),o.jsxs("select",{value:pe,onChange:ce=>xe(ce.target.value),style:Je,children:[o.jsx("option",{value:"",children:"全部路由"}),U.map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})]}),Xe&&o.jsx("button",{style:tn,onClick:Se,children:"清除筛选"}),o.jsxs("div",{style:Ge,children:[o.jsx("input",{type:"text",placeholder:Xt?"搜索日志内容...":"搜索错误日志...",value:Et,onChange:ce=>St(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&gi()},style:Ut}),o.jsx("button",{style:ut,onClick:gi,children:"搜索"}),(Et||Xi)&&o.jsx("button",{style:Wt,onClick:Ta,children:"清空"})]})]}),t==="request"&&o.jsxs(o.Fragment,{children:[_?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):ve(),!_&&o.jsx(ju,{currentPage:d,totalItems:v,pageSize:m,onPageChange:L,onPageSizeChange:ge})]}),t==="error"&&o.jsxs(o.Fragment,{children:[_?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):Ae(),!_&&o.jsx(ju,{currentPage:y,totalItems:k,pageSize:w,onPageChange:F,onPageSizeChange:de})]})]}),l&&o.jsx(yf,{log:l,onClose:()=>c(null)}),u&&o.jsx(yf,{log:u,onClose:()=>p(null)})]})}function CU({session:e,onClose:t}){var _;const[n,r]=h.useState(e.targetType==="claude-code"?"codex":"claude-code"),[i,a]=h.useState(!1),[s,l]=h.useState(!0),[c,u]=h.useState(0),[p,d]=h.useState(!1),[f,m]=h.useState(null),[g,v]=h.useState(""),[x,y]=h.useState(null),[b,w]=h.useState(!1),j=e.targetType==="claude-code"?"Claude Code":"Codex",k=n==="claude-code"?"Claude Code":"Codex",S=(()=>{const R=e.lastRequestAt-e.firstRequestAt,X=Math.floor(R/6e4);return X<1?`${Math.max(1,Math.floor(R/1e3))}秒`:X<60?`${X}分钟`:`${Math.floor(X/60)}小时${X%60}分钟`})(),A=async()=>{d(!0),m(null),y(null);try{const R={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:s,maxRounds:c},X=await q.migrationPreview(e.id,R);m(X),v(X.generatedPrompt)}catch(R){K.error(R.message||"预览失败")}finally{d(!1)}},T=async()=>{const R=g||(f==null?void 0:f.generatedPrompt)||"";try{await navigator.clipboard.writeText(R),K.success("已复制到剪贴板!请打开 "+k+",粘贴为第一条消息")}catch{const X=document.querySelector(".migration-prompt-textarea");X?(X.select(),document.execCommand("copy"),K.success("已复制到剪贴板!")):K.error("复制失败,请手动选择内容复制")}},D=async()=>{if(x!=null&&x.command)try{await navigator.clipboard.writeText(x.command),K.success("命令已复制!请在终端中执行")}catch{K.error("复制失败")}},O=async()=>{w(!0),y(null);try{const R={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:s,maxRounds:c},X=await q.migrateLaunch(e.id,R);y(X),X.success&&K.success(`已在新的终端窗口中启动 ${k}`)}catch(R){K.error(R.message||"启动失败")}finally{w(!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:["将 ",j," 会话迁移到 ",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:((_=e.title)==null?void 0:_.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:j}),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"),y(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"),y(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:R=>l(R.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:R=>a(R.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:R=>u(Number(R.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:A,disabled:p,children:p?"加载中...":"预览迁移内容"})}),!f&&!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 后即可启动目标工具或复制到剪贴板"})]})]}),f&&o.jsxs("div",{className:"migration-preview-section",style:{marginTop:"16px"},children:[o.jsx("textarea",{className:"migration-prompt-textarea",value:g,onChange:R=>v(R.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: ",f.estimatedTokens.toLocaleString(),f.warnings.map((R,X)=>o.jsxs("span",{style:{color:"#e67e22",marginLeft:"12px"},children:["⚠ ",R]},X)),f.content.extractedRounds>0&&o.jsxs("span",{style:{color:"var(--text-tertiary)",marginLeft:"12px"},children:[f.content.extractedRounds,"/",f.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((R,X)=>o.jsxs("div",{children:["• ",R]},X))})]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:O,disabled:b||!f,title:f?"":"请先预览迁移内容",children:b?"启动中...":`🚀 启动 ${k}`}),o.jsx("button",{className:"btn btn-secondary",onClick:T,disabled:!f,title:f?"":"请先预览迁移内容",children:"📋 复制到剪贴板"}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"关闭"})]})]})]})}function PU({session:e,onClose:t,onBound:n}){var y;const[r,i]=h.useState([]),[a,s]=h.useState({}),[l,c]=h.useState(e.routeId||null),[u,p]=h.useState(!1),[d,f]=h.useState(!0),m=e.targetType==="claude-code"?"Claude Code":"Codex";h.useEffect(()=>{(async()=>{try{const w=await q.getRoutes();i(w);const j={};for(const k of w)try{const S=await q.getRules(k.id);j[k.id]=S.length}catch{j[k.id]=0}s(j)}catch{K.error("加载路由列表失败")}finally{f(!1)}})()},[]);const g=async()=>{if(l){p(!0);try{const b=await q.bindSessionRoute(e.id,l);b.success?(K.success("路由绑定成功"),n(),t()):K.error(b.error||"绑定失败")}catch(b){K.error(b.message||"绑定失败")}finally{p(!1)}}},v=async()=>{p(!0);try{const b=await q.unbindSessionRoute(e.id);b.success?(K.success("已解除路由绑定"),n(),t()):K.error(b.error||"解绑失败")}catch(b){K.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:((y=e.title)==null?void 0:y.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 w=l===b.id,j=e.routeId===b.id;return o.jsx("div",{onClick:()=>c(b.id),style:{padding:"12px 14px",border:`2px solid ${w?"var(--color-primary, #2980b9)":"var(--border-primary, #e0e0e0)"}`,borderRadius:"8px",cursor:"pointer",backgroundColor:w?"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 ${w?"var(--color-primary, #2980b9)":"var(--border-secondary, #ccc)"}`,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:w&&o.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--color-primary, #2980b9)"}})}),b.name,j&&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:v,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 AU=Array.from({length:15},(e,t)=>t+1);function EU({onClose:e,onCleared:t}){const[n,r]=h.useState(7),[i,a]=h.useState(!1),[s,l]=h.useState(!1),c=async()=>{l(!0);try{const p=await q.cleanupSessions(n,i);p.sessionsAffected===0?K.info("没有符合条件的会话需要清除"):i?K.success(`已清除 ${p.sessionsAffected} 个会话的日志(共 ${p.logsDeleted} 条),会话记录已保留`):K.success(`已清除 ${p.sessionsAffected} 个会话及其关联日志(共 ${p.logsDeleted} 条)`),t(),e()}catch(p){K.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:AU.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?"处理中...":"确认清除"})]})]})]})}bt.extend(db);function TU(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(`
123
+ `),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(`
124
+ `):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):"",f=p?`[工具结果: ${p}${d?` · ...${d}`:""}]`:d?`[工具结果: ...${d}]`:"[工具结果]";i.push({role:"user",type:"tool_result",header:f,content:u||f,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}`:""),f=c.input?JSON.stringify(c.input,null,2):"";i.push({role:"assistant",type:"tool_use",header:`[工具调用: ${d}]`,content:f||`[工具调用: ${d}]`,timestamp:t,model:n})}(s||l)&&i.push({role:"assistant",content:s||"",thinking:l||void 0,timestamp:t,model:n})}}return i}function IU(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=Yu(r),{text:p,thinking:d}=Gu(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 f of u.content)if(f.type==="text"&&f.text&&(p+=f.text),f.type==="thinking"&&f.thinking&&(d+=f.thinking),f.type==="tool_use"){(p||d)&&(t.push({role:"assistant",content:p,thinking:d||void 0,...n}),p="",d="");const m=f.name||"",g=f.id?f.id.slice(-8):"",v=m+(g?` · ...${g}`:""),x=f.input?JSON.stringify(f.input,null,2):"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${v}]`,content:x||`[工具调用: ${v}]`,...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 f=((l=d.function)==null?void 0:l.name)||"",m=d.id?d.id.slice(-8):"",g=f+(m?` · ...${m}`:""),v=((c=d.function)==null?void 0:c.arguments)||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${g}]`,content:v||`[工具调用: ${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 f of d){if(f.type==="message"&&f.content){const m=Array.isArray(f.content)?f.content:[f.content];for(const g of m)g.type==="output_text"&&g.text?p+=g.text:typeof g=="string"&&(p+=g)}if(f.type==="function_call"){p&&(t.push({role:"assistant",content:p,...n}),p="");const m=f.name||"",g=f.call_id?f.call_id.slice(-8):"",v=m+(g?` · ...${g}`:""),x=f.arguments||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${v}]`,content:x||`[工具调用: ${v}]`,...n})}}if(p&&t.push({role:"assistant",content:p,...n}),t.length>0)return t}}catch{}return t}function pb(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=TU(p,s.timestamp,s.requestModel,r);t.push(...d)}const u=IU(s);t.push(...u)}return OU(t)}function OU(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 $o(e){return(e||"").replace("<session>","").replace("</session>","").trim()||"(无标题)"}function NU({content:e,header:t,forceCollapsible:n,hideContentWhenCollapsed:r}){const i=e.split(`
125
+ `),a=10,s=3,l=h.useRef(null),c=!!n,u=n||i.length>a,p=c?s:a,[d,f]=h.useState(!u),m=()=>{d?(requestAnimationFrame(()=>{const g=l.current,v=g==null?void 0:g.closest(".modal-body-scrollable");if(g&&v){const x=g.getBoundingClientRect(),y=v.getBoundingClientRect();(x.top<y.top||x.top>y.bottom)&&g.scrollIntoView({block:"start"})}}),f(!1)):f(!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(`
126
+ `)}),!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 MU({logs:e,onFetchNew:t}){const n=[...e].sort((m,g)=>m.timestamp-g.timestamp),[r,i]=h.useState(n),a=pb(r),s=h.useRef(null),[l,c]=h.useState(!1),[u,p]=h.useState(!1);h.useEffect(()=>{i([...e].sort((m,g)=>m.timestamp-g.timestamp))},[e]),h.useEffect(()=>{var v;const m=(v=s.current)==null?void 0:v.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"})},f=async()=>{if(l&&t){p(!0);try{const m=await t(),g=new Set(r.map(y=>y.id)),x=[...m].sort((y,b)=>y.timestamp-b.timestamp).filter(y=>!g.has(y.id));x.length>0&&(i(y=>[...y,...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(NU,{content:m.content,header:m.header,forceCollapsible:!!m.type,hideContentWhenCollapsed:m.type==="tool_use"})]}),!m.type&&o.jsxs("div",{className:"chat-meta",children:[bt(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:f,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 fb({session:e,logs:t,logsLoading:n,onRefreshLogs:r,onFetchNewLogs:i,onClose:a,onExport:s}){const[l,c]=h.useState("logs"),[u,p]=h.useState(null),d=(g,v)=>{const x=v-g;return x<6e4?`${Math.floor(x/1e3)}秒`:x<36e5?`${Math.floor(x/6e4)}分钟`:`${Math.floor(x/36e5)}小时`},f=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 v=`${$o(e.title)}.json`;if(l==="chat"){const x=pb(t),y={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(y,null,2)],{type:"application/json"}),w=URL.createObjectURL(b),j=document.createElement("a");j.href=w,j.download=v,j.click(),URL.revokeObjectURL(w)}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},y=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),b=URL.createObjectURL(y),w=document.createElement("a");w.href=b,w.download=v,w.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:$o(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"})," ",f(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:"首次请求"})," ",bt(e.firstRequestAt).format("YYYY-MM-DD HH:mm:ss")]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"最后请求"})," ",bt(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,v)=>g.timestamp-v.timestamp).map(g=>o.jsxs("tr",{children:[o.jsx("td",{children:bt(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(MU,{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(yf,{log:u,onClose:()=>p(null)})]})}bt.extend(db);function _U(){const[e,t]=h.useState([]),[n,r]=h.useState(0),[i,a]=h.useState(1),[s,l]=h.useState(20),[c,u]=h.useState(null),[p,d]=h.useState([]),[f,m]=h.useState(!1),[g,v]=h.useState(""),[x,y]=h.useState(""),[b,w]=h.useState(""),[j,k]=h.useState(""),[S,A]=h.useState(""),[T,D]=h.useState(""),[O,_]=h.useState(""),[R,X]=h.useState([]),[V,I]=h.useState([]),[$,H]=h.useState([]),[N,W]=h.useState(!1),[P,U]=h.useState(10),[le,E]=h.useState(null),[he,ye]=h.useState(null),[Q,ie]=h.useState(!1),je=h.useRef({sessionsPage:i,sessionsPageSize:s,appliedSearchQuery:x,filterTargetType:b,filterVendorId:j,filterServiceId:S,filterModel:T,filterRouteId:O});je.current={sessionsPage:i,sessionsPageSize:s,appliedSearchQuery:x,filterTargetType:b,filterVendorId:j,filterServiceId:S,filterModel:T,filterRouteId:O},h.useEffect(()=>{re()},[i,s,x,b,j,S,T,O]),h.useEffect(()=>{Z()},[]),h.useEffect(()=>{let J=null,Y=null;return N&&(Y=setInterval(()=>{U(ue=>ue<=1?10:ue-1)},1e3),J=setInterval(()=>{re()},1e4)),()=>{J&&clearInterval(J),Y&&clearInterval(Y)}},[N,i,s]);const Z=async()=>{try{const[J,Y,ue]=await Promise.all([q.getVendors(),q.getAPIServices(),q.getRoutes()]);X(J),I(Y),H(ue)}catch(J){console.error("Failed to load filter options:",J)}},re=async()=>{const J=je.current;try{const Y=(J.sessionsPage-1)*J.sessionsPageSize,ue=await q.getSessions({filters:{targetType:J.filterTargetType||void 0,vendorId:J.filterVendorId||void 0,serviceId:J.filterServiceId||void 0,model:J.filterModel||void 0,routeId:J.filterRouteId||void 0},keyword:J.appliedSearchQuery.trim()||void 0,limit:J.sessionsPageSize,offset:Y});t(ue.sessions),r(ue.total)}catch(Y){console.error("Failed to load sessions:",Y)}},pe=async J=>{u(J),m(!0);try{const Y=await q.getSessionLogs(J.id,1e4);d(Y)}catch(Y){console.error("Failed to load session logs:",Y)}finally{m(!1)}},se=(J,Y)=>{const ue=Y-J;return ue<6e4?`${Math.floor(ue/1e3)}秒`:ue<36e5?`${Math.floor(ue/6e4)}分钟`:`${Math.floor(ue/36e5)}小时`},_e=J=>J==="claude-code"?o.jsx("span",{className:"badge badge-claude-code",children:"Claude Code"}):J==="codex"?o.jsx("span",{className:"badge badge-codex",children:"Codex"}):J==="opencode"?o.jsx("span",{className:"badge badge-opencode",children:"OpenCode"}):o.jsx("span",{className:"badge",children:J}),ke=J=>{k(J),A(""),D(""),a(1)},ne=J=>{A(J),D(""),a(1)},Le=()=>j?V.filter(J=>J.vendorId===j):[],qe=()=>{if(!S)return[];const J=V.find(Y=>Y.id===S);return(J==null?void 0:J.supportedModels)||[]},ze=!!(x||b||j||S||T||O),Ke=()=>{v(""),y(""),w(""),k(""),A(""),D(""),_(""),a(1)},pt=(J,Y,ue)=>{const M=J;if(ue==="chat"){const Xe=pb(Y).map((Ee,Ge)=>({index:Ge+1,role:Ee.role,type:Ee.type||null,header:Ee.header||null,content:Ee.content,thinking:Ee.thinking||null,timestamp:bt(Ee.timestamp).format("YYYY-MM-DD HH:mm:ss"),model:Ee.model||null,tokens:Ee.tokens||null})),L={session:{id:M.id,title:$o(M.title),targetType:M.targetType,requestCount:M.requestCount,totalTokens:M.totalTokens,firstRequestAt:bt(M.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:bt(M.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:se(M.firstRequestAt,M.lastRequestAt)},messages:Xe,exportedAt:bt().format("YYYY-MM-DD HH:mm:ss")},ge=JSON.stringify(L,null,2),F=new Blob([ge],{type:"application/json;charset=utf-8"}),de=URL.createObjectURL(F),ve=document.createElement("a");ve.href=de;const Ae=$o(M.title).replace(/[\\/:*?"<>|]/g,"_");ve.download=`${Ae}_对话.json`,document.body.appendChild(ve),ve.click(),document.body.removeChild(ve),URL.revokeObjectURL(de),K.success("对话数据已导出");return}const fe=Y.map((Ie,Xe)=>{var de,ve,Ae,Ee;const L=((de=Ie.body)==null?void 0:de.messages)||[];let ge="";const F=Ie.downstreamResponseBody;if(typeof F=="string"&&(F.includes("event:")||F.includes("data:"))){const Ge=Yu(F),{text:nt,thinking:ot}=Gu(Ge),Je=[];ot&&Je.push(`<details><summary>思考过程</summary>
127
+
128
+ ${ot}
129
+
130
+ </details>`),nt&&Je.push(nt),ge=Je.join(`
131
+
132
+ `)}if(!ge&&Ie.responseBody)try{const Ge=typeof Ie.responseBody=="string"?JSON.parse(Ie.responseBody):Ie.responseBody;if(Ge.content){if(Array.isArray(Ge.content)){const nt=[];for(const ot of Ge.content)ot.type==="text"&&ot.text?nt.push(ot.text):ot.type==="thinking"&&ot.thinking&&nt.push(`<details><summary>思考过程</summary>
133
+
134
+ ${ot.thinking}
135
+
136
+ </details>`);ge=nt.join(`
137
+
138
+ `)}typeof Ge.content=="string"&&(ge=Ge.content)}!ge&&((Ee=(Ae=(ve=Ge.choices)==null?void 0:ve[0])==null?void 0:Ae.message)!=null&&Ee.content)&&(ge=Ge.choices[0].message.content)}catch{}return{index:Xe+1,timestamp:bt(Ie.timestamp).format("YYYY-MM-DD HH:mm:ss"),statusCode:Ie.statusCode||null,responseTime:Ie.responseTime||null,requestModel:Ie.requestModel||null,targetModel:Ie.targetModel||null,vendorName:Ie.vendorName||null,serviceName:Ie.targetServiceName||null,contentType:Ie.contentType||null,tags:Ie.tags||[],usage:Ie.usage||null,messages:L,response:ge||null}}),ee={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:bt(M.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:bt(M.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:se(M.firstRequestAt,M.lastRequestAt)},logs:fe,exportedAt:bt().format("YYYY-MM-DD HH:mm:ss")},xe=JSON.stringify(ee,null,2),Se=new Blob([xe],{type:"application/json;charset=utf-8"}),De=URL.createObjectURL(Se),$e=document.createElement("a");$e.href=De;const He=$o(M.title).replace(/[\\/:*?"<>|]/g,"_");$e.download=`${He}.json`,document.body.appendChild($e),$e.click(),document.body.removeChild($e),URL.revokeObjectURL(De),K.success("导出成功")},Ye=J=>a(J),Qe=J=>{l(J),a(1)},Ze={padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",minWidth:"140px"},tt={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:()=>ie(!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:N,onChange:J=>{W(J.target.checked),U(10)}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",N&&`(⏱ ${P}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{re(),U(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:tt,children:"来源类型:"}),o.jsxs("select",{value:b,onChange:J=>{w(J.target.value),a(1)},style:Ze,children:[o.jsx("option",{value:"",children:"全部"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"}),o.jsx("option",{value:"opencode",children:"OpenCode"})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:tt,children:"供应商:"}),o.jsxs("select",{value:j,onChange:J=>ke(J.target.value),style:Ze,children:[o.jsx("option",{value:"",children:"全部供应商"}),R.map(J=>o.jsx("option",{value:J.id,children:J.name},J.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:tt,children:"API服务:"}),o.jsxs("select",{value:S,onChange:J=>ne(J.target.value),disabled:!j,style:{...Ze,background:j?"var(--bg-card)":"var(--bg-secondary)",cursor:j?"pointer":"not-allowed",opacity:j?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),Le().map(J=>o.jsx("option",{value:J.id,children:J.name},J.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:tt,children:"模型:"}),o.jsxs("select",{value:T,onChange:J=>{D(J.target.value),a(1)},disabled:!S,style:{...Ze,background:S?"var(--bg-card)":"var(--bg-secondary)",cursor:S?"pointer":"not-allowed",opacity:S?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),qe().map(J=>o.jsx("option",{value:J,children:J},J))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:tt,children:"路由:"}),o.jsxs("select",{value:O,onChange:J=>{_(J.target.value),a(1)},style:Ze,children:[o.jsx("option",{value:"",children:"全部路由"}),$.map(J=>o.jsx("option",{value:J.id,children:J.name},J.id))]})]}),ze&&o.jsx("button",{onClick:Ke,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:J=>v(J.target.value),onKeyDown:J=>{J.key==="Enter"&&(y(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:()=>{y(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:()=>{v(""),y(""),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:ze?"没有匹配的会话":"暂无会话记录"})}):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(J=>o.jsxs("tr",{onClick:()=>pe(J),style:{cursor:"pointer",backgroundColor:(c==null?void 0:c.id)===J.id?"var(--bg-selected)":void 0},children:[o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$o(J.title)}),o.jsx("td",{children:_e(J.targetType)}),o.jsx("td",{children:J.requestCount}),o.jsx("td",{children:J.totalTokens.toLocaleString()}),o.jsx("td",{children:bt(J.firstRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:bt(J.lastRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:se(J.firstRequestAt,J.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(),pe(J)},children:"查看"}),o.jsx("button",{className:"btn btn-sm btn-primary",onClick:Y=>{Y.stopPropagation(),u(J),m(!0),q.getSessionLogs(J.id,1e4).then(ue=>d(ue)).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(),E(J)},title:"迁移到另一个工具",children:"迁移"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:J.routeId?"#27ae60":"#2980b9",color:"white",border:"none",minWidth:(J.routeId,void 0)},onClick:Y=>{Y.stopPropagation(),ye(J)},title:J.routeId?`已绑定: ${J.routeName||J.routeId}`:"绑定路由",children:J.routeName?J.routeName.length>8?J.routeName.slice(0,8)+"…":J.routeName:"路由"})]})})]},J.id))})]}),o.jsx(ju,{currentPage:i,pageSize:s,totalItems:n,onPageChange:Ye,onPageSizeChange:Qe})]})]}),c&&o.jsx(fb,{session:c,logs:p,logsLoading:f,onRefreshLogs:async()=>{if(c){m(!0);try{const J=await q.getSessionLogs(c.id,1e4);d(J)}catch(J){console.error("Failed to refresh session logs:",J)}finally{m(!1)}}},onFetchNewLogs:async()=>{if(!c)return[];const J=await q.getSessionLogs(c.id,1e4);return d(J),J},onClose:()=>{u(null),d([])},onExport:pt}),le&&o.jsx(CU,{session:le,onClose:()=>E(null)}),he&&o.jsx(PU,{session:he,onClose:()=>ye(null),onBound:()=>{re()}}),Q&&o.jsx(EU,{onClose:()=>ie(!1),onCleared:()=>{a(1),re()}})]})}function Qo({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 Vg({skillId:e,targetType:t,enabled:n,onChange:r,disabled:i}){const a=t==="claude-code"?"Claude Code":t==="opencode"?"OpenCode":"Codex";return o.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:o.jsx(Qo,{checked:n,onChange:s=>r(e,t,s),disabled:i,label:a,labelPosition:"right"})})}function RU(){var I,$,H,N,W,P;const[e,t]=h.useState(null),[n,r]=h.useState(!0),[i,a]=h.useState("10"),[s,l]=h.useState(""),[c,u]=h.useState(""),[p,d]=h.useState(""),[f,m]=h.useState({proxyEnabled:!1,proxyUrl:"",proxyUsername:"",proxyPassword:""}),[g,v]=h.useState(!1),[x,y]=h.useState(null),[b,w]=h.useState(!1),[j,k]=h.useState(!1);h.useEffect(()=>{S()},[]);const S=async()=>{const U=await q.getConfig();t(U),r(U.enableFailover!==!1),a(typeof U.failoverRecoverySeconds=="number"&&U.failoverRecoverySeconds>0?String(Math.floor(U.failoverRecoverySeconds)):"10"),m({proxyEnabled:U.proxyEnabled||!1,proxyUrl:U.proxyUrl||"",proxyUsername:U.proxyUsername||"",proxyPassword:U.proxyPassword||""}),v(U.enableLanDiscovery||!1)},A=async U=>{U.preventDefault();const le=Number(i),E=Number.isFinite(le)&&le>0?Math.floor(le):10,he={...e,enableFailover:n,failoverRecoverySeconds:E};await q.updateConfig(he)?(K.success("配置保存成功"),S()):K.error("配置保存失败")},T=async U=>{U.preventDefault();const le=new FormData(U.currentTarget),E={...e,enableLogging:le.get("enableLogging")==="true",logRetentionDays:parseInt(le.get("logRetentionDays")),maxLogSize:parseInt(le.get("maxLogSize"))};await q.updateConfig(E)?(K.success("日志配置保存成功"),S()):K.error("日志配置保存失败")},D=async U=>{U.preventDefault();const le=new FormData(U.currentTarget),E={...e,proxyEnabled:le.get("proxyEnabled")==="true",proxyUrl:le.get("proxyUrl"),proxyUsername:le.get("proxyUsername"),proxyPassword:le.get("proxyPassword")};await q.updateConfig(E)?(K.success("代理配置保存成功"),S()):K.error("代理配置保存失败")},O=async U=>{v(U);const le={...e,enableLanDiscovery:U};await q.updateConfig(le)?(K.success(U?"已开启局域网同步":"已关闭局域网同步"),S()):(v(!U),K.error("配置保存失败"))},_=async()=>{if(!s){K.warning("请输入密码");return}try{const U=await q.exportData(s);d(U),K.success("导出成功,请复制下方数据")}catch(U){K.error("导出失败: "+U.message)}},R=async()=>{if(!s||!c){K.warning("请输入密码和导入数据");return}w(!0);try{const U=await q.previewImportData(c,s);y(U),U.success||K.error(U.message||"预览失败")}catch(U){K.error("预览失败: "+U.message),y({success:!1,message:U.message})}finally{w(!1)}},X=async()=>{if(!s||!c||!(x!=null&&x.success)){K.warning("请先预览数据并确认无误");return}k(!0);try{const U=await q.importData(c,s);U.success?(K.success(U.message+(U.details?` (${U.details})`:"")),u(""),l(""),y(null)):K.error(U.message+(U.details?`: ${U.details}`:""))}catch(U){K.error("导入失败: "+U.message)}finally{k(!1)}},V=()=>{y(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:A,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用智能故障切换"}),o.jsxs("select",{name:"enableFailover",value:n?"true":"false",onChange:U=>r(U.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:U=>a(U.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:T,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:f.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(Qo,{checked:f.proxyEnabled,onChange:U=>m(le=>({...le,proxyEnabled:U}))}),o.jsx("span",{style:{fontSize:"14px",color:"#666"},children:f.proxyEnabled?"已启用":"未启用"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理地址"}),o.jsx("input",{type:"text",name:"proxyUrl",value:f.proxyUrl,onChange:U=>m(le=>({...le,proxyUrl:U.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:f.proxyUsername,onChange:U=>m(le=>({...le,proxyUsername:U.target.value})),placeholder:"如果代理需要认证"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理密码(可选)"}),o.jsx("input",{type:"password",name:"proxyPassword",value:f.proxyPassword,onChange:U=>m(le=>({...le,proxyPassword:U.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(Qo,{checked:g,onChange:O}),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:U=>l(U.target.value),placeholder:"用于加密导出数据"})]}),o.jsx("button",{className:"btn btn-primary",onClick:_,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),K.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:((I=x.data)==null?void 0:I.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:(($=x.data)==null?void 0:$.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:((H=x.data)==null?void 0:H.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:((N=x.data)==null?void 0:N.rules)||0})]})]}),o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:[o.jsxs("div",{children:["数据版本: ",(W=x.data)==null?void 0:W.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:X,disabled:j,children:j?"导入中...":"确认导入"}),o.jsx("button",{className:"btn btn-secondary",onClick:V,disabled:j,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:U=>l(U.target.value),placeholder:"用于解密导入数据"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"导入数据"}),o.jsx("textarea",{rows:6,value:c,onChange:U=>u(U.target.value),placeholder:"粘贴导出的加密数据",style:{fontFamily:"monospace",fontSize:"12px"}})]}),o.jsx("button",{className:"btn btn-primary",onClick:R,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 DU(){var f,m,g,v,x,y,b,w;const[e,t]=h.useState({claude:!1,codex:!1}),[n,r]=h.useState({claude:!1,codex:!1}),[i,a]=h.useState({claude:null,codex:null}),[s,l]=h.useState("");h.useEffect(()=>{c()},[]);const c=async()=>{try{const[j,k]=await Promise.all([q.getClaudeConfigStatus(),q.getCodexConfigStatus()]);a({claude:j,codex:k})}catch(j){console.error("Failed to check config status:",j)}},u=async j=>{t(k=>({...k,[j]:!0})),l("");try{(j==="claude"?await q.writeClaudeConfig():await q.writeCodexConfig())?(l(`${j==="claude"?"Claude Code":"Codex"}配置文件写入成功!原始文件已备份为 .aicodeswitch_backup 文件。`),await c()):l("写入失败: 操作未成功")}catch(k){l(`写入失败: ${k.message}`)}finally{t(k=>({...k,[j]:!1}))}},p=async j=>{r(k=>({...k,[j]:!0})),l("");try{(j==="claude"?await q.restoreClaudeConfig():await q.restoreCodexConfig())?(l(`${j==="claude"?"Claude Code":"Codex"}配置文件已从备份恢复!`),await c()):l("恢复失败: 操作未成功")}catch(k){l(`恢复失败: ${k.message}`)}finally{r(k=>({...k,[j]:!1}))}},d=j=>{const k=i[j];if(!k)return null;const S=j==="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||(((f=i.claude)==null?void 0:f.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)&&!((v=i.claude)!=null&&v.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||!(((y=i.codex)==null?void 0:y.hasBackup)??!1),children:n.codex?"恢复中...":"恢复Codex配置"})]}),d("codex"),((b=i.codex)==null?void 0:b.isOverwritten)&&!((w=i.codex)!=null&&w.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 LU=`# AI Code Switch
139
+
140
+ ## 简介
141
+
142
+ AI Code Switch 是帮助你在本地管理 AI 编程工具接入大模型的工具。
143
+ 它可以让你的 Claude Code、Codex 等工具不再局限于官方模型。
144
+ 为所有编程工具提供本地API驱动,自动智能的切换不同场景下的模型。
145
+
146
+ **而且它尽可能简单的帮你解决这件事。**
147
+
148
+ - 视频演示:[https://www.bilibili.com/video/BV1uEznBuEJd/](https://www.bilibili.com/video/BV1uEznBuEJd/?from=github)
149
+ - 1分钟让Claude Code接入GLM国产模型:[https://www.bilibili.com/video/BV1a865B8ErA/](https://www.bilibili.com/video/BV1a865B8ErA/)
150
+ - 1分钟让Codex接入免费模型Agnes:[https://www.bilibili.com/video/BV1tQ7Q63Eva/](https://www.bilibili.com/video/BV1tQ7Q63Eva/) Codex接入Deepseek可参考该方法实现
151
+ - 在线教程:[https://space.bilibili.com/37442719/lists/8333248](https://space.bilibili.com/37442719/lists/8333248)
152
+
153
+ ## 功能要点
154
+
155
+ * 可登记任意的大模型API接口服务,让你可以在一个面板管理你的大模型厂商
156
+ * 一键切换模型:可以注册多个供应商的多个API接口,当想要切换模型时,只需要点击一个按钮就可以立即切换
157
+ * 自动配置:无需你手动去修改claude code或codex的系统配置文件,aicodeswitch自动帮你修改,你只要启动它,无需配置claude code或codex就可以让它们正常工作
158
+ * 一键配置供应商,省去复杂的供应商配置流程
159
+ * 启动所有已知大模型接口标准,可接入任意客户端,包括但不限于openclaw、hermes、trae等,根据不同需要自主配置接口对应的大模型服务
160
+ * API转流:将兼容openai接口标准的模型,轻松接入到claude code中,支持将符合openai、anthropic、gemini的数据格式转发给claude code或codex
161
+ * 按需中转请求:根据请求类型,让不同的模型来处理不同的任务,节省成本,基于该特性,可以让glm等原生非多模态模型支持图像识别
162
+ * 智能故障切换:当API服务发生故障时,智能切换到其他API服务进行尝试,无需手动切换,特别适用于中转服务商
163
+ * 代理:针对无法直接访问的模型服务,例如地区被ban,支持设置代理来解决
164
+ * tokens超量限制:避免其中一个服务商的用量超过限制,浪费了钱,适合有免费额度的服务商
165
+ * 次数超量限制:次数到达一定量后,切换其他服务商,适合coding plan的服务商
166
+ * 日志:超精细的日志记录和会话记录,帮助你发现编程工具本身的问题,以及专研工具的agent逻辑
167
+ * 统计:丰富且详细的统计数据,用量信息快速掌握,发掘自己的编程习惯
168
+ * Skills管理:一键搜索和安装Skills,一键启用skill到claude code或codex
169
+ * MCP管理:一键安装预设MCP,一键启用MCP
170
+ * 导入和导出:一键备份数据,在多太电脑间共享aicodeswitch配置
171
+ * 服务端部署,自定义API Key,支持B/S架构,让aicodeswitch成为在线服务,提供给团队使用
172
+ * 数据完全本地,自主可控
173
+ * 特殊语法:在发送的提示词最前面添加\`[!]\`来直接切换为高智商模型服务(\`[x]\`关闭),简单快捷
174
+
175
+ ![](public/aicodeswitch-flow.svg)
176
+
177
+ ## 桌面客户端
178
+
179
+ [进入下载](https://github.com/tangshuang/aicodeswitch/releases)
180
+
181
+ ## 命令行工具
182
+
183
+ \`\`\`
184
+ # 安装
185
+ npm install -g aicodeswitch
186
+ # 启动服务
187
+ aicos start
188
+ # http://127.0.0.1:4567
189
+ # 启动服务并打开管理界面
190
+ aicos ui
191
+ # 停止服务
192
+ aicos stop
193
+ \`\`\`
194
+
195
+ ## 管理界面
196
+
197
+ **配置供应商**
198
+
199
+ * 什么是供应商?
200
+ * 供应商配置有什么用?
201
+
202
+ 具体请看下方文档。
203
+
204
+ **路由配置**
205
+
206
+ * 什么是路由?
207
+ * 什么是路由规则?
208
+
209
+ 具体请看下方文档。
210
+
211
+ **覆盖配置文件**
212
+
213
+ 在aicodeswitch中,点击“写入Claude Code配置”按钮,它会修改Claude Code的配置文件,让Claude Code开始使用aicocdeswitch提供的模型API,而非直接连到官网的模型API。
214
+
215
+ 你不用太担心,你可以在写入后,点击“恢复Claude Code配置”按钮,将Claude Code的配置文件恢复到原始状态。
216
+
217
+ Codex的配置覆盖逻辑一模一样。
218
+
219
+ **设置**
220
+
221
+ 你可以在设置页面,对aicodedeswitch进行配置。
222
+
223
+ 也可以导出配置数据,转移到其他电脑上导入。
224
+
225
+ ## 配置供应商
226
+
227
+ ### 什么是供应商?
228
+
229
+ 所谓供应商,就是提供AI服务的上游服务商。可以是OpenAI、Claude、DeepSeek、GLM 官方服务,也可以是其他中转服务商。
230
+
231
+ ### 供应商配置有什么用?
232
+
233
+ 通过将你所有的AI服务商统一起来管理,可以帮你:
234
+
235
+ 1. 避免频繁修改配置文件,通过aicodeswitch,可以一键切换到不同的供应商的AI服务API
236
+ 2. 通过aicodeswitch,将不同供应商的接口数据,转换为工具可以正确使用的接口数据格式,也就是说,你可以将Claude Code接入遵循openai的接口数据协议的其他接口
237
+ 3. 避免你忘记曾经注册过那些供应商
238
+ 4. 充分榨干不怎么用的供应商的服务,避免充值后不怎么用浪费了
239
+
240
+ ### 什么是API服务的“源类型”
241
+
242
+ 供应商接口返回的数据格式标准类型,目前支持以下几种:
243
+
244
+ * OpenAI(Responses API标准)
245
+ * OpenAI Chat (Chat Completions API标准)
246
+ * DeepSeek Chat(reasoning_content标准)
247
+ * Claude
248
+ * Claude Chat
249
+ * Gemini
250
+ * Gemini Chat
251
+
252
+ **有什么用?**
253
+
254
+ aicodeswitch内部,会根据“源类型”来转换数据。例如,你的供应商API服务接口是OpenAI Chat的数据格式,而你在路由中配置的“客户端工具“是Claude Code,那么就意味着,这个供应商API的数据,需要经过转换之后才能被Claude Code正确使用。
255
+
256
+ ## 路由管理
257
+
258
+ ### 什么是路由?
259
+
260
+ 路由是aicodeswitch的核心功能,它负责将不同的对象工具(目前指Claude Code和Codex)的请求,路由到不同的供应商API服务上。
261
+
262
+ ### 什么是“客户端工具”?
263
+
264
+ 目前指Claude Code或Codex。
265
+
266
+ ### 什么是“路由规则”?
267
+
268
+ 以Claude Code为例,它的请求实际上并非铁板一块,可以被分为多种。比如它的深度思考、长文对话、图片理解等等,都是可以独立对待的。
269
+
270
+ 路由规则的目的,就是让你的工具发出的请求,可以根据这个区分,发送给不同的服务商来处理。例如,你默认使用glm-4.7作为写代码的模型,但是,你可以把图片识别的请求发给doubao-code来进行,因为doubao-code的图片识别平均价格可以更低。同样的道理,不同目标的请求可以通过不同的规则来处理,以提升编程的质量和效果。
271
+
272
+ 目前,我仅提供了几个比较容易区分的规则,以后,还会添加更多的规则。
273
+
274
+ ### 激活路由
275
+
276
+ 我们可以为Claude Code添加多个路由,但是,我们必须激活一个路由,才能开始使用。
277
+ 而且,所有以Claude Code为对象的路由,在同一时间,只有一个可以被激活。
278
+
279
+ ### 切换路由
280
+
281
+ 你可以根据你的实际情况来实时切换路由,比如,你可以在发现自己的某个服务商处的余额较少时,立即切换到另外一个服务商。
282
+
283
+ **智能故障切换机制**
284
+
285
+ 当同一请求类型配置多个规则时,系统会按排序优先使用第一个,如果某个服务报错(4xx/5xx)或请求超时,将自动切换到下一个可用规则,确保你可以正常使用coding工具。
286
+
287
+ ### 数据转流
288
+
289
+ 支持将openai的流式响应数据转换成Claude Code的流式数据,并支持实时转换,从而可以让你使用支持openAI的API服务来在Claude Code中使用。
290
+
291
+ *不过,需要注意,如果你的API服务商不支持tools,或者所支持的max_tokens太小,是无法在Claude Code中使用的。*
292
+
293
+ ## Skills管理
294
+
295
+ 你可以在 aicodeswitch 中集中统一管理 skills,把skills分发给claude code和codex,随时启用和停用skills。
296
+ 另外,你可以基于自然语言搜索skills,找到skill之后,支持一键安装。
297
+
298
+ ## MCP管理
299
+
300
+ 你可以在 aicodeswitch 中集中统一管理 MCP,把MCP分发给claude code和codex,随时启用和停用MCP。
301
+ 并且,你还可以通过MCP来实现图像理解。
302
+
303
+ ## 日志
304
+
305
+ 在**日志**页面,您可以查看:
306
+
307
+ **请求日志**:所有 API 请求的详细记录
308
+
309
+ * 请求来源和目标
310
+ * 请求内容和响应
311
+ * 耗时和状态码
312
+ * 错误信息(如有)
313
+
314
+ **错误日志**:错误和异常记录
315
+
316
+ * 错误类型
317
+ * 错误详情
318
+ * 发生时间
319
+
320
+ **会话日志**:按照会话session来汇集日志
321
+
322
+ **日志筛选**
323
+
324
+ 根据提供的选项进行筛选。
325
+
326
+ ## 配置文件
327
+
328
+ 作为 CLI 工具,你可以在 ~/.aicodeswitch/ 目录下找到工具的相关文件。里面有一个 aicodeswitch.conf 文件,可以进行配置。
329
+ 目前仅支持以下配置:
330
+
331
+ \`\`\`
332
+ # aicodeswitch的服务端口
333
+ PORT=4567
334
+
335
+ # 如果提供AUTH,你无法直接登录用户界面,必须输入AUTH的值才能进入,相当于是一个登陆鉴权
336
+ # 如果你在自己的服务器上使用,通过远程接入接口时,就必须提供这个值
337
+ # AUTH=
338
+ \`\`\`
339
+
340
+ > 服务监听地址由 AUTH 模式自动决定,无需也无法通过配置修改:
341
+ > - AUTH 关闭:仅监听 \`127.0.0.1\`(本机访问)
342
+ > - AUTH 开启:监听 \`0.0.0.0\`(允许远端 AccessKey 客户端连接)
343
+ >
344
+ > 写入本地编程工具(Claude Code / Codex)配置文件的地址、以及 UI / CLI 展示的访问地址,统一使用 \`127.0.0.1\`。
345
+
346
+ ## 常见问题
347
+
348
+ ### 1\\. 如何切换供应商?
349
+
350
+ 在路由管理页面修改规则的目标供应商,或调整优先级即可。
351
+
352
+ ### 2\\. 如何查看失败的请求?
353
+
354
+ 在请求日志页面,筛选状态码不为 200 的记录。
355
+
356
+ ### 3\\. 如何备份配置?
357
+
358
+ 在系统设置页面使用**导出配置**功能,然后将提供的数据保存到本地文件中。
359
+
360
+ ### 4\\. 如何设置日志保留时间?
361
+
362
+ 在系统设置页面修改**日志保留天数**配置。
363
+
364
+ ## 我的开源
365
+
366
+ * [PCM](https://github.com/tangshuang/pcm): 用户意图识别、精准上下文、多线对话的Agent系统
367
+ * [Lan Transfer](https://github.com/tangshuang/lan-transfer): 免费高效的局域网文件互传工具
368
+ * [MCP Bone](https://github.com/tangshuang/mcp-bone): 远程托管的MCP服管理工具
369
+ * [Anys](https://github.com/tangshuang/anys): 免费前端监控kit
370
+ * [WebCut](https://github.com/tangshuang/webcut): 免费开源的网页端视频剪辑UI框架
371
+ * [indb](https://github.com/tangshuang/indb): 网页端轻量kv数据库操作库
372
+ * [Formast](https://github.com/tangshuang/formast): 复杂业务场景下的企业级JSON驱动表单框架
373
+
374
+ ## 关联资源
375
+
376
+ * [Claude Code 深度教程](https://claudecode.tangshuang.net): 100%免费的Claude Code入门到精通教程
377
+ * [AICodingBus](https://aicodingbus.24x7.to): AI Tokens 交换平台
378
+
379
+ ## 支持我
380
+
381
+ ![](public/donate-to-me.png)
382
+
383
+ 你的支持是我前进的动力!
384
+
385
+ ## 许可
386
+
387
+ 此项目采用双许可证模式:
388
+
389
+ * **开源使用**:项目默认采用 GPL 3.0 许可证,允许个人免费使用、修改和分发,但所有衍生品必须开源。
390
+ * **商业使用**:如果您希望商业化使用而不遵守 GPL 条款(例如闭源销售),请联系我们购买单独的商业许可证。
391
+
392
+ ## 技术支持
393
+
394
+ 如有问题或建议,请访问项目 [GitHub 仓库](https://github.com/tangshuang/aicodeswitch/issues)提交 Issue。
395
+ `,zU=()=>o.jsx("div",{className:"markdown-content",children:o.jsx(Gc,{children:LU})});function xO(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=xO(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xO(e))&&(r&&(r+=" "),r+=t);return r}var $U=["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 hb(e){if(typeof e!="string")return!1;var t=$U;return t.includes(e)}var BU=["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"],FU=new Set(BU);function bO(e){return typeof e!="string"?!1:FU.has(e)}function wO(e){return typeof e=="string"&&e.startsWith("data-")}function nr(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(bO(n)||wO(n))&&(t[n]=e[n]);return t}function ls(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return nr(t)}return typeof e=="object"&&!Array.isArray(e)?nr(e):null}function yr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(bO(n)||wO(n)||hb(n))&&(t[n]=e[n]);return t}function UU(e){return e==null?null:h.isValidElement(e)?yr(e.props):typeof e=="object"&&!Array.isArray(e)?yr(e):null}var WU=["children","width","height","viewBox","className","style","title","desc"];function Kv(){return Kv=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},Kv.apply(null,arguments)}function KU(e,t){if(e==null)return{};var n,r,i=HU(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 HU(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 mb=h.forwardRef((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,s=e.className,l=e.style,c=e.title,u=e.desc,p=KU(e,WU),d=a||{width:r,height:i,x:0,y:0},f=mt("recharts-surface",s);return h.createElement("svg",Kv({},yr(p),{className:f,width:r,height:i,style:l,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),h.createElement("title",null,c),h.createElement("desc",null,u),n)}),VU=["children","className"];function Hv(){return Hv=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},Hv.apply(null,arguments)}function qU(e,t){if(e==null)return{};var n,r,i=YU(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 YU(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 Yt=h.forwardRef((e,t)=>{var n=e.children,r=e.className,i=qU(e,VU),a=mt("recharts-layer",r);return h.createElement("g",Hv({className:a},yr(i),{ref:t}),n)}),jO=h.createContext(null),GU=()=>h.useContext(jO);function Tt(e){return function(){return e}}const SO=Math.cos,vf=Math.sin,fi=Math.sqrt,xf=Math.PI,Hh=2*xf,Vv=Math.PI,qv=2*Vv,Io=1e-6,XU=qv-Io;function kO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function QU(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return kO;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 ZU{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?kO:QU(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,f=p*p+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>Io)if(!(Math.abs(d*c-u*p)>Io)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-s,g=i-l,v=c*c+u*u,x=m*m+g*g,y=Math.sqrt(v),b=Math.sqrt(f),w=a*Math.tan((Vv-Math.acos((v+f-x)/(2*y*b)))/2),j=w/b,k=w/y;Math.abs(j-1)>Io&&this._append`L${t+j*p},${n+j*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,f=s?i-a:a-i;this._x1===null?this._append`M${u},${p}`:(Math.abs(this._x1-u)>Io||Math.abs(this._y1-p)>Io)&&this._append`L${u},${p}`,r&&(f<0&&(f=f%qv+qv),f>XU?this._append`A${r},${r},0,1,${d},${t-l},${n-c}A${r},${r},0,1,${d},${this._x1=u},${this._y1=p}`:f>Io&&this._append`A${r},${r},0,${+(f>=Vv)},${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 gb(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 ZU(t)}function yb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function CO(e){this._context=e}CO.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 Vh(e){return new CO(e)}function PO(e){return e[0]}function AO(e){return e[1]}function EO(e,t){var n=Tt(!0),r=null,i=Vh,a=null,s=gb(l);e=typeof e=="function"?e:e===void 0?PO:Tt(e),t=typeof t=="function"?t:t===void 0?AO:Tt(t);function l(c){var u,p=(c=yb(c)).length,d,f=!1,m;for(r==null&&(a=i(m=s())),u=0;u<=p;++u)!(u<p&&n(d=c[u],u,c))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&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:Tt(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Tt(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Tt(!!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 Yd(e,t,n){var r=null,i=Tt(!0),a=null,s=Vh,l=null,c=gb(u);e=typeof e=="function"?e:e===void 0?PO:Tt(+e),t=typeof t=="function"?t:Tt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?AO:Tt(+n);function u(d){var f,m,g,v=(d=yb(d)).length,x,y=!1,b,w=new Array(v),j=new Array(v);for(a==null&&(l=s(b=c())),f=0;f<=v;++f){if(!(f<v&&i(x=d[f],f,d))===y)if(y=!y)m=f,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=f-1;g>=m;--g)l.point(w[g],j[g]);l.lineEnd(),l.areaEnd()}y&&(w[f]=+e(x,f,d),j[f]=+t(x,f,d),l.point(r?+r(x,f,d):w[f],n?+n(x,f,d):j[f]))}if(b)return l=null,b+""||null}function p(){return EO().defined(i).curve(s).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Tt(+d),r=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Tt(+d),u):e},u.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Tt(+d),u):r},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Tt(+d),n=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Tt(+d),u):t},u.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Tt(+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:Tt(!!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 TO{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 JU(e){return new TO(e,!0)}function eW(e){return new TO(e,!1)}const vb={draw(e,t){const n=fi(t/xf);e.moveTo(n,0),e.arc(0,0,n,0,Hh)}},tW={draw(e,t){const n=fi(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()}},IO=fi(1/3),nW=IO*2,rW={draw(e,t){const n=fi(t/nW),r=n*IO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},iW={draw(e,t){const n=fi(t),r=-n/2;e.rect(r,r,n,n)}},aW=.8908130915292852,OO=vf(xf/10)/vf(7*xf/10),oW=vf(Hh/10)*OO,sW=-SO(Hh/10)*OO,lW={draw(e,t){const n=fi(t*aW),r=oW*n,i=sW*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=Hh*a/5,l=SO(s),c=vf(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},qg=fi(3),cW={draw(e,t){const n=-fi(t/(qg*3));e.moveTo(0,n*2),e.lineTo(-qg*n,-n),e.lineTo(qg*n,-n),e.closePath()}},Mr=-.5,_r=fi(3)/2,Yv=1/fi(12),uW=(Yv/2+1)*3,dW={draw(e,t){const n=fi(t/uW),r=n/2,i=n*Yv,a=r,s=n*Yv+n,l=-a,c=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(l,c),e.lineTo(Mr*r-_r*i,_r*r+Mr*i),e.lineTo(Mr*a-_r*s,_r*a+Mr*s),e.lineTo(Mr*l-_r*c,_r*l+Mr*c),e.lineTo(Mr*r+_r*i,Mr*i-_r*r),e.lineTo(Mr*a+_r*s,Mr*s-_r*a),e.lineTo(Mr*l+_r*c,Mr*c-_r*l),e.closePath()}};function pW(e,t){let n=null,r=gb(i);e=typeof e=="function"?e:Tt(e||vb),t=typeof t=="function"?t:Tt(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:Tt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Tt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function bf(){}function wf(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 NO(e){this._context=e}NO.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:wf(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:wf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fW(e){return new NO(e)}function MO(e){this._context=e}MO.prototype={areaStart:bf,areaEnd:bf,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:wf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hW(e){return new MO(e)}function _O(e){this._context=e}_O.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:wf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function mW(e){return new _O(e)}function RO(e){this._context=e}RO.prototype={areaStart:bf,areaEnd:bf,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 gW(e){return new RO(e)}function ck(e){return e<0?-1:1}function uk(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(ck(a)+ck(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function dk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Yg(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 jf(e){this._context=e}jf.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:Yg(this,this._t0,dk(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,Yg(this,dk(this,n=uk(this,e,t)),n);break;default:Yg(this,this._t0,n=uk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function DO(e){this._context=new LO(e)}(DO.prototype=Object.create(jf.prototype)).point=function(e,t){jf.prototype.point.call(this,t,e)};function LO(e){this._context=e}LO.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 yW(e){return new jf(e)}function vW(e){return new DO(e)}function zO(e){this._context=e}zO.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=pk(e),i=pk(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 pk(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 xW(e){return new zO(e)}function qh(e,t){this._context=e,this._t=t}qh.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 bW(e){return new qh(e,.5)}function wW(e){return new qh(e,0)}function jW(e){return new qh(e,1)}function cs(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 Gv(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function SW(e,t){return e[t]}function kW(e){const t=[];return t.key=e,t}function CW(){var e=Tt([]),t=Gv,n=cs,r=SW;function i(a){var s=Array.from(e.apply(this,arguments),kW),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=yb(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:Tt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Tt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Gv:typeof a=="function"?a:Tt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??cs,i):n},i}function PW(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}cs(e,t)}}function AW(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}cs(e,t)}}function EW(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,f=p[r-1][1]||0,m=(d-f)/2,g=0;g<l;++g){var v=e[t[g]],x=v[r][1]||0,y=v[r-1][1]||0;m+=x-y}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,cs(e,t)}}function Xv(e){return e==="__proto__"}function $O(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function xb(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 BO(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(BO).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function bb(e){if(Array.isArray(e))return e.map(xb);if(typeof e=="symbol")return[e];e=BO(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 Bi(e,t,n){if(e==null)return n;switch(typeof t){case"string":{if(Xv(t))return n;const r=e[t];return r===void 0?$O(t)?Bi(e,bb(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=xb(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return TW(e,t,n);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),Xv(t))return n;const r=e[t];return r===void 0?n:r}}}function TW(e,t,n){if(t.length===0)return n;let r=e;for(let i=0;i<t.length;i++){if(r==null||Xv(t[i]))return n;r=r[t[i]]}return r===void 0?n:r}var IW=4;function oa(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:IW,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Dn(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+oa(l)+a:i+a},"")}var Sn=e=>e===0?0:e>0?1:-1,di=e=>typeof e=="number"&&e!=+e,us=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,Ce=e=>(typeof e=="number"||e instanceof Number)&&!di(e),Fi=e=>Ce(e)||typeof e=="string",OW=0,Su=e=>{var t=++OW;return"".concat(e||"").concat(t)},Vn=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(us(t)){if(n==null)return r;var s=t.indexOf("%");a=n*parseFloat(t.slice(0,s))/100}else a=+t;return di(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},FO=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 It(e,t,n){return Ce(e)&&Ce(t)?oa(e+n*(t-e)):t}function UO(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Bi(r,t))===n)}var zt=e=>e===null||typeof e>"u",Xu=e=>zt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function dr(e){return e!=null}function fo(){}var NW=["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 fk(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 hk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fk(Object(n),!0).forEach(function(r){MW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MW(e,t,n){return(t=_W(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _W(e){var t=RW(e,"string");return typeof t=="symbol"?t:t+""}function RW(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 DW(e,t){if(e==null)return{};var n,r,i=LW(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 LW(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 WO={symbolCircle:vb,symbolCross:tW,symbolDiamond:rW,symbolSquare:iW,symbolStar:lW,symbolTriangle:cW,symbolWye:dW},zW=Math.PI/180,$W=e=>{var t="symbol".concat(Xu(e));return WO[t]||vb},BW=(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*zW;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}},FW=(e,t)=>{WO["symbol".concat(Xu(e))]=t},KO=e=>{var t=e.type,n=t===void 0?"circle":t,r=e.size,i=r===void 0?64:r,a=e.sizeType,s=a===void 0?"area":a,l=DW(e,NW),c=hk(hk({},l),{},{type:n,size:i,sizeType:s}),u="circle";typeof n=="string"&&(u=n);var p=()=>{var v=$W(u),x=pW().type(v).size(BW(i,s,u)),y=x();if(y!==null)return y},d=c.className,f=c.cx,m=c.cy,g=yr(c);return Ce(f)&&Ce(m)&&Ce(i)?h.createElement("path",Qv({},g,{className:mt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(m,")"),d:p()})):null};KO.registerSymbol=FW;var HO=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,wb=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(h.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{hb(i)&&typeof n[i]=="function"&&(r[i]=a=>n[i](n,a))}),r},UW=(e,t,n)=>r=>(e(t,n,r),null),Qu=(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];hb(i)&&typeof a=="function"&&(r||(r={}),r[i]=UW(a,t,n))}),r};function mk(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 WW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mk(Object(n),!0).forEach(function(r){KW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KW(e,t,n){return(t=HW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HW(e){var t=VW(e,"string");return typeof t=="symbol"?t:t+""}function VW(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 dn(e,t){var n=WW({},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 Sf(){return Sf=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},Sf.apply(null,arguments)}function gk(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 VO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gk(Object(n),!0).forEach(function(r){qW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qW(e,t,n){return(t=YW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YW(e){var t=GW(e,"string");return typeof t=="symbol"?t:t+""}function GW(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 Lr=32,XW={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function QW(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function ZW(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=Lr/2,a=Lr/6,s=Lr/3,l=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return h.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:QW(t.payload),x1:0,y1:i,x2:Lr,y2:i,className:"recharts-legend-icon"});if(c==="line")return h.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(s,`
396
+ A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(i,`
397
+ H`).concat(Lr,"M").concat(2*s,",").concat(i,`
398
+ A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return h.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Lr/8,"h").concat(Lr,"v").concat(Lr*3/4,"h").concat(-Lr,"z"),className:"recharts-legend-icon"});if(h.isValidElement(t.legendIcon)){var u=VO({},t);return delete u.legendIcon,h.cloneElement(t.legendIcon,u)}return h.createElement(KO,{fill:l,cx:i,cy:i,size:Lr,sizeType:"diameter",type:c})}function JW(e){var t=e.payload,n=e.iconSize,r=e.layout,i=e.formatter,a=e.inactiveColor,s=e.iconType,l=e.labelStyle,c={x:0,y:0,width:Lr,height:Lr},u={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,f)=>{var m=d.formatter||i,g=mt({"recharts-legend-item":!0,["legend-item-".concat(f)]:!0,inactive:d.inactive});if(d.type==="none")return null;var v=typeof l=="object"?VO({},l):{};v.color=d.inactive?a:v.color||d.color;var x=m?m(d.value,d,f):d.value;return h.createElement("li",Sf({className:g,style:u,key:"legend-item-".concat(f)},Qu(e,d,f)),h.createElement(mb,{width:n,height:n,viewBox:c,style:p,"aria-label":"".concat(d.value," legend icon")},h.createElement(ZW,{data:d,iconType:s,inactiveColor:a})),h.createElement("span",{className:"recharts-legend-item-text",style:v},x))})}var e9=e=>{var t=dn(e,XW),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return h.createElement("ul",{className:"recharts-default-legend",style:a},h.createElement(JW,Sf({},t,{payload:n})))};function t9(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 n9(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function qO(e){return e}function r9(e){return function(t){return Bi(t,e)}}function Zv(e){return e==null||typeof e!="object"&&typeof e!="function"}function i9(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a9(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function jb(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const o9="[object RegExp]",YO="[object String]",GO="[object Number]",XO="[object Boolean]",QO="[object Arguments]",s9="[object Symbol]",l9="[object Date]",c9="[object Map]",u9="[object Set]",d9="[object Array]",p9="[object ArrayBuffer]",f9="[object Object]",h9="[object DataView]",m9="[object Uint8Array]",g9="[object Uint8ClampedArray]",y9="[object Uint16Array]",v9="[object Uint32Array]",x9="[object Int8Array]",b9="[object Int16Array]",w9="[object Int32Array]",j9="[object Float32Array]",S9="[object Float64Array]",yk=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function k9(e){return typeof yk.Buffer<"u"&&yk.Buffer.isBuffer(e)}function C9(e,t){return Bo(e,void 0,e,new Map,t)}function Bo(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(Zv(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]=Bo(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,Bo(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(Bo(l,void 0,n,r,i));return s}if(k9(e))return e.subarray();if(i9(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,s);for(let l=0;l<e.length;l++)s[l]=Bo(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),ni(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),ni(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),ni(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,ni(s,e,n,r,i),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return r.set(e,s),ni(s,e,n,r,i),s}if(e instanceof Number){const s=new Number(e.valueOf());return r.set(e,s),ni(s,e,n,r,i),s}if(e instanceof String){const s=new String(e.valueOf());return r.set(e,s),ni(s,e,n,r,i),s}if(typeof e=="object"&&P9(e)){const s=Object.create(Object.getPrototypeOf(e));return r.set(e,s),ni(s,e,n,r,i),s}return e}function ni(e,t,n=e,r,i){const a=[...Object.keys(t),...a9(t)];for(let s=0;s<a.length;s++){const l=a[s],c=Object.getOwnPropertyDescriptor(e,l);(c==null||c.writable)&&(e[l]=Bo(t[l],l,n,r,i))}}function P9(e){switch(jb(e)){case QO:case d9:case p9:case h9:case XO:case l9:case j9:case S9:case x9:case b9:case w9:case c9:case GO:case f9:case o9:case u9:case YO:case s9:case m9:case g9:case y9:case v9:return!0;default:return!1}}function A9(e){return Bo(e,void 0,e,new Map,void 0)}function Rp(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function ZO(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function JO(e,t,n){return typeof n!="function"?JO(e,t,()=>{}):Jv(e,t,function r(i,a,s,l,c,u){const p=n(i,a,s,l,c,u);return p!==void 0?!!p:Jv(i,a,r,u,!1)},new Map,!0)}function Jv(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case"object":return E9(e,t,n,r);case"function":return Object.keys(t).length>0?Jv(e,{...t},n,r,i):Rp(e,t);default:return ZO(e)&&i?typeof t=="string"?t==="":!0:Rp(e,t)}}function E9(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return eN(e,t,n,r);if(t instanceof Map)return T9(e,t,n,r);if(t instanceof Set)return I9(e,t,n,r);const i=Object.keys(t);if(e==null||Zv(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(!Zv(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 T9(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 eN(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 I9(e,t,n,r){return t.size===0?!0:e instanceof Set?eN([...e],[...t],n,r):!1}function tN(e,t){return JO(e,t,()=>{})}function O9(e){return e=A9(e),t=>tN(t,e)}function N9(e,t){return C9(e,(n,r,i,a)=>{if(typeof e=="object"){if(jb(e)==="[object Object]"&&typeof e.constructor!="function"){const s={};return a.set(e,s),ni(s,e,i,a),s}switch(Object.prototype.toString.call(e)){case GO:case YO:case XO:{const s=new e.constructor(e==null?void 0:e.valueOf());return ni(s,e),s}case QO:{const s={};return ni(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}function M9(e){return N9(e)}const _9=/^(?:0|[1-9]\d*)$/;function nN(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 _9.test(e)}}function R9(e){return e!==null&&typeof e=="object"&&jb(e)==="[object Arguments]"}function D9(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&$O(t)&&(e==null?void 0:e[t])==null?n=bb(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)||R9(r))&&nN(a)&&a<r.length))return!1;r=r[a]}return!0}function L9(e,t){switch(typeof e){case"object":Object.is(e==null?void 0:e.valueOf(),-0)&&(e="-0");break;case"number":e=xb(e);break}return t=M9(t),function(n){const r=Bi(n,e);return r===void 0?D9(n,e):t===void 0?r===void 0:tN(r,t)}}function z9(e){if(e==null)return qO;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?L9(e[0],e[1]):O9(e);case"string":case"symbol":case"number":return r9(e)}}function $9(e){return Number.isSafeInteger(e)&&e>=0}function rN(e){return e!=null&&typeof e!="function"&&$9(e.length)}function B9(e){return typeof e=="object"&&e!==null}function F9(e){return B9(e)&&rN(e)}function vk(e,t=qO){return F9(e)?t9(Array.from(e),n9(z9(t),1)):[]}function iN(e,t,n){return t===!0?vk(e,n):typeof t=="function"?vk(e,t):e}var aN={exports:{}},oN={},sN={exports:{}},lN={};/**
399
+ * @license React
400
+ * use-sync-external-store-shim.production.js
401
+ *
402
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
403
+ *
404
+ * This source code is licensed under the MIT license found in the
405
+ * LICENSE file in the root directory of this source tree.
406
+ */var Il=h;function U9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var W9=typeof Object.is=="function"?Object.is:U9,K9=Il.useState,H9=Il.useEffect,V9=Il.useLayoutEffect,q9=Il.useDebugValue;function Y9(e,t){var n=t(),r=K9({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return V9(function(){i.value=n,i.getSnapshot=t,Gg(i)&&a({inst:i})},[e,n,t]),H9(function(){return Gg(i)&&a({inst:i}),e(function(){Gg(i)&&a({inst:i})})},[e]),q9(n),n}function Gg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!W9(e,n)}catch{return!0}}function G9(e,t){return t()}var X9=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?G9:Y9;lN.useSyncExternalStore=Il.useSyncExternalStore!==void 0?Il.useSyncExternalStore:X9;sN.exports=lN;var Q9=sN.exports;/**
407
+ * @license React
408
+ * use-sync-external-store-shim/with-selector.production.js
409
+ *
410
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
411
+ *
412
+ * This source code is licensed under the MIT license found in the
413
+ * LICENSE file in the root directory of this source tree.
414
+ */var Yh=h,Z9=Q9;function J9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var eK=typeof Object.is=="function"?Object.is:J9,tK=Z9.useSyncExternalStore,nK=Yh.useRef,rK=Yh.useEffect,iK=Yh.useMemo,aK=Yh.useDebugValue;oN.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=nK(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=iK(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,eK(p,m))return g;var v=r(m);return i!==void 0&&i(g,v)?(p=m,g):(p=m,d=v)}var u=!1,p,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,r,i]);var l=tK(e,a[0],a[1]);return rK(function(){s.hasValue=!0,s.value=l},[l]),aK(l),l};aN.exports=oN;var oK=aN.exports,Sb=h.createContext(null),sK=e=>e,jt=()=>{var e=h.useContext(Sb);return e?e.store.dispatch:sK},Dp=()=>{},lK=()=>Dp,cK=(e,t)=>e===t;function Te(e){var t=h.useContext(Sb),n=h.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Dp,[t,e]);return oK.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:lK,t?t.store.getState:Dp,t?t.store.getState:Dp,n,cK)}function uK(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function dK(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 xk=e=>Array.isArray(e)?e:[e];function pK(e){const t=Array.isArray(e[0])?e[0]:e;return dK(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function fK(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var hK=class{constructor(e){this.value=e}deref(){return this.value}},mK=()=>typeof WeakRef>"u"?hK:WeakRef,cN=mK(),gK=0,bk=1;function Gd(){return{s:gK,v:void 0,o:null,p:null}}function yK(e){return e instanceof cN?e.deref():e}function uN(e,t={}){let n=Gd();const{resultEqualityCheck:r}=t;let i,a=0;function s(){let l=n;const{length:c}=arguments;for(let d=0,f=c;d<f;d++){const m=arguments[d];if(typeof m=="function"||typeof m=="object"&&m!==null){let g=l.o;g===null&&(l.o=g=new WeakMap);const v=g.get(m);v===void 0?(l=Gd(),g.set(m,l)):l=v}else{let g=l.p;g===null&&(l.p=g=new Map);const v=g.get(m);v===void 0?(l=Gd(),g.set(m,l)):l=v}}const u=l;let p;if(l.s===bk)p=l.v;else if(p=e.apply(null,arguments),a++,r){const d=yK(i);d!=null&&r(d,p)&&(p=d,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new cN(p):p}return u.s=bk,u.v=p,p}return s.clearCache=()=>{n=Gd(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function vK(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()),uK(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const p={...n,...c},{memoize:d,memoizeOptions:f=[],argsMemoize:m=uN,argsMemoizeOptions:g=[]}=p,v=xk(f),x=xk(g),y=pK(i),b=d(function(){return a++,u.apply(null,arguments)},...v),w=m(function(){s++;const k=fK(y,arguments);return l=b.apply(null,k),l},...x);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var G=vK(uN);function xK(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 ex(e,t,n){return ZO(n)&&(typeof t=="number"&&rN(n)&&nN(t)&&t<n.length||typeof t=="string"&&t in n)?Rp(n[t],e):!1}function wk(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const bK=(e,t,n)=>{if(e!==t){const r=wk(e),i=wk(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 dN(e){return typeof e=="symbol"||e instanceof Symbol}const wK=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jK=/^\w*$/;function SK(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||dN(e)?!0:typeof e=="string"&&(jK.test(e)||!wK.test(e))||t!=null}function kK(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)||SK(l)?l:{key:l,path:bb(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=bK(l.criteria[u],c.criteria[u],n[u]);if(p!==0)return p}return 0}).map(l=>l.original)}function Gh(e,...t){const n=t.length;return n>1&&ex(e,t[0],t[1])?t=[]:n>2&&ex(t[0],t[1],t[2])&&(t=[t[0]]),kK(e,xK(t),["asc"])}var pN=e=>e.legend.settings,CK=e=>e.legend.size,PK=e=>e.legend.payload,AK=G([PK,pN],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?Gh(r,n):r});function EK(){return Te(AK)}function TK(e,t){return MK(e)||NK(e,t)||OK(e,t)||IK()}function IK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
415
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OK(e,t){if(e){if(typeof e=="string")return jk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jk(e,t):void 0}}function jk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function NK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function MK(e){if(Array.isArray(e))return e}var Xd=1;function Sk(e,t){return Math.abs(e.height-t.height)>Xd||Math.abs(e.left-t.left)>Xd||Math.abs(e.top-t.top)>Xd||Math.abs(e.width-t.width)>Xd}function kk(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function fN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=h.useState({height:0,left:0,top:0,width:0}),n=TK(t,2),r=n[0],i=n[1],a=h.useRef(null),s=h.useRef(r);s.current=r;var l=h.useCallback(c=>{if(a.current!=null&&(a.current.disconnect(),a.current=null),c!=null){var u=kk(c);if(Sk(u,s.current)&&i(u),typeof ResizeObserver<"u"){var p=new ResizeObserver(()=>{var d=kk(c);Sk(d,s.current)&&i(d)});p.observe(c),a.current=p}}},[...e]);return h.useEffect(()=>()=>{var c;(c=a.current)===null||c===void 0||c.disconnect()},[]),[r,l]}function Nn(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 _K=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ck=_K,Xg=()=>Math.random().toString(36).substring(7).split("").join("."),RK={INIT:`@@redux/INIT${Xg()}`,REPLACE:`@@redux/REPLACE${Xg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Xg()}`},kf=RK;function kb(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 hN(e,t,n){if(typeof e!="function")throw new Error(Nn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Nn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Nn(1));return n(hN)(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,y)=>{s.set(y,x)}))}function p(){if(c)throw new Error(Nn(3));return i}function d(x){if(typeof x!="function")throw new Error(Nn(4));if(c)throw new Error(Nn(5));let y=!0;u();const b=l++;return s.set(b,x),function(){if(y){if(c)throw new Error(Nn(6));y=!1,u(),s.delete(b),a=null}}}function f(x){if(!kb(x))throw new Error(Nn(7));if(typeof x.type>"u")throw new Error(Nn(8));if(typeof x.type!="string")throw new Error(Nn(17));if(c)throw new Error(Nn(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(Nn(10));r=x,f({type:kf.REPLACE})}function g(){const x=d;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(Nn(11));function b(){const j=y;j.next&&j.next(p())}return b(),{unsubscribe:x(b)}},[Ck](){return this}}}return f({type:kf.INIT}),{dispatch:f,subscribe:d,getState:p,replaceReducer:m,[Ck]:g}}function DK(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:kf.INIT})>"u")throw new Error(Nn(12));if(typeof n(void 0,{type:kf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Nn(13))})}function mN(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{DK(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],f=n[d],m=s[d],g=f(m,l);if(typeof g>"u")throw l&&l.type,new Error(Nn(14));u[d]=g,c=c||g!==m}return c=c||r.length!==Object.keys(s).length,c?u:s}}function Cf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function LK(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Nn(15))};const s={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},l=e.map(c=>c(s));return a=Cf(...l)(i.dispatch),{...i,dispatch:a}}}function gN(e){return kb(e)&&"type"in e&&typeof e.type=="string"}var yN=Symbol.for("immer-nothing"),Pk=Symbol.for("immer-draftable"),rr=Symbol.for("immer-state");function ai(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Cr=Object,Ol=Cr.getPrototypeOf,Pf="constructor",Xh="prototype",tx="configurable",Af="enumerable",Lp="writable",ku="value",ga=e=>!!e&&!!e[rr];function pi(e){var t;return e?vN(e)||Zh(e)||!!e[Pk]||!!((t=e[Pf])!=null&&t[Pk])||Jh(e)||em(e):!1}var zK=Cr[Xh][Pf].toString(),Ak=new WeakMap;function vN(e){if(!e||!Cb(e))return!1;const t=Ol(e);if(t===null||t===Cr[Xh])return!0;const n=Cr.hasOwnProperty.call(t,Pf)&&t[Pf];if(n===Object)return!0;if(!Ks(n))return!1;let r=Ak.get(n);return r===void 0&&(r=Function.toString.call(n),Ak.set(n,r)),r===zK}function Qh(e,t,n=!0){Zu(e)===0?(n?Reflect.ownKeys(e):Cr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Zu(e){const t=e[rr];return t?t.type_:Zh(e)?1:Jh(e)?2:em(e)?3:0}var Ek=(e,t,n=Zu(e))=>n===2?e.has(t):Cr[Xh].hasOwnProperty.call(e,t),nx=(e,t,n=Zu(e))=>n===2?e.get(t):e[t],Ef=(e,t,n,r=Zu(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function $K(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Zh=Array.isArray,Jh=e=>e instanceof Map,em=e=>e instanceof Set,Cb=e=>typeof e=="object",Ks=e=>typeof e=="function",Qg=e=>typeof e=="boolean";function BK(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var na=e=>e.copy_||e.base_,Pb=e=>e.modified_?e.copy_:e.base_;function rx(e,t){if(Jh(e))return new Map(e);if(em(e))return new Set(e);if(Zh(e))return Array[Xh].slice.call(e);const n=vN(e);if(t===!0||t==="class_only"&&!n){const r=Cr.getOwnPropertyDescriptors(e);delete r[rr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],l=r[s];l[Lp]===!1&&(l[Lp]=!0,l[tx]=!0),(l.get||l.set)&&(r[s]={[tx]:!0,[Lp]:!0,[Af]:l[Af],[ku]:e[s]})}return Cr.create(Ol(e),r)}else{const r=Ol(e);if(r!==null&&n)return{...e};const i=Cr.create(r);return Cr.assign(i,e)}}function Ab(e,t=!1){return tm(e)||ga(e)||!pi(e)||(Zu(e)>1&&Cr.defineProperties(e,{set:Qd,add:Qd,clear:Qd,delete:Qd}),Cr.freeze(e),t&&Qh(e,(n,r)=>{Ab(r,!0)},!1)),e}function FK(){ai(2)}var Qd={[ku]:FK};function tm(e){return e===null||!Cb(e)?!0:Cr.isFrozen(e)}var Tf="MapSet",ix="Patches",Tk="ArrayMethods",xN={};function ds(e){const t=xN[e];return t||ai(0,e),t}var Ik=e=>!!xN[e],Cu,bN=()=>Cu,UK=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Ik(Tf)?ds(Tf):void 0,arrayMethodsPlugin_:Ik(Tk)?ds(Tk):void 0});function Ok(e,t){t&&(e.patchPlugin_=ds(ix),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ax(e){ox(e),e.drafts_.forEach(WK),e.drafts_=null}function ox(e){e===Cu&&(Cu=e.parent_)}var Nk=e=>Cu=UK(Cu,e);function WK(e){const t=e[rr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Mk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[rr].modified_&&(ax(t),ai(4)),pi(e)&&(e=_k(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[rr].base_,e,t)}else e=_k(t,n);return KK(t,e,!0),ax(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yN?e:void 0}function _k(e,t){if(tm(t))return t;const n=t[rr];if(!n)return If(t,e.handledSet_,e);if(!nm(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);SN(n,e)}return n.copy_}function KK(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ab(t,n)}function wN(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var nm=(e,t)=>e.scope_===t,HK=[];function jN(e,t,n,r){const i=na(e),a=e.type_;if(r!==void 0&&nx(i,r,a)===t){Ef(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;Qh(i,(c,u)=>{if(ga(u)){const p=l.get(u)||[];p.push(c),l.set(u,p)}})}const s=e.draftLocations_.get(t)??HK;for(const l of s)Ef(i,l,n,a)}function VK(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!nm(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const s=Pb(a);jN(e,a.draft_??a,s,n),SN(a,i)})}function SN(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)}wN(e)}}function qK(e,t,n){const{scope_:r}=e;if(ga(n)){const i=n[rr];nm(i,r)&&i.callbacks_.push(function(){zp(e);const s=Pb(i);jN(e,n,s,t)})}else pi(n)&&e.callbacks_.push(function(){const a=na(e);e.type_===3?a.has(n)&&If(n,r.handledSet_,r):nx(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&If(nx(e.copy_,t,e.type_),r.handledSet_,r)})}function If(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ga(e)||t.has(e)||!pi(e)||tm(e)||(t.add(e),Qh(e,(r,i)=>{if(ga(i)){const a=i[rr];if(nm(a,n)){const s=Pb(a);Ef(e,r,s,e.type_),wN(a)}}else pi(i)&&If(i,t,n)})),e}function YK(e,t){const n=Zh(e),r={type_:n?1:0,scope_:t?t.scope_:bN(),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=Of;n&&(i=[r],a=Pu);const{revoke:s,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=s,[l,r]}var Of={get(e,t){if(t===rr)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=na(e);if(!Ek(i,t,e.type_))return GK(e,i,t);const a=i[t];if(e.finalized_||!pi(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&BK(t))return a;if(a===Zg(e.base_,t)){zp(e);const s=e.type_===1?+t:t,l=lx(e.scope_,a,e,s);return e.copy_[s]=l}return a},has(e,t){return t in na(e)},ownKeys(e){return Reflect.ownKeys(na(e))},set(e,t,n){const r=kN(na(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Zg(na(e),t),a=i==null?void 0:i[rr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if($K(n,i)&&(n!==void 0||Ek(e.base_,t,e.type_)))return!0;zp(e),sx(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),qK(e,t,n)),!0},deleteProperty(e,t){return zp(e),Zg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),sx(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=na(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Lp]:!0,[tx]:e.type_!==1||t!=="length",[Af]:r[Af],[ku]:n[t]}},defineProperty(){ai(11)},getPrototypeOf(e){return Ol(e.base_)},setPrototypeOf(){ai(12)}},Pu={};for(let e in Of){let t=Of[e];Pu[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Pu.deleteProperty=function(e,t){return Pu.set.call(this,e,t,void 0)};Pu.set=function(e,t,n){return Of.set.call(this,e[0],t,n,e[0])};function Zg(e,t){const n=e[rr];return(n?na(n):e)[t]}function GK(e,t,n){var i;const r=kN(t,n);return r?ku in r?r[ku]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function kN(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 sx(e){e.modified_||(e.modified_=!0,e.parent_&&sx(e.parent_))}function zp(e){e.copy_||(e.assigned_=new Map,e.copy_=rx(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var XK=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Ks(n)&&!Ks(r)){const s=r;r=n;const l=this;return function(u=s,...p){return l.produce(u,d=>r.call(this,d,...p))}}Ks(r)||ai(6),i!==void 0&&!Ks(i)&&ai(7);let a;if(pi(n)){const s=Nk(this),l=lx(s,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?ax(s):ox(s)}return Ok(s,i),Mk(a,s)}else if(!n||!Cb(n)){if(a=r(n),a===void 0&&(a=n),a===yN&&(a=void 0),this.autoFreeze_&&Ab(a,!0),i){const s=[],l=[];ds(ix).generateReplacementPatches_(n,a,{patches_:s,inversePatches_:l}),i(s,l)}return a}else ai(1,n)},this.produceWithPatches=(n,r)=>{if(Ks(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]},Qg(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Qg(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Qg(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){pi(t)||ai(8),ga(t)&&(t=Wr(t));const n=Nk(this),r=lx(n,t,void 0);return r[rr].isManual_=!0,ox(n),r}finishDraft(t,n){const r=t&&t[rr];(!r||!r.isManual_)&&ai(9);const{scope_:i}=r;return Ok(i,n),Mk(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=ds(ix).applyPatches_;return ga(t)?i(t,n):this.produce(t,a=>i(a,n))}};function lx(e,t,n,r){const[i,a]=Jh(t)?ds(Tf).proxyMap_(t,n):em(t)?ds(Tf).proxySet_(t,n):YK(t,n);return((n==null?void 0:n.scope_)??bN()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?VK(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 Wr(e){return ga(e)||ai(10,e),CN(e)}function CN(e){if(!pi(e)||tm(e))return e;const t=e[rr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=rx(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=rx(e,!0);return Qh(n,(i,a)=>{Ef(n,i,CN(a))},r),t&&(t.finalized_=!1),n}var QK=new XK,PN=QK.produce;function AN(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var ZK=AN(),JK=AN,eH=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Cf:Cf.apply(null,arguments)};function Tr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Ar(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=>gN(r)&&r.type===e,n}var EN=class _c extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,_c.prototype)}static get[Symbol.species](){return _c}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new _c(...t[0].concat(this)):new _c(...t.concat(this))}};function Rk(e){return pi(e)?PN(e,()=>{}):e}function Zd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function tH(e){return typeof e=="boolean"}var nH=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let s=new EN;return n&&(tH(n)?s.push(ZK):s.push(JK(n.extraArgument))),s},TN="RTK_autoBatch",Rt=()=>e=>({payload:e,meta:{[TN]:!0}}),Dk=e=>t=>{setTimeout(t,e)},rH=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(s),n())},a=e(i),s=setTimeout(i,t)},IN=(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?rH(window.requestAnimationFrame,100):Dk(10):e.type==="callback"?e.queueNotification:Dk(e.timeout),u=()=>{s=!1,a&&(a=!1,l.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const d=()=>i&&p(),f=r.subscribe(d);return l.add(p),()=>{f(),l.delete(p)}},dispatch(p){var d;try{return i=!((d=p==null?void 0:p.meta)!=null&&d[TN]),a=!i,a&&(s||(s=!0,c(u))),r.dispatch(p)}finally{i=!0}}})},iH=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new EN(e);return r&&i.push(IN(typeof r=="object"?r:void 0)),i};function aH(e){const t=nH(),{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(kb(n))l=mN(n);else throw new Error(Ar(1));let c;typeof r=="function"?c=r(t):c=t();let u=Cf;i&&(u=eH({trace:!1,...typeof i=="object"&&i}));const p=LK(...c),d=iH(p);let f=typeof s=="function"?s(d):d();const m=u(...f);return hN(l,a,m)}function ON(e){const t={},n=[];let r;const i={addCase(a,s){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(Ar(28));if(l in t)throw new Error(Ar(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 oH(e){return typeof e=="function"}function sH(e,t){let[n,r,i]=ON(t),a;if(oH(e))a=()=>Rk(e());else{const l=Rk(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(ga(p)){const m=d(p,c);return m===void 0?p:m}else{if(pi(p))return PN(p,f=>d(f,c));{const f=d(p,c);if(f===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return p},l)}return s.getInitialState=a,s}var lH="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",cH=(e=21)=>{let t="",n=e;for(;n--;)t+=lH[Math.random()*64|0];return t},uH=Symbol.for("rtk-slice-createasyncthunk");function dH(e,t){return`${e}/${t}`}function pH({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[uH];return function(i){const{name:a,reducerPath:s=a}=i;if(!a)throw new Error(Ar(11));const l=(typeof i.reducers=="function"?i.reducers(hH()):i.reducers)||{},c=Object.keys(l),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(j,k){const S=typeof j=="string"?j:j.type;if(!S)throw new Error(Ar(12));if(S in u.sliceCaseReducersByType)throw new Error(Ar(13));return u.sliceCaseReducersByType[S]=k,p},addMatcher(j,k){return u.sliceMatchers.push({matcher:j,reducer:k}),p},exposeAction(j,k){return u.actionCreators[j]=k,p},exposeCaseReducer(j,k){return u.sliceCaseReducersByName[j]=k,p}};c.forEach(j=>{const k=l[j],S={reducerName:j,type:dH(a,j),createNotation:typeof i.reducers=="function"};gH(k)?vH(S,k,p,t):mH(S,k,p)});function d(){const[j={},k=[],S=void 0]=typeof i.extraReducers=="function"?ON(i.extraReducers):[i.extraReducers],A={...j,...u.sliceCaseReducersByType};return sH(i.initialState,T=>{for(let D in A)T.addCase(D,A[D]);for(let D of u.sliceMatchers)T.addMatcher(D.matcher,D.reducer);for(let D of k)T.addMatcher(D.matcher,D.reducer);S&&T.addDefaultCase(S)})}const f=j=>j,m=new Map,g=new WeakMap;let v;function x(j,k){return v||(v=d()),v(j,k)}function y(){return v||(v=d()),v.getInitialState()}function b(j,k=!1){function S(T){let D=T[j];return typeof D>"u"&&k&&(D=Zd(g,S,y)),D}function A(T=f){const D=Zd(m,k,()=>new WeakMap);return Zd(D,T,()=>{const O={};for(const[_,R]of Object.entries(i.selectors??{}))O[_]=fH(R,T,()=>Zd(g,T,y),k);return O})}return{reducerPath:j,getSelectors:A,get selectors(){return A(S)},selectSlice:S}}const w={name:a,reducer:x,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:y,...b(s),injectInto(j,{reducerPath:k,...S}={}){const A=k??s;return j.inject({reducerPath:A,reducer:x},S),{...w,...b(A,!0)}}};return w}}function fH(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 Gn=pH();function hH(){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 mH({type:e,reducerName:t,createNotation:n},r,i){let a,s;if("reducer"in r){if(n&&!yH(r))throw new Error(Ar(17));a=r.reducer,s=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?Tr(e,s):Tr(e))}function gH(e){return e._reducerDefinitionType==="asyncThunk"}function yH(e){return e._reducerDefinitionType==="reducerWithPrepare"}function vH({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Ar(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||Jd,pending:l||Jd,rejected:c||Jd,settled:u||Jd})}function Jd(){}var xH="task",NN="listener",MN="completed",Eb="cancelled",bH=`task-${Eb}`,wH=`task-${MN}`,cx=`${NN}-${Eb}`,jH=`${NN}-${MN}`,rm=class{constructor(e){Be(this,"code");Be(this,"name","TaskAbortError");Be(this,"message");this.code=e,this.message=`${xH} ${Eb} (reason: ${e})`}},Tb=(e,t)=>{if(typeof e!="function")throw new TypeError(Ar(32))},Nf=()=>{},_N=(e,t=Nf)=>(e.catch(t),e),RN=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Zo=e=>{if(e.aborted)throw new rm(e.reason)};function DN(e,t){let n=Nf;return new Promise((r,i)=>{const a=()=>i(new rm(e.reason));if(e.aborted){a();return}n=RN(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Nf})}var SH=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof rm?"cancelled":"rejected",error:n}}finally{t==null||t()}},Mf=e=>t=>_N(DN(e,t).then(n=>(Zo(e),n))),LN=e=>{const t=Mf(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:gl}=Object,Lk={},im="listenerMiddleware",kH=(e,t)=>{const n=r=>RN(e,()=>r.abort(e.reason));return(r,i)=>{Tb(r);const a=new AbortController;n(a);const s=SH(async()=>{Zo(e),Zo(a.signal);const l=await r({pause:Mf(a.signal),delay:LN(a.signal),signal:a.signal});return Zo(a.signal),l},()=>a.abort(wH));return i!=null&&i.autoJoin&&t.push(s.catch(Nf)),{result:Mf(e)(s),cancel(){a.abort(bH)}}}},CH=(e,t)=>{const n=async(r,i)=>{Zo(t);let a=()=>{};const l=[new Promise((c,u)=>{let p=e({predicate:r,effect:(d,f)=>{f.unsubscribe(),c([d,f.getState(),f.getOriginalState()])}});a=()=>{p(),u()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await DN(t,Promise.race(l));return Zo(t),c}finally{a()}};return(r,i)=>_N(n(r,i))},zN=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Tr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Ar(21));return Tb(a),{predicate:i,type:t,effect:a}},$N=gl(e=>{const{type:t,predicate:n,effect:r}=zN(e);return{id:cH(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Ar(22))}}},{withTypes:()=>$N}),zk=(e,t)=>{const{type:n,effect:r,predicate:i}=zN(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},ux=e=>{e.pending.forEach(t=>{t.abort(cx)})},PH=(e,t)=>()=>{for(const n of t.keys())ux(n);e.clear()},$k=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},BN=gl(Tr(`${im}/add`),{withTypes:()=>BN}),AH=Tr(`${im}/removeAll`),FN=gl(Tr(`${im}/remove`),{withTypes:()=>FN}),EH=(...e)=>{console.error(`${im}/error`,...e)},Ju=(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=EH}=e;Tb(s);const l=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),g=>{m.unsubscribe(),g!=null&&g.cancelActive&&ux(m)}),c=m=>{const g=zk(t,m)??$N(m);return l(g)};gl(c,{withTypes:()=>c});const u=m=>{const g=zk(t,m);return g&&(g.unsubscribe(),m.cancelActive&&ux(g)),!!g};gl(u,{withTypes:()=>u});const p=async(m,g,v,x)=>{const y=new AbortController,b=CH(c,y.signal),w=[];try{m.pending.add(y),r(m),await Promise.resolve(m.effect(g,gl({},v,{getOriginalState:x,condition:(j,k)=>b(j,k).then(Boolean),take:b,delay:LN(y.signal),pause:Mf(y.signal),extra:a,signal:y.signal,fork:kH(y.signal,w),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((j,k,S)=>{j!==y&&(j.abort(cx),S.delete(j))})},cancel:()=>{y.abort(cx),m.pending.delete(y)},throwIfCancelled:()=>{Zo(y.signal)}})))}catch(j){j instanceof rm||$k(s,j,{raisedBy:"effect"})}finally{await Promise.all(w),y.abort(jH),i(m),m.pending.delete(y)}},d=PH(t,n);return{middleware:m=>g=>v=>{if(!gN(v))return g(v);if(BN.match(v))return c(v.payload);if(AH.match(v)){d();return}if(FN.match(v))return u(v.payload);let x=m.getState();const y=()=>{if(x===Lk)throw new Error(Ar(23));return x};let b;try{if(b=g(v),t.size>0){const w=m.getState(),j=Array.from(t.values());for(const k of j){let S=!1;try{S=k.predicate(v,w,x)}catch(A){S=!1,$k(s,A,{raisedBy:"predicate"})}S&&p(k,v,m,y)}}}finally{x=Lk}return b},startListening:c,stopListening:u,clearListeners:d}};function Ar(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 TH={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},UN=Gn({name:"chartLayout",initialState:TH,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}}}),am=UN.actions,IH=am.setMargin,OH=am.setLayout,NH=am.setChartSize,MH=am.setScale,_H=UN.reducer;function WN(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function et(e){return Number.isFinite(e)}function Ui(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Bk(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 al(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bk(Object(n),!0).forEach(function(r){RH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bk(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)}function ht(e,t,n){return zt(e)||zt(t)?n:Fi(t)?Bi(e,t,n):typeof t=="function"?t(e):n}var zH=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,s=t.verticalAlign,l=t.layout;if((l==="vertical"||l==="horizontal"&&s==="middle")&&a!=="center"&&Ce(e[a]))return al(al({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&s!=="middle"&&Ce(e[s]))return al(al({},e),{},{[s]:e[s]+(i||0)})}return e},hi=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",KN=(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},HN=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,s=e.scale,l=e.realScaleType,c=e.isCategorical,u=e.categoricalDomain,p=e.tickCount,d=e.ticks,f=e.niceTicks,m=e.axisType;if(!s)return null;var g=l==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,v=i==="category"&&s.bandwidth?s.bandwidth()/g:0;if(v=m==="angleAxis"&&a&&a.length>=2?Sn(a[0]-a[1])*2*v:v,d||f){var x=(d||f||[]).map((y,b)=>{var w=r?r.indexOf(y):y,j=s.map(w);return et(j)?{coordinate:j+v,value:y,offset:v,index:b}:null}).filter(dr);return x}return c&&u?u.map((y,b)=>{var w=s.map(y);return et(w)?{coordinate:w+v,value:y,index:b,offset:v}:null}).filter(dr):s.ticks&&p!=null?s.ticks(p).map((y,b)=>{var w=s.map(y);return et(w)?{coordinate:w+v,value:y,index:b,offset:v}:null}).filter(dr):s.domain().map((y,b)=>{var w=s.map(y);return et(w)?{coordinate:w+v,value:r?r[y]:y,index:b,offset:v}:null}).filter(dr)},$H=(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},BH=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],f=di(p)?d:p;f>=0?(u[0]=a,a+=f,u[1]=a):(u[0]=s,s+=f,u[1]=s)}}}},FH=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=di(c[1])?c[0]:c[1];u>=0?(c[0]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},UH={sign:BH,expand:PW,none:cs,silhouette:AW,wiggle:EW,positive:FH},WH=(e,t,n)=>{var r,i=(r=UH[n])!==null&&r!==void 0?r:cs,a=CW().keys(t).value((l,c)=>Number(ht(l,c,0))).order(Gv).offset(i),s=a(e);return s.forEach((l,c)=>{l.forEach((u,p)=>{var d=ht(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 VN(e){return e==null?void 0:String(e)}function _f(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!zt(i[t.dataKey])){var l=UO(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=ht(i,zt(s)?t.dataKey:s),u=t.scale.map(c);return Ce(u)?u:null}var Fk=e=>{var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,s=e.index;if(t.type==="category")return n[s]?n[s].coordinate+r:null;var l=ht(a,t.dataKey,t.scale.domain()[s]);if(zt(l))return null;var c=t.scale.map(l);return Ce(c)?c-i/2+r:null},KH=e=>{var t=e.numericAxis,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]},HH=e=>{var t=e.flat(2).filter(Ce);return[Math.min(...t),Math.max(...t)]},VH=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],qH=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return VH(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var s=a.stackedData,l=s.reduce((c,u)=>{var p=WN(u,t,n),d=HH(p);return!et(d[0])||!et(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]))},Uk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Wk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ao=(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=Gh(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 Kk(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return al(al({},t),{},{dataKey:n,payload:r,value:i,name:a})}function ho(e,t){if(e!=null)return String(e);if(typeof t=="string")return t}var YH=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},GH=(e,t)=>t==="centric"?e.angle:e.radius,Sa=e=>e.layout.width,ka=e=>e.layout.height,XH=e=>e.layout.scale,qN=e=>e.layout.margin,om=G(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),sm=G(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),YN="data-recharts-item-index",GN="data-recharts-item-id",ed=60;function Hk(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?Hk(Object(n),!0).forEach(function(r){QH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QH(e,t,n){return(t=ZH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZH(e){var t=JH(e,"string");return typeof t=="symbol"?t:t+""}function JH(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 e7=e=>e.brush.height;function t7(e){var t=sm(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ed;return n+i}return n},0)}function n7(e){var t=sm(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ed;return n+i}return n},0)}function r7(e){var t=om(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function i7(e){var t=om(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var vn=G([Sa,ka,qN,e7,t7,n7,r7,i7,pN,CK],(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},f=ep(ep({},d),p),m=f.bottom;f.bottom+=r,f=zH(f,c,u);var g=e-f.left-f.right,v=t-f.top-f.bottom;return ep(ep({brushBottom:m},f),{},{width:Math.max(g,0),height:Math.max(v,0)})}),a7=G(vn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Ib=G(Sa,ka,(e,t)=>({x:0,y:0,width:e,height:t})),o7=h.createContext(null),Cn=()=>h.useContext(o7)!=null,lm=e=>e.brush,cm=G([lm,vn,qN],(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 s7(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)},f=()=>{p!==null&&(clearTimeout(p),p=null)},m=()=>{f(),i=void 0,a=null},g=()=>{c()},v=function(...x){if(n!=null&&n.aborted)return;i=this,a=x;const y=p==null;d(),s&&y&&c()};return v.schedule=d,v.cancel=m,v.flush=g,n==null||n.addEventListener("abort",m,{once:!0}),v}function l7(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=s7(function(...f){l=e.apply(this,f),c=null},t,{edges:s}),p=function(...f){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(l=e.apply(this,f),c=Date.now(),u.cancel(),u.schedule(),l):(u.apply(this,f),l)},d=()=>(u.flush(),l);return p.cancel=u.cancel,p.flush=d,p}function c7(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return l7(e,t,{leading:r,maxWait:t,trailing:i})}var Rf=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++]))}},Mi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},XN=(e,t,n)=>{var r=n.width,i=r===void 0?Mi.width:r,a=n.height,s=a===void 0?Mi.height:a,l=n.aspect,c=n.maxHeight,u=us(i)?e:Number(i),p=us(s)?t:Number(s);return l&&l>0&&(u?p=u/l:p&&(u=p*l),c&&p!=null&&p>c&&(p=c)),{calculatedWidth:u,calculatedHeight:p}},u7={width:0,height:0,overflow:"visible"},d7={width:0,overflowX:"visible"},p7={height:0,overflowY:"visible"},f7={},h7=e=>{var t=e.width,n=e.height,r=us(t),i=us(n);return r&&i?u7:r?d7:i?p7:f7};function m7(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Mi.width,a=Mi.height):i===void 0?i=r&&r>0?void 0:Mi.width:a===void 0&&(a=r&&r>0?void 0:Mi.height),{width:i,height:a}}var g7=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Df(){return Df=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},Df.apply(null,arguments)}function Vk(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 qk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vk(Object(n),!0).forEach(function(r){y7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function y7(e,t,n){return(t=v7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v7(e){var t=x7(e,"string");return typeof t=="symbol"?t:t+""}function x7(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 b7(e,t){return k7(e)||S7(e,t)||j7(e,t)||w7()}function w7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
416
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j7(e,t){if(e){if(typeof e=="string")return Yk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yk(e,t):void 0}}function Yk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S7(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function k7(e){if(Array.isArray(e))return e}function C7(e,t){if(e==null)return{};var n,r,i=P7(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 P7(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 QN=h.createContext(Mi.initialDimension);function A7(e){return Ui(e.width)&&Ui(e.height)}function ZN(e){var t=e.children,n=e.width,r=e.height,i=h.useMemo(()=>({width:n,height:r}),[n,r]);return A7(i)?h.createElement(QN.Provider,{value:i},t):null}var Ob=()=>h.useContext(QN),E7=h.forwardRef((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Mi.initialDimension:r,a=e.width,s=e.height,l=e.minWidth,c=l===void 0?Mi.minWidth:l,u=e.minHeight,p=e.maxHeight,d=e.children,f=e.debounce,m=f===void 0?Mi.debounce:f,g=e.id,v=e.className,x=e.onResize,y=e.style,b=y===void 0?{}:y,w=C7(e,g7),j=h.useRef(null),k=h.useRef();k.current=x,h.useImperativeHandle(t,()=>j.current);var S=h.useState({containerWidth:i.width,containerHeight:i.height}),A=b7(S,2),T=A[0],D=A[1],O=h.useCallback(($,H)=>{D(N=>{var W=Math.round($),P=Math.round(H);return N.containerWidth===W&&N.containerHeight===P?N:{containerWidth:W,containerHeight:P}})},[]);h.useEffect(()=>{if(j.current==null||typeof ResizeObserver>"u")return fo;var $=U=>{var le,E=U[0];if(E!=null){var he=E.contentRect,ye=he.width,Q=he.height;O(ye,Q),(le=k.current)===null||le===void 0||le.call(k,ye,Q)}};m>0&&($=c7($,m,{trailing:!0,leading:!1}));var H=new ResizeObserver($),N=j.current.getBoundingClientRect(),W=N.width,P=N.height;return O(W,P),H.observe(j.current),()=>{H.disconnect()}},[O,m]);var _=T.containerWidth,R=T.containerHeight;Rf(!n||n>0,"The aspect(%s) must be greater than zero.",n);var X=XN(_,R,{width:a,height:s,aspect:n,maxHeight:p}),V=X.calculatedWidth,I=X.calculatedHeight;return Rf(_<0||R<0||V!=null&&V>0||I!=null&&I>0,`The width(%s) and height(%s) of chart should be greater than 0,
417
+ please check the style of container, or the props width(%s) and height(%s),
418
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
419
+ height and width.`,V,I,a,s,c,u,n),h.createElement("div",Df({id:g?"".concat(g):void 0,className:mt("recharts-responsive-container",v),style:qk(qk({},b),{},{width:a,height:s,minWidth:c,minHeight:u,maxHeight:p}),ref:j},w),h.createElement("div",{style:h7({width:a,height:s})},h.createElement(ZN,{width:V,height:I},d)))}),Hs=h.forwardRef((e,t)=>{var n=Ob();if(Ui(n.width)&&Ui(n.height))return e.children;var r=m7({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,s=XN(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),l=s.calculatedWidth,c=s.calculatedHeight;return Ce(l)&&Ce(c)?h.createElement(ZN,{width:l,height:c},e.children):h.createElement(E7,Df({},e,{width:i,height:a,ref:t}))});function Nb(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 um=()=>{var e,t=Cn(),n=Te(a7),r=Te(cm),i=(e=Te(lm))===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}},T7={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},JN=()=>{var e;return(e=Te(vn))!==null&&e!==void 0?e:T7},Mb=()=>Te(Sa),_b=()=>Te(ka),I7=()=>Te(e=>e.layout.margin),ct=e=>e.layout.layoutType,mo=()=>Te(ct),Rb=()=>{var e=mo();if(e==="horizontal"||e==="vertical")return e},Db=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},O7=()=>Te(Db),N7=()=>{var e=mo();return e!==void 0},td=e=>{var t=jt(),n=Cn(),r=e.width,i=e.height,a=Ob(),s=r,l=i;return a&&(s=a.width>0?a.width:r,l=a.height>0?a.height:i),h.useEffect(()=>{!n&&Ui(s)&&Ui(l)&&t(NH({width:s,height:l}))},[t,n,s,l]),null},eM=Symbol.for("immer-nothing"),Gk=Symbol.for("immer-draftable"),Ir=Symbol.for("immer-state");function oi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Au=Object.getPrototypeOf;function Nl(e){return!!e&&!!e[Ir]}function ps(e){var t;return e?tM(e)||Array.isArray(e)||!!e[Gk]||!!((t=e.constructor)!=null&&t[Gk])||nd(e)||pm(e):!1}var M7=Object.prototype.constructor.toString(),Xk=new WeakMap;function tM(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=Xk.get(n);return r===void 0&&(r=Function.toString.call(n),Xk.set(n,r)),r===M7}function Lf(e,t,n=!0){dm(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 dm(e){const t=e[Ir];return t?t.type_:Array.isArray(e)?1:nd(e)?2:pm(e)?3:0}function dx(e,t){return dm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function nM(e,t,n){const r=dm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function _7(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function nd(e){return e instanceof Map}function pm(e){return e instanceof Set}function Oo(e){return e.copy_||e.base_}function px(e,t){if(nd(e))return new Map(e);if(pm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=tM(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ir];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(Au(e),r)}else{const r=Au(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Lb(e,t=!1){return fm(e)||Nl(e)||!ps(e)||(dm(e)>1&&Object.defineProperties(e,{set:tp,add:tp,clear:tp,delete:tp}),Object.freeze(e),t&&Object.values(e).forEach(n=>Lb(n,!0))),e}function R7(){oi(2)}var tp={value:R7};function fm(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var D7={};function fs(e){const t=D7[e];return t||oi(0,e),t}var Eu;function rM(){return Eu}function L7(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Qk(e,t){t&&(fs("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fx(e){hx(e),e.drafts_.forEach(z7),e.drafts_=null}function hx(e){e===Eu&&(Eu=e.parent_)}function Zk(e){return Eu=L7(Eu,e)}function z7(e){const t=e[Ir];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Jk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ir].modified_&&(fx(t),oi(4)),ps(e)&&(e=zf(t,e),t.parent_||$f(t,e)),t.patches_&&fs("Patches").generateReplacementPatches_(n[Ir].base_,e,t.patches_,t.inversePatches_)):e=zf(t,n,[]),fx(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==eM?e:void 0}function zf(e,t,n){if(fm(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Ir];if(!i)return Lf(t,(a,s)=>eC(e,i,t,a,s,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return $f(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),Lf(s,(c,u)=>eC(e,i,a,c,u,n,l),r),$f(e,a,!1),n&&e.patches_&&fs("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function eC(e,t,n,r,i,a,s){if(i==null||typeof i!="object"&&!s)return;const l=fm(i);if(!(l&&!s)){if(Nl(i)){const c=a&&t&&t.type_!==3&&!dx(t.assigned_,r)?a.concat(r):void 0,u=zf(e,i,c);if(nM(n,r,u),Nl(u))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(ps(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;zf(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(nd(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&$f(e,i)}}}function $f(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Lb(t,n)}function $7(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:rM(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=zb;n&&(i=[r],a=Tu);const{revoke:s,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=s,l}var zb={get(e,t){if(t===Ir)return e;const n=Oo(e);if(!dx(n,t))return B7(e,n,t);const r=n[t];return e.finalized_||!ps(r)?r:r===Jg(e.base_,t)?(ey(e),e.copy_[t]=gx(r,e)):r},has(e,t){return t in Oo(e)},ownKeys(e){return Reflect.ownKeys(Oo(e))},set(e,t,n){const r=iM(Oo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Jg(Oo(e),t),a=i==null?void 0:i[Ir];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(_7(n,i)&&(n!==void 0||dx(e.base_,t)))return!0;ey(e),mx(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 Jg(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ey(e),mx(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Oo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){oi(11)},getPrototypeOf(e){return Au(e.base_)},setPrototypeOf(){oi(12)}},Tu={};Lf(zb,(e,t)=>{Tu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Tu.deleteProperty=function(e,t){return Tu.set.call(this,e,t,void 0)};Tu.set=function(e,t,n){return zb.set.call(this,e[0],t,n,e[0])};function Jg(e,t){const n=e[Ir];return(n?Oo(n):e)[t]}function B7(e,t,n){var i;const r=iM(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function iM(e,t){if(!(t in e))return;let n=Au(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Au(n)}}function mx(e){e.modified_||(e.modified_=!0,e.parent_&&mx(e.parent_))}function ey(e){e.copy_||(e.copy_=px(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var F7=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"&&oi(6),r!==void 0&&typeof r!="function"&&oi(7);let i;if(ps(t)){const a=Zk(this),s=gx(t,void 0);let l=!0;try{i=n(s),l=!1}finally{l?fx(a):hx(a)}return Qk(a,r),Jk(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===eM&&(i=void 0),this.autoFreeze_&&Lb(i,!0),r){const a=[],s=[];fs("Patches").generateReplacementPatches_(t,i,a,s),r(a,s)}return i}else oi(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){ps(e)||oi(8),Nl(e)&&(e=U7(e));const t=Zk(this),n=gx(e,void 0);return n[Ir].isManual_=!0,hx(t),n}finishDraft(e,t){const n=e&&e[Ir];(!n||!n.isManual_)&&oi(9);const{scope_:r}=n;return Qk(r,t),Jk(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=fs("Patches").applyPatches_;return Nl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function gx(e,t){const n=nd(e)?fs("MapSet").proxyMap_(e,t):pm(e)?fs("MapSet").proxySet_(e,t):$7(e,t);return(t?t.scope_:rM()).drafts_.push(n),n}function U7(e){return Nl(e)||oi(10,e),aM(e)}function aM(e){if(!ps(e)||fm(e))return e;const t=e[Ir];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=px(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=px(e,!0);return Lf(n,(i,a)=>{nM(n,i,aM(a))},r),t&&(t.finalized_=!1),n}var W7=new F7;W7.produce;var K7={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},oM=Gn({name:"legend",initialState:K7,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:Rt()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Wr(e).payload.indexOf(r);a>-1&&(e.payload[a]=i)},prepare:Rt()},removeLegendPayload:{reducer(e,t){var n=Wr(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Rt()}}}),rd=oM.actions,tC=rd.setLegendSize,H7=rd.setLegendSettings,sM=rd.addLegendPayload,lM=rd.replaceLegendPayload,cM=rd.removeLegendPayload,V7=oM.reducer,q7={};/**
420
+ * @license React
421
+ * use-sync-external-store-with-selector.production.js
422
+ *
423
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
424
+ *
425
+ * This source code is licensed under the MIT license found in the
426
+ * LICENSE file in the root directory of this source tree.
427
+ */var id=h;function Y7(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var G7=typeof Object.is=="function"?Object.is:Y7,X7=id.useSyncExternalStore,Q7=id.useRef,Z7=id.useEffect,J7=id.useMemo,eV=id.useDebugValue;q7.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=Q7(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=J7(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,G7(p,m))return g;var v=r(m);return i!==void 0&&i(g,v)?(p=m,g):(p=m,d=v)}var u=!1,p,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,r,i]);var l=X7(e,a[0],a[1]);return Z7(function(){s.hasValue=!0,s.value=l},[l]),eV(l),l};function tV(e){e()}function nV(){let e=null,t=null;return{clear(){e=null,t=null},notify(){tV(()=>{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 nC={notify(){},get:()=>[]};function rV(e,t){let n,r=nC,i=0,a=!1;function s(v){p();const x=r.subscribe(v);let y=!1;return()=>{y||(y=!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=nV())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=nC)}function f(){a||(a=!0,p())}function m(){a&&(a=!1,d())}const g={addNestedSub:s,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:u,trySubscribe:f,tryUnsubscribe:m,getListeners:()=>r};return g}var iV=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aV=iV(),oV=()=>typeof navigator<"u"&&navigator.product==="ReactNative",sV=oV(),lV=()=>aV||sV?h.useLayoutEffect:h.useEffect,cV=lV();function rC(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function uV(e,t){if(rC(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])||!rC(e[n[i]],t[n[i]]))return!1;return!0}var ty=Symbol.for("react-redux-context"),ny=typeof globalThis<"u"?globalThis:{};function dV(){if(!h.createContext)return{};const e=ny[ty]??(ny[ty]=new Map);let t=e.get(h.createContext);return t||(t=h.createContext(null),e.set(h.createContext,t)),t}var pV=dV();function fV(e){const{children:t,context:n,serverState:r,store:i}=e,a=h.useMemo(()=>{const c=rV(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),s=h.useMemo(()=>i.getState(),[i]);cV(()=>{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||pV;return h.createElement(l.Provider,{value:a},t)}var hV=fV,mV=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function gV(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function js(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(mV.has(r)){if(e[r]==null&&t[r]==null)continue;if(!uV(e[r],t[r]))return!1}else if(!gV(e[r],t[r]))return!1;return!0}var yV=["contextPayload"];function yx(){return yx=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},yx.apply(null,arguments)}function vV(e,t){return jV(e)||wV(e,t)||bV(e,t)||xV()}function xV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
428
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bV(e,t){if(e){if(typeof e=="string")return iC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iC(e,t):void 0}}function iC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function jV(e){if(Array.isArray(e))return e}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 Ml(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){SV(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 SV(e,t,n){return(t=kV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kV(e){var t=CV(e,"string");return typeof t=="symbol"?t:t+""}function CV(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 PV(e,t){if(e==null)return{};var n,r,i=AV(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 AV(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 EV(e){return e.value}function TV(e){var t=e.contextPayload,n=PV(e,yV),r=iN(t,e.payloadUniqBy,EV),i=Ml(Ml({},n),{},{payload:r});return h.isValidElement(e.content)?h.cloneElement(e.content,i):typeof e.content=="function"?h.createElement(e.content,i):h.createElement(e9,i)}function IV(e,t,n,r,i,a){var s=t.layout,l=t.align,c=t.verticalAlign,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}),Ml(Ml({},u),p)}function OV(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=jt();return h.useLayoutEffect(()=>{a(H7({align:t,layout:n,verticalAlign:r,itemSorter:i}))},[a,t,n,r,i]),null}function NV(e){var t=e.width,n=e.height,r=jt();return h.useLayoutEffect(()=>{r(tC({width:t,height:n}))},[r,t,n]),h.useLayoutEffect(()=>()=>{r(tC({width:0,height:0}))},[r]),null}function MV(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var _V={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",labelStyle:{},layout:"horizontal",verticalAlign:"bottom"};function RV(e){var t=dn(e,_V),n=EK(),r=GU(),i=I7(),a=t.width,s=t.height,l=t.wrapperStyle,c=t.portal,u=fN([n]),p=vV(u,2),d=p[0],f=p[1],m=Mb(),g=_b();if(m==null||g==null)return null;var v=m-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),x=MV(t.layout,s,a,v),y=c?l:Ml(Ml({position:"absolute",width:(x==null?void 0:x.width)||a||"auto",height:(x==null?void 0:x.height)||s||"auto"},IV(l,t,i,m,g,d)),l),b=c??r;if(b==null||n==null)return null;var w=h.createElement("div",{className:"recharts-legend-wrapper",style:y,ref:f},h.createElement(OV,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&h.createElement(NV,{width:d.width,height:d.height}),h.createElement(TV,yx({},t,x,{margin:i,chartWidth:m,chartHeight:g,contextPayload:n})));return Ku.createPortal(w,b)}var ol=h.memo(RV,js);ol.displayName="Legend";function vx(){return vx=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},vx.apply(null,arguments)}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 vc(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){DV(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 DV(e,t,n){return(t=LV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LV(e){var t=zV(e,"string");return typeof t=="symbol"?t:t+""}function zV(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 $V(e,t){return WV(e)||UV(e,t)||FV(e,t)||BV()}function BV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
429
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FV(e,t){if(e){if(typeof e=="string")return sC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sC(e,t):void 0}}function sC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function UV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function WV(e){if(Array.isArray(e))return e}function KV(e){return Array.isArray(e)&&Fi(e[0])&&Fi(e[1])?e.join(" ~ "):e}var Rs={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 HV(e,t){return t==null?e:Gh(e,t)}var VV=e=>{var t=e.separator,n=t===void 0?Rs.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,s=a===void 0?Rs.labelStyle:a,l=e.payload,c=e.formatter,u=e.itemSorter,p=e.wrapperClassName,d=e.labelClassName,f=e.label,m=e.labelFormatter,g=e.accessibilityLayer,v=g===void 0?Rs.accessibilityLayer:g,x=()=>{if(l&&l.length){var T={padding:0,margin:0},D=HV(l,u),O=D.map((_,R)=>{if(!_||_.type==="none")return null;var X=_.formatter||c||KV,V=_.value,I=_.name,$=V,H=I;if(X){var N=X(V,I,_,R,l);if(Array.isArray(N)){var W=$V(N,2);$=W[0],H=W[1]}else if(N!=null)$=N;else return null}var P=vc(vc({},Rs.itemStyle),{},{color:_.color||Rs.itemStyle.color},i);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:P},Fi(H)?h.createElement("span",{className:"recharts-tooltip-item-name"},H):null,Fi(H)?h.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,h.createElement("span",{className:"recharts-tooltip-item-value"},$),h.createElement("span",{className:"recharts-tooltip-item-unit"},_.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:T},O)}return null},y=vc(vc({},Rs.contentStyle),r),b=vc({margin:0},s),w=!zt(f),j=w?f:"",k=mt("recharts-default-tooltip",p),S=mt("recharts-tooltip-label",d);w&&m&&l!==void 0&&l!==null&&(j=m(f,l));var A=v?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",vx({className:k,style:y},A),h.createElement("p",{className:S,style:b},h.isValidElement(j)?j:"".concat(j)),x())},xc="recharts-tooltip-wrapper",qV={visibility:"hidden"};function YV(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return mt(xc,{["".concat(xc,"-right")]:Ce(n)&&t&&Ce(t.x)&&n>=t.x,["".concat(xc,"-left")]:Ce(n)&&t&&Ce(t.x)&&n<t.x,["".concat(xc,"-bottom")]:Ce(r)&&t&&Ce(t.y)&&r>=t.y,["".concat(xc,"-top")]:Ce(r)&&t&&Ce(t.y)&&r<t.y})}function lC(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offset,a=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;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 f=c[r];if(f==null)return 0;if(s[r]){var m=p,g=f;return m<g?Math.max(d,f):Math.max(p,f)}if(u==null)return 0;var v=d+l,x=f+u;return v>x?Math.max(p,f):Math.max(d,f)}function GV(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function XV(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,s=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,u=e.viewBox,p,d,f;return l.height>0&&l.width>0&&n?(d=lC({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:s,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),f=lC({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:s,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),p=GV({translateX:d,translateY:f,useTranslate3d:c})):p=qV,{cssProperties:p,cssClasses:YV({translateX:d,translateY:f,coordinate:n})}}var QV=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),ad={isSsr:QV()};function ZV(e,t){return nq(e)||tq(e,t)||eq(e,t)||JV()}function JV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
430
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eq(e,t){if(e){if(typeof e=="string")return cC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cC(e,t):void 0}}function cC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function nq(e){if(Array.isArray(e))return e}function uM(){var e=h.useState(()=>ad.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=ZV(e,2),n=t[0],r=t[1];return h.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{r(i.matches)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}}},[]),n}function uC(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?uC(Object(n),!0).forEach(function(r){rq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rq(e,t,n){return(t=iq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iq(e){var t=aq(e,"string");return typeof t=="symbol"?t:t+""}function aq(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 oq(e,t){return uq(e)||cq(e,t)||lq(e,t)||sq()}function sq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
431
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lq(e,t){if(e){if(typeof e=="string")return dC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dC(e,t):void 0}}function dC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function uq(e){if(Array.isArray(e))return e}function dq(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing=="string"?e.animationEasing:"ease";return"transform ".concat(e.animationDuration,"ms ").concat(t)}}function pq(e){var t,n,r,i,a,s,l=uM(),c=h.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),u=oq(c,2),p=u[0],d=u[1];h.useEffect(()=>{var y=b=>{if(b.key==="Escape"){var w,j,k,S;d({dismissed:!0,dismissedAtCoordinate:{x:(w=(j=e.coordinate)===null||j===void 0?void 0:j.x)!==null&&w!==void 0?w:0,y:(k=(S=e.coordinate)===null||S===void 0?void 0:S.y)!==null&&k!==void 0?k:0}})}};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),p.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==p.dismissedAtCoordinate.x||((a=(s=e.coordinate)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0)!==p.dismissedAtCoordinate.y)&&d(Ds(Ds({},p),{},{dismissed:!1}));var f=XV({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}),m=f.cssClasses,g=f.cssProperties,v=e.hasPortalFromProps?{}:Ds(Ds({transition:dq({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},g),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),x=Ds(Ds({},v),{},{visibility:!p.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:m,style:x,ref:e.innerRef},e.children)}var fq=h.memo(pq),dM=()=>{var e;return(e=Te(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function xx(){return xx=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},xx.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 fC(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){hq(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 hq(e,t,n){return(t=mq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mq(e){var t=gq(e,"string");return typeof t=="symbol"?t:t+""}function gq(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 hC={curveBasisClosed:hW,curveBasisOpen:mW,curveBasis:fW,curveBumpX:JU,curveBumpY:eW,curveLinearClosed:gW,curveLinear:Vh,curveMonotoneX:yW,curveMonotoneY:vW,curveNatural:xW,curveStep:bW,curveStepAfter:jW,curveStepBefore:wW},Bf=e=>et(e.x)&&et(e.y),mC=e=>e.base!=null&&Bf(e.base)&&Bf(e),bc=e=>e.x,wc=e=>e.y,yq=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Xu(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=hC["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return hC[n]||Vh},gC={connectNulls:!1,type:"linear"},vq=e=>{var t=e.type,n=t===void 0?gC.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,s=e.layout,l=e.connectNulls,c=l===void 0?gC.connectNulls:l,u=yq(n,s),p=c?i.filter(Bf):i;if(Array.isArray(a)){var d,f=i.map((y,b)=>fC(fC({},y),{},{base:a[b]}));s==="vertical"?d=Yd().y(wc).x1(bc).x0(y=>y.base.x):d=Yd().x(bc).y1(wc).y0(y=>y.base.y);var m=d.defined(mC).curve(u),g=c?f.filter(mC):f;return m(g)}var v;s==="vertical"&&Ce(a)?v=Yd().y(wc).x1(bc).x0(a):Ce(a)?v=Yd().x(bc).y1(wc).y0(a):v=EO().x(bc).y(wc);var x=v.defined(Bf).curve(u);return x(p)},yl=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=mo();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?vq(s):r;return h.createElement("path",xx({},nr(e),wb(e),{className:mt("recharts-curve",t),d:l===null?void 0:l,ref:i}))},xq=["x","y","top","left","width","height","className"];function bx(){return bx=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},bx.apply(null,arguments)}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 bq(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){wq(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 wq(e,t,n){return(t=jq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jq(e){var t=Sq(e,"string");return typeof t=="symbol"?t:t+""}function Sq(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 kq(e,t){if(e==null)return{};var n,r,i=Cq(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 Cq(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 Pq=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Aq=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,p=u===void 0?0:u,d=e.height,f=d===void 0?0:d,m=e.className,g=kq(e,xq),v=bq({x:n,y:i,top:s,left:c,width:p,height:f},g);return!Ce(n)||!Ce(i)||!Ce(p)||!Ce(f)||!Ce(s)||!Ce(c)?null:h.createElement("path",bx({},yr(v),{className:mt("recharts-cross",m),d:Pq(n,i,p,f,s,c)}))};function Eq(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}}var Ff=1e-4,pM=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],fM=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),vC=(e,t)=>n=>{var r=pM(e,t);return fM(r,n)},Tq=(e,t)=>n=>{var r=pM(e,t),i=[...r.map((a,s)=>a*s).slice(1),0];return fM(i,n)},Iq=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]]},Oq=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=Iq(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Nq=(e,t,n,r)=>{var i=vC(e,n),a=vC(t,r),s=Tq(e,n),l=u=>u>1?1:u<0?0:u,c=u=>{for(var p=u>1?1:u,d=p,f=0;f<8;++f){var m=i(d)-p,g=s(d);if(Math.abs(m-p)<Ff||g<Ff)return a(d);d=l(d-m/g)}return a(d)};return c.isStepper=!1,c},xC=function(){return Nq(...Oq(...arguments))},Mq=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,s=t.dt,l=s===void 0?16.67:s,c=1,u=[0],p=0,d=0,f=1e4,m=0;m<f;){var g=-(p-c)*r,v=d*a;if(d+=(g-v)*l/1e3,p+=d*l/1e3,u.push(p),Math.abs(p-c)<Ff&&Math.abs(d)<Ff)break;m++}u[u.length-1]=c;var x=u.length-1;return y=>{var b,w,j;if(y<=0)return 0;if(y>=1)return c;var k=y*x,S=Math.floor(k),A=k-S;return((b=u[S])!==null&&b!==void 0?b:0)+(((w=u[S+1])!==null&&w!==void 0?w:0)-((j=u[S])!==null&&j!==void 0?j:0))*A}},_q=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return xC(e);case"spring":return Mq();default:if(e.split("(")[0]==="cubic-bezier")return xC(e)}return typeof e=="function"?e:null},Rq=(e,t,n)=>{var r,i=a=>{var s=t.tick(a);if(t.getState()==="active"){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,s);return}r=e.setTimeout(i,s)};return r=e.setTimeout(i,0),()=>{var a;return(a=r)===null||a===void 0?void 0:a()}},hM=h.createContext(Rq);hM.Provider;function Dq(e){var t=h.useContext(hM);return h.useMemo(()=>e??t,[e,t])}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 bC="init",wC="pending",jC="active",Bq="completed";function ry(e){return Math.max(0,e)}class Fq{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var n;Lq(this,"state",bC),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=ry(t.animationDuration),this.animationBegin=ry(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(n=t.onAnimationStart)===null||n===void 0||n.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===bC)return this.state=wC,this.beginStartedTime=t,this.animationBegin;if(this.getState()===wC){if(this.beginStartedTime==null)throw new Error;var n=t-this.beginStartedTime;return n>=this.animationBegin?(this.state=jC,this.animationStartedTime=t,this.nextAnimationUpdate(0)):ry(this.animationBegin-n)}if(this.getState()===jC){if(this.animationStartedTime==null)throw new Error;var r=t-this.animationStartedTime;return this.setProgress(r/this.animationDuration),this.nextAnimationUpdate(r)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=Bq}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class Uq extends Fq{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(It(this.getFrom(),this.getTo(),this.getProgress()))}}class Wq{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):i=requestAnimationFrame(a)};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function Kq(e,t){return Yq(e)||qq(e,t)||Vq(e,t)||Hq()}function Hq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
432
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vq(e,t){if(e){if(typeof e=="string")return SC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SC(e,t):void 0}}function SC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Yq(e){if(Array.isArray(e))return e}var Gq={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},kC=0,iy=1;function mM(e){var t=dn(e,Gq),n=t.animationId,r=t.isActive,i=t.canBegin,a=t.duration,s=t.easing,l=t.begin,c=t.onAnimationEnd,u=t.onAnimationStart,p=t.children,d=uM(),f=r==="auto"?!ad.isSsr&&!d:r,m=Dq(t.animationController),g=h.useState(f?kC:iy),v=Kq(g,2),x=v[0],y=v[1];return h.useEffect(()=>{f||y(iy)},[f]),h.useEffect(()=>{var b=_q(s);if(!f||!i||b==null)return fo;var w=new Wq,j=new Uq({animationId:n,easing:b,animationDuration:a,animationBegin:l,onAnimationStart:u,onAnimationEnd:c,from:kC,to:iy});return m(w,j,y)},[m,n,f,i,a,s,l,u,c]),p(Number(x))}function gM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=h.useRef(Su(t)),r=h.useRef(e);return r.current!==e&&(n.current=Su(t),r.current=e),n.current}var Xq=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Qq=(e,t,n)=>e.map(r=>"".concat(Xq(r)," ").concat(t,"ms ").concat(n)).join(","),Zq=["radius"],Jq=["radius"],CC,PC,AC,EC,TC,IC,OC,NC,MC,_C;function RC(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 DC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RC(Object(n),!0).forEach(function(r){eY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eY(e,t,n){return(t=tY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tY(e){var t=nY(e,"string");return typeof t=="symbol"?t:t+""}function nY(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 Uf(){return Uf=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},Uf.apply(null,arguments)}function LC(e,t){if(e==null)return{};var n,r,i=rY(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 rY(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 iY(e,t){return lY(e)||sY(e,t)||oY(e,t)||aY()}function aY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
433
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oY(e,t){if(e){if(typeof e=="string")return zC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zC(e,t):void 0}}function zC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function lY(e){if(Array.isArray(e))return e}function bi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var $C=(e,t,n,r,i)=>{var a=oa(n),s=oa(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 f=[0,0,0,0],m=0,g=4;m<g;m++){var v,x=(v=i[m])!==null&&v!==void 0?v:0;f[m]=x>l?l:x}d=Dn(CC||(CC=bi(["M",",",""])),e,t+c*f[0]),f[0]>0&&(d+=Dn(PC||(PC=bi(["A ",",",",0,0,",",",",",""])),f[0],f[0],p,e+u*f[0],t)),d+=Dn(AC||(AC=bi(["L ",",",""])),e+n-u*f[1],t),f[1]>0&&(d+=Dn(EC||(EC=bi(["A ",",",",0,0,",`,
434
+ `,",",""])),f[1],f[1],p,e+n,t+c*f[1])),d+=Dn(TC||(TC=bi(["L ",",",""])),e+n,t+r-c*f[2]),f[2]>0&&(d+=Dn(IC||(IC=bi(["A ",",",",0,0,",`,
435
+ `,",",""])),f[2],f[2],p,e+n-u*f[2],t+r)),d+=Dn(OC||(OC=bi(["L ",",",""])),e+u*f[3],t+r),f[3]>0&&(d+=Dn(NC||(NC=bi(["A ",",",",0,0,",`,
436
+ `,",",""])),f[3],f[3],p,e,t+r-c*f[3])),d+="Z"}else if(l>0&&i===+i&&i>0){var y=Math.min(l,i);d=Dn(MC||(MC=bi(["M ",",",`
437
+ A `,",",",0,0,",",",",",`
438
+ L `,",",`
439
+ A `,",",",0,0,",",",",",`
440
+ L `,",",`
441
+ A `,",",",0,0,",",",",",`
442
+ L `,",",`
443
+ A `,",",",0,0,",",",","," Z"])),e,t+c*y,y,y,p,e+u*y,t,e+n-u*y,t,y,y,p,e+n,t+c*y,e+n,t+r-c*y,y,y,p,e+n-u*y,t+r,e+u*y,t+r,y,y,p,e,t+r-c*y)}else d=Dn(_C||(_C=bi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},BC={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yM=e=>{var t=dn(e,BC),n=h.useRef(null),r=h.useState(-1),i=iY(r,2),a=i[0],s=i[1];h.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var N=n.current.getTotalLength();N&&s(N)}catch{}},[]);var l=t.x,c=t.y,u=t.width,p=t.height,d=t.radius,f=t.className,m=t.animationEasing,g=t.animationDuration,v=t.animationBegin,x=t.isAnimationActive,y=t.isUpdateAnimationActive,b=h.useRef(u),w=h.useRef(p),j=h.useRef(l),k=h.useRef(c),S=h.useMemo(()=>({x:l,y:c,width:u,height:p,radius:d}),[l,c,u,p,d]),A=gM(S,"rectangle-");if(l!==+l||c!==+c||u!==+u||p!==+p||u===0||p===0)return null;var T=mt("recharts-rectangle",f);if(!y){var D=yr(t);D.radius;var O=LC(D,Zq);return h.createElement("path",Uf({},O,{x:oa(l),y:oa(c),width:oa(u),height:oa(p),radius:typeof d=="number"?d:void 0,className:T,d:$C(l,c,u,p,d)}))}var _=b.current,R=w.current,X=j.current,V=k.current,I="0px ".concat(a===-1?1:a,"px"),$="".concat(a,"px ").concat(a,"px"),H=Qq(["strokeDasharray"],g,typeof m=="string"?m:BC.animationEasing);return h.createElement(mM,{animationId:A,key:A,canBegin:a>0,duration:g,easing:m,isActive:y,begin:v},N=>{var W=It(_,u,N),P=It(R,p,N),U=It(X,l,N),le=It(V,c,N);n.current&&(b.current=W,w.current=P,j.current=U,k.current=le);var E;x?N>0?E={transition:H,strokeDasharray:$}:E={strokeDasharray:I}:E={strokeDasharray:$};var he=yr(t);he.radius;var ye=LC(he,Jq);return h.createElement("path",Uf({},ye,{radius:typeof d=="number"?d:void 0,className:T,d:$C(U,le,W,P,d),ref:n,style:DC(DC({},E),t.style)}))})};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 UC(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){cY(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 cY(e,t,n){return(t=uY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uY(e){var t=dY(e,"string");return typeof t=="symbol"?t:t+""}function dY(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 Wf=Math.PI/180,pY=e=>e*180/Math.PI,cn=(e,t,n,r)=>({x:e+Math.cos(-Wf*r)*n,y:t+Math.sin(-Wf*r)*n}),vM=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},fY=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},hY=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,s=fY({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:pY(c),angleInRadian:c}},mY=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},gY=(e,t)=>{var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),s=Math.min(i,a);return e+s*360},yY=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=hY({x:n,y:r},t),a=i.radius,s=i.angle,l=t.innerRadius,c=t.outerRadius;if(a<l||a>c||a===0)return null;var u=mY(t),p=u.startAngle,d=u.endAngle,f=s,m;if(p<=d){for(;f>d;)f-=360;for(;f<p;)f+=360;m=f>=p&&f<=d}else{for(;f>p;)f-=360;for(;f<d;)f+=360;m=f>=d&&f<=p}return m?UC(UC({},t),{},{radius:a,angle:gY(f,t)}):null};function xM(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,s=cn(t,n,r,i),l=cn(t,n,r,a);return{points:[s,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var WC,KC,HC,VC,qC,YC,GC;function wx(){return wx=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},wx.apply(null,arguments)}function Fo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var vY=(e,t)=>{var n=Sn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},np=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,s=e.isExternal,l=e.cornerRadius,c=e.cornerIsExternal,u=l*(s?1:-1)+r,p=Math.asin(l/u)/Wf,d=c?i:i+a*p,f=cn(t,n,u,d),m=cn(t,n,r,d),g=c?i-a*p:i,v=cn(t,n,u*Math.cos(p*Wf),g);return{center:f,circleTangency:m,lineTangency:v,theta:p}},bM=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,s=e.endAngle,l=vY(a,s),c=a+l,u=cn(t,n,i,a),p=cn(t,n,i,c),d=Dn(WC||(WC=Fo(["M ",",",`
444
+ A `,",",`,0,
445
+ `,",",`,
446
+ `,",",`
447
+ `])),u.x,u.y,i,i,+(Math.abs(l)>180),+(a>c),p.x,p.y);if(r>0){var f=cn(t,n,r,a),m=cn(t,n,r,c);d+=Dn(KC||(KC=Fo(["L ",",",`
448
+ A `,",",`,0,
449
+ `,",",`,
450
+ `,","," Z"])),m.x,m.y,r,r,+(Math.abs(l)>180),+(a<=c),f.x,f.y)}else d+=Dn(HC||(HC=Fo(["L ",","," Z"])),t,n);return d},xY=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,p=Sn(u-c),d=np({cx:t,cy:n,radius:i,angle:c,sign:p,cornerRadius:a,cornerIsExternal:l}),f=d.circleTangency,m=d.lineTangency,g=d.theta,v=np({cx:t,cy:n,radius:i,angle:u,sign:-p,cornerRadius:a,cornerIsExternal:l}),x=v.circleTangency,y=v.lineTangency,b=v.theta,w=l?Math.abs(c-u):Math.abs(c-u)-g-b;if(w<0)return s?Dn(VC||(VC=Fo(["M ",",",`
451
+ a`,",",",0,0,1,",`,0
452
+ a`,",",",0,0,1,",`,0
453
+ `])),m.x,m.y,a,a,a*2,a,a,-a*2):bM({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var j=Dn(qC||(qC=Fo(["M ",",",`
454
+ A`,",",",0,0,",",",",",`
455
+ A`,",",",0,",",",",",",",`
456
+ A`,",",",0,0,",",",",",`
457
+ `])),m.x,m.y,a,a,+(p<0),f.x,f.y,i,i,+(w>180),+(p<0),x.x,x.y,a,a,+(p<0),y.x,y.y);if(r>0){var k=np({cx:t,cy:n,radius:r,angle:c,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),S=k.circleTangency,A=k.lineTangency,T=k.theta,D=np({cx:t,cy:n,radius:r,angle:u,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),O=D.circleTangency,_=D.lineTangency,R=D.theta,X=l?Math.abs(c-u):Math.abs(c-u)-T-R;if(X<0&&a===0)return"".concat(j,"L").concat(t,",").concat(n,"Z");j+=Dn(YC||(YC=Fo(["L",",",`
458
+ A`,",",",0,0,",",",",",`
459
+ A`,",",",0,",",",",",",",`
460
+ A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(p<0),O.x,O.y,r,r,+(X>180),+(p>0),S.x,S.y,a,a,+(p<0),A.x,A.y)}else j+=Dn(GC||(GC=Fo(["L",",","Z"])),t,n);return j},bY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},wM=e=>{var t=dn(e,bY),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,p=t.endAngle,d=t.className;if(a<i||u===p)return null;var f=mt("recharts-sector",d),m=a-i,g=Vn(s,m,0,!0),v;return g>0&&Math.abs(u-p)<360?v=xY({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,m/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:p}):v=bM({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:p}),h.createElement("path",wx({},yr(t),{className:f,d:v}))};function wY(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(HO(t)){if(e==="centric"){var r=t.cx,i=t.cy,a=t.innerRadius,s=t.outerRadius,l=t.angle,c=cn(r,i,a,l),u=cn(r,i,s,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return xM(t)}}function jY(e){return dN(e)?NaN:Number(e)}function ay(e){return e?(e=jY(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function jM(e,t,n){n&&typeof n!="number"&&ex(e,t,n)&&(t=n=void 0),e=ay(e),t===void 0?(t=e,e=0):t=ay(t),n=n===void 0?e<t?1:-1:ay(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 mi=e=>e.chartData,od=G([mi],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),sd=(e,t,n,r)=>r?od(e):mi(e),SM=(e,t,n)=>n?od(e):mi(e),SY=G([sd],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]}),kY=G([od],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]}),CY=G([mi],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});function $b(e,t){return TY(e)||EY(e,t)||AY(e,t)||PY()}function PY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
461
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AY(e,t){if(e){if(typeof e=="string")return XC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XC(e,t):void 0}}function XC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function EY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function TY(e){if(Array.isArray(e))return e}function Li(e){if(Array.isArray(e)&&e.length===2){var t=$b(e,2),n=t[0],r=t[1];if(et(n)&&et(r))return!0}return!1}function QC(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function kM(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var n=$b(e,2),r=n[0],i=n[1],a,s;if(et(r))a=r;else if(typeof r=="function")return;if(et(i))s=i;else if(typeof i=="function")return;var l=[a,s];if(Li(l))return l}}function IY(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Li(r))return QC(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=$b(e,2),a=i[0],s=i[1],l,c;if(a==="auto")t!=null&&(l=Math.min(...t));else if(Ce(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t==null?void 0:t[0]))}catch{}else if(typeof a=="string"&&Uk.test(a)){var u=Uk.exec(a);if(u==null||u[1]==null||t==null)l=void 0;else{var p=+u[1];l=t[0]-p}}else l=t==null?void 0:t[0];if(s==="auto")t!=null&&(c=Math.max(...t));else if(Ce(s))c=s;else if(typeof s=="function")try{t!=null&&(c=s(t==null?void 0:t[1]))}catch{}else if(typeof s=="string"&&Wk.test(s)){var d=Wk.exec(s);if(d==null||d[1]==null||t==null)c=void 0;else{var f=+d[1];c=t[1]+f}}else c=t==null?void 0:t[1];var m=[l,c];if(Li(m))return t==null?m:QC(m,t,n)}}}var Yl=1e9,OY={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Fb,Ft=!0,Yr="[DecimalError] ",Jo=Yr+"Invalid argument: ",Bb=Yr+"Exponent out of range: ",Gl=Math.floor,No=Math.pow,NY=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,jr,wn=1e7,Dt=7,CM=9007199254740991,Kf=Gl(CM/Dt),Me={};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Me.comparedTo=Me.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};Me.decimalPlaces=Me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Dt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Me.dividedBy=Me.div=function(e){return ua(this,new this.constructor(e))};Me.dividedToIntegerBy=Me.idiv=function(e){var t=this,n=t.constructor;return Pt(ua(t,new n(e),0,1),n.precision)};Me.equals=Me.eq=function(e){return!this.cmp(e)};Me.exponent=function(){return un(this)};Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0};Me.greaterThanOrEqualTo=Me.gte=function(e){return this.cmp(e)>=0};Me.isInteger=Me.isint=function(){return this.e>this.d.length-2};Me.isNegative=Me.isneg=function(){return this.s<0};Me.isPositive=Me.ispos=function(){return this.s>0};Me.isZero=function(){return this.s===0};Me.lessThan=Me.lt=function(e){return this.cmp(e)<0};Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1};Me.logarithm=Me.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(jr))throw Error(Yr+"NaN");if(n.s<1)throw Error(Yr+(n.s?"NaN":"-Infinity"));return n.eq(jr)?new r(0):(Ft=!1,t=ua(Iu(n,a),Iu(e,a),a),Ft=!0,Pt(t,i))};Me.minus=Me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?EM(t,e):PM(t,(e.s=-e.s,e))};Me.modulo=Me.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Yr+"NaN");return n.s?(Ft=!1,t=ua(n,e,0,1).times(e),Ft=!0,n.minus(t)):Pt(new r(n),i)};Me.naturalExponential=Me.exp=function(){return AM(this)};Me.naturalLogarithm=Me.ln=function(){return Iu(this)};Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Me.plus=Me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?PM(t,e):EM(t,(e.s=-e.s,e))};Me.precision=Me.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Jo+e);if(t=un(i)+1,r=i.d.length-1,n=r*Dt+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};Me.squareRoot=Me.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(Yr+"NaN")}for(e=un(l),Ft=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=_i(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Gl((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(ua(l,a,s+2)).times(.5),_i(a.d).slice(0,s)===(t=_i(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(Pt(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;s+=4}return Ft=!0,Pt(r,n)};Me.times=Me.mul=function(e){var t,n,r,i,a,s,l,c,u,p=this,d=p.constructor,f=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=f.length,u=m.length,c<u&&(a=f,f=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]*f[i-r-1]+t,a[i--]=l%wn|0,t=l/wn|0;a[i]=(a[i]+t)%wn|0}for(;!a[--s];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Ft?Pt(e,d.precision):e};Me.toDecimalPlaces=Me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Wi(e,0,Yl),t===void 0?t=r.rounding:Wi(t,0,8),Pt(n,e+un(n)+1,t))};Me.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=hs(r,!0):(Wi(e,0,Yl),t===void 0?t=i.rounding:Wi(t,0,8),r=Pt(new i(r),e+1,t),n=hs(r,!0,e+1)),n};Me.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?hs(i):(Wi(e,0,Yl),t===void 0?t=a.rounding:Wi(t,0,8),r=Pt(new a(i),e+un(i)+1,t),n=hs(r.abs(),!1,e+un(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Me.toInteger=Me.toint=function(){var e=this,t=e.constructor;return Pt(new t(e),un(e)+1,t.rounding)};Me.toNumber=function(){return+this};Me.toPower=Me.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(jr);if(l=new c(l),!l.s){if(e.s<1)throw Error(Yr+"Infinity");return l}if(l.eq(jr))return l;if(r=c.precision,e.eq(jr))return Pt(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,a=l.s,s){if((n=p<0?-p:p)<=CM){for(i=new c(jr),t=Math.ceil(r/Dt+4),Ft=!1;n%2&&(i=i.times(l),JC(i.d,t)),n=Gl(n/2),n!==0;)l=l.times(l),JC(l.d,t);return Ft=!0,e.s<0?new c(jr).div(i):Pt(i,r)}}else if(a<0)throw Error(Yr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Ft=!1,i=e.times(Iu(l,r+u)),Ft=!0,i=AM(i),i.s=a,i};Me.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=un(i),r=hs(i,n<=a.toExpNeg||n>=a.toExpPos)):(Wi(e,1,Yl),t===void 0?t=a.rounding:Wi(t,0,8),i=Pt(new a(i),e,t),n=un(i),r=hs(i,e<=n||n<=a.toExpNeg,e)),r};Me.toSignificantDigits=Me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Wi(e,1,Yl),t===void 0?t=r.rounding:Wi(t,0,8)),Pt(new r(n),e,t)};Me.toString=Me.valueOf=Me.val=Me.toJSON=Me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=un(e),n=e.constructor;return hs(e,t<=n.toExpNeg||t>=n.toExpPos)};function PM(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)),Ft?Pt(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/Dt),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)/wn|0,c[a]%=wn;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Ft?Pt(t,d):t}function Wi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Jo+e)}function _i(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=Dt-r.length,n&&(a+=za(n)),a+=r;s=e[t],r=s+"",n=Dt-r.length,n&&(a+=za(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var ua=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%wn|0,s=a/wn|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*wn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,s){var l,c,u,p,d,f,m,g,v,x,y,b,w,j,k,S,A,T,D=r.constructor,O=r.s==i.s?1:-1,_=r.d,R=i.d;if(!r.s)return new D(r);if(!i.s)throw Error(Yr+"Division by zero");for(c=r.e-i.e,A=R.length,k=_.length,m=new D(O),g=m.d=[],u=0;R[u]==(_[u]||0);)++u;if(R[u]>(_[u]||0)&&--c,a==null?b=a=D.precision:s?b=a+(un(r)-un(i))+1:b=a,b<0)return new D(0);if(b=b/Dt+2|0,u=0,A==1)for(p=0,R=R[0],b++;(u<k||p)&&b--;u++)w=p*wn+(_[u]||0),g[u]=w/R|0,p=w%R|0;else{for(p=wn/(R[0]+1)|0,p>1&&(R=e(R,p),_=e(_,p),A=R.length,k=_.length),j=A,v=_.slice(0,A),x=v.length;x<A;)v[x++]=0;T=R.slice(),T.unshift(0),S=R[0],R[1]>=wn/2&&++S;do p=0,l=t(R,v,A,x),l<0?(y=v[0],A!=x&&(y=y*wn+(v[1]||0)),p=y/S|0,p>1?(p>=wn&&(p=wn-1),d=e(R,p),f=d.length,x=v.length,l=t(d,v,f,x),l==1&&(p--,n(d,A<f?T:R,f))):(p==0&&(l=p=1),d=R.slice()),f=d.length,f<x&&d.unshift(0),n(v,d,x),l==-1&&(x=v.length,l=t(R,v,A,x),l<1&&(p++,n(v,A<x?T:R,x))),x=v.length):l===0&&(p++,v=[0]),g[u++]=p,l&&v[0]?v[x++]=_[j]||0:(v=[_[j]],x=1);while((j++<k||v[0]!==void 0)&&b--)}return g[0]||g.shift(),m.e=c,Pt(m,s?a+un(m)+1:a)}}();function AM(e,t){var n,r,i,a,s,l,c=0,u=0,p=e.constructor,d=p.precision;if(un(e)>16)throw Error(Bb+un(e));if(!e.s)return new p(jr);for(Ft=!1,l=d,s=new p(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(No(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new p(jr),p.precision=l;;){if(i=Pt(i.times(e),l),n=n.times(++c),s=a.plus(ua(i,n,l)),_i(s.d).slice(0,l)===_i(a.d).slice(0,l)){for(;u--;)a=Pt(a.times(a),l);return p.precision=d,t==null?(Ft=!0,Pt(a,d)):a}a=s}}function un(e){for(var t=e.e*Dt,n=e.d[0];n>=10;n/=10)t++;return t}function oy(e,t,n){if(t>e.LN10.sd())throw Ft=!0,n&&(e.precision=n),Error(Yr+"LN10 precision limit exceeded");return Pt(new e(e.LN10),t)}function za(e){for(var t="";e--;)t+="0";return t}function Iu(e,t){var n,r,i,a,s,l,c,u,p,d=1,f=10,m=e,g=m.d,v=m.constructor,x=v.precision;if(m.s<1)throw Error(Yr+(m.s?"NaN":"-Infinity"));if(m.eq(jr))return new v(0);if(t==null?(Ft=!1,u=x):u=t,m.eq(10))return t==null&&(Ft=!0),oy(v,u);if(u+=f,v.precision=u,n=_i(g),r=n.charAt(0),a=un(m),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=_i(m.d),r=n.charAt(0),d++;a=un(m),r>1?(m=new v("0."+n),a++):m=new v(r+"."+n.slice(1))}else return c=oy(v,u+2,x).times(a+""),m=Iu(new v(r+"."+n.slice(1)),u-f).plus(c),v.precision=x,t==null?(Ft=!0,Pt(m,x)):m;for(l=s=m=ua(m.minus(jr),m.plus(jr),u),p=Pt(m.times(m),u),i=3;;){if(s=Pt(s.times(p),u),c=l.plus(ua(s,new v(i),u)),_i(c.d).slice(0,u)===_i(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(oy(v,u+2,x).times(a+""))),l=ua(l,new v(d),u),v.precision=x,t==null?(Ft=!0,Pt(l,x)):l;l=c,i+=2}}function ZC(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=Gl(n/Dt),e.d=[],r=(n+1)%Dt,n<0&&(r+=Dt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Dt;r<i;)e.d.push(+t.slice(r,r+=Dt));t=t.slice(r),r=Dt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Ft&&(e.e>Kf||e.e<-Kf))throw Error(Bb+n)}else e.s=0,e.e=0,e.d=[0];return e}function Pt(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+=Dt,i=t,u=d[p=0];else{if(p=Math.ceil((r+1)/Dt),a=d.length,p>=a)return e;for(u=a=d[p],s=1;a>=10;a/=10)s++;r%=Dt,i=r-Dt+s}if(n!==void 0&&(a=No(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/No(10,s-i):0:d[p-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=un(e),d.length=1,t=t-a-1,d[0]=No(10,(Dt-t%Dt)%Dt),e.e=Gl(-t/Dt)||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=No(10,Dt-r),d[p]=i>0?(u/No(10,s-i)%No(10,i)|0)*a:0),c)for(;;)if(p==0){(d[0]+=a)==wn&&(d[0]=1,++e.e);break}else{if(d[p]+=a,d[p]!=wn)break;d[p--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if(Ft&&(e.e>Kf||e.e<-Kf))throw Error(Bb+un(e));return e}function EM(e,t){var n,r,i,a,s,l,c,u,p,d,f=e.constructor,m=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),Ft?Pt(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/Dt),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]=wn-1;--c[a],c[i]+=wn}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,Ft?Pt(t,m):t):new f(0)}function hs(e,t,n){var r,i=un(e),a=_i(e.d),s=a.length;return t?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+za(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+za(-i-1)+a,n&&(r=n-s)>0&&(a+=za(r))):i>=s?(a+=za(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+za(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=za(r))),e.s<0?"-"+a:a}function JC(e,t){if(e.length>t)return e.length=t,!0}function TM(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(Jo+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 ZC(s,a.toString())}else if(typeof a!="string")throw Error(Jo+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,NY.test(a))ZC(s,a);else throw Error(Jo+a)}if(i.prototype=Me,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=TM,i.config=i.set=MY,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 MY(e){if(!e||typeof e!="object")throw Error(Yr+"Object expected");var t,n,r,i=["precision",1,Yl,"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(Gl(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Jo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Jo+n+": "+r);return this}var Fb=TM(OY);jr=new Fb(1);const lt=Fb;function IM(e){var t;return e===0?t=1:t=Math.floor(new lt(e).abs().log(10).toNumber())+1,t}function OM(e,t,n){for(var r=new lt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function Ou(e,t){return LY(e)||DY(e,t)||RY(e,t)||_Y()}function _Y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
462
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RY(e,t){if(e){if(typeof e=="string")return eP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eP(e,t):void 0}}function eP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function DY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function LY(e){if(Array.isArray(e))return e}var NM=e=>{var t=Ou(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},Ub=(e,t,n)=>{if(e.lte(0))return new lt(0);var r=IM(e.toNumber()),i=new lt(10).pow(r),a=e.div(i),s=r!==1?.05:.1,l=new lt(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=l.mul(i);return t?new lt(c.toNumber()):new lt(Math.ceil(c.toNumber()))},MM=(e,t,n)=>{var r;if(e.lte(0))return new lt(0);var i=[1,2,2.5,5],a=e.toNumber(),s=Math.floor(new lt(a).abs().log(10).toNumber()),l=new lt(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 lt(10).pow(p))}var d=(r=i[u])!==null&&r!==void 0?r:1,f=new lt(d).mul(l);return t?f:new lt(Math.ceil(f.toNumber()))},zY=(e,t,n)=>{var r=new lt(1),i=new lt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new lt(10).pow(IM(e)-1),i=new lt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new lt(Math.floor(e)))}else e===0?i=new lt(Math.floor((t-1)/2)):n||(i=new lt(Math.floor(e)));for(var s=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new lt(c-s).mul(r)).toNumber());return l},_M=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]:Ub;if(!Number.isFinite((n-t)/(r-1)))return{step:new lt(0),tickMin:new lt(0),tickMax:new lt(0)};var l=s(new lt(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new lt(0):(c=new lt(t).add(n).div(2),c=c.sub(new lt(c).mod(l)));var u=Math.ceil(c.sub(t).div(l).toNumber()),p=Math.ceil(new lt(n).sub(c).div(l).toNumber()),d=u+p+1;return d>r?_M(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 lt(u).mul(l)),tickMax:c.add(new lt(p).mul(l))})},tP=function(t){var n=Ou(t,2),r=n[0],i=n[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(a,2),u=NM([r,i]),p=Ou(u,2),d=p[0],f=p[1];if(d===-1/0||f===1/0){var m=f===1/0?[d,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),f];return r>i?m.reverse():m}if(d===f)return zY(d,a,s);var g=l==="snap125"?MM:Ub,v=_M(d,f,c,s,0,g),x=v.step,y=v.tickMin,b=v.tickMax,w=OM(y,b.add(new lt(.1).mul(x)),x);return r>i?w.reverse():w},nP=function(t,n){var r=Ou(t,2),i=r[0],a=r[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=NM([i,a]),u=Ou(c,2),p=u[0],d=u[1];if(p===-1/0||d===1/0)return[i,a];if(p===d)return[p];var f=l==="snap125"?MM:Ub,m=Math.max(n,2),g=f(new lt(d).sub(p).div(m-1),s,0),v=[...OM(new lt(p),new lt(d),g),d];return s===!1&&(v=v.map(x=>Math.round(x))),i>a?v.reverse():v},RM=e=>e.rootProps.maxBarSize,$Y=e=>e.rootProps.barGap,DM=e=>e.rootProps.barCategoryGap,BY=e=>e.rootProps.barSize,ld=e=>e.rootProps.stackOffset,LM=e=>e.rootProps.reverseStackOrder,Wb=e=>e.options.chartName,Kb=e=>e.rootProps.syncId,zM=e=>e.rootProps.syncMethod,Hb=e=>e.options.eventEmitter,FY=e=>e.rootProps.baseValue,rn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},jo={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},wi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},hm=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function mm(e,t,n){if(n!=="auto")return n;if(e!=null)return hi(e,t)?"category":"number"}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 Hf(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){UY(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 UY(e,t,n){return(t=WY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WY(e){var t=KY(e,"string");return typeof t=="symbol"?t:t+""}function KY(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 iP={allowDataOverflow:jo.allowDataOverflow,allowDecimals:jo.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:jo.angleAxisId,includeHidden:!1,name:void 0,reversed:jo.reversed,scale:jo.scale,tick:jo.tick,tickCount:void 0,ticks:void 0,type:jo.type,unit:void 0,niceTicks:"auto"},aP={allowDataOverflow:wi.allowDataOverflow,allowDecimals:wi.allowDecimals,allowDuplicatedCategory:wi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:wi.radiusAxisId,includeHidden:wi.includeHidden,name:void 0,reversed:wi.reversed,scale:wi.scale,tick:wi.tick,tickCount:wi.tickCount,ticks:void 0,type:wi.type,unit:void 0,niceTicks:"auto"},HY=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Vb=G([HY,Db],(e,t)=>{var n;if(e!=null)return e;var r=(n=mm(t,"angleAxis",iP.type))!==null&&n!==void 0?n:"category";return Hf(Hf({},iP),{},{type:r})}),VY=(e,t)=>e.polarAxis.radiusAxis[t],qb=G([VY,Db],(e,t)=>{var n;if(e!=null)return e;var r=(n=mm(t,"radiusAxis",aP.type))!==null&&n!==void 0?n:"category";return Hf(Hf({},aP),{},{type:r})}),gm=e=>e.polarOptions,Yb=G([Sa,ka,vn],vM),$M=G([gm,Yb],(e,t)=>{if(e!=null)return Vn(e.innerRadius,t,0)}),BM=G([gm,Yb],(e,t)=>{if(e!=null)return Vn(e.outerRadius,t,t*.8)}),qY=e=>{if(e==null)return[0,0];var t=e.startAngle,n=e.endAngle;return[t,n]},FM=G([gm],qY);G([Vb,FM],hm);var UM=G([Yb,$M,BM],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});G([qb,UM],hm);var WM=G([ct,gm,$M,BM,Sa,ka],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var s=t.cx,l=t.cy,c=t.startAngle,u=t.endAngle;return{cx:Vn(s,i,i/2),cy:Vn(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),Gt=(e,t)=>t,cd=(e,t,n)=>n;function ym(e){return e==null?void 0:e.id}function KM(e,t,n){var r=t.chartData,i=r===void 0?[]:r,a=n.allowDuplicatedCategory,s=n.dataKey,l=new Map;return e.forEach(c=>{var u,p=(u=c.data)!==null&&u!==void 0?u:i;if(!(p==null||p.length===0)){var d=ym(c);p.forEach((f,m)=>{var g=s==null||a?m:String(ht(f,s,null)),v=ht(f,c.dataKey,0),x;l.has(g)?x=l.get(g):x={},Object.assign(x,{[d]:v}),l.set(g,x)})}}),Array.from(l.values())}function vm(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var xm=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function bm(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function YY(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 Pn=e=>{var t=ct(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Xl=e=>e.tooltip.settings.axisId;function Gb(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 HM=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Li(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];et(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 to(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function GY(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Xb(e){let t,n,r;e.length!==2?(t=to,n=(l,c)=>to(e(l),c),r=(l,c)=>e(l)-c):(t=e===to||e===GY?e:XY,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 XY(){return 0}function VM(e){return e===null?NaN:+e}function*QY(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const ZY=Xb(to),ud=ZY.right;Xb(VM).center;class oP extends Map{constructor(t,n=tG){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(sP(this,t))}has(t){return super.has(sP(this,t))}set(t,n){return super.set(JY(this,t),n)}delete(t){return super.delete(eG(this,t))}}function sP({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function JY({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function eG({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function tG(e){return e!==null&&typeof e=="object"?e.valueOf():e}function nG(e=to){if(e===to)return qM;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 qM(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const rG=Math.sqrt(50),iG=Math.sqrt(10),aG=Math.sqrt(2);function Vf(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>=rG?10:a>=iG?5:a>=aG?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?Vf(e,t,n*2):[l,c,u]}function jx(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?Vf(t,e,n):Vf(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 Sx(e,t,n){return t=+t,e=+e,n=+n,Vf(e,t,n)[2]}function kx(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Sx(t,e,n):Sx(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function lP(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function cP(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function YM(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?qM:nG(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),f=.5*Math.sqrt(p*d*(c-d)/c)*(u-c/2<0?-1:1),m=Math.max(n,Math.floor(t-u*d/c+f)),g=Math.min(r,Math.floor(t+(c-u)*d/c+f));YM(e,t,m,g,i)}const a=e[t];let s=n,l=r;for(jc(e,n,t),i(e[r],a)>0&&jc(e,n,r);s<l;){for(jc(e,s,l),++s,--l;i(e[s],a)<0;)++s;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?jc(e,n,l):(++l,jc(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function jc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function oG(e,t,n){if(e=Float64Array.from(QY(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return cP(e);if(t>=1)return lP(e);var r,i=(r-1)*t,a=Math.floor(i),s=lP(YM(e,a).subarray(0,a+1)),l=cP(e.subarray(a+1));return s+(l-s)*(i-a)}}function sG(e,t,n=VM){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 lG(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 Gr(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 Cx=Symbol("implicit");function Qb(){var e=new oP,t=[],n=[],r=Cx;function i(a){let s=e.get(a);if(s===void 0){if(r!==Cx)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 oP;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 Qb(t,n).unknown(r)},Gr.apply(i,arguments),i}function Zb(){var e=Qb().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 f=t().length,m=i<r,g=m?i:r,v=m?r:i;a=(v-g)/Math.max(1,f-c+u*2),l&&(a=Math.floor(a)),g+=(v-g-a*(f-c))*p,s=a*(1-c),l&&(g=Math.round(g),s=Math.round(s));var x=lG(f).map(function(y){return g+a*y});return n(m?x.reverse():x)}return e.domain=function(f){return arguments.length?(t(f),d()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,l=!0,d()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(f){return arguments.length?(l=!!f,d()):l},e.padding=function(f){return arguments.length?(c=Math.min(1,u=+f),d()):c},e.paddingInner=function(f){return arguments.length?(c=Math.min(1,f),d()):c},e.paddingOuter=function(f){return arguments.length?(u=+f,d()):u},e.align=function(f){return arguments.length?(p=Math.max(0,Math.min(1,f)),d()):p},e.copy=function(){return Zb(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(p)},Gr.apply(d(),arguments)}function GM(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return GM(t())},e}function cG(){return GM(Zb.apply(null,arguments).paddingInner(1))}function Jb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function XM(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dd(){}var Nu=.7,qf=1/Nu,vl="\\s*([+-]?\\d+)\\s*",Mu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uG=/^#([0-9a-f]{3,8})$/,dG=new RegExp(`^rgb\\(${vl},${vl},${vl}\\)$`),pG=new RegExp(`^rgb\\(${zi},${zi},${zi}\\)$`),fG=new RegExp(`^rgba\\(${vl},${vl},${vl},${Mu}\\)$`),hG=new RegExp(`^rgba\\(${zi},${zi},${zi},${Mu}\\)$`),mG=new RegExp(`^hsl\\(${Mu},${zi},${zi}\\)$`),gG=new RegExp(`^hsla\\(${Mu},${zi},${zi},${Mu}\\)$`),uP={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};Jb(dd,_u,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dP,formatHex:dP,formatHex8:yG,formatHsl:vG,formatRgb:pP,toString:pP});function dP(){return this.rgb().formatHex()}function yG(){return this.rgb().formatHex8()}function vG(){return QM(this).formatHsl()}function pP(){return this.rgb().formatRgb()}function _u(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=uG.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?fP(t):n===3?new pr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rp(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=dG.exec(e))?new pr(t[1],t[2],t[3],1):(t=pG.exec(e))?new pr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=fG.exec(e))?rp(t[1],t[2],t[3],t[4]):(t=hG.exec(e))?rp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mG.exec(e))?gP(t[1],t[2]/100,t[3]/100,1):(t=gG.exec(e))?gP(t[1],t[2]/100,t[3]/100,t[4]):uP.hasOwnProperty(e)?fP(uP[e]):e==="transparent"?new pr(NaN,NaN,NaN,0):null}function fP(e){return new pr(e>>16&255,e>>8&255,e&255,1)}function rp(e,t,n,r){return r<=0&&(e=t=n=NaN),new pr(e,t,n,r)}function xG(e){return e instanceof dd||(e=_u(e)),e?(e=e.rgb(),new pr(e.r,e.g,e.b,e.opacity)):new pr}function Px(e,t,n,r){return arguments.length===1?xG(e):new pr(e,t,n,r??1)}function pr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Jb(pr,Px,XM(dd,{brighter(e){return e=e==null?qf:Math.pow(qf,e),new pr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nu:Math.pow(Nu,e),new pr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pr(es(this.r),es(this.g),es(this.b),Yf(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:hP,formatHex:hP,formatHex8:bG,formatRgb:mP,toString:mP}));function hP(){return`#${Uo(this.r)}${Uo(this.g)}${Uo(this.b)}`}function bG(){return`#${Uo(this.r)}${Uo(this.g)}${Uo(this.b)}${Uo((isNaN(this.opacity)?1:this.opacity)*255)}`}function mP(){const e=Yf(this.opacity);return`${e===1?"rgb(":"rgba("}${es(this.r)}, ${es(this.g)}, ${es(this.b)}${e===1?")":`, ${e})`}`}function Yf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function es(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Uo(e){return e=es(e),(e<16?"0":"")+e.toString(16)}function gP(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new si(e,t,n,r)}function QM(e){if(e instanceof si)return new si(e.h,e.s,e.l,e.opacity);if(e instanceof dd||(e=_u(e)),!e)return new si;if(e instanceof si)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 si(s,l,c,e.opacity)}function wG(e,t,n,r){return arguments.length===1?QM(e):new si(e,t,n,r??1)}function si(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jb(si,wG,XM(dd,{brighter(e){return e=e==null?qf:Math.pow(qf,e),new si(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nu:Math.pow(Nu,e),new si(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 pr(sy(e>=240?e-240:e+120,i,r),sy(e,i,r),sy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new si(yP(this.h),ip(this.s),ip(this.l),Yf(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=Yf(this.opacity);return`${e===1?"hsl(":"hsla("}${yP(this.h)}, ${ip(this.s)*100}%, ${ip(this.l)*100}%${e===1?")":`, ${e})`}`}}));function yP(e){return e=(e||0)%360,e<0?e+360:e}function ip(e){return Math.max(0,Math.min(1,e||0))}function sy(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 e1=e=>()=>e;function jG(e,t){return function(n){return e+n*t}}function SG(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 kG(e){return(e=+e)==1?ZM:function(t,n){return n-t?SG(t,n,e):e1(isNaN(t)?n:t)}}function ZM(e,t){var n=t-e;return n?jG(e,n):e1(isNaN(e)?t:e)}const vP=function e(t){var n=kG(t);function r(i,a){var s=n((i=Px(i)).r,(a=Px(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=ZM(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 CG(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 PG(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function AG(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]=Ql(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 EG(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Gf(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function TG(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]=Ql(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Ax=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ly=new RegExp(Ax.source,"g");function IG(e){return function(){return e}}function OG(e){return function(t){return e(t)+""}}function NG(e,t){var n=Ax.lastIndex=ly.lastIndex=0,r,i,a,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=Ax.exec(e))&&(i=ly.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:Gf(r,i)})),n=ly.lastIndex;return n<t.length&&(a=t.slice(n),l[s]?l[s]+=a:l[++s]=a),l.length<2?c[0]?OG(c[0].x):IG(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 Ql(e,t){var n=typeof t,r;return t==null||n==="boolean"?e1(t):(n==="number"?Gf:n==="string"?(r=_u(t))?(t=r,vP):NG:t instanceof _u?vP:t instanceof Date?EG:PG(t)?CG:Array.isArray(t)?AG:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?TG:Gf)(e,t)}function t1(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function MG(e,t){t===void 0&&(t=e,e=Ql);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 _G(e){return function(){return e}}function Xf(e){return+e}var xP=[0,1];function er(e){return e}function Ex(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:_G(isNaN(t)?NaN:.5)}function RG(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function DG(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=Ex(i,r),a=n(s,a)):(r=Ex(r,i),a=n(a,s)),function(l){return a(r(l))}}function LG(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]=Ex(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(l){var c=ud(e,l,1,r)-1;return a[c](i[c](l))}}function pd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function wm(){var e=xP,t=xP,n=Ql,r,i,a,s=er,l,c,u;function p(){var f=Math.min(e.length,t.length);return s!==er&&(s=RG(e[0],e[f-1])),l=f>2?LG:DG,c=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(c||(c=l(e.map(r),t,n)))(r(s(f)))}return d.invert=function(f){return s(i((u||(u=l(t,e.map(r),Gf)))(f)))},d.domain=function(f){return arguments.length?(e=Array.from(f,Xf),p()):e.slice()},d.range=function(f){return arguments.length?(t=Array.from(f),p()):t.slice()},d.rangeRound=function(f){return t=Array.from(f),n=t1,p()},d.clamp=function(f){return arguments.length?(s=f?!0:er,p()):s!==er},d.interpolate=function(f){return arguments.length?(n=f,p()):n},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,m){return r=f,i=m,p()}}function n1(){return wm()(er,er)}function zG(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qf(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 _l(e){return e=Qf(Math.abs(e)),e?e[1]:NaN}function $G(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 BG(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var FG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ru(e){if(!(t=FG.exec(e)))throw new Error("invalid format: "+e);var t;return new r1({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]})}Ru.prototype=r1.prototype;function r1(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+""}r1.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 UG(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 Zf;function WG(e,t){var n=Qf(e,t);if(!n)return Zf=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Zf=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")+Qf(e,Math.max(0,t+a-1))[0]}function bP(e,t){var n=Qf(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 wP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:zG,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)=>bP(e*100,t),r:bP,s:WG,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function jP(e){return e}var SP=Array.prototype.map,kP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function KG(e){var t=e.grouping===void 0||e.thousands===void 0?jP:$G(SP.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?jP:BG(SP.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,f){d=Ru(d);var m=d.fill,g=d.align,v=d.sign,x=d.symbol,y=d.zero,b=d.width,w=d.comma,j=d.precision,k=d.trim,S=d.type;S==="n"?(w=!0,S="g"):wP[S]||(j===void 0&&(j=12),k=!0,S="g"),(y||m==="0"&&g==="=")&&(y=!0,m="0",g="=");var A=(f&&f.prefix!==void 0?f.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),T=(x==="$"?r:/[%p]/.test(S)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),D=wP[S],O=/[defgprs%]/.test(S);j=j===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function _(R){var X=A,V=T,I,$,H;if(S==="c")V=D(R)+V,R="";else{R=+R;var N=R<0||1/R<0;if(R=isNaN(R)?c:D(Math.abs(R),j),k&&(R=UG(R)),N&&+R==0&&v!=="+"&&(N=!1),X=(N?v==="("?v:l:v==="-"||v==="("?"":v)+X,V=(S==="s"&&!isNaN(R)&&Zf!==void 0?kP[8+Zf/3]:"")+V+(N&&v==="("?")":""),O){for(I=-1,$=R.length;++I<$;)if(H=R.charCodeAt(I),48>H||H>57){V=(H===46?i+R.slice(I+1):R.slice(I))+V,R=R.slice(0,I);break}}}w&&!y&&(R=t(R,1/0));var W=X.length+R.length+V.length,P=W<b?new Array(b-W+1).join(m):"";switch(w&&y&&(R=t(P+R,P.length?b-V.length:1/0),P=""),g){case"<":R=X+R+V+P;break;case"=":R=X+P+R+V;break;case"^":R=P.slice(0,W=P.length>>1)+X+R+V+P.slice(W);break;default:R=P+X+R+V;break}return a(R)}return _.toString=function(){return d+""},_}function p(d,f){var m=Math.max(-8,Math.min(8,Math.floor(_l(f)/3)))*3,g=Math.pow(10,-m),v=u((d=Ru(d),d.type="f",d),{suffix:kP[8+m/3]});return function(x){return v(g*x)}}return{format:u,formatPrefix:p}}var ap,i1,JM;HG({thousands:",",grouping:[3],currency:["$",""]});function HG(e){return ap=KG(e),i1=ap.format,JM=ap.formatPrefix,ap}function VG(e){return Math.max(0,-_l(Math.abs(e)))}function qG(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(_l(t)/3)))*3-_l(Math.abs(e)))}function YG(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_l(t)-_l(e))+1}function e_(e,t,n,r){var i=kx(e,t,n),a;switch(r=Ru(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=qG(i,s))&&(r.precision=a),JM(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=YG(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=VG(i))&&(r.precision=a-(r.type==="%")*2);break}}return i1(r)}function go(e){var t=e.domain;return e.ticks=function(n){var r=t();return jx(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return e_(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=Sx(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 t_(){var e=n1();return e.copy=function(){return pd(e,t_())},Gr.apply(e,arguments),go(e)}function n_(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,Xf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return n_(e).unknown(t)},e=arguments.length?Array.from(e,Xf):[0,1],go(n)}function r_(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 CP(e){return Math.log(e)}function PP(e){return Math.exp(e)}function GG(e){return-Math.log(-e)}function XG(e){return-Math.exp(-e)}function QG(e){return isFinite(e)?+("1e"+e):e<0?0:e}function ZG(e){return e===10?QG:e===Math.E?Math.exp:t=>Math.pow(e,t)}function JG(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 AP(e){return(t,n)=>-e(-t,n)}function a1(e){const t=e(CP,PP),n=t.domain;let r=10,i,a;function s(){return i=JG(r),a=ZG(r),n()[0]<0?(i=AP(i),a=AP(a),e(GG,XG)):e(CP,PP),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 f=i(u),m=i(p),g,v;const x=l==null?10:+l;let y=[];if(!(r%1)&&m-f<x){if(f=Math.floor(f),m=Math.ceil(m),u>0){for(;f<=m;++f)for(g=1;g<r;++g)if(v=f<0?g/a(-f):g*a(f),!(v<u)){if(v>p)break;y.push(v)}}else for(;f<=m;++f)for(g=r-1;g>=1;--g)if(v=f>0?g/a(-f):g*a(f),!(v<u)){if(v>p)break;y.push(v)}y.length*2<x&&(y=jx(u,p,x))}else y=jx(f,m,Math.min(m-f,x)).map(a);return d?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Ru(c)).precision==null&&(c.trim=!0),c=i1(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(r_(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function i_(){const e=a1(wm()).domain([1,10]);return e.copy=()=>pd(e,i_()).base(e.base()),Gr.apply(e,arguments),e}function EP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function TP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function o1(e){var t=1,n=e(EP(t),TP(t));return n.constant=function(r){return arguments.length?e(EP(t=+r),TP(t)):t},go(n)}function a_(){var e=o1(wm());return e.copy=function(){return pd(e,a_()).constant(e.constant())},Gr.apply(e,arguments)}function IP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function eX(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function tX(e){return e<0?-e*e:e*e}function s1(e){var t=e(er,er),n=1;function r(){return n===1?e(er,er):n===.5?e(eX,tX):e(IP(n),IP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},go(t)}function l1(){var e=s1(wm());return e.copy=function(){return pd(e,l1()).exponent(e.exponent())},Gr.apply(e,arguments),e}function nX(){return l1.apply(null,arguments).exponent(.5)}function OP(e){return Math.sign(e)*e*e}function rX(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function o_(){var e=n1(),t=[0,1],n=!1,r;function i(a){var s=rX(e(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return e.invert(OP(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,Xf)).map(OP)),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 o_(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Gr.apply(i,arguments),go(i)}function s_(){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]=sG(e,s/l);return a}function a(s){return s==null||isNaN(s=+s)?r:t[ud(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(to),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 s_().domain(e).range(t).unknown(r)},Gr.apply(a,arguments)}function l_(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[ud(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 l_().domain([e,t]).range(i).unknown(a)},Gr.apply(go(s),arguments)}function c_(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[ud(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 c_().domain(e).range(t).unknown(n)},Gr.apply(i,arguments)}const cy=new Date,uy=new Date;function xn(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=>xn(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)=>(cy.setTime(+a),uy.setTime(+s),e(cy),e(uy),Math.floor(n(cy,uy))),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 Jf=xn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Jf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?xn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Jf);Jf.range;const sa=1e3,Kr=sa*60,la=Kr*60,ya=la*24,c1=ya*7,NP=ya*30,dy=ya*365,Wo=xn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*sa)},(e,t)=>(t-e)/sa,e=>e.getUTCSeconds());Wo.range;const u1=xn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sa)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getMinutes());u1.range;const d1=xn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getUTCMinutes());d1.range;const p1=xn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sa-e.getMinutes()*Kr)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getHours());p1.range;const f1=xn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getUTCHours());f1.range;const fd=xn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Kr)/ya,e=>e.getDate()-1);fd.range;const jm=xn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ya,e=>e.getUTCDate()-1);jm.range;const u_=xn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ya,e=>Math.floor(e/ya));u_.range;function Ss(e){return xn(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())*Kr)/c1)}const Sm=Ss(0),eh=Ss(1),iX=Ss(2),aX=Ss(3),Rl=Ss(4),oX=Ss(5),sX=Ss(6);Sm.range;eh.range;iX.range;aX.range;Rl.range;oX.range;sX.range;function ks(e){return xn(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)/c1)}const km=ks(0),th=ks(1),lX=ks(2),cX=ks(3),Dl=ks(4),uX=ks(5),dX=ks(6);km.range;th.range;lX.range;cX.range;Dl.range;uX.range;dX.range;const h1=xn(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());h1.range;const m1=xn(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());m1.range;const va=xn(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());va.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xn(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)});va.range;const xa=xn(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());xa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xn(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)});xa.range;function d_(e,t,n,r,i,a){const s=[[Wo,1,sa],[Wo,5,5*sa],[Wo,15,15*sa],[Wo,30,30*sa],[a,1,Kr],[a,5,5*Kr],[a,15,15*Kr],[a,30,30*Kr],[i,1,la],[i,3,3*la],[i,6,6*la],[i,12,12*la],[r,1,ya],[r,2,2*ya],[n,1,c1],[t,1,NP],[t,3,3*NP],[e,1,dy]];function l(u,p,d){const f=p<u;f&&([u,p]=[p,u]);const m=d&&typeof d.range=="function"?d:c(u,p,d),g=m?m.range(u,+p+1):[];return f?g.reverse():g}function c(u,p,d){const f=Math.abs(p-u)/d,m=Xb(([,,x])=>x).right(s,f);if(m===s.length)return e.every(kx(u/dy,p/dy,d));if(m===0)return Jf.every(Math.max(kx(u,p,d),1));const[g,v]=s[f/s[m-1][2]<s[m][2]/f?m-1:m];return g.every(v)}return[l,c]}const[pX,fX]=d_(xa,m1,km,u_,f1,d1),[hX,mX]=d_(va,h1,Sm,fd,p1,u1);function py(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 fy(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 Sc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function gX(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=kc(i),p=Cc(i),d=kc(a),f=Cc(a),m=kc(s),g=Cc(s),v=kc(l),x=Cc(l),y=kc(c),b=Cc(c),w={a:H,A:N,b:W,B:P,c:null,d:zP,e:zP,f:$X,g:GX,G:QX,H:DX,I:LX,j:zX,L:p_,m:BX,M:FX,p:U,q:le,Q:FP,s:UP,S:UX,u:WX,U:KX,V:HX,w:VX,W:qX,x:null,X:null,y:YX,Y:XX,Z:ZX,"%":BP},j={a:E,A:he,b:ye,B:Q,c:null,d:$P,e:$P,f:nQ,g:pQ,G:hQ,H:JX,I:eQ,j:tQ,L:h_,m:rQ,M:iQ,p:ie,q:je,Q:FP,s:UP,S:aQ,u:oQ,U:sQ,V:lQ,w:cQ,W:uQ,x:null,X:null,y:dQ,Y:fQ,Z:mQ,"%":BP},k={a:O,A:_,b:R,B:X,c:V,d:DP,e:DP,f:NX,g:RP,G:_P,H:LP,I:LP,j:EX,L:OX,m:AX,M:TX,p:D,q:PX,Q:_X,s:RX,S:IX,u:wX,U:jX,V:SX,w:bX,W:kX,x:I,X:$,y:RP,Y:_P,Z:CX,"%":MX};w.x=S(n,w),w.X=S(r,w),w.c=S(t,w),j.x=S(n,j),j.X=S(r,j),j.c=S(t,j);function S(Z,re){return function(pe){var se=[],_e=-1,ke=0,ne=Z.length,Le,qe,ze;for(pe instanceof Date||(pe=new Date(+pe));++_e<ne;)Z.charCodeAt(_e)===37&&(se.push(Z.slice(ke,_e)),(qe=MP[Le=Z.charAt(++_e)])!=null?Le=Z.charAt(++_e):qe=Le==="e"?" ":"0",(ze=re[Le])&&(Le=ze(pe,qe)),se.push(Le),ke=_e+1);return se.push(Z.slice(ke,_e)),se.join("")}}function A(Z,re){return function(pe){var se=Sc(1900,void 0,1),_e=T(se,Z,pe+="",0),ke,ne;if(_e!=pe.length)return null;if("Q"in se)return new Date(se.Q);if("s"in se)return new Date(se.s*1e3+("L"in se?se.L:0));if(re&&!("Z"in se)&&(se.Z=0),"p"in se&&(se.H=se.H%12+se.p*12),se.m===void 0&&(se.m="q"in se?se.q:0),"V"in se){if(se.V<1||se.V>53)return null;"w"in se||(se.w=1),"Z"in se?(ke=fy(Sc(se.y,0,1)),ne=ke.getUTCDay(),ke=ne>4||ne===0?th.ceil(ke):th(ke),ke=jm.offset(ke,(se.V-1)*7),se.y=ke.getUTCFullYear(),se.m=ke.getUTCMonth(),se.d=ke.getUTCDate()+(se.w+6)%7):(ke=py(Sc(se.y,0,1)),ne=ke.getDay(),ke=ne>4||ne===0?eh.ceil(ke):eh(ke),ke=fd.offset(ke,(se.V-1)*7),se.y=ke.getFullYear(),se.m=ke.getMonth(),se.d=ke.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),ne="Z"in se?fy(Sc(se.y,0,1)).getUTCDay():py(Sc(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(ne+5)%7:se.w+se.U*7-(ne+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,fy(se)):py(se)}}function T(Z,re,pe,se){for(var _e=0,ke=re.length,ne=pe.length,Le,qe;_e<ke;){if(se>=ne)return-1;if(Le=re.charCodeAt(_e++),Le===37){if(Le=re.charAt(_e++),qe=k[Le in MP?re.charAt(_e++):Le],!qe||(se=qe(Z,pe,se))<0)return-1}else if(Le!=pe.charCodeAt(se++))return-1}return se}function D(Z,re,pe){var se=u.exec(re.slice(pe));return se?(Z.p=p.get(se[0].toLowerCase()),pe+se[0].length):-1}function O(Z,re,pe){var se=m.exec(re.slice(pe));return se?(Z.w=g.get(se[0].toLowerCase()),pe+se[0].length):-1}function _(Z,re,pe){var se=d.exec(re.slice(pe));return se?(Z.w=f.get(se[0].toLowerCase()),pe+se[0].length):-1}function R(Z,re,pe){var se=y.exec(re.slice(pe));return se?(Z.m=b.get(se[0].toLowerCase()),pe+se[0].length):-1}function X(Z,re,pe){var se=v.exec(re.slice(pe));return se?(Z.m=x.get(se[0].toLowerCase()),pe+se[0].length):-1}function V(Z,re,pe){return T(Z,t,re,pe)}function I(Z,re,pe){return T(Z,n,re,pe)}function $(Z,re,pe){return T(Z,r,re,pe)}function H(Z){return s[Z.getDay()]}function N(Z){return a[Z.getDay()]}function W(Z){return c[Z.getMonth()]}function P(Z){return l[Z.getMonth()]}function U(Z){return i[+(Z.getHours()>=12)]}function le(Z){return 1+~~(Z.getMonth()/3)}function E(Z){return s[Z.getUTCDay()]}function he(Z){return a[Z.getUTCDay()]}function ye(Z){return c[Z.getUTCMonth()]}function Q(Z){return l[Z.getUTCMonth()]}function ie(Z){return i[+(Z.getUTCHours()>=12)]}function je(Z){return 1+~~(Z.getUTCMonth()/3)}return{format:function(Z){var re=S(Z+="",w);return re.toString=function(){return Z},re},parse:function(Z){var re=A(Z+="",!1);return re.toString=function(){return Z},re},utcFormat:function(Z){var re=S(Z+="",j);return re.toString=function(){return Z},re},utcParse:function(Z){var re=A(Z+="",!0);return re.toString=function(){return Z},re}}}var MP={"-":"",_:" ",0:"0"},An=/^\s*\d+/,yX=/^%/,vX=/[\\^$*+?|[\]().{}]/g;function gt(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 xX(e){return e.replace(vX,"\\$&")}function kc(e){return new RegExp("^(?:"+e.map(xX).join("|")+")","i")}function Cc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function bX(e,t,n){var r=An.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function wX(e,t,n){var r=An.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function jX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function SX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function _P(e,t,n){var r=An.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function RP(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function CX(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 PX(e,t,n){var r=An.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function AX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function DP(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function EX(e,t,n){var r=An.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function LP(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function TX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function IX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function OX(e,t,n){var r=An.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function NX(e,t,n){var r=An.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function MX(e,t,n){var r=yX.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function _X(e,t,n){var r=An.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function RX(e,t,n){var r=An.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function zP(e,t){return gt(e.getDate(),t,2)}function DX(e,t){return gt(e.getHours(),t,2)}function LX(e,t){return gt(e.getHours()%12||12,t,2)}function zX(e,t){return gt(1+fd.count(va(e),e),t,3)}function p_(e,t){return gt(e.getMilliseconds(),t,3)}function $X(e,t){return p_(e,t)+"000"}function BX(e,t){return gt(e.getMonth()+1,t,2)}function FX(e,t){return gt(e.getMinutes(),t,2)}function UX(e,t){return gt(e.getSeconds(),t,2)}function WX(e){var t=e.getDay();return t===0?7:t}function KX(e,t){return gt(Sm.count(va(e)-1,e),t,2)}function f_(e){var t=e.getDay();return t>=4||t===0?Rl(e):Rl.ceil(e)}function HX(e,t){return e=f_(e),gt(Rl.count(va(e),e)+(va(e).getDay()===4),t,2)}function VX(e){return e.getDay()}function qX(e,t){return gt(eh.count(va(e)-1,e),t,2)}function YX(e,t){return gt(e.getFullYear()%100,t,2)}function GX(e,t){return e=f_(e),gt(e.getFullYear()%100,t,2)}function XX(e,t){return gt(e.getFullYear()%1e4,t,4)}function QX(e,t){var n=e.getDay();return e=n>=4||n===0?Rl(e):Rl.ceil(e),gt(e.getFullYear()%1e4,t,4)}function ZX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+gt(t/60|0,"0",2)+gt(t%60,"0",2)}function $P(e,t){return gt(e.getUTCDate(),t,2)}function JX(e,t){return gt(e.getUTCHours(),t,2)}function eQ(e,t){return gt(e.getUTCHours()%12||12,t,2)}function tQ(e,t){return gt(1+jm.count(xa(e),e),t,3)}function h_(e,t){return gt(e.getUTCMilliseconds(),t,3)}function nQ(e,t){return h_(e,t)+"000"}function rQ(e,t){return gt(e.getUTCMonth()+1,t,2)}function iQ(e,t){return gt(e.getUTCMinutes(),t,2)}function aQ(e,t){return gt(e.getUTCSeconds(),t,2)}function oQ(e){var t=e.getUTCDay();return t===0?7:t}function sQ(e,t){return gt(km.count(xa(e)-1,e),t,2)}function m_(e){var t=e.getUTCDay();return t>=4||t===0?Dl(e):Dl.ceil(e)}function lQ(e,t){return e=m_(e),gt(Dl.count(xa(e),e)+(xa(e).getUTCDay()===4),t,2)}function cQ(e){return e.getUTCDay()}function uQ(e,t){return gt(th.count(xa(e)-1,e),t,2)}function dQ(e,t){return gt(e.getUTCFullYear()%100,t,2)}function pQ(e,t){return e=m_(e),gt(e.getUTCFullYear()%100,t,2)}function fQ(e,t){return gt(e.getUTCFullYear()%1e4,t,4)}function hQ(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Dl(e):Dl.ceil(e),gt(e.getUTCFullYear()%1e4,t,4)}function mQ(){return"+0000"}function BP(){return"%"}function FP(e){return+e}function UP(e){return Math.floor(+e/1e3)}var Ls,g_,y_;gQ({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 gQ(e){return Ls=gX(e),g_=Ls.format,Ls.parse,y_=Ls.utcFormat,Ls.utcParse,Ls}function yQ(e){return new Date(e)}function vQ(e){return e instanceof Date?+e:+new Date(+e)}function g1(e,t,n,r,i,a,s,l,c,u){var p=n1(),d=p.invert,f=p.domain,m=u(".%L"),g=u(":%S"),v=u("%I:%M"),x=u("%I %p"),y=u("%a %d"),b=u("%b %d"),w=u("%B"),j=u("%Y");function k(S){return(c(S)<S?m:l(S)<S?g:s(S)<S?v:a(S)<S?x:r(S)<S?i(S)<S?y:b:n(S)<S?w:j)(S)}return p.invert=function(S){return new Date(d(S))},p.domain=function(S){return arguments.length?f(Array.from(S,vQ)):f().map(yQ)},p.ticks=function(S){var A=f();return e(A[0],A[A.length-1],S??10)},p.tickFormat=function(S,A){return A==null?k:u(A)},p.nice=function(S){var A=f();return(!S||typeof S.range!="function")&&(S=t(A[0],A[A.length-1],S??10)),S?f(r_(A,S)):p},p.copy=function(){return pd(p,g1(e,t,n,r,i,a,s,l,c,u))},p}function xQ(){return Gr.apply(g1(hX,mX,va,h1,Sm,fd,p1,u1,Wo,g_).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function bQ(){return Gr.apply(g1(pX,fX,xa,m1,km,jm,f1,d1,Wo,y_).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Cm(){var e=0,t=1,n,r,i,a,s=er,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(f){var m,g;return arguments.length?([m,g]=f,s=d(m,g),u):[s(0),s(1)]}}return u.range=p(Ql),u.rangeRound=p(t1),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 yo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function v_(){var e=go(Cm()(er));return e.copy=function(){return yo(e,v_())},Ca.apply(e,arguments)}function x_(){var e=a1(Cm()).domain([1,10]);return e.copy=function(){return yo(e,x_()).base(e.base())},Ca.apply(e,arguments)}function b_(){var e=o1(Cm());return e.copy=function(){return yo(e,b_()).constant(e.constant())},Ca.apply(e,arguments)}function y1(){var e=s1(Cm());return e.copy=function(){return yo(e,y1()).exponent(e.exponent())},Ca.apply(e,arguments)}function wQ(){return y1.apply(null,arguments).exponent(.5)}function w_(){var e=[],t=er;function n(r){if(r!=null&&!isNaN(r=+r))return t((ud(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(to),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)=>oG(e,a/r))},n.copy=function(){return w_(t).domain(e)},Ca.apply(n,arguments)}function Pm(){var e=0,t=.5,n=1,r=1,i,a,s,l,c,u=er,p,d=!1,f;function m(v){return isNaN(v=+v)?f:(v=.5+((v=+p(v))-a)*(r*v<r*a?l:c),u(d?Math.max(0,Math.min(1,v)):v))}m.domain=function(v){return arguments.length?([e,t,n]=v,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(v){return arguments.length?(d=!!v,m):d},m.interpolator=function(v){return arguments.length?(u=v,m):u};function g(v){return function(x){var y,b,w;return arguments.length?([y,b,w]=x,u=MG(v,[y,b,w]),m):[u(0),u(.5),u(1)]}}return m.range=g(Ql),m.rangeRound=g(t1),m.unknown=function(v){return arguments.length?(f=v,m):f},function(v){return p=v,i=v(e),a=v(t),s=v(n),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,m}}function j_(){var e=go(Pm()(er));return e.copy=function(){return yo(e,j_())},Ca.apply(e,arguments)}function S_(){var e=a1(Pm()).domain([.1,1,10]);return e.copy=function(){return yo(e,S_()).base(e.base())},Ca.apply(e,arguments)}function k_(){var e=o1(Pm());return e.copy=function(){return yo(e,k_()).constant(e.constant())},Ca.apply(e,arguments)}function v1(){var e=s1(Pm());return e.copy=function(){return yo(e,v1()).exponent(e.exponent())},Ca.apply(e,arguments)}function jQ(){return v1.apply(null,arguments).exponent(.5)}const C_=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Zb,scaleDiverging:j_,scaleDivergingLog:S_,scaleDivergingPow:v1,scaleDivergingSqrt:jQ,scaleDivergingSymlog:k_,scaleIdentity:n_,scaleImplicit:Cx,scaleLinear:t_,scaleLog:i_,scaleOrdinal:Qb,scalePoint:cG,scalePow:l1,scaleQuantile:s_,scaleQuantize:l_,scaleRadial:o_,scaleSequential:v_,scaleSequentialLog:x_,scaleSequentialPow:y1,scaleSequentialQuantile:w_,scaleSequentialSqrt:wQ,scaleSequentialSymlog:b_,scaleSqrt:nX,scaleSymlog:a_,scaleThreshold:c_,scaleTime:xQ,scaleUtc:bQ,tickFormat:e_},Symbol.toStringTag,{value:"Module"}));function SQ(e){var t=C_;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Xu(e));if(n in t&&typeof t[n]=="function")return t[n]()}function WP(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=SQ(e);if(r!=null)return r.domain(t).range(n),r}}function x1(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?WP(e.scale,n,r):WP(t,n,r)}function kQ(e){return"scale".concat(Xu(e))}function CQ(e){return kQ(e)in C_}var P_=(e,t,n)=>{if(e!=null){var r=e.scale,i=e.type;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 CQ(r)?r:"point"}};function PQ(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 A_(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=PQ(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 AQ(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):A_(e,void 0)}function KP(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 nh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KP(Object(n),!0).forEach(function(r){EQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KP(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=IQ(e,"string");return typeof t=="symbol"?t:t+""}function IQ(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 E_(e,t){return _Q(e)||MQ(e,t)||NQ(e,t)||OQ()}function OQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
463
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NQ(e,t){if(e){if(typeof e=="string")return HP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HP(e,t):void 0}}function HP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function MQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function _Q(e){if(Array.isArray(e))return e}var Tx=[0,"auto"],fn={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"},T_=(e,t)=>e.cartesianAxis.xAxis[t],Pa=(e,t)=>{var n=T_(e,t);return n??fn},hn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Tx,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:ed},I_=(e,t)=>e.cartesianAxis.yAxis[t],Aa=(e,t)=>{var n=I_(e,t);return n??hn},RQ={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:""},b1=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??RQ},en=(e,t,n)=>{switch(t){case"xAxis":return Pa(e,n);case"yAxis":return Aa(e,n);case"zAxis":return b1(e,n);case"angleAxis":return Vb(e,n);case"radiusAxis":return qb(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},DQ=(e,t,n)=>{switch(t){case"xAxis":return Pa(e,n);case"yAxis":return Aa(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Zl=(e,t,n)=>{switch(t){case"xAxis":return Pa(e,n);case"yAxis":return Aa(e,n);case"angleAxis":return Vb(e,n);case"radiusAxis":return qb(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},O_=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function w1(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 hd=e=>e.graphicalItems.cartesianItems,LQ=G([Gt,cd],w1),j1=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Jl=G([hd,en,LQ],j1,{memoizeOptions:{resultEqualityCheck:bm}}),N_=G([Jl],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(vm)),M_=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),zQ=G([Jl],M_),S1=e=>e.map(t=>t.data).filter(Boolean).flat(1),$Q=G([Jl],e=>e.some(t=>!t.data)),__=G([Jl],S1,{memoizeOptions:{resultEqualityCheck:bm}}),k1=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},C1=G([__,sd],k1),R_=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:ht(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:ht(i,r)}))):e.map(r=>({value:r})),D_=(e,t,n,r,i,a)=>{var s=r.chartData,l=s===void 0?[]:s,c=r.dataStartIndex,u=r.dataEndIndex,p=R_(e,t,n);if(i&&(t==null?void 0:t.dataKey)!=null&&a.length>0){var d=l.slice(c,u+1),f=d.map(m=>({value:ht(m,t.dataKey)})).filter(m=>m.value!=null);return[...f,...p]}return p},md=G([C1,en,Jl,sd,$Q,__],D_);function xl(e){if(Fi(e)||e instanceof Date){var t=Number(e);if(et(t))return t}}function VP(e){if(Array.isArray(e)){var t=[xl(e[0]),xl(e[1])];return Li(t)?t:void 0}var n=xl(e);if(n!=null)return[n,n]}function Ki(e){return e.map(xl).filter(dr)}function BQ(e,t){var n=xl(e),r=xl(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var FQ=G([md],e=>e==null?void 0:e.map(t=>t.value).sort(BQ));function L_(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function UQ(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!di(t))r=t;else if(Array.isArray(t)){var i=Ki(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ki(n.flatMap(a=>{var s=ht(e,a.dataKey),l,c;if(Array.isArray(s)){var u=E_(s,2);l=u[0],c=u[1]}else l=c=s;if(!(!et(l)||!et(c)))return[r-l,r+c]}))}var bn=e=>{var t=Pn(e),n=Xl(e);return Zl(e,t,n)},Ll=G([bn],e=>e==null?void 0:e.dataKey),WQ=G([N_,sd,bn],KM),z_=(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=E_(s,2),c=l[0],u=l[1],p=r?[...u].reverse():u,d=p.map(ym);return[c,{stackedData:WH(e,d,n),graphicalItems:p}]}))},rh=G([WQ,N_,ld,LM],z_),$_=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!=="zAxis")return qH(e,i,a)},KQ=G([en],e=>e.allowDataOverflow),P1=e=>{var t;if(e==null||!("domain"in e))return Tx;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ki(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:Tx},A1=G([en],P1),E1=G([A1,KQ],kM),HQ=G([rh,mi,Gt,E1],$_,{memoizeOptions:{resultEqualityCheck:xm}}),Am=e=>e.errorBars,VQ=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>L_(n,r)),ih=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]}},T1=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,f=(p=i[u.id])===null||p===void 0?void 0:p.filter(m=>L_(a,m));d.forEach(m=>{var g,v=ht(m,(g=n.dataKey)!==null&&g!==void 0?g:u.dataKey),x=UQ(m,v,f);if(x.length>=2){var y=Math.min(...x),b=Math.max(...x);(l==null||y<l)&&(l=y),(c==null||b>c)&&(c=b)}var w=VP(v);w!=null&&(l=l==null?w[0]:Math.min(l,w[0]),c=c==null?w[1]:Math.max(c,w[1]))})}),(n==null?void 0:n.dataKey)!=null&&r.length===0&&t.forEach(u=>{var p=VP(ht(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]))}),et(l)&&et(c))return[l,c]},qQ=G([C1,en,zQ,Am,Gt,SY],T1,{memoizeOptions:{resultEqualityCheck:xm}});function YQ(e){var t=e.value;if(Fi(t)||t instanceof Date)return t}var GQ=(e,t,n)=>{var r=e.map(YQ).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&FO(r))?jM(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},B_=e=>e.referenceElements.dots,ec=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),XQ=G([B_,Gt,cd],ec),F_=e=>e.referenceElements.areas,QQ=G([F_,Gt,cd],ec),U_=e=>e.referenceElements.lines,ZQ=G([U_,Gt,cd],ec),W_=(e,t)=>{if(e!=null){var n=Ki(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},JQ=G(XQ,Gt,W_),K_=(e,t)=>{if(e!=null){var n=Ki(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)]}},eZ=G([QQ,Gt],K_);function tZ(e){var t;if(e.x!=null)return Ki([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ki(n)}function nZ(e){var t;if(e.y!=null)return Ki([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ki(n)}var H_=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?tZ(r):nZ(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},rZ=G([ZQ,Gt],H_),iZ=G(JQ,rZ,eZ,(e,t,n)=>ih(e,n,t)),I1=(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?ih(r,a,i):ih(a,i);return IY(t,u,e.allowDataOverflow)},aZ=G([en,A1,E1,HQ,qQ,iZ,ct,Gt],I1,{memoizeOptions:{resultEqualityCheck:xm}}),oZ=[0,1],O1=(e,t,n,r,i,a,s)=>{if(!((e==null||n==null||n.length===0)&&s===void 0)){var l=e.dataKey,c=e.type,u=hi(t,a);if(u&&l==null){var p;return jM(0,(p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)}return c==="category"?GQ(r,e,u):i==="expand"&&!u?oZ:s}},N1=G([en,ct,C1,md,ld,Gt,aZ],O1),vo=G([en,O_,Wb],P_),M1=(e,t,n)=>{var r=t.niceTicks;if(r!=="none"){var i=P1(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Li(e)){if(a)return tP(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return nP(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Li(e))return tP(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Li(e))return nP(e,t.tickCount,t.allowDecimals,"adaptive")}}},_1=G([N1,Zl,vo],M1),R1=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Li(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},sZ=G([en,N1,_1,Gt],R1),lZ=G(md,en,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ki(e.map(d=>d.value))).sort((d,f)=>d-f),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}}),V_=G(lZ,ct,DM,vn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!et(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var s=Vn(n,e*a),l=e*a/2;return l-s-(l-s)/a*s}return 0}),cZ=(e,t,n)=>{var r=Pa(e,t);return r==null||typeof r.padding!="string"?0:V_(e,"xAxis",t,n,r.padding)},uZ=(e,t,n)=>{var r=Aa(e,t);return r==null||typeof r.padding!="string"?0:V_(e,"yAxis",t,n,r.padding)},dZ=G(Pa,cZ,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var i=e.padding;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}}),pZ=G(Aa,uZ,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var i=e.padding;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}}),q_=G([vn,dZ,cm,lm,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),Y_=G([vn,ct,pZ,cm,lm,(e,t,n)=>n],(e,t,n,r,i,a)=>{var s=i.padding;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]}),gd=(e,t,n,r)=>{var i;switch(t){case"xAxis":return q_(e,n,r);case"yAxis":return Y_(e,n,r);case"zAxis":return(i=b1(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return FM(e);case"radiusAxis":return UM(e,n);default:return}},G_=G([en,gd],hm),fZ=G([vo,sZ],HM),D1=G([en,vo,fZ,G_],x1),X_=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale,s=hi(e,r);if(s&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},L1=G([ct,md,Zl,Gt],X_),Em=G([D1],Gb);G([D1],AQ);G([D1,FQ],A_);G([Jl,Am,Gt],VQ);function Q_(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Tm=(e,t)=>t,Im=(e,t,n)=>n,hZ=G(om,Tm,Im,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Q_)),mZ=G(sm,Tm,Im,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Q_)),Z_=(e,t)=>({width:e.width,height:t.height}),gZ=(e,t)=>{var n=typeof t.width=="number"?t.width:ed;return{width:n,height:e.height}},J_=G(vn,Pa,Z_),yZ=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},vZ=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},xZ=G(ka,vn,hZ,Tm,Im,(e,t,n,r,i)=>{var a={},s;return n.forEach(l=>{var c=Z_(t,l);s==null&&(s=yZ(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}),bZ=G(Sa,vn,mZ,Tm,Im,(e,t,n,r,i)=>{var a={},s;return n.forEach(l=>{var c=gZ(t,l);s==null&&(s=vZ(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}),wZ=(e,t)=>{var n=Pa(e,t);if(n!=null)return xZ(e,n.orientation,n.mirror)},jZ=G([vn,Pa,wZ,(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}}}),SZ=(e,t)=>{var n=Aa(e,t);if(n!=null)return bZ(e,n.orientation,n.mirror)},kZ=G([vn,Aa,SZ,(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}}}),eR=G(vn,Aa,(e,t)=>{var n=typeof t.width=="number"?t.width:ed;return{width:n,height:e.height}}),qP=(e,t,n)=>{switch(t){case"xAxis":return J_(e,n).width;case"yAxis":return eR(e,n).height;default:return}},tR=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,s=n.dataKey,l=hi(e,r),c=t.map(p=>p.value),u=c.filter(p=>p!=null);if(s&&l&&a==="category"&&i&&FO(u))return c}},z1=G([ct,md,en,Gt],tR),YP=G([ct,DQ,vo,Em,z1,L1,gd,_1,Gt],(e,t,n,r,i,a,s,l,c)=>{if(t!=null){var u=hi(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}}}),CZ=(e,t,n,r,i,a,s,l,c)=>{if(!(t==null||r==null)){var u=hi(e,c),p=t.type,d=t.ticks,f=t.tickCount,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?Sn(a[0]-a[1])*2*g:g;var v=d||i;return v?v.map((x,y)=>{var b=s?s.indexOf(x):x,w=r.map(b);return et(w)?{index:y,coordinate:w+g,value:x,offset:g}:null}).filter(dr):u&&l?l.map((x,y)=>{var b=r.map(x);return et(b)?{coordinate:b+g,value:x,index:y,offset:g}:null}).filter(dr):r.ticks?r.ticks(f).map((x,y)=>{var b=r.map(x);return et(b)?{coordinate:b+g,value:x,index:y,offset:g}:null}).filter(dr):r.domain().map((x,y)=>{var b=r.map(x);return et(b)?{coordinate:b+g,value:s?s[x]:x,index:y,offset:g}:null}).filter(dr)}},nR=G([ct,Zl,vo,Em,_1,gd,z1,L1,Gt],CZ),PZ=(e,t,n,r,i,a,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=hi(e,s),c=t.tickCount,u=0;return u=s==="angleAxis"&&(r==null?void 0:r.length)>=2?Sn(r[0]-r[1])*2*u:u,l&&a?a.map((p,d)=>{var f=n.map(p);return et(f)?{coordinate:f+u,value:p,index:d,offset:u}:null}).filter(dr):n.ticks?n.ticks(c).map((p,d)=>{var f=n.map(p);return et(f)?{coordinate:f+u,value:p,index:d,offset:u}:null}).filter(dr):n.domain().map((p,d)=>{var f=n.map(p);return et(f)?{coordinate:f+u,value:i?i[p]:p,index:d,offset:u}:null}).filter(dr)}},Hi=G([ct,Zl,Em,gd,z1,L1,Gt],PZ),Vi=G(en,Em,(e,t)=>{if(!(e==null||t==null))return nh(nh({},e),{},{scale:t})}),AZ=G([en,vo,N1,G_],x1),EZ=G([AZ],Gb);G((e,t,n)=>b1(e,n),EZ,(e,t)=>{if(!(e==null||t==null))return nh(nh({},e),{},{scale:t})});var TZ=G([ct,om,sm],(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}}),IZ=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};G([IZ],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 rR=e=>e.options.defaultTooltipEventType,iR=e=>e.options.validateTooltipEventTypes;function aR(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function yd(e,t){var n=rR(e),r=iR(e);return aR(t,n,r)}function OZ(e){return Te(t=>yd(t,e))}var oR=(e,t)=>{var n,r=Number(t);if(!(di(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},NZ=e=>e.tooltip.settings,Ua={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},MZ={itemInteraction:{click:Ua,hover:Ua},axisInteraction:{click:Ua,hover:Ua},keyboardInteraction:Ua,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}},sR=Gn({name:"tooltip",initialState:MZ,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Rt()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Wr(e).tooltipItemPayloads.indexOf(r);a>-1&&(e.tooltipItemPayloads[a]=i)},prepare:Rt()},removeTooltipEntrySettings:{reducer(e,t){var n=Wr(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Rt()},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}}}),Xr=sR.actions,_Z=Xr.addTooltipEntrySettings,RZ=Xr.replaceTooltipEntrySettings,DZ=Xr.removeTooltipEntrySettings,LZ=Xr.setTooltipSettingsState,lR=Xr.setActiveMouseOverItemIndex,zZ=Xr.mouseLeaveItem,cR=Xr.mouseLeaveChart,$Z=Xr.setActiveClickItemIndex,uR=Xr.setMouseOverAxisIndex,BZ=Xr.setMouseClickAxisIndex,Rc=Xr.setSyncInteraction,ah=Xr.setKeyboardInteraction,FZ=sR.reducer;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 op(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){UZ(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 UZ(e,t,n){return(t=WZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WZ(e){var t=KZ(e,"string");return typeof t=="symbol"?t:t+""}function KZ(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 HZ(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function VZ(e){return e.index!=null}var dR=(e,t,n,r)=>{if(t==null)return Ua;var i=HZ(e,t,n);if(i==null)return Ua;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(VZ(i)){if(a)return op(op({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return op(op({},Ua),{},{coordinate:i.coordinate})};function qZ(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 YZ(e,t){var n=qZ(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 GZ(e,t,n){if(n==null||t==null)return!0;var r=ht(e,t);return r==null||!Li(n)?!0:YZ(r,n)}var Xc=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!et(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||GZ(u,n,r)?String(c):null},pR=(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}}}},fR=(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})},hR=e=>e.options.tooltipPayloadSearcher,tc=e=>e.tooltip;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 QP(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){XZ(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 XZ(e,t,n){return(t=QZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QZ(e){var t=ZZ(e,"string");return typeof t=="symbol"?t:t+""}function ZZ(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 JZ(e){if(typeof e=="string"||typeof e=="number")return e}function eJ(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function tJ(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function ZP(e){if(typeof e=="string")return e}function nJ(e){if(!(e==null||typeof e!="object")){var t="name"in e?JZ(e.name):void 0,n="unit"in e?eJ(e.unit):void 0,r="dataKey"in e?tJ(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?ZP(e.color):void 0,s="fill"in e?ZP(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:s}}}function rJ(e,t){return e??t}var mR=(e,t,n,r,i,a,s)=>{if(!(t==null||a==null)){var l=n.chartData,c=n.computedData,u=n.dataStartIndex,p=n.dataEndIndex,d=[];return e.reduce((f,m)=>{var g,v=m.dataDefinedOnItem,x=m.settings,y=rJ(v,l),b=Array.isArray(y)?WN(y,u,p):y,w=(g=x==null?void 0:x.dataKey)!==null&&g!==void 0?g:r,j=x==null?void 0:x.nameKey,k;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&s==="axis"?k=UO(b,r,i):k=a(b,t,c,j),Array.isArray(k))k.forEach(A=>{var T,D,O=nJ(A),_=O==null?void 0:O.name,R=O==null?void 0:O.dataKey,X=O==null?void 0:O.payload,V=QP(QP({},x),{},{name:_,unit:O==null?void 0:O.unit,color:(T=O==null?void 0:O.color)!==null&&T!==void 0?T:x==null?void 0:x.color,fill:(D=O==null?void 0:O.fill)!==null&&D!==void 0?D:x==null?void 0:x.fill});f.push(Kk({tooltipEntrySettings:V,dataKey:R,payload:X,value:ht(X,R),name:_==null?void 0:String(_)}))});else{var S;f.push(Kk({tooltipEntrySettings:x,dataKey:w,payload:k,value:ht(k,w),name:(S=ht(k,j))!==null&&S!==void 0?S:x==null?void 0:x.name}))}return f},d)}},$1=G([bn,O_,Wb],P_),iJ=G([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),aJ=G([Pn,Xl],w1),Cs=G([iJ,bn,aJ],j1,{memoizeOptions:{resultEqualityCheck:bm}}),oJ=G([Cs],e=>e.filter(vm)),gR=G([Cs],S1,{memoizeOptions:{resultEqualityCheck:bm}}),sJ=G([Cs],e=>e.some(t=>!t.data)),ms=G([gR,mi],k1),lJ=G([oJ,mi,bn],KM),B1=G([ms,bn,Cs,mi,sJ,gR],D_),yR=G([bn],P1),cJ=G([bn],e=>e.allowDataOverflow),vR=G([yR,cJ],kM),uJ=G([Cs],e=>e.filter(vm)),dJ=G([lJ,uJ,ld,LM],z_),pJ=G([dJ,mi,Pn,vR],$_),fJ=G([Cs],M_),hJ=G([ms,bn,fJ,Am,Pn,CY],T1,{memoizeOptions:{resultEqualityCheck:xm}}),mJ=G([B_,Pn,Xl],ec),gJ=G([mJ,Pn],W_),yJ=G([F_,Pn,Xl],ec),vJ=G([yJ,Pn],K_),xJ=G([U_,Pn,Xl],ec),bJ=G([xJ,Pn],H_),wJ=G([gJ,bJ,vJ],ih),jJ=G([bn,yR,vR,pJ,hJ,wJ,ct,Pn],I1),zl=G([bn,ct,ms,B1,ld,Pn,jJ],O1),SJ=G([zl,bn,$1],M1),kJ=G([bn,zl,SJ,Pn],R1),xR=e=>{var t=Pn(e),n=Xl(e),r=!1;return gd(e,t,n,r)},bR=G([bn,xR],hm),CJ=G([bn,$1,kJ,bR],x1),wR=G([CJ],Gb),PJ=G([ct,B1,bn,Pn],tR),AJ=G([ct,B1,bn,Pn],X_),EJ=(e,t,n,r,i,a,s,l)=>{if(t){var c=t.type,u=hi(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?Sn(i[0]-i[1])*2*d:d,u&&s?s.map((f,m)=>{var g=r.map(f);return et(g)?{coordinate:g+d,value:f,index:m,offset:d}:null}).filter(dr):r.domain().map((f,m)=>{var g=r.map(f);return et(g)?{coordinate:g+d,value:a?a[f]:f,index:m,offset:d}:null}).filter(dr)}}},Ea=G([ct,bn,$1,wR,xR,PJ,AJ,Pn],EJ),F1=G([rR,iR,NZ],(e,t,n)=>aR(n.shared,e,t)),jR=e=>e.tooltip.settings.trigger,U1=e=>e.tooltip.settings.defaultIndex,vd=G([tc,F1,jR,U1],dR),oo=G([vd,ms,Ll,zl],Xc),SR=G([Ea,oo],oR),W1=G([vd],e=>{if(e)return e.dataKey}),kR=G([vd],e=>{if(e)return e.graphicalItemId}),CR=G([tc,F1,jR,U1],fR),TJ=G([Sa,ka,ct,vn,Ea,U1,CR],pR),IJ=G([vd,TJ],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),OJ=G([vd],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),NJ=G([CR,oo,mi,Ll,SR,hR,F1],mR),MJ=G([NJ],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});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 eA(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){_J(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 _J(e,t,n){return(t=RJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RJ(e){var t=DJ(e,"string");return typeof t=="symbol"?t:t+""}function DJ(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 LJ=()=>Te(bn),zJ=()=>{var e=LJ(),t=Te(Ea),n=Te(wR);return ao(!e||!n?void 0:eA(eA({},e),{},{scale:n}),t)};function tA(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 zs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tA(Object(n),!0).forEach(function(r){$J(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tA(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)}var UJ=(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}},WJ=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var a=i.coordinate,s=r.radius;return zs(zs(zs({},r),cn(r.cx,r.cy,s,a)),{},{angle:a,radius:s})}var l=i.coordinate,c=r.angle;return zs(zs(zs({},r),cn(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 KJ(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var PR=(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,f,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,v=l>=s-1?(d=n[0])===null||d===void 0?void 0:d.coordinate:(f=n[l+1])===null||f===void 0?void 0:f.coordinate,x=void 0;if(!(m==null||g==null||v==null))if(Sn(g-m)!==Sn(v-g)){var y=[];if(Sn(v-g)===Sn(i[1]-i[0])){x=v;var b=g+i[1]-i[0];y[0]=Math.min(b,(b+m)/2),y[1]=Math.max(b,(b+m)/2)}else{x=m;var w=v+i[1]-i[0];y[0]=Math.min(g,(w+g)/2),y[1]=Math.max(g,(w+g)/2)}var j=[Math.min(g,(x+g)/2),Math.max(g,(x+g)/2)];if(e>j[0]&&e<=j[1]||e>=y[0]&&e<=y[1]){var k;return(k=n[l])===null||k===void 0?void 0:k.index}}else{var S=Math.min(m,v),A=Math.max(m,v);if(e>(S+g)/2&&e<=(A+g)/2){var T;return(T=n[l])===null||T===void 0?void 0:T.index}}}else if(t)for(var D=0;D<s;D++){var O=t[D];if(O!=null){var _=t[D+1],R=t[D-1];if(D===0&&_!=null&&e<=(O.coordinate+_.coordinate)/2||D===s-1&&R!=null&&e>(O.coordinate+R.coordinate)/2||D>0&&D<s-1&&R!=null&&_!=null&&e>(O.coordinate+R.coordinate)/2&&e<=(O.coordinate+_.coordinate)/2)return O.index}}return-1},AR=()=>Te(Wb),K1=(e,t)=>t,ER=(e,t,n)=>n,H1=(e,t,n,r)=>r,HJ=G(Ea,e=>Gh(e,t=>t.coordinate)),V1=G([tc,K1,ER,H1],dR),q1=G([V1,ms,Ll,zl],Xc),VJ=(e,t,n)=>{if(t!=null){var r=tc(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},TR=G([tc,K1,ER,H1],fR),oh=G([Sa,ka,ct,vn,Ea,H1,TR],pR),qJ=G([V1,oh],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),IR=G([Ea,q1],oR),YJ=G([TR,q1,mi,Ll,IR,hR,K1],mR),GJ=G([V1,q1],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),XJ=(e,t,n,r,i,a,s)=>{if(!(!e||!n||!r||!i)&&KJ(e,s)){var l=YH(e,t),c=PR(l,a,i,n,r),u=UJ(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},QJ=(e,t,n,r,i,a,s)=>{if(!(!e||!r||!i||!a||!n)){var l=yY(e,n);if(l){var c=GH(l,t),u=PR(c,s,a,r,i),p=WJ(t,a,u,l);return{activeIndex:String(u),activeCoordinate:p}}}},ZJ=(e,t,n,r,i,a,s,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?XJ(e,t,r,i,a,s,l):QJ(e,t,n,r,i,a,s)},JJ=G(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}}),eee=G(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(rn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:YY}});function nA(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 rA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nA(Object(n),!0).forEach(function(r){tee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tee(e,t,n){return(t=nee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nee(e){var t=ree(e,"string");return typeof t=="symbol"?t:t+""}function ree(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 iee={},aee={zIndexMap:Object.values(rn).reduce((e,t)=>rA(rA({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),iee)},oee=new Set(Object.values(rn));function see(e){return oee.has(e)}var OR=Gn({name:"zIndex",initialState:aee,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Rt()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!see(n)&&delete e.zIndexMap[n])},prepare:Rt()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=i:e.zIndexMap[r].element=i:e.zIndexMap[r]={consumers:0,element:a?void 0:i,panoramaElement:a?i:void 0}},prepare:Rt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:Rt()}}}),Om=OR.actions,lee=Om.registerZIndexPortal,hy=Om.unregisterZIndexPortal,cee=Om.registerZIndexPortalElement,uee=Om.unregisterZIndexPortalElement,dee=OR.reducer;function or(e){var t=e.zIndex,n=e.children,r=N7(),i=r&&t!==void 0&&t!==0,a=Cn(),s=h.useRef(void 0),l=h.useRef(new Set),c=jt(),u=Te(d=>JJ(d,t,a));if(h.useLayoutEffect(()=>{if(!i){var d=l.current;d.forEach(m=>{c(hy({zIndex:m}))}),d.clear(),s.current=void 0;return}if(l.current.has(t)||(c(lee({zIndex:t})),l.current.add(t)),u){s.current=u;var f=l.current;f.forEach(m=>{m!==t&&(c(hy({zIndex:m})),f.delete(m))})}},[c,t,i,u]),h.useLayoutEffect(()=>{var d=l.current;return()=>{d.forEach(f=>{c(hy({zIndex:f}))}),d.clear()}},[c]),!i)return n;var p=u??s.current;return p?Ku.createPortal(n,p):null}function Ix(){return Ix=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},Ix.apply(null,arguments)}function iA(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 sp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iA(Object(n),!0).forEach(function(r){pee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pee(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=hee(e,"string");return typeof t=="symbol"?t:t+""}function hee(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 mee(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return h.isValidElement(t)?h.cloneElement(t,r):h.createElement(n,r)}function gee(e){var t,n=e.coordinate,r=e.payload,i=e.index,a=e.offset,s=e.tooltipAxisBandSize,l=e.layout,c=e.cursor,u=e.tooltipEventType,p=e.chartName,d=n,f=r,m=i;if(!c||!d||p!=="ScatterChart"&&u!=="axis")return null;var g,v,x;if(p==="ScatterChart")g=d,v=Aq,x=rn.cursorLine;else if(p==="BarChart")g=Eq(l,d,a,s),v=yM,x=rn.cursorRectangle;else if(l==="radial"&&HO(d)){var y=xM(d),b=y.cx,w=y.cy,j=y.radius,k=y.startAngle,S=y.endAngle;g={cx:b,cy:w,startAngle:k,endAngle:S,innerRadius:j,outerRadius:j},v=wM,x=rn.cursorLine}else g={points:wY(l,d,a)},v=yl,x=rn.cursorLine;var A=typeof c=="object"&&"className"in c?c.className:void 0,T=sp(sp(sp(sp({stroke:"#ccc",pointerEvents:"none"},a),g),ls(c)),{},{payload:f,payloadIndex:m,className:mt("recharts-tooltip-cursor",A)});return h.createElement(or,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:x},h.createElement(mee,{cursor:c,cursorComp:v,cursorProps:T}))}function yee(e){var t=zJ(),n=JN(),r=mo(),i=AR();return t==null||n==null||r==null||i==null?null:h.createElement(gee,Ix({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var NR=h.createContext(null),vee=()=>h.useContext(NR),MR={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,f){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new i(p,d||c,f),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 f=0,m=d.length,g=new Array(m);f<m;f++)g[f]=d[f].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,f,m,g){var v=n?n+u:u;if(!this._events[v])return!1;var x=this._events[v],y=arguments.length,b,w;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),y){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,f),!0;case 5:return x.fn.call(x.context,p,d,f,m),!0;case 6:return x.fn.call(x.context,p,d,f,m,g),!0}for(w=1,b=new Array(y-1);w<y;w++)b[w-1]=arguments[w];x.fn.apply(x.context,b)}else{var j=x.length,k;for(w=0;w<j;w++)switch(x[w].once&&this.removeListener(u,x[w].fn,void 0,!0),y){case 1:x[w].fn.call(x[w].context);break;case 2:x[w].fn.call(x[w].context,p);break;case 3:x[w].fn.call(x[w].context,p,d);break;case 4:x[w].fn.call(x[w].context,p,d,f);break;default:if(!b)for(k=1,b=new Array(y-1);k<y;k++)b[k-1]=arguments[k];x[w].fn.apply(x[w].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,f){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&&(!f||g.once)&&(!d||g.context===d)&&s(this,m);else{for(var v=0,x=[],y=g.length;v<y;v++)(g[v].fn!==p||f&&!g[v].once||d&&g[v].context!==d)&&x.push(g[v]);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})(MR);var xee=MR.exports;const bee=Bl(xee);var Du=new bee,Ox="recharts.syncEvent.tooltip",aA="recharts.syncEvent.brush",xd=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!di(n))return e[n]}},wee={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},_R=Gn({name:"options",initialState:wee,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),jee=_R.reducer,See=_R.actions.createEventEmitter;function kee(e){return e.tooltip.syncInteraction}var Cee={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},RR=Gn({name:"chartData",initialState:Cee,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 n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),Y1=RR.actions,oA=Y1.setChartData,Pee=Y1.setDataStartEndIndexes;Y1.setComputedData;var Aee=RR.reducer,Eee=["x","y"];function sA(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 $s(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sA(Object(n),!0).forEach(function(r){Tee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tee(e,t,n){return(t=Iee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iee(e){var t=Oee(e,"string");return typeof t=="symbol"?t:t+""}function Oee(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 Nee(e,t){if(e==null)return{};var n,r,i=Mee(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 Mee(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 _ee(){var e=Te(Kb),t=Te(Hb),n=jt(),r=Te(zM),i=Te(Ea),a=mo(),s=um(),l=Te(c=>c.rootProps.className);h.useEffect(()=>{if(e==null)return fo;var c=(u,p,d)=>{if(t!==d&&e===u){if(p.payload.active===!1){n(Rc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var f;if(s&&p!==null&&p!==void 0&&(f=p.payload)!==null&&f!==void 0&&f.coordinate&&p.payload.sourceViewBox){var m=p.payload.coordinate,g=m.x,v=m.y,x=Nee(m,Eee),y=p.payload.sourceViewBox,b=y.x,w=y.y,j=y.width,k=y.height,S=$s($s({},x),{},{x:s.x+(j?(g-b)/j:0)*s.width,y:s.y+(k?(v-w)/k:0)*s.height});n($s($s({},p),{},{payload:$s($s({},p.payload),{},{coordinate:S})}))}else n(p);return}if(i!=null){var A;if(typeof r=="function"){var T={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},D=r(i,T);A=i[D]}else r==="value"&&(A=i.find(H=>String(H.value)===p.payload.label));var O=p.payload.coordinate;if(O==null||s==null){n(Rc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(A==null){n(Rc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var _=O.x,R=O.y,X=Math.min(_,s.x+s.width),V=Math.min(R,s.y+s.height),I={x:a==="horizontal"?A.coordinate:X,y:a==="horizontal"?V:A.coordinate},$=Rc({active:p.payload.active,coordinate:I,dataKey:p.payload.dataKey,index:String(A.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n($)}}};return Du.on(Ox,c),()=>{Du.off(Ox,c)}},[l,n,t,e,r,i,a,s])}function Ree(){var e=Te(Kb),t=Te(Hb),n=jt();h.useEffect(()=>{if(e==null)return fo;var r=(i,a,s)=>{t!==s&&e===i&&n(Pee(a))};return Du.on(aA,r),()=>{Du.off(aA,r)}},[n,t,e])}function Dee(){var e=jt();h.useEffect(()=>{e(See())},[e]),_ee(),Ree()}function Lee(e,t,n,r,i,a){var s=Te(g=>VJ(g,e,t)),l=Te(kR),c=Te(Hb),u=Te(Kb),p=Te(zM),d=Te(kee),f=(d==null?void 0:d.sourceViewBox)!=null,m=um();h.useEffect(()=>{if(!f&&u!=null&&c!=null){var g=Rc({active:a,coordinate:n,dataKey:s,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:m,graphicalItemId:l});Du.emit(Ox,u,g,c)}},[f,n,s,l,i,r,c,u,p,a,m])}function lA(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 cA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lA(Object(n),!0).forEach(function(r){zee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zee(e,t,n){return(t=$ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $ee(e){var t=Bee(e,"string");return typeof t=="symbol"?t:t+""}function Bee(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 Fee(e,t){return Hee(e)||Kee(e,t)||Wee(e,t)||Uee()}function Uee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
464
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wee(e,t){if(e){if(typeof e=="string")return uA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uA(e,t):void 0}}function uA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Kee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Hee(e){if(Array.isArray(e))return e}function Vee(e){return e.dataKey}function qee(e,t){return h.isValidElement(e)?h.cloneElement(e,t):typeof e=="function"?h.createElement(e,t):h.createElement(VV,t)}var dA=[],Yee={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 Ro(e){var t,n,r=dn(e,Yee),i=r.active,a=r.allowEscapeViewBox,s=r.animationDuration,l=r.animationEasing,c=r.content,u=r.filterNull,p=r.isAnimationActive,d=r.offset,f=r.payloadUniqBy,m=r.position,g=r.reverseDirection,v=r.useTranslate3d,x=r.wrapperStyle,y=r.cursor,b=r.shared,w=r.trigger,j=r.defaultIndex,k=r.portal,S=r.axisId,A=jt(),T=typeof j=="number"?String(j):j;h.useEffect(()=>{A(LZ({shared:b,trigger:w,axisId:S,active:i,defaultIndex:T}))},[A,b,w,S,i,T]);var D=um(),O=dM(),_=OZ(b),R=(t=Te(pe=>GJ(pe,_,w,T)))!==null&&t!==void 0?t:{},X=R.activeIndex,V=R.isActive,I=Te(pe=>YJ(pe,_,w,T)),$=Te(pe=>IR(pe,_,w,T)),H=Te(pe=>qJ(pe,_,w,T)),N=I,W=vee(),P=(n=i??V)!==null&&n!==void 0?n:!1,U=fN([N,P]),le=Fee(U,2),E=le[0],he=le[1],ye=_==="axis"?$:void 0;Lee(_,w,H,ye,X,P);var Q=k??W;if(Q==null||D==null||_==null)return null;var ie=N??dA;P||(ie=dA),u&&ie.length&&(ie=iN(ie.filter(pe=>pe.value!=null&&(pe.hide!==!0||r.includeHidden)),f,Vee));var je=ie.length>0,Z=cA(cA({},r),{},{payload:ie,label:ye,active:P,activeIndex:X,coordinate:H,accessibilityLayer:O}),re=h.createElement(fq,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:p,active:P,coordinate:H,hasPayload:je,offset:d,position:m,reverseDirection:g,useTranslate3d:v,viewBox:D,wrapperStyle:x,lastBoundingBox:E,innerRef:he,hasPortalFromProps:!!k},qee(c,Z));return h.createElement(h.Fragment,null,Ku.createPortal(re,Q),P&&h.createElement(yee,{cursor:y,tooltipEventType:_,coordinate:H,payload:ie,index:X}))}var bd=e=>null;bd.displayName="Cell";function Gee(e,t,n){return(t=Xee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xee(e){var t=Qee(e,"string");return typeof t=="symbol"?t:t+""}function Qee(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 Zee{constructor(t){Gee(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 pA(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 Jee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pA(Object(n),!0).forEach(function(r){ete(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ete(e,t,n){return(t=tte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tte(e){var t=nte(e,"string");return typeof t=="symbol"?t:t+""}function nte(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 rte={cacheSize:2e3,enableCache:!0},DR=Jee({},rte),fA=new Zee(DR.cacheSize),ite={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},hA="recharts_measurement_span";function ate(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 mA=(e,t)=>{try{var n=document.getElementById(hA);n||(n=document.createElement("span"),n.setAttribute("id",hA),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,ite,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Qc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ad.isSsr)return{width:0,height:0};if(!DR.enableCache)return mA(t,n);var r=ate(t,n),i=fA.get(r);if(i)return i;var a=mA(t,n);return fA.set(r,a),a},LR;function sh(e,t){return cte(e)||lte(e,t)||ste(e,t)||ote()}function ote(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
465
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ste(e,t){if(e){if(typeof e=="string")return gA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gA(e,t):void 0}}function gA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lte(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function cte(e){if(Array.isArray(e))return e}function ute(e,t,n){return(t=dte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dte(e){var t=pte(e,"string");return typeof t=="symbol"?t:t+""}function pte(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 yA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,vA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,fte=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,hte=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,mte={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},gte=["cm","mm","pt","pc","in","Q","px"];function yte(e){return gte.includes(e)}var sl="NaN";function vte(e,t){return e*mte[t]}class Ln{static parse(t){var n,r=(n=hte.exec(t))!==null&&n!==void 0?n:[],i=sh(r,3),a=i[1],s=i[2];return a==null?Ln.NaN:new Ln(parseFloat(a),s??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,di(t)&&(this.unit=""),n!==""&&!fte.test(n)&&(this.num=NaN,this.unit=""),yte(n)&&(this.num=vte(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Ln(NaN,""):new Ln(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Ln(NaN,""):new Ln(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ln(NaN,""):new Ln(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Ln(NaN,""):new Ln(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return di(this.num)}}LR=Ln;ute(Ln,"NaN",new LR(NaN,""));function zR(e){if(e==null||e.includes(sl))return sl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=yA.exec(t))!==null&&n!==void 0?n:[],i=sh(r,4),a=i[1],s=i[2],l=i[3],c=Ln.parse(a??""),u=Ln.parse(l??""),p=s==="*"?c.multiply(u):c.divide(u);if(p.isNaN())return sl;t=t.replace(yA,p.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,f=(d=vA.exec(t))!==null&&d!==void 0?d:[],m=sh(f,4),g=m[1],v=m[2],x=m[3],y=Ln.parse(g??""),b=Ln.parse(x??""),w=v==="+"?y.add(b):y.subtract(b);if(w.isNaN())return sl;t=t.replace(vA,w.toString())}return t}var xA=/\(([^()]*)\)/;function xte(e){for(var t=e,n;(n=xA.exec(t))!=null;){var r=n,i=sh(r,2),a=i[1];t=t.replace(xA,zR(a))}return t}function bte(e){var t=e.replace(/\s+/g,"");return t=xte(t),t=zR(t),t}function wte(e){try{return bte(e)}catch{return sl}}function my(e){var t=wte(e.slice(5,-1));return t===sl?"":t}var jte=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Ste=["dx","dy","angle","className","breakAll"];function Nx(){return Nx=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},Nx.apply(null,arguments)}function bA(e,t){if(e==null)return{};var n,r,i=kte(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 kte(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 wA(e,t){return Ete(e)||Ate(e,t)||Pte(e,t)||Cte()}function Cte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
466
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pte(e,t){if(e){if(typeof e=="string")return jA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jA(e,t):void 0}}function jA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ate(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Ete(e){if(Array.isArray(e))return e}var $R=/[ \f\n\r\t\v\u2028\u2029]+/,BR=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];zt(t)||(n?i=t.toString().split(""):i=t.toString().split($R));var a=i.map(l=>({word:l,width:Qc(l,r).width})),s=n?0:Qc(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}};function FR(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function Tte(e){return zt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var UR=(e,t,n,r)=>e.reduce((i,a)=>{var s=a.word,l=a.width,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},[]),WR=e=>e.reduce((t,n)=>t.width>n.width?t:n),Ite="…",SA=(e,t,n,r,i,a,s,l)=>{var c=e.slice(0,t),u=BR({breakAll:n,style:r,children:c+Ite});if(!u)return[!1,[]];var p=UR(u.wordsWithComputedWidth,a,s,l),d=p.length>i||WR(p).width>Number(a);return[d,p]},Ote=(e,t,n,r,i)=>{var a=e.maxLines,s=e.children,l=e.style,c=e.breakAll,u=Ce(a),p=String(s),d=UR(t,r,n,i);if(!u||i)return d;var f=d.length>a||WR(d).width>Number(r);if(!f)return d;for(var m=0,g=p.length-1,v=0,x;m<=g&&v<=p.length-1;){var y=Math.floor((m+g)/2),b=y-1,w=SA(p,b,c,l,a,r,n,i),j=wA(w,2),k=j[0],S=j[1],A=SA(p,y,c,l,a,r,n,i),T=wA(A,1),D=T[0];if(!k&&!D&&(m=y+1),k&&D&&(g=y-1),!k&&D){x=S;break}v++}return x||d},kA=e=>{var t=zt(e)?[]:e.toString().split($R);return[{words:t,width:void 0}]},Nte=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,s=e.maxLines;if((t||n)&&!ad.isSsr){var l,c,u=BR({breakAll:a,children:r,style:i});if(u){var p=u.wordsWithComputedWidth,d=u.spaceWidth;l=p,c=d}else return kA(r);return Ote({breakAll:a,children:r,maxLines:s,style:i},l,c,t,!!n)}return kA(r)},KR="#808080",Mte={angle:0,breakAll:!1,capHeight:"0.71em",fill:KR,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Nm=h.forwardRef((e,t)=>{var n=dn(e,Mte),r=n.x,i=n.y,a=n.lineHeight,s=n.capHeight,l=n.fill,c=n.scaleToFit,u=n.textAnchor,p=n.verticalAnchor,d=bA(n,jte),f=h.useMemo(()=>Nte({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]),m=d.dx,g=d.dy,v=d.angle,x=d.className,y=d.breakAll,b=bA(d,Ste);if(!Fi(r)||!Fi(i)||f.length===0)return null;var w=Number(r)+(Ce(m)?m:0),j=Number(i)+(Ce(g)?g:0);if(!et(w)||!et(j))return null;var k;switch(p){case"start":k=my("calc(".concat(s,")"));break;case"middle":k=my("calc(".concat((f.length-1)/2," * -").concat(a," + (").concat(s," / 2))"));break;default:k=my("calc(".concat(f.length-1," * -").concat(a,")"));break}var S=[],A=f[0];if(c&&A!=null){var T=A.width,D=d.width;S.push("scale(".concat(Ce(D)&&Ce(T)?D/T:1,")"))}return v&&S.push("rotate(".concat(v,", ").concat(w,", ").concat(j,")")),S.length&&(b.transform=S.join(" ")),h.createElement("text",Nx({},yr(b),{ref:t,x:w,y:j,className:mt("recharts-text",x),textAnchor:u,fill:l.includes("url")?KR:l}),f.map((O,_)=>{var R=O.words.join(y?"":" ");return h.createElement("tspan",{x:w,dy:_===0?k:a,key:"".concat(R,"-").concat(_)},R)}))});Nm.displayName="Text";function CA(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 ji(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CA(Object(n),!0).forEach(function(r){_te(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _te(e,t,n){return(t=Rte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rte(e){var t=Dte(e,"string");return typeof t=="symbol"?t:t+""}function Dte(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 Lte=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,s=Nb(t),l=s.x,c=s.y,u=s.height,p=s.upperWidth,d=s.lowerWidth,f=l,m=l+(p-d)/2,g=(f+m)/2,v=(p+d)/2,x=f+p/2,y=u>=0?1:-1,b=y*i,w=y>0?"end":"start",j=y>0?"start":"end",k=p>=0?1:-1,S=k*i,A=k>0?"end":"start",T=k>0?"start":"end",D=a;if(n==="top"){var O={x:f+p/2,y:c-b,horizontalAnchor:"middle",verticalAnchor:w};return D&&(O.height=Math.max(c-D.y,0),O.width=p),O}if(n==="bottom"){var _={x:m+d/2,y:c+u+b,horizontalAnchor:"middle",verticalAnchor:j};return D&&(_.height=Math.max(D.y+D.height-(c+u),0),_.width=d),_}if(n==="left"){var R={x:g-S,y:c+u/2,horizontalAnchor:A,verticalAnchor:"middle"};return D&&(R.width=Math.max(R.x-D.x,0),R.height=u),R}if(n==="right"){var X={x:g+v+S,y:c+u/2,horizontalAnchor:T,verticalAnchor:"middle"};return D&&(X.width=Math.max(D.x+D.width-X.x,0),X.height=u),X}var V=D?{width:v,height:u}:{};return n==="insideLeft"?ji({x:g+S,y:c+u/2,horizontalAnchor:T,verticalAnchor:"middle"},V):n==="insideRight"?ji({x:g+v-S,y:c+u/2,horizontalAnchor:A,verticalAnchor:"middle"},V):n==="insideTop"?ji({x:f+p/2,y:c+b,horizontalAnchor:"middle",verticalAnchor:j},V):n==="insideBottom"?ji({x:m+d/2,y:c+u-b,horizontalAnchor:"middle",verticalAnchor:w},V):n==="insideTopLeft"?ji({x:f+S,y:c+b,horizontalAnchor:T,verticalAnchor:j},V):n==="insideTopRight"?ji({x:f+p-S,y:c+b,horizontalAnchor:A,verticalAnchor:j},V):n==="insideBottomLeft"?ji({x:m+S,y:c+u-b,horizontalAnchor:T,verticalAnchor:w},V):n==="insideBottomRight"?ji({x:m+d-S,y:c+u-b,horizontalAnchor:A,verticalAnchor:w},V):n&&typeof n=="object"&&(Ce(n.x)||us(n.x))&&(Ce(n.y)||us(n.y))?ji({x:l+Vn(n.x,v),y:c+Vn(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},V):ji({x,y:c+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},V)},zte=["labelRef"],$te=["content"];function PA(e,t){if(e==null)return{};var n,r,i=Bte(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 Bte(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 AA(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 Dc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AA(Object(n),!0).forEach(function(r){Fte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fte(e,t,n){return(t=Ute(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ute(e){var t=Wte(e,"string");return typeof t=="symbol"?t:t+""}function Wte(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 ra(){return ra=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},ra.apply(null,arguments)}var HR=h.createContext(null),Kte=e=>{var t=e.x,n=e.y,r=e.upperWidth,i=e.lowerWidth,a=e.width,s=e.height,l=e.children,c=h.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:s}),[t,n,r,i,a,s]);return h.createElement(HR.Provider,{value:c},l)},VR=()=>{var e=h.useContext(HR),t=um();return e||(t?Nb(t):void 0)},Hte=h.createContext(null),Vte=()=>{var e=h.useContext(Hte),t=Te(WM);return e||t},qte=e=>{var t=e.value,n=e.formatter,r=zt(e.children)?t:e.children;return typeof n=="function"?n(r):r},G1=e=>e!=null&&typeof e=="function",Yte=(e,t)=>{var n=Sn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Gte=(e,t,n,r,i)=>{var a=e.offset,s=e.className,l=i.cx,c=i.cy,u=i.innerRadius,p=i.outerRadius,d=i.startAngle,f=i.endAngle,m=i.clockWise,g=(u+p)/2,v=Yte(d,f),x=v>=0?1:-1,y,b;switch(t){case"insideStart":y=d+x*a,b=m;break;case"insideEnd":y=f-x*a,b=!m;break;case"end":y=f+x*a,b=m;break;default:throw new Error("Unsupported position ".concat(t))}b=v<=0?b:!b;var w=cn(l,c,g,y),j=cn(l,c,g,y+(b?1:-1)*359),k="M".concat(w.x,",").concat(w.y,`
467
+ A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
468
+ `).concat(j.x,",").concat(j.y),S=zt(e.id)?Su("recharts-radial-line-"):e.id;return h.createElement("text",ra({},r,{dominantBaseline:"central",className:mt("recharts-radial-bar-label",s)}),h.createElement("defs",null,h.createElement("path",{id:S,d:k})),h.createElement("textPath",{xlinkHref:"#".concat(S)},n))},Xte=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,s=e.outerRadius,l=e.startAngle,c=e.endAngle,u=(l+c)/2;if(n==="outside"){var p=cn(r,i,s+t,u),d=p.x,f=p.y;return{x:d,y:f,textAnchor:d>=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 m=(a+s)/2,g=cn(r,i,m,u),v=g.x,x=g.y;return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},$p=e=>e!=null&&"cx"in e&&Ce(e.cx),Qte={angle:0,offset:5,zIndex:rn.label,position:"middle",textBreakAll:!1};function Zte(e){if(!$p(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function $a(e){var t=dn(e,Qte),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,s=t.children,l=t.content,c=t.className,u=c===void 0?"":c,p=t.textBreakAll,d=t.labelRef,f=Vte(),m=VR(),g=i==="center"?m:f??m,v,x,y;n==null?v=g:$p(n)?v=n:v=Nb(n);var b=Zte(v);if(!v||zt(a)&&zt(s)&&!h.isValidElement(l)&&typeof l!="function")return null;var w=Dc(Dc({},t),{},{viewBox:v});if(h.isValidElement(l)){w.labelRef;var j=PA(w,zte);return h.cloneElement(l,j)}if(typeof l=="function"){w.content;var k=PA(w,$te);if(x=h.createElement(l,k),h.isValidElement(x))return x}else x=qte(t);var S=yr(t);if($p(v)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Gte(t,i,x,S,v);y=Xte(v,t.offset,t.position)}else{if(!b)return null;var A=Lte({viewBox:b,position:i,offset:t.offset,parentViewBox:$p(r)?void 0:r});y=Dc(Dc({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 h.createElement(or,{zIndex:t.zIndex},h.createElement(Nm,ra({ref:d,className:mt("recharts-label",u)},S,y,{textAnchor:FR(S.textAnchor)?S.textAnchor:y.textAnchor,breakAll:p}),x))}$a.displayName="Label";var Jte=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?h.createElement($a,ra({key:"label-implicit"},r)):Fi(e)?h.createElement($a,ra({key:"label-implicit",value:e},r)):h.isValidElement(e)?e.type===$a?h.cloneElement(e,Dc({key:"label-implicit"},r)):h.createElement($a,ra({key:"label-implicit",content:e},r)):G1(e)?h.createElement($a,ra({key:"label-implicit",content:e},r)):e&&typeof e=="object"?h.createElement($a,ra({},e,{key:"label-implicit"},r)):null};function ene(e){var t=e.label,n=e.labelRef,r=VR();return Jte(t,r,n)||null}var tne=["valueAccessor"],nne=["dataKey","clockWise","id","textBreakAll","zIndex"];function lh(){return lh=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},lh.apply(null,arguments)}function EA(e,t){if(e==null)return{};var n,r,i=rne(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 rne(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 ine=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(Tte(t))return t},qR=h.createContext(void 0),X1=qR.Provider,YR=h.createContext(void 0),ane=YR.Provider;function one(){return h.useContext(qR)}function sne(){return h.useContext(YR)}function Bp(e){var t=e.valueAccessor,n=t===void 0?ine:t,r=EA(e,tne),i=r.dataKey;r.clockWise;var a=r.id,s=r.textBreakAll,l=r.zIndex,c=EA(r,nne),u=one(),p=sne(),d=u||p;return!d||!d.length?null:h.createElement(or,{zIndex:l??rn.label},h.createElement(Yt,{className:"recharts-label-list"},d.map((f,m)=>{var g,v=zt(i)?n(f,m):ht(f.payload,i),x=zt(a)?{}:{id:"".concat(a,"-").concat(m)};return h.createElement($a,lh({key:"label-".concat(m)},yr(f),c,x,{fill:(g=r.fill)!==null&&g!==void 0?g:f.fill,parentViewBox:f.parentViewBox,value:v,textBreakAll:s,viewBox:f.viewBox,index:m,zIndex:0}))})))}Bp.displayName="LabelList";function Mm(e){var t=e.label;return t?t===!0?h.createElement(Bp,{key:"labelList-implicit"}):h.isValidElement(t)||G1(t)?h.createElement(Bp,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(Bp,lh({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Mx(){return Mx=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},Mx.apply(null,arguments)}var GR=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=mt("recharts-dot",i);return Ce(t)&&Ce(n)&&Ce(r)?h.createElement("circle",Mx({},nr(e),wb(e),{className:a,cx:t,cy:n,r})):null},XR=e=>e.graphicalItems.polarItems,lne=G([Gt,cd],w1),_m=G([XR,en,lne],j1),cne=G([_m],S1),Rm=G([cne,od],k1),une=G([Rm,en,_m],R_);G([Rm,en,_m],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,s=ht(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:ht(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var TA=()=>{},dne=G([Rm,en,_m,Am,Gt,kY],T1),pne=G([en,A1,E1,TA,dne,TA,ct,Gt],I1),QR=G([en,ct,Rm,une,ld,Gt,pne],O1),fne=G([QR,Zl,vo],M1),hne=G([en,QR,fne,Gt],R1);G([vo,hne],HM);var mne={radiusAxis:{},angleAxis:{}},ZR=Gn({name:"polarAxis",initialState:mne,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]}}}),Dm=ZR.actions;Dm.addRadiusAxis;Dm.removeRadiusAxis;Dm.addAngleAxis;Dm.removeAngleAxis;var gne=ZR.reducer;function JR(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function IA(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 OA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IA(Object(n),!0).forEach(function(r){yne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yne(e,t,n){return(t=vne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vne(e){var t=xne(e,"string");return typeof t=="symbol"?t:t+""}function xne(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 bne=(e,t)=>t,Q1=G([XR,bne],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),wne=[],Z1=(e,t,n)=>(n==null?void 0:n.length)===0?wne:n,eD=G([od,Q1,Z1],(e,t,n)=>{var r=e.chartData;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=>OA(OA({},t.presentationProps),a.props))),i!=null)return i}}),jne=G([eD,Q1,Z1],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,s=ht(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:ho(s,t.dataKey),dataKey:t.dataKey,color:l,payload:r,type:t.legendType}})}),Sne=G([eD,Q1,Z1,vn],(e,t,n,r)=>{if(!(t==null||e==null))return _re({offset:r,pieSettings:t,displayedData:e,cells:n})}),tD={exports:{}},At={};/**
469
+ * @license React
470
+ * react-is.production.js
471
+ *
472
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
473
+ *
474
+ * This source code is licensed under the MIT license found in the
475
+ * LICENSE file in the root directory of this source tree.
476
+ */var J1=Symbol.for("react.transitional.element"),ew=Symbol.for("react.portal"),Lm=Symbol.for("react.fragment"),zm=Symbol.for("react.strict_mode"),$m=Symbol.for("react.profiler"),Bm=Symbol.for("react.consumer"),Fm=Symbol.for("react.context"),Um=Symbol.for("react.forward_ref"),Wm=Symbol.for("react.suspense"),Km=Symbol.for("react.suspense_list"),Hm=Symbol.for("react.memo"),Vm=Symbol.for("react.lazy"),kne=Symbol.for("react.view_transition"),Cne=Symbol.for("react.client.reference");function Qr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case J1:switch(e=e.type,e){case Lm:case $m:case zm:case Wm:case Km:case kne:return e;default:switch(e=e&&e.$$typeof,e){case Fm:case Um:case Vm:case Hm:return e;case Bm:return e;default:return t}}case ew:return t}}}At.ContextConsumer=Bm;At.ContextProvider=Fm;At.Element=J1;At.ForwardRef=Um;At.Fragment=Lm;At.Lazy=Vm;At.Memo=Hm;At.Portal=ew;At.Profiler=$m;At.StrictMode=zm;At.Suspense=Wm;At.SuspenseList=Km;At.isContextConsumer=function(e){return Qr(e)===Bm};At.isContextProvider=function(e){return Qr(e)===Fm};At.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===J1};At.isForwardRef=function(e){return Qr(e)===Um};At.isFragment=function(e){return Qr(e)===Lm};At.isLazy=function(e){return Qr(e)===Vm};At.isMemo=function(e){return Qr(e)===Hm};At.isPortal=function(e){return Qr(e)===ew};At.isProfiler=function(e){return Qr(e)===$m};At.isStrictMode=function(e){return Qr(e)===zm};At.isSuspense=function(e){return Qr(e)===Wm};At.isSuspenseList=function(e){return Qr(e)===Km};At.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Lm||e===$m||e===zm||e===Wm||e===Km||typeof e=="object"&&e!==null&&(e.$$typeof===Vm||e.$$typeof===Hm||e.$$typeof===Fm||e.$$typeof===Bm||e.$$typeof===Um||e.$$typeof===Cne||e.getModuleId!==void 0)};At.typeOf=Qr;tD.exports=At;var Pne=tD.exports,NA=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",MA=null,gy=null,nD=e=>{if(e===MA&&Array.isArray(gy))return gy;var t=[];return h.Children.forEach(e,n=>{zt(n)||(Pne.isFragment(n)?t=t.concat(nD(n.props.children)):t.push(n))}),gy=t,MA=e,t};function tw(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>NA(i)):r=[NA(t)],nD(e).forEach(i=>{var a=Bi(i,"type.displayName")||Bi(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var nw=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function _A(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 RA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_A(Object(n),!0).forEach(function(r){Ane(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_A(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ane(e,t,n){return(t=Ene(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ene(e){var t=Tne(e,"string");return typeof t=="symbol"?t:t+""}function Tne(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 rD(e,t){return RA(RA({},t),e)}function Ine(e){return h.isValidElement(e)?e.props:e}function One(e,t){return h.cloneElement(e,rD(Ine(e),t))}function Nne(e){if("index"in e){var t=e.index;return typeof t=="number"||typeof t=="string"?t:void 0}}function Mne(e){return"isActive"in e&&e.isActive===!0}function qm(e){var t=e.option,n=e.DefaultShape,r=e.shapeProps,i=e.activeClassName,a=i===void 0?"recharts-active-shape":i,s=e.inActiveClassName,l=s===void 0?"recharts-shape":s,c=Nne(r),u;return h.isValidElement(t)?u=One(t,r):t===n?u=h.createElement(n,r):typeof t=="function"?u=t(r,c):typeof t=="object"?u=h.createElement(n,rD(t,r)):u=h.createElement(n,r),Mne(r)?h.createElement(Yt,{className:a},u):h.createElement(Yt,{className:l},u)}var rw=(e,t,n)=>{var r=jt();return(i,a)=>s=>{e==null||e(i,a,s),r(lR({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},iw=e=>{var t=jt();return(n,r)=>i=>{e==null||e(n,r,i),t(zZ())}},aw=(e,t,n)=>{var r=jt();return(i,a)=>s=>{e==null||e(i,a,s),r($Z({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function Ym(e){var t=e.tooltipEntrySettings,n=jt(),r=Cn(),i=h.useRef(null);return h.useLayoutEffect(()=>{r||(i.current===null?n(_Z(t)):i.current!==t&&n(RZ({prev:i.current,next:t})),i.current=t)},[t,n,r]),h.useLayoutEffect(()=>()=>{i.current&&(n(DZ(i.current)),i.current=null)},[n]),null}function ow(e){var t=e.legendPayload,n=jt(),r=Cn(),i=h.useRef(null);return h.useLayoutEffect(()=>{r||(i.current===null?n(sM(t)):i.current!==t&&n(lM({prev:i.current,next:t})),i.current=t)},[n,r,t]),h.useLayoutEffect(()=>()=>{i.current&&(n(cM(i.current)),i.current=null)},[n]),null}function _ne(e){var t=e.legendPayload,n=jt(),r=Te(ct),i=h.useRef(null);return h.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(sM(t)):i.current!==t&&n(lM({prev:i.current,next:t})),i.current=t)},[n,r,t]),h.useLayoutEffect(()=>()=>{i.current&&(n(cM(i.current)),i.current=null)},[n]),null}function Rne(e,t){return $ne(e)||zne(e,t)||Lne(e,t)||Dne()}function Dne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
477
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lne(e,t){if(e){if(typeof e=="string")return DA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?DA(e,t):void 0}}function DA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function $ne(e){if(Array.isArray(e))return e}var Gm="index",sw="append";function lw(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var i of n)r.push({status:"removed",prev:i});for(var a=0;a<t.length;a++){var s=e[a],l=t[a];s!=null?r.push({status:"matched",prev:s,next:l}):r.push({status:"added",next:l})}return r}function Bne(e,t){var n=e.length/t.length,r=t.map((i,a)=>e[Math.floor(a*n)]);return lw(r,t)}function Fne(e,t){var n=t.map((r,i)=>e[i]);return lw(n,t)}function Une(e,t){for(var n=new Map,r=0;r<e.length;r++){var i=e[r];if(i!=null){var a=t(i,r);a!=null&&!n.has(a)&&n.set(a,i)}}return n}function Wne(e,t,n){var r=Une(e,n),i=new Set,a=t.map((d,f)=>{var m=n(d,f);if(m!=null){var g=r.get(m);if(g!==void 0)return i.add(m),g}}),s=[];for(var l of r){var c=Rne(l,2),u=c[0],p=c[1];i.has(u)||s.push(p)}return lw(a,t,s)}function _x(e,t,n){return t==null?null:e==null?t.map(r=>({status:"added",next:r})):n===Gm?Bne(e,t):n===sw?Fne(e,t):Wne(e,t,n)}function iD(e,t){var n=h.useRef(e),r=h.useRef(t.current),i=h.useRef(!0);n.current!==e&&(n.current=e,r.current=t.current,i.current=!1);var a=h.useCallback(function(s,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(l===0){i.current=!0;return}l===1&&(r.current=s),l>0&&i.current&&c&&(t.current=s)},[t]);return{startValue:r.current,syncStepValue:a}}function Kne(e,t){return Yne(e)||qne(e,t)||Vne(e,t)||Hne()}function Hne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
478
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vne(e,t){if(e){if(typeof e=="string")return LA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?LA(e,t):void 0}}function LA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Yne(e){if(Array.isArray(e))return e}function Xm(e,t){var n=h.useState(!1),r=Kne(n,2),i=r[0],a=r[1],s=h.useCallback(()=>{typeof e=="function"&&e(),a(!0)},[e]),l=h.useCallback(()=>{typeof t=="function"&&t(),a(!1)},[t]);return{isAnimating:i,handleAnimationStart:s,handleAnimationEnd:l}}function Qm(e){var t,n=e.animationInput,r=e.animationIdPrefix,i=e.items,a=e.previousItemsRef,s=e.isAnimationActive,l=e.animationBegin,c=e.animationDuration,u=e.animationEasing,p=e.onAnimationStart,d=e.onAnimationEnd,f=e.animationInterpolateFn,m=e.animationMatchBy,g=e.shouldUpdatePreviousRef,v=e.children,x=e.layout,y=gM(n,r),b=iD(y,a),w=(t=b.startValue)!==null&&t!==void 0?t:null,j=_x(w,i,m??Gm);return h.createElement(mM,{animationId:y,begin:l,duration:c,isActive:s,easing:u,onAnimationEnd:d,onAnimationStart:p,key:y},k=>{var S=w==null,A=i==null?i:f(j,k,x),T=g?g(k):k>0;return b.syncStepValue(A,k,T),A==null?null:v(A,k,S)})}var yy;function Gne(e,t){return Jne(e)||Zne(e,t)||Qne(e,t)||Xne()}function Xne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
479
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qne(e,t){if(e){if(typeof e=="string")return zA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zA(e,t):void 0}}function zA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Jne(e){if(Array.isArray(e))return e}var ere=()=>{var e=h.useState(()=>Su("uid-")),t=Gne(e,1),n=t[0];return n},aD=(yy=uE.useId)!==null&&yy!==void 0?yy:ere;function tre(e,t){var n=aD();return t||(e?"".concat(e,"-").concat(n):n)}var nre=h.createContext(void 0),Zm=e=>{var t=e.id,n=e.type,r=e.children,i=tre("recharts-".concat(n),t);return h.createElement(nre.Provider,{value:i},r(i))},rre={cartesianItems:[],polarItems:[]},oD=Gn({name:"graphicalItems",initialState:rre,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Rt()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Wr(e).cartesianItems.indexOf(r);a>-1&&(e.cartesianItems[a]=i)},prepare:Rt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Wr(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Rt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Rt()},removePolarGraphicalItem:{reducer(e,t){var n=Wr(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Rt()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Wr(e).polarItems.indexOf(r);a>-1&&(e.polarItems[a]=i)},prepare:Rt()}}}),nc=oD.actions,ire=nc.addCartesianGraphicalItem,are=nc.replaceCartesianGraphicalItem,ore=nc.removeCartesianGraphicalItem,sre=nc.addPolarGraphicalItem,lre=nc.removePolarGraphicalItem,cre=nc.replacePolarGraphicalItem,ure=oD.reducer,dre=e=>{var t=jt(),n=h.useRef(null);return h.useLayoutEffect(()=>{n.current===null?t(ire(e)):n.current!==e&&t(are({prev:n.current,next:e})),n.current=e},[t,e]),h.useLayoutEffect(()=>()=>{n.current&&(t(ore(n.current)),n.current=null)},[t]),null},cw=h.memo(dre),pre=e=>{var t=jt(),n=h.useRef(null);return h.useLayoutEffect(()=>{n.current===null?t(sre(e)):n.current!==e&&t(cre({prev:n.current,next:e})),n.current=e},[t,e]),h.useLayoutEffect(()=>()=>{n.current&&(t(lre(n.current)),n.current=null)},[t]),null},fre=h.memo(pre),hre=["key"],mre=["onMouseEnter","onClick","onMouseLeave"],gre=["id"],yre=["id"];function gs(){return gs=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},gs.apply(null,arguments)}function Jm(e,t){if(e==null)return{};var n,r,i=vre(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 vre(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 $A(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 $t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$A(Object(n),!0).forEach(function(r){xre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$A(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xre(e,t,n){return(t=bre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bre(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)}var sD=wM;function jre(e){var t=h.useMemo(()=>tw(e.children,bd),[e.children]),n=Te(r=>jne(r,e.id,t));return n==null?null:h.createElement(_ne,{legendPayload:n})}function Sre(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(h.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var r=e.fill;return typeof r=="string"?r:void 0}}var kre=h.memo(e=>{var t=e.dataKey,n=e.nameKey,r=e.sectors,i=e.stroke,a=e.strokeWidth,s=e.fill,l=e.name,c=e.hide,u=e.tooltipType,p=e.id,d=e.activeShape,f=Sre(d),m=r.map(v=>{var x=v.tooltipPayload;return f==null||x==null?x:x.map(y=>$t($t({},y),{},{color:f,fill:f}))}),g={dataDefinedOnItem:m,getPosition:v=>{var x;return(x=r[Number(v)])===null||x===void 0?void 0:x.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:s,dataKey:t,nameKey:n,name:ho(l,t),hide:c,type:u,color:s,unit:"",graphicalItemId:p}};return h.createElement(Ym,{tooltipEntrySettings:g})}),Cre=(e,t)=>e>t?"start":e<t?"end":"middle",Pre=(e,t,n)=>Vn(typeof t=="function"?t(e):t,n,n*.8),Are=(e,t,n)=>{var r=t.top,i=t.left,a=t.width,s=t.height,l=vM(a,s),c=i+Vn(e.cx,a,a/2),u=r+Vn(e.cy,s,s/2),p=Vn(e.innerRadius,l,0),d=Pre(n,e.outerRadius,l),f=e.maxRadius||Math.sqrt(a*a+s*s)/2;return{cx:c,cy:u,innerRadius:p,outerRadius:d,maxRadius:f}},Ere=(e,t)=>{var n=Sn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Tre=(e,t)=>{if(h.isValidElement(e))return h.cloneElement(e,t);if(typeof e=="function")return e(t);var n=mt("recharts-pie-label-line",typeof e!="boolean"?e.className:"");t.key;var r=Jm(t,hre);return h.createElement(yl,gs({},r,{type:"linear",className:n}))},Ire=(e,t,n)=>{if(h.isValidElement(e))return h.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),h.isValidElement(r)))return r;var i=mt("recharts-pie-label-text",JR(e));return h.createElement(Nm,gs({},t,{alignmentBaseline:"middle",className:i}),r)};function Ore(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label,a=n.labelLine,s=n.dataKey;if(!r||!i||!t)return null;var l=nr(n),c=ls(i),u=ls(a),p=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,d=t.map((f,m)=>{var g=(f.startAngle+f.endAngle)/2,v=cn(f.cx,f.cy,f.outerRadius+p,g),x=$t($t($t($t({},l),f),{},{stroke:"none"},c),{},{index:m,textAnchor:Cre(v.x,f.cx)},v),y=$t($t($t($t({},l),f),{},{fill:"none",stroke:f.fill},u),{},{index:m,points:[cn(f.cx,f.cy,f.outerRadius,g),v],key:"line"});return h.createElement(or,{zIndex:rn.label,key:"label-".concat(f.startAngle,"-").concat(f.endAngle,"-").concat(f.midAngle,"-").concat(m)},h.createElement(Yt,null,a&&Tre(a,y),Ire(i,x,ht(f,s))))});return h.createElement(Yt,{className:"recharts-pie-labels"},d)}function Nre(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label;return typeof i=="object"&&i!=null&&"position"in i?h.createElement(Mm,{label:i}):h.createElement(Ore,{sectors:t,props:n,showLabels:r})}function Mre(e){var t=e.sectors,n=e.activeShape,r=e.inactiveShape,i=e.allOtherPieProps,a=e.shape,s=e.id,l=e.animationElapsedTime,c=e.isAnimating,u=e.isEntrance,p=Te(oo),d=Te(W1),f=Te(kR),m=i.onMouseEnter,g=i.onClick,v=i.onMouseLeave,x=Jm(i,mre),y=rw(m,i.dataKey,s),b=iw(v),w=aw(g,i.dataKey,s);return t==null||t.length===0?null:h.createElement(h.Fragment,null,t.map((j,k)=>{if((j==null?void 0:j.startAngle)===0&&(j==null?void 0:j.endAngle)===0&&t.length!==1)return null;var S=f==null||f===s,A=String(k)===p&&(d==null||i.dataKey===d)&&S,T=p?r:null,D=n&&A?n:T,O=$t($t({},j),{},{stroke:j.stroke,tabIndex:-1,index:k,isActive:A,animationElapsedTime:l,isAnimating:c,isEntrance:u,[YN]:k,[GN]:s});return h.createElement(Yt,gs({key:"sector-".concat(j==null?void 0:j.startAngle,"-").concat(j==null?void 0:j.endAngle,"-").concat(j.midAngle,"-").concat(k),tabIndex:-1,className:"recharts-pie-sector"},Qu(x,j,k),{onMouseEnter:y(j,k),onMouseLeave:b(j,k),onClick:w(j,k)}),h.createElement(qm,{option:D??a,DefaultShape:sD,shapeProps:O}))}))}function _re(e){var t,n=e.pieSettings,r=e.displayedData,i=e.cells,a=e.offset,s=n.cornerRadius,l=n.startAngle,c=n.endAngle,u=n.dataKey,p=n.nameKey,d=n.tooltipType,f=Math.abs(n.minAngle),m=Ere(l,c),g=Math.abs(m),v=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,x=r.filter(T=>ht(T,u,0)!==0).length,y=(g>=360?x:x-1)*v,b=r.reduce((T,D)=>{var O=ht(D,u,0);return T+(Ce(O)?O:0)},0),w=f>0&&b>0&&r.some(T=>{var D=ht(T,u,0),O=(Ce(D)?D:0)/b;return D!==0&&O*g<f}),j=w?f:0,k=g-x*j-y,S;if(b>0){var A;S=r.map((T,D)=>{var O=ht(T,u,0),_=ht(T,p,D),R=Are(n,a,T),X=(Ce(O)?O:0)/b,V,I=$t($t({},T),i&&i[D]&&i[D].props),$=I!=null&&"fill"in I&&typeof I.fill=="string"?I.fill:n.fill;D?V=A.endAngle+Sn(m)*v*(O!==0?1:0):V=l;var H=V+Sn(m)*((O!==0?j:0)+X*k),N=(V+H)/2,W=(R.innerRadius+R.outerRadius)/2,P=[{name:_,value:O,payload:I,dataKey:u,type:d,color:$,fill:$,graphicalItemId:n.id}],U=cn(R.cx,R.cy,W,N);return A=$t($t($t($t({},n.presentationProps),{},{percent:X,cornerRadius:typeof s=="string"?parseFloat(s):s,name:_,tooltipPayload:P,midAngle:N,middleRadius:W,tooltipPosition:U},I),R),{},{value:O,dataKey:u,startAngle:V,endAngle:H,payload:I,paddingAngle:O!==0?Sn(m)*v:0}),A})}return S}function Rre(e){var t=e.showLabels,n=e.sectors,r=e.children,i=h.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 h.createElement(ane,{value:t?i:void 0},r)}var Dre=(e,t)=>{if(e==null)return[];var n=[],r=e.find(a=>a.status!=="removed"),i=r?r.next.startAngle:0;return e.forEach((a,s)=>{if(a.status!=="removed"){var l=s>0?Bi(a.next,"paddingAngle",0):0;if(a.status==="matched"){var c=It(a.prev.endAngle-a.prev.startAngle,a.next.endAngle-a.next.startAngle,t),u=$t($t({},a.next),{},{startAngle:i+l,endAngle:i+c+l});n.push(u),i=u.endAngle}else{var p=It(0,a.next.endAngle-a.next.startAngle,t),d=$t($t({},a.next),{},{startAngle:i+l,endAngle:i+p+l});n.push(d),i=d.endAngle}}}),n};function Lre(e){var t=e.props,n=e.previousSectorsRef,r=e.id,i=t.sectors,a=t.activeShape,s=t.inactiveShape,l=t.animationInterpolateFn,c=Xm(t.onAnimationStart,t.onAnimationEnd),u=c.isAnimating,p=c.handleAnimationStart,d=c.handleAnimationEnd,f=O7();return f==null?null:h.createElement(Rre,{showLabels:!u,sectors:i},h.createElement(Qm,{animationInput:t,animationIdPrefix:"recharts-pie-",items:i,previousItemsRef:n,isAnimationActive:t.isAnimationActive,animationBegin:t.animationBegin,animationDuration:t.animationDuration,animationEasing:t.animationEasing,onAnimationStart:p,onAnimationEnd:d,animationInterpolateFn:l,animationMatchBy:t.animationMatchBy,layout:f},(m,g,v)=>h.createElement(Yt,null,h.createElement(Mre,{sectors:m,activeShape:a,inactiveShape:s,allOtherPieProps:t,shape:t.shape,id:r,animationElapsedTime:g,isAnimating:u||g<1,isEntrance:v}))),h.createElement(Nre,{showLabels:!u,sectors:i,props:t}),t.children)}var zre={animationBegin:400,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:Dre,animationMatchBy:sw,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,shape:sD,startAngle:0,stroke:"#fff",zIndex:rn.area};function $re(e){var t=e.id,n=Jm(e,gre),r=e.hide,i=e.className,a=e.rootTabIndex,s=h.useMemo(()=>tw(e.children,bd),[e.children]),l=Te(p=>Sne(p,t,s)),c=h.useRef(null),u=mt("recharts-pie",i);return r||l==null?(c.current=null,h.createElement(Yt,{tabIndex:a,className:u})):h.createElement(or,{zIndex:e.zIndex},h.createElement(kre,{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}),h.createElement(Yt,{tabIndex:a,className:u},h.createElement(Lre,{props:$t($t({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function Bre(e){var t=dn(e,zre),n=t.id,r=Jm(t,yre),i=nr(r);return h.createElement(Zm,{id:n,type:"pie"},a=>h.createElement(h.Fragment,null,h.createElement(fre,{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}),h.createElement(jre,gs({},r,{id:a})),h.createElement($re,gs({},r,{id:a}))))}var lD=Bre;lD.displayName="Pie";var Fre=["points"];function BA(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 vy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BA(Object(n),!0).forEach(function(r){Ure(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ure(e,t,n){return(t=Wre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wre(e){var t=Kre(e,"string");return typeof t=="symbol"?t:t+""}function Kre(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 ch(){return ch=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},ch.apply(null,arguments)}function Hre(e,t){if(e==null)return{};var n,r,i=Vre(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 Vre(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 qre(e){var t=e.option,n=e.dotProps,r=e.className;if(h.isValidElement(t))return h.cloneElement(t,n);if(typeof t=="function")return t(n);var i=mt(r,typeof t!="boolean"?t.className:""),a=n??{};a.points;var s=Hre(a,Fre);return h.createElement(GR,ch({},s,{className:i}))}function Yre(e,t){return e==null?!1:t?!0:e.length===1}function cD(e){var t=e.points,n=e.dot,r=e.className,i=e.dotClassName,a=e.dataKey,s=e.baseProps,l=e.needClip,c=e.clipPathId,u=e.zIndex,p=u===void 0?rn.scatter:u;if(!Yre(t,n))return null;var d=nw(n),f=UU(n),m=t.map((v,x)=>{var y,b,w=vy(vy(vy({r:3},s),f),{},{index:x,cx:(y=v.x)!==null&&y!==void 0?y:void 0,cy:(b=v.y)!==null&&b!==void 0?b:void 0,dataKey:a,value:v.value,payload:v.payload,points:t});return h.createElement(qre,{key:"dot-".concat(x),option:n,dotProps:w,className:i})}),g={};return l&&c!=null&&(g.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),h.createElement(or,{zIndex:p},h.createElement(Yt,ch({className:r},g),m))}function FA(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 UA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FA(Object(n),!0).forEach(function(r){Gre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gre(e,t,n){return(t=Xre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xre(e){var t=Qre(e,"string");return typeof t=="symbol"?t:t+""}function Qre(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 uD=0,Zre={xAxis:{},yAxis:{},zAxis:{}},dD=Gn({name:"cartesianAxis",initialState:Zre,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Rt()},replaceXAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.xAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.xAxis[r.id],e.xAxis[i.id]=i)},prepare:Rt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Rt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Rt()},replaceYAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.yAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.yAxis[r.id],e.yAxis[i.id]=i)},prepare:Rt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Rt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Rt()},replaceZAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.zAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.zAxis[r.id],e.zAxis[i.id]=i)},prepare:Rt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Rt()},updateYAxisWidth(e,t){var n=t.payload,r=n.id,i=n.width,a=e.yAxis[r];if(a){var s,l=a.widthHistory||[];if(l.length===3&&l[0]===l[2]&&i===l[1]&&i!==a.width&&Math.abs(i-((s=l[0])!==null&&s!==void 0?s:0))<=1)return;var c=[...l,i].slice(-3);e.yAxis[r]=UA(UA({},a),{},{width:i,widthHistory:c})}}}}),qi=dD.actions,Jre=qi.addXAxis,eie=qi.replaceXAxis,tie=qi.removeXAxis,nie=qi.addYAxis,rie=qi.replaceYAxis,iie=qi.removeYAxis;qi.addZAxis;qi.replaceZAxis;qi.removeZAxis;var aie=qi.updateYAxisWidth,oie=dD.reducer,sie=G([vn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),lie=G([sie,Sa,ka],(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)}}),eg=()=>Te(lie),cie=()=>Te(MJ);function WA(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 xy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WA(Object(n),!0).forEach(function(r){uie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WA(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)}var fie=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,s=e.clipPath;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=xy(xy(xy({},l),ls(i)),wb(i)),u;return h.isValidElement(i)?u=h.cloneElement(i,c):typeof i=="function"?u=i(c):u=h.createElement(GR,c),h.createElement(Yt,{className:"recharts-active-dot",clipPath:s},u)};function Rx(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,s=e.zIndex,l=s===void 0?rn.activeDot:s,c=Te(oo),u=cie();if(t==null||u==null)return null;var p=t.find(d=>u.includes(d.payload));return zt(p)?null:h.createElement(or,{zIndex:l},h.createElement(fie,{point:p,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}function hie(e,t){return vie(e)||yie(e,t)||gie(e,t)||mie()}function mie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
480
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gie(e,t){if(e){if(typeof e=="string")return KA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?KA(e,t):void 0}}function KA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function vie(e){if(Array.isArray(e))return e}var HA=(e,t,n)=>{var r=n??e;if(!zt(r))return Vn(r,t,0)},xie=(e,t,n)=>{var r={},i=e.filter(vm),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=hie(u,2),f=d[0],m=d[1],g=m.map(x=>x.dataKey),v=HA(t,n,(p=m[0])===null||p===void 0?void 0:p.barSize);return{stackId:f,dataKeys:g,barSize:v}}),c=a.map(u=>{var p=[u.dataKey].filter(f=>f!=null),d=HA(t,n,u.barSize);return{stackId:void 0,dataKeys:p,barSize:d}});return[...l,...c]};function VA(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 lp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VA(Object(n),!0).forEach(function(r){bie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bie(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=jie(e,"string");return typeof t=="symbol"?t:t+""}function jie(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 Sie(e,t,n,r,i){var a,s=r.length;if(!(s<1)){var l=Vn(e,n,0,!0),c,u=[];if(et((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,d=n/s,f=r.reduce((b,w)=>b+(w.barSize||0),0);f+=(s-1)*l,f>=n&&(f-=(s-1)*l,l=0),f>=n&&d>0&&(p=!0,d*=.9,f=s*d);var m=Math.round((n-f)/2),g={offset:m-l,size:0};c=r.reduce((b,w)=>{var j,k={stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:g.offset+g.size+l,size:p?d:(j=w.barSize)!==null&&j!==void 0?j:0}},S=[...b,k];return g=k.position,S},u)}else{var v=Vn(t,n,0,!0);n-2*v-(s-1)*l<=0&&(l=0);var x=(n-2*v-(s-1)*l)/s;x>1&&(x=Math.round(x));var y=et(i)?Math.min(x,i):x;c=r.reduce((b,w,j)=>[...b,{stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:v+(x+l)*j+(x-y)/2,size:y}}],u)}return c}}var kie=(e,t,n,r,i,a,s)=>{var l=zt(s)?t:s,c=Sie(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(u=>lp(lp({},u),{},{position:lp(lp({},u.position),{},{offset:u.position.offset-i/2})}))),c},Cie=(e,t)=>{var n=ym(t);if(!(!e||n==null||t==null)){var r=t.stackId;if(r!=null){var i=e[r];if(i){var a=i.stackedData;if(a)return a.find(s=>s.key===n)}}}},Pie=(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 Aie(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&et(e.zIndex)?e.zIndex:t}var pD=e=>{var t=e.chartData,n=jt(),r=Cn();return h.useEffect(()=>r?()=>{}:(n(oA(t)),()=>{n(oA(void 0))}),[t,n,r]),null},qA={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},fD=Gn({name:"brush",initialState:qA,reducers:{setBrushSettings(e,t){return t.payload==null?qA:t.payload}}});fD.actions.setBrushSettings;var Eie=fD.reducer;function Tie(e){return(e%180+180)%180}var Iie=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Tie(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)},Oie={dots:[],areas:[],lines:[]},hD=Gn({name:"referenceElements",initialState:Oie,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Wr(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=Wr(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=Wr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),rc=hD.actions;rc.addDot;rc.removeDot;rc.addArea;rc.removeArea;rc.addLine;rc.removeLine;var Nie=hD.reducer;function Mie(e,t){return Lie(e)||Die(e,t)||Rie(e,t)||_ie()}function _ie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
481
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rie(e,t){if(e){if(typeof e=="string")return YA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?YA(e,t):void 0}}function YA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Die(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Lie(e){if(Array.isArray(e))return e}var zie=h.createContext(void 0),$ie=e=>{var t=e.children,n=h.useState("".concat(Su("recharts"),"-clip")),r=Mie(n,1),i=r[0],a=eg();if(a==null)return null;var s=a.x,l=a.y,c=a.width,u=a.height;return h.createElement(zie.Provider,{value:i},h.createElement("defs",null,h.createElement("clipPath",{id:i},h.createElement("rect",{x:s,y:l,height:u,width:c}))),t)};function mD(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 Bie(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Iie(r,n)}function Fie(e,t,n){var r=n==="width",i=e.x,a=e.y,s=e.width,l=e.height;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 Uie(e,t){return mD(e,t+1)}function Wie(e,t,n,r,i){for(var a=(r||[]).slice(),s=t.start,l=t.end,c=0,u=1,p=s,d=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:mD(r,u)};var v=c,x,y=()=>(x===void 0&&(x=n(g,v)),x),b=g.coordinate,w=c===0||Lu(e,b,y,p,l);w||(c=0,p=s,u+=1),w&&(p=b+e*(y()/2+i),c+=u)},f;u<=a.length;)if(f=d(),f)return f.v;return[]}function Kie(e,t,n,r,i){var a=(r||[]).slice(),s=a.length;if(s===0)return[];for(var l=t.start,c=t.end,u=1;u<=s;u++){for(var p=(s-1)%u,d=l,f=!0,m=function(){var j=r[v];if(j==null)return 0;var k=v,S,A=()=>(S===void 0&&(S=n(j,k)),S),T=j.coordinate,D=v===p||Lu(e,T,A,d,c);if(!D)return f=!1,1;D&&(d=T+e*(A()/2+i))},g,v=p;v<s&&(g=m(),!(g!==0&&g===1));v+=u);if(f){for(var x=[],y=p;y<s;y+=u){var b=r[y];b!=null&&x.push(b)}return x}}return[]}function GA(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 Wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GA(Object(n),!0).forEach(function(r){Hie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hie(e,t,n){return(t=Vie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vie(e){var t=qie(e,"string");return typeof t=="symbol"?t:t+""}function qie(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 Yie(e,t,n,r,i){for(var a=(r||[]).slice(),s=a.length,l=t.start,c=t.end,u=function(f){var m=a[f];if(m==null)return 1;var g=m,v,x=()=>(v===void 0&&(v=n(m,f)),v);if(f===s-1){var y=e*(g.coordinate+e*x()/2-c);a[f]=g=Wn(Wn({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else a[f]=g=Wn(Wn({},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[f]=Wn(Wn({},g),{},{isShow:!0}))}},p=s-1;p>=0;p--)u(p);return a}function Gie(e,t,n,r,i,a){var s=(r||[]).slice(),l=s.length,c=t.start,u=t.end;if(a){var p=r[l-1];if(p!=null){var d=n(p,l-1),f=e*(p.coordinate+e*d/2-u);if(s[l-1]=p=Wn(Wn({},p),{},{tickCoord:f>0?p.coordinate-f*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]=Wn(Wn({},p),{},{isShow:!0}))}}}for(var g=a?l-1:l,v=function(b){var w=s[b];if(w==null)return 1;var j=w,k,S=()=>(k===void 0&&(k=n(w,b)),k);if(b===0){var A=e*(j.coordinate-e*S()/2-c);s[b]=j=Wn(Wn({},j),{},{tickCoord:A<0?j.coordinate-A*e:j.coordinate})}else s[b]=j=Wn(Wn({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var T=Lu(e,j.tickCoord,S,c,u);T&&(c=j.tickCoord+e*(S()/2+i),s[b]=Wn(Wn({},j),{},{isShow:!0}))}},x=0;x<g;x++)v(x);return s}function uw(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,p=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(Ce(c)||ad.isSsr){var f;return(f=Uie(i,Ce(c)?c:0))!==null&&f!==void 0?f:[]}var m=[],g=l==="top"||l==="bottom"?"width":"height",v=p&&g==="width"?Qc(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},x=(k,S)=>{var A=typeof u=="function"?u(k.value,S):k.value;return g==="width"?Bie(Qc(A,{fontSize:t,letterSpacing:n}),v,d):Qc(A,{fontSize:t,letterSpacing:n})[g]},y=i[0],b=i[1],w=i.length>=2&&y!=null&&b!=null?Sn(b.coordinate-y.coordinate):1,j=Fie(a,w,g);return c==="equidistantPreserveStart"?Wie(w,j,x,i,s):c==="equidistantPreserveEnd"?Kie(w,j,x,i,s):(c==="preserveStart"||c==="preserveStartEnd"?m=Gie(w,j,x,i,s,c==="preserveStartEnd"):m=Yie(w,j,x,i,s),m.filter(k=>k.isShow))}var Xie=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r,a=e.tickSize,s=a===void 0?0:a,l=e.tickMargin,c=l===void 0?0:l,u=0;if(t){Array.from(t).forEach(m=>{if(m){var g=m.getBoundingClientRect();g.width>u&&(u=g.width)}});var p=n?n.getBoundingClientRect().width:0,d=s+c,f=u+d+p+(n?i:0);return Math.round(f)}return 0},Qie={xAxis:{},yAxis:{}},gD=Gn({name:"renderedTicks",initialState:Qie,reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=a},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),yD=gD.actions,Zie=yD.setRenderedTicks,Jie=yD.removeRenderedTicks,eae=gD.reducer,tae=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function XA(e,t){return aae(e)||iae(e,t)||rae(e,t)||nae()}function nae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
482
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rae(e,t){if(e){if(typeof e=="string")return QA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QA(e,t):void 0}}function QA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function aae(e){if(Array.isArray(e))return e}function oae(e,t){if(e==null)return{};var n,r,i=sae(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 sae(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 ys(){return ys=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},ys.apply(null,arguments)}function ZA(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 Zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZA(Object(n),!0).forEach(function(r){lae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lae(e,t,n){return(t=cae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cae(e){var t=uae(e,"string");return typeof t=="symbol"?t:t+""}function uae(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 da={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:rn.axis};function dae(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,s=e.mirror,l=e.axisLine,c=e.otherSvgProps;if(!l)return null;var u=Zt(Zt(Zt({},c),nr(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!s||a==="bottom"&&s);u=Zt(Zt({},u),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var d=+(a==="left"&&!s||a==="right"&&s);u=Zt(Zt({},u),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return h.createElement("line",ys({},u,{className:mt("recharts-cartesian-axis-line",Bi(l,"className"))}))}function pae(e,t,n,r,i,a,s,l,c){var u,p,d,f,m,g,v=l?-1:1,x=e.tickSize||s,y=Ce(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=p=e.coordinate,f=n+ +!l*i,d=f-v*x,g=d-v*c,m=y;break;case"left":d=f=e.coordinate,p=t+ +!l*r,u=p-v*x,m=u-v*c,g=y;break;case"right":d=f=e.coordinate,p=t+ +l*r,u=p+v*x,m=u+v*c,g=y;break;default:u=p=e.coordinate,f=n+ +l*i,d=f+v*x,g=d+v*c,m=y;break}return{line:{x1:u,y1:d,x2:p,y2:f},tick:{x:m,y:g}}}function fae(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function hae(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function mae(e){var t=e.option,n=e.tickProps,r=e.value,i,a=mt(n.className,"recharts-cartesian-axis-tick-value");if(h.isValidElement(t))i=h.cloneElement(t,Zt(Zt({},n),{},{className:a}));else if(typeof t=="function")i=t(Zt(Zt({},n),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=mt(s,JR(t))),i=h.createElement(Nm,ys({},n,{className:s}),r)}return i}function gae(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=jt();return h.useEffect(()=>{if(r==null||n==null)return fo;var a=t.map(s=>({value:s.value,coordinate:s.coordinate,offset:s.offset,index:s.index}));return i(Zie({ticks:a,axisId:r,axisType:n})),()=>{i(Jie({axisId:r,axisType:n}))}},[i,t,r,n]),null}var yae=h.forwardRef((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,s=e.stroke,l=e.tickFormatter,c=e.unit,u=e.padding,p=e.tickTextProps,d=e.orientation,f=e.mirror,m=e.x,g=e.y,v=e.width,x=e.height,y=e.tickSize,b=e.tickMargin,w=e.fontSize,j=e.letterSpacing,k=e.getTicksConfig,S=e.events,A=e.axisType,T=e.axisId,D=uw(Zt(Zt({},k),{},{ticks:r}),w,j),O=nr(k),_=ls(i),R=FR(O.textAnchor)?O.textAnchor:fae(d,f),X=hae(d,f),V={};typeof a=="object"&&(V=a);var I=Zt(Zt({},O),{},{fill:"none"},V),$=D.map(W=>Zt({entry:W},pae(W,m,g,v,x,d,y,f,b))),H=$.map(W=>{var P=W.entry,U=W.line;return h.createElement(Yt,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},a&&h.createElement("line",ys({},I,U,{className:mt("recharts-cartesian-axis-tick-line",Bi(a,"className"))})))}),N=$.map((W,P)=>{var U,le,E=W.entry,he=W.tick,ye=Zt(Zt(Zt(Zt({verticalAnchor:X},O),{},{textAnchor:R,stroke:"none",fill:s},he),{},{index:P,payload:E,visibleTicksCount:D.length,tickFormatter:l,padding:u},p),{},{angle:(U=(le=p==null?void 0:p.angle)!==null&&le!==void 0?le:O.angle)!==null&&U!==void 0?U:0}),Q=Zt(Zt({},ye),_);return h.createElement(Yt,ys({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},Qu(S,E,P)),i&&h.createElement(mae,{option:i,tickProps:Q,value:"".concat(typeof l=="function"?l(E.value,P):E.value).concat(c||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},h.createElement(gae,{ticks:D,axisId:T,axisType:A}),N.length>0&&h.createElement(or,{zIndex:rn.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},N)),H.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},H))}),vae=h.forwardRef((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,s=e.hide,l=e.ticks,c=e.axisType,u=e.axisId,p=oae(e,tae),d=h.useState(""),f=XA(d,2),m=f[0],g=f[1],v=h.useState(""),x=XA(v,2),y=x[0],b=x[1],w=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return Xie({ticks:w.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=h.useCallback(k=>{if(k){var S=k.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=S;var A=S[0];if(A){var T=window.getComputedStyle(A),D=T.fontSize,O=T.letterSpacing;(D!==m||O!==y)&&(g(D),b(O))}}},[m,y]);return s||r!=null&&r<=0||i!=null&&i<=0?null:h.createElement(or,{zIndex:e.zIndex},h.createElement(Yt,{className:mt("recharts-cartesian-axis",a)},h.createElement(dae,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:nr(e)}),h.createElement(yae,{ref:j,axisType:c,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:y,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}),h.createElement(Kte,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(ene,{label:e.label,labelRef:e.labelRef}),e.children)))}),dw=h.forwardRef((e,t)=>{var n=dn(e,da);return h.createElement(vae,ys({},n,{ref:t}))});dw.displayName="CartesianAxis";var xae=["x1","y1","x2","y2","key"],bae=["offset"],wae=["xAxisId","yAxisId"],jae=["xAxisId","yAxisId"];function JA(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 Hn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JA(Object(n),!0).forEach(function(r){Sae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sae(e,t,n){return(t=kae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kae(e){var t=Cae(e,"string");return typeof t=="symbol"?t:t+""}function Cae(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 Ko(){return Ko=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},Ko.apply(null,arguments)}function uh(e,t){if(e==null)return{};var n,r,i=Pae(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 Pae(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 Aae=e=>{var t=e.fill;if(!t||t==="none")return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,s=e.height,l=e.ry;return h.createElement("rect",{x:r,y:i,ry:l,width:a,height:s,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function vD(e){var t=e.option,n=e.lineItemProps,r;if(h.isValidElement(t))r=h.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,a=n.x1,s=n.y1,l=n.x2,c=n.y2,u=n.key,p=uh(n,xae),d=(i=nr(p))!==null&&i!==void 0?i:{};d.offset;var f=uh(d,bae);r=h.createElement("line",Ko({},f,{x1:a,y1:s,x2:l,y2:c,fill:"none",key:u}))}return r}function Eae(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var s=uh(e,wae),l=a.map((c,u)=>{var p=Hn(Hn({},s),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(u),index:u});return h.createElement(vD,{key:"line-".concat(u),option:i,lineItemProps:p})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function Tae(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var s=uh(e,jae),l=a.map((c,u)=>{var p=Hn(Hn({},s),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(u),index:u});return h.createElement(vD,{option:i,lineItemProps:p,key:"line-".concat(u)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function Iae(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,s=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length||l==null)return null;var p=l.map(f=>Math.round(f+i-i)).sort((f,m)=>f-m);i!==p[0]&&p.unshift(0);var d=p.map((f,m)=>{var g=p[m+1],v=g==null,x=v?i+s-f:g-f;if(x<=0)return null;var y=m%t.length;return h.createElement("rect",{key:"react-".concat(m),y:f,x:r,height:x,width:a,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function Oae(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,s=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var p=u.map(f=>Math.round(f+a-a)).sort((f,m)=>f-m);a!==p[0]&&p.unshift(0);var d=p.map((f,m)=>{var g=p[m+1],v=g==null,x=v?a+l-f:g-f;if(x<=0)return null;var y=m%r.length;return h.createElement("rect",{key:"react-".concat(m),x:f,y:s,width:x,height:c,stroke:"none",fill:r[y],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var Nae=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return KN(uw(Hn(Hn(Hn({},da),n),{},{ticks:HN(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Mae=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return KN(uw(Hn(Hn(Hn({},da),n),{},{ticks:HN(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},_ae={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:rn.grid};function Ho(e){var t=Mb(),n=_b(),r=JN(),i=Hn(Hn({},dn(e,_ae)),{},{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}),a=i.xAxisId,s=i.yAxisId,l=i.x,c=i.y,u=i.width,p=i.height,d=i.syncWithTicks,f=i.horizontalValues,m=i.verticalValues,g=Cn(),v=Te(D=>YP(D,"xAxis",a,g)),x=Te(D=>YP(D,"yAxis",s,g));if(!Ui(u)||!Ui(p)||!Ce(l)||!Ce(c))return null;var y=i.verticalCoordinatesGenerator||Nae,b=i.horizontalCoordinatesGenerator||Mae,w=i.horizontalPoints,j=i.verticalPoints;if((!w||!w.length)&&typeof b=="function"){var k=f&&f.length,S=b({yAxis:x?Hn(Hn({},x),{},{ticks:k?f:x.ticks}):void 0,width:t??u,height:n??p,offset:r},k?!0:d);Rf(Array.isArray(S),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof S,"]")),Array.isArray(S)&&(w=S)}if((!j||!j.length)&&typeof y=="function"){var A=m&&m.length,T=y({xAxis:v?Hn(Hn({},v),{},{ticks:A?m:v.ticks}):void 0,width:t??u,height:n??p,offset:r},A?!0:d);Rf(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(j=T)}return h.createElement(or,{zIndex:i.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(Aae,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),h.createElement(Iae,Ko({},i,{horizontalPoints:w})),h.createElement(Oae,Ko({},i,{verticalPoints:j})),h.createElement(Eae,Ko({},i,{offset:r,horizontalPoints:w,xAxis:v,yAxis:x})),h.createElement(Tae,Ko({},i,{offset:r,verticalPoints:j,xAxis:v,yAxis:x}))))}Ho.displayName="CartesianGrid";var Rae=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];function Dx(){return Dx=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},Dx.apply(null,arguments)}function Dae(e,t){if(e==null)return{};var n,r,i=Lae(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 Lae(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 zae(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function xD(e,t){return"".concat(t,"px ").concat(e,"px")}function $ae(e){return e.length%2!==0?[...e,...e]:e}function Bae(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function Fae(e,t,n){var r=$ae(n),i=r.reduce((m,g)=>m+g,0);if(!i)return xD(t,e);for(var a=Math.floor(e/i),s=e%i,l=[],c=0,u=0;c<r.length;u+=(p=r[c])!==null&&p!==void 0?p:0,++c){var p,d=r[c];if(d!=null&&u+d>s){l=[...r.slice(0,c),s-u];break}}var f=l.length%2===0?[0,t]:[t];return[...Bae(r,a),...l,...f].map(m=>"".concat(m,"px")).join(", ")}function Uae(e,t,n){if(e){var r="".concat(e).split(/[,\s]+/gim).map(i=>parseFloat(i));return Fae(n,t,r)}return xD(t,n)}function Wae(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Dae(e,Rae),a=r??!1,s;if(t!=null){var l,c=i.pathRef,u=zae((l=c==null?void 0:c.current)!==null&&l!==void 0?l:null);s=Uae(n,u,t)}else n!=null&&(s=String(n));return h.createElement(yl,Dx({},i,{connectNulls:a,strokeDasharray:s}))}function Kae(e){var t=h.useRef(0),n=h.useRef(0),r=h.useRef(!1),i=h.useRef(e);return i.current!==e&&(t.current=n.current,i.current=e),h.useCallback((a,s)=>{if(r.current)return null;var l=Math.min(oa(t.current+a*s),s);return a>0&&s>0&&(n.current=Math.max(n.current,l),l>=s)?(r.current=!0,null):l},[])}var Hae={},bD=Gn({name:"errorBars",initialState:Hae,reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(s=>s.dataKey===i.dataKey&&s.direction===i.direction?a:s))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(a=>a.dataKey!==i.dataKey||a.direction!==i.direction))}}}),pw=bD.actions;pw.addErrorBar;pw.replaceErrorBar;pw.removeErrorBar;var Vae=bD.reducer,qae=["children"];function Yae(e,t){if(e==null)return{};var n,r,i=Gae(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 Gae(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 Xae={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Qae=h.createContext(Xae);function wD(e){var t=e.children,n=Yae(e,qae);return h.createElement(Qae.Provider,{value:n},t)}function tg(e,t){var n,r,i=Te(u=>Pa(u,e)),a=Te(u=>Aa(u,t)),s=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:fn.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:hn.allowDataOverflow,c=s||l;return{needClip:c,needClipX:s,needClipY:l}}function fw(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=eg(),a=tg(t,n),s=a.needClipX,l=a.needClipY,c=a.needClip,u=Te(w=>q_(w,t,!1)),p=Te(w=>Y_(w,n,!1));if(!c||!i)return null;var d=i.x,f=i.y,m=i.width,g=i.height,v=s&&u?Math.min(u[0],u[1]):d-m/2,x=l&&p?Math.min(p[0],p[1]):f-g/2,y=s&&u?Math.abs(u[1]-u[0]):m*2,b=l&&p?Math.abs(p[1]-p[0]):g*2;return h.createElement("clipPath",{id:"clipPath-".concat(r)},h.createElement("rect",{x:v,y:x,width:y,height:b}))}var jD=(e,t,n,r)=>Vi(e,"xAxis",t,r),SD=(e,t,n,r)=>Hi(e,"xAxis",t,r),kD=(e,t,n,r)=>Vi(e,"yAxis",n,r),CD=(e,t,n,r)=>Hi(e,"yAxis",n,r),Zae=G([ct,jD,kD,SD,CD],(e,t,n,r,i)=>hi(e,"xAxis")?ao(t,r,!1):ao(n,i,!1)),Jae=(e,t,n,r,i)=>i;function eoe(e){return e.type==="line"}var toe=G([hd,Jae],(e,t)=>e.filter(eoe).find(n=>n.id===t)),noe=G([ct,jD,kD,SD,CD,toe,Zae,sd],(e,t,n,r,i,a,s,l)=>{var c=l.chartData,u=l.dataStartIndex,p=l.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null||e!=="horizontal"&&e!=="vertical")){var d=a.dataKey,f=a.data,m;if(f!=null&&f.length>0?m=f:m=c==null?void 0:c.slice(u,p+1),m!=null)return Soe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:s,displayedData:m})}});function PD(e){var t=ls(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,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 roe=["id"],ioe=["type","layout","connectNulls","needClip","shape","strokeDasharray"],aoe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function dh(){return dh=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},dh.apply(null,arguments)}function hw(e,t){if(e==null)return{};var n,r,i=ooe(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 ooe(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 e2(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 Ei(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e2(Object(n),!0).forEach(function(r){soe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function soe(e,t,n){return(t=loe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function loe(e){var t=coe(e,"string");return typeof t=="symbol"?t:t+""}function coe(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 uoe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function doe(e){var t=0,n=0;for(var r of e)r.status==="matched"&&r.prev.x!=null&&r.next.x!=null&&(t+=r.next.x-r.prev.x,n++);return n>0?t/n:0}var poe=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(l=>l.status==="removed"?[]:[l.next]);var n=doe(e),r=[];for(var i of e)if(i.status==="matched")r.push(Ei(Ei({},i.next),{},{x:It(i.prev.x,i.next.x,t),y:It(i.prev.y,i.next.y,t)}));else if(i.status==="added")if(i.next.x!=null){var a=i.next.x-n;r.push(Ei(Ei({},i.next),{},{x:It(a,i.next.x,t),y:i.next.y}))}else r.push(i.next);else if(i.status==="removed"&&i.prev.x!=null){var s=i.prev.x+n;r.push(Ei(Ei({},i.prev),{},{x:It(i.prev.x,s,t),y:i.prev.y}))}return r},mw={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:poe,animationMatchBy:Gm,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:Wae,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:rn.line,type:"linear"},foe=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:ho(n,t),payload:e}]},hoe=h.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,s=e.name,l=e.hide,c=e.unit,u=e.tooltipType,p=e.id,d={dataDefinedOnItem:n,getPosition:fo,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:ho(s,t),hide:l,type:u,color:r,unit:c,graphicalItemId:p}};return h.createElement(Ym,{tooltipEntrySettings:d})});function moe(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,s=r.needClip;r.id;var l=hw(r,roe),c=nr(l);return h.createElement(cD,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:c,needClip:s,clipPathId:t})}function goe(e){var t=e.showLabels,n=e.children,r=e.points,i=h.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 Ei(Ei({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return h.createElement(X1,{value:t?i:void 0},n)}function yoe(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,s=e.isAnimating,l=e.isEntrance,c=e.visibleLength,u=i.type,p=i.layout,d=i.connectNulls,f=i.needClip,m=i.shape,g=i.strokeDasharray,v=hw(i,ioe),x=Ei(Ei({},yr(v)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"url(#clipPath-".concat(t,")"):void 0,points:r,type:u,layout:p,connectNulls:d,strokeDasharray:g??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:s,isEntrance:i.animateNewValues?l:!1,visibleLength:c});return h.createElement(h.Fragment,null,(r==null?void 0:r.length)>1&&h.createElement(qm,{option:m,DefaultShape:mw.shape,shapeProps:x}),h.createElement(moe,{points:r,clipPathId:t,props:i}))}function voe(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,s=n.isAnimationActive,l=n.animationBegin,c=n.animationDuration,u=n.animationEasing,p=n.animationMatchBy,d=n.animationInterpolateFn,f=n.layout,m=uoe(r.current),g=Xm(n.onAnimationStart,n.onAnimationEnd),v=g.isAnimating,x=g.handleAnimationStart,y=g.handleAnimationEnd,b=!v,w=Kae(a),j=h.useCallback(k=>k>0&&m>0,[m]);return h.createElement(goe,{points:a,showLabels:b},n.children,h.createElement(Qm,{animationInput:a,animationIdPrefix:"recharts-line-",items:a,previousItemsRef:i,isAnimationActive:s,animationBegin:l,animationDuration:c,animationEasing:u,onAnimationStart:x,onAnimationEnd:y,animationInterpolateFn:d,animationMatchBy:p,shouldUpdatePreviousRef:j,layout:f},(k,S,A)=>{var T=v||S<1,D=T?w(S,m):null;return h.createElement(yoe,{props:n,points:k,clipPathId:t,pathRef:r,animationElapsedTime:S,isAnimating:T,isEntrance:A,visibleLength:D})}),h.createElement(Mm,{label:n.label}))}function xoe(e){var t=e.clipPathId,n=e.props,r=h.useRef(null),i=h.useRef(null);return h.createElement(voe,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var boe=(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:ht(e.payload,t)}};class woe extends h.Component{render(){var t=this.props,n=t.hide,r=t.dot,i=t.points,a=t.className,s=t.xAxisId,l=t.yAxisId,c=t.top,u=t.left,p=t.width,d=t.height,f=t.id,m=t.needClip,g=t.zIndex;if(n)return null;var v=mt("recharts-line",a),x=f,y=PD(r),b=y.r,w=y.strokeWidth,j=nw(r),k=b*2+w,S=m?"url(#clipPath-".concat(j?"":"dots-").concat(x,")"):void 0;return h.createElement(or,{zIndex:g},h.createElement(Yt,{className:v},m&&h.createElement("defs",null,h.createElement(fw,{clipPathId:x,xAxisId:s,yAxisId:l}),!j&&h.createElement("clipPath",{id:"clipPath-dots-".concat(x)},h.createElement("rect",{x:u-k/2,y:c-k/2,width:p+k,height:d+k}))),h.createElement(wD,{xAxisId:s,yAxisId:l,data:i,dataPointFormatter:boe,errorBarOffset:0},h.createElement(xoe,{props:this.props,clipPathId:x}))),h.createElement(Rx,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:S}))}}function joe(e){var t=dn(e,mw),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,s=t.animationEasing,l=t.connectNulls,c=t.dot,u=t.hide,p=t.isAnimationActive,d=t.label,f=t.legendType,m=t.xAxisId,g=t.yAxisId,v=t.id,x=hw(t,aoe),y=tg(m,g),b=y.needClip,w=eg(),j=mo(),k=Cn(),S=Te(_=>noe(_,m,g,k,v));if(j!=="horizontal"&&j!=="vertical"||S==null||w==null)return null;var A=w.height,T=w.width,D=w.x,O=w.y;return h.createElement(woe,dh({},x,{id:v,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:s,isAnimationActive:p,hide:u,label:d,legendType:f,xAxisId:m,yAxisId:g,points:S,layout:j,height:A,width:T,left:D,top:O,needClip:b}))}function Soe(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,s=e.dataKey,l=e.bandSize,c=e.displayedData;return c.map((u,p)=>{var d=ht(u,s);if(t==="horizontal"){var f=_f({axis:n,ticks:i,bandSize:l,entry:u,index:p}),m=zt(d)?null:r.scale.map(d);return{x:f,y:m??null,value:d,payload:u}}var g=zt(d)?null:n.scale.map(d),v=_f({axis:r,ticks:a,bandSize:l,entry:u,index:p});return g==null||v==null?null:{x:g,y:v,value:d,payload:u}}).filter(Boolean)}function koe(e){var t=dn(e,mw),n=Cn();return h.createElement(Zm,{id:t.id,type:"line"},r=>h.createElement(h.Fragment,null,h.createElement(ow,{legendPayload:foe(t)}),h.createElement(hoe,{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}),h.createElement(cw,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),h.createElement(joe,dh({},t,{id:r}))))}var ts=h.memo(koe,js);ts.displayName="Line";function Yi(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:uD}function Gi(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:uD}var AD=(e,t,n)=>Vi(e,"xAxis",Yi(e,t),n),ED=(e,t,n)=>Hi(e,"xAxis",Yi(e,t),n),TD=(e,t,n)=>Vi(e,"yAxis",Gi(e,t),n),ID=(e,t,n)=>Hi(e,"yAxis",Gi(e,t),n),Coe=G([ct,AD,TD,ED,ID],(e,t,n,r,i)=>hi(e,"xAxis")?ao(t,r,!1):ao(n,i,!1)),Poe=(e,t)=>t,OD=G([hd,Poe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),ND=e=>{var t=ct(e),n=hi(t,"xAxis");return n?"yAxis":"xAxis"},Aoe=(e,t)=>{var n=ND(e);return n==="yAxis"?Gi(e,t):Yi(e,t)},Eoe=(e,t,n)=>rh(e,ND(e),Aoe(e,t),n),Toe=G([OD,Eoe],(e,t)=>{var n;if(!(e==null||t==null)){var r=e.stackId,i=ym(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]])}}}),Ioe=G([ct,AD,TD,ED,ID,Toe,SM,Coe,OD,FY],(e,t,n,r,i,a,s,l,c,u)=>{var p=s.chartData,d=s.dataStartIndex,f=s.dataEndIndex;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null)){var m=c.data,g;if(m&&m.length>0?g=m:g=p==null?void 0:p.slice(d,f+1),g!=null)return nse({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:g,chartBaseValue:u,bandSize:l})}}),Ooe=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],Noe=["id","baseLine"];function Zc(){return Zc=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},Zc.apply(null,arguments)}function t2(e,t){if(e==null)return{};var n,r,i=Moe(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 Moe(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 _oe(e){var t,n,r=e.alpha,i=e.baseLine,a=e.points,s=e.strokeWidth,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(!et(l)||!et(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)?h.createElement("rect",{x:l<c?l:l-u,y:0,width:u,height:Math.floor(p+(s?parseInt("".concat(s),10):1))}):null}function Roe(e){var t,n,r=e.alpha,i=e.baseLine,a=e.points,s=e.strokeWidth,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(!et(l)||!et(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)?h.createElement("rect",{x:0,y:l<c?l:l-u,width:p+(s?parseInt("".concat(s),10):1),height:Math.floor(u)}):null}function Doe(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n==="vertical"?h.createElement(Roe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):h.createElement(_oe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Loe(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r===void 0?!1:r,a=e.isEntrance,s=a===void 0?!1:a,l=e.layout,c=e.isRange,u=e.stroke,p=e.connectNulls,d=t2(e,Ooe),f=l==="vertical"?"vertical":"horizontal",m=p??!1,g=aD(),v=d.id,x=d.baseLine,y=t2(d,Noe),b=nr(y),w=h.createElement(yl,Zc({},d,{id:v,baseLine:x,connectNulls:m,stroke:"none",className:"recharts-area-area",layout:f})),j=u!=="none"&&h.createElement(yl,Zc({},b,{className:"recharts-area-curve",layout:f,type:d.type,connectNulls:m,fill:"none",stroke:u,points:d.points})),k=u!=="none"&&c&&Array.isArray(x)&&h.createElement(yl,Zc({},b,{className:"recharts-area-curve",layout:f,type:d.type,connectNulls:m,fill:"none",stroke:u,points:x}));if(s&&(i||n<1)){var S;return h.createElement(Yt,null,h.createElement("defs",null,h.createElement("clipPath",{id:g},h.createElement(Doe,{alpha:n,points:(S=d.points)!==null&&S!==void 0?S:[],baseLine:x,layout:f,strokeWidth:d.strokeWidth}))),h.createElement(Yt,{clipPath:"url(#".concat(g,")")},w,j,k))}return h.createElement(h.Fragment,null,w,j,k)}var zoe=["id"],$oe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function ph(){return ph=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},ph.apply(null,arguments)}function MD(e,t){if(e==null)return{};var n,r,i=Boe(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 Boe(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 n2(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 $l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n2(Object(n),!0).forEach(function(r){Foe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Foe(e,t,n){return(t=Uoe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uoe(e){var t=Woe(e,"string");return typeof t=="symbol"?t:t+""}function Woe(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 Koe=(e,t)=>e==null?[]:t===1?e.flatMap(n=>n.status==="removed"?[]:[n.next]):e.flatMap(n=>n.status==="matched"?[$l($l({},n.next),{},{x:It(n.prev.x,n.next.x,t),y:It(n.prev.y,n.next.y,t)})]:n.status==="added"?[n.next]:[]),_D={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:Gm,animationInterpolateFn:Koe,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:Loe,xAxisId:0,yAxisId:0,zIndex:rn.area};function fh(e,t){return e&&e!=="none"?e:t}var Hoe=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType,s=e.hide;return[{inactive:s,dataKey:t,type:a,color:fh(r,i),value:ho(n,t),payload:e}]},Voe=h.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,s=e.name,l=e.hide,c=e.unit,u=e.tooltipType,p=e.id,d={dataDefinedOnItem:n,getPosition:fo,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:ho(s,t),hide:l,type:u,color:fh(r,a),unit:c,graphicalItemId:p}};return h.createElement(Ym,{tooltipEntrySettings:d})});function qoe(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,s=r.dataKey,l=nr(r);return h.createElement(cD,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:s,baseProps:l,needClip:i,clipPathId:t})}function Yoe(e){var t=e.showLabels,n=e.children,r=e.points,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 $l($l({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return h.createElement(X1,{value:t?i:void 0},n)}function Goe(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,s=e.animationElapsedTime,l=e.isAnimating,c=e.isEntrance,u=a.layout,p=a.type,d=a.stroke,f=a.connectNulls,m=a.isRange,g=a.shape,v=a.id,x=MD(a,zoe),y=yr(x),b=$l($l({},y),{},{id:v,points:t,connectNulls:f,type:p,baseLine:n,layout:u,stroke:d,isRange:m,animationElapsedTime:s,isAnimating:l,isEntrance:c});return h.createElement(h.Fragment,null,(t==null?void 0:t.length)>1&&h.createElement(Yt,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},h.createElement(qm,{option:g,DefaultShape:_D.shape,shapeProps:b})),h.createElement(qoe,{points:t,props:x,clipPathId:i}))}function Xoe(e,t,n){if(Ce(e)){var r=Ce(t)?t:void 0;return It(r,e,n)}if(zt(e)||di(e)){var i=Ce(t)?t:void 0;return It(i,0,n)}return e}function Qoe(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,s=r.points,l=r.baseLine,c=r.isAnimationActive,u=r.animationBegin,p=r.animationDuration,d=r.animationEasing,f=r.animationMatchBy,m=r.animationInterpolateFn,g=h.useMemo(()=>({points:s,baseLine:l}),[s,l]),v=iD(g,a),x=Rb(),y=Xm(r.onAnimationStart,r.onAnimationEnd),b=y.isAnimating,w=y.handleAnimationStart,j=y.handleAnimationEnd,k=v.startValue;if(x==null)return null;var S;return Array.isArray(l)&&Array.isArray(k)?S=_x(k,l,f):Array.isArray(l)?S=_x(null,l,f):S=null,h.createElement(Qm,{animationInput:g,animationIdPrefix:"recharts-area-",items:s,previousItemsRef:i,isAnimationActive:c,animationBegin:u,animationDuration:p,animationEasing:d,onAnimationStart:w,onAnimationEnd:j,animationInterpolateFn:m,animationMatchBy:f,layout:x},(A,T,D)=>{var O;return T===1?O=l:Array.isArray(l)?O=m(S,T,x):O=D?l:Xoe(l,k,T),v.syncStepValue(O,T),h.createElement(Yoe,{showLabels:!b,points:s},r.children,h.createElement(Goe,{points:A,baseLine:O,needClip:t,clipPathId:n,props:r,animationElapsedTime:T,isAnimating:b||T<1,isEntrance:D}),h.createElement(Mm,{label:r.label}))})}function Zoe(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=h.useRef(null),a=h.useRef();return h.createElement(Qoe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class Joe extends h.PureComponent{render(){var t=this.props,n=t.hide,r=t.dot,i=t.points,a=t.className,s=t.top,l=t.left,c=t.needClip,u=t.xAxisId,p=t.yAxisId,d=t.width,f=t.height,m=t.id,g=t.baseLine,v=t.zIndex;if(n)return null;var x=mt("recharts-area",a),y=m,b=PD(r),w=b.r,j=b.strokeWidth,k=nw(r),S=w*2+j,A=c?"url(#clipPath-".concat(k?"":"dots-").concat(y,")"):void 0;return h.createElement(or,{zIndex:v},h.createElement(Yt,{className:x},c&&h.createElement("defs",null,h.createElement(fw,{clipPathId:y,xAxisId:u,yAxisId:p}),!k&&h.createElement("clipPath",{id:"clipPath-dots-".concat(y)},h.createElement("rect",{x:l-S/2,y:s-S/2,width:d+S,height:f+S}))),h.createElement(Zoe,{needClip:c,clipPathId:y,props:this.props})),h.createElement(Rx,{points:i,mainColor:fh(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:A}),this.props.isRange&&Array.isArray(g)&&h.createElement(Rx,{points:g,mainColor:fh(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:A}))}}function ese(e){var t,n=e.activeDot,r=e.animationBegin,i=e.animationDuration,a=e.animationEasing,s=e.connectNulls,l=e.dot,c=e.fill,u=e.fillOpacity,p=e.hide,d=e.isAnimationActive,f=e.legendType,m=e.stroke,g=e.xAxisId,v=e.yAxisId,x=MD(e,$oe),y=mo(),b=AR(),w=tg(g,v),j=w.needClip,k=Cn(),S=(t=Te(I=>Ioe(I,e.id,k)))!==null&&t!==void 0?t:{},A=S.points,T=S.isRange,D=S.baseLine,O=eg();if(y!=="horizontal"&&y!=="vertical"||O==null||b!=="AreaChart"&&b!=="ComposedChart")return null;var _=O.height,R=O.width,X=O.x,V=O.y;return!A||!A.length?null:h.createElement(Joe,ph({},x,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:D,connectNulls:s,dot:l,fill:c,fillOpacity:u,height:_,hide:p,layout:y,isAnimationActive:d,isRange:T,legendType:f,needClip:j,points:A,stroke:m,width:R,left:X,top:V,xAxisId:g,yAxisId:v}))}var tse=(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 nse(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,s=e.layout,l=e.chartBaseValue,c=e.xAxis,u=e.yAxis,p=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,m=e.yAxisTicks,g=e.bandSize,v=a&&a.length,x=tse(s,l,r,c,u),y=s==="horizontal",b=!1,w=p.map((k,S)=>{var A,T,D,O;if(v)O=a[d+S];else{var _=ht(k,i);Array.isArray(_)?(O=_,b=!0):O=[x,_]}var R=(A=(T=O)===null||T===void 0?void 0:T[1])!==null&&A!==void 0?A:null,X=R==null||v&&!n&&ht(k,i)==null;if(y){var V;return{x:_f({axis:c,ticks:f,bandSize:g,entry:k,index:S}),y:X?null:(V=u.scale.map(R))!==null&&V!==void 0?V:null,value:O,payload:k}}return{x:X?null:(D=c.scale.map(R))!==null&&D!==void 0?D:null,y:_f({axis:u,ticks:m,bandSize:g,entry:k,index:S}),value:O,payload:k}}),j;return v||b?j=w.map(k=>{var S,A=Array.isArray(k.value)?k.value[0]:null;if(y){var T;return{x:k.x,y:A!=null&&k.y!=null&&(T=u.scale.map(A))!==null&&T!==void 0?T:null,payload:k.payload}}return{x:A!=null&&(S=c.scale.map(A))!==null&&S!==void 0?S:null,y:k.y,payload:k.payload}}):j=y?u.scale.map(x):c.scale.map(x),{points:w,baseLine:j??0,isRange:b}}function rse(e){var t=dn(e,_D),n=Cn();return h.createElement(Zm,{id:t.id,type:"area"},r=>h.createElement(h.Fragment,null,h.createElement(ow,{legendPayload:Hoe(t)}),h.createElement(Voe,{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}),h.createElement(cw,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:VN(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),h.createElement(ese,ph({},t,{id:r}))))}var hh=h.memo(rse,js);hh.displayName="Area";var ise="Invariant failed";function ase(e,t){throw new Error(ise)}var ose=["option"];function sse(e,t){if(e==null)return{};var n,r,i=lse(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 lse(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 gw=yM;function yw(e){var t=e.option,n=sse(e,ose);return h.createElement(qm,{option:t,DefaultShape:gw,shapeProps:n,activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"})}var cse=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)||zt(r);return a?t(r,i):(a||ase(),n)}},use=(e,t,n)=>n,dse=(e,t)=>t,wd=G([hd,dse],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),pse=G([wd],e=>e==null?void 0:e.maxBarSize),fse=(e,t,n,r)=>r,hse=G([ct,hd,Yi,Gi,use],(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")),mse=(e,t,n)=>{var r=ct(e),i=Yi(e,t),a=Gi(e,t);if(!(i==null||a==null))return r==="horizontal"?rh(e,"yAxis",a,n):rh(e,"xAxis",i,n)},gse=(e,t)=>{var n=ct(e),r=Yi(e,t),i=Gi(e,t);if(!(r==null||i==null))return n==="horizontal"?qP(e,"xAxis",r):qP(e,"yAxis",i)},yse=G([hse,BY,gse],xie),vse=(e,t,n)=>{var r,i,a=wd(e,t);if(a==null)return 0;var s=Yi(e,t),l=Gi(e,t);if(s==null||l==null)return 0;var c=ct(e),u=RM(e),p=a.maxBarSize,d=zt(p)?u:p,f,m;return c==="horizontal"?(f=Vi(e,"xAxis",s,n),m=Hi(e,"xAxis",s,n)):(f=Vi(e,"yAxis",l,n),m=Hi(e,"yAxis",l,n)),(r=(i=ao(f,m,!0))!==null&&i!==void 0?i:d)!==null&&r!==void 0?r:0},RD=(e,t,n)=>{var r=ct(e),i=Yi(e,t),a=Gi(e,t);if(!(i==null||a==null)){var s,l;return r==="horizontal"?(s=Vi(e,"xAxis",i,n),l=Hi(e,"xAxis",i,n)):(s=Vi(e,"yAxis",a,n),l=Hi(e,"yAxis",a,n)),ao(s,l)}},xse=G([yse,RM,$Y,DM,vse,RD,pse],kie),bse=(e,t,n)=>{var r=Yi(e,t);if(r!=null)return Vi(e,"xAxis",r,n)},wse=(e,t,n)=>{var r=Gi(e,t);if(r!=null)return Vi(e,"yAxis",r,n)},jse=(e,t,n)=>{var r=Yi(e,t);if(r!=null)return Hi(e,"xAxis",r,n)},Sse=(e,t,n)=>{var r=Gi(e,t);if(r!=null)return Hi(e,"yAxis",r,n)},kse=G([xse,wd],Pie),Cse=G([mse,wd],Cie),Pse=G([vn,Ib,bse,wse,jse,Sse,kse,ct,SM,RD,Cse,wd,fse],(e,t,n,r,i,a,s,l,c,u,p,d,f)=>{var m=c.chartData,g=c.dataStartIndex,v=c.dataEndIndex;if(!(d==null||s==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||u==null)){var x=d.data,y;if(x!=null&&x.length>0?y=x:y=m==null?void 0:m.slice(g,v+1),y!=null)return ale({layout:l,barSettings:d,pos:s,parentViewBox:t,bandSize:u,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:y,offset:e,cells:f,dataStartIndex:g})}}),Ase=["index"];function Lx(){return Lx=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},Lx.apply(null,arguments)}function Ese(e,t){if(e==null)return{};var n,r,i=Tse(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 Tse(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 DD=h.createContext(void 0),Ise=e=>{var t=h.useContext(DD);if(t!=null)return t.stackId;if(e!=null)return VN(e)},Ose=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),Nse=e=>{var t=h.useContext(DD);if(t!=null){var n=t.stackId;return"url(#".concat(Ose(n,e),")")}},LD=e=>{var t=e.index,n=Ese(e,Ase),r=Nse(t);return h.createElement(Yt,Lx({className:"recharts-bar-stack-layer",clipPath:r},n))},Mse=["onMouseEnter","onMouseLeave","onClick"],_se=["value","background","tooltipPosition"],Rse=["id"],Dse=["onMouseEnter","onClick","onMouseLeave"];function r2(e,t){return Bse(e)||$se(e,t)||zse(e,t)||Lse()}function Lse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
483
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zse(e,t){if(e){if(typeof e=="string")return i2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i2(e,t):void 0}}function i2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $se(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Bse(e){if(Array.isArray(e))return e}function so(){return so=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},so.apply(null,arguments)}function a2(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 mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a2(Object(n),!0).forEach(function(r){Fse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fse(e,t,n){return(t=Use(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Use(e){var t=Wse(e,"string");return typeof t=="symbol"?t:t+""}function Wse(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 mh(e,t){if(e==null)return{};var n,r,i=Kse(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 Kse(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 Hse=e=>{var t=e.dataKey,n=e.name,r=e.fill,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:ho(n,t),payload:e}]},Vse=h.memo(e=>{var t=e.dataKey,n=e.stroke,r=e.strokeWidth,i=e.fill,a=e.name,s=e.hide,l=e.unit,c=e.tooltipType,u=e.id,p={dataDefinedOnItem:void 0,getPosition:fo,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:ho(a,t),hide:s,type:c,color:i,unit:l,graphicalItemId:u}};return h.createElement(Ym,{tooltipEntrySettings:p})});function qse(e){var t=Te(oo),n=e.data,r=e.dataKey,i=e.background,a=e.allOtherBarProps,s=a.onMouseEnter,l=a.onMouseLeave,c=a.onClick,u=mh(a,Mse),p=rw(s,r,a.id),d=iw(l),f=aw(c,r,a.id);if(!i||n==null)return null;var m=ls(i);return h.createElement(or,{zIndex:Aie(i,rn.barBackground)},n.map((g,v)=>{g.value;var x=g.background;g.tooltipPosition;var y=mh(g,_se);if(!x)return null;var b=p(g,g.originalDataIndex),w=d(g,g.originalDataIndex),j=f(g,g.originalDataIndex),k=mn(mn(mn(mn(mn({option:i,isActive:String(g.originalDataIndex)===t},y),{},{fill:"#eee"},x),m),Qu(u,g,v)),{},{onMouseEnter:b,onMouseLeave:w,onClick:j,dataKey:r,index:v,className:"recharts-bar-background-rectangle"});return h.createElement(yw,so({key:"background-bar-".concat(v)},k))}))}function Yse(e){var t=e.showLabels,n=e.children,r=e.rects,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 mn(mn({},s),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:s,fill:a.fill})});return h.createElement(X1,{value:t?i:void 0},n)}function Gse(e){var t=e.shape,n=e.activeBar,r=e.baseProps,i=e.entry,a=e.index,s=e.dataKey,l=Te(oo),c=Te(W1),u=n&&String(i.originalDataIndex)===l&&(c==null||s===c),p=h.useState(!1),d=r2(p,2),f=d[0],m=d[1],g=h.useState(!1),v=r2(g,2),x=v[0],y=v[1];h.useEffect(()=>{var A;return u?(m(!0),A=requestAnimationFrame(()=>{y(!0)})):y(!1),()=>{cancelAnimationFrame(A)}},[u]);var b=h.useCallback(()=>{u||m(!1)},[u]),w=u&&x,j=u||f,k;u?n===!0?k=t:k=n:k=t;var S=h.createElement(yw,so({},r,{name:String(r.name)},i,{isActive:w,option:k,index:a,dataKey:s,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:b}));return j?h.createElement(or,{zIndex:rn.activeBar},h.createElement(LD,{index:i.originalDataIndex},S)):S}function Xse(e){var t=e.shape,n=e.baseProps,r=e.entry,i=e.index,a=e.dataKey;return h.createElement(yw,so({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance}))}function Qse(e){var t,n=e.data,r=e.props,i=e.animationElapsedTime,a=e.isAnimating,s=e.isEntrance,l=(t=nr(r))!==null&&t!==void 0?t:{},c=l.id,u=mh(l,Rse),p=r.shape,d=r.dataKey,f=r.activeBar,m=r.onMouseEnter,g=r.onClick,v=r.onMouseLeave,x=mh(r,Dse),y=rw(m,d,c),b=iw(v),w=aw(g,d,c);return n?h.createElement(h.Fragment,null,n.map((j,k)=>h.createElement(LD,so({index:j.originalDataIndex,key:"rectangle-".concat(j==null?void 0:j.x,"-").concat(j==null?void 0:j.y,"-").concat(j==null?void 0:j.value,"-").concat(k),className:"recharts-bar-rectangle"},Qu(x,j,k),{onMouseEnter:y(j,j.originalDataIndex),onMouseLeave:b(j,j.originalDataIndex),onClick:w(j,j.originalDataIndex)}),f?h.createElement(Gse,{shape:p,activeBar:f,baseProps:u,entry:j,index:k,dataKey:d,animationElapsedTime:i,isAnimating:a,isEntrance:s}):h.createElement(Xse,{shape:p,baseProps:u,entry:j,index:k,dataKey:d,animationElapsedTime:i,isAnimating:a,isEntrance:s})))):null}var Zse=(e,t,n)=>e==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>{if(r.status==="removed")return n==="horizontal"?[mn(mn({},r.prev),{},{height:It(r.prev.height,0,t),y:It(r.prev.y,r.prev.y+r.prev.height,t)})]:[mn(mn({},r.prev),{},{width:It(r.prev.width,0,t)})];if(r.status==="matched")return[mn(mn({},r.next),{},{x:It(r.prev.x,r.next.x,t),y:It(r.prev.y,r.next.y,t),width:It(r.prev.width,r.next.width,t),height:It(r.prev.height,r.next.height,t)})];var i=r.next;return n==="horizontal"?[mn(mn({},i),{},{height:It(0,i.height,t),y:It(i.stackedBarStart,i.y,t)})]:[mn(mn({},i),{},{width:It(0,i.width,t),x:It(i.stackedBarStart,i.x,t)})]});function Jse(e){var t=e.props,n=e.previousRectanglesRef,r=t.data,i=t.isAnimationActive,a=t.animationBegin,s=t.animationDuration,l=t.animationEasing,c=t.animationInterpolateFn,u=t.layout,p=Xm(t.onAnimationStart,t.onAnimationEnd),d=p.isAnimating,f=p.handleAnimationStart,m=p.handleAnimationEnd;return h.createElement(Yse,{showLabels:!d,rects:r},h.createElement(Qm,{animationInput:r,animationIdPrefix:"recharts-bar-",items:r,previousItemsRef:n,isAnimationActive:i,animationBegin:a,animationDuration:s,animationEasing:l,onAnimationStart:f,onAnimationEnd:m,animationInterpolateFn:c,animationMatchBy:t.animationMatchBy,layout:u},(g,v,x)=>h.createElement(Yt,null,h.createElement(Qse,{props:t,data:g,animationElapsedTime:v,isAnimating:d||v<1,isEntrance:x}))),h.createElement(Mm,{label:t.label}),t.children)}function ele(e){var t=h.useRef(null);return h.createElement(Jse,{previousRectanglesRef:t,props:e})}var zD=0,tle=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:ht(e,t)}};class nle extends h.PureComponent{render(){var t=this.props,n=t.hide,r=t.data,i=t.dataKey,a=t.className,s=t.xAxisId,l=t.yAxisId,c=t.needClip,u=t.background,p=t.id;if(n||r==null)return null;var d=mt("recharts-bar",a),f=p;return h.createElement(Yt,{className:d,id:p},c&&h.createElement("defs",null,h.createElement(fw,{clipPathId:f,xAxisId:s,yAxisId:l})),h.createElement(Yt,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(f,")"):void 0},h.createElement(qse,{data:r,dataKey:i,background:u,allOtherBarProps:this.props}),h.createElement(ele,this.props)))}}var rle={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",animationInterpolateFn:Zse,animationMatchBy:sw,background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:zD,shape:gw,xAxisId:0,yAxisId:0,zIndex:rn.bar};function ile(e){var t=e.xAxisId,n=e.yAxisId,r=e.hide,i=e.legendType,a=e.minPointSize,s=e.activeBar,l=e.animationBegin,c=e.animationDuration,u=e.animationEasing,p=e.isAnimationActive,d=tg(t,n),f=d.needClip,m=mo(),g=Cn(),v=tw(e.children,bd),x=Te(w=>Pse(w,e.id,g,v));if(m!=="vertical"&&m!=="horizontal")return null;var y,b=x==null?void 0:x[0];return b==null||b.height==null||b.width==null?y=0:y=m==="vertical"?b.height/2:b.width/2,h.createElement(wD,{xAxisId:t,yAxisId:n,data:x,dataPointFormatter:tle,errorBarOffset:y},h.createElement(nle,so({},e,{layout:m,needClip:f,data:x,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:u,isAnimationActive:p})))}function ale(e){var t=e.layout,n=e.barSettings,r=n.dataKey,i=n.minPointSize,a=n.hasCustomShape,s=e.pos,l=e.bandSize,c=e.xAxis,u=e.yAxis,p=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,m=e.displayedData,g=e.offset,v=e.cells,x=e.parentViewBox,y=e.dataStartIndex,b=t==="horizontal"?u:c,w=f?b.scale.domain():null,j=KH({numericAxis:b}),k=b.scale.map(j);return m.map((S,A)=>{var T,D,O,_,R,X;if(f){var V=f[A+y];if(V==null)return null;T=$H(V,w)}else T=ht(S,r),Array.isArray(T)||(T=[j,T]);var I=cse(i,zD)(T[1],A);if(t==="horizontal"){var $,H=u.scale.map(T[0]),N=u.scale.map(T[1]);if(H==null||N==null)return null;D=Fk({axis:c,ticks:p,bandSize:l,offset:s.offset,entry:S,index:A}),O=($=N??H)!==null&&$!==void 0?$:void 0,_=s.size;var W=H-N;if(R=di(W)?0:W,X={x:D,y:g.top,width:_,height:g.height},Math.abs(I)>0&&Math.abs(R)<Math.abs(I)){var P=Sn(R||I)*(Math.abs(I)-Math.abs(R));O-=P,R+=P}}else{var U=c.scale.map(T[0]),le=c.scale.map(T[1]);if(U==null||le==null)return null;if(D=U,O=Fk({axis:u,ticks:d,bandSize:l,offset:s.offset,entry:S,index:A}),_=le-U,R=s.size,X={x:g.left,y:O,width:g.width,height:R},Math.abs(I)>0&&Math.abs(_)<Math.abs(I)){var E=Sn(_||I)*(Math.abs(I)-Math.abs(_));_+=E}}if(D==null||O==null||_==null||R==null||!a&&(_===0||R===0))return null;var he=mn(mn({},S),{},{stackedBarStart:k,x:D,y:O,width:_,height:R,value:f?T:T[1],payload:S,background:X,tooltipPosition:{x:D+_/2,y:O+R/2},parentViewBox:x,originalDataIndex:A},v&&v[A]&&v[A].props);return he}).filter(Boolean)}function ole(e){var t=dn(e,rle),n=Ise(t.stackId),r=Cn();return h.createElement(Zm,{id:t.id,type:"bar"},i=>h.createElement(h.Fragment,null,h.createElement(ow,{legendPayload:Hse(t)}),h.createElement(Vse,{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}),h.createElement(cw,{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&&t.shape!==gw}),h.createElement(or,{zIndex:t.zIndex},h.createElement(ile,so({},t,{id:i})))))}var $D=h.memo(ole,js);$D.displayName="Bar";var sle=["domain","range"],lle=["domain","range"];function o2(e,t){if(e==null)return{};var n,r,i=cle(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 cle(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 s2(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 BD(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=o2(e,sle),a=t.domain,s=t.range,l=o2(t,lle);return!s2(n,a)||!s2(r,s)?!1:js(i,l)}var ule=["type"],dle=["dangerouslySetInnerHTML","ticks","scale"],ple=["id","scale"];function zx(){return zx=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},zx.apply(null,arguments)}function l2(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 c2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l2(Object(n),!0).forEach(function(r){fle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fle(e,t,n){return(t=hle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hle(e){var t=mle(e,"string");return typeof t=="symbol"?t:t+""}function mle(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 $x(e,t){if(e==null)return{};var n,r,i=gle(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 gle(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 yle(e){var t=jt(),n=h.useRef(null),r=Rb(),i=e.type,a=$x(e,ule),s=mm(r,"xAxis",i),l=h.useMemo(()=>{if(s!=null)return c2(c2({},a),{},{type:s})},[a,s]);return h.useLayoutEffect(()=>{l!=null&&(n.current===null?t(Jre(l)):n.current!==l&&t(eie({prev:n.current,next:l})),n.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{n.current&&(t(tie(n.current)),n.current=null)},[t]),null}var vle=e=>{var t=e.xAxisId,n=e.className,r=Te(Ib),i=Cn(),a="xAxis",s=Te(f=>nR(f,a,t,i)),l=Te(f=>J_(f,t)),c=Te(f=>jZ(f,t)),u=Te(f=>T_(f,t));if(l==null||c==null||u==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var p=$x(e,dle);u.id,u.scale;var d=$x(u,ple);return h.createElement(dw,zx({},p,d,{x:c.x,y:c.y,width:l.width,height:l.height,className:mt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:s,axisType:a,axisId:t}))},xle={allowDataOverflow:fn.allowDataOverflow,allowDecimals:fn.allowDecimals,allowDuplicatedCategory:fn.allowDuplicatedCategory,angle:fn.angle,axisLine:da.axisLine,height:fn.height,hide:!1,includeHidden:fn.includeHidden,interval:fn.interval,label:!1,minTickGap:fn.minTickGap,mirror:fn.mirror,orientation:fn.orientation,padding:fn.padding,reversed:fn.reversed,scale:fn.scale,tick:fn.tick,tickCount:fn.tickCount,tickLine:da.tickLine,tickSize:da.tickSize,type:fn.type,niceTicks:fn.niceTicks,xAxisId:0},ble=e=>{var t=dn(e,xle);return h.createElement(h.Fragment,null,h.createElement(yle,{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}),h.createElement(vle,t))},Vo=h.memo(ble,BD);Vo.displayName="XAxis";var wle=["type"],jle=["dangerouslySetInnerHTML","ticks","scale"],Sle=["id","scale"];function Bx(){return Bx=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},Bx.apply(null,arguments)}function u2(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 d2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u2(Object(n),!0).forEach(function(r){kle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kle(e,t,n){return(t=Cle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cle(e){var t=Ple(e,"string");return typeof t=="symbol"?t:t+""}function Ple(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 Fx(e,t){if(e==null)return{};var n,r,i=Ale(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 Ale(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 Ele(e){var t=jt(),n=h.useRef(null),r=Rb(),i=e.type,a=Fx(e,wle),s=mm(r,"yAxis",i),l=h.useMemo(()=>{if(s!=null)return d2(d2({},a),{},{type:s})},[s,a]);return h.useLayoutEffect(()=>{l!=null&&(n.current===null?t(nie(l)):n.current!==l&&t(rie({prev:n.current,next:l})),n.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{n.current&&(t(iie(n.current)),n.current=null)},[t]),null}function Tle(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=h.useRef(null),s=h.useRef(null),l=Te(Ib),c=Cn(),u=jt(),p="yAxis",d=Te(y=>eR(y,t)),f=Te(y=>kZ(y,t)),m=Te(y=>nR(y,p,t,c)),g=Te(y=>I_(y,t));if(h.useLayoutEffect(()=>{if(!(r!=="auto"||!d||G1(i)||h.isValidElement(i)||g==null)){var y=a.current;if(y){var b=y.getCalculatedWidth();Math.round(d.width)!==Math.round(b)&&u(aie({id:t,width:b}))}}},[m,d,u,i,t,r,g]),d==null||f==null||g==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var v=Fx(e,jle);g.id,g.scale;var x=Fx(g,Sle);return h.createElement(dw,Bx({},v,x,{ref:a,labelRef:s,x:f.x,y:f.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:d.width,height:d.height,className:mt("recharts-".concat(p," ").concat(p),n),viewBox:l,ticks:m,axisType:p,axisId:t}))}var Ile={allowDataOverflow:hn.allowDataOverflow,allowDecimals:hn.allowDecimals,allowDuplicatedCategory:hn.allowDuplicatedCategory,angle:hn.angle,axisLine:da.axisLine,hide:!1,includeHidden:hn.includeHidden,interval:hn.interval,label:!1,minTickGap:hn.minTickGap,mirror:hn.mirror,orientation:hn.orientation,padding:hn.padding,reversed:hn.reversed,scale:hn.scale,tick:hn.tick,tickCount:hn.tickCount,tickLine:da.tickLine,tickSize:da.tickSize,type:hn.type,niceTicks:hn.niceTicks,width:hn.width,yAxisId:0},Ole=e=>{var t=dn(e,Ile);return h.createElement(h.Fragment,null,h.createElement(Ele,{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}),h.createElement(Tle,t))},qo=h.memo(Ole,BD);qo.displayName="YAxis";var Nle=(e,t)=>t,vw=G([Nle,ct,WM,Pn,bR,Ea,HJ,vn],ZJ);function Mle(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function xw(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Mle(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 FD=Tr("mouseClick"),UD=Ju();UD.startListening({actionCreator:FD,effect:(e,t)=>{var n=e.payload,r=vw(t.getState(),xw(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(BZ({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Ux=Tr("mouseMove"),WD=Ju(),Bs=null,So=null,by=null;WD.startListening({actionCreator:Ux,effect:(e,t)=>{var n=e.payload,r=t.getState(),i=r.eventSettings,a=i.throttleDelay,s=i.throttledEvents,l=s==="all"||(s==null?void 0:s.includes("mousemove"));Bs!==null&&(cancelAnimationFrame(Bs),Bs=null),So!==null&&(typeof a!="number"||!l)&&(clearTimeout(So),So=null),by=xw(n);var c=()=>{var u=t.getState(),p=yd(u,u.tooltip.settings.shared);if(!by){Bs=null,So=null;return}if(p==="axis"){var d=vw(u,by);(d==null?void 0:d.activeIndex)!=null?t.dispatch(uR({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(cR())}Bs=null,So=null};if(!l){c();return}a==="raf"?Bs=requestAnimationFrame(c):typeof a=="number"&&So===null&&(So=setTimeout(c,a))}});function _le(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 p2={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},KD=Gn({name:"rootProps",initialState:p2,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:p2.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}}}),Rle=KD.reducer,Dle=KD.actions.updateOptions,Lle=null,zle={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)},HD=Gn({name:"polarOptions",initialState:Lle,reducers:zle}),$le=HD.actions.updatePolarOptions,Ble=HD.reducer,VD=Tr("keyDown"),qD=Tr("focus"),YD=Tr("blur"),ng=Ju(),Fs=null,ko=null,cp=null;ng.startListening({actionCreator:VD,effect:(e,t)=>{cp=e.payload,Fs!==null&&(cancelAnimationFrame(Fs),Fs=null);var n=t.getState(),r=n.eventSettings,i=r.throttleDelay,a=r.throttledEvents,s=a==="all"||a.includes("keydown");ko!==null&&(typeof i!="number"||!s)&&(clearTimeout(ko),ko=null);var l=()=>{try{var c=t.getState(),u=c.rootProps.accessibilityLayer!==!1;if(!u)return;var p=c.tooltip.keyboardInteraction,d=cp;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=Xc(p,ms(c),Ll(c),zl(c)),m=f==null?-1:Number(f),g=!Number.isFinite(m)||m<0,v=Ea(c),x=ms(c),y=yd(c,c.tooltip.settings.shared);if(d==="Enter"){if(g)return;var b=oh(c,y,"hover",String(p.index));t.dispatch(ah({active:!p.active,activeIndex:p.index,activeCoordinate:b}));return}var w=TZ(c),j=w==="left-to-right"?1:-1,k=d==="ArrowRight"?1:-1,S;if(g){var A=Ll(c),T=zl(c),D=k*j,O=I=>({active:!1,index:String(I),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(S=-1,D>0){for(var _=0;_<x.length;_++)if(Xc(O(_),x,A,T)!=null){S=_;break}}else for(var R=x.length-1;R>=0;R--)if(Xc(O(R),x,A,T)!=null){S=R;break}if(S<0)return}else{S=m+k*j;var X=(v==null?void 0:v.length)||x.length;if(X===0||S>=X||S<0)return}var V=oh(c,y,"hover",String(S));t.dispatch(ah({active:!0,activeIndex:S.toString(),activeCoordinate:V}))}finally{Fs=null,ko=null}};if(!s){l();return}i==="raf"?Fs=requestAnimationFrame(l):typeof i=="number"&&ko===null&&(l(),cp=null,ko=setTimeout(()=>{cp?l():(ko=null,Fs=null)},i))}});ng.startListening({actionCreator:qD,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var a="0",s=yd(n,n.tooltip.settings.shared),l=oh(n,s,"hover",String(a));t.dispatch(ah({active:!0,activeIndex:a,activeCoordinate:l}))}}}});ng.startListening({actionCreator:YD,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;i.active&&t.dispatch(ah({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function GD(e){e.persist();var t=e.currentTarget;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 Dr=Tr("externalEvent"),XD=Ju(),up=new Map,Pc=new Map,wy=new Map;XD.startListening({actionCreator:Dr,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,s=GD(i);wy.set(a,{handler:r,reactEvent:s});var l=up.get(a);l!==void 0&&(cancelAnimationFrame(l),up.delete(a));var c=t.getState(),u=c.eventSettings,p=u.throttleDelay,d=u.throttledEvents,f=d,m=f==="all"||(f==null?void 0:f.includes(a)),g=Pc.get(a);g!==void 0&&(typeof p!="number"||!m)&&(clearTimeout(g),Pc.delete(a));var v=()=>{var b=wy.get(a);try{if(!b)return;var w=b.handler,j=b.reactEvent,k=t.getState(),S={activeCoordinate:IJ(k),activeDataKey:W1(k),activeIndex:oo(k),activeLabel:SR(k),activeTooltipIndex:oo(k),isTooltipActive:OJ(k)};w&&w(S,j)}finally{up.delete(a),Pc.delete(a),wy.delete(a)}};if(!m){v();return}if(p==="raf"){var x=requestAnimationFrame(v);up.set(a,x)}else if(typeof p=="number"){if(!Pc.has(a)){v();var y=setTimeout(v,p);Pc.set(a,y)}}else v()}}});var Fle=G([tc],e=>e.tooltipItemPayloads),Ule=G([Fle,(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 i=r.getPosition;if(i!=null)return i(t)}}}),QD=Tr("touchMove"),ZD=Ju(),Co=null,Na=null,f2=null,Ac=null;ZD.startListening({actionCreator:QD,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Ac=GD(n);var r=t.getState(),i=r.eventSettings,a=i.throttleDelay,s=i.throttledEvents,l=s==="all"||s.includes("touchmove");Co!==null&&(cancelAnimationFrame(Co),Co=null),Na!==null&&(typeof a!="number"||!l)&&(clearTimeout(Na),Na=null),f2=Array.from(n.touches).map(u=>xw({clientX:u.clientX,clientY:u.clientY,currentTarget:n.currentTarget}));var c=()=>{if(Ac!=null){var u=t.getState(),p=yd(u,u.tooltip.settings.shared);if(p==="axis"){var d,f=(d=f2)===null||d===void 0?void 0:d[0];if(f==null){Co=null,Na=null;return}var m=vw(u,f);(m==null?void 0:m.activeIndex)!=null&&t.dispatch(uR({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate}))}else if(p==="item"){var g,v=Ac.touches[0];if(document.elementFromPoint==null||v==null)return;var x=document.elementFromPoint(v.clientX,v.clientY);if(!x||!x.getAttribute)return;var y=x.getAttribute(YN),b=(g=x.getAttribute(GN))!==null&&g!==void 0?g:void 0,w=Cs(u).find(S=>S.id===b);if(y==null||w==null||b==null)return;var j=w.dataKey,k=Ule(u,y,b);t.dispatch(lR({activeDataKey:j,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:b}))}Co=null,Na=null}};if(!l){c();return}a==="raf"?Co=requestAnimationFrame(c):typeof a=="number"&&Na===null&&(c(),Ac=null,Na=setTimeout(()=>{Ac?c():(Na=null,Co=null)},a))}}});var bw={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},JD=Gn({name:"eventSettings",initialState:bw,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),Wle=JD.actions.setEventSettings,Kle=JD.reducer,Hle=mN({brush:Eie,cartesianAxis:oie,chartData:Aee,errorBars:Vae,eventSettings:Kle,graphicalItems:ure,layout:_H,legend:V7,options:jee,polarAxis:gne,polarOptions:Ble,referenceElements:Nie,renderedTicks:eae,rootProps:Rle,tooltip:FZ,zIndex:dee}),Vle=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return aH({reducer:Hle,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([UD.middleware,WD.middleware,ng.middleware,XD.middleware,ZD.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(IN({type:"raf"}))},devTools:{serialize:{replacer:_le},name:"recharts-".concat(n)}})};function eL(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=Cn(),a=h.useRef(null);if(i)return n;a.current==null&&(a.current=Vle(t,r));var s=Sb;return h.createElement(hV,{context:s,store:a.current},n)}function qle(e){var t=e.layout,n=e.margin,r=jt(),i=Cn();return h.useEffect(()=>{i||(r(OH(t)),r(IH(n)))},[r,i,t,n]),null}var tL=h.memo(qle,js);function nL(e){var t=jt();return h.useEffect(()=>{t(Dle(e))},[t,e]),null}var Yle=e=>{var t=jt();return h.useEffect(()=>{t(Wle(e))},[t,e]),null},rL=h.memo(Yle,js);function h2(e){var t=e.zIndex,n=e.isPanorama,r=h.useRef(null),i=jt();return h.useLayoutEffect(()=>(r.current&&i(cee({zIndex:t,element:r.current,isPanorama:n})),()=>{i(uee({zIndex:t,isPanorama:n}))}),[i,t,n]),h.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function m2(e){var t=e.children,n=e.isPanorama,r=Te(eee);if(!r||r.length===0)return t;var i=r.filter(s=>s<0),a=r.filter(s=>s>0);return h.createElement(h.Fragment,null,i.map(s=>h.createElement(h2,{key:s,zIndex:s,isPanorama:n})),t,a.map(s=>h.createElement(h2,{key:s,zIndex:s,isPanorama:n})))}var Gle=["children"];function Xle(e,t){if(e==null)return{};var n,r,i=Qle(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 Qle(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 gh(){return gh=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},gh.apply(null,arguments)}var Zle={width:"100%",height:"100%",display:"block"},Jle=h.forwardRef((e,t)=>{var n=Mb(),r=_b(),i=dM();if(!Ui(n)||!Ui(r))return null;var a=e.children,s=e.otherAttributes,l=e.title,c=e.desc,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),h.createElement(mb,gh({},s,{title:l,desc:c,role:p,tabIndex:u,width:n,height:r,style:Zle,ref:t}),a)}),ece=e=>{var t=e.children,n=Te(cm);if(!n)return null;var r=n.width,i=n.height,a=n.y,s=n.x;return h.createElement(mb,{width:r,height:i,x:s,y:a},t)},g2=h.forwardRef((e,t)=>{var n=e.children,r=Xle(e,Gle),i=Cn();return i?h.createElement(ece,null,h.createElement(m2,{isPanorama:!0},n)):h.createElement(Jle,gh({ref:t},r),h.createElement(m2,{isPanorama:!1},n))});function tce(e,t){return ace(e)||ice(e,t)||rce(e,t)||nce()}function nce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
484
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rce(e,t){if(e){if(typeof e=="string")return y2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y2(e,t):void 0}}function y2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ice(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function ace(e){if(Array.isArray(e))return e}function oce(){var e=jt(),t=h.useState(null),n=tce(t,2),r=n[0],i=n[1],a=Te(XH);return h.useEffect(()=>{if(r!=null){var s=r.getBoundingClientRect(),l=s.width/r.offsetWidth;et(l)&&l!==a&&e(MH(l))}},[r,e,a]),i}function v2(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 sce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v2(Object(n),!0).forEach(function(r){lce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lce(e,t,n){return(t=cce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cce(e){var t=uce(e,"string");return typeof t=="symbol"?t:t+""}function uce(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 no(){return no=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},no.apply(null,arguments)}function yh(e,t){return hce(e)||fce(e,t)||pce(e,t)||dce()}function dce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
485
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pce(e,t){if(e){if(typeof e=="string")return x2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x2(e,t):void 0}}function x2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function hce(e){if(Array.isArray(e))return e}var mce=()=>(Dee(),null);function vh(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var gce=h.forwardRef((e,t)=>{var n,r,i=h.useRef(null),a=h.useState({containerWidth:vh((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:vh((r=e.style)===null||r===void 0?void 0:r.height)}),s=yh(a,2),l=s[0],c=s[1],u=h.useCallback((d,f)=>{c(m=>{var g=Math.round(d),v=Math.round(f);return m.containerWidth===g&&m.containerHeight===v?m:{containerWidth:g,containerHeight:v}})},[]),p=h.useCallback(d=>{if(typeof t=="function"&&t(d),i.current!=null&&(i.current.disconnect(),i.current=null),d!=null&&typeof ResizeObserver<"u"){var f=d.getBoundingClientRect(),m=f.width,g=f.height;u(m,g);var v=y=>{var b=y[0];if(b!=null){var w=b.contentRect,j=w.width,k=w.height;u(j,k)}},x=new ResizeObserver(v);x.observe(d),i.current=x}},[t,u]);return h.useEffect(()=>()=>{var d=i.current;d!=null&&d.disconnect()},[u]),h.createElement(h.Fragment,null,h.createElement(td,{width:l.containerWidth,height:l.containerHeight}),h.createElement("div",no({ref:p},e)))}),yce=h.forwardRef((e,t)=>{var n=e.width,r=e.height,i=h.useState({containerWidth:vh(n),containerHeight:vh(r)}),a=yh(i,2),s=a[0],l=a[1],c=h.useCallback((p,d)=>{l(f=>{var m=Math.round(p),g=Math.round(d);return f.containerWidth===m&&f.containerHeight===g?f:{containerWidth:m,containerHeight:g}})},[]),u=h.useCallback(p=>{if(typeof t=="function"&&t(p),p!=null){var d=p.getBoundingClientRect(),f=d.width,m=d.height;c(f,m)}},[t,c]);return h.createElement(h.Fragment,null,h.createElement(td,{width:s.containerWidth,height:s.containerHeight}),h.createElement("div",no({ref:u},e)))}),vce=h.forwardRef((e,t)=>{var n=e.width,r=e.height;return h.createElement(h.Fragment,null,h.createElement(td,{width:n,height:r}),h.createElement("div",no({ref:t},e)))}),xce=h.forwardRef((e,t)=>{var n=e.width,r=e.height;return typeof n=="string"||typeof r=="string"?h.createElement(yce,no({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?h.createElement(vce,no({},e,{width:n,height:r,ref:t})):h.createElement(h.Fragment,null,h.createElement(td,{width:n,height:r}),h.createElement("div",no({ref:t},e)))});function bce(e){return e?gce:xce}var wce=h.forwardRef((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,s=e.onContextMenu,l=e.onDoubleClick,c=e.onMouseDown,u=e.onMouseEnter,p=e.onMouseLeave,d=e.onMouseMove,f=e.onMouseUp,m=e.onTouchEnd,g=e.onTouchMove,v=e.onTouchStart,x=e.style,y=e.width,b=e.responsive,w=e.dispatchTouchEvents,j=w===void 0?!0:w,k=h.useRef(null),S=jt(),A=h.useState(null),T=yh(A,2),D=T[0],O=T[1],_=h.useState(null),R=yh(_,2),X=R[0],V=R[1],I=oce(),$=Ob(),H=($==null?void 0:$.width)>0?$.width:y,N=($==null?void 0:$.height)>0?$.height:i,W=h.useCallback(ne=>{I(ne),typeof t=="function"&&t(ne),O(ne),V(ne),ne!=null&&(k.current=ne)},[I,t,O,V]),P=h.useCallback(ne=>{S(FD(ne)),S(Dr({handler:a,reactEvent:ne}))},[S,a]),U=h.useCallback(ne=>{S(Ux(ne)),S(Dr({handler:u,reactEvent:ne}))},[S,u]),le=h.useCallback(ne=>{S(cR()),S(Dr({handler:p,reactEvent:ne}))},[S,p]),E=h.useCallback(ne=>{S(Ux(ne)),S(Dr({handler:d,reactEvent:ne}))},[S,d]),he=h.useCallback(()=>{S(qD())},[S]),ye=h.useCallback(()=>{S(YD())},[S]),Q=h.useCallback(ne=>{S(VD(ne.key))},[S]),ie=h.useCallback(ne=>{S(Dr({handler:s,reactEvent:ne}))},[S,s]),je=h.useCallback(ne=>{S(Dr({handler:l,reactEvent:ne}))},[S,l]),Z=h.useCallback(ne=>{S(Dr({handler:c,reactEvent:ne}))},[S,c]),re=h.useCallback(ne=>{S(Dr({handler:f,reactEvent:ne}))},[S,f]),pe=h.useCallback(ne=>{S(Dr({handler:v,reactEvent:ne}))},[S,v]),se=h.useCallback(ne=>{j&&S(QD(ne)),S(Dr({handler:g,reactEvent:ne}))},[S,j,g]),_e=h.useCallback(ne=>{S(Dr({handler:m,reactEvent:ne}))},[S,m]),ke=bce(b);return h.createElement(NR.Provider,{value:D},h.createElement(jO.Provider,{value:X},h.createElement(ke,{width:H??(x==null?void 0:x.width),height:N??(x==null?void 0:x.height),className:mt("recharts-wrapper",r),style:sce({position:"relative",cursor:"default",width:H,height:N},x),onClick:P,onContextMenu:ie,onDoubleClick:je,onFocus:he,onBlur:ye,onKeyDown:Q,onMouseDown:Z,onMouseEnter:U,onMouseLeave:le,onMouseMove:E,onMouseUp:re,onTouchEnd:_e,onTouchMove:se,onTouchStart:pe,ref:W},h.createElement(mce,null),n)))}),jce=["width","height","responsive","children","className","style","compact","title","desc"];function Sce(e,t){if(e==null)return{};var n,r,i=kce(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 kce(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 iL=h.forwardRef((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,s=e.className,l=e.style,c=e.compact,u=e.title,p=e.desc,d=Sce(e,jce),f=nr(d);return c?h.createElement(h.Fragment,null,h.createElement(td,{width:n,height:r}),h.createElement(g2,{otherAttributes:f,title:u,desc:p},a)):h.createElement(wce,{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},h.createElement(g2,{otherAttributes:f,title:u,desc:p,ref:t},h.createElement($ie,null,a)))});function Wx(){return Wx=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},Wx.apply(null,arguments)}function b2(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 Cce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b2(Object(n),!0).forEach(function(r){Pce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pce(e,t,n){return(t=Ace(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ace(e){var t=Ece(e,"string");return typeof t=="symbol"?t:t+""}function Ece(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 Tce={top:5,right:5,bottom:5,left:5},Ice=Cce({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Tce,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},bw),rg=h.forwardRef(function(t,n){var r,i=dn(t.categoricalChartProps,Ice),a=t.chartName,s=t.defaultTooltipEventType,l=t.validateTooltipEventTypes,c=t.tooltipPayloadSearcher,u=t.categoricalChartProps,p={chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return h.createElement(eL,{preloadedState:{options:p},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},h.createElement(pD,{chartData:u.data}),h.createElement(tL,{layout:i.layout,margin:i.margin}),h.createElement(rL,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),h.createElement(nL,{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}),h.createElement(iL,Wx({},i,{ref:n})))}),Oce=["axis"],Kx=h.forwardRef((e,t)=>h.createElement(rg,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Oce,tooltipPayloadSearcher:xd,categoricalChartProps:e,ref:t})),Nce=["axis","item"],Mce=h.forwardRef((e,t)=>h.createElement(rg,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Nce,tooltipPayloadSearcher:xd,categoricalChartProps:e,ref:t}));function _ce(e){var t=jt();return h.useEffect(()=>{t($le(e))},[t,e]),null}var Rce=["layout"];function Hx(){return Hx=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},Hx.apply(null,arguments)}function Dce(e,t){if(e==null)return{};var n,r,i=Lce(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 Lce(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 w2(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 zce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w2(Object(n),!0).forEach(function(r){$ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ce(e,t,n){return(t=Bce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bce(e){var t=Fce(e,"string");return typeof t=="symbol"?t:t+""}function Fce(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 Uce={top:5,right:5,bottom:5,left:5},aL=zce({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Uce,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},bw),Wce=h.forwardRef(function(t,n){var r,i=dn(t.categoricalChartProps,aL),a=i.layout,s=Dce(i,Rce),l=t.chartName,c=t.defaultTooltipEventType,u=t.validateTooltipEventTypes,p=t.tooltipPayloadSearcher,d={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:p,eventEmitter:void 0};return h.createElement(eL,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},h.createElement(pD,{chartData:i.data}),h.createElement(tL,{layout:a,margin:i.margin}),h.createElement(rL,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),h.createElement(nL,{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}),h.createElement(_ce,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),h.createElement(iL,Hx({},s,{ref:n})))});function j2(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 S2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j2(Object(n),!0).forEach(function(r){Kce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kce(e,t,n){return(t=Hce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hce(e){var t=Vce(e,"string");return typeof t=="symbol"?t:t+""}function Vce(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 qce=["item"],Yce=S2(S2({},aL),{},{layout:"centric",startAngle:0,endAngle:360}),Gce=h.forwardRef((e,t)=>{var n=dn(e,Yce);return h.createElement(Wce,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:qce,tooltipPayloadSearcher:xd,categoricalChartProps:n,ref:t})}),Xce=["axis"],Qce=h.forwardRef((e,t)=>h.createElement(rg,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Xce,tooltipPayloadSearcher:xd,categoricalChartProps:e,ref:t})),Zce=["axis"],Jce=h.forwardRef((e,t)=>h.createElement(rg,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Zce,tooltipPayloadSearcher:xd,categoricalChartProps:e,ref:t}));const eue={background:"var(--bg-card)",borderRadius:"16px",border:"1px solid var(--border-primary)",padding:"20px",marginTop:"24px"},tue={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",cursor:"pointer",fontSize:"13px"},jy={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"13px"};function dp(e){return e?e>=1e3?`${(e/1e3).toFixed(2)}s`:`${Math.round(e)}ms`:"-"}function Ma(e){return e?Math.round(e).toLocaleString():"-"}function nue(e){return`${(e*100).toFixed(1)}%`}function rue(e,t){return e?e.slice(-t):[]}function iue(){const[e,t]=h.useState("service"),[n,r]=h.useState("ttft"),[i,a]=h.useState(24),[s,l]=h.useState("overview"),[c,u]=h.useState(null),[p,d]=h.useState(null),[f,m]=h.useState(null),[g,v]=h.useState(null),[x,y]=h.useState("desc"),[b,w]=h.useState([]),[j,k]=h.useState([]),[S,A]=h.useState(null),[T,D]=h.useState(null),[O,_]=h.useState(null),[R,X]=h.useState(!1),[V,I]=h.useState(null),$=h.useCallback(async()=>{X(!0),I(null);try{s==="overview"?e==="service"?w(await q.getPerformanceServicesOverview()||[]):k(await q.getPerformanceVendors()||[]):s==="vendor"&&c?A(await q.getPerformanceVendor(c)):s==="service"&&p?D(await q.getPerformanceService(p)):s==="model"&&p&&f&&_(await q.getPerformanceModel(p,f))}catch(ne){I((ne==null?void 0:ne.message)||"加载失败")}finally{X(!1)}},[e,s,c,p,f]);h.useEffect(()=>{$()},[$]);const H=ne=>{t(ne),l("overview"),u(null),d(null),m(null),A(null),D(null),_(null),v(null)},N=ne=>{u(ne),d(null),m(null),A(null),D(null),_(null),l("vendor"),v(null)},W=ne=>{d(ne),m(null),D(null),_(null),l("service"),v(null)},P=ne=>{m(ne),_(null),l("model"),v(null)},U=()=>{u(null),d(null),m(null),l("overview"),v(null)},le=()=>{d(null),m(null),D(null),l("vendor"),v(null)},E=h.useMemo(()=>s==="overview"&&e==="service"?b.map(ne=>({id:ne.serviceId,name:ne.serviceName||ne.serviceId,vendorName:ne.vendorName,derived:ne.derived,onClick:()=>W(ne.serviceId)})):s==="overview"&&e==="vendor"?j.map(ne=>({id:ne.vendorId,name:ne.vendorName||ne.vendorId,derived:ne.derived,onClick:()=>N(ne.vendorId)})):s==="vendor"&&S?S.services.map(ne=>({id:ne.serviceId,name:ne.serviceName||ne.serviceId,vendorName:S.vendorName,derived:ne.derived,onClick:()=>W(ne.serviceId)})):s==="service"&&T?T.models.map(ne=>({id:ne.model,name:ne.model,vendorName:T.vendorName,serviceName:T.serviceName,derived:ne.derived,onClick:()=>P(ne.model)})):[],[s,e,b,j,S,T]),he=h.useMemo(()=>{if(!g)return E;const ne=x==="asc"?1:-1;return[...E].sort((Le,qe)=>{const ze=Le.derived[g]??0,Ke=qe.derived[g]??0;return(ze-Ke)*ne})},[E,g,x]),ye=ne=>{g===ne?y(Le=>Le==="asc"?"desc":"asc"):(v(ne),y("desc"))},Q=ne=>g!==ne?" ⇅":x==="asc"?" ▲":" ▼",ie=(()=>{if(s==="vendor")return S==null?void 0:S.hourly;if(s==="service")return T==null?void 0:T.hourly;if(s==="model")return O==null?void 0:O.hourly})(),Z=rue(ie,i).map(ne=>n==="tokens"?{hour:ne.hour.slice(11),inputTokens:ne.inputTokens||0,outputTokens:ne.outputTokens||0,totalTokens:ne.totalTokens||0}:{hour:ne.hour.slice(11),value:n==="ttft"?ne.avgTtftMs:ne.avgTpm}),re=s==="overview"&&e==="service"||s==="vendor"||s==="service",pe=s==="service",se=s==="overview"&&e==="vendor"?"供应商":s==="service"?"模型":"API 服务",_e=n==="ttft"?"首 Token 返回时间":n==="tpm"?"吞吐 TPM":"Token量",ke=s==="model"?O==null?void 0:O.derived:void 0;return o.jsxs("div",{style:eue,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:U,style:Sy,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:le,style:Sy,children:(S==null?void 0:S.vendorName)||c})]}),T&&(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:T.serviceName||p}):o.jsx("span",{onClick:()=>{m(null),_(null),l("service"),v(null)},style:Sy,children:T.serviceName||p})]}),f&&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:f})]})]})]}),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:[s==="overview"&&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:jy,value:e,onChange:ne=>H(ne.target.value),children:[o.jsx("option",{value:"service",children:"API 服务"}),o.jsx("option",{value:"vendor",children:"供应商"})]})]}),s!=="overview"&&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:jy,value:n,onChange:ne=>r(ne.target.value),children:[o.jsx("option",{value:"ttft",children:"首 Token 返回时间"}),o.jsx("option",{value:"tpm",children:"吞吐 TPM"}),o.jsx("option",{value:"tokens",children:"Token量"})]})]}),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:jy,value:i,onChange:ne=>a(Number(ne.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:tue,onClick:$,children:"🔄 刷新"})]}),V&&o.jsx("div",{style:{color:"#e74c3c",marginBottom:"12px"},children:V}),(()=>{const ne=(re?1:0)+(pe?1:0),Le=n==="tokens"?3:2,qe=1+ne+Le+2;return 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:Si,children:se}),re&&o.jsx("th",{style:Si,children:"供应商"}),pe&&o.jsx("th",{style:Si,children:"API 服务"}),n==="tokens"?o.jsxs(o.Fragment,{children:[o.jsx("th",{style:Si,children:"输入Token"}),o.jsx("th",{style:Si,children:"输出Token"}),o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("totalTokens"),children:["总Token",Q("totalTokens")]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("avgTtftMs"),children:["平均首Token",Q("avgTtftMs")]}),o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("avgTpm"),children:["平均 TPM",Q("avgTpm")]})]}),o.jsx("th",{style:Si,children:"样本数"}),o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("successRate"),children:["成功率",Q("successRate")]})]})}),o.jsxs("tbody",{children:[R&&o.jsx("tr",{children:o.jsx("td",{style:Rr,colSpan:qe,align:"center",children:"加载中..."})}),!R&&he.length===0&&o.jsx("tr",{children:o.jsx("td",{style:{...Rr,color:"var(--text-muted)"},colSpan:qe,align:"center",children:"暂无数据"})}),!R&&he.map(ze=>o.jsxs("tr",{style:aue,children:[o.jsx("td",{style:Rr,children:o.jsx("span",{style:{color:"var(--text-primary)",cursor:"pointer",textDecoration:"underline"},onClick:ze.onClick,children:ze.name})}),re&&o.jsx("td",{style:{...Rr,color:"var(--text-muted)"},children:ze.vendorName||"-"}),pe&&o.jsx("td",{style:{...Rr,color:"var(--text-muted)"},children:ze.serviceName||"-"}),n==="tokens"?o.jsxs(o.Fragment,{children:[o.jsx("td",{style:Rr,children:ze.derived.totalInputTokens!=null?Ma(ze.derived.totalInputTokens):"-"}),o.jsx("td",{style:Rr,children:ze.derived.totalOutputTokens!=null?Ma(ze.derived.totalOutputTokens):"-"}),o.jsx("td",{style:Rr,children:ze.derived.totalTokens!=null?Ma(ze.derived.totalTokens):"-"})]}):o.jsxs(o.Fragment,{children:[o.jsx("td",{style:Rr,children:dp(ze.derived.avgTtftMs)}),o.jsx("td",{style:Rr,children:ze.derived.count>0?Ma(ze.derived.avgTpm):"-"})]}),o.jsx("td",{style:Rr,children:ze.derived.count}),o.jsx("td",{style:Rr,children:nue(ze.derived.successRate)})]},ze.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:[_e," · 按小时走势",ke&&n!=="tokens"&&o.jsxs("span",{style:{marginLeft:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["最小 ",n==="ttft"?dp(ke.minTtftMs):Ma(ke.minTps?ke.minTps*60:void 0)," / 最大 ",n==="ttft"?dp(ke.maxTtftMs):Ma(ke.maxTps?ke.maxTps*60:void 0)]})]}),Z.length===0?o.jsx("div",{style:{color:"var(--text-muted)",padding:"24px",textAlign:"center"},children:"暂无走势数据"}):o.jsx(Hs,{width:"100%",height:260,children:n==="tokens"?o.jsxs(Jce,{data:Z,margin:{top:8,right:16,bottom:0,left:8},children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"perfTotalTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:"#667eea",stopOpacity:.35}),o.jsx("stop",{offset:"100%",stopColor:"#667eea",stopOpacity:.04})]})}),o.jsx(Ho,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Vo,{dataKey:"hour",stroke:"var(--text-muted)",fontSize:12}),o.jsx(qo,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Ro,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px"},formatter:(ne,Le)=>[Ma(Number(ne)),Le]}),o.jsx(ol,{wrapperStyle:{fontSize:12}}),o.jsx(hh,{type:"monotone",dataKey:"totalTokens",name:"总Token",stroke:"#667eea",strokeWidth:2,fill:"url(#perfTotalTokens)",dot:!1}),o.jsx(ts,{type:"monotone",dataKey:"inputTokens",name:"输入Token",stroke:"#37d67a",strokeWidth:2,dot:!1}),o.jsx(ts,{type:"monotone",dataKey:"outputTokens",name:"输出Token",stroke:"#f5a623",strokeWidth:2,dot:!1})]}):o.jsxs(Kx,{data:Z,margin:{top:8,right:16,bottom:0,left:8},children:[o.jsx(Ho,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Vo,{dataKey:"hour",stroke:"var(--text-muted)",fontSize:12}),o.jsx(qo,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Ro,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px"},formatter:ne=>[n==="ttft"?dp(Number(ne)):Ma(Number(ne)),_e]}),o.jsx(ts,{type:"monotone",dataKey:"value",stroke:"#667eea",strokeWidth:2,dot:!1,name:_e})]})})]})]})}const Si={textAlign:"left",padding:"10px 12px",borderBottom:"2px solid var(--border-primary)",color:"var(--text-muted)",fontWeight:500,fontSize:"12px"},Rr={padding:"10px 12px",borderBottom:"1px solid var(--border-primary)",color:"var(--text-primary)"},Sy={color:"var(--text-primary)",cursor:"pointer",textDecoration:"underline",textDecorationColor:"transparent"},aue={transition:"background 0.15s"},k2=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#f97316"];function oue(){const[e,t]=h.useState(null),[n,r]=h.useState(!0),[i,a]=h.useState(30);h.useEffect(()=>{s()},[i]);const s=async()=>{try{r(!0);const d=await q.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 f=Math.floor(d/60),m=d%60;return`${f}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(Hs,{width:"100%",height:300,children:o.jsxs(Qce,{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(Ho,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Vo,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>bt(d).format("MM/DD")}),o.jsx(qo,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Ro,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>bt(d).format("YYYY-MM-DD")}),o.jsx(ol,{}),o.jsx(hh,{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(Hs,{width:"100%",height:300,children:o.jsxs(Kx,{data:e.timeline,children:[o.jsx(Ho,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Vo,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>bt(d).format("MM/DD")}),o.jsx(qo,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d?l(Number(d)):""}),o.jsx(Ro,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>bt(d).format("YYYY-MM-DD"),formatter:d=>d?l(Number(d)):""}),o.jsx(ol,{}),o.jsx(ts,{type:"monotone",dataKey:"totalInputTokens",name:"输入 Tokens",stroke:"#10b981",strokeWidth:2,dot:!1}),o.jsx(ts,{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(Hs,{width:"100%",height:300,children:o.jsxs(Kx,{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(Ho,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Vo,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>bt(d).format("MM/DD")}),o.jsx(qo,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d!=null?d>=60?`${Math.round(Number(d)/60)}h`:`${Number(d)}m`:""}),o.jsx(Ro,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>bt(d).format("YYYY-MM-DD"),formatter:d=>d!=null?c(Number(d)):""}),o.jsx(ol,{}),o.jsx(hh,{type:"monotone",dataKey:"codingTime",name:"编程时长",stroke:"#8b5cf6",fillOpacity:1,fill:"url(#colorCodingTime)"}),o.jsx(ts,{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(Hs,{width:"100%",height:300,children:o.jsxs(Mce,{data:e.byVendor,children:[o.jsx(Ho,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(Vo,{dataKey:"vendorName",stroke:"var(--text-muted)",fontSize:12,angle:-45,textAnchor:"end",height:80}),o.jsx(qo,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Ro,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"}}),o.jsx(ol,{}),o.jsx($D,{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(Hs,{width:"100%",height:300,children:o.jsxs(Gce,{children:[o.jsx(lD,{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,f)=>o.jsx(bd,{fill:k2[f%k2.length]},`cell-${f}`))}),o.jsx(Ro,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},formatter:(d,f,m)=>{var b,w;const g=d??0,v=((b=m.payload)==null?void 0:b.percentage)??0,x=((w=m.payload)==null?void 0:w.contentType)||"",y=u[x]||x;return`${g} (${v}%) - ${y}`}})]})})]})]}),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":d.targetType==="opencode"?"OpenCode":"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(iue,{})]})}function C2({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}const ky=e=>e==="claude-code"?"Claude Code":e==="opencode"?"OpenCode":"Codex";function sue(){const[e,t]=h.useState(!1),[n,r]=h.useState([]),[i,a]=h.useState(!0),[s,l]=h.useState({skillId:null,skillName:"",isDeleting:!1}),[c,u]=h.useState(!1),[p,d]=h.useState({name:"",description:"",instruction:"",link:"",targets:[]}),[f,m]=h.useState(!1),[g,v]=h.useState(!1),[x,y]=h.useState(""),[b,w]=h.useState(""),[j,k]=h.useState(!1),[S,A]=h.useState([]),[T,D]=h.useState(!1),[O,_]=h.useState({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}),R=async()=>{try{a(!0);const Q=await q.getInstalledSkills();r(Q)}catch(Q){console.error("Failed to load installed skills:",Q),K.error("加载已安装 Skills 失败")}finally{a(!1)}};h.useEffect(()=>{R()},[]);const X=async()=>{const Q=b.trim();if(!Q){K.warning("请输入需求描述后再搜索");return}try{k(!0),D(!0);const je=(await q.searchSkills(Q)).sort((Z,re)=>{const pe=Z.stars??0;return(re.stars??0)-pe});A(je)}catch(ie){console.error("Failed to search skills:",ie),K.error("搜索失败,请稍后重试")}finally{k(!1)}},V=Q=>{_({skill:Q,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},I=()=>{O.isInstalling||_({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},$=(Q,ie)=>{_(je=>({...je,selectedTargets:ie?[...je.selectedTargets,Q]:je.selectedTargets.filter(Z=>Z!==Q)}))},H=async()=>{var Q;if(O.skill)try{_(je=>({...je,isInstalling:!0,status:"preparing",message:"正在准备安装...",progress:0})),_(je=>({...je,status:"downloading",message:"正在从GitHub下载..."}));const ie=await q.installSkill(O.skill,O.selectedTargets[0]);if(ie.success){const je=O.selectedTargets,Z=(Q=ie.installedSkill)==null?void 0:Q.id;if(!Z){_(pe=>({...pe,status:"error",message:"安装返回数据异常"})),K.error("安装返回数据异常");return}let re=0;for(const pe of je)(await q.enableSkill(Z,pe)).success&&re++;_(pe=>({...pe,status:"completed",message:je.length>0?`安装完成!已启用 ${re}/${je.length} 个目标`:"安装完成!可在列表中启用目标",progress:100})),je.length>0?K.success(`已安装到 ${je.map(pe=>ky(pe)).join(", ")}`):K.success("安装完成!可在列表中启用目标"),await R()}else _(je=>({...je,status:"error",message:ie.message?`${ie.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试"})),K.error(ie.message?`${ie.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试")}catch(ie){console.error("Failed to install skill:",ie),_(je=>({...je,status:"error",message:"安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理"})),K.error("安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理")}finally{setTimeout(()=>{_(ie=>({...ie,skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}))},2e3)}},N=async(Q,ie,je)=>{try{je?(await q.enableSkill(Q,ie),K.success(`已启用 ${ky(ie)}`)):(await q.disableSkill(Q,ie),K.success(`已禁用 ${ky(ie)}`)),await R()}catch(Z){console.error("Failed to toggle skill:",Z),K.error("操作失败,请稍后重试")}},W=Q=>{l({skillId:Q.id,skillName:Q.name,isDeleting:!1})},P=()=>{s.isDeleting||l({skillId:null,skillName:"",isDeleting:!1})},U=async()=>{if(s.skillId)try{l(Q=>({...Q,isDeleting:!0})),await q.deleteSkill(s.skillId),K.success("已删除 Skill"),await R(),P()}catch(Q){console.error("Failed to delete skill:",Q),K.error("删除失败,请稍后重试"),l(ie=>({...ie,isDeleting:!1}))}},le=()=>{try{const Q=x.trim();if(!Q){K.error("请粘贴 SKILL.md 内容");return}let ie="",je="",Z=Q;if(Q.startsWith("---")){const re=Q.indexOf("---",3);if(re!==-1){const pe=Q.slice(3,re),se=Q.match(/^#\s+(.+)$/m);ie=se?se[1].trim():"";const _e=pe.split(`
486
+ `);for(const ke of _e)ke.startsWith("name:")?ie=ke.replace("name:","").trim():ke.startsWith("description:")&&(je=ke.replace("description:","").trim());Z=Q.slice(re+3).trim(),Z=Z.replace(/^##\s+指令\n*/,"").trim()}}else{const re=Q.match(/^#\s+(.+)$/m);re&&(ie=re[1].trim())}if(!ie){K.error("无法解析 Skill 名称");return}d(re=>({...re,name:ie,description:je||re.description,instruction:Z||re.instruction})),v(!1),y(""),K.success("解析成功")}catch(Q){console.error("Failed to parse skill:",Q),K.error("解析失败,请检查格式")}},E=async Q=>{var ie;if(Q.preventDefault(),!p.name.trim()){K.error("请填写 Skill 名称");return}if(!p.description.trim()){K.error("请填写描述");return}if(!p.instruction.trim()){K.error("请填写指令");return}try{m(!0);const je=await q.createLocalSkill({name:p.name.trim(),description:p.description.trim(),instruction:p.instruction.trim(),link:p.link.trim()||void 0,targets:p.targets});if(je.success){K.success("Skill 创建成功"),u(!1),d({name:"",description:"",instruction:"",link:"",targets:[]}),await R();for(const Z of p.targets)(ie=je.installedSkill)!=null&&ie.id&&await q.enableSkill(je.installedSkill.id,Z)}else K.error(je.message||"创建失败")}catch(je){console.error("Failed to create skill:",je),K.error("创建失败,请稍后重试")}finally{m(!1)}},he=()=>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(Q=>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:Q.name}),o.jsxs("div",{style:{display:"flex",gap:"8px",flexShrink:0},children:[Q.githubUrl&&o.jsx("a",{href:Q.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:()=>W(Q),style:{padding:"6px 12px",fontSize:"12px"},children:"删除"})]})]}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{className:"skill-description",children:Q.description||"暂无描述"}),o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(Q.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(Vg,{skillId:Q.id,targetType:"claude-code",enabled:Q.enabledTargets.includes("claude-code"),onChange:N}),o.jsx(Vg,{skillId:Q.id,targetType:"codex",enabled:Q.enabledTargets.includes("codex"),onChange:N}),o.jsx(Vg,{skillId:Q.id,targetType:"opencode",enabled:Q.enabledTargets.includes("opencode"),onChange:N})]})]},Q.id))}),ye=()=>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:Q=>w(Q.target.value),placeholder:"请输入你的需求...",className:"skills-search-input"}),o.jsx("div",{className:"skills-search-actions",children:o.jsx("button",{className:"btn btn-primary",onClick:X,disabled:j,children:j?"搜索中...":"搜索"})})]}),o.jsxs("div",{className:"skills-results",children:[j&&o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在进行 AI 搜索..."})}),!j&&T&&S.length===0&&o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"没有找到匹配的 Skills"}),o.jsx("span",{children:"试试换个描述或添加更多细节。"})]}),!j&&S.length>0&&o.jsx("div",{className:"skills-grid",children:S.map(Q=>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:Q.name}),Q.stars!==void 0&&Q.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:Q.stars})]})]}),Q.tags&&Q.tags.length>0&&o.jsx("div",{className:"skill-tags",children:Q.tags.map(ie=>o.jsx("span",{className:"badge badge-secondary",children:ie},ie))}),o.jsx("div",{className:"skill-description",children:Q.description||"暂无描述"}),o.jsxs("div",{className:"skills-result-actions",children:[Q.url?o.jsx("a",{className:"btn btn-secondary",href:Q.url,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:"8px"},children:"查看"}):null,o.jsx("button",{className:"btn btn-secondary",onClick:()=>V(Q),children:"安装"})]})]},Q.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(Q=>!Q),children:e?"返回":"发现"})]})]}),e?ye():he(),O.skill&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:I,disabled:O.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:O.status==="idle"?"选择安装目标":O.status==="completed"?"安装完成":O.status==="error"?"安装失败":"正在安装"})}),o.jsx("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:O.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{style:{marginBottom:"12px",color:"var(--text-muted)"},children:["即将安装:",o.jsx("strong",{children:O.skill.name})]}),O.skill.description&&o.jsx("p",{style:{marginBottom:"12px",color:"var(--text-muted)",fontSize:"14px"},children:O.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:O.selectedTargets.includes("claude-code"),onChange:Q=>$("claude-code",Q.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:O.selectedTargets.includes("codex"),onChange:Q=>$("codex",Q.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"Codex"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:O.selectedTargets.includes("opencode"),onChange:Q=>$("opencode",Q.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"OpenCode"})]})]})]})]}):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:`${O.progress}%`,height:"100%",backgroundColor:O.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:O.message}),O.status==="error"&&o.jsx("p",{style:{textAlign:"center",color:"var(--error)",fontSize:"14px"},children:O.message})]})}),o.jsx("div",{className:"modal-footer",style:{justifyContent:O.status!=="idle"?"center":"space-between"},children:O.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"btn btn-secondary",onClick:I,disabled:O.isInstalling,children:"取消"}),o.jsx("button",{className:"btn btn-primary",onClick:H,disabled:O.isInstalling,children:"确定安装"})]}):O.status==="completed"||O.status==="error"?o.jsx("button",{className:"btn btn-primary",onClick:I,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:U,disabled:s.isDeleting,children:s.isDeleting?"删除中...":"确认删除"})]})]})})]}),c&&o.jsx(C2,{isOpen:c,onClose:()=>u(!1),title:"新增 Skill",closeOnOverlayClick:!1,children:o.jsxs("form",{onSubmit:E,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:()=>v(!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:Q=>d(ie=>({...ie,name:Q.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:Q=>d(ie=>({...ie,description:Q.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:Q=>d(ie=>({...ie,instruction:Q.target.value})),placeholder:`当这个 Skill 被触发时,你希望模型遵循哪些规则或信息,例如:
487
+ # codemap
488
+ ## 命令
489
+ ## 使用场景
490
+ ## 输出解释
491
+ ## 示例`,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:Q=>d(ie=>({...ie,link:Q.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:Q=>{Q.target.checked?d(ie=>({...ie,targets:[...ie.targets,"claude-code"]})):d(ie=>({...ie,targets:ie.targets.filter(je=>je!=="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:Q=>{Q.target.checked?d(ie=>({...ie,targets:[...ie.targets,"codex"]})):d(ie=>({...ie,targets:ie.targets.filter(je=>je!=="codex")}))}}),"Codex"]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:p.targets.includes("opencode"),onChange:Q=>{Q.target.checked?d(ie=>({...ie,targets:[...ie.targets,"opencode"]})):d(ie=>({...ie,targets:ie.targets.filter(je=>je!=="opencode")}))}}),"OpenCode"]})]})]}),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:f,children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",disabled:f,children:f?"创建中...":"确认创建"})]})]})}),g&&o.jsxs(C2,{isOpen:g,onClose:()=>{v(!1),y("")},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:Q=>y(Q.target.value),placeholder:`---
492
+ name: skill-name
493
+ description: Skill 描述
494
+ ---
495
+
496
+ # Skill 名称
497
+
498
+ Skill 描述
499
+
500
+ ## 指令
501
+
502
+ 技能指令内容...`,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:()=>{v(!1),y("")},children:"取消"}),o.jsx("button",{type:"button",className:"btn btn-primary",onClick:le,children:"解析并填充"})]})]})]})}const lue=[{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 cue(){var X,V;const[e,t]=h.useState([]),[n,r]=h.useState(!0),[i,a]=h.useState(!1),[s,l]=h.useState(null),[c,u]=h.useState({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),[p,d]=h.useState(!1),[f,m]=h.useState({mcpId:null,mcpName:"",isDeleting:!1}),[g,v]=h.useState({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null}),x=async()=>{try{r(!0);const I=await q.getMCPs();t(I)}catch(I){console.error("Failed to load MCPs:",I),K.error("加载 MCP 工具失败")}finally{r(!1)}};h.useEffect(()=>{x()},[]);const y=()=>{l(null),u({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),a(!0)},b=I=>{l(I),u({name:I.name,description:I.description||"",type:I.type,command:I.command||"",args:I.args?I.args.join(" "):"",url:I.url||"",headers:I.headers?JSON.stringify(I.headers,null,2):"",env:I.env?JSON.stringify(I.env,null,2):"",targets:I.targets||[]}),a(!0)},w=()=>{p||(a(!1),l(null))},j=async I=>{var $,H;if(I.preventDefault(),!c.name.trim()){K.error("请填写 MCP 名称");return}if(c.type==="stdio"&&!c.command){K.error("请填写命令");return}if((c.type==="http"||c.type==="sse")&&!c.url){K.error("请填写 URL");return}try{d(!0);const N={},W={};if(c.env)try{Object.assign(N,JSON.parse(c.env))}catch{K.error("环境变量格式错误,请使用有效的 JSON 格式");return}if(c.headers)try{Object.assign(W,JSON.parse(c.headers))}catch{K.error("请求头格式错误,请使用有效的 JSON 格式");return}const P={name:c.name.trim(),description:c.description.trim(),type:c.type,command:($=c.command)==null?void 0:$.trim(),args:c.args?c.args.trim().split(/\s+/):void 0,url:(H=c.url)==null?void 0:H.trim(),headers:Object.keys(W).length>0?W:void 0,env:Object.keys(N).length>0?N:void 0,targets:c.targets};s?(await q.updateMCP(s.id,P),K.success("MCP 工具已更新")):(await q.createMCP(P),K.success("MCP 工具已添加")),a(!1),l(null),await x()}catch(N){console.error("Failed to save MCP:",N),K.error("保存失败,请稍后重试")}finally{d(!1)}},k=I=>{m({mcpId:I.id,mcpName:I.name,isDeleting:!1})},S=()=>{f.isDeleting||m({mcpId:null,mcpName:"",isDeleting:!1})},A=async()=>{if(f.mcpId)try{m(I=>({...I,isDeleting:!0})),await q.deleteMCP(f.mcpId),K.success("已删除 MCP 工具"),await x(),S()}catch(I){console.error("Failed to delete MCP:",I),K.error("删除失败,请稍后重试"),m($=>({...$,isDeleting:!1}))}},T=()=>{v({isOpen:!0,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},D=()=>{g.installingMCPName||v({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},O=I=>{v($=>({...$,step:"input-api-key",selectedDefinition:I}))},_=async()=>{var I;if(!g.apiKey.trim()){K.error("请填写 API Key");return}if(g.selectedDefinition)try{const $=g.selectedDefinition;v(he=>({...he,step:"installing",message:"正在安装...",installingMCPName:$.name}));const H=$.apiKeyEnvName||"Z_AI_API_KEY",N=$.apiKeyIn==="env",W=[];$.env&&Object.entries($.env).forEach(([he,ye])=>{ye!==void 0&&W.push([he,ye])}),N&&W.push([H,g.apiKey.trim()]);const P=W.length>0?Object.fromEntries(W):void 0,le=$.apiKeyIn==="headers"?{Authorization:`Bearer ${g.apiKey.trim()}`}:void 0,E={name:$.name,description:$.description,type:$.type,command:$.command,args:$.args,url:$.url,env:P,headers:le,targets:["claude-code","codex"]};await q.createMCP(E),v(he=>({...he,step:"completed",message:`成功安装 ${$.name}`,installingMCPName:null})),K.success(`已安装 ${$.name}`),await x()}catch($){console.error(`Failed to install ${(I=g.selectedDefinition)==null?void 0:I.id}:`,$),v(H=>({...H,step:"error",message:"安装失败,请稍后重试",installingMCPName:null})),K.error("安装失败,请稍后重试")}},R=I=>{switch(I){case"stdio":return"命令行";case"http":return"HTTP";case"sse":return"SSE";default:return I}};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:T,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:y,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(I=>{var $,H,N,W;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:I.name}),o.jsx("div",{className:"badge badge-secondary",children:R(I.type)})]}),o.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>b(I),style:{padding:"6px 14px",fontSize:"13px"},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>k(I),style:{padding:"6px 14px",fontSize:"13px"},children:"删除"})]})]}),I.description&&o.jsx("div",{className:"mcp-description",style:{marginTop:"12px",color:"var(--text-muted)",fontSize:"14px"},children:I.description}),o.jsxs("div",{style:{marginTop:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(I.createdAt).toLocaleDateString("zh-CN")]}),I.type==="stdio"&&I.command&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",fontFamily:"monospace",color:"var(--text-muted)"},children:["命令: ",I.command," ",($=I.args)==null?void 0:$.join(" ")]}),(I.type==="http"||I.type==="sse")&&I.url&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["URL: ",I.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(Qo,{checked:((H=I.targets)==null?void 0:H.includes("claude-code"))??!1,onChange:async P=>{const U=I.targets||[],le=P?[...U,"claude-code"]:U.filter(E=>E!=="claude-code");await q.updateMCP(I.id,{targets:le}),await x()},label:"Claude Code",labelPosition:"right"}),o.jsx(Qo,{checked:((N=I.targets)==null?void 0:N.includes("codex"))??!1,onChange:async P=>{const U=I.targets||[],le=P?[...U,"codex"]:U.filter(E=>E!=="codex");await q.updateMCP(I.id,{targets:le}),await x()},label:"Codex",labelPosition:"right"}),o.jsx(Qo,{checked:((W=I.targets)==null?void 0:W.includes("opencode"))??!1,onChange:async P=>{const U=I.targets||[],le=P?[...U,"opencode"]:U.filter(E=>E!=="opencode");await q.updateMCP(I.id,{targets:le}),await x()},label:"OpenCode",labelPosition:"right"})]})})]},I.id)})}),i&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:w,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:j,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:I=>u({...c,name:I.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:I=>u({...c,description:I.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:I=>u({...c,type:I.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:I=>u({...c,command:I.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:I=>u({...c,args:I.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:I=>u({...c,url:I.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:I=>u({...c,headers:I.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:I=>u({...c,env:I.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:I=>u({...c,targets:I.target.checked?[...c.targets,"claude-code"]:c.targets.filter($=>$!=="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:I=>u({...c,targets:I.target.checked?[...c.targets,"codex"]:c.targets.filter($=>$!=="codex")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:p}),o.jsx("span",{children:"Codex"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:c.targets.includes("opencode"),onChange:I=>u({...c,targets:I.target.checked?[...c.targets,"opencode"]:c.targets.filter($=>$!=="opencode")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:p}),o.jsx("span",{children:"OpenCode"})]})]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",type:"button",onClick:w,disabled:p,children:"取消"}),o.jsx("button",{className:"btn btn-primary",type:"submit",disabled:p,children:p?"保存中...":s?"保存":"添加"})]})]})]})})]}),f.mcpId&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000001},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:S,disabled:f.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:f.mcpName}),'" 吗?此操作无法撤销。']})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:S,disabled:f.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:A,disabled:f.isDeleting,children:f.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:lue.map(I=>{const $=e.some(H=>H.name===I.name);return o.jsxs("div",{className:"card",style:{padding:"16px",cursor:$?"not-allowed":"pointer",transition:"all 0.2s ease",opacity:$?.7:1},onClick:()=>!$&&O(I),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:I.name}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[$&&o.jsx("div",{className:"badge badge-success",style:{fontSize:"12px"},children:"已安装"}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"12px"},children:R(I.type)})]})]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-muted)",marginBottom:"12px"},children:I.description}),o.jsx("button",{className:"btn btn-primary",style:{width:"100%"},disabled:$,children:$?"已安装":"安装"})]},I.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:(X=g.selectedDefinition)==null?void 0:X.name}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)"},children:(V=g.selectedDefinition)==null?void 0:V.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:I=>v({...g,apiKey:I.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:()=>v(I=>({...I,step:"select",selectedDefinition:null})),disabled:g.installingMCPName!==null,children:"返回"}),o.jsx("button",{className:"btn btn-primary",onClick:_,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 oL({keyName:e,apiKey:t,guide:n,onClose:r}){const i=a=>{navigator.clipboard.writeText(a).then(()=>K.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:`
503
+ .ak-guide-section {
504
+ border-radius: 10px;
505
+ border: 1px solid var(--border-primary);
506
+ overflow: hidden;
507
+ background: var(--bg-primary-solid);
508
+ }
509
+ .ak-guide-section-header {
510
+ padding: 10px 16px;
511
+ border-bottom: 1px solid var(--border-primary);
512
+ background: var(--bg-secondary);
513
+ fontWeight: 600;
514
+ font-size: 14px;
515
+ }
516
+ .ak-guide-env-name {
517
+ color: var(--color-accent, #8b5cf6);
518
+ fontWeight: 600;
519
+ fontFamily: "SF Mono", "Fira Code", monospace;
520
+ flexShrink: 0;
521
+ }
522
+ .ak-guide-env-value {
523
+ flex: 1;
524
+ padding: 6px 10px;
525
+ border-radius: 5px;
526
+ background: var(--bg-secondary);
527
+ wordBreak: break-all;
528
+ fontSize: 12px;
529
+ fontFamily: "SF Mono", "Fira Code", monospace;
530
+ }
531
+ [data-theme="dark"] .ak-guide-section {
532
+ background: #0C1F12;
533
+ border-color: rgba(167, 243, 208, 0.15);
534
+ }
535
+ [data-theme="dark"] .ak-guide-section-header {
536
+ background: rgba(30, 58, 40, 0.95);
537
+ border-color: rgba(167, 243, 208, 0.15);
538
+ }
539
+ [data-theme="dark"] .ak-guide-env-value {
540
+ background: rgba(30, 58, 40, 0.95);
541
+ }
542
+ `})]})}function uue(){const[e,t]=h.useState([]),[n,r]=h.useState([]),[i,a]=h.useState([]),[s,l]=h.useState([]),[c,u]=h.useState([]),[p,d]=h.useState(0),[f,m]=h.useState(1),g=20,[v,x]=h.useState(!0),[y,b]=h.useState(""),[w,j]=h.useState(""),[k,S]=h.useState(new Set),[A,T]=h.useState(!1),[D,O]=h.useState(null),[_,R]=h.useState(""),[X,V]=h.useState(""),[I,$]=h.useState(""),[H,N]=h.useState(!1),[W,P]=h.useState(()=>localStorage.getItem("policies-panel-open")==="true"),[U,le]=h.useState(null),[E,he]=h.useState(!1),[ye,Q]=h.useState(""),[ie,je]=h.useState(""),[Z,re]=h.useState("system"),[pe,se]=h.useState(""),[_e,ke]=h.useState(""),[ne,Le]=h.useState(""),[qe,ze]=h.useState(""),[Ke,pt]=h.useState(""),[Ye,Qe]=h.useState([]),[Ze,tt]=h.useState([]),[J,Y]=h.useState("none"),[ue,M]=h.useState(""),[fe,ee]=h.useState([]),[xe,Se]=h.useState(!1),De=h.useRef(null),{confirm:$e}=qu(),He=h.useRef(null);h.useEffect(()=>{if(!H)return;const B=z=>{He.current&&!He.current.contains(z.target)&&N(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[H]);const Ie=async()=>{x(!0);try{const B=await q.getAccessKeys({page:f,pageSize:g,status:y||void 0,search:w||void 0});t(B.data),d(B.total)}catch(B){K.error("加载密钥列表失败: "+B.message)}finally{x(!1)}},Xe=async()=>{try{const[B,z,Pe]=await Promise.all([q.getPolicies().catch(()=>[]),q.getRoutes().catch(()=>[]),q.getPolicyTemplates().catch(()=>[])]);r(B),a(z),l(Pe)}catch{}};h.useEffect(()=>{Ie()},[f,y,w]),h.useEffect(()=>{Xe()},[]),h.useEffect(()=>{q.getWriteLocalRecords().then(u).catch(()=>{})},[e]);const L=async()=>{if(!_.trim()){K.error("请输入密钥名称");return}try{const B=await q.createAccessKey({name:_.trim(),remark:X||void 0,policyId:I||void 0});T(!1),O(B),R(""),V(""),$(""),Ie()}catch(B){K.error("创建失败: "+B.message)}},ge=async B=>{try{await q.updateAccessKey(B.id,{status:B.status==="active"?"disabled":"active"}),K.success(B.status==="active"?"已停用":"已启用"),Ie()}catch(z){K.error("操作失败: "+z.message)}},F=async B=>{if(await $e({message:`确定删除密钥「${B.name}」吗?`}))try{await q.deleteAccessKey(B.id),K.success("已删除"),Ie()}catch(Pe){K.error("删除失败: "+Pe.message)}},de=async B=>{if(await $e({message:"重新生成后旧密钥将立即失效,确定继续吗?"}))try{const Pe=await q.regenerateAccessKey(B.id);O({key:{...B,apiKey:Pe.apiKey},apiKey:Pe.apiKey}),Ie()}catch(Pe){K.error("重新生成失败: "+Pe.message)}},[ve,Ae]=h.useState(null),Ee=async B=>{try{const z=await q.getAccessKeyGuide(B.id);Ae({key:B,guide:z})}catch(z){K.error("获取指引失败: "+z.message)}},Ge=async B=>{if(k.size!==0)try{await q.batchUpdateAccessKeyStatus(Array.from(k),B),K.success(`已批量${B==="active"?"启用":"停用"} ${k.size} 个密钥`),S(new Set),N(!1),Ie()}catch(z){K.error("批量操作失败: "+z.message)}},nt=async()=>{if(!(k.size===0||!await $e({message:`确定删除选中的 ${k.size} 个密钥吗?`})))try{await q.batchDeleteAccessKeys(Array.from(k)),K.success(`已删除 ${k.size} 个密钥`),S(new Set),N(!1),Ie()}catch(z){K.error("批量删除失败: "+z.message)}},ot=async B=>{if(!(k.size===0||!B))try{await q.batchBindAccessKeyPolicy(Array.from(k),B),K.success("已批量绑定策略"),S(new Set),N(!1),Ie()}catch(z){K.error("批量绑定失败: "+z.message)}},Je=B=>{const z=new Set(k);z.has(B)?z.delete(B):z.add(B),S(z)},tn=()=>S(k.size===e.length?new Set:new Set(e.map(B=>B.id))),Ut=B=>navigator.clipboard.writeText(B).then(()=>K.success("已复制")),ut=()=>{Q(""),je(""),re(""),se(""),ke(""),Le(""),ze(""),pt(""),Qe([]),tt([]),Y("none"),M("")},Wt=B=>{var z,Pe,st,Ue,xt,Qt,yi;B?(le(B),Q(B.name),je(B.description||""),re(B.routeId||"system"),se(((z=B.dailyTokenLimit)==null?void 0:z.toString())||""),ke(((Pe=B.monthlyTokenLimit)==null?void 0:Pe.toString())||""),Le(((st=B.dailyRequestLimit)==null?void 0:st.toString())||""),ze(((Ue=B.rpmLimit)==null?void 0:Ue.toString())||""),pt(((xt=B.concurrentLimit)==null?void 0:xt.toString())||""),Qe(B.allowedModels||[]),tt(B.blockedModels||[]),Y((Qt=B.allowedModels)!=null&&Qt.length?"allow":(yi=B.blockedModels)!=null&&yi.length?"block":"none")):(le(null),ut()),he(!0),Xt()},Xt=async()=>{try{const B=await q.getVendors(),z=new Map;(B||[]).forEach(Pe=>{const st=Pe.name||"";(Pe.services||[]).forEach(Ue=>{(Ue.supportedModels||[]).forEach(xt=>{z.has(xt)||z.set(xt,new Set),z.get(xt).add(st)})})}),ee(Array.from(z.entries()).map(([Pe,st])=>({name:Pe,vendors:Array.from(st)})).sort((Pe,st)=>Pe.name.localeCompare(st.name)))}catch{}},Et=J==="allow"?Ye:Ze,St=ue.trim()?fe.filter(B=>B.name.toLowerCase().includes(ue.toLowerCase())&&!Et.includes(B.name)):fe.filter(B=>!Et.includes(B.name)),gi=B=>{var Pe,st,Ue,xt,Qt;const z=B.config;Q(z.name||""),je(B.description),se(((Pe=z.dailyTokenLimit)==null?void 0:Pe.toString())||""),ke(((st=z.monthlyTokenLimit)==null?void 0:st.toString())||""),Le(((Ue=z.dailyRequestLimit)==null?void 0:Ue.toString())||""),ze(((xt=z.rpmLimit)==null?void 0:xt.toString())||""),pt(((Qt=z.concurrentLimit)==null?void 0:Qt.toString())||""),K.success(`已应用模板: ${B.name}`)},Xi=async()=>{if(!ye.trim()){K.error("请输入策略名称");return}const B={name:ye.trim(),description:ie||void 0,routeId:Z==="system"?"system":Z||void 0,dailyTokenLimit:pe?Number(pe):void 0,monthlyTokenLimit:_e?Number(_e):void 0,dailyRequestLimit:ne?Number(ne):void 0,rpmLimit:qe?Number(qe):void 0,concurrentLimit:Ke?Number(Ke):void 0,allowedModels:J==="allow"?Ye:void 0,blockedModels:J==="block"?Ze:void 0};try{U?(await q.updatePolicy(U.id,B),K.success("策略已更新")):(await q.createPolicy(B),K.success("策略已创建")),he(!1),Xe(),Ie()}catch(z){K.error("保存失败: "+z.message)}},Ta=async B=>{if(B.keyCount&&B.keyCount>0){K.error(`有 ${B.keyCount} 个密钥正在使用此策略,请先解除绑定`);return}if(await $e({message:`确定删除策略「${B.name}」吗?`}))try{await q.deletePolicy(B.id),K.success("已删除"),Xe(),Ie()}catch(Pe){K.error("删除失败: "+Pe.message)}},ce=async B=>{try{await q.duplicatePolicy(B.id),K.success("已复制"),Xe()}catch(z){K.error("复制失败: "+z.message)}},Mt=(B,z)=>{const Pe=ue.trim();Pe&&!B.includes(Pe)&&(z([...B,Pe]),M(""))},En=B=>{var z;return(z=i.find(Pe=>Pe.id===B))==null?void 0:z.name},sr=B=>{const z=[];return B.dailyTokenLimit&&z.push(`日${B.dailyTokenLimit}k`),B.monthlyTokenLimit&&z.push(`月${B.monthlyTokenLimit}k`),B.dailyRequestLimit&&z.push(`日${B.dailyRequestLimit}次`),B.rpmLimit&&z.push(`RPM ${B.rpmLimit}`),B.concurrentLimit&&z.push(`并发${B.concurrentLimit}`),z.length>0?z.join(", "):"无限制"},Qi=Math.ceil(p/g),an={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:()=>{T(!0),Xe()},style:{height:"45px"},children:"+ 创建密钥"}),o.jsxs("button",{className:`btn ${W?"btn-primary":"btn-secondary"}`,onClick:()=>{const B=!W;P(B),localStorage.setItem("policies-panel-open",String(B)),B&&Xe()},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:W?"var(--color-success, #22c55e)":"transparent",flexShrink:0,transition:"all 0.25s"},children:W&&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:W?"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:y,onChange:B=>{b(B.target.value),m(1)},style:an,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:w,onChange:B=>{j(B.target.value),m(1)},style:{...an,minWidth:"200px"}})]}),k.size>0&&o.jsxs("div",{ref:He,style:{position:"relative",flexShrink:0},children:[o.jsxs("button",{className:"ak-action-btn",onClick:()=>N(!H),children:["批量操作 (",k.size,") ▾"]}),H&&o.jsxs("div",{className:"ak-dropdown-menu",children:[o.jsx("button",{className:"dropdown-btn",onClick:()=>Ge("active"),children:"批量启用"}),o.jsx("button",{className:"dropdown-btn",onClick:()=>Ge("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:B=>{B.target.value&&ot(B.target.value)},children:[o.jsx("option",{value:"",children:"批量绑定策略..."}),n.map(B=>o.jsx("option",{value:B.id,children:B.name},B.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:nt,children:"批量删除"})]})]})]}),v?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:tn})}),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(B=>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(B.id),onChange:()=>Je(B.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/${B.id}`,style:{color:"var(--color-primary)",textDecoration:"none",fontWeight:500},children:B.name}),(()=>{const z=c.find(Pe=>Pe.accessKeyId===B.id);return z?z.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})()]}),B.remark&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:B.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:B.apiKey})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px"},children:B.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:B.status==="active"?"#22c55e":"var(--text-tertiary)"},title:B.status==="active"?"启用":"停用"})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:new Date(B.createdAt).toLocaleDateString()}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:B.lastActiveAt?new Date(B.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:()=>Ee(B),title:"接入指引",children:"📋"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>ge(B),title:B.status==="active"?"停用":"启用",children:B.status==="active"?"⏸":"▶"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>de(B),title:"重新生成",children:"🔄"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>F(B),title:"删除",children:"✕"})]})})]},B.id))})]})}),Qi>1&&o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"8px",marginTop:"16px"},children:[o.jsx("button",{className:"btn btn-sm",disabled:f<=1,onClick:()=>m(f-1),children:"‹"}),o.jsxs("span",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:[f,"/",Qi," · 共 ",p," 个"]}),o.jsx("button",{className:"btn btn-sm",disabled:f>=Qi,onClick:()=>m(f+1),children:"›"})]})]})}),o.jsx("div",{style:{width:W?"480px":"0",overflow:"hidden",transition:"width 0.35s ease, opacity 0.35s ease",opacity:W?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:()=>Wt(),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(B=>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:["📋 ",B.name]}),B.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"12px"},children:B.description})]}),o.jsxs("div",{style:{display:"flex",gap:"4px"},children:[o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>Wt(B),children:"编辑"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>ce(B),children:"复制"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>Ta(B),children:"删除"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"16px",fontSize:"12px",color:"var(--text-secondary)"},children:[o.jsxs("span",{children:["🔗 路由: ",B.routeId&&B.routeId!=="system"?En(B.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: ",B.keyCount||0]}),o.jsxs("span",{children:["📊 配额: ",sr(B)]})]})]},B.id))})})]})})})]}),A&&o.jsx("div",{className:"modal-overlay",onClick:()=>T(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"480px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>T(!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:_,onChange:B=>R(B.target.value),placeholder:"例如:张三 - 前端组",autoFocus:!0,style:{...an,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:X,onChange:B=>V(B.target.value),placeholder:"补充说明信息",style:{...an,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:I,onChange:B=>$(B.target.value),style:{...an,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"",children:"稍后配置"}),n.map(B=>o.jsx("option",{value:B.id,children:B.name},B.id))]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>T(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:L,className:"ak-modal-btn-primary",children:"创建密钥"})]})]})}),D&&o.jsx("div",{className:"modal-overlay",onClick:()=>O(null),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>O(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:()=>Ut(D.apiKey),className:"ak-modal-btn-primary",children:"📋 复制 Key"}),o.jsx("button",{onClick:()=>O(null),className:"ak-modal-btn-secondary",children:"完成"})]})]})}),E&&o.jsx("div",{className:"modal-overlay",onClick:()=>he(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>he(!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:U?"编辑策略":"创建策略"}),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:ye,onChange:B=>Q(B.target.value),placeholder:"例如:中度限制策略",style:{...an,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:ie,onChange:B=>je(B.target.value),placeholder:"适合普通开发者使用",style:{...an,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:Z,onChange:B=>re(B.target.value),style:{...an,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"system",children:"按系统默认"}),i.map(B=>o.jsx("option",{value:B.id,children:B.name},B.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:"配额限制"}),!U&&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:B=>{B.target.value&&(gi(s[Number(B.target.value)]),B.target.value="")},children:[o.jsx("option",{value:"",children:"📋 使用模板..."}),s.map((B,z)=>o.jsxs("option",{value:String(z),children:[B.name," — ",B.description]},z))]})]}),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:pe,onChange:B=>se(B.target.value),placeholder:"不限",style:{...an,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:_e,onChange:B=>ke(B.target.value),placeholder:"不限",style:{...an,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:ne,onChange:B=>Le(B.target.value),placeholder:"不限",style:{...an,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:qe,onChange:B=>ze(B.target.value),placeholder:"不限",style:{...an,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:Ke,onChange:B=>pt(B.target.value),placeholder:"不限",style:{...an,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:J!=="none"?"12px":"0"},children:[{value:"none",label:"不限制",desc:"允许所有模型"},{value:"allow",label:"白名单",desc:"仅允许指定模型"},{value:"block",label:"黑名单",desc:"禁止指定模型"}].map(B=>o.jsxs("label",{className:`policy-model-opt ${J===B.value?"policy-model-opt--active":""}`,children:[o.jsx("input",{type:"radio",name:"modelMode",value:B.value,checked:J===B.value,onChange:()=>Y(B.value),style:{display:"none"}}),o.jsx("div",{style:{fontWeight:600,fontSize:"14px",marginBottom:"2px"},children:B.label}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)"},children:B.desc})]},B.value))}),J!=="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:De,type:"text",value:ue,onChange:B=>{M(B.target.value),Se(!0)},onFocus:()=>Se(!0),onBlur:()=>setTimeout(()=>Se(!1),150),placeholder:fe.length>0?"搜索或输入模型名...":"输入模型名,回车确认...",autoFocus:!0,onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),Mt(J==="allow"?Ye:Ze,J==="allow"?Qe:tt)),B.key==="Escape"&&Se(!1)},style:{...an,width:"100%",padding:"8px 12px",borderRadius:"6px",fontSize:"13px"}}),xe&&St.length>0&&o.jsx("div",{className:"ak-model-suggest",children:St.map(B=>o.jsxs("button",{className:"ak-model-suggest-item",onMouseDown:z=>{var Ue;z.preventDefault();const Pe=J==="allow"?Ye:Ze,st=J==="allow"?Qe:tt;Pe.includes(B.name)||st([...Pe,B.name]),M(""),Se(!1),(Ue=De.current)==null||Ue.focus()},children:[o.jsx("span",{children:B.name}),o.jsx("span",{children:B.vendors.join(", ")})]},B.name))})]}),o.jsx("button",{className:"btn btn-primary btn-sm",style:{padding:"8px 14px",borderRadius:"6px"},onClick:()=>Mt(J==="allow"?Ye:Ze,J==="allow"?Qe:tt),children:"添加"})]}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",minHeight:"24px"},children:[(J==="allow"?Ye:Ze).length===0&&o.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)",padding:"4px 0"},children:J==="allow"?"尚未添加模型,至少需要添加一个模型才能生效":"尚未添加模型,不添加则不对任何模型进行屏蔽"}),(J==="allow"?Ye:Ze).map((B,z)=>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:[B,o.jsx("button",{style:{border:"none",background:"none",cursor:"pointer",padding:"0 2px",color:"var(--text-tertiary)",fontSize:"14px",lineHeight:1},onClick:()=>{(J==="allow"?Qe:tt)((J==="allow"?Ye:Ze).filter((Ue,xt)=>xt!==z))},children:"×"})]},z))]})]})]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>he(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Xi,className:"ak-modal-btn-primary",children:U?"保存修改":"创建策略"})]})]})}),ve&&o.jsx(oL,{keyName:ve.key.name,apiKey:ve.key.apiKey,guide:ve.guide,onClose:()=>Ae(null)}),o.jsx("style",{children:`
543
+ .dropdown-btn {
544
+ display: block; width: 100%; padding: 6px 10px; text-align: left;
545
+ border: none; background: none; cursor: pointer; font-size: 13px;
546
+ color: var(--text-primary);
547
+ }
548
+ .dropdown-btn:hover { background: var(--bg-secondary); }
549
+
550
+ /* 操作按钮 - 列表/策略面板中的小按钮 */
551
+ .ak-action-btn {
552
+ padding: 4px 10px; border-radius: 6px;
553
+ border: 1px solid var(--border-primary);
554
+ background: var(--bg-secondary);
555
+ color: var(--text-secondary);
556
+ cursor: pointer; font-size: 13px;
557
+ transition: all 0.15s;
558
+ }
559
+ .ak-action-btn:hover {
560
+ background: var(--bg-route-item-hover);
561
+ border-color: var(--text-secondary);
562
+ }
563
+ .ak-action-btn--danger {
564
+ color: var(--accent-danger);
565
+ }
566
+ .ak-action-btn--danger:hover {
567
+ background: rgba(220, 38, 38, 0.1);
568
+ border-color: var(--accent-danger);
569
+ }
570
+
571
+ /* 模型自动补全下拉 */
572
+ .ak-model-suggest {
573
+ position: absolute; left: 0; right: 0; bottom: 100%; z-index: 50;
574
+ margin-top: 4px; max-height: 240px; overflow-y: auto;
575
+ background: var(--bg-primary-solid); border: 1px solid var(--border-primary);
576
+ border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
577
+ padding: 4px 0;
578
+ }
579
+ .ak-model-suggest-item {
580
+ display: flex; justify-content: space-between; align-items: center; gap: 8px;
581
+ width: 100%; padding: 7px 12px;
582
+ border: none; background: none; cursor: pointer;
583
+ font-size: 13px; color: var(--text-primary); text-align: left;
584
+ }
585
+ .ak-model-suggest-item > span:first-child {
586
+ font-family: "SF Mono", "Fira Code", monospace;
587
+ white-space: nowrap;
588
+ }
589
+ .ak-model-suggest-item > span:last-child {
590
+ color: #999; font-size: 11px; white-space: nowrap; flex-shrink: 0;
591
+ }
592
+ [data-theme="dark"] .ak-model-suggest-item > span:last-child {
593
+ color: #888;
594
+ }
595
+ .ak-model-suggest-item:hover {
596
+ background: var(--bg-secondary);
597
+ }
598
+ [data-theme="dark"] .ak-model-suggest {
599
+ background: #0C1F12;
600
+ border-color: rgba(167, 243, 208, 0.2);
601
+ }
602
+ [data-theme="dark"] .ak-model-suggest-item:hover {
603
+ background: rgba(30, 58, 40, 0.95);
604
+ }
605
+
606
+ /* 批量操作按钮 */
607
+ .ak-action-btn[onClick] {
608
+ padding: 6px 12px;
609
+ }
610
+
611
+ /* 下拉菜单 */
612
+ .ak-dropdown-menu {
613
+ position: absolute; right: 0; top: 100%; z-index: 100;
614
+ background: var(--bg-primary-solid);
615
+ border: 1px solid var(--border-primary);
616
+ border-radius: 6px;
617
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15);
618
+ min-width: 140px; padding: 4px 0;
619
+ }
620
+
621
+ /* 弹窗按钮 */
622
+ .ak-modal-btn-primary {
623
+ padding: 10px 28px; border-radius: 8px; border: none;
624
+ background: var(--color-primary, #3b82f6); color: #fff;
625
+ cursor: pointer; font-size: 14px; font-weight: 600;
626
+ transition: opacity 0.15s;
627
+ }
628
+ .ak-modal-btn-primary:hover { opacity: 0.9; }
629
+
630
+ .ak-modal-btn-secondary {
631
+ padding: 10px 24px; border-radius: 8px;
632
+ border: 1px solid var(--border-primary);
633
+ background: var(--bg-secondary);
634
+ color: var(--text-primary);
635
+ cursor: pointer; font-size: 14px; font-weight: 500;
636
+ transition: all 0.15s;
637
+ }
638
+ .ak-modal-btn-secondary:hover {
639
+ background: var(--bg-route-item-hover);
640
+ }
641
+
642
+ /* 模型过滤选项 */
643
+ .policy-model-opt {
644
+ cursor: pointer; padding: 10px 14px; border-radius: 8px;
645
+ flex: 1; text-align: center; transition: all 0.2s;
646
+ border: 1px solid var(--border-primary);
647
+ background: transparent;
648
+ }
649
+ .policy-model-opt:hover {
650
+ background: rgba(59,130,246,0.05);
651
+ }
652
+ .policy-model-opt--active {
653
+ border: 2px solid var(--color-primary, #3b82f6);
654
+ background: rgba(59,130,246,0.12);
655
+ }
656
+ .policy-model-opt--active:hover {
657
+ background: rgba(59,130,246,0.18);
658
+ }
659
+
660
+ /* ========== 深色模式 ========== */
661
+ [data-theme="dark"] .ak-action-btn {
662
+ background: rgba(30, 58, 40, 0.95);
663
+ border-color: rgba(167, 243, 208, 0.2);
664
+ color: #A7F3D0;
665
+ }
666
+ [data-theme="dark"] .ak-action-btn:hover {
667
+ background: rgba(40, 75, 52, 0.95);
668
+ border-color: rgba(167, 243, 208, 0.4);
669
+ }
670
+ [data-theme="dark"] .ak-action-btn--danger {
671
+ color: #EF4444;
672
+ }
673
+ [data-theme="dark"] .ak-action-btn--danger:hover {
674
+ background: rgba(239, 68, 68, 0.15);
675
+ border-color: rgba(239, 68, 68, 0.5);
676
+ }
677
+ [data-theme="dark"] .ak-dropdown-menu {
678
+ background: #0C1F12;
679
+ border-color: rgba(167, 243, 208, 0.2);
680
+ }
681
+ [data-theme="dark"] .ak-modal-btn-secondary {
682
+ background: rgba(30, 58, 40, 0.95);
683
+ border-color: rgba(167, 243, 208, 0.2);
684
+ color: #ECFEF5;
685
+ }
686
+ [data-theme="dark"] .ak-modal-btn-secondary:hover {
687
+ background: rgba(40, 75, 52, 0.95);
688
+ border-color: rgba(167, 243, 208, 0.35);
689
+ }
690
+ [data-theme="dark"] .policy-model-opt:hover {
691
+ background: rgba(96,165,250,0.12);
692
+ }
693
+ [data-theme="dark"] .policy-model-opt--active {
694
+ background: rgba(96,165,250,0.28);
695
+ border-color: #60a5fa;
696
+ }
697
+ [data-theme="dark"] .policy-model-opt--active:hover {
698
+ background: rgba(96,165,250,0.38);
699
+ }
700
+ [data-theme="dark"] .page-container select option {
701
+ background: #0C1F12;
702
+ color: #ECFEF5;
703
+ }
704
+ [data-theme="dark"] .page-container textarea,
705
+ [data-theme="dark"] .page-container input[type="text"],
706
+ [data-theme="dark"] .page-container input[type="number"] {
707
+ color-scheme: dark;
708
+ }
709
+ `})]})}function due(){var sr,Qi,an,B;const{id:e}=x3(),t=$h(),{confirm:n}=qu(),[r,i]=h.useState(null),[a,s]=h.useState([]),[l,c]=h.useState([]),[u,p]=h.useState(!0),[d,f]=h.useState("info"),[m,g]=h.useState(null),[v,x]=h.useState([]),[y,b]=h.useState(30),[w,j]=h.useState([]),[k,S]=h.useState(0),[A,T]=h.useState(1),[D,O]=h.useState(20),[_,R]=h.useState(""),[X,V]=h.useState(""),[I,$]=h.useState(""),[H,N]=h.useState(""),[W,P]=h.useState(null),[U,le]=h.useState(!1),[E,he]=h.useState(10),ye=h.useRef(null),[Q,ie]=h.useState(!1),[je,Z]=h.useState(""),[re,pe]=h.useState(""),[se,_e]=h.useState(""),[ke,ne]=h.useState(null),[Le,qe]=h.useState(!1),[ze,Ke]=h.useState({"claude-code":!0,codex:!0}),[pt,Ye]=h.useState(!1),[Qe,Ze]=h.useState([]),[tt,J]=h.useState(0),[Y,ue]=h.useState(1),[M,fe]=h.useState(20),[ee,xe]=h.useState(""),[Se,De]=h.useState(""),[$e,He]=h.useState(null),[Ie,Xe]=h.useState([]),[L,ge]=h.useState(!1),[F,de]=h.useState(!1),[ve,Ae]=h.useState(10),Ee=h.useRef(null),Ge=h.useCallback(async()=>{if(e)try{const[z,Pe,st]=await Promise.all([q.getAccessKey(e).catch(()=>null),q.getPolicies().catch(()=>[]),q.getRoutes().catch(()=>[])]);if(!z){K.error("密钥不存在"),t("/access-keys");return}i(z),s(Pe),c(st),Z(z.name),pe(z.remark||""),_e(z.policyId||"")}catch(z){K.error("加载数据失败: "+z.message)}finally{p(!1)}},[e,t]),nt=h.useCallback(async()=>{if(e)try{const[z,Pe]=await Promise.all([q.getAccessKeyUsage(e).catch(()=>null),q.getAccessKeyUsageTrend(e,y).catch(()=>[])]);g(z),x(Pe)}catch{}},[e,y]),ot=h.useCallback(async()=>{if(e)try{const z=await q.getAccessKeyLogs(e,{page:A,pageSize:D,startDate:_||void 0,endDate:X||void 0,contentType:I||void 0,search:H||void 0});j(z.data),S(z.total)}catch{}},[e,A,D,_,X,I,H]),Je=h.useCallback(async()=>{if(e)try{const z=await q.getAccessKeySessions(e,{page:Y,pageSize:M,targetType:Se||void 0,search:ee||void 0});Ze(z.data),J(z.total)}catch{}},[e,Y,M,Se,ee]);h.useEffect(()=>{Ge()},[Ge]),h.useEffect(()=>{d==="stats"&&nt(),d==="logs"&&ot(),d==="sessions"&&Je()},[d,nt,ot,Je]),h.useEffect(()=>{if(U&&d==="logs")return ye.current=setInterval(()=>{he(z=>z<=1?(ot(),10):z-1)},1e3),()=>{ye.current&&clearInterval(ye.current)};ye.current&&clearInterval(ye.current),he(10)},[U,d,ot]),h.useEffect(()=>{if(F&&d==="sessions")return Ee.current=setInterval(()=>{Ae(z=>z<=1?(Je(),10):z-1)},1e3),()=>{Ee.current&&clearInterval(Ee.current)};Ee.current&&clearInterval(Ee.current),Ae(10)},[F,d,Je]);const tn=async()=>{if(!(!e||!je.trim()))try{await q.updateAccessKey(e,{name:je.trim(),remark:re||void 0,policyId:se||void 0}),K.success("已保存"),ie(!1),Ge()}catch(z){K.error("保存失败: "+z.message)}},Ut=async()=>{if(r)try{await q.updateAccessKey(r.id,{status:r.status==="active"?"disabled":"active"}),K.success(r.status==="active"?"已停用":"已启用"),Ge()}catch(z){K.error("操作失败: "+z.message)}},ut=async()=>{if(!(!r||!await n({message:"确定删除此密钥吗?删除后不可恢复。"})))try{await q.deleteAccessKey(r.id),K.success("已删除"),t("/access-keys")}catch(Pe){K.error("删除失败: "+Pe.message)}},Wt=async()=>{if(r)try{const z=await q.getAccessKeyGuide(r.id);ne({key:r,guide:z})}catch(z){K.error("获取指引失败: "+z.message)}},Xt=async()=>{var z,Pe;if(r)try{const st=await q.getAccessKeyGuide(r.id),Ue=((Pe=(z=st==null?void 0:st.claudeCode)==null?void 0:z.envVars)==null?void 0:Pe.ANTHROPIC_AUTH_TOKEN)||r.apiKey;await navigator.clipboard.writeText(Ue),K.success("已复制到剪贴板")}catch{try{await navigator.clipboard.writeText(r.apiKey),K.success("已复制到剪贴板")}catch{K.error("复制失败")}}},Et=async()=>{if(!r)return;const z=Object.entries(ze).filter(([,Pe])=>Pe).map(([Pe])=>Pe);if(z.length===0){K.error("请选择至少一个目标");return}Ye(!0);try{await q.writeAccessKeyToLocal(r.id,z),K.success("已写入本地配置文件"),qe(!1)}catch(Pe){K.error("写入失败: "+(Pe.message||"未知错误"))}finally{Ye(!1)}},St=z=>z>=1e6?(z/1e6).toFixed(1)+"M":z>=1e3?(z/1e3).toFixed(1)+"k":String(z),gi=z=>z?new Date(z).toLocaleString():"-",Xi={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 Ta=m&&m.lifetime.totalRequests>0?((m.lifetime.totalRequests-m.lifetime.errorCount)/m.lifetime.totalRequests*100).toFixed(1):"-",ce=Math.max(...v.map(z=>z.tokens),1),Mt=Math.max(...v.map(z=>z.requests),1),En=[{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:()=>ie(!0),children:"编辑"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:()=>qe(!0),children:"💾 写入本地"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:Ut,children:r.status==="active"?"停用":"启用"}),o.jsx("button",{className:"ak-action-btn ak-action-btn--danger",style:{padding:"6px 14px"},onClick:ut,children:"删除"})]}),o.jsx("div",{className:"ak-tab-bar",style:{display:"flex",gap:"0",borderBottom:"2px solid var(--border-primary)",marginBottom:"20px"},children:En.map(z=>o.jsx("button",{className:`ak-tab-btn ${d===z.key?"ak-tab-btn--active":""}`,onClick:()=>f(z.key),children:z.label},z.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:Xt,title:"复制",children:"📋"}),o.jsx("button",{className:"ak-action-btn",onClick:Wt,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:gi(r.createdAt)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"最后活跃"}),o.jsx("div",{style:{fontSize:"14px"},children:gi(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 yi,jd,Ps,xo,ic;const z=a.find(it=>it.id===r.policyId),Pe=z!=null&&z.routeId&&z.routeId!=="system"?(yi=l.find(it=>it.id===z.routeId))==null?void 0:yi.name:void 0,st=it=>{const pn=[];return it.dailyTokenLimit&&pn.push(`日 ${it.dailyTokenLimit}k Token`),it.weeklyTokenLimit&&pn.push(`周 ${it.weeklyTokenLimit}k Token`),it.monthlyTokenLimit&&pn.push(`月 ${it.monthlyTokenLimit}k Token`),it.customTokenLimit&&it.customTokenResetHours&&pn.push(`${it.customTokenResetHours}h ${it.customTokenLimit}k Token`),it.dailyRequestLimit&&pn.push(`日 ${it.dailyRequestLimit} 次请求`),it.weeklyRequestLimit&&pn.push(`周 ${it.weeklyRequestLimit} 次请求`),it.monthlyRequestLimit&&pn.push(`月 ${it.monthlyRequestLimit} 次请求`),it.customRequestLimit&&it.customRequestResetHours&&pn.push(`${it.customRequestResetHours}h ${it.customRequestLimit} 次请求`),it.rpmLimit&&pn.push(`RPM ${it.rpmLimit}`),it.concurrentLimit&&pn.push(`并发 ${it.concurrentLimit}`),pn.length>0?pn:null},Ue=(jd=z==null?void 0:z.allowedModels)!=null&&jd.length?z.allowedModels:(Ps=z==null?void 0:z.blockedModels)!=null&&Ps.length?z.blockedModels:null,xt=(xo=z==null?void 0:z.allowedModels)!=null&&xo.length?"allow":(ic=z==null?void 0:z.blockedModels)!=null&&ic.length?"block":"none";if(!z)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 Qt=st(z);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:["📋 ",z.name]}),z.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px"},children:z.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:"📊 配额限制"}),Qt?o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:Qt.map((it,pn)=>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:it},pn))}):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:"🏷️ 模型过滤"}),xt==="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:xt==="allow"?"✅ 白名单模式 — 仅允许以下模型":"🚫 黑名单模式 — 禁止以下模型"}),o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Ue.map((it,pn)=>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:it},pn))})]})]})]})})(),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:Ta+"%"},{label:"错误数",value:String(m.lifetime.errorCount)},{label:"输入 Token",value:St(m.lifetime.inputTokens)},{label:"输出 Token",value:St(m.lifetime.outputTokens)}].map(z=>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:z.label}),o.jsx("div",{style:{fontSize:"20px",fontWeight:600},children:z.value})]},z.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(z=>o.jsxs("button",{className:`ak-action-btn ${y===z?"ak-action-btn--active":""}`,style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>b(z),children:[z,"天"]},z))})]}),v.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:v.slice(-y).map((z,Pe)=>o.jsx("div",{style:{flex:1,minWidth:0,height:ce>0?`${Math.max(2,z.tokens/ce*100)}%`:"2px",background:"var(--color-primary, #3b82f6)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${St(z.tokens)}`},Pe))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(sr=v[0])==null?void 0:sr.date}),o.jsx("span",{children:(Qi=v[v.length-1])==null?void 0:Qi.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:v.slice(-y).map((z,Pe)=>o.jsx("div",{style:{flex:1,minWidth:0,height:Mt>0?`${Math.max(2,z.requests/Mt*100)}%`:"2px",background:"var(--color-success, #22c55e)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${z.requests} 请求`},Pe))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(an=v[0])==null?void 0:an.date}),o.jsx("span",{children:(B=v[v.length-1])==null?void 0:B.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:v.slice(-y).map((z,Pe)=>{const st=Math.max(...v.map(Ue=>Ue.errors),1);return o.jsx("div",{style:{flex:1,minWidth:0,height:st>0?`${Math.max(2,z.errors/st*100)}%`:"2px",background:z.errors>0?"var(--accent-danger, #ef4444)":"var(--border-primary)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${z.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:H,onChange:z=>{N(z.target.value),T(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:I,onChange:z=>{$(z.target.value),T(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:_,onChange:z=>{R(z.target.value),T(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:X,onChange:z=>{V(z.target.value),T(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:U,onChange:z=>le(z.target.checked)}),"自动刷新 ",U&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",E,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>ot(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:w.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:w.map(z=>{var Ue,xt,Qt;const Pe=((Ue=z.usage)==null?void 0:Ue.totalTokens)||(((xt=z.usage)==null?void 0:xt.inputTokens)||0)+(((Qt=z.usage)==null?void 0:Qt.outputTokens)||0),st=(z.statusCode||200)<400;return o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>P(z),children:[o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(z.timestamp).toLocaleString()}),o.jsx("td",{style:{padding:"8px 6px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z.path||"-"}),o.jsx("td",{style:{padding:"8px 6px"},children:z.targetModel||z.requestModel||"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:St(Pe)}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:z.responseTime?(z.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:st?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",color:st?"var(--color-success, #22c55e)":"var(--accent-danger, #ef4444)"},children:z.statusCode||200})}),o.jsx("td",{style:{padding:"8px 6px"},children:z.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:yi=>{yi.stopPropagation(),P(z)},children:"详情"})})]},z.id)})})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(ju,{currentPage:A,totalItems:k,pageSize:D,onPageChange:T,onPageSizeChange:z=>{O(z),T(1)}})})]})})]}),d==="sessions"&&(()=>{const z=(Ue,xt)=>{const Qt=xt-Ue;return Qt<6e4?`${Math.floor(Qt/1e3)}秒`:Qt<36e5?`${Math.floor(Qt/6e4)}分钟`:`${Math.floor(Qt/36e5)}小时`},Pe=async Ue=>{He(Ue),ge(!0);try{const xt=await q.getAccessKeySessionLogs(e,Ue.id,1e4);Xe(xt)}catch{K.error("加载会话日志失败")}finally{ge(!1)}},st=async()=>{if(!(!$e||L)){ge(!0);try{const Ue=await q.getAccessKeySessionLogs(e,$e.id,1e4);Xe(Ue)}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:ee,onChange:Ue=>{xe(Ue.target.value),ue(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:Se,onChange:Ue=>{De(Ue.target.value),ue(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:F,onChange:Ue=>de(Ue.target.checked)}),"自动刷新 ",F&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",ve,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>Je(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:Qe.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:Qe.map(Ue=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>Pe(Ue),children:[o.jsx("td",{style:{padding:"8px 6px",maxWidth:"250px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$o(Ue.title)}),o.jsx("td",{style:{padding:"8px 6px"},children:o.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",background:Ue.targetType==="claude-code"?"rgba(59,130,246,0.1)":"rgba(34,197,94,0.1)",color:Ue.targetType==="claude-code"?"var(--color-primary, #3b82f6)":"var(--color-success, #22c55e)"},children:Ue.targetType==="claude-code"?"Claude Code":"Codex"})}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:Ue.requestCount}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:St(Ue.totalTokens)}),o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(Ue.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(Ue.lastRequestAt).toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),o.jsx("td",{style:{padding:"8px 6px"},children:z(Ue.firstRequestAt,Ue.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:xt=>{xt.stopPropagation(),Pe(Ue)},children:"详情"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px",marginLeft:"4px"},onClick:xt=>{xt.stopPropagation(),He(Ue),ge(!0),q.getAccessKeySessionLogs(e,Ue.id,1e4).then(Qt=>{Xe(Qt),ge(!1)}).catch(()=>ge(!1))},children:"对话"})]})]},Ue.id))})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(ju,{currentPage:Y,totalItems:tt,pageSize:M,onPageChange:ue,onPageSizeChange:Ue=>{fe(Ue),ue(1)}})})]})}),$e&&o.jsx(fb,{session:$e,logs:Ie,logsLoading:L,onRefreshLogs:st,onFetchNewLogs:async()=>$e?await q.getAccessKeySessionLogs(e,$e.id,1e4):[],onClose:()=>{He(null),Xe([])}})]})})(),Q&&o.jsx("div",{className:"modal-overlay",onClick:()=>ie(!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:()=>ie(!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:je,onChange:z=>Z(z.target.value),style:Xi})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"备注"}),o.jsx("textarea",{value:re,onChange:z=>pe(z.target.value),style:{...Xi,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:se,onChange:z=>_e(z.target.value),style:{...Xi,cursor:"pointer"},children:[o.jsx("option",{value:"",children:"未配置"}),a.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:()=>ie(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:tn,className:"ak-modal-btn-primary",children:"保存"})]})]})}),W&&o.jsx(yf,{log:W,onClose:()=>P(null)}),ke&&o.jsx(oL,{keyName:ke.key.name,apiKey:ke.key.apiKey,guide:ke.guide,onClose:()=>ne(null)}),Le&&o.jsx("div",{className:"modal-overlay",onClick:()=>qe(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"420px",padding:"28px"},onClick:z=>z.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>qe(!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(z=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px",marginBottom:"8px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:ze[z.key]?"var(--bg-secondary)":"transparent",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:ze[z.key],onChange:Pe=>Ke(st=>({...st,[z.key]:Pe.target.checked})),style:{marginTop:"2px"}}),o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:z.label}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:z.desc})]})]},z.key))}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>qe(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Et,className:"ak-modal-btn-primary",disabled:pt,children:pt?"写入中...":"确认写入"})]})]})}),o.jsx("style",{children:`
710
+ .ak-tab-btn {
711
+ padding: 10px 24px;
712
+ border: none;
713
+ background: transparent;
714
+ color: var(--text-tertiary);
715
+ font-size: 14px;
716
+ font-weight: 500;
717
+ cursor: pointer;
718
+ border-bottom: 2px solid transparent;
719
+ margin-bottom: -2px;
720
+ transition: all 0.15s;
721
+ }
722
+ .ak-tab-btn:hover {
723
+ color: var(--text-secondary);
724
+ }
725
+ .ak-tab-btn--active {
726
+ color: var(--color-primary, #3b82f6);
727
+ border-bottom-color: var(--color-primary, #3b82f6);
728
+ font-weight: 600;
729
+ }
730
+ .ak-action-btn {
731
+ padding: 4px 10px; border-radius: 6px;
732
+ border: 1px solid var(--border-primary);
733
+ background: var(--bg-secondary);
734
+ color: var(--text-secondary);
735
+ cursor: pointer; font-size: 13px;
736
+ transition: all 0.15s;
737
+ }
738
+ .ak-action-btn:hover {
739
+ background: var(--bg-route-item-hover);
740
+ border-color: var(--text-secondary);
741
+ }
742
+ .ak-action-btn--active {
743
+ background: var(--color-primary, #3b82f6);
744
+ color: #fff;
745
+ border-color: var(--color-primary, #3b82f6);
746
+ }
747
+ .ak-action-btn--danger {
748
+ color: var(--accent-danger);
749
+ }
750
+ .ak-action-btn--danger:hover {
751
+ background: rgba(220, 38, 38, 0.1);
752
+ border-color: var(--accent-danger);
753
+ }
754
+ .ak-modal-btn-primary {
755
+ padding: 10px 28px; border-radius: 8px; border: none;
756
+ background: var(--color-primary, #3b82f6); color: #fff;
757
+ cursor: pointer; font-size: 14px; font-weight: 600;
758
+ transition: opacity 0.15s;
759
+ }
760
+ .ak-modal-btn-primary:hover { opacity: 0.9; }
761
+ .ak-modal-btn-secondary {
762
+ padding: 10px 24px; border-radius: 8px;
763
+ border: 1px solid var(--border-primary);
764
+ background: var(--bg-secondary);
765
+ color: var(--text-primary);
766
+ cursor: pointer; font-size: 14px; font-weight: 500;
767
+ transition: all 0.15s;
768
+ }
769
+ .ak-modal-btn-secondary:hover {
770
+ background: var(--bg-route-item-hover);
771
+ }
772
+
773
+ /* 深色模式 */
774
+ [data-theme="dark"] .ak-action-btn {
775
+ background: rgba(30, 58, 40, 0.95);
776
+ border-color: rgba(167, 243, 208, 0.2);
777
+ color: #A7F3D0;
778
+ }
779
+ [data-theme="dark"] .ak-action-btn:hover {
780
+ background: rgba(40, 75, 52, 0.95);
781
+ border-color: rgba(167, 243, 208, 0.4);
782
+ }
783
+ [data-theme="dark"] .ak-action-btn--danger {
784
+ color: #EF4444;
785
+ }
786
+ [data-theme="dark"] .ak-action-btn--danger:hover {
787
+ background: rgba(239, 68, 68, 0.15);
788
+ border-color: rgba(239, 68, 68, 0.5);
789
+ }
790
+ [data-theme="dark"] .ak-modal-btn-secondary {
791
+ background: rgba(30, 58, 40, 0.95);
792
+ border-color: rgba(167, 243, 208, 0.2);
793
+ color: #ECFEF5;
794
+ }
795
+ [data-theme="dark"] .ak-modal-btn-secondary:hover {
796
+ background: rgba(40, 75, 52, 0.95);
797
+ border-color: rgba(167, 243, 208, 0.35);
798
+ }
799
+ [data-theme="dark"] .page-container select option {
800
+ background: #0C1F12;
801
+ color: #ECFEF5;
802
+ }
803
+ [data-theme="dark"] .page-container textarea,
804
+ [data-theme="dark"] .page-container input[type="text"],
805
+ [data-theme="dark"] .page-container input[type="date"] {
806
+ color-scheme: dark;
807
+ }
808
+ `})]})}const sL=h.createContext(null);function pue(){const e=h.useContext(sL);if(!e)throw new Error("useAgentNotifications must be used inside <AgentNotificationsProvider>");return e}function fue({children:e}){const[t,n]=h.useState(!1);h.useEffect(()=>{q.getAgentMapNotify().then(i=>n(!!i.enabled)).catch(()=>{})},[]);const r=h.useCallback(()=>{n(i=>{const a=!i;return q.setAgentMapNotify(a).catch(()=>{}),a})},[]);return o.jsx(sL.Provider,{value:{enabled:t,toggle:r},children:e})}const Ji=1e3,ea=700,Jc=36e5,ww=864e5,lL=.4,cL=4,jw={Read:"📖",Edit:"📝",Write:"📝",MultiEdit:"📝",Bash:"🔧",Glob:"🔍",Grep:"🔍",WebFetch:"🌐",WebSearch:"🌐",Agent:"🤖",Task:"🤖",NotebookEdit:"📓"},P2=8,hue=96;function A2(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}const Po=[[0,0],[1,400],[7,640],[30,720],[365,800]];function uL(e){if(!Number.isFinite(e)||e<=0)return Po[0][1];for(let t=1;t<Po.length;t++)if(e<=Po[t][0]){const[n,r]=Po[t-1],[i,a]=Po[t],s=(e-n)/(i-n);return r+(a-r)*s}return Po[Po.length-1][1]}function E2(e,t,n){const r=Ji/2,i=ea/2,a=n-t,s=Number.isFinite(a)&&a>0?a/ww:0,l=uL(s),c=(A2(e)%360+(A2(e+"~j")%40-20))*(Math.PI/180);return{x:r+Math.cos(c)*l,y:i+Math.sin(c)*l}}const mue=[{days:1,tier:0,label:"1 天"},{days:7,tier:1,label:"7 天"},{days:30,tier:2,label:"30 天"},{days:365,tier:3,label:"1 年"}],gue=mue.map(e=>({days:e.days,tier:e.tier,label:e.label,r:uL(e.days)}));function Vx(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 yue({item:e,pos:t,selected:n}){const r=e.requestCount||0,i=Math.min(r/100,1),a=P2+(hue-P2)*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(cb,{size:s,x:-s/2,y:-s/2}):e.agent==="opencode"?o.jsx(ub,{size:s,x:-s/2,y:-s/2}):o.jsx(lb,{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?`${jw[e.lastToolName]||"•"} ${e.lastToolName}`:(e.lastActivitySummary||"").slice(0,20)||Vx(e.lastRequestAt)}),e.source==="access-key"&&o.jsxs("text",{textAnchor:"middle",dy:a+48,className:"am-node-source",children:["🔑 ",e.keyName||"key"]})]})}function vue({view:e,onView:t}){const n=i=>{const a=Ji/2,s=ea/2,{zoom:l,panX:c,panY:u}=e,p=Math.min(cL,Math.max(lL,l*i)),d=(a-c)/l,f=(s-u)/l;t({zoom:p,panX:a-d*p,panY:s-f*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 xue({sessions:e,now:t,selectedId:n,onSelect:r,view:i,onView:a,focus:s}){const l=h.useRef(null),c=h.useRef(null),u=h.useRef(i);u.current=i;const[p,d]=h.useState(!1),f=h.useMemo(()=>{const w={};for(const j of e)w[j.sessionId]=E2(j.sessionId,j.firstRequestAt,t);return w},[e,t]),m=h.useCallback((w,j)=>{const k=l.current;if(!k)return null;const S=k.getScreenCTM();if(!S)return null;const A=k.createSVGPoint();A.x=w,A.y=j;const T=A.matrixTransform(S.inverse());return{x:T.x,y:T.y}},[]);h.useEffect(()=>{const w=l.current;if(!w)return;const j=k=>{k.preventDefault();const S=m(k.clientX,k.clientY);if(!S)return;const{zoom:A,panX:T,panY:D}=u.current,O=k.deltaY<0?1.15:1/1.15,_=Math.min(cL,Math.max(lL,A*O)),R=(S.x-T)/A,X=(S.y-D)/A;a({zoom:_,panX:S.x-R*_,panY:S.y-X*_})};return w.addEventListener("wheel",j,{passive:!1}),()=>w.removeEventListener("wheel",j)},[m,a,e.length]),h.useEffect(()=>{if(!s)return;const w=e.find(k=>k.sessionId===s.sessionId);if(!w)return;const j=E2(s.sessionId,w.firstRequestAt,Date.now());a(k=>({zoom:k.zoom,panX:Ji/2-j.x*k.zoom,panY:ea/2-j.y*k.zoom}))},[s==null?void 0:s.nonce]);const g=h.useRef(null),v=w=>{var A,T;if(w.button!==0)return;d(!0);let j=w.target,k=null;for(;j&&j!==w.currentTarget;){const D=j.getAttribute&&j.getAttribute("data-sid");if(D){k=D;break}j=j.parentElement}const S=m(w.clientX,w.clientY);g.current={startClient:{x:w.clientX,y:w.clientY},startVB:S||{x:0,y:0},panX:u.current.panX,panY:u.current.panY,moved:!1,sid:k},(T=(A=w.currentTarget).setPointerCapture)==null||T.call(A,w.pointerId)},x=w=>{const j=g.current;if(!j)return;!j.moved&&Math.hypot(w.clientX-j.startClient.x,w.clientY-j.startClient.y)>5&&(j.moved=!0,r(null));const k=m(w.clientX,w.clientY);k&&a(S=>({...S,panX:j.panX+(k.x-j.startVB.x),panY:j.panY+(k.y-j.startVB.y)}))},y=()=>{d(!1);const w=g.current;g.current=null,!(!w||w.moved)&&r(w.sid)},b=h.useMemo(()=>{const w=j=>j.sessionId===n?2:j.status==="active"||j.status==="error"?1:0;return[...e].sort((j,k)=>w(j)-w(k))},[e,n]);return o.jsxs("svg",{ref:l,className:"am-canvas",viewBox:`0 0 ${Ji} ${ea}`,preserveAspectRatio:"xMidYMid meet",onPointerDown:v,onPointerMove:x,onPointerUp:y,onPointerLeave:y,onPointerCancel:y,style:{cursor:p?"grabbing":"grab",touchAction:"none"},children:[o.jsx("rect",{x:0,y:0,width:Ji,height:ea,fill:"transparent"}),o.jsxs("g",{ref:c,transform:`translate(${i.panX} ${i.panY}) scale(${i.zoom})`,children:[o.jsx("circle",{cx:Ji/2,cy:ea/2,r:4,className:"am-center-mark"}),gue.map(w=>o.jsxs("g",{className:`am-ring am-ring--t${w.tier}`,children:[o.jsx("circle",{cx:Ji/2,cy:ea/2,r:w.r,fill:"none"}),o.jsx("text",{x:Ji/2,y:ea/2-w.r-6,textAnchor:"middle",className:"am-ring-label",children:w.label})]},`ring-${w.days}`)),e.filter(w=>w.status==="active").map(w=>{const j=f[w.sessionId];return j?o.jsx("line",{x1:Ji/2,y1:ea/2,x2:j.x,y2:j.y,className:"am-link am-link--active"},`l-${w.sessionId}`):null}),b.map(w=>{const j=f[w.sessionId];return j?o.jsx(yue,{item:w,pos:j,selected:w.sessionId===n},w.sessionId):null})]})]})}const T2={type:"change"},Cy={type:"start"},I2={type:"end"},pp=new YL,O2=new GL,bue=Math.cos(70*G2.DEG2RAD);class wue extends qL{constructor(t,n){super(),this.object=t,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new rt,this.cursor=new rt,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:Os.ROTATE,MIDDLE:Os.DOLLY,RIGHT:Os.PAN},this.touches={ONE:Ns.ROTATE,TWO:Ns.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(L){L.addEventListener("keydown",M),this._domElementKeyEvents=L},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",M),this._domElementKeyEvents=null},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(T2),r.update(),a=i.NONE},this.update=function(){const L=new rt,ge=new tu().setFromUnitVectors(t.up,new rt(0,1,0)),F=ge.clone().invert(),de=new rt,ve=new tu,Ae=new rt,Ee=2*Math.PI;return function(nt=null){const ot=r.object.position;L.copy(ot).sub(r.target),L.applyQuaternion(ge),l.setFromVector3(L),r.autoRotate&&a===i.NONE&&R(O(nt)),r.enableDamping?(l.theta+=c.theta*r.dampingFactor,l.phi+=c.phi*r.dampingFactor):(l.theta+=c.theta,l.phi+=c.phi);let Je=r.minAzimuthAngle,tn=r.maxAzimuthAngle;isFinite(Je)&&isFinite(tn)&&(Je<-Math.PI?Je+=Ee:Je>Math.PI&&(Je-=Ee),tn<-Math.PI?tn+=Ee:tn>Math.PI&&(tn-=Ee),Je<=tn?l.theta=Math.max(Je,Math.min(tn,l.theta)):l.theta=l.theta>(Je+tn)/2?Math.max(Je,l.theta):Math.min(tn,l.theta)),l.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,l.phi)),l.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(p,r.dampingFactor):r.target.add(p),r.target.sub(r.cursor),r.target.clampLength(r.minTargetRadius,r.maxTargetRadius),r.target.add(r.cursor);let Ut=!1;if(r.zoomToCursor&&S||r.object.isOrthographicCamera)l.radius=P(l.radius);else{const ut=l.radius;l.radius=P(l.radius*u),Ut=ut!=l.radius}if(L.setFromSpherical(l),L.applyQuaternion(F),ot.copy(r.target).add(L),r.object.lookAt(r.target),r.enableDamping===!0?(c.theta*=1-r.dampingFactor,c.phi*=1-r.dampingFactor,p.multiplyScalar(1-r.dampingFactor)):(c.set(0,0,0),p.set(0,0,0)),r.zoomToCursor&&S){let ut=null;if(r.object.isPerspectiveCamera){const Wt=L.length();ut=P(Wt*u);const Xt=Wt-ut;r.object.position.addScaledVector(j,Xt),r.object.updateMatrixWorld(),Ut=!!Xt}else if(r.object.isOrthographicCamera){const Wt=new rt(k.x,k.y,0);Wt.unproject(r.object);const Xt=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/u)),r.object.updateProjectionMatrix(),Ut=Xt!==r.object.zoom;const Et=new rt(k.x,k.y,0);Et.unproject(r.object),r.object.position.sub(Et).add(Wt),r.object.updateMatrixWorld(),ut=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;ut!==null&&(this.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(ut).add(r.object.position):(pp.origin.copy(r.object.position),pp.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(pp.direction))<bue?t.lookAt(r.target):(O2.setFromNormalAndCoplanarPoint(r.object.up,r.target),pp.intersectPlane(O2,r.target))))}else if(r.object.isOrthographicCamera){const ut=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/u)),ut!==r.object.zoom&&(r.object.updateProjectionMatrix(),Ut=!0)}return u=1,S=!1,Ut||de.distanceToSquared(r.object.position)>s||8*(1-ve.dot(r.object.quaternion))>s||Ae.distanceToSquared(r.target)>s?(r.dispatchEvent(T2),de.copy(r.object.position),ve.copy(r.object.quaternion),Ae.copy(r.target),!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",xe),r.domElement.removeEventListener("pointerdown",Ke),r.domElement.removeEventListener("pointercancel",Ye),r.domElement.removeEventListener("wheel",tt),r.domElement.removeEventListener("pointermove",pt),r.domElement.removeEventListener("pointerup",Ye),r.domElement.getRootNode().removeEventListener("keydown",Y,{capture:!0}),r._domElementKeyEvents!==null&&(r._domElementKeyEvents.removeEventListener("keydown",M),r._domElementKeyEvents=null)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let a=i.NONE;const s=1e-6,l=new Kw,c=new Kw;let u=1;const p=new rt,d=new Rn,f=new Rn,m=new Rn,g=new Rn,v=new Rn,x=new Rn,y=new Rn,b=new Rn,w=new Rn,j=new rt,k=new Rn;let S=!1;const A=[],T={};let D=!1;function O(L){return L!==null?2*Math.PI/60*r.autoRotateSpeed*L:2*Math.PI/60/60*r.autoRotateSpeed}function _(L){const ge=Math.abs(L*.01);return Math.pow(.95,r.zoomSpeed*ge)}function R(L){c.theta-=L}function X(L){c.phi-=L}const V=function(){const L=new rt;return function(F,de){L.setFromMatrixColumn(de,0),L.multiplyScalar(-F),p.add(L)}}(),I=function(){const L=new rt;return function(F,de){r.screenSpacePanning===!0?L.setFromMatrixColumn(de,1):(L.setFromMatrixColumn(de,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(F),p.add(L)}}(),$=function(){const L=new rt;return function(F,de){const ve=r.domElement;if(r.object.isPerspectiveCamera){const Ae=r.object.position;L.copy(Ae).sub(r.target);let Ee=L.length();Ee*=Math.tan(r.object.fov/2*Math.PI/180),V(2*F*Ee/ve.clientHeight,r.object.matrix),I(2*de*Ee/ve.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(V(F*(r.object.right-r.object.left)/r.object.zoom/ve.clientWidth,r.object.matrix),I(de*(r.object.top-r.object.bottom)/r.object.zoom/ve.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function H(L){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u/=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function N(L){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u*=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function W(L,ge){if(!r.zoomToCursor)return;S=!0;const F=r.domElement.getBoundingClientRect(),de=L-F.left,ve=ge-F.top,Ae=F.width,Ee=F.height;k.x=de/Ae*2-1,k.y=-(ve/Ee)*2+1,j.set(k.x,k.y,1).unproject(r.object).sub(r.object.position).normalize()}function P(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function U(L){d.set(L.clientX,L.clientY)}function le(L){W(L.clientX,L.clientX),y.set(L.clientX,L.clientY)}function E(L){g.set(L.clientX,L.clientY)}function he(L){f.set(L.clientX,L.clientY),m.subVectors(f,d).multiplyScalar(r.rotateSpeed);const ge=r.domElement;R(2*Math.PI*m.x/ge.clientHeight),X(2*Math.PI*m.y/ge.clientHeight),d.copy(f),r.update()}function ye(L){b.set(L.clientX,L.clientY),w.subVectors(b,y),w.y>0?H(_(w.y)):w.y<0&&N(_(w.y)),y.copy(b),r.update()}function Q(L){v.set(L.clientX,L.clientY),x.subVectors(v,g).multiplyScalar(r.panSpeed),$(x.x,x.y),g.copy(v),r.update()}function ie(L){W(L.clientX,L.clientY),L.deltaY<0?N(_(L.deltaY)):L.deltaY>0&&H(_(L.deltaY)),r.update()}function je(L){let ge=!1;switch(L.code){case r.keys.UP:L.ctrlKey||L.metaKey||L.shiftKey?X(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(0,r.keyPanSpeed),ge=!0;break;case r.keys.BOTTOM:L.ctrlKey||L.metaKey||L.shiftKey?X(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(0,-r.keyPanSpeed),ge=!0;break;case r.keys.LEFT:L.ctrlKey||L.metaKey||L.shiftKey?R(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(r.keyPanSpeed,0),ge=!0;break;case r.keys.RIGHT:L.ctrlKey||L.metaKey||L.shiftKey?R(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(-r.keyPanSpeed,0),ge=!0;break}ge&&(L.preventDefault(),r.update())}function Z(L){if(A.length===1)d.set(L.pageX,L.pageY);else{const ge=Ie(L),F=.5*(L.pageX+ge.x),de=.5*(L.pageY+ge.y);d.set(F,de)}}function re(L){if(A.length===1)g.set(L.pageX,L.pageY);else{const ge=Ie(L),F=.5*(L.pageX+ge.x),de=.5*(L.pageY+ge.y);g.set(F,de)}}function pe(L){const ge=Ie(L),F=L.pageX-ge.x,de=L.pageY-ge.y,ve=Math.sqrt(F*F+de*de);y.set(0,ve)}function se(L){r.enableZoom&&pe(L),r.enablePan&&re(L)}function _e(L){r.enableZoom&&pe(L),r.enableRotate&&Z(L)}function ke(L){if(A.length==1)f.set(L.pageX,L.pageY);else{const F=Ie(L),de=.5*(L.pageX+F.x),ve=.5*(L.pageY+F.y);f.set(de,ve)}m.subVectors(f,d).multiplyScalar(r.rotateSpeed);const ge=r.domElement;R(2*Math.PI*m.x/ge.clientHeight),X(2*Math.PI*m.y/ge.clientHeight),d.copy(f)}function ne(L){if(A.length===1)v.set(L.pageX,L.pageY);else{const ge=Ie(L),F=.5*(L.pageX+ge.x),de=.5*(L.pageY+ge.y);v.set(F,de)}x.subVectors(v,g).multiplyScalar(r.panSpeed),$(x.x,x.y),g.copy(v)}function Le(L){const ge=Ie(L),F=L.pageX-ge.x,de=L.pageY-ge.y,ve=Math.sqrt(F*F+de*de);b.set(0,ve),w.set(0,Math.pow(b.y/y.y,r.zoomSpeed)),H(w.y),y.copy(b);const Ae=(L.pageX+ge.x)*.5,Ee=(L.pageY+ge.y)*.5;W(Ae,Ee)}function qe(L){r.enableZoom&&Le(L),r.enablePan&&ne(L)}function ze(L){r.enableZoom&&Le(L),r.enableRotate&&ke(L)}function Ke(L){r.enabled!==!1&&(A.length===0&&(r.domElement.setPointerCapture(L.pointerId),r.domElement.addEventListener("pointermove",pt),r.domElement.addEventListener("pointerup",Ye)),!$e(L)&&(Se(L),L.pointerType==="touch"?fe(L):Qe(L)))}function pt(L){r.enabled!==!1&&(L.pointerType==="touch"?ee(L):Ze(L))}function Ye(L){switch(De(L),A.length){case 0:r.domElement.releasePointerCapture(L.pointerId),r.domElement.removeEventListener("pointermove",pt),r.domElement.removeEventListener("pointerup",Ye),r.dispatchEvent(I2),a=i.NONE;break;case 1:const ge=A[0],F=T[ge];fe({pointerId:ge,pageX:F.x,pageY:F.y});break}}function Qe(L){let ge;switch(L.button){case 0:ge=r.mouseButtons.LEFT;break;case 1:ge=r.mouseButtons.MIDDLE;break;case 2:ge=r.mouseButtons.RIGHT;break;default:ge=-1}switch(ge){case Os.DOLLY:if(r.enableZoom===!1)return;le(L),a=i.DOLLY;break;case Os.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;E(L),a=i.PAN}else{if(r.enableRotate===!1)return;U(L),a=i.ROTATE}break;case Os.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;U(L),a=i.ROTATE}else{if(r.enablePan===!1)return;E(L),a=i.PAN}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(Cy)}function Ze(L){switch(a){case i.ROTATE:if(r.enableRotate===!1)return;he(L);break;case i.DOLLY:if(r.enableZoom===!1)return;ye(L);break;case i.PAN:if(r.enablePan===!1)return;Q(L);break}}function tt(L){r.enabled===!1||r.enableZoom===!1||a!==i.NONE||(L.preventDefault(),r.dispatchEvent(Cy),ie(J(L)),r.dispatchEvent(I2))}function J(L){const ge=L.deltaMode,F={clientX:L.clientX,clientY:L.clientY,deltaY:L.deltaY};switch(ge){case 1:F.deltaY*=16;break;case 2:F.deltaY*=100;break}return L.ctrlKey&&!D&&(F.deltaY*=10),F}function Y(L){L.key==="Control"&&(D=!0,r.domElement.getRootNode().addEventListener("keyup",ue,{passive:!0,capture:!0}))}function ue(L){L.key==="Control"&&(D=!1,r.domElement.getRootNode().removeEventListener("keyup",ue,{passive:!0,capture:!0}))}function M(L){r.enabled===!1||r.enablePan===!1||je(L)}function fe(L){switch(He(L),A.length){case 1:switch(r.touches.ONE){case Ns.ROTATE:if(r.enableRotate===!1)return;Z(L),a=i.TOUCH_ROTATE;break;case Ns.PAN:if(r.enablePan===!1)return;re(L),a=i.TOUCH_PAN;break;default:a=i.NONE}break;case 2:switch(r.touches.TWO){case Ns.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;se(L),a=i.TOUCH_DOLLY_PAN;break;case Ns.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;_e(L),a=i.TOUCH_DOLLY_ROTATE;break;default:a=i.NONE}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(Cy)}function ee(L){switch(He(L),a){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;ke(L),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;ne(L),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;qe(L),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ze(L),r.update();break;default:a=i.NONE}}function xe(L){r.enabled!==!1&&L.preventDefault()}function Se(L){A.push(L.pointerId)}function De(L){delete T[L.pointerId];for(let ge=0;ge<A.length;ge++)if(A[ge]==L.pointerId){A.splice(ge,1);return}}function $e(L){for(let ge=0;ge<A.length;ge++)if(A[ge]==L.pointerId)return!0;return!1}function He(L){let ge=T[L.pointerId];ge===void 0&&(ge=new Rn,T[L.pointerId]=ge),ge.set(L.pageX,L.pageY)}function Ie(L){const ge=L.pointerId===A[0]?A[1]:A[0];return T[ge]}r.domElement.addEventListener("contextmenu",xe),r.domElement.addEventListener("pointerdown",Ke),r.domElement.addEventListener("pointercancel",Ye),r.domElement.addEventListener("wheel",tt,{passive:!1}),r.domElement.getRootNode().addEventListener("keydown",Y,{passive:!0,capture:!0}),this.update()}}class Py extends X2{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Rn(.5,.5),this.addEventListener("removed",function(){this.traverse(function(n){n.element instanceof Element&&n.element.parentNode!==null&&n.element.parentNode.removeChild(n.element)})})}copy(t,n){return super.copy(t,n),this.element=t.element.cloneNode(!0),this.center=t.center,this}}const Us=new rt,N2=new Gx,M2=new Gx,_2=new rt,R2=new rt;class jue{constructor(t={}){const n=this;let r,i,a,s;const l={objects:new WeakMap},c=t.element!==void 0?t.element:document.createElement("div");c.style.overflow="hidden",this.domElement=c,this.getSize=function(){return{width:r,height:i}},this.render=function(g,v){g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),v.parent===null&&v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld(),N2.copy(v.matrixWorldInverse),M2.multiplyMatrices(v.projectionMatrix,N2),p(g,g,v),m(g)},this.setSize=function(g,v){r=g,i=v,a=r/2,s=i/2,c.style.width=g+"px",c.style.height=v+"px"};function u(g){g.isCSS2DObject&&(g.element.style.display="none");for(let v=0,x=g.children.length;v<x;v++)u(g.children[v])}function p(g,v,x){if(g.visible===!1){u(g);return}if(g.isCSS2DObject){Us.setFromMatrixPosition(g.matrixWorld),Us.applyMatrix4(M2);const y=Us.z>=-1&&Us.z<=1&&g.layers.test(x.layers)===!0,b=g.element;b.style.display=y===!0?"":"none",y===!0&&(g.onBeforeRender(n,v,x),b.style.transform="translate("+-100*g.center.x+"%,"+-100*g.center.y+"%)translate("+(Us.x*a+a)+"px,"+(-Us.y*s+s)+"px)",b.parentNode!==c&&c.appendChild(b),g.onAfterRender(n,v,x));const w={distanceToCameraSquared:d(x,g)};l.objects.set(g,w)}for(let y=0,b=g.children.length;y<b;y++)p(g.children[y],v,x)}function d(g,v){return _2.setFromMatrixPosition(g.matrixWorld),R2.setFromMatrixPosition(v.matrixWorld),_2.distanceToSquared(R2)}function f(g){const v=[];return g.traverseVisible(function(x){x.isCSS2DObject&&v.push(x)}),v}function m(g){const v=f(g).sort(function(y,b){if(y.renderOrder!==b.renderOrder)return b.renderOrder-y.renderOrder;const w=l.objects.get(y).distanceToCameraSquared,j=l.objects.get(b).distanceToCameraSquared;return w-j}),x=v.length;for(let y=0,b=v.length;y<b;y++)v[y].element.style.zIndex=x-y}}}const D2=new Xx,fp=new rt;class dL extends XL{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(r),this.setAttribute("position",new Hw(t,3)),this.setAttribute("uv",new Hw(n,2))}applyMatrix4(t){const n=this.attributes.instanceStart,r=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(t),r.applyMatrix4(t),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let n;t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));const r=new Ny(n,6,1);return this.setAttribute("instanceStart",new Vs(r,3,0)),this.setAttribute("instanceEnd",new Vs(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let n;t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));const r=new Ny(n,6,1);return this.setAttribute("instanceColorStart",new Vs(r,3,0)),this.setAttribute("instanceColorEnd",new Vs(r,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new QL(t.geometry)),this}fromLineSegments(t){const n=t.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Xx);const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;t!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(t),D2.setFromBufferAttribute(n),this.boundingBox.union(D2))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Q2),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(t!==void 0&&n!==void 0){const r=this.boundingSphere.center;this.boundingBox.getCenter(r);let i=0;for(let a=0,s=t.count;a<s;a++)fp.fromBufferAttribute(t,a),i=Math.max(i,r.distanceToSquared(fp)),fp.fromBufferAttribute(n,a),i=Math.max(i,r.distanceToSquared(fp));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}bp.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Rn(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};xp.line={uniforms:Z2.merge([bp.common,bp.fog,bp.line]),vertexShader:`
809
+ #include <common>
810
+ #include <color_pars_vertex>
811
+ #include <fog_pars_vertex>
812
+ #include <logdepthbuf_pars_vertex>
813
+ #include <clipping_planes_pars_vertex>
814
+
815
+ uniform float linewidth;
816
+ uniform vec2 resolution;
817
+
818
+ attribute vec3 instanceStart;
819
+ attribute vec3 instanceEnd;
820
+
821
+ attribute vec3 instanceColorStart;
822
+ attribute vec3 instanceColorEnd;
823
+
824
+ #ifdef WORLD_UNITS
825
+
826
+ varying vec4 worldPos;
827
+ varying vec3 worldStart;
828
+ varying vec3 worldEnd;
829
+
830
+ #ifdef USE_DASH
831
+
832
+ varying vec2 vUv;
833
+
834
+ #endif
835
+
836
+ #else
837
+
838
+ varying vec2 vUv;
839
+
840
+ #endif
841
+
842
+ #ifdef USE_DASH
843
+
844
+ uniform float dashScale;
845
+ attribute float instanceDistanceStart;
846
+ attribute float instanceDistanceEnd;
847
+ varying float vLineDistance;
848
+
849
+ #endif
850
+
851
+ void trimSegment( const in vec4 start, inout vec4 end ) {
852
+
853
+ // trim end segment so it terminates between the camera plane and the near plane
854
+
855
+ // conservative estimate of the near plane
856
+ float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
857
+ float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
858
+ float nearEstimate = - 0.5 * b / a;
859
+
860
+ float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
861
+
862
+ end.xyz = mix( start.xyz, end.xyz, alpha );
863
+
864
+ }
865
+
866
+ void main() {
867
+
868
+ #ifdef USE_COLOR
869
+
870
+ vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
871
+
872
+ #endif
873
+
874
+ #ifdef USE_DASH
875
+
876
+ vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
877
+ vUv = uv;
878
+
879
+ #endif
880
+
881
+ float aspect = resolution.x / resolution.y;
882
+
883
+ // camera space
884
+ vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
885
+ vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
886
+
887
+ #ifdef WORLD_UNITS
888
+
889
+ worldStart = start.xyz;
890
+ worldEnd = end.xyz;
891
+
892
+ #else
893
+
894
+ vUv = uv;
895
+
896
+ #endif
897
+
898
+ // special case for perspective projection, and segments that terminate either in, or behind, the camera plane
899
+ // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
900
+ // but we need to perform ndc-space calculations in the shader, so we must address this issue directly
901
+ // perhaps there is a more elegant solution -- WestLangley
902
+
903
+ bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
904
+
905
+ if ( perspective ) {
906
+
907
+ if ( start.z < 0.0 && end.z >= 0.0 ) {
908
+
909
+ trimSegment( start, end );
910
+
911
+ } else if ( end.z < 0.0 && start.z >= 0.0 ) {
912
+
913
+ trimSegment( end, start );
914
+
915
+ }
916
+
917
+ }
918
+
919
+ // clip space
920
+ vec4 clipStart = projectionMatrix * start;
921
+ vec4 clipEnd = projectionMatrix * end;
922
+
923
+ // ndc space
924
+ vec3 ndcStart = clipStart.xyz / clipStart.w;
925
+ vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
926
+
927
+ // direction
928
+ vec2 dir = ndcEnd.xy - ndcStart.xy;
929
+
930
+ // account for clip-space aspect ratio
931
+ dir.x *= aspect;
932
+ dir = normalize( dir );
933
+
934
+ #ifdef WORLD_UNITS
935
+
936
+ vec3 worldDir = normalize( end.xyz - start.xyz );
937
+ vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );
938
+ vec3 worldUp = normalize( cross( worldDir, tmpFwd ) );
939
+ vec3 worldFwd = cross( worldDir, worldUp );
940
+ worldPos = position.y < 0.5 ? start: end;
941
+
942
+ // height offset
943
+ float hw = linewidth * 0.5;
944
+ worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;
945
+
946
+ // don't extend the line if we're rendering dashes because we
947
+ // won't be rendering the endcaps
948
+ #ifndef USE_DASH
949
+
950
+ // cap extension
951
+ worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;
952
+
953
+ // add width to the box
954
+ worldPos.xyz += worldFwd * hw;
955
+
956
+ // endcaps
957
+ if ( position.y > 1.0 || position.y < 0.0 ) {
958
+
959
+ worldPos.xyz -= worldFwd * 2.0 * hw;
960
+
961
+ }
962
+
963
+ #endif
964
+
965
+ // project the worldpos
966
+ vec4 clip = projectionMatrix * worldPos;
967
+
968
+ // shift the depth of the projected points so the line
969
+ // segments overlap neatly
970
+ vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
971
+ clip.z = clipPose.z * clip.w;
972
+
973
+ #else
974
+
975
+ vec2 offset = vec2( dir.y, - dir.x );
976
+ // undo aspect ratio adjustment
977
+ dir.x /= aspect;
978
+ offset.x /= aspect;
979
+
980
+ // sign flip
981
+ if ( position.x < 0.0 ) offset *= - 1.0;
982
+
983
+ // endcaps
984
+ if ( position.y < 0.0 ) {
985
+
986
+ offset += - dir;
987
+
988
+ } else if ( position.y > 1.0 ) {
989
+
990
+ offset += dir;
991
+
992
+ }
993
+
994
+ // adjust for linewidth
995
+ offset *= linewidth;
996
+
997
+ // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
998
+ offset /= resolution.y;
999
+
1000
+ // select end
1001
+ vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
1002
+
1003
+ // back to clip space
1004
+ offset *= clip.w;
1005
+
1006
+ clip.xy += offset;
1007
+
1008
+ #endif
1009
+
1010
+ gl_Position = clip;
1011
+
1012
+ vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
1013
+
1014
+ #include <logdepthbuf_vertex>
1015
+ #include <clipping_planes_vertex>
1016
+ #include <fog_vertex>
1017
+
1018
+ }
1019
+ `,fragmentShader:`
1020
+ uniform vec3 diffuse;
1021
+ uniform float opacity;
1022
+ uniform float linewidth;
1023
+
1024
+ #ifdef USE_DASH
1025
+
1026
+ uniform float dashOffset;
1027
+ uniform float dashSize;
1028
+ uniform float gapSize;
1029
+
1030
+ #endif
1031
+
1032
+ varying float vLineDistance;
1033
+
1034
+ #ifdef WORLD_UNITS
1035
+
1036
+ varying vec4 worldPos;
1037
+ varying vec3 worldStart;
1038
+ varying vec3 worldEnd;
1039
+
1040
+ #ifdef USE_DASH
1041
+
1042
+ varying vec2 vUv;
1043
+
1044
+ #endif
1045
+
1046
+ #else
1047
+
1048
+ varying vec2 vUv;
1049
+
1050
+ #endif
1051
+
1052
+ #include <common>
1053
+ #include <color_pars_fragment>
1054
+ #include <fog_pars_fragment>
1055
+ #include <logdepthbuf_pars_fragment>
1056
+ #include <clipping_planes_pars_fragment>
1057
+
1058
+ vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
1059
+
1060
+ float mua;
1061
+ float mub;
1062
+
1063
+ vec3 p13 = p1 - p3;
1064
+ vec3 p43 = p4 - p3;
1065
+
1066
+ vec3 p21 = p2 - p1;
1067
+
1068
+ float d1343 = dot( p13, p43 );
1069
+ float d4321 = dot( p43, p21 );
1070
+ float d1321 = dot( p13, p21 );
1071
+ float d4343 = dot( p43, p43 );
1072
+ float d2121 = dot( p21, p21 );
1073
+
1074
+ float denom = d2121 * d4343 - d4321 * d4321;
1075
+
1076
+ float numer = d1343 * d4321 - d1321 * d4343;
1077
+
1078
+ mua = numer / denom;
1079
+ mua = clamp( mua, 0.0, 1.0 );
1080
+ mub = ( d1343 + d4321 * ( mua ) ) / d4343;
1081
+ mub = clamp( mub, 0.0, 1.0 );
1082
+
1083
+ return vec2( mua, mub );
1084
+
1085
+ }
1086
+
1087
+ void main() {
1088
+
1089
+ #include <clipping_planes_fragment>
1090
+
1091
+ #ifdef USE_DASH
1092
+
1093
+ if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
1094
+
1095
+ if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
1096
+
1097
+ #endif
1098
+
1099
+ float alpha = opacity;
1100
+
1101
+ #ifdef WORLD_UNITS
1102
+
1103
+ // Find the closest points on the view ray and the line segment
1104
+ vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
1105
+ vec3 lineDir = worldEnd - worldStart;
1106
+ vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
1107
+
1108
+ vec3 p1 = worldStart + lineDir * params.x;
1109
+ vec3 p2 = rayEnd * params.y;
1110
+ vec3 delta = p1 - p2;
1111
+ float len = length( delta );
1112
+ float norm = len / linewidth;
1113
+
1114
+ #ifndef USE_DASH
1115
+
1116
+ #ifdef USE_ALPHA_TO_COVERAGE
1117
+
1118
+ float dnorm = fwidth( norm );
1119
+ alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
1120
+
1121
+ #else
1122
+
1123
+ if ( norm > 0.5 ) {
1124
+
1125
+ discard;
1126
+
1127
+ }
1128
+
1129
+ #endif
1130
+
1131
+ #endif
1132
+
1133
+ #else
1134
+
1135
+ #ifdef USE_ALPHA_TO_COVERAGE
1136
+
1137
+ // artifacts appear on some hardware if a derivative is taken within a conditional
1138
+ float a = vUv.x;
1139
+ float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
1140
+ float len2 = a * a + b * b;
1141
+ float dlen = fwidth( len2 );
1142
+
1143
+ if ( abs( vUv.y ) > 1.0 ) {
1144
+
1145
+ alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
1146
+
1147
+ }
1148
+
1149
+ #else
1150
+
1151
+ if ( abs( vUv.y ) > 1.0 ) {
1152
+
1153
+ float a = vUv.x;
1154
+ float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
1155
+ float len2 = a * a + b * b;
1156
+
1157
+ if ( len2 > 1.0 ) discard;
1158
+
1159
+ }
1160
+
1161
+ #endif
1162
+
1163
+ #endif
1164
+
1165
+ vec4 diffuseColor = vec4( diffuse, alpha );
1166
+
1167
+ #include <logdepthbuf_fragment>
1168
+ #include <color_fragment>
1169
+
1170
+ gl_FragColor = vec4( diffuseColor.rgb, alpha );
1171
+
1172
+ #include <tonemapping_fragment>
1173
+ #include <colorspace_fragment>
1174
+ #include <fog_fragment>
1175
+ #include <premultiplied_alpha_fragment>
1176
+
1177
+ }
1178
+ `};class ll extends ZL{constructor(t){super({type:"LineMaterial",uniforms:Z2.clone(xp.line.uniforms),vertexShader:xp.line.vertexShader,fragmentShader:xp.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){t===!0!==this.dashed&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(t===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),t===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const Ay=new zu,L2=new rt,z2=new rt,In=new zu,On=new zu,ki=new zu,Ey=new rt,Ty=new Gx,_n=new JL,$2=new rt,hp=new Xx,mp=new Q2,Ci=new zu;let Ni,ns;function B2(e,t,n){return Ci.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),Ci.multiplyScalar(1/Ci.w),Ci.x=ns/n.width,Ci.y=ns/n.height,Ci.applyMatrix4(e.projectionMatrixInverse),Ci.multiplyScalar(1/Ci.w),Math.abs(Math.max(Ci.x,Ci.y))}function Sue(e,t){const n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,s=Math.min(r.instanceCount,i.count);for(let l=0,c=s;l<c;l++){_n.start.fromBufferAttribute(i,l),_n.end.fromBufferAttribute(a,l),_n.applyMatrix4(n);const u=new rt,p=new rt;Ni.distanceSqToSegment(_n.start,_n.end,p,u),p.distanceTo(u)<ns*.5&&t.push({point:p,pointOnLine:u,distance:Ni.origin.distanceTo(p),object:e,face:null,faceIndex:l,uv:null,uv1:null})}}function kue(e,t,n){const r=t.projectionMatrix,a=e.material.resolution,s=e.matrixWorld,l=e.geometry,c=l.attributes.instanceStart,u=l.attributes.instanceEnd,p=Math.min(l.instanceCount,c.count),d=-t.near;Ni.at(1,ki),ki.w=1,ki.applyMatrix4(t.matrixWorldInverse),ki.applyMatrix4(r),ki.multiplyScalar(1/ki.w),ki.x*=a.x/2,ki.y*=a.y/2,ki.z=0,Ey.copy(ki),Ty.multiplyMatrices(t.matrixWorldInverse,s);for(let f=0,m=p;f<m;f++){if(In.fromBufferAttribute(c,f),On.fromBufferAttribute(u,f),In.w=1,On.w=1,In.applyMatrix4(Ty),On.applyMatrix4(Ty),In.z>d&&On.z>d)continue;if(In.z>d){const w=In.z-On.z,j=(In.z-d)/w;In.lerp(On,j)}else if(On.z>d){const w=On.z-In.z,j=(On.z-d)/w;On.lerp(In,j)}In.applyMatrix4(r),On.applyMatrix4(r),In.multiplyScalar(1/In.w),On.multiplyScalar(1/On.w),In.x*=a.x/2,In.y*=a.y/2,On.x*=a.x/2,On.y*=a.y/2,_n.start.copy(In),_n.start.z=0,_n.end.copy(On),_n.end.z=0;const v=_n.closestPointToPointParameter(Ey,!0);_n.at(v,$2);const x=G2.lerp(In.z,On.z,v),y=x>=-1&&x<=1,b=Ey.distanceTo($2)<ns*.5;if(y&&b){_n.start.fromBufferAttribute(c,f),_n.end.fromBufferAttribute(u,f),_n.start.applyMatrix4(s),_n.end.applyMatrix4(s);const w=new rt,j=new rt;Ni.distanceSqToSegment(_n.start,_n.end,j,w),n.push({point:j,pointOnLine:w,distance:Ni.origin.distanceTo(j),object:e,face:null,faceIndex:f,uv:null,uv1:null})}}}class Cue extends Ra{constructor(t=new dL,n=new ll({color:Math.random()*16777215})){super(t,n),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,n=t.attributes.instanceStart,r=t.attributes.instanceEnd,i=new Float32Array(2*n.count);for(let s=0,l=0,c=n.count;s<c;s++,l+=2)L2.fromBufferAttribute(n,s),z2.fromBufferAttribute(r,s),i[l]=l===0?0:i[l-1],i[l+1]=i[l]+L2.distanceTo(z2);const a=new Ny(i,2,1);return t.setAttribute("instanceDistanceStart",new Vs(a,1,0)),t.setAttribute("instanceDistanceEnd",new Vs(a,1,1)),this}raycast(t,n){const r=this.material.worldUnits,i=t.camera;i===null&&!r&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const a=t.params.Line2!==void 0&&t.params.Line2.threshold||0;Ni=t.ray;const s=this.matrixWorld,l=this.geometry,c=this.material;ns=c.linewidth+a,l.boundingSphere===null&&l.computeBoundingSphere(),mp.copy(l.boundingSphere).applyMatrix4(s);let u;if(r)u=ns*.5;else{const d=Math.max(i.near,mp.distanceToPoint(Ni.origin));u=B2(i,d,c.resolution)}if(mp.radius+=u,Ni.intersectsSphere(mp)===!1)return;l.boundingBox===null&&l.computeBoundingBox(),hp.copy(l.boundingBox).applyMatrix4(s);let p;if(r)p=ns*.5;else{const d=Math.max(i.near,hp.distanceToPoint(Ni.origin));p=B2(i,d,c.resolution)}hp.expandByScalar(p),Ni.intersectsBox(hp)!==!1&&(r?Sue(this,n):kue(this,i,n))}onBeforeRender(t){const n=this.material.uniforms;n&&n.resolution&&(t.getViewport(Ay),this.material.uniforms.resolution.value.set(Ay.z,Ay.w))}}class qx extends dL{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const n=t.length-3,r=new Float32Array(2*n);for(let i=0;i<n;i+=3)r[2*i]=t[i],r[2*i+1]=t[i+1],r[2*i+2]=t[i+2],r[2*i+3]=t[i+3],r[2*i+4]=t[i+4],r[2*i+5]=t[i+5];return super.setPositions(r),this}setColors(t){const n=t.length-3,r=new Float32Array(2*n);for(let i=0;i<n;i+=3)r[2*i]=t[i],r[2*i+1]=t[i+1],r[2*i+2]=t[i+2],r[2*i+3]=t[i+3],r[2*i+4]=t[i+4],r[2*i+5]=t[i+5];return super.setColors(r),this}fromLine(t){const n=t.geometry;return this.setPositions(n.attributes.position.array),this}}class gp extends Cue{constructor(t=new qx,n=new ll({color:Math.random()*16777215})){super(t,n),this.isLine2=!0,this.type="Line2"}}const Pue=864e5,Aue=1e6,Ec=[0,1,7,30,365],Eue=[32,48,48,32],Tc=(()=>{const e=[0];let t=0;for(const n of Eue)t+=n,e.push(t);return e})(),Ti=new rt(0,0,0);function Yx(e){if(!Number.isFinite(e)||e<=0)return 0;for(let t=1;t<Ec.length;t++)if(e<=Ec[t]){const n=(e-Ec[t-1])/(Ec[t]-Ec[t-1]);return Tc[t-1]+(Tc[t]-Tc[t-1])*n}return Tc[Tc.length-1]}const xh=.7,pL=4,eu=10;function Tue(e){return Math.min((e||0)/100,1)}function F2(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}function Iue(e){const t=Math.max(0,e|0);return t<=0?0:Math.max(0,Math.min(1,Math.log10(t+1)/Math.log10(Aue+1)))}const U2=[9,9,18,36,72,144],W2=[0,1e4,1e5,1e6,1e7,1e8,1e9];function Oue(){const e=[[W2[0],0]];let t=0;for(let n=0;n<U2.length;n++)t+=U2[n],e.push([W2[n+1],t]);return e}const Ws=Oue(),Iy=[[1e4,Mo(1e4)],[1e5,Mo(1e5)],[1e6,Mo(1e6)],[1e7,Mo(1e7)],[1e8,Mo(1e8)],[1e9,Mo(1e9)]];function Mo(e){const t=Math.max(0,e|0);if(t<=0)return 0;for(let n=1;n<Ws.length;n++)if(t<=Ws[n][0]){const[r,i]=Ws[n-1],[a,s]=Ws[n],l=(t-r)/(a-r);return i+(s-i)*l}return Ws[Ws.length-1][1]}function Nue(e){return Mo(e)}function Mue(e){return e>=1e9?`${e/1e9}B`:e>=1e6?`${e/1e6}M`:e>=1e3?`${e/1e3}k`:`${e}`}function _ue(e){const t=Tue(e),n=Math.max(0,Math.min(eu-1,Math.round(t*(eu-1))));return{radius:xh+(pL-xh)*(n/(eu-1)),bucket:n}}function Rue(e,t){const n=t-e.firstRequestAt,r=Number.isFinite(n)&&n>0?n/Pue:0,i=(F2(e.sessionId)%360+(F2(e.sessionId+"~j")%40-20))*(Math.PI/180),a=Yx(r),s=Math.cos(i)*a,l=Math.sin(i)*a,c=Iue(e.totalTokens),u=Nue(e.totalTokens),p=new rt(s,u,l);let d=null;const f=e.inputTokens|0,m=e.outputTokens|0;if(f>0&&m>0){const y=Math.min(f/(f+m),.85);d=new rt(Ti.x+(p.x-Ti.x)*y,Ti.y+(p.y-Ti.y)*y,Ti.z+(p.z-Ti.z)*y)}const{radius:g,bucket:v}=_ue(e.requestCount);return{pos:p,radius:g,bucket:v,depth01:c,split:d}}const Due='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude Code</title><path clip-rule="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" fill-rule="evenodd"></path></svg>',Lue=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Codex</title><path clip-rule="evenodd" d="M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z" fill="url(#codex-gradient)" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="codex-gradient" x1="12" x2="12" y1="3" y2="21"><stop stop-color="#B1A7FF"></stop><stop offset=".5" stop-color="#7A9DFF"></stop><stop offset="1" stop-color="#3941FF"></stop></linearGradient></defs></svg>
1179
+ `,zue=`<svg fill="#10B981" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>opencode</title><path d="M16 6H8v12h8V6zm4 16H4V2h16v20z"></path></svg>
1180
+ `,K2=new rt(0,60,60),Oy=new rt(0,28,0),yp=new rt(0,.82,.58).normalize(),H2=.32,V2=54784;function $ue(e){const n=new vz(1,1,12,12),r=n.attributes.position,i=Math.abs(yp.y)<.9?new rt(0,1,0):new rt(0,0,1),a=new rt().crossVectors(yp,i).normalize(),s=new rt().crossVectors(yp,a).normalize(),l=new tu,c=new tu,u=new rt;for(let p=0;p<r.count;p++){const d=r.getX(p)*2*H2,f=r.getY(p)*2*H2;l.setFromAxisAngle(a,d),c.setFromAxisAngle(s,f),u.copy(yp).applyQuaternion(l).applyQuaternion(c).normalize();const m=e*1.003;r.setXYZ(p,u.x*m,u.y*m,u.z*m)}return r.needsUpdate=!0,n.computeVertexNormals(),n}const vp={active:"--accent-primary",idle:"--accent-warning",completed:"--border-secondary",error:"--accent-danger"};class Bue{constructor(t,n){Be(this,"container");Be(this,"cb");Be(this,"renderer");Be(this,"css2d");Be(this,"scene");Be(this,"camera");Be(this,"controls");Be(this,"raycaster",new ez);Be(this,"pointer",new Rn);Be(this,"clock",new tz);Be(this,"nodes",new Map);Be(this,"links",new Map);Be(this,"pickables",[]);Be(this,"sphereGeoms",[]);Be(this,"glowGeoms",[]);Be(this,"decalGeoms",[]);Be(this,"ringPivot");Be(this,"ringMesh");Be(this,"ringMat");Be(this,"floor");Be(this,"floorRings",[]);Be(this,"apexMat");Be(this,"apexMesh");Be(this,"axisMat");Be(this,"axisLine");Be(this,"axisLabels",[]);Be(this,"ringLabels",[]);Be(this,"palette");Be(this,"completedNodeColor");Be(this,"bgColor");Be(this,"logoTexCache",new Map);Be(this,"logoImg",{});Be(this,"selectedId",null);Be(this,"showAllLabels",!1);Be(this,"showLinks",!1);Be(this,"focusTarget",null);Be(this,"rafId",0);Be(this,"running",!1);Be(this,"disposed",!1);Be(this,"downClient",{x:0,y:0});Be(this,"downCamPos",new rt);Be(this,"downCamQuat",new tu);Be(this,"pointerDownTime",0);Be(this,"ro");Be(this,"mo");Be(this,"probeEl");Be(this,"onPointerDown",t=>{this.downClient={x:t.clientX,y:t.clientY},this.downCamPos.copy(this.camera.position),this.downCamQuat.copy(this.camera.quaternion),this.pointerDownTime=performance.now()});Be(this,"onPointerUp",t=>{const n=Math.hypot(t.clientX-this.downClient.x,t.clientY-this.downClient.y),r=this.camera.position.distanceTo(this.downCamPos)>1e-4||Math.abs(this.camera.quaternion.dot(this.downCamQuat))<.9995,i=performance.now()-this.pointerDownTime;if(n>5||r||i>350)return;const a=this.renderer.domElement.getBoundingClientRect();this.pointer.x=(t.clientX-a.left)/a.width*2-1,this.pointer.y=-((t.clientY-a.top)/a.height)*2+1,this.raycaster.setFromCamera(this.pointer,this.camera);const s=this.raycaster.intersectObjects(this.pickables,!1);if(s.length>0){const l=s[0].object,c=this.findByMesh(l);this.cb.onSelect(c?c.sessionId:null)}else this.cb.onSelect(null)});Be(this,"onContextLost",t=>{var n,r;t.preventDefault(),this.running=!1,cancelAnimationFrame(this.rafId),(r=(n=this.cb).onContextLost)==null||r.call(n)});Be(this,"onVisibility",()=>{document.hidden?(this.running=!1,cancelAnimationFrame(this.rafId)):!this.disposed&&!this.running&&(this.running=!0,this.clock.getDelta(),this.loop())});Be(this,"loop",()=>{if(!this.running||this.disposed)return;this.rafId=requestAnimationFrame(this.loop);const t=Math.min(this.clock.getDelta(),.05),n=this.clock.elapsedTime,r=1-Math.exp(-t*6);for(const i of this.nodes.values())i.group.position.lerp(i.targetPos,r),i.glow.visible&&(i.glowMat.opacity=(.4+Math.sin(n*2)*.2)*.5,i.glow.scale.setScalar(1+Math.sin(n*2)*.05)),i.inFlight>0?i.sphere.scale.setScalar(1+Math.sin(n*6)*.05):i.sphere.scale.x!==1&&i.sphere.scale.setScalar(1);if(this.selectedId&&this.ringPivot.visible){const i=this.nodes.get(this.selectedId);i?(this.ringPivot.position.copy(i.group.position),this.ringPivot.rotation.y+=t*.8):this.ringPivot.visible=!1}this.focusTarget&&(this.camera.position.lerp(this.focusTarget.cam,1-Math.exp(-t*3)),this.controls.target.lerp(this.focusTarget.look,1-Math.exp(-t*3)),this.camera.position.distanceTo(this.focusTarget.cam)<.1&&(this.focusTarget=null)),this.controls.update(),this.renderer.render(this.scene,this.camera),this.css2d.render(this.scene,this.camera)});this.container=t,this.cb=n,this.probeEl=document.createElement("div"),this.probeEl.style.position="absolute",this.probeEl.style.visibility="hidden",this.probeEl.style.pointerEvents="none";try{this.build()}catch(r){throw this.dispose(),r}}build(){const t=this.container.clientWidth||800,n=this.container.clientHeight||600;this.renderer=new nz({antialias:!0,alpha:!0,powerPreference:"high-performance"}),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.renderer.setSize(t,n),this.renderer.setClearColor(0,0),this.renderer.toneMapping=rz,this.renderer.toneMappingExposure=1.05,this.renderer.outputColorSpace=Vw,this.renderer.domElement.style.position="absolute",this.renderer.domElement.style.inset="0",this.renderer.domElement.style.width="100%",this.renderer.domElement.style.height="100%",this.renderer.domElement.style.display="block",this.renderer.domElement.style.cursor="grab",this.container.appendChild(this.renderer.domElement),this.renderer.domElement.addEventListener("webglcontextlost",this.onContextLost,!1),this.css2d=new jue,this.css2d.setSize(t,n);const r=this.css2d.domElement;r.style.position="absolute",r.style.inset="0",r.style.width="100%",r.style.height="100%",r.style.pointerEvents="none",this.container.appendChild(r),this.scene=new iz,this.refreshPalette(),this.scene.background=null,this.scene.fog=new az(this.bgColor.getHex(),250,3e3),this.camera=new oz(50,t/n,.1,3e4),this.camera.position.copy(K2),this.camera.lookAt(Oy);const i=new sz(16777215,.85);this.scene.add(i);const a=new lz(16777215,1);a.position.set(150,500,200),this.scene.add(a);const s=new cz(16767392,.6,2e3,1.2);s.position.set(0,150,0),this.scene.add(s),this.controls=new wue(this.camera,this.renderer.domElement),this.controls.target.copy(Oy),this.controls.enableDamping=!0,this.controls.dampingFactor=.08,this.controls.rotateSpeed=.7,this.controls.zoomSpeed=.9,this.controls.panSpeed=.8,this.controls.minDistance=6,this.controls.maxDistance=6e3,this.controls.maxPolarAngle=Math.PI*.49,this.controls.addEventListener("start",()=>{this.focusTarget=null,this.renderer.domElement.style.cursor="grabbing"}),this.controls.addEventListener("end",()=>{this.renderer.domElement.style.cursor="grab"});for(let p=0;p<eu;p++){const d=this.bucketRadius(p);this.sphereGeoms.push(new qw(d,32,24)),this.glowGeoms.push(new qw(d*1.55,24,16)),this.decalGeoms.push($ue(d))}const l=Yx(365)+14;this.floor=new Ra(new Yw(l,96),new Ms({color:this.palette.completed,transparent:!0,opacity:.05,side:oc})),this.floor.rotation.x=-Math.PI/2,this.scene.add(this.floor);const c=[1,7,30,365];for(const p of c){const d=Yx(p),f=new Ms({color:this.palette.completed,transparent:!0,opacity:.2,side:oc}),m=new Ra(new uz(d-1,d+1,128),f);m.rotation.x=-Math.PI/2,m.position.y=.01,this.scene.add(m),this.floorRings.push({mesh:m,mat:f});const g=document.createElement("div");g.className="am-axis-label",g.style.pointerEvents="none",g.textContent=p>=365?"1年":`${p} 天`;const v=new Py(g);v.position.set(d,.6,0),this.scene.add(v),this.ringLabels.push(v)}this.apexMat=new Ms({color:this.palette.completed,side:oc}),this.apexMesh=new Ra(new Yw(.7,32),this.apexMat),this.apexMesh.rotation.x=-Math.PI/2,this.apexMesh.position.set(0,.02,0),this.scene.add(this.apexMesh),this.ringMat=new Ms({color:this.palette.active.clone(),transparent:!0,opacity:.85,side:oc}),this.ringMesh=new Ra(new dz(1,.05,12,80),this.ringMat),this.ringMesh.rotation.x=Math.PI*.42,this.ringPivot=new X2,this.ringPivot.add(this.ringMesh),this.ringPivot.visible=!1,this.scene.add(this.ringPivot),this.buildAxis(t,n);const u=this.renderer.domElement;u.addEventListener("pointerdown",this.onPointerDown),u.addEventListener("pointerup",this.onPointerUp),this.ro=new ResizeObserver(()=>this.resize()),this.ro.observe(this.container),this.mo=new MutationObserver(()=>this.refreshTheme()),this.mo.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),document.addEventListener("visibilitychange",this.onVisibility),this.running=!0,this.clock.start(),this.loop()}bucketRadius(t){return xh+(pL-xh)*(t/(eu-1))}getDecalTex(t){const n=this.logoTexCache.get(t);if(n)return n;const r=256,i=document.createElement("canvas");i.width=i.height=r;const a=i.getContext("2d");a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high";const s=new pz(i);s.colorSpace=Vw,s.generateMipmaps=!0,s.minFilter=fz,s.magFilter=hz,s.anisotropy=8,this.logoTexCache.set(t,s);const c=Math.round(r*.8),u=(r-c)/2;return this.ensureLogoImg(t).then(p=>{a.drawImage(p,u,u,c,c),s.needsUpdate=!0}),s}applyDecalTint(t,n){n==="completed"?(t.opacity=.32,t.color.set(10133670)):n==="idle"?(t.opacity=.8,t.color.set(16777215)):(t.opacity=1,t.color.set(16777215))}applyNodeAppearance(t){const n=t.sessionId===this.selectedId,r=t.status==="completed";n?(t.sphereMat.wireframe=!1,t.sphereMat.transparent=!1,t.sphereMat.opacity=1,t.decalMat.opacity=1,t.decalMat.color.set(16777215)):(t.sphereMat.transparent=r,t.sphereMat.opacity=r?.7:1,t.sphereMat.wireframe=r,this.applyDecalTint(t.decalMat,t.status))}ensureLogoImg(t){const n=this.logoImg[t];if(n&&n.complete)return Promise.resolve(n);const i=(t==="codex"?Lue:t==="opencode"?zue:Due).replace(/width="[^"]*"/,'width="512"').replace(/height="[^"]*"/,'height="512"'),a="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i),s=n||new Image;s.crossOrigin="anonymous";const l=new Promise(c=>{s.onload=()=>{this.logoImg[t]=s,c(s)},s.onerror=()=>c(s)});return s.src=a,l}buildAxis(t,n){const r=Iy[Iy.length-1][1]+6;this.axisMat=new ll({color:this.palette.completed.getHex(),linewidth:2,transparent:!0,opacity:.5,dashed:!0,dashScale:1,dashSize:.4,gapSize:.25}),this.axisMat.resolution=new Rn(t,n);const i=new qx;i.setPositions([0,0,0,0,r,0]),this.axisLine=new gp(i,this.axisMat),this.axisLine.computeLineDistances(),this.scene.add(this.axisLine);for(const[a,s]of Iy){const l=document.createElement("div");l.className="am-axis-label",l.style.pointerEvents="none",l.textContent=Mue(a);const c=new Py(l);c.position.set(.6,s,0),this.scene.add(c),this.axisLabels.push(c)}}refreshPalette(){this.palette={active:this.resolveColor(vp.active),idle:this.resolveColor(vp.idle),completed:this.resolveColor(vp.completed),error:this.resolveColor(vp.error)},this.bgColor=this.resolveColor("--bg-primary-solid"),this.completedNodeColor=new Gw(document.documentElement.getAttribute("data-theme")==="dark"?"#4ADE80":"#86EFAC")}resolveColor(t){this.probeEl.parentElement||document.body.appendChild(this.probeEl),this.probeEl.style.color=`var(${t})`;const n=getComputedStyle(this.probeEl).color||"rgb(128,128,128)";return new Gw(n)}refreshTheme(){this.refreshPalette(),this.scene.fog&&this.scene.fog.color.copy(this.bgColor);for(const t of this.nodes.values()){const n=t.status==="completed";t.sphereMat.color.copy(n?this.completedNodeColor:this.palette[t.status]),t.glowMat.color.copy(this.palette[t.status])}for(const t of this.links.values())t.bgMat.color.copy(this.palette.active),t.segInMat.color.copy(this.palette.active),t.segOutMat.color.setHex(V2);this.floor.material.color.copy(this.palette.completed);for(const t of this.floorRings)t.mat.color.copy(this.palette.completed);if(this.apexMat.color.copy(this.palette.completed),this.selectedId){const t=this.nodes.get(this.selectedId);t&&this.ringMat.color.copy(t.status==="completed"?this.completedNodeColor:this.palette[t.status])}this.axisMat&&this.axisMat.color.copy(this.palette.completed)}update(t,n){if(this.disposed)return;const r=new Set(t.map(i=>i.sessionId));for(const i of t){const a=Rue(i,n),s=this.nodes.get(i.sessionId);s?this.updateNode(s,i,a):this.createNode(i,a);const l=this.links.get(i.sessionId);l?this.updateLink(l,a):this.createLink(i.sessionId,a)}for(const[i,a]of[...this.nodes.entries()])if(!r.has(i)){this.disposeNode(a),this.nodes.delete(i);const s=this.links.get(i);s&&(this.disposeLink(s),this.links.delete(i))}this.selectedId&&!this.nodes.has(this.selectedId)&&this.applySelection(null),this.refreshPickables()}createNode(t,n){const r=new Xw;r.position.copy(n.pos);const i=this.sphereGeoms[n.bucket],a=t.status==="completed",s=new mz({color:(a?this.completedNodeColor:this.palette[t.status]).clone(),roughness:.5,metalness:.1,transparent:a,opacity:a?.7:1,wireframe:a}),l=new Ra(i,s);r.add(l);const c=new Ms({color:this.palette[t.status].clone(),transparent:!0,opacity:0,side:yz,depthWrite:!1,blending:gz}),u=new Ra(this.glowGeoms[n.bucket],c);u.visible=t.status==="active",r.add(u);const p=new Ms({map:this.getDecalTex(t.agent),transparent:!0,depthWrite:!1,side:oc});this.applyDecalTint(p,t.status);const d=new Ra(this.decalGeoms[n.bucket],p);l.add(d);const f=t.sessionId,m=document.createElement("div");m.className="am-node-label";const g=this.showAllLabels?"auto":"none";m.style.pointerEvents=g,m.style.cursor=g==="auto"?"pointer":"default",m.addEventListener("click",w=>{w.stopPropagation(),this.cb.onSelect(f)});const v=document.createElement("div");v.className="am-node-label-title";const x=document.createElement("div");x.className="am-node-label-sub",m.appendChild(v),m.appendChild(x);const y=new Py(m);y.position.set(0,-n.radius*1.8,0),r.add(y),this.scene.add(r);const b={sessionId:t.sessionId,group:r,sphere:l,sphereMat:s,glow:u,glowMat:c,decal:d,decalMat:p,labelEl:m,label:y,targetPos:n.pos.clone(),status:t.status,radius:n.radius,bucket:n.bucket,depth01:n.depth01,inFlight:t.inFlight|0,split:n.split?n.split.clone():null};this.nodes.set(t.sessionId,b),this.writeLabel(b,t),this.syncLabel(b),this.applyNodeAppearance(b)}updateNode(t,n,r){if(t.targetPos.copy(r.pos),t.depth01=r.depth01,t.inFlight=n.inFlight|0,t.split=r.split?r.split.clone():null,r.bucket!==t.bucket&&(t.bucket=r.bucket,t.radius=r.radius,t.sphere.geometry=this.sphereGeoms[r.bucket],t.glow.geometry=this.glowGeoms[r.bucket],t.decal.geometry=this.decalGeoms[r.bucket],t.label.position.set(0,-r.radius*1.8,0),this.selectedId===t.sessionId&&this.ringMesh.scale.setScalar(r.radius*1.8)),n.status!==t.status){t.status=n.status;const a=n.status==="completed"?this.completedNodeColor:this.palette[n.status];t.sphereMat.color.copy(a),t.glowMat.color.copy(this.palette[n.status]),t.glow.visible=n.status==="active",this.applyNodeAppearance(t),t.sessionId===this.selectedId&&this.showRing(t)}this.writeLabel(t,n),this.syncLabel(t)}writeLabel(t,n){const r=t.labelEl.firstChild,i=t.labelEl.lastChild;r.textContent=(n.title||n.sessionId.slice(-8)).slice(0,20);const a=[];n.totalTokens>0&&a.push(`${this.formatTokens(n.totalTokens)} tok`),n.lastToolName&&a.push(n.lastToolName),n.source==="access-key"&&n.keyName&&a.push(`🔑 ${n.keyName}`),i.textContent=a.join(" · ")}syncLabel(t){t.label.visible=this.showAllLabels||t.sessionId===this.selectedId}setLabelsVisible(t){if(this.showAllLabels===t)return;this.showAllLabels=t;const n=t?"auto":"none";for(const r of this.nodes.values())r.labelEl.style.pointerEvents=n,r.labelEl.style.cursor=n==="auto"?"pointer":"default",this.syncLabel(r)}formatTokens(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)}k`:`${t}`}createLink(t,n){const r=new Xw,i=this.container.clientWidth||800,a=this.container.clientHeight||600,s=new Rn(i,a),l=!!n.split,c=new ll({color:this.palette.active.getHex(),linewidth:3,transparent:!0,opacity:.85+n.depth01*.15,dashed:!1});c.resolution=s;const u=new gp(this.makeLineGeo(Ti,n.pos),c),p=new ll({color:this.palette.active.getHex(),linewidth:3,transparent:!0,opacity:.95});p.resolution=s;const d=new ll({color:V2,linewidth:3,transparent:!0,opacity:.95});d.resolution=s;const f=n.split??n.pos,m=new gp(this.makeLineGeo(Ti,f),p),g=new gp(this.makeLineGeo(f,n.pos),d);u.visible=!l,m.visible=l,g.visible=l,r.add(u,m,g),r.visible=this.linkVisible(t),this.scene.add(r),this.links.set(t,{group:r,bg:u,bgMat:c,segIn:m,segInMat:p,segOut:g,segOutMat:d})}linkVisible(t){return this.showLinks||t===this.selectedId}setLinksVisible(t){if(this.showLinks!==t){this.showLinks=t;for(const[n,r]of this.links)r.group.visible=this.linkVisible(n)}}updateLink(t,n){const r=!!n.split,i=n.split??n.pos;this.setLineGeo(t.bg.geometry,Ti,n.pos),t.bgMat.opacity=.85+n.depth01*.15,this.setLineGeo(t.segIn.geometry,Ti,i),this.setLineGeo(t.segOut.geometry,i,n.pos),t.bg.visible=!r,t.segIn.visible=r,t.segOut.visible=r}makeLineGeo(t,n){const r=new qx;return r.setPositions([t.x,t.y,t.z,n.x,n.y,n.z]),r}setLineGeo(t,n,r){t.setPositions([n.x,n.y,n.z,r.x,r.y,r.z])}setSelected(t){this.selectedId!==t&&this.applySelection(t)}showRing(t){this.ringMat.color.copy(t.status==="completed"?this.completedNodeColor:this.palette[t.status]),this.ringMesh.scale.setScalar(t.radius*1.8),this.ringPivot.visible=!0}applySelection(t){const n=this.selectedId;if(this.selectedId=t,n){const a=this.nodes.get(n);a&&(this.applyNodeAppearance(a),this.syncLabel(a));const s=this.links.get(n);s&&(s.group.visible=this.linkVisible(n))}if(!t){this.ringPivot.visible=!1;return}const r=this.nodes.get(t);if(!r){this.ringPivot.visible=!1;return}const i=this.links.get(t);i&&(i.group.visible=this.linkVisible(t)),this.applyNodeAppearance(r),this.syncLabel(r),this.showRing(r)}focusSession(t){const n=this.nodes.get(t);if(!n)return;this.applySelection(t);const r=new rt(0,4,14);this.focusTarget={cam:n.targetPos.clone().add(r),look:n.targetPos.clone()}}resetCamera(){this.focusTarget={cam:K2.clone(),look:Oy.clone()}}refreshPickables(){this.pickables=[];for(const t of this.nodes.values())this.pickables.push(t.sphere)}findByMesh(t){for(const n of this.nodes.values())if(n.sphere===t)return n;return null}resize(){if(this.disposed)return;const t=this.container.clientWidth||800,n=this.container.clientHeight||600;this.camera.aspect=t/n,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,n),this.css2d.setSize(t,n);const r=new Rn(t,n);for(const i of this.links.values())i.bgMat.resolution=r,i.segInMat.resolution=r,i.segOutMat.resolution=r;this.axisMat&&(this.axisMat.resolution=r)}dispose(){var r,i,a,s,l,c,u,p;if(this.disposed)return;this.disposed=!0,this.running=!1,cancelAnimationFrame(this.rafId),document.removeEventListener("visibilitychange",this.onVisibility),(r=this.ro)==null||r.disconnect(),(i=this.mo)==null||i.disconnect();const t=(a=this.renderer)==null?void 0:a.domElement;t&&(t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("webglcontextlost",this.onContextLost));for(const d of[...this.nodes.values()])this.disposeNode(d);this.nodes.clear();for(const d of[...this.links.values()])this.disposeLink(d);this.links.clear();for(const d of this.sphereGeoms)d.dispose();for(const d of this.glowGeoms)d.dispose();for(const d of this.decalGeoms)d.dispose();this.ringMesh.geometry.dispose(),this.ringMat.dispose(),this.floor.geometry.dispose(),this.floor.material.dispose();for(const d of this.floorRings)d.mesh.geometry.dispose(),d.mat.dispose();this.apexMesh.geometry.dispose(),this.apexMat.dispose(),this.axisLine&&(this.axisLine.geometry.dispose(),this.axisMat.dispose());for(const d of this.axisLabels)d.element.remove(),d.removeFromParent();this.axisLabels=[],(s=this.controls)==null||s.dispose();for(const d of this.logoTexCache.values())d.dispose();this.logoTexCache.clear(),(l=this.renderer)==null||l.dispose(),t!=null&&t.parentElement&&t.parentElement.removeChild(t);const n=(c=this.css2d)==null?void 0:c.domElement;n!=null&&n.parentElement&&n.parentElement.removeChild(n),this.probeEl.parentElement&&this.probeEl.parentElement.removeChild(this.probeEl),(p=(u=this.renderer)==null?void 0:u.forceContextLoss)==null||p.call(u)}disposeNode(t){this.scene.remove(t.group),t.sphereMat.dispose(),t.glowMat.dispose(),t.decalMat.dispose(),t.labelEl.remove(),t.label.removeFromParent()}disposeLink(t){this.scene.remove(t.group),t.bg.geometry.dispose(),t.segIn.geometry.dispose(),t.segOut.geometry.dispose(),t.bgMat.dispose(),t.segInMat.dispose(),t.segOutMat.dispose()}}function Fue({sessions:e,now:t,selectedId:n,onSelect:r,showLabels:i,showLinks:a,focus:s,resetNonce:l,onContextLost:c}){const u=h.useRef(null),p=h.useRef(null);return h.useEffect(()=>{if(!u.current)return;let d;try{d=new Bue(u.current,{onSelect:r,onContextLost:c})}catch{c();return}return p.current=d,()=>{d.dispose(),p.current=null}},[]),h.useEffect(()=>{var d;(d=p.current)==null||d.update(e,t)},[e,t]),h.useEffect(()=>{var d;(d=p.current)==null||d.setSelected(n)},[n]),h.useEffect(()=>{var d;(d=p.current)==null||d.setLabelsVisible(i)},[i]),h.useEffect(()=>{var d;(d=p.current)==null||d.setLinksVisible(a)},[a]),h.useEffect(()=>{var d;s&&((d=p.current)==null||d.focusSession(s.sessionId))},[s==null?void 0:s.nonce]),h.useEffect(()=>{var d;l!==0&&((d=p.current)==null||d.resetCamera())},[l]),o.jsx("div",{ref:u,className:"am-canvas am-canvas-3d"})}const Uue={active:"进行中",idle:"空闲",completed:"已完成",error:"异常"},q2=[{key:"all",label:"全部",ms:0},{key:"1h",label:"近 1 小时",ms:Jc},{key:"6h",label:"近 6 小时",ms:6*Jc},{key:"24h",label:"近 24 小时",ms:24*Jc},{key:"7d",label:"近 7 天",ms:7*ww}];function Y2(e,t){const n=new Date(e);return t<=ww?`${n.getHours().toString().padStart(2,"0")}:00`:`${n.getMonth()+1}/${n.getDate()}`}function Wue(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 Kue({sessions:e,start:t,end:n}){const s=h.useMemo(()=>{const m=Math.max(1,n-t),g=Math.max(1,Math.min(96,Math.round(m/Jc))),v=new Array(g).fill(0);for(const x of e){const y=x.lastRequestAt;if(y<t||y>n)continue;let b=Math.floor((y-t)/(m/g));b<0&&(b=0),b>=g&&(b=g-1),v[b]++}return v},[e,t,n]),l=Math.max(1,...s),c=s.reduce((m,g)=>m+g,0),u=n-t,p=s.map((m,g)=>({x:s.length===1?220/2:g/(s.length-1)*218+1,y:41-m/l*(44-2*3)})),d=Wue(p),f=p.length>0?`${d} L ${p[p.length-1].x.toFixed(2)} 44 L ${p[0].x.toFixed(2)} 44 Z`:"";return o.jsxs("div",{className:"am-trend",title:`区间内会话最后活动分布:共 ${c} 个会话(按小时统计)`,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"})]})}),f&&o.jsx("path",{d:f,fill:"url(#am-trend-grad)",stroke:"none"}),d&&o.jsx("path",{d,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:[Y2(t,u)," – ",Y2(n,u)]})]})}function Hue({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"?"💬":jw[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 Vue({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(fO,{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"?"🚫":jw[n.toolName||""]||"•"}),o.jsx("span",{className:"am-feed-summary",children:n.summary})]},n.id))})}function yt({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 _a({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 que({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(_a,{title:"客户端类型(节点中心图标)",children:[o.jsx(yt,{icon:o.jsx(lb,{size:16}),label:"Claude Code",desc:"该 Session 来自 Claude Code 客户端"}),o.jsx(yt,{icon:o.jsx(cb,{size:16}),label:"Codex",desc:"该 Session 来自 Codex 客户端"})]}),o.jsxs(_a,{title:"节点状态(颜色 + 光晕)",children:[o.jsx(yt,{icon:o.jsx("i",{className:"am-dot am-dot--active"}),label:"进行中",desc:"最近 60 秒内有请求,或有在途请求(脉冲发光)"}),o.jsx(yt,{icon:o.jsx("i",{className:"am-dot am-dot--idle"}),label:"空闲",desc:"超过 60 秒无新请求,但 10 分钟内有过活动"}),o.jsx(yt,{icon:o.jsx("i",{className:"am-dot am-dot--completed"}),label:"已完成",desc:"超过 10 分钟无活动,且末轮正常结束(变暗、虚线)"}),o.jsx(yt,{icon:o.jsx("i",{className:"am-dot am-dot--error"}),label:"异常",desc:"末次请求失败(上游 5xx),红色脉冲"})]}),o.jsxs(_a,{title:"距离分档(同心圆,按时间阶梯 1/7/30/365 天)",children:[o.jsx(yt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"var(--accent-success)"}}),label:"1 天临界",desc:"圈内在 1 天内开始的会话;圈外是更早的会话"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"var(--accent-warning)"}}),label:"7 天临界",desc:"1–7 天前开始的会话落在本圈与 1 天圈之间"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"#6BA8E5"}}),label:"30 天临界",desc:"7–30 天前开始的会话落在本圈与 7 天圈之间"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"#6BA8E5"}}),label:"1 年临界(最外圈)",desc:"30 天–1 年前开始的会话落在本圈与 30 天圈之间;超过 1 年的会话游离在本圈之外(最外围)"})]})]}),o.jsxs("div",{className:"am-legend-col",children:[o.jsxs(_a,{title:"节点装饰",children:[o.jsx(yt,{icon:o.jsx("span",{children:"🔑"}),label:"接入密钥来源",desc:"节点下方钥匙标记,走 AccessKey 接入密钥流量"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ic-center"}),label:"中心点",desc:"画布中心圆点,进行中节点会与它连线"})]}),o.jsxs(_a,{title:"节点位置与尺寸",children:[o.jsx(yt,{icon:o.jsx("span",{children:"🎯"}),label:"距中心距离 = 会话开始时间",desc:"以会话开始时间(firstRequestAt)按龄分档:1 天内居内侧(分布最宽),1–5 天、5–10 天依次外扩,10 天以上在最外围。内圈带宽最大、越往外越紧凑,落定后不漂移"}),o.jsx(yt,{icon:o.jsx("span",{children:"🔵"}),label:"节点大小 = 对话轮数",desc:"默认较小,仅随对话轮数(requestCount)增长并封顶,越大代表历史对话轮数越多"})]}),o.jsxs(_a,{title:"操作",children:[o.jsx(yt,{icon:o.jsx("span",{className:"am-ic-mouse",children:"🖱"}),label:"缩放 / 平移",desc:"2D:滚轮缩放、拖拽平移、短按选中;3D:拖拽旋转、滚轮缩放、右键平移、点击选中"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ic-chart",children:"📈"}),label:"时间筛选",desc:"点 topbar「时间筛选」按预设区间过滤;趋势曲线仅作参考"})]})]}),o.jsx("div",{className:"am-legend-col",children:o.jsxs(_a,{title:"3D 视图操作与标识",children:[o.jsx(yt,{icon:o.jsx("span",{children:"🧊"}),label:"进入 / 退出 3D",desc:"右下角「2D / 3D」分段切换;3D 使用 WebGL,若环境不支持会自动回退到 2D(此时 3D 按钮置灰)。3D 与 2D 是两套完全独立的画布,互不影响"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ic-mouse",children:"🖱"}),label:"鼠标操作",desc:"左键按住拖拽 = 环绕旋转视角;滚轮 = 以光标为中心缩放;右键(或双指)按住拖拽 = 平移;在节点上单击 = 选中并展开详情,点空白 = 取消选中。一旦开始拖拽,复位/定位的自动过渡会立即停止,视角完全交给用户"}),o.jsx(yt,{icon:o.jsx("span",{children:"🕹️"}),label:"连线 / 标签 / 复位",desc:"3D 模式下右下角额外出现「连线」「标签」「复位」三个按钮:连线 = 开关中心点到各节点的 Token 连线(默认开,关闭后选中节点的连线仍显示);标签 = 切换是否显示所有节点文字(默认只显示选中节点的文字);复位 = 把相机平滑回到初始机位"}),o.jsx(yt,{icon:o.jsx("span",{children:"📐"}),label:"中心纵轴 = Token 量尺",desc:"底部中心点垂直向上一根虚线纵轴,标注 10k / 100k / 1M / 10M / 100M / 1B 临界刻度;节点高度由 Token 总量驱动(阶梯式分段、每跨一档放大但不超过 2 倍),Token 越多越往上长"}),o.jsx(yt,{icon:o.jsx("span",{children:"🌀"}),label:"地面同心圆 = 会话年龄",desc:"底部平面同心圆按时间阶梯对齐到 1 天 / 7 天 / 30 天 / 1 年 临界(段长比 20/30/30/20,1 天段最长):越靠中心 = 会话越新(刚创建),越往外 = 会话开始得越早;超过 1 年的节点游离在最外圈之外。节点距中心的水平距离由会话开始时间决定,落定后不漂移"}),o.jsx(yt,{icon:o.jsx("span",{children:"🎨"}),label:"节点颜色 / 形态",desc:"进行中=主色(带脉冲发光圈)、空闲=黄色、异常=红色(快频脉冲)、已完成=浅绿线框球(半透明、不遮挡视野)。in-flight 请求中的节点球体会轻微呼吸缩放"})]})}),o.jsx("div",{className:"am-legend-col",children:o.jsxs(_a,{title:"活动路径 / 活动流图标",children:[o.jsx(yt,{icon:o.jsx("span",{children:"💬"}),label:"提问 / 回复",desc:"用户提问或模型回复"}),o.jsx(yt,{icon:o.jsx("span",{children:"💭"}),label:"思考",desc:"模型推理思考过程"}),o.jsx(yt,{icon:o.jsx("span",{children:"⚠️"}),label:"错误",desc:"请求失败"}),o.jsx(yt,{icon:o.jsx("span",{children:"📖"}),label:"Read",desc:"读取文件"}),o.jsx(yt,{icon:o.jsx("span",{children:"📝"}),label:"Edit / Write",desc:"编辑 / 写入文件"}),o.jsx(yt,{icon:o.jsx("span",{children:"🔧"}),label:"Bash",desc:"执行终端命令"}),o.jsx(yt,{icon:o.jsx("span",{children:"🔍"}),label:"Grep / Glob",desc:"搜索内容 / 匹配文件"}),o.jsx(yt,{icon:o.jsx("span",{children:"🌐"}),label:"WebFetch / WebSearch",desc:"抓取网页 / 联网搜索"}),o.jsx(yt,{icon:o.jsx("span",{children:"🤖"}),label:"Agent / Task",desc:"调用子 Agent"})]})})]})]})]})}function Yue(){const[e,t]=h.useState(new Map),[n,r]=h.useState([]),[i,a]=h.useState(null),[s,l]=h.useState(null),[c,u]=h.useState([]),[p,d]=h.useState(null),[f,m]=h.useState([]),[g,v]=h.useState(!1),[x,y]=h.useState(null),[b,w]=h.useState({loading:!1}),[j,k]=h.useState(!0),S=h.useCallback(()=>k(ee=>!ee),[]),[A,T]=h.useState(!1),[D,O]=h.useState(!1),{enabled:_,toggle:R}=pue(),[X,V]=h.useState(!1),[I,$]=h.useState({zoom:1,panX:0,panY:0}),[H,N]=h.useState(!1),[W,P]=h.useState(!1),[U,le]=h.useState(!1),[E,he]=h.useState(!1),[ye,Q]=h.useState(null),[ie,je]=h.useState(0);h.useEffect(()=>{const ee=q.streamAgentMap({onInit:xe=>{V(!0);const Se=new Map;for(const De of xe.sessions)Se.set(De.sessionId,De);t(Se),r(xe.events),a(xe.stats)},onSessionUpdate:xe=>t(Se=>{const De=new Map(Se);return De.set(xe.sessionId,xe),De}),onActivity:xe=>r(Se=>[xe,...Se].slice(0,500)),onStats:xe=>a(xe),onError:()=>V(!1)});return()=>ee.abort()},[]);const[,Z]=h.useState(0);h.useEffect(()=>{const ee=setInterval(()=>Z(xe=>(xe+1)%1e9),1e4);return()=>clearInterval(ee)},[]);const re=h.useCallback(async ee=>{try{u(await q.getAgentMapSessionEvents(ee))}catch{u([])}},[]),pe=h.useCallback(async(ee,xe,Se)=>ee==="access-key"&&Se?q.getAccessKeySessionLogs(Se,xe,1e4):q.getSessionLogs(xe,1e4),[]),se=h.useCallback(ee=>{const xe=ee.source==="access-key"?"access-key":"global";d({id:ee.sessionId,targetType:ee.agent,title:ee.title,firstRequestAt:ee.firstRequestAt,lastRequestAt:ee.lastRequestAt,requestCount:ee.requestCount,totalTokens:ee.totalTokens}),m([]),y({source:xe,keyId:ee.keyId,sessionId:ee.sessionId}),v(!0),pe(xe,ee.sessionId,ee.keyId).then(Se=>m(Se)).catch(Se=>console.error("Failed to load session logs:",Se)).finally(()=>v(!1))},[pe]),_e=h.useCallback(()=>{d(null),m([]),y(null),v(!1)},[]);h.useEffect(()=>{s?re(s):u([])},[s,re]);const ke=s?e.get(s):null;h.useEffect(()=>{s&&re(s)},[ke==null?void 0:ke.lastRequestAt]),h.useEffect(()=>{if(!s){w({loading:!1});return}const ee=e.get(s);if(!ee){w({loading:!1});return}if(ee.source==="access-key"){w({loading:!1,unavailable:!0});return}if(ee.projectPath){w({loading:!1,projectPath:ee.projectPath});return}w({loading:!0});let xe=!0;return q.getAgentMapSessionMeta(s).then(Se=>{xe&&w({loading:!1,projectPath:Se.projectPath})}).catch(()=>{xe&&w({loading:!1})}),()=>{xe=!1}},[s,ke==null?void 0:ke.projectPath]);const ne=h.useCallback(ee=>{e.has(ee)&&(l(ee),qe("all"),k(!0),Q({sessionId:ee,nonce:Date.now()}))},[e]),[Le,qe]=h.useState("all"),ze=Math.floor(Date.now()/1e4)*1e4,Ke=q2.find(ee=>ee.key===Le).ms,pt=Le!=="all",Ye=h.useMemo(()=>Le==="all"?null:{start:ze-Ke,end:ze},[Le,ze,Ke]),Qe=h.useMemo(()=>Array.from(e.values()),[e]),Ze=h.useMemo(()=>Ye?Qe.filter(ee=>ee.lastRequestAt>=Ye.start&&ee.lastRequestAt<=Ye.end):Qe,[Qe,Ye]),tt=h.useRef(null);ke&&(tt.current=ke);const J=ke??(s?tt.current:null);h.useEffect(()=>{s||(tt.current=null)},[s]);const Y=h.useCallback(ee=>{l(ee),ee&&k(!0)},[]),ue=n.length?n[n.length-1].ts:ze,M=Le==="all"?Math.min(ue,ze-24*Jc):ze-Ke,fe=ze;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${X?" am-conn--on":""}`,children:X?"● 实时":"○ 连接中"})]}),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:Ze.length}),"/",Qe.length]})]}),o.jsxs("div",{className:"am-actions",children:[o.jsxs("button",{className:"am-btn am-toggle-btn",onClick:()=>{O(ee=>!ee),T(!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:()=>{T(ee=>!ee),O(!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:A?"rotate(180deg)":"none"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),o.jsxs("div",{className:"am-notify-switch",title:_?"已开启:每个会话的一轮任务结束时(请求完成、流结束,或停滞超过阈值)会弹一次系统通知":"开启:每个会话的一轮任务结束时(请求完成、流结束,或停滞超过阈值)会弹一次系统通知",children:[o.jsx(Qo,{checked:_,onChange:R,label:"🔔 通知"}),_&&o.jsx("button",{type:"button",className:"am-notify-test",onClick:()=>q.testAgentMapNotify(),title:"发一条测试通知,验证系统是否真的弹(若没弹,请在系统设置里允许 AICodeSwitch/终端 的通知)",children:"测试"})]})]}),A&&o.jsx(que,{onClose:()=>T(!1)})]}),D&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"am-popover-overlay",onClick:()=>O(!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:()=>O(!1),"aria-label":"关闭",children:"×"})]}),o.jsxs("div",{className:"am-timefilter",children:[o.jsx("div",{className:"am-timepresets",children:q2.map(ee=>o.jsx("button",{className:`am-chip${Le===ee.key?" am-chip--active":""}`,onClick:()=>qe(ee.key),children:ee.label},ee.key))}),o.jsx(Kue,{sessions:Qe,start:M,end:fe})]}),pt&&o.jsxs("div",{className:"am-timefilter-hint",children:["已筛选:",new Date(Ye.start).toLocaleString()," → 现在 · 显示 ",Ze.length,"/",Qe.length]})]})]}),o.jsxs("div",{className:"am-main",children:[o.jsxs("div",{className:"am-canvas-wrap",children:[Qe.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 开始编程,节点会实时出现在这里"})]}):H&&!W?o.jsx(Fue,{sessions:Ze,now:ze,selectedId:s,onSelect:Y,showLabels:U,showLinks:E,focus:ye,resetNonce:ie,onContextLost:()=>P(!0)}):o.jsx(xue,{sessions:Ze,now:ze,selectedId:s,onSelect:Y,view:I,onView:$,focus:ye}),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.jsxs("div",{className:"am-float-controls",children:[o.jsxs("div",{className:"am-view-toggle",role:"group","aria-label":"2D / 3D 视图切换",children:[o.jsx("button",{className:`am-view-btn${H?"":" am-view-btn--active"}`,onClick:()=>N(!1),title:"2D 平面视图(默认)",children:"2D"}),o.jsx("button",{className:`am-view-btn${H?" am-view-btn--active":""}${W?" am-view-btn--disabled":""}`,onClick:()=>{W||N(!0)},disabled:W,title:W?"WebGL 不可用,已回退到 2D":"3D 场景视图(Three.js):自由轨道旋转/缩放/平移",children:"3D"})]}),H&&!W?o.jsxs("div",{className:"am-view-toggle",role:"group","aria-label":"3D 显示控制",children:[o.jsx("button",{className:`am-view-btn am-view-btn--link${E?" am-view-btn--active":""}`,onClick:()=>he(ee=>!ee),title:E?"隐藏中心点到节点的 Token 连线(选中节点的连线仍显示)":"显示中心点到节点的 Token 连线",children:"连线"}),o.jsx("button",{className:`am-view-btn am-view-btn--label${U?" am-view-btn--active":""}`,onClick:()=>le(ee=>!ee),title:U?"隐藏所有节点标签(仅保留选中节点)":"显示所有节点标签",children:"标签"}),o.jsx("button",{className:"am-view-btn",onClick:()=>je(ee=>ee+1),title:"复位视角",children:"复位"})]}):o.jsx(vue,{view:I,onView:$})]})]}),o.jsxs("div",{className:"am-feed-wrap",children:[o.jsx("button",{className:"am-feed-toggle",onClick:S,title:j?"收起侧栏":"展开侧栏","aria-label":j?"收起侧栏":"展开侧栏",children:o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:j?o.jsx("polyline",{points:"9 18 15 12 9 6"}):o.jsx("polyline",{points:"15 18 9 12 15 6"})})}),j&&o.jsx("aside",{className:"am-feed-sidebar",children:J?o.jsxs("div",{className:"am-detail am-detail--sidebar",children:[o.jsxs("div",{className:"am-detail-head",children:[o.jsxs("span",{className:`am-badge am-badge--${J.status}`,children:[o.jsx(fO,{agent:J.agent,size:14})," ",Uue[J.status]]}),o.jsx("button",{className:"am-detail-close",onClick:()=>l(null),title:"返回活动流",children:"×"})]}),o.jsxs("div",{className:"am-detail-body",children:[o.jsx("h3",{className:"am-detail-title",children:J.title||J.sessionId}),o.jsxs("div",{className:"am-detail-meta",children:[o.jsxs("div",{children:["请求轮次:",o.jsx("b",{children:J.requestCount})]}),o.jsxs("div",{children:["输入 Token:",o.jsx("b",{children:(J.inputTokens||0).toLocaleString()})]}),o.jsxs("div",{children:["输出 Token:",o.jsx("b",{children:(J.outputTokens||0).toLocaleString()})]}),o.jsxs("div",{children:["累计 Token:",o.jsx("b",{children:(J.totalTokens||0).toLocaleString()})]}),o.jsxs("div",{children:["最近模型:",o.jsx("b",{children:J.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:Vx(J.firstRequestAt)})," · ",o.jsx("b",{children:Vx(J.lastRequestAt)})]})]}),o.jsx("div",{className:"am-detail-section-title",children:"活动路径"}),o.jsx(Hue,{events:c})]}),o.jsxs("div",{className:"am-detail-footer",children:[o.jsx("button",{className:"am-btn am-btn--ghost",onClick:()=>re(J.sessionId),children:"刷新活动"}),o.jsx("button",{className:"am-btn am-btn--ghost",disabled:J.source==="access-key"&&!J.keyId,onClick:()=>se(J),children:"会话详情"})]})]}):o.jsxs(o.Fragment,{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(Vue,{events:n,onSelectSession:ne})]})})]})]}),p&&x&&o.jsx(fb,{session:p,logs:f,logsLoading:g,onRefreshLogs:async()=>{if(x){v(!0);try{const ee=await pe(x.source,x.sessionId,x.keyId);m(ee)}catch(ee){console.error("Failed to refresh session logs:",ee)}finally{v(!1)}}},onFetchNewLogs:async()=>{if(!x)return[];const ee=await pe(x.source,x.sessionId,x.keyId);return m(ee),ee},onClose:_e})]})}function ei({children:e,text:t,showTooltip:n}){const[r,i]=h.useState(!1),[a,s]=h.useState(null),l=h.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&&Ku.createPortal(o.jsx("div",{className:"nav-tooltip",style:{left:a.left,top:a.top},children:t}),document.body)]})}const Gue=""+new URL("logo-CRx_w1Ov.png",import.meta.url).href,Xue=`升级到 v6.0.0 版本将会有破坏性影响,你需要注意:
1181
+
1182
+ * 我们升级了日志系统,以解决老的日志系统所带来的存储问题。新日志系统会迁移你的日志数据,但是,为了确保日志数据不丢失,我们会在下一个版本中才删除老的日志文件,这也就意味着你的电脑上可能同时存在两份日志文件,占用空间。为了节约你的电脑磁盘空间,你可以在运行一段时间感觉正常之后,删除 \`~/.aicodeswitch/fs-db/logs\` 目录来移除老的日志文件。
1183
+
1184
+ 本次升级带来了新的大功能:
1185
+
1186
+ * 「任务雷达」功能,帮助你时刻掌握当前任务状态,历史任务分布,通过对任务雷达的分析,你可以掌握自己的编程习惯,从而作出适当的调整。
1187
+ `;function Que(){const e=$h(),[t,n]=h.useState("light"),[r,i]=h.useState(!1),[a,s]=h.useState(!1),[l,c]=h.useState(!1),[u,p]=h.useState(!1),[d,f]=h.useState(!1),[m,g]=h.useState(null),[v,x]=h.useState(null),[y,b]=h.useState(!1),w=BF(),[j,k]=h.useState(!1),[S,A]=h.useState(!1),[T,D]=h.useState(""),[O,_]=h.useState(""),[R,X]=h.useState(!0),[V,I]=h.useState(!1),[$,H]=h.useState(""),[N,W]=h.useState(!1);h.useEffect(()=>{const Z=localStorage.getItem("theme")||"light";n(Z),document.documentElement.setAttribute("data-theme",Z),localStorage.getItem("sidebar-collapsed")==="true"&&p(!0)},[]),h.useEffect(()=>{const Z=async()=>{try{const pe=await q.checkVersion();f(pe.hasUpdate),g(pe.latestVersion),x(pe.currentVersion)}catch(pe){console.error("Failed to check version:",pe)}};Z();const re=setInterval(Z,6e4);return()=>clearInterval(re)},[]),h.useEffect(()=>{(async()=>{try{const re=await q.getAuthStatus();if(k(re.enabled),!re.enabled){A(!0),X(!1);return}if(!localStorage.getItem("auth_token")){X(!1);return}try{await q.getVendors(),A(!0)}catch{}}catch(re){console.error("Failed to check auth status:",re)}finally{X(!1)}})()},[]),h.useEffect(()=>{(async()=>{if(!N)try{const re=await q.getUpgrade();re.shouldShow&&re.content&&(H(re.content),I(!0)),W(!0)}catch(re){console.error("Failed to check upgrade:",re)}})()},[N]),h.useEffect(()=>{(async()=>{try{(await q.getVendors()).length===0&&!a&&(i(!0),s(!0))}catch(re){console.error("Failed to check vendors:",re)}})()},[a]);const P=()=>{const Z=t==="light"?"dark":"light";n(Z),document.documentElement.setAttribute("data-theme",Z),localStorage.setItem("theme",Z)},U=()=>{p(!u),localStorage.setItem("sidebar-collapsed",(!u).toString())},le=h.useRef(null),[E,he]=h.useState({scrollable:!1,atTop:!0,atBottom:!0});h.useEffect(()=>{const Z=le.current;if(!Z)return;const re=()=>{const ke=Z.scrollHeight-Z.clientHeight>2;he({scrollable:ke,atTop:Z.scrollTop<=1,atBottom:Z.scrollTop+Z.clientHeight>=Z.scrollHeight-1})};re();let pe=0;const se=()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(re)},_e=new ResizeObserver(se);return _e.observe(Z),Z.addEventListener("scroll",se,{passive:!0}),()=>{cancelAnimationFrame(pe),_e.disconnect(),Z.removeEventListener("scroll",se)}},[j,u]);const ye=E.scrollable,Q=()=>{i(!1),e("/vendors")},ie=async()=>{try{await q.acknowledgeUpgrade()}catch(Z){console.error("Failed to acknowledge upgrade:",Z)}I(!1)},je=async Z=>{if(Z.preventDefault(),_(""),!T.trim()){_("请输入鉴权码");return}try{const re=await q.login(T);localStorage.setItem("auth_token",re.token),A(!0),D("")}catch(re){re instanceof Error?_(re.message||"登录失败,请检查鉴权码"):_("登录失败,请检查鉴权码")}};return R?o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",fontSize:"18px",color:"var(--text-secondary)"},children:"加载中..."}):j&&!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:je,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:T,onChange:Z=>D(Z.target.value),placeholder:"请输入鉴权码",style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-color)",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box"},autoFocus:!0})]}),O&&o.jsx("div",{style:{padding:"10px 12px",backgroundColor:"#fee",border:"1px solid #fcc",borderRadius:"6px",color:"#c33",fontSize:"14px",marginBottom:"16px"},children:O})]}),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:Gue,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:le,children:[o.jsx("li",{children:o.jsx(ei,{text:"路由管理",showTooltip:u,children:o.jsxs(Jr,{to:"/routes",children:[o.jsx("span",{className:"nav-icon",children:"🌏"}),o.jsx("span",{className:"nav-text",children:"路由管理"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"供应商管理",showTooltip:u,children:o.jsxs(Jr,{to:"/vendors",children:[o.jsx("span",{className:"nav-icon",children:"🏭"}),o.jsx("span",{className:"nav-text",children:"供应商管理"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"Skills 管理",showTooltip:u,children:o.jsxs(Jr,{to:"/skills",children:[o.jsx("span",{className:"nav-icon",children:"🧩"}),o.jsx("span",{className:"nav-text",children:"Skills 管理"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"MCP 管理",showTooltip:u,children:o.jsxs(Jr,{to:"/mcp",children:[o.jsx("span",{className:"nav-icon",children:"🧰"}),o.jsx("span",{className:"nav-text",children:"MCP 管理"})]})})}),j&&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(ei,{text:"API Key",showTooltip:u,children:o.jsxs(Jr,{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(ei,{text:"任务雷达",showTooltip:u,children:o.jsxs(Jr,{to:"/agent-map",children:[o.jsx("span",{className:"nav-icon",children:"🗺️"}),o.jsx("span",{className:"nav-text",children:"任务雷达"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"数据统计",showTooltip:u,children:o.jsxs(Jr,{to:"/statistics",children:[o.jsx("span",{className:"nav-icon",children:"📊"}),o.jsx("span",{className:"nav-text",children:"数据统计"})]})})}),!j&&o.jsxs(o.Fragment,{children:[o.jsx("li",{children:o.jsx(ei,{text:"会话",showTooltip:u,children:o.jsxs(Jr,{to:"/sessions",children:[o.jsx("span",{className:"nav-icon",children:"💬"}),o.jsx("span",{className:"nav-text",children:"会话"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"日志",showTooltip:u,children:o.jsxs(Jr,{to:"/logs",children:[o.jsx("span",{className:"nav-icon",children:"🪵"}),o.jsx("span",{className:"nav-text",children:"日志"})]})})})]}),o.jsx("li",{children:o.jsx(ei,{text:"设置",showTooltip:u,children:o.jsxs(Jr,{to:"/settings",children:[o.jsx("span",{className:"nav-icon",children:"⚙️"}),o.jsx("span",{className:"nav-text",children:"设置"})]})})}),o.jsx("li",{children:o.jsx(ei,{text:"使用说明",showTooltip:u,children:o.jsxs(Jr,{to:"/usage",children:[o.jsx("span",{className:"nav-icon",children:"📖"}),o.jsx("span",{className:"nav-text",children:"使用说明"})]})})})]}),ye&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`nav-scroll-shadow nav-scroll-shadow--top${E.atTop?" is-hidden":""}`,"aria-hidden":"true"}),o.jsx("div",{className:`nav-scroll-shadow nav-scroll-shadow--bottom${E.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:P,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"})})}),v&&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",v,d&&o.jsx("span",{className:"version-badge"})]})}),o.jsx("button",{onClick:U,className:"sidebar-toggle-btn",title:u?"展开侧边栏":"收起侧边栏",children:u?"»":"«"})]})]}),o.jsx("main",{className:"main-content",children:o.jsxs(R3,{children:[o.jsx(Zn,{path:"/",element:o.jsx(mc,{to:"/routes",replace:!0})}),o.jsx(Zn,{path:"/agent-map",element:o.jsx(Yue,{})}),o.jsx(Zn,{path:"/statistics",element:o.jsx(oue,{})}),o.jsx(Zn,{path:"/routes",element:o.jsx(cU,{})}),o.jsx(Zn,{path:"/vendors",element:o.jsx(HF,{})}),o.jsx(Zn,{path:"/skills",element:o.jsx(sue,{})}),o.jsx(Zn,{path:"/mcp",element:o.jsx(cue,{})}),o.jsx(Zn,{path:"/access-keys",element:j?o.jsx(uue,{}):o.jsx(mc,{to:"/"})}),o.jsx(Zn,{path:"/access-keys/:id",element:j?o.jsx(due,{}):o.jsx(mc,{to:"/"})}),o.jsx(Zn,{path:"/sessions",element:j?o.jsx(mc,{to:"/"}):o.jsx(_U,{})}),o.jsx(Zn,{path:"/logs",element:j?o.jsx(mc,{to:"/"}):o.jsx(kU,{})}),o.jsx(Zn,{path:"/write-config",element:o.jsx(DU,{})}),o.jsx(Zn,{path:"/settings",element:o.jsx(RU,{})}),o.jsx(Zn,{path:"/usage",element:o.jsx(zU,{})})]})}),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:Q,children:"前往供应商管理"})]})]})]})})]}),o.jsx(pO,{show:l,onClose:()=>c(!1),onComplete:()=>s(!0)}),V&&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(Gc,{children:$})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:ie,children:"我知道了"})})]})})}),y&&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",v]})]}),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?w?o.jsx("div",{className:"markdown-content",style:{maxHeight:"400px",overflow:"auto"},children:o.jsx(Gc,{children:w})}):null:o.jsxs("div",{className:"markdown-content",children:[o.jsx("h4",{style:{marginBottom:12},children:"当前版本提示:"}),o.jsx(Gc,{children:Xue})]})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>b(!1),children:"关闭"})})]})})]})]})}function Zue(){return o.jsx(W3,{children:o.jsx(FF,{children:o.jsx(QF,{children:o.jsxs(fue,{children:[o.jsx(Que,{}),o.jsx(WF,{})]})})})})}My.createRoot(document.getElementById("root")).render(o.jsx(cE.StrictMode,{children:o.jsx(Zue,{})}));