@inspectr/mcplab 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/index-BLw-ClvB.js +249 -0
- package/dist/app/assets/index-D5Ew6sJk.css +1 -0
- package/dist/app/index.html +2 -2
- package/dist/cli.js +64 -3
- package/dist/cli.js.map +1 -1
- package/dist/migrate-utils.d.ts +7 -0
- package/dist/migrate-utils.d.ts.map +1 -0
- package/dist/migrate-utils.js +40 -0
- package/dist/migrate-utils.js.map +1 -0
- package/package.json +4 -4
- package/dist/app/assets/index-Dy2-RWt3.js +0 -249
- package/dist/app/assets/index-EP4WAY8u.css +0 -1
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
function m7(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Ep=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dy={exports:{}},ku={},Ly={exports:{}},_t={};var VE;function v7(){if(VE)return _t;VE=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=p&&B[p]||B["@@iterator"],typeof B=="function"?B:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,w={};function x(B,$,ee){this.props=B,this.context=$,this.refs=w,this.updater=ee||y}x.prototype.isReactComponent={},x.prototype.setState=function(B,$){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,$,"setState")},x.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function S(){}S.prototype=x.prototype;function N(B,$,ee){this.props=B,this.context=$,this.refs=w,this.updater=ee||y}var A=N.prototype=new S;A.constructor=N,j(A,x.prototype),A.isPureReactComponent=!0;var P=Array.isArray,E=Object.prototype.hasOwnProperty,O={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function R(B,$,ee){var V,J={},ge=null,ie=null;if($!=null)for(V in $.ref!==void 0&&(ie=$.ref),$.key!==void 0&&(ge=""+$.key),$)E.call($,V)&&!k.hasOwnProperty(V)&&(J[V]=$[V]);var ce=arguments.length-2;if(ce===1)J.children=ee;else if(1<ce){for(var oe=Array(ce),xe=0;xe<ce;xe++)oe[xe]=arguments[xe+2];J.children=oe}if(B&&B.defaultProps)for(V in ce=B.defaultProps,ce)J[V]===void 0&&(J[V]=ce[V]);return{$$typeof:e,type:B,key:ge,ref:ie,props:J,_owner:O.current}}function D(B,$){return{$$typeof:e,type:B.type,key:$,ref:B.ref,props:B.props,_owner:B._owner}}function U(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function z(B){var $={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(ee){return $[ee]})}var L=/\/+/g;function G(B,$){return typeof B=="object"&&B!==null&&B.key!=null?z(""+B.key):$.toString(36)}function q(B,$,ee,V,J){var ge=typeof B;(ge==="undefined"||ge==="boolean")&&(B=null);var ie=!1;if(B===null)ie=!0;else switch(ge){case"string":case"number":ie=!0;break;case"object":switch(B.$$typeof){case e:case t:ie=!0}}if(ie)return ie=B,J=J(ie),B=V===""?"."+G(ie,0):V,P(J)?(ee="",B!=null&&(ee=B.replace(L,"$&/")+"/"),q(J,$,ee,"",function(xe){return xe})):J!=null&&(U(J)&&(J=D(J,ee+(!J.key||ie&&ie.key===J.key?"":(""+J.key).replace(L,"$&/")+"/")+B)),$.push(J)),1;if(ie=0,V=V===""?".":V+":",P(B))for(var ce=0;ce<B.length;ce++){ge=B[ce];var oe=V+G(ge,ce);ie+=q(ge,$,ee,oe,J)}else if(oe=g(B),typeof oe=="function")for(B=oe.call(B),ce=0;!(ge=B.next()).done;)ge=ge.value,oe=V+G(ge,ce++),ie+=q(ge,$,ee,oe,J);else if(ge==="object")throw $=String(B),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return ie}function H(B,$,ee){if(B==null)return B;var V=[],J=0;return q(B,V,"","",function(ge){return $.call(ee,ge,J++)}),V}function X(B){if(B._status===-1){var $=B._result;$=$(),$.then(function(ee){(B._status===0||B._status===-1)&&(B._status=1,B._result=ee)},function(ee){(B._status===0||B._status===-1)&&(B._status=2,B._result=ee)}),B._status===-1&&(B._status=0,B._result=$)}if(B._status===1)return B._result.default;throw B._result}var Z={current:null},I={transition:null},F={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:I,ReactCurrentOwner:O};function Q(){throw Error("act(...) is not supported in production builds of React.")}return _t.Children={map:H,forEach:function(B,$,ee){H(B,function(){$.apply(this,arguments)},ee)},count:function(B){var $=0;return H(B,function(){$++}),$},toArray:function(B){return H(B,function($){return $})||[]},only:function(B){if(!U(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},_t.Component=x,_t.Fragment=n,_t.Profiler=a,_t.PureComponent=N,_t.StrictMode=r,_t.Suspense=d,_t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,_t.act=Q,_t.cloneElement=function(B,$,ee){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var V=j({},B.props),J=B.key,ge=B.ref,ie=B._owner;if($!=null){if($.ref!==void 0&&(ge=$.ref,ie=O.current),$.key!==void 0&&(J=""+$.key),B.type&&B.type.defaultProps)var ce=B.type.defaultProps;for(oe in $)E.call($,oe)&&!k.hasOwnProperty(oe)&&(V[oe]=$[oe]===void 0&&ce!==void 0?ce[oe]:$[oe])}var oe=arguments.length-2;if(oe===1)V.children=ee;else if(1<oe){ce=Array(oe);for(var xe=0;xe<oe;xe++)ce[xe]=arguments[xe+2];V.children=ce}return{$$typeof:e,type:B.type,key:J,ref:ge,props:V,_owner:ie}},_t.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:i,_context:B},B.Consumer=B},_t.createElement=R,_t.createFactory=function(B){var $=R.bind(null,B);return $.type=B,$},_t.createRef=function(){return{current:null}},_t.forwardRef=function(B){return{$$typeof:c,render:B}},_t.isValidElement=U,_t.lazy=function(B){return{$$typeof:h,_payload:{_status:-1,_result:B},_init:X}},_t.memo=function(B,$){return{$$typeof:f,type:B,compare:$===void 0?null:$}},_t.startTransition=function(B){var $=I.transition;I.transition={};try{B()}finally{I.transition=$}},_t.unstable_act=Q,_t.useCallback=function(B,$){return Z.current.useCallback(B,$)},_t.useContext=function(B){return Z.current.useContext(B)},_t.useDebugValue=function(){},_t.useDeferredValue=function(B){return Z.current.useDeferredValue(B)},_t.useEffect=function(B,$){return Z.current.useEffect(B,$)},_t.useId=function(){return Z.current.useId()},_t.useImperativeHandle=function(B,$,ee){return Z.current.useImperativeHandle(B,$,ee)},_t.useInsertionEffect=function(B,$){return Z.current.useInsertionEffect(B,$)},_t.useLayoutEffect=function(B,$){return Z.current.useLayoutEffect(B,$)},_t.useMemo=function(B,$){return Z.current.useMemo(B,$)},_t.useReducer=function(B,$,ee){return Z.current.useReducer(B,$,ee)},_t.useRef=function(B){return Z.current.useRef(B)},_t.useState=function(B){return Z.current.useState(B)},_t.useSyncExternalStore=function(B,$,ee){return Z.current.useSyncExternalStore(B,$,ee)},_t.useTransition=function(){return Z.current.useTransition()},_t.version="18.3.1",_t}var HE;function bS(){return HE||(HE=1,Ly.exports=v7()),Ly.exports}var KE;function g7(){if(KE)return ku;KE=1;var e=bS(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,d,f){var h,p={},g=null,y=null;f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(y=d.ref);for(h in d)r.call(d,h)&&!i.hasOwnProperty(h)&&(p[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:c,key:g,ref:y,props:p,_owner:a.current}}return ku.Fragment=n,ku.jsx=o,ku.jsxs=o,ku}var GE;function y7(){return GE||(GE=1,Dy.exports=g7()),Dy.exports}var s=y7(),_p={},Fy={exports:{}},Cr={},By={exports:{}},zy={};var YE;function x7(){return YE||(YE=1,(function(e){function t(I,F){var Q=I.length;I.push(F);e:for(;0<Q;){var B=Q-1>>>1,$=I[B];if(0<a($,F))I[B]=F,I[Q]=$,Q=B;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var F=I[0],Q=I.pop();if(Q!==F){I[0]=Q;e:for(var B=0,$=I.length,ee=$>>>1;B<ee;){var V=2*(B+1)-1,J=I[V],ge=V+1,ie=I[ge];if(0>a(J,Q))ge<$&&0>a(ie,J)?(I[B]=ie,I[ge]=Q,B=ge):(I[B]=J,I[V]=Q,B=V);else if(ge<$&&0>a(ie,Q))I[B]=ie,I[ge]=Q,B=ge;else break e}}return F}function a(I,F){var Q=I.sortIndex-F.sortIndex;return Q!==0?Q:I.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],f=[],h=1,p=null,g=3,y=!1,j=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(I){for(var F=n(f);F!==null;){if(F.callback===null)r(f);else if(F.startTime<=I)r(f),F.sortIndex=F.expirationTime,t(d,F);else break;F=n(f)}}function P(I){if(w=!1,A(I),!j)if(n(d)!==null)j=!0,X(E);else{var F=n(f);F!==null&&Z(P,F.startTime-I)}}function E(I,F){j=!1,w&&(w=!1,S(R),R=-1),y=!0;var Q=g;try{for(A(F),p=n(d);p!==null&&(!(p.expirationTime>F)||I&&!z());){var B=p.callback;if(typeof B=="function"){p.callback=null,g=p.priorityLevel;var $=B(p.expirationTime<=F);F=e.unstable_now(),typeof $=="function"?p.callback=$:p===n(d)&&r(d),A(F)}else r(d);p=n(d)}if(p!==null)var ee=!0;else{var V=n(f);V!==null&&Z(P,V.startTime-F),ee=!1}return ee}finally{p=null,g=Q,y=!1}}var O=!1,k=null,R=-1,D=5,U=-1;function z(){return!(e.unstable_now()-U<D)}function L(){if(k!==null){var I=e.unstable_now();U=I;var F=!0;try{F=k(!0,I)}finally{F?G():(O=!1,k=null)}}else O=!1}var G;if(typeof N=="function")G=function(){N(L)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,H=q.port2;q.port1.onmessage=L,G=function(){H.postMessage(null)}}else G=function(){x(L,0)};function X(I){k=I,O||(O=!0,G())}function Z(I,F){R=x(function(){I(e.unstable_now())},F)}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(I){I.callback=null},e.unstable_continueExecution=function(){j||y||(j=!0,X(E))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(I){switch(g){case 1:case 2:case 3:var F=3;break;default:F=g}var Q=g;g=F;try{return I()}finally{g=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,F){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var Q=g;g=I;try{return F()}finally{g=Q}},e.unstable_scheduleCallback=function(I,F,Q){var B=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?B+Q:B):Q=B,I){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Q+$,I={id:h++,callback:F,priorityLevel:I,startTime:Q,expirationTime:$,sortIndex:-1},Q>B?(I.sortIndex=Q,t(f,I),n(d)===null&&I===n(f)&&(w?(S(R),R=-1):w=!0,Z(P,Q-B))):(I.sortIndex=$,t(d,I),j||y||(j=!0,X(E))),I},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(I){var F=g;return function(){var Q=g;g=F;try{return I.apply(this,arguments)}finally{g=Q}}}})(zy)),zy}var XE;function b7(){return XE||(XE=1,By.exports=x7()),By.exports}var QE;function w7(){if(QE)return Cr;QE=1;var e=bS(),t=b7();function n(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function i(l,u){o(l,u),o(l+"Capture",u)}function o(l,u){for(a[l]=u,l=0;l<u.length;l++)r.add(u[l])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function g(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function y(l,u,m,b){if(m!==null&&m.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return b?!1:m!==null?!m.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,m,b){if(u===null||typeof u>"u"||y(l,u,m,b))return!0;if(b)return!1;if(m!==null)switch(m.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function w(l,u,m,b,C,_,M){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=b,this.attributeNamespace=C,this.mustUseProperty=m,this.propertyName=l,this.type=u,this.sanitizeURL=_,this.removeEmptyString=M}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[l]=new w(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var u=l[0];x[u]=new w(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new w(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[l]=new w(l,2,!1,l,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(l){x[l]=new w(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new w(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new w(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new w(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new w(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(l){return l[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(l){var u=l.replace(S,N);x[u]=new w(u,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var u=l.replace(S,N);x[u]=new w(u,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var u=l.replace(S,N);x[u]=new w(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new w(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new w(l,1,!1,l.toLowerCase(),null,!0,!0)});function A(l,u,m,b){var C=x.hasOwnProperty(u)?x[u]:null;(C!==null?C.type!==0:b||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,m,C,b)&&(m=null),b||C===null?g(u)&&(m===null?l.removeAttribute(u):l.setAttribute(u,""+m)):C.mustUseProperty?l[C.propertyName]=m===null?C.type===3?!1:"":m:(u=C.attributeName,b=C.attributeNamespace,m===null?l.removeAttribute(u):(C=C.type,m=C===3||C===4&&m===!0?"":""+m,b?l.setAttributeNS(b,u,m):l.setAttribute(u,m))))}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=Symbol.for("react.element"),O=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),z=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),I=Symbol.iterator;function F(l){return l===null||typeof l!="object"?null:(l=I&&l[I]||l["@@iterator"],typeof l=="function"?l:null)}var Q=Object.assign,B;function $(l){if(B===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);B=u&&u[1]||""}return`
|
|
2
|
-
`+B+l}var ee=!1;function V(l,u){if(!l||ee)return"";ee=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(me){var b=me}Reflect.construct(l,[],u)}else{try{u.call()}catch(me){b=me}l.call(u.prototype)}else{try{throw Error()}catch(me){b=me}l()}}catch(me){if(me&&b&&typeof me.stack=="string"){for(var C=me.stack.split(`
|
|
3
|
-
`),_=b.stack.split(`
|
|
4
|
-
`),M=C.length-1,Y=_.length-1;1<=M&&0<=Y&&C[M]!==_[Y];)Y--;for(;1<=M&&0<=Y;M--,Y--)if(C[M]!==_[Y]){if(M!==1||Y!==1)do if(M--,Y--,0>Y||C[M]!==_[Y]){var te=`
|
|
5
|
-
`+C[M].replace(" at new "," at ");return l.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",l.displayName)),te}while(1<=M&&0<=Y);break}}}finally{ee=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?$(l):""}function J(l){switch(l.tag){case 5:return $(l.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return l=V(l.type,!1),l;case 11:return l=V(l.type.render,!1),l;case 1:return l=V(l.type,!0),l;default:return""}}function ge(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case k:return"Fragment";case O:return"Portal";case D:return"Profiler";case R:return"StrictMode";case G:return"Suspense";case q:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case z:return(l.displayName||"Context")+".Consumer";case U:return(l._context.displayName||"Context")+".Provider";case L:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case H:return u=l.displayName||null,u!==null?u:ge(l.type)||"Memo";case X:u=l._payload,l=l._init;try{return ge(l(u))}catch{}}return null}function ie(l){var u=l.type;switch(l.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=u.render,l=l.displayName||l.name||"",u.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ge(u);case 8:return u===R?"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 u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function ce(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function oe(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function xe(l){var u=oe(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),b=""+l[u];if(!l.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var C=m.get,_=m.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return C.call(this)},set:function(M){b=""+M,_.call(this,M)}}),Object.defineProperty(l,u,{enumerable:m.enumerable}),{getValue:function(){return b},setValue:function(M){b=""+M},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function ke(l){l._valueTracker||(l._valueTracker=xe(l))}function pe(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var m=u.getValue(),b="";return l&&(b=oe(l)?l.checked?"true":"false":l.value),l=b,l!==m?(u.setValue(l),!0):!1}function ve(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ce(l,u){var m=u.checked;return Q({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function Le(l,u){var m=u.defaultValue==null?"":u.defaultValue,b=u.checked!=null?u.checked:u.defaultChecked;m=ce(u.value!=null?u.value:m),l._wrapperState={initialChecked:b,initialValue:m,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function se(l,u){u=u.checked,u!=null&&A(l,"checked",u,!1)}function de(l,u){se(l,u);var m=ce(u.value),b=u.type;if(m!=null)b==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(b==="submit"||b==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?Fe(l,u.type,m):u.hasOwnProperty("defaultValue")&&Fe(l,u.type,ce(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function Ne(l,u,m){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var b=u.type;if(!(b!=="submit"&&b!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+l._wrapperState.initialValue,m||u===l.value||(l.value=u),l.defaultValue=u}m=l.name,m!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,m!==""&&(l.name=m)}function Fe(l,u,m){(u!=="number"||ve(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var je=Array.isArray;function $e(l,u,m,b){if(l=l.options,u){u={};for(var C=0;C<m.length;C++)u["$"+m[C]]=!0;for(m=0;m<l.length;m++)C=u.hasOwnProperty("$"+l[m].value),l[m].selected!==C&&(l[m].selected=C),C&&b&&(l[m].defaultSelected=!0)}else{for(m=""+ce(m),u=null,C=0;C<l.length;C++){if(l[C].value===m){l[C].selected=!0,b&&(l[C].defaultSelected=!0);return}u!==null||l[C].disabled||(u=l[C])}u!==null&&(u.selected=!0)}}function et(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return Q({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function xt(l,u){var m=u.value;if(m==null){if(m=u.children,u=u.defaultValue,m!=null){if(u!=null)throw Error(n(92));if(je(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}l._wrapperState={initialValue:ce(m)}}function Jt(l,u){var m=ce(u.value),b=ce(u.defaultValue);m!=null&&(m=""+m,m!==l.value&&(l.value=m),u.defaultValue==null&&l.defaultValue!==m&&(l.defaultValue=m)),b!=null&&(l.defaultValue=""+b)}function ye(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function We(l){switch(l){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 Ye(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?We(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Ot,Dt=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,m,b,C){MSApp.execUnsafeLocalFunction(function(){return l(u,m,b,C)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(Ot=Ot||document.createElement("div"),Ot.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Ot.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function kt(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var Zt={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},Sn=["Webkit","ms","Moz","O"];Object.keys(Zt).forEach(function(l){Sn.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Zt[u]=Zt[l]})});function tr(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||Zt.hasOwnProperty(l)&&Zt[l]?(""+u).trim():u+"px"}function nr(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var b=m.indexOf("--")===0,C=tr(m,u[m],b);m==="float"&&(m="cssFloat"),b?l.setProperty(m,C):l[m]=C}}var wa=Q({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 En(l,u){if(u){if(wa[l]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function kr(l,u){if(l.indexOf("-")===-1)return typeof u.is=="string";switch(l){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 Rr=null;function yr(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var _n=null,Rn=null,xn=null;function Tn(l){if(l=vu(l)){if(typeof _n!="function")throw Error(n(280));var u=l.stateNode;u&&(u=Uf(u),_n(l.stateNode,l.type,u))}}function ue(l){Rn?xn?xn.push(l):xn=[l]:Rn=l}function Ie(){if(Rn){var l=Rn,u=xn;if(xn=Rn=null,Tn(l),u)for(l=0;l<u.length;l++)Tn(u[l])}}function ct(l,u){return l(u)}function bt(){}var Wt=!1;function ln(l,u,m){if(Wt)return l(u,m);Wt=!0;try{return ct(l,u,m)}finally{Wt=!1,(Rn!==null||xn!==null)&&(bt(),Ie())}}function Pt(l,u){var m=l.stateNode;if(m===null)return null;var b=Uf(m);if(b===null)return null;m=b[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(l=l.type,b=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!b;break e;default:l=!1}if(l)return null;if(m&&typeof m!="function")throw Error(n(231,u,typeof m));return m}var rr=!1;if(c)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){rr=!0}}),window.addEventListener("test",cn,cn),window.removeEventListener("test",cn,cn)}catch{rr=!1}function Xt(l,u,m,b,C,_,M,Y,te){var me=Array.prototype.slice.call(arguments,3);try{u.apply(m,me)}catch(Ee){this.onError(Ee)}}var xr=!1,ja=null,Sa=!1,ti=null,Gi={onError:function(l){xr=!0,ja=l}};function Yo(l,u,m,b,C,_,M,Y,te){xr=!1,ja=null,Xt.apply(Gi,arguments)}function ni(l,u,m,b,C,_,M,Y,te){if(Yo.apply(this,arguments),xr){if(xr){var me=ja;xr=!1,ja=null}else throw Error(n(198));Sa||(Sa=!0,ti=me)}}function Tr(l){var u=l,m=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(m=u.return),l=u.return;while(l)}return u.tag===3?m:null}function Yi(l){if(l.tag===13){var u=l.memoizedState;if(u===null&&(l=l.alternate,l!==null&&(u=l.memoizedState)),u!==null)return u.dehydrated}return null}function es(l){if(Tr(l)!==l)throw Error(n(188))}function Qc(l){var u=l.alternate;if(!u){if(u=Tr(l),u===null)throw Error(n(188));return u!==l?null:l}for(var m=l,b=u;;){var C=m.return;if(C===null)break;var _=C.alternate;if(_===null){if(b=C.return,b!==null){m=b;continue}break}if(C.child===_.child){for(_=C.child;_;){if(_===m)return es(C),l;if(_===b)return es(C),u;_=_.sibling}throw Error(n(188))}if(m.return!==b.return)m=C,b=_;else{for(var M=!1,Y=C.child;Y;){if(Y===m){M=!0,m=C,b=_;break}if(Y===b){M=!0,b=C,m=_;break}Y=Y.sibling}if(!M){for(Y=_.child;Y;){if(Y===m){M=!0,m=_,b=C;break}if(Y===b){M=!0,b=_,m=C;break}Y=Y.sibling}if(!M)throw Error(n(189))}}if(m.alternate!==b)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?l:u}function Xo(l){return l=Qc(l),l!==null?ea(l):null}function ea(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=ea(l);if(u!==null)return u;l=l.sibling}return null}var ts=t.unstable_scheduleCallback,Na=t.unstable_cancelCallback,Jc=t.unstable_shouldYield,K=t.unstable_requestPaint,he=t.unstable_now,at=t.unstable_getCurrentPriorityLevel,T=t.unstable_ImmediatePriority,ne=t.unstable_UserBlockingPriority,be=t.unstable_NormalPriority,_e=t.unstable_LowPriority,rt=t.unstable_IdlePriority,Ge=null,vt=null;function Be(l){if(vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(Ge,l,void 0,(l.current.flags&128)===128)}catch{}}var Ct=Math.clz32?Math.clz32:bn,Vt=Math.log,Lt=Math.LN2;function bn(l){return l>>>=0,l===0?32:31-(Vt(l)/Lt|0)|0}var Ir=64,Xi=4194304;function Ca(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Qo(l,u){var m=l.pendingLanes;if(m===0)return 0;var b=0,C=l.suspendedLanes,_=l.pingedLanes,M=m&268435455;if(M!==0){var Y=M&~C;Y!==0?b=Ca(Y):(_&=M,_!==0&&(b=Ca(_)))}else M=m&~C,M!==0?b=Ca(M):_!==0&&(b=Ca(_));if(b===0)return 0;if(u!==0&&u!==b&&(u&C)===0&&(C=b&-b,_=u&-u,C>=_||C===16&&(_&4194240)!==0))return u;if((b&4)!==0&&(b|=m&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=b;0<u;)m=31-Ct(u),C=1<<m,b|=l[m],u&=~C;return b}function Cf(l,u){switch(l){case 1:case 2:case 4:return u+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 u+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 Af(l,u){for(var m=l.suspendedLanes,b=l.pingedLanes,C=l.expirationTimes,_=l.pendingLanes;0<_;){var M=31-Ct(_),Y=1<<M,te=C[M];te===-1?((Y&m)===0||(Y&b)!==0)&&(C[M]=Cf(Y,u)):te<=u&&(l.expiredLanes|=Y),_&=~Y}}function Mr(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function jC(){var l=Ir;return Ir<<=1,(Ir&4194240)===0&&(Ir=64),l}function sg(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Zc(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Ct(u),l[u]=m}function $z(l,u){var m=l.pendingLanes&~u;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=u,l.mutableReadLanes&=u,l.entangledLanes&=u,u=l.entanglements;var b=l.eventTimes;for(l=l.expirationTimes;0<m;){var C=31-Ct(m),_=1<<C;u[C]=0,b[C]=-1,l[C]=-1,m&=~_}}function ig(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var b=31-Ct(m),C=1<<b;C&u|l[b]&u&&(l[b]|=u),m&=~C}}var Ht=0;function SC(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var NC,og,CC,AC,EC,lg=!1,Ef=[],ri=null,ai=null,si=null,eu=new Map,tu=new Map,ii=[],Dz="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 _C(l,u){switch(l){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":si=null;break;case"pointerover":case"pointerout":eu.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":tu.delete(u.pointerId)}}function nu(l,u,m,b,C,_){return l===null||l.nativeEvent!==_?(l={blockedOn:u,domEventName:m,eventSystemFlags:b,nativeEvent:_,targetContainers:[C]},u!==null&&(u=vu(u),u!==null&&og(u)),l):(l.eventSystemFlags|=b,u=l.targetContainers,C!==null&&u.indexOf(C)===-1&&u.push(C),l)}function Lz(l,u,m,b,C){switch(u){case"focusin":return ri=nu(ri,l,u,m,b,C),!0;case"dragenter":return ai=nu(ai,l,u,m,b,C),!0;case"mouseover":return si=nu(si,l,u,m,b,C),!0;case"pointerover":var _=C.pointerId;return eu.set(_,nu(eu.get(_)||null,l,u,m,b,C)),!0;case"gotpointercapture":return _=C.pointerId,tu.set(_,nu(tu.get(_)||null,l,u,m,b,C)),!0}return!1}function PC(l){var u=Qi(l.target);if(u!==null){var m=Tr(u);if(m!==null){if(u=m.tag,u===13){if(u=Yi(m),u!==null){l.blockedOn=u,EC(l.priority,function(){CC(m)});return}}else if(u===3&&m.stateNode.current.memoizedState.isDehydrated){l.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}l.blockedOn=null}function _f(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var m=ug(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(m===null){m=l.nativeEvent;var b=new m.constructor(m.type,m);Rr=b,m.target.dispatchEvent(b),Rr=null}else return u=vu(m),u!==null&&og(u),l.blockedOn=m,!1;u.shift()}return!0}function OC(l,u,m){_f(l)&&m.delete(u)}function Fz(){lg=!1,ri!==null&&_f(ri)&&(ri=null),ai!==null&&_f(ai)&&(ai=null),si!==null&&_f(si)&&(si=null),eu.forEach(OC),tu.forEach(OC)}function ru(l,u){l.blockedOn===u&&(l.blockedOn=null,lg||(lg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fz)))}function au(l){function u(C){return ru(C,l)}if(0<Ef.length){ru(Ef[0],l);for(var m=1;m<Ef.length;m++){var b=Ef[m];b.blockedOn===l&&(b.blockedOn=null)}}for(ri!==null&&ru(ri,l),ai!==null&&ru(ai,l),si!==null&&ru(si,l),eu.forEach(u),tu.forEach(u),m=0;m<ii.length;m++)b=ii[m],b.blockedOn===l&&(b.blockedOn=null);for(;0<ii.length&&(m=ii[0],m.blockedOn===null);)PC(m),m.blockedOn===null&&ii.shift()}var Jo=P.ReactCurrentBatchConfig,Pf=!0;function Bz(l,u,m,b){var C=Ht,_=Jo.transition;Jo.transition=null;try{Ht=1,cg(l,u,m,b)}finally{Ht=C,Jo.transition=_}}function zz(l,u,m,b){var C=Ht,_=Jo.transition;Jo.transition=null;try{Ht=4,cg(l,u,m,b)}finally{Ht=C,Jo.transition=_}}function cg(l,u,m,b){if(Pf){var C=ug(l,u,m,b);if(C===null)Eg(l,u,b,Of,m),_C(l,b);else if(Lz(C,l,u,m,b))b.stopPropagation();else if(_C(l,b),u&4&&-1<Dz.indexOf(l)){for(;C!==null;){var _=vu(C);if(_!==null&&NC(_),_=ug(l,u,m,b),_===null&&Eg(l,u,b,Of,m),_===C)break;C=_}C!==null&&b.stopPropagation()}else Eg(l,u,b,null,m)}}var Of=null;function ug(l,u,m,b){if(Of=null,l=yr(b),l=Qi(l),l!==null)if(u=Tr(l),u===null)l=null;else if(m=u.tag,m===13){if(l=Yi(u),l!==null)return l;l=null}else if(m===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null);return Of=l,null}function kC(l){switch(l){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(at()){case T:return 1;case ne:return 4;case be:case _e:return 16;case rt:return 536870912;default:return 16}default:return 16}}var oi=null,dg=null,kf=null;function RC(){if(kf)return kf;var l,u=dg,m=u.length,b,C="value"in oi?oi.value:oi.textContent,_=C.length;for(l=0;l<m&&u[l]===C[l];l++);var M=m-l;for(b=1;b<=M&&u[m-b]===C[_-b];b++);return kf=C.slice(l,1<b?1-b:void 0)}function Rf(l){var u=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&u===13&&(l=13)):l=u,l===10&&(l=13),32<=l||l===13?l:0}function Tf(){return!0}function TC(){return!1}function $r(l){function u(m,b,C,_,M){this._reactName=m,this._targetInst=C,this.type=b,this.nativeEvent=_,this.target=M,this.currentTarget=null;for(var Y in l)l.hasOwnProperty(Y)&&(m=l[Y],this[Y]=m?m(_):_[Y]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Tf:TC,this.isPropagationStopped=TC,this}return Q(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Tf)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Tf)},persist:function(){},isPersistent:Tf}),u}var Zo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fg=$r(Zo),su=Q({},Zo,{view:0,detail:0}),Uz=$r(su),pg,hg,iu,If=Q({},su,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vg,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==iu&&(iu&&l.type==="mousemove"?(pg=l.screenX-iu.screenX,hg=l.screenY-iu.screenY):hg=pg=0,iu=l),pg)},movementY:function(l){return"movementY"in l?l.movementY:hg}}),IC=$r(If),qz=Q({},If,{dataTransfer:0}),Wz=$r(qz),Vz=Q({},su,{relatedTarget:0}),mg=$r(Vz),Hz=Q({},Zo,{animationName:0,elapsedTime:0,pseudoElement:0}),Kz=$r(Hz),Gz=Q({},Zo,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Yz=$r(Gz),Xz=Q({},Zo,{data:0}),MC=$r(Xz),Qz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jz={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"},Zz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=Zz[l])?!!u[l]:!1}function vg(){return e6}var t6=Q({},su,{key:function(l){if(l.key){var u=Qz[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Rf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Jz[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vg,charCode:function(l){return l.type==="keypress"?Rf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Rf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),n6=$r(t6),r6=Q({},If,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$C=$r(r6),a6=Q({},su,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vg}),s6=$r(a6),i6=Q({},Zo,{propertyName:0,elapsedTime:0,pseudoElement:0}),o6=$r(i6),l6=Q({},If,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),c6=$r(l6),u6=[9,13,27,32],gg=c&&"CompositionEvent"in window,ou=null;c&&"documentMode"in document&&(ou=document.documentMode);var d6=c&&"TextEvent"in window&&!ou,DC=c&&(!gg||ou&&8<ou&&11>=ou),LC=" ",FC=!1;function BC(l,u){switch(l){case"keyup":return u6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zC(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var el=!1;function f6(l,u){switch(l){case"compositionend":return zC(u);case"keypress":return u.which!==32?null:(FC=!0,LC);case"textInput":return l=u.data,l===LC&&FC?null:l;default:return null}}function p6(l,u){if(el)return l==="compositionend"||!gg&&BC(l,u)?(l=RC(),kf=dg=oi=null,el=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return DC&&u.locale!=="ko"?null:u.data;default:return null}}var h6={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 UC(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!h6[l.type]:u==="textarea"}function qC(l,u,m,b){ue(b),u=Ff(u,"onChange"),0<u.length&&(m=new fg("onChange","change",null,m,b),l.push({event:m,listeners:u}))}var lu=null,cu=null;function m6(l){oA(l,0)}function Mf(l){var u=sl(l);if(pe(u))return l}function v6(l,u){if(l==="change")return u}var WC=!1;if(c){var yg;if(c){var xg="oninput"in document;if(!xg){var VC=document.createElement("div");VC.setAttribute("oninput","return;"),xg=typeof VC.oninput=="function"}yg=xg}else yg=!1;WC=yg&&(!document.documentMode||9<document.documentMode)}function HC(){lu&&(lu.detachEvent("onpropertychange",KC),cu=lu=null)}function KC(l){if(l.propertyName==="value"&&Mf(cu)){var u=[];qC(u,cu,l,yr(l)),ln(m6,u)}}function g6(l,u,m){l==="focusin"?(HC(),lu=u,cu=m,lu.attachEvent("onpropertychange",KC)):l==="focusout"&&HC()}function y6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Mf(cu)}function x6(l,u){if(l==="click")return Mf(u)}function b6(l,u){if(l==="input"||l==="change")return Mf(u)}function w6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Aa=typeof Object.is=="function"?Object.is:w6;function uu(l,u){if(Aa(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var m=Object.keys(l),b=Object.keys(u);if(m.length!==b.length)return!1;for(b=0;b<m.length;b++){var C=m[b];if(!d.call(u,C)||!Aa(l[C],u[C]))return!1}return!0}function GC(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function YC(l,u){var m=GC(l);l=0;for(var b;m;){if(m.nodeType===3){if(b=l+m.textContent.length,l<=u&&b>=u)return{node:m,offset:u-l};l=b}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=GC(m)}}function XC(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?XC(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function QC(){for(var l=window,u=ve();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=ve(l.document)}return u}function bg(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u&&(u==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||u==="textarea"||l.contentEditable==="true")}function j6(l){var u=QC(),m=l.focusedElem,b=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&XC(m.ownerDocument.documentElement,m)){if(b!==null&&bg(m)){if(u=b.start,l=b.end,l===void 0&&(l=u),"selectionStart"in m)m.selectionStart=u,m.selectionEnd=Math.min(l,m.value.length);else if(l=(u=m.ownerDocument||document)&&u.defaultView||window,l.getSelection){l=l.getSelection();var C=m.textContent.length,_=Math.min(b.start,C);b=b.end===void 0?_:Math.min(b.end,C),!l.extend&&_>b&&(C=b,b=_,_=C),C=YC(m,_);var M=YC(m,b);C&&M&&(l.rangeCount!==1||l.anchorNode!==C.node||l.anchorOffset!==C.offset||l.focusNode!==M.node||l.focusOffset!==M.offset)&&(u=u.createRange(),u.setStart(C.node,C.offset),l.removeAllRanges(),_>b?(l.addRange(u),l.extend(M.node,M.offset)):(u.setEnd(M.node,M.offset),l.addRange(u)))}}for(u=[],l=m;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<u.length;m++)l=u[m],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var S6=c&&"documentMode"in document&&11>=document.documentMode,tl=null,wg=null,du=null,jg=!1;function JC(l,u,m){var b=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;jg||tl==null||tl!==ve(b)||(b=tl,"selectionStart"in b&&bg(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),du&&uu(du,b)||(du=b,b=Ff(wg,"onSelect"),0<b.length&&(u=new fg("onSelect","select",null,u,m),l.push({event:u,listeners:b}),u.target=tl)))}function $f(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var nl={animationend:$f("Animation","AnimationEnd"),animationiteration:$f("Animation","AnimationIteration"),animationstart:$f("Animation","AnimationStart"),transitionend:$f("Transition","TransitionEnd")},Sg={},ZC={};c&&(ZC=document.createElement("div").style,"AnimationEvent"in window||(delete nl.animationend.animation,delete nl.animationiteration.animation,delete nl.animationstart.animation),"TransitionEvent"in window||delete nl.transitionend.transition);function Df(l){if(Sg[l])return Sg[l];if(!nl[l])return l;var u=nl[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in ZC)return Sg[l]=u[m];return l}var eA=Df("animationend"),tA=Df("animationiteration"),nA=Df("animationstart"),rA=Df("transitionend"),aA=new Map,sA="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 li(l,u){aA.set(l,u),i(u,[l])}for(var Ng=0;Ng<sA.length;Ng++){var Cg=sA[Ng],N6=Cg.toLowerCase(),C6=Cg[0].toUpperCase()+Cg.slice(1);li(N6,"on"+C6)}li(eA,"onAnimationEnd"),li(tA,"onAnimationIteration"),li(nA,"onAnimationStart"),li("dblclick","onDoubleClick"),li("focusin","onFocus"),li("focusout","onBlur"),li(rA,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fu="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(" "),A6=new Set("cancel close invalid load scroll toggle".split(" ").concat(fu));function iA(l,u,m){var b=l.type||"unknown-event";l.currentTarget=m,ni(b,u,void 0,l),l.currentTarget=null}function oA(l,u){u=(u&4)!==0;for(var m=0;m<l.length;m++){var b=l[m],C=b.event;b=b.listeners;e:{var _=void 0;if(u)for(var M=b.length-1;0<=M;M--){var Y=b[M],te=Y.instance,me=Y.currentTarget;if(Y=Y.listener,te!==_&&C.isPropagationStopped())break e;iA(C,Y,me),_=te}else for(M=0;M<b.length;M++){if(Y=b[M],te=Y.instance,me=Y.currentTarget,Y=Y.listener,te!==_&&C.isPropagationStopped())break e;iA(C,Y,me),_=te}}}if(Sa)throw l=ti,Sa=!1,ti=null,l}function un(l,u){var m=u[Tg];m===void 0&&(m=u[Tg]=new Set);var b=l+"__bubble";m.has(b)||(lA(u,l,2,!1),m.add(b))}function Ag(l,u,m){var b=0;u&&(b|=4),lA(m,l,b,u)}var Lf="_reactListening"+Math.random().toString(36).slice(2);function pu(l){if(!l[Lf]){l[Lf]=!0,r.forEach(function(m){m!=="selectionchange"&&(A6.has(m)||Ag(m,!1,l),Ag(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[Lf]||(u[Lf]=!0,Ag("selectionchange",!1,u))}}function lA(l,u,m,b){switch(kC(u)){case 1:var C=Bz;break;case 4:C=zz;break;default:C=cg}m=C.bind(null,u,m,l),C=void 0,!rr||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(C=!0),b?C!==void 0?l.addEventListener(u,m,{capture:!0,passive:C}):l.addEventListener(u,m,!0):C!==void 0?l.addEventListener(u,m,{passive:C}):l.addEventListener(u,m,!1)}function Eg(l,u,m,b,C){var _=b;if((u&1)===0&&(u&2)===0&&b!==null)e:for(;;){if(b===null)return;var M=b.tag;if(M===3||M===4){var Y=b.stateNode.containerInfo;if(Y===C||Y.nodeType===8&&Y.parentNode===C)break;if(M===4)for(M=b.return;M!==null;){var te=M.tag;if((te===3||te===4)&&(te=M.stateNode.containerInfo,te===C||te.nodeType===8&&te.parentNode===C))return;M=M.return}for(;Y!==null;){if(M=Qi(Y),M===null)return;if(te=M.tag,te===5||te===6){b=_=M;continue e}Y=Y.parentNode}}b=b.return}ln(function(){var me=_,Ee=yr(m),Re=[];e:{var Ae=aA.get(l);if(Ae!==void 0){var Ve=fg,Ze=l;switch(l){case"keypress":if(Rf(m)===0)break e;case"keydown":case"keyup":Ve=n6;break;case"focusin":Ze="focus",Ve=mg;break;case"focusout":Ze="blur",Ve=mg;break;case"beforeblur":case"afterblur":Ve=mg;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ve=IC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ve=Wz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ve=s6;break;case eA:case tA:case nA:Ve=Kz;break;case rA:Ve=o6;break;case"scroll":Ve=Uz;break;case"wheel":Ve=c6;break;case"copy":case"cut":case"paste":Ve=Yz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ve=$C}var tt=(u&4)!==0,Nn=!tt&&l==="scroll",le=tt?Ae!==null?Ae+"Capture":null:Ae;tt=[];for(var re=me,fe;re!==null;){fe=re;var Me=fe.stateNode;if(fe.tag===5&&Me!==null&&(fe=Me,le!==null&&(Me=Pt(re,le),Me!=null&&tt.push(hu(re,Me,fe)))),Nn)break;re=re.return}0<tt.length&&(Ae=new Ve(Ae,Ze,null,m,Ee),Re.push({event:Ae,listeners:tt}))}}if((u&7)===0){e:{if(Ae=l==="mouseover"||l==="pointerover",Ve=l==="mouseout"||l==="pointerout",Ae&&m!==Rr&&(Ze=m.relatedTarget||m.fromElement)&&(Qi(Ze)||Ze[js]))break e;if((Ve||Ae)&&(Ae=Ee.window===Ee?Ee:(Ae=Ee.ownerDocument)?Ae.defaultView||Ae.parentWindow:window,Ve?(Ze=m.relatedTarget||m.toElement,Ve=me,Ze=Ze?Qi(Ze):null,Ze!==null&&(Nn=Tr(Ze),Ze!==Nn||Ze.tag!==5&&Ze.tag!==6)&&(Ze=null)):(Ve=null,Ze=me),Ve!==Ze)){if(tt=IC,Me="onMouseLeave",le="onMouseEnter",re="mouse",(l==="pointerout"||l==="pointerover")&&(tt=$C,Me="onPointerLeave",le="onPointerEnter",re="pointer"),Nn=Ve==null?Ae:sl(Ve),fe=Ze==null?Ae:sl(Ze),Ae=new tt(Me,re+"leave",Ve,m,Ee),Ae.target=Nn,Ae.relatedTarget=fe,Me=null,Qi(Ee)===me&&(tt=new tt(le,re+"enter",Ze,m,Ee),tt.target=fe,tt.relatedTarget=Nn,Me=tt),Nn=Me,Ve&&Ze)t:{for(tt=Ve,le=Ze,re=0,fe=tt;fe;fe=rl(fe))re++;for(fe=0,Me=le;Me;Me=rl(Me))fe++;for(;0<re-fe;)tt=rl(tt),re--;for(;0<fe-re;)le=rl(le),fe--;for(;re--;){if(tt===le||le!==null&&tt===le.alternate)break t;tt=rl(tt),le=rl(le)}tt=null}else tt=null;Ve!==null&&cA(Re,Ae,Ve,tt,!1),Ze!==null&&Nn!==null&&cA(Re,Nn,Ze,tt,!0)}}e:{if(Ae=me?sl(me):window,Ve=Ae.nodeName&&Ae.nodeName.toLowerCase(),Ve==="select"||Ve==="input"&&Ae.type==="file")var st=v6;else if(UC(Ae))if(WC)st=b6;else{st=y6;var ut=g6}else(Ve=Ae.nodeName)&&Ve.toLowerCase()==="input"&&(Ae.type==="checkbox"||Ae.type==="radio")&&(st=x6);if(st&&(st=st(l,me))){qC(Re,st,m,Ee);break e}ut&&ut(l,Ae,me),l==="focusout"&&(ut=Ae._wrapperState)&&ut.controlled&&Ae.type==="number"&&Fe(Ae,"number",Ae.value)}switch(ut=me?sl(me):window,l){case"focusin":(UC(ut)||ut.contentEditable==="true")&&(tl=ut,wg=me,du=null);break;case"focusout":du=wg=tl=null;break;case"mousedown":jg=!0;break;case"contextmenu":case"mouseup":case"dragend":jg=!1,JC(Re,m,Ee);break;case"selectionchange":if(S6)break;case"keydown":case"keyup":JC(Re,m,Ee)}var dt;if(gg)e:{switch(l){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else el?BC(l,m)&&(gt="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(gt="onCompositionStart");gt&&(DC&&m.locale!=="ko"&&(el||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&el&&(dt=RC()):(oi=Ee,dg="value"in oi?oi.value:oi.textContent,el=!0)),ut=Ff(me,gt),0<ut.length&&(gt=new MC(gt,l,null,m,Ee),Re.push({event:gt,listeners:ut}),dt?gt.data=dt:(dt=zC(m),dt!==null&&(gt.data=dt)))),(dt=d6?f6(l,m):p6(l,m))&&(me=Ff(me,"onBeforeInput"),0<me.length&&(Ee=new MC("onBeforeInput","beforeinput",null,m,Ee),Re.push({event:Ee,listeners:me}),Ee.data=dt))}oA(Re,u)})}function hu(l,u,m){return{instance:l,listener:u,currentTarget:m}}function Ff(l,u){for(var m=u+"Capture",b=[];l!==null;){var C=l,_=C.stateNode;C.tag===5&&_!==null&&(C=_,_=Pt(l,m),_!=null&&b.unshift(hu(l,_,C)),_=Pt(l,u),_!=null&&b.push(hu(l,_,C))),l=l.return}return b}function rl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function cA(l,u,m,b,C){for(var _=u._reactName,M=[];m!==null&&m!==b;){var Y=m,te=Y.alternate,me=Y.stateNode;if(te!==null&&te===b)break;Y.tag===5&&me!==null&&(Y=me,C?(te=Pt(m,_),te!=null&&M.unshift(hu(m,te,Y))):C||(te=Pt(m,_),te!=null&&M.push(hu(m,te,Y)))),m=m.return}M.length!==0&&l.push({event:u,listeners:M})}var E6=/\r\n?/g,_6=/\u0000|\uFFFD/g;function uA(l){return(typeof l=="string"?l:""+l).replace(E6,`
|
|
6
|
-
`).replace(_6,"")}function Bf(l,u,m){if(u=uA(u),uA(l)!==u&&m)throw Error(n(425))}function zf(){}var _g=null,Pg=null;function Og(l,u){return l==="textarea"||l==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var kg=typeof setTimeout=="function"?setTimeout:void 0,P6=typeof clearTimeout=="function"?clearTimeout:void 0,dA=typeof Promise=="function"?Promise:void 0,O6=typeof queueMicrotask=="function"?queueMicrotask:typeof dA<"u"?function(l){return dA.resolve(null).then(l).catch(k6)}:kg;function k6(l){setTimeout(function(){throw l})}function Rg(l,u){var m=u,b=0;do{var C=m.nextSibling;if(l.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(b===0){l.removeChild(C),au(u);return}b--}else m!=="$"&&m!=="$?"&&m!=="$!"||b++;m=C}while(m);au(u)}function ci(l){for(;l!=null;l=l.nextSibling){var u=l.nodeType;if(u===1||u===3)break;if(u===8){if(u=l.data,u==="$"||u==="$!"||u==="$?")break;if(u==="/$")return null}}return l}function fA(l){l=l.previousSibling;for(var u=0;l;){if(l.nodeType===8){var m=l.data;if(m==="$"||m==="$!"||m==="$?"){if(u===0)return l;u--}else m==="/$"&&u++}l=l.previousSibling}return null}var al=Math.random().toString(36).slice(2),ns="__reactFiber$"+al,mu="__reactProps$"+al,js="__reactContainer$"+al,Tg="__reactEvents$"+al,R6="__reactListeners$"+al,T6="__reactHandles$"+al;function Qi(l){var u=l[ns];if(u)return u;for(var m=l.parentNode;m;){if(u=m[js]||m[ns]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=fA(l);l!==null;){if(m=l[ns])return m;l=fA(l)}return u}l=m,m=l.parentNode}return null}function vu(l){return l=l[ns]||l[js],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function sl(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Uf(l){return l[mu]||null}var Ig=[],il=-1;function ui(l){return{current:l}}function dn(l){0>il||(l.current=Ig[il],Ig[il]=null,il--)}function rn(l,u){il++,Ig[il]=l.current,l.current=u}var di={},ar=ui(di),br=ui(!1),Ji=di;function ol(l,u){var m=l.type.contextTypes;if(!m)return di;var b=l.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===u)return b.__reactInternalMemoizedMaskedChildContext;var C={},_;for(_ in m)C[_]=u[_];return b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=C),C}function wr(l){return l=l.childContextTypes,l!=null}function qf(){dn(br),dn(ar)}function pA(l,u,m){if(ar.current!==di)throw Error(n(168));rn(ar,u),rn(br,m)}function hA(l,u,m){var b=l.stateNode;if(u=u.childContextTypes,typeof b.getChildContext!="function")return m;b=b.getChildContext();for(var C in b)if(!(C in u))throw Error(n(108,ie(l)||"Unknown",C));return Q({},m,b)}function Wf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||di,Ji=ar.current,rn(ar,l),rn(br,br.current),!0}function mA(l,u,m){var b=l.stateNode;if(!b)throw Error(n(169));m?(l=hA(l,u,Ji),b.__reactInternalMemoizedMergedChildContext=l,dn(br),dn(ar),rn(ar,l)):dn(br),rn(br,m)}var Ss=null,Vf=!1,Mg=!1;function vA(l){Ss===null?Ss=[l]:Ss.push(l)}function I6(l){Vf=!0,vA(l)}function fi(){if(!Mg&&Ss!==null){Mg=!0;var l=0,u=Ht;try{var m=Ss;for(Ht=1;l<m.length;l++){var b=m[l];do b=b(!0);while(b!==null)}Ss=null,Vf=!1}catch(C){throw Ss!==null&&(Ss=Ss.slice(l+1)),ts(T,fi),C}finally{Ht=u,Mg=!1}}return null}var ll=[],cl=0,Hf=null,Kf=0,ta=[],na=0,Zi=null,Ns=1,Cs="";function eo(l,u){ll[cl++]=Kf,ll[cl++]=Hf,Hf=l,Kf=u}function gA(l,u,m){ta[na++]=Ns,ta[na++]=Cs,ta[na++]=Zi,Zi=l;var b=Ns;l=Cs;var C=32-Ct(b)-1;b&=~(1<<C),m+=1;var _=32-Ct(u)+C;if(30<_){var M=C-C%5;_=(b&(1<<M)-1).toString(32),b>>=M,C-=M,Ns=1<<32-Ct(u)+C|m<<C|b,Cs=_+l}else Ns=1<<_|m<<C|b,Cs=l}function $g(l){l.return!==null&&(eo(l,1),gA(l,1,0))}function Dg(l){for(;l===Hf;)Hf=ll[--cl],ll[cl]=null,Kf=ll[--cl],ll[cl]=null;for(;l===Zi;)Zi=ta[--na],ta[na]=null,Cs=ta[--na],ta[na]=null,Ns=ta[--na],ta[na]=null}var Dr=null,Lr=null,hn=!1,Ea=null;function yA(l,u){var m=ia(5,null,null,0);m.elementType="DELETED",m.stateNode=u,m.return=l,u=l.deletions,u===null?(l.deletions=[m],l.flags|=16):u.push(m)}function xA(l,u){switch(l.tag){case 5:var m=l.type;return u=u.nodeType!==1||m.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(l.stateNode=u,Dr=l,Lr=ci(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,Dr=l,Lr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=Zi!==null?{id:Ns,overflow:Cs}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=ia(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,Dr=l,Lr=null,!0):!1;default:return!1}}function Lg(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Fg(l){if(hn){var u=Lr;if(u){var m=u;if(!xA(l,u)){if(Lg(l))throw Error(n(418));u=ci(m.nextSibling);var b=Dr;u&&xA(l,u)?yA(b,m):(l.flags=l.flags&-4097|2,hn=!1,Dr=l)}}else{if(Lg(l))throw Error(n(418));l.flags=l.flags&-4097|2,hn=!1,Dr=l}}}function bA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Dr=l}function Gf(l){if(l!==Dr)return!1;if(!hn)return bA(l),hn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!Og(l.type,l.memoizedProps)),u&&(u=Lr)){if(Lg(l))throw wA(),Error(n(418));for(;u;)yA(l,u),u=ci(u.nextSibling)}if(bA(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,u=0;l;){if(l.nodeType===8){var m=l.data;if(m==="/$"){if(u===0){Lr=ci(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}Lr=null}}else Lr=Dr?ci(l.stateNode.nextSibling):null;return!0}function wA(){for(var l=Lr;l;)l=ci(l.nextSibling)}function ul(){Lr=Dr=null,hn=!1}function Bg(l){Ea===null?Ea=[l]:Ea.push(l)}var M6=P.ReactCurrentBatchConfig;function gu(l,u,m){if(l=m.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var b=m.stateNode}if(!b)throw Error(n(147,l));var C=b,_=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===_?u.ref:(u=function(M){var Y=C.refs;M===null?delete Y[_]:Y[_]=M},u._stringRef=_,u)}if(typeof l!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,l))}return l}function Yf(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function jA(l){var u=l._init;return u(l._payload)}function SA(l){function u(le,re){if(l){var fe=le.deletions;fe===null?(le.deletions=[re],le.flags|=16):fe.push(re)}}function m(le,re){if(!l)return null;for(;re!==null;)u(le,re),re=re.sibling;return null}function b(le,re){for(le=new Map;re!==null;)re.key!==null?le.set(re.key,re):le.set(re.index,re),re=re.sibling;return le}function C(le,re){return le=bi(le,re),le.index=0,le.sibling=null,le}function _(le,re,fe){return le.index=fe,l?(fe=le.alternate,fe!==null?(fe=fe.index,fe<re?(le.flags|=2,re):fe):(le.flags|=2,re)):(le.flags|=1048576,re)}function M(le){return l&&le.alternate===null&&(le.flags|=2),le}function Y(le,re,fe,Me){return re===null||re.tag!==6?(re=ky(fe,le.mode,Me),re.return=le,re):(re=C(re,fe),re.return=le,re)}function te(le,re,fe,Me){var st=fe.type;return st===k?Ee(le,re,fe.props.children,Me,fe.key):re!==null&&(re.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===X&&jA(st)===re.type)?(Me=C(re,fe.props),Me.ref=gu(le,re,fe),Me.return=le,Me):(Me=xp(fe.type,fe.key,fe.props,null,le.mode,Me),Me.ref=gu(le,re,fe),Me.return=le,Me)}function me(le,re,fe,Me){return re===null||re.tag!==4||re.stateNode.containerInfo!==fe.containerInfo||re.stateNode.implementation!==fe.implementation?(re=Ry(fe,le.mode,Me),re.return=le,re):(re=C(re,fe.children||[]),re.return=le,re)}function Ee(le,re,fe,Me,st){return re===null||re.tag!==7?(re=lo(fe,le.mode,Me,st),re.return=le,re):(re=C(re,fe),re.return=le,re)}function Re(le,re,fe){if(typeof re=="string"&&re!==""||typeof re=="number")return re=ky(""+re,le.mode,fe),re.return=le,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case E:return fe=xp(re.type,re.key,re.props,null,le.mode,fe),fe.ref=gu(le,null,re),fe.return=le,fe;case O:return re=Ry(re,le.mode,fe),re.return=le,re;case X:var Me=re._init;return Re(le,Me(re._payload),fe)}if(je(re)||F(re))return re=lo(re,le.mode,fe,null),re.return=le,re;Yf(le,re)}return null}function Ae(le,re,fe,Me){var st=re!==null?re.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number")return st!==null?null:Y(le,re,""+fe,Me);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case E:return fe.key===st?te(le,re,fe,Me):null;case O:return fe.key===st?me(le,re,fe,Me):null;case X:return st=fe._init,Ae(le,re,st(fe._payload),Me)}if(je(fe)||F(fe))return st!==null?null:Ee(le,re,fe,Me,null);Yf(le,fe)}return null}function Ve(le,re,fe,Me,st){if(typeof Me=="string"&&Me!==""||typeof Me=="number")return le=le.get(fe)||null,Y(re,le,""+Me,st);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case E:return le=le.get(Me.key===null?fe:Me.key)||null,te(re,le,Me,st);case O:return le=le.get(Me.key===null?fe:Me.key)||null,me(re,le,Me,st);case X:var ut=Me._init;return Ve(le,re,fe,ut(Me._payload),st)}if(je(Me)||F(Me))return le=le.get(fe)||null,Ee(re,le,Me,st,null);Yf(re,Me)}return null}function Ze(le,re,fe,Me){for(var st=null,ut=null,dt=re,gt=re=0,Hn=null;dt!==null&><fe.length;gt++){dt.index>gt?(Hn=dt,dt=null):Hn=dt.sibling;var Tt=Ae(le,dt,fe[gt],Me);if(Tt===null){dt===null&&(dt=Hn);break}l&&dt&&Tt.alternate===null&&u(le,dt),re=_(Tt,re,gt),ut===null?st=Tt:ut.sibling=Tt,ut=Tt,dt=Hn}if(gt===fe.length)return m(le,dt),hn&&eo(le,gt),st;if(dt===null){for(;gt<fe.length;gt++)dt=Re(le,fe[gt],Me),dt!==null&&(re=_(dt,re,gt),ut===null?st=dt:ut.sibling=dt,ut=dt);return hn&&eo(le,gt),st}for(dt=b(le,dt);gt<fe.length;gt++)Hn=Ve(dt,le,gt,fe[gt],Me),Hn!==null&&(l&&Hn.alternate!==null&&dt.delete(Hn.key===null?gt:Hn.key),re=_(Hn,re,gt),ut===null?st=Hn:ut.sibling=Hn,ut=Hn);return l&&dt.forEach(function(wi){return u(le,wi)}),hn&&eo(le,gt),st}function tt(le,re,fe,Me){var st=F(fe);if(typeof st!="function")throw Error(n(150));if(fe=st.call(fe),fe==null)throw Error(n(151));for(var ut=st=null,dt=re,gt=re=0,Hn=null,Tt=fe.next();dt!==null&&!Tt.done;gt++,Tt=fe.next()){dt.index>gt?(Hn=dt,dt=null):Hn=dt.sibling;var wi=Ae(le,dt,Tt.value,Me);if(wi===null){dt===null&&(dt=Hn);break}l&&dt&&wi.alternate===null&&u(le,dt),re=_(wi,re,gt),ut===null?st=wi:ut.sibling=wi,ut=wi,dt=Hn}if(Tt.done)return m(le,dt),hn&&eo(le,gt),st;if(dt===null){for(;!Tt.done;gt++,Tt=fe.next())Tt=Re(le,Tt.value,Me),Tt!==null&&(re=_(Tt,re,gt),ut===null?st=Tt:ut.sibling=Tt,ut=Tt);return hn&&eo(le,gt),st}for(dt=b(le,dt);!Tt.done;gt++,Tt=fe.next())Tt=Ve(dt,le,gt,Tt.value,Me),Tt!==null&&(l&&Tt.alternate!==null&&dt.delete(Tt.key===null?gt:Tt.key),re=_(Tt,re,gt),ut===null?st=Tt:ut.sibling=Tt,ut=Tt);return l&&dt.forEach(function(h7){return u(le,h7)}),hn&&eo(le,gt),st}function Nn(le,re,fe,Me){if(typeof fe=="object"&&fe!==null&&fe.type===k&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case E:e:{for(var st=fe.key,ut=re;ut!==null;){if(ut.key===st){if(st=fe.type,st===k){if(ut.tag===7){m(le,ut.sibling),re=C(ut,fe.props.children),re.return=le,le=re;break e}}else if(ut.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===X&&jA(st)===ut.type){m(le,ut.sibling),re=C(ut,fe.props),re.ref=gu(le,ut,fe),re.return=le,le=re;break e}m(le,ut);break}else u(le,ut);ut=ut.sibling}fe.type===k?(re=lo(fe.props.children,le.mode,Me,fe.key),re.return=le,le=re):(Me=xp(fe.type,fe.key,fe.props,null,le.mode,Me),Me.ref=gu(le,re,fe),Me.return=le,le=Me)}return M(le);case O:e:{for(ut=fe.key;re!==null;){if(re.key===ut)if(re.tag===4&&re.stateNode.containerInfo===fe.containerInfo&&re.stateNode.implementation===fe.implementation){m(le,re.sibling),re=C(re,fe.children||[]),re.return=le,le=re;break e}else{m(le,re);break}else u(le,re);re=re.sibling}re=Ry(fe,le.mode,Me),re.return=le,le=re}return M(le);case X:return ut=fe._init,Nn(le,re,ut(fe._payload),Me)}if(je(fe))return Ze(le,re,fe,Me);if(F(fe))return tt(le,re,fe,Me);Yf(le,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"?(fe=""+fe,re!==null&&re.tag===6?(m(le,re.sibling),re=C(re,fe),re.return=le,le=re):(m(le,re),re=ky(fe,le.mode,Me),re.return=le,le=re),M(le)):m(le,re)}return Nn}var dl=SA(!0),NA=SA(!1),Xf=ui(null),Qf=null,fl=null,zg=null;function Ug(){zg=fl=Qf=null}function qg(l){var u=Xf.current;dn(Xf),l._currentValue=u}function Wg(l,u,m){for(;l!==null;){var b=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,b!==null&&(b.childLanes|=u)):b!==null&&(b.childLanes&u)!==u&&(b.childLanes|=u),l===m)break;l=l.return}}function pl(l,u){Qf=l,zg=fl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(jr=!0),l.firstContext=null)}function ra(l){var u=l._currentValue;if(zg!==l)if(l={context:l,memoizedValue:u,next:null},fl===null){if(Qf===null)throw Error(n(308));fl=l,Qf.dependencies={lanes:0,firstContext:l}}else fl=fl.next=l;return u}var to=null;function Vg(l){to===null?to=[l]:to.push(l)}function CA(l,u,m,b){var C=u.interleaved;return C===null?(m.next=m,Vg(u)):(m.next=C.next,C.next=m),u.interleaved=m,As(l,b)}function As(l,u){l.lanes|=u;var m=l.alternate;for(m!==null&&(m.lanes|=u),m=l,l=l.return;l!==null;)l.childLanes|=u,m=l.alternate,m!==null&&(m.childLanes|=u),m=l,l=l.return;return m.tag===3?m.stateNode:null}var pi=!1;function Hg(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function AA(l,u){l=l.updateQueue,u.updateQueue===l&&(u.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Es(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function hi(l,u,m){var b=l.updateQueue;if(b===null)return null;if(b=b.shared,(Rt&2)!==0){var C=b.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),b.pending=u,As(l,m)}return C=b.interleaved,C===null?(u.next=u,Vg(b)):(u.next=C.next,C.next=u),b.interleaved=u,As(l,m)}function Jf(l,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194240)!==0)){var b=u.lanes;b&=l.pendingLanes,m|=b,u.lanes=m,ig(l,m)}}function EA(l,u){var m=l.updateQueue,b=l.alternate;if(b!==null&&(b=b.updateQueue,m===b)){var C=null,_=null;if(m=m.firstBaseUpdate,m!==null){do{var M={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};_===null?C=_=M:_=_.next=M,m=m.next}while(m!==null);_===null?C=_=u:_=_.next=u}else C=_=u;m={baseState:b.baseState,firstBaseUpdate:C,lastBaseUpdate:_,shared:b.shared,effects:b.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=u}function Zf(l,u,m,b){var C=l.updateQueue;pi=!1;var _=C.firstBaseUpdate,M=C.lastBaseUpdate,Y=C.shared.pending;if(Y!==null){C.shared.pending=null;var te=Y,me=te.next;te.next=null,M===null?_=me:M.next=me,M=te;var Ee=l.alternate;Ee!==null&&(Ee=Ee.updateQueue,Y=Ee.lastBaseUpdate,Y!==M&&(Y===null?Ee.firstBaseUpdate=me:Y.next=me,Ee.lastBaseUpdate=te))}if(_!==null){var Re=C.baseState;M=0,Ee=me=te=null,Y=_;do{var Ae=Y.lane,Ve=Y.eventTime;if((b&Ae)===Ae){Ee!==null&&(Ee=Ee.next={eventTime:Ve,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ze=l,tt=Y;switch(Ae=u,Ve=m,tt.tag){case 1:if(Ze=tt.payload,typeof Ze=="function"){Re=Ze.call(Ve,Re,Ae);break e}Re=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=tt.payload,Ae=typeof Ze=="function"?Ze.call(Ve,Re,Ae):Ze,Ae==null)break e;Re=Q({},Re,Ae);break e;case 2:pi=!0}}Y.callback!==null&&Y.lane!==0&&(l.flags|=64,Ae=C.effects,Ae===null?C.effects=[Y]:Ae.push(Y))}else Ve={eventTime:Ve,lane:Ae,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Ee===null?(me=Ee=Ve,te=Re):Ee=Ee.next=Ve,M|=Ae;if(Y=Y.next,Y===null){if(Y=C.shared.pending,Y===null)break;Ae=Y,Y=Ae.next,Ae.next=null,C.lastBaseUpdate=Ae,C.shared.pending=null}}while(!0);if(Ee===null&&(te=Re),C.baseState=te,C.firstBaseUpdate=me,C.lastBaseUpdate=Ee,u=C.shared.interleaved,u!==null){C=u;do M|=C.lane,C=C.next;while(C!==u)}else _===null&&(C.shared.lanes=0);ao|=M,l.lanes=M,l.memoizedState=Re}}function _A(l,u,m){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var b=l[u],C=b.callback;if(C!==null){if(b.callback=null,b=m,typeof C!="function")throw Error(n(191,C));C.call(b)}}}var yu={},rs=ui(yu),xu=ui(yu),bu=ui(yu);function no(l){if(l===yu)throw Error(n(174));return l}function Kg(l,u){switch(rn(bu,u),rn(xu,l),rn(rs,yu),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Ye(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Ye(u,l)}dn(rs),rn(rs,u)}function hl(){dn(rs),dn(xu),dn(bu)}function PA(l){no(bu.current);var u=no(rs.current),m=Ye(u,l.type);u!==m&&(rn(xu,l),rn(rs,m))}function Gg(l){xu.current===l&&(dn(rs),dn(xu))}var vn=ui(0);function ep(l){for(var u=l;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Yg=[];function Xg(){for(var l=0;l<Yg.length;l++)Yg[l]._workInProgressVersionPrimary=null;Yg.length=0}var tp=P.ReactCurrentDispatcher,Qg=P.ReactCurrentBatchConfig,ro=0,gn=null,In=null,Wn=null,np=!1,wu=!1,ju=0,$6=0;function sr(){throw Error(n(321))}function Jg(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!Aa(l[m],u[m]))return!1;return!0}function Zg(l,u,m,b,C,_){if(ro=_,gn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,tp.current=l===null||l.memoizedState===null?B6:z6,l=m(b,C),wu){_=0;do{if(wu=!1,ju=0,25<=_)throw Error(n(301));_+=1,Wn=In=null,u.updateQueue=null,tp.current=U6,l=m(b,C)}while(wu)}if(tp.current=sp,u=In!==null&&In.next!==null,ro=0,Wn=In=gn=null,np=!1,u)throw Error(n(300));return l}function ey(){var l=ju!==0;return ju=0,l}function as(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wn===null?gn.memoizedState=Wn=l:Wn=Wn.next=l,Wn}function aa(){if(In===null){var l=gn.alternate;l=l!==null?l.memoizedState:null}else l=In.next;var u=Wn===null?gn.memoizedState:Wn.next;if(u!==null)Wn=u,In=l;else{if(l===null)throw Error(n(310));In=l,l={memoizedState:In.memoizedState,baseState:In.baseState,baseQueue:In.baseQueue,queue:In.queue,next:null},Wn===null?gn.memoizedState=Wn=l:Wn=Wn.next=l}return Wn}function Su(l,u){return typeof u=="function"?u(l):u}function ty(l){var u=aa(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var b=In,C=b.baseQueue,_=m.pending;if(_!==null){if(C!==null){var M=C.next;C.next=_.next,_.next=M}b.baseQueue=C=_,m.pending=null}if(C!==null){_=C.next,b=b.baseState;var Y=M=null,te=null,me=_;do{var Ee=me.lane;if((ro&Ee)===Ee)te!==null&&(te=te.next={lane:0,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),b=me.hasEagerState?me.eagerState:l(b,me.action);else{var Re={lane:Ee,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null};te===null?(Y=te=Re,M=b):te=te.next=Re,gn.lanes|=Ee,ao|=Ee}me=me.next}while(me!==null&&me!==_);te===null?M=b:te.next=Y,Aa(b,u.memoizedState)||(jr=!0),u.memoizedState=b,u.baseState=M,u.baseQueue=te,m.lastRenderedState=b}if(l=m.interleaved,l!==null){C=l;do _=C.lane,gn.lanes|=_,ao|=_,C=C.next;while(C!==l)}else C===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function ny(l){var u=aa(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var b=m.dispatch,C=m.pending,_=u.memoizedState;if(C!==null){m.pending=null;var M=C=C.next;do _=l(_,M.action),M=M.next;while(M!==C);Aa(_,u.memoizedState)||(jr=!0),u.memoizedState=_,u.baseQueue===null&&(u.baseState=_),m.lastRenderedState=_}return[_,b]}function OA(){}function kA(l,u){var m=gn,b=aa(),C=u(),_=!Aa(b.memoizedState,C);if(_&&(b.memoizedState=C,jr=!0),b=b.queue,ry(IA.bind(null,m,b,l),[l]),b.getSnapshot!==u||_||Wn!==null&&Wn.memoizedState.tag&1){if(m.flags|=2048,Nu(9,TA.bind(null,m,b,C,u),void 0,null),Vn===null)throw Error(n(349));(ro&30)!==0||RA(m,u,C)}return C}function RA(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=gn.updateQueue,u===null?(u={lastEffect:null,stores:null},gn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function TA(l,u,m,b){u.value=m,u.getSnapshot=b,MA(u)&&$A(l)}function IA(l,u,m){return m(function(){MA(u)&&$A(l)})}function MA(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!Aa(l,m)}catch{return!0}}function $A(l){var u=As(l,1);u!==null&&ka(u,l,1,-1)}function DA(l){var u=as();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Su,lastRenderedState:l},u.queue=l,l=l.dispatch=F6.bind(null,gn,l),[u.memoizedState,l]}function Nu(l,u,m,b){return l={tag:l,create:u,destroy:m,deps:b,next:null},u=gn.updateQueue,u===null?(u={lastEffect:null,stores:null},gn.updateQueue=u,u.lastEffect=l.next=l):(m=u.lastEffect,m===null?u.lastEffect=l.next=l:(b=m.next,m.next=l,l.next=b,u.lastEffect=l)),l}function LA(){return aa().memoizedState}function rp(l,u,m,b){var C=as();gn.flags|=l,C.memoizedState=Nu(1|u,m,void 0,b===void 0?null:b)}function ap(l,u,m,b){var C=aa();b=b===void 0?null:b;var _=void 0;if(In!==null){var M=In.memoizedState;if(_=M.destroy,b!==null&&Jg(b,M.deps)){C.memoizedState=Nu(u,m,_,b);return}}gn.flags|=l,C.memoizedState=Nu(1|u,m,_,b)}function FA(l,u){return rp(8390656,8,l,u)}function ry(l,u){return ap(2048,8,l,u)}function BA(l,u){return ap(4,2,l,u)}function zA(l,u){return ap(4,4,l,u)}function UA(l,u){if(typeof u=="function")return l=l(),u(l),function(){u(null)};if(u!=null)return l=l(),u.current=l,function(){u.current=null}}function qA(l,u,m){return m=m!=null?m.concat([l]):null,ap(4,4,UA.bind(null,u,l),m)}function ay(){}function WA(l,u){var m=aa();u=u===void 0?null:u;var b=m.memoizedState;return b!==null&&u!==null&&Jg(u,b[1])?b[0]:(m.memoizedState=[l,u],l)}function VA(l,u){var m=aa();u=u===void 0?null:u;var b=m.memoizedState;return b!==null&&u!==null&&Jg(u,b[1])?b[0]:(l=l(),m.memoizedState=[l,u],l)}function HA(l,u,m){return(ro&21)===0?(l.baseState&&(l.baseState=!1,jr=!0),l.memoizedState=m):(Aa(m,u)||(m=jC(),gn.lanes|=m,ao|=m,l.baseState=!0),u)}function D6(l,u){var m=Ht;Ht=m!==0&&4>m?m:4,l(!0);var b=Qg.transition;Qg.transition={};try{l(!1),u()}finally{Ht=m,Qg.transition=b}}function KA(){return aa().memoizedState}function L6(l,u,m){var b=yi(l);if(m={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null},GA(l))YA(u,m);else if(m=CA(l,u,m,b),m!==null){var C=dr();ka(m,l,b,C),XA(m,u,b)}}function F6(l,u,m){var b=yi(l),C={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null};if(GA(l))YA(u,C);else{var _=l.alternate;if(l.lanes===0&&(_===null||_.lanes===0)&&(_=u.lastRenderedReducer,_!==null))try{var M=u.lastRenderedState,Y=_(M,m);if(C.hasEagerState=!0,C.eagerState=Y,Aa(Y,M)){var te=u.interleaved;te===null?(C.next=C,Vg(u)):(C.next=te.next,te.next=C),u.interleaved=C;return}}catch{}m=CA(l,u,C,b),m!==null&&(C=dr(),ka(m,l,b,C),XA(m,u,b))}}function GA(l){var u=l.alternate;return l===gn||u!==null&&u===gn}function YA(l,u){wu=np=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function XA(l,u,m){if((m&4194240)!==0){var b=u.lanes;b&=l.pendingLanes,m|=b,u.lanes=m,ig(l,m)}}var sp={readContext:ra,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useInsertionEffect:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useSyncExternalStore:sr,useId:sr,unstable_isNewReconciler:!1},B6={readContext:ra,useCallback:function(l,u){return as().memoizedState=[l,u===void 0?null:u],l},useContext:ra,useEffect:FA,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,rp(4194308,4,UA.bind(null,u,l),m)},useLayoutEffect:function(l,u){return rp(4194308,4,l,u)},useInsertionEffect:function(l,u){return rp(4,2,l,u)},useMemo:function(l,u){var m=as();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var b=as();return u=m!==void 0?m(u):u,b.memoizedState=b.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},b.queue=l,l=l.dispatch=L6.bind(null,gn,l),[b.memoizedState,l]},useRef:function(l){var u=as();return l={current:l},u.memoizedState=l},useState:DA,useDebugValue:ay,useDeferredValue:function(l){return as().memoizedState=l},useTransition:function(){var l=DA(!1),u=l[0];return l=D6.bind(null,l[1]),as().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var b=gn,C=as();if(hn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Vn===null)throw Error(n(349));(ro&30)!==0||RA(b,u,m)}C.memoizedState=m;var _={value:m,getSnapshot:u};return C.queue=_,FA(IA.bind(null,b,_,l),[l]),b.flags|=2048,Nu(9,TA.bind(null,b,_,m,u),void 0,null),m},useId:function(){var l=as(),u=Vn.identifierPrefix;if(hn){var m=Cs,b=Ns;m=(b&~(1<<32-Ct(b)-1)).toString(32)+m,u=":"+u+"R"+m,m=ju++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=$6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},z6={readContext:ra,useCallback:WA,useContext:ra,useEffect:ry,useImperativeHandle:qA,useInsertionEffect:BA,useLayoutEffect:zA,useMemo:VA,useReducer:ty,useRef:LA,useState:function(){return ty(Su)},useDebugValue:ay,useDeferredValue:function(l){var u=aa();return HA(u,In.memoizedState,l)},useTransition:function(){var l=ty(Su)[0],u=aa().memoizedState;return[l,u]},useMutableSource:OA,useSyncExternalStore:kA,useId:KA,unstable_isNewReconciler:!1},U6={readContext:ra,useCallback:WA,useContext:ra,useEffect:ry,useImperativeHandle:qA,useInsertionEffect:BA,useLayoutEffect:zA,useMemo:VA,useReducer:ny,useRef:LA,useState:function(){return ny(Su)},useDebugValue:ay,useDeferredValue:function(l){var u=aa();return In===null?u.memoizedState=l:HA(u,In.memoizedState,l)},useTransition:function(){var l=ny(Su)[0],u=aa().memoizedState;return[l,u]},useMutableSource:OA,useSyncExternalStore:kA,useId:KA,unstable_isNewReconciler:!1};function _a(l,u){if(l&&l.defaultProps){u=Q({},u),l=l.defaultProps;for(var m in l)u[m]===void 0&&(u[m]=l[m]);return u}return u}function sy(l,u,m,b){u=l.memoizedState,m=m(b,u),m=m==null?u:Q({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var ip={isMounted:function(l){return(l=l._reactInternals)?Tr(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var b=dr(),C=yi(l),_=Es(b,C);_.payload=u,m!=null&&(_.callback=m),u=hi(l,_,C),u!==null&&(ka(u,l,C,b),Jf(u,l,C))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var b=dr(),C=yi(l),_=Es(b,C);_.tag=1,_.payload=u,m!=null&&(_.callback=m),u=hi(l,_,C),u!==null&&(ka(u,l,C,b),Jf(u,l,C))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=dr(),b=yi(l),C=Es(m,b);C.tag=2,u!=null&&(C.callback=u),u=hi(l,C,b),u!==null&&(ka(u,l,b,m),Jf(u,l,b))}};function QA(l,u,m,b,C,_,M){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(b,_,M):u.prototype&&u.prototype.isPureReactComponent?!uu(m,b)||!uu(C,_):!0}function JA(l,u,m){var b=!1,C=di,_=u.contextType;return typeof _=="object"&&_!==null?_=ra(_):(C=wr(u)?Ji:ar.current,b=u.contextTypes,_=(b=b!=null)?ol(l,C):di),u=new u(m,_),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=ip,l.stateNode=u,u._reactInternals=l,b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=C,l.__reactInternalMemoizedMaskedChildContext=_),u}function ZA(l,u,m,b){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,b),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,b),u.state!==l&&ip.enqueueReplaceState(u,u.state,null)}function iy(l,u,m,b){var C=l.stateNode;C.props=m,C.state=l.memoizedState,C.refs={},Hg(l);var _=u.contextType;typeof _=="object"&&_!==null?C.context=ra(_):(_=wr(u)?Ji:ar.current,C.context=ol(l,_)),C.state=l.memoizedState,_=u.getDerivedStateFromProps,typeof _=="function"&&(sy(l,u,_,m),C.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(u=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),u!==C.state&&ip.enqueueReplaceState(C,C.state,null),Zf(l,m,C,b),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308)}function ml(l,u){try{var m="",b=u;do m+=J(b),b=b.return;while(b);var C=m}catch(_){C=`
|
|
7
|
-
Error generating stack: `+_.message+`
|
|
8
|
-
`+_.stack}return{value:l,source:u,stack:C,digest:null}}function oy(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function ly(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var q6=typeof WeakMap=="function"?WeakMap:Map;function eE(l,u,m){m=Es(-1,m),m.tag=3,m.payload={element:null};var b=u.value;return m.callback=function(){pp||(pp=!0,Sy=b),ly(l,u)},m}function tE(l,u,m){m=Es(-1,m),m.tag=3;var b=l.type.getDerivedStateFromError;if(typeof b=="function"){var C=u.value;m.payload=function(){return b(C)},m.callback=function(){ly(l,u)}}var _=l.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(m.callback=function(){ly(l,u),typeof b!="function"&&(vi===null?vi=new Set([this]):vi.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})}),m}function nE(l,u,m){var b=l.pingCache;if(b===null){b=l.pingCache=new q6;var C=new Set;b.set(u,C)}else C=b.get(u),C===void 0&&(C=new Set,b.set(u,C));C.has(m)||(C.add(m),l=r7.bind(null,l,u,m),u.then(l,l))}function rE(l){do{var u;if((u=l.tag===13)&&(u=l.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return l;l=l.return}while(l!==null);return null}function aE(l,u,m,b,C){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(u=Es(-1,1),u.tag=2,hi(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=C,l)}var W6=P.ReactCurrentOwner,jr=!1;function ur(l,u,m,b){u.child=l===null?NA(u,null,m,b):dl(u,l.child,m,b)}function sE(l,u,m,b,C){m=m.render;var _=u.ref;return pl(u,C),b=Zg(l,u,m,b,_,C),m=ey(),l!==null&&!jr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,_s(l,u,C)):(hn&&m&&$g(u),u.flags|=1,ur(l,u,b,C),u.child)}function iE(l,u,m,b,C){if(l===null){var _=m.type;return typeof _=="function"&&!Oy(_)&&_.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=_,oE(l,u,_,b,C)):(l=xp(m.type,null,b,u,u.mode,C),l.ref=u.ref,l.return=u,u.child=l)}if(_=l.child,(l.lanes&C)===0){var M=_.memoizedProps;if(m=m.compare,m=m!==null?m:uu,m(M,b)&&l.ref===u.ref)return _s(l,u,C)}return u.flags|=1,l=bi(_,b),l.ref=u.ref,l.return=u,u.child=l}function oE(l,u,m,b,C){if(l!==null){var _=l.memoizedProps;if(uu(_,b)&&l.ref===u.ref)if(jr=!1,u.pendingProps=b=_,(l.lanes&C)!==0)(l.flags&131072)!==0&&(jr=!0);else return u.lanes=l.lanes,_s(l,u,C)}return cy(l,u,m,b,C)}function lE(l,u,m){var b=u.pendingProps,C=b.children,_=l!==null?l.memoizedState:null;if(b.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},rn(gl,Fr),Fr|=m;else{if((m&1073741824)===0)return l=_!==null?_.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,rn(gl,Fr),Fr|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=_!==null?_.baseLanes:m,rn(gl,Fr),Fr|=b}else _!==null?(b=_.baseLanes|m,u.memoizedState=null):b=m,rn(gl,Fr),Fr|=b;return ur(l,u,C,m),u.child}function cE(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function cy(l,u,m,b,C){var _=wr(m)?Ji:ar.current;return _=ol(u,_),pl(u,C),m=Zg(l,u,m,b,_,C),b=ey(),l!==null&&!jr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,_s(l,u,C)):(hn&&b&&$g(u),u.flags|=1,ur(l,u,m,C),u.child)}function uE(l,u,m,b,C){if(wr(m)){var _=!0;Wf(u)}else _=!1;if(pl(u,C),u.stateNode===null)lp(l,u),JA(u,m,b),iy(u,m,b,C),b=!0;else if(l===null){var M=u.stateNode,Y=u.memoizedProps;M.props=Y;var te=M.context,me=m.contextType;typeof me=="object"&&me!==null?me=ra(me):(me=wr(m)?Ji:ar.current,me=ol(u,me));var Ee=m.getDerivedStateFromProps,Re=typeof Ee=="function"||typeof M.getSnapshotBeforeUpdate=="function";Re||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Y!==b||te!==me)&&ZA(u,M,b,me),pi=!1;var Ae=u.memoizedState;M.state=Ae,Zf(u,b,M,C),te=u.memoizedState,Y!==b||Ae!==te||br.current||pi?(typeof Ee=="function"&&(sy(u,m,Ee,b),te=u.memoizedState),(Y=pi||QA(u,m,Y,b,Ae,te,me))?(Re||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(u.flags|=4194308)):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=b,u.memoizedState=te),M.props=b,M.state=te,M.context=me,b=Y):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),b=!1)}else{M=u.stateNode,AA(l,u),Y=u.memoizedProps,me=u.type===u.elementType?Y:_a(u.type,Y),M.props=me,Re=u.pendingProps,Ae=M.context,te=m.contextType,typeof te=="object"&&te!==null?te=ra(te):(te=wr(m)?Ji:ar.current,te=ol(u,te));var Ve=m.getDerivedStateFromProps;(Ee=typeof Ve=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Y!==Re||Ae!==te)&&ZA(u,M,b,te),pi=!1,Ae=u.memoizedState,M.state=Ae,Zf(u,b,M,C);var Ze=u.memoizedState;Y!==Re||Ae!==Ze||br.current||pi?(typeof Ve=="function"&&(sy(u,m,Ve,b),Ze=u.memoizedState),(me=pi||QA(u,m,me,b,Ae,Ze,te)||!1)?(Ee||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(b,Ze,te),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(b,Ze,te)),typeof M.componentDidUpdate=="function"&&(u.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof M.componentDidUpdate!="function"||Y===l.memoizedProps&&Ae===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&Ae===l.memoizedState||(u.flags|=1024),u.memoizedProps=b,u.memoizedState=Ze),M.props=b,M.state=Ze,M.context=te,b=me):(typeof M.componentDidUpdate!="function"||Y===l.memoizedProps&&Ae===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&Ae===l.memoizedState||(u.flags|=1024),b=!1)}return uy(l,u,m,b,_,C)}function uy(l,u,m,b,C,_){cE(l,u);var M=(u.flags&128)!==0;if(!b&&!M)return C&&mA(u,m,!1),_s(l,u,_);b=u.stateNode,W6.current=u;var Y=M&&typeof m.getDerivedStateFromError!="function"?null:b.render();return u.flags|=1,l!==null&&M?(u.child=dl(u,l.child,null,_),u.child=dl(u,null,Y,_)):ur(l,u,Y,_),u.memoizedState=b.state,C&&mA(u,m,!0),u.child}function dE(l){var u=l.stateNode;u.pendingContext?pA(l,u.pendingContext,u.pendingContext!==u.context):u.context&&pA(l,u.context,!1),Kg(l,u.containerInfo)}function fE(l,u,m,b,C){return ul(),Bg(C),u.flags|=256,ur(l,u,m,b),u.child}var dy={dehydrated:null,treeContext:null,retryLane:0};function fy(l){return{baseLanes:l,cachePool:null,transitions:null}}function pE(l,u,m){var b=u.pendingProps,C=vn.current,_=!1,M=(u.flags&128)!==0,Y;if((Y=M)||(Y=l!==null&&l.memoizedState===null?!1:(C&2)!==0),Y?(_=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(C|=1),rn(vn,C&1),l===null)return Fg(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:l.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(M=b.children,l=b.fallback,_?(b=u.mode,_=u.child,M={mode:"hidden",children:M},(b&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=M):_=bp(M,b,0,null),l=lo(l,b,m,null),_.return=u,l.return=u,_.sibling=l,u.child=_,u.child.memoizedState=fy(m),u.memoizedState=dy,l):py(u,M));if(C=l.memoizedState,C!==null&&(Y=C.dehydrated,Y!==null))return V6(l,u,M,b,Y,C,m);if(_){_=b.fallback,M=u.mode,C=l.child,Y=C.sibling;var te={mode:"hidden",children:b.children};return(M&1)===0&&u.child!==C?(b=u.child,b.childLanes=0,b.pendingProps=te,u.deletions=null):(b=bi(C,te),b.subtreeFlags=C.subtreeFlags&14680064),Y!==null?_=bi(Y,_):(_=lo(_,M,m,null),_.flags|=2),_.return=u,b.return=u,b.sibling=_,u.child=b,b=_,_=u.child,M=l.child.memoizedState,M=M===null?fy(m):{baseLanes:M.baseLanes|m,cachePool:null,transitions:M.transitions},_.memoizedState=M,_.childLanes=l.childLanes&~m,u.memoizedState=dy,b}return _=l.child,l=_.sibling,b=bi(_,{mode:"visible",children:b.children}),(u.mode&1)===0&&(b.lanes=m),b.return=u,b.sibling=null,l!==null&&(m=u.deletions,m===null?(u.deletions=[l],u.flags|=16):m.push(l)),u.child=b,u.memoizedState=null,b}function py(l,u){return u=bp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function op(l,u,m,b){return b!==null&&Bg(b),dl(u,l.child,null,m),l=py(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function V6(l,u,m,b,C,_,M){if(m)return u.flags&256?(u.flags&=-257,b=oy(Error(n(422))),op(l,u,M,b)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(_=b.fallback,C=u.mode,b=bp({mode:"visible",children:b.children},C,0,null),_=lo(_,C,M,null),_.flags|=2,b.return=u,_.return=u,b.sibling=_,u.child=b,(u.mode&1)!==0&&dl(u,l.child,null,M),u.child.memoizedState=fy(M),u.memoizedState=dy,_);if((u.mode&1)===0)return op(l,u,M,null);if(C.data==="$!"){if(b=C.nextSibling&&C.nextSibling.dataset,b)var Y=b.dgst;return b=Y,_=Error(n(419)),b=oy(_,b,void 0),op(l,u,M,b)}if(Y=(M&l.childLanes)!==0,jr||Y){if(b=Vn,b!==null){switch(M&-M){case 4:C=2;break;case 16:C=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:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(b.suspendedLanes|M))!==0?0:C,C!==0&&C!==_.retryLane&&(_.retryLane=C,As(l,C),ka(b,l,C,-1))}return Py(),b=oy(Error(n(421))),op(l,u,M,b)}return C.data==="$?"?(u.flags|=128,u.child=l.child,u=a7.bind(null,l),C._reactRetry=u,null):(l=_.treeContext,Lr=ci(C.nextSibling),Dr=u,hn=!0,Ea=null,l!==null&&(ta[na++]=Ns,ta[na++]=Cs,ta[na++]=Zi,Ns=l.id,Cs=l.overflow,Zi=u),u=py(u,b.children),u.flags|=4096,u)}function hE(l,u,m){l.lanes|=u;var b=l.alternate;b!==null&&(b.lanes|=u),Wg(l.return,u,m)}function hy(l,u,m,b,C){var _=l.memoizedState;_===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:b,tail:m,tailMode:C}:(_.isBackwards=u,_.rendering=null,_.renderingStartTime=0,_.last=b,_.tail=m,_.tailMode=C)}function mE(l,u,m){var b=u.pendingProps,C=b.revealOrder,_=b.tail;if(ur(l,u,b.children,m),b=vn.current,(b&2)!==0)b=b&1|2,u.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&hE(l,m,u);else if(l.tag===19)hE(l,m,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}b&=1}if(rn(vn,b),(u.mode&1)===0)u.memoizedState=null;else switch(C){case"forwards":for(m=u.child,C=null;m!==null;)l=m.alternate,l!==null&&ep(l)===null&&(C=m),m=m.sibling;m=C,m===null?(C=u.child,u.child=null):(C=m.sibling,m.sibling=null),hy(u,!1,C,m,_);break;case"backwards":for(m=null,C=u.child,u.child=null;C!==null;){if(l=C.alternate,l!==null&&ep(l)===null){u.child=C;break}l=C.sibling,C.sibling=m,m=C,C=l}hy(u,!0,m,null,_);break;case"together":hy(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function lp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function _s(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),ao|=u.lanes,(m&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(n(153));if(u.child!==null){for(l=u.child,m=bi(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=bi(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function H6(l,u,m){switch(u.tag){case 3:dE(u),ul();break;case 5:PA(u);break;case 1:wr(u.type)&&Wf(u);break;case 4:Kg(u,u.stateNode.containerInfo);break;case 10:var b=u.type._context,C=u.memoizedProps.value;rn(Xf,b._currentValue),b._currentValue=C;break;case 13:if(b=u.memoizedState,b!==null)return b.dehydrated!==null?(rn(vn,vn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?pE(l,u,m):(rn(vn,vn.current&1),l=_s(l,u,m),l!==null?l.sibling:null);rn(vn,vn.current&1);break;case 19:if(b=(m&u.childLanes)!==0,(l.flags&128)!==0){if(b)return mE(l,u,m);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),rn(vn,vn.current),b)break;return null;case 22:case 23:return u.lanes=0,lE(l,u,m)}return _s(l,u,m)}var vE,my,gE,yE;vE=function(l,u){for(var m=u.child;m!==null;){if(m.tag===5||m.tag===6)l.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===u)break;for(;m.sibling===null;){if(m.return===null||m.return===u)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},my=function(){},gE=function(l,u,m,b){var C=l.memoizedProps;if(C!==b){l=u.stateNode,no(rs.current);var _=null;switch(m){case"input":C=Ce(l,C),b=Ce(l,b),_=[];break;case"select":C=Q({},C,{value:void 0}),b=Q({},b,{value:void 0}),_=[];break;case"textarea":C=et(l,C),b=et(l,b),_=[];break;default:typeof C.onClick!="function"&&typeof b.onClick=="function"&&(l.onclick=zf)}En(m,b);var M;m=null;for(me in C)if(!b.hasOwnProperty(me)&&C.hasOwnProperty(me)&&C[me]!=null)if(me==="style"){var Y=C[me];for(M in Y)Y.hasOwnProperty(M)&&(m||(m={}),m[M]="")}else me!=="dangerouslySetInnerHTML"&&me!=="children"&&me!=="suppressContentEditableWarning"&&me!=="suppressHydrationWarning"&&me!=="autoFocus"&&(a.hasOwnProperty(me)?_||(_=[]):(_=_||[]).push(me,null));for(me in b){var te=b[me];if(Y=C?.[me],b.hasOwnProperty(me)&&te!==Y&&(te!=null||Y!=null))if(me==="style")if(Y){for(M in Y)!Y.hasOwnProperty(M)||te&&te.hasOwnProperty(M)||(m||(m={}),m[M]="");for(M in te)te.hasOwnProperty(M)&&Y[M]!==te[M]&&(m||(m={}),m[M]=te[M])}else m||(_||(_=[]),_.push(me,m)),m=te;else me==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Y=Y?Y.__html:void 0,te!=null&&Y!==te&&(_=_||[]).push(me,te)):me==="children"?typeof te!="string"&&typeof te!="number"||(_=_||[]).push(me,""+te):me!=="suppressContentEditableWarning"&&me!=="suppressHydrationWarning"&&(a.hasOwnProperty(me)?(te!=null&&me==="onScroll"&&un("scroll",l),_||Y===te||(_=[])):(_=_||[]).push(me,te))}m&&(_=_||[]).push("style",m);var me=_;(u.updateQueue=me)&&(u.flags|=4)}},yE=function(l,u,m,b){m!==b&&(u.flags|=4)};function Cu(l,u){if(!hn)switch(l.tailMode){case"hidden":u=l.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l.tail=null:m.sibling=null;break;case"collapsed":m=l.tail;for(var b=null;m!==null;)m.alternate!==null&&(b=m),m=m.sibling;b===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:b.sibling=null}}function ir(l){var u=l.alternate!==null&&l.alternate.child===l.child,m=0,b=0;if(u)for(var C=l.child;C!==null;)m|=C.lanes|C.childLanes,b|=C.subtreeFlags&14680064,b|=C.flags&14680064,C.return=l,C=C.sibling;else for(C=l.child;C!==null;)m|=C.lanes|C.childLanes,b|=C.subtreeFlags,b|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=b,l.childLanes=m,u}function K6(l,u,m){var b=u.pendingProps;switch(Dg(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ir(u),null;case 1:return wr(u.type)&&qf(),ir(u),null;case 3:return b=u.stateNode,hl(),dn(br),dn(ar),Xg(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(l===null||l.child===null)&&(Gf(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Ea!==null&&(Ay(Ea),Ea=null))),my(l,u),ir(u),null;case 5:Gg(u);var C=no(bu.current);if(m=u.type,l!==null&&u.stateNode!=null)gE(l,u,m,b,C),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!b){if(u.stateNode===null)throw Error(n(166));return ir(u),null}if(l=no(rs.current),Gf(u)){b=u.stateNode,m=u.type;var _=u.memoizedProps;switch(b[ns]=u,b[mu]=_,l=(u.mode&1)!==0,m){case"dialog":un("cancel",b),un("close",b);break;case"iframe":case"object":case"embed":un("load",b);break;case"video":case"audio":for(C=0;C<fu.length;C++)un(fu[C],b);break;case"source":un("error",b);break;case"img":case"image":case"link":un("error",b),un("load",b);break;case"details":un("toggle",b);break;case"input":Le(b,_),un("invalid",b);break;case"select":b._wrapperState={wasMultiple:!!_.multiple},un("invalid",b);break;case"textarea":xt(b,_),un("invalid",b)}En(m,_),C=null;for(var M in _)if(_.hasOwnProperty(M)){var Y=_[M];M==="children"?typeof Y=="string"?b.textContent!==Y&&(_.suppressHydrationWarning!==!0&&Bf(b.textContent,Y,l),C=["children",Y]):typeof Y=="number"&&b.textContent!==""+Y&&(_.suppressHydrationWarning!==!0&&Bf(b.textContent,Y,l),C=["children",""+Y]):a.hasOwnProperty(M)&&Y!=null&&M==="onScroll"&&un("scroll",b)}switch(m){case"input":ke(b),Ne(b,_,!0);break;case"textarea":ke(b),ye(b);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(b.onclick=zf)}b=C,u.updateQueue=b,b!==null&&(u.flags|=4)}else{M=C.nodeType===9?C:C.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=We(m)),l==="http://www.w3.org/1999/xhtml"?m==="script"?(l=M.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof b.is=="string"?l=M.createElement(m,{is:b.is}):(l=M.createElement(m),m==="select"&&(M=l,b.multiple?M.multiple=!0:b.size&&(M.size=b.size))):l=M.createElementNS(l,m),l[ns]=u,l[mu]=b,vE(l,u,!1,!1),u.stateNode=l;e:{switch(M=kr(m,b),m){case"dialog":un("cancel",l),un("close",l),C=b;break;case"iframe":case"object":case"embed":un("load",l),C=b;break;case"video":case"audio":for(C=0;C<fu.length;C++)un(fu[C],l);C=b;break;case"source":un("error",l),C=b;break;case"img":case"image":case"link":un("error",l),un("load",l),C=b;break;case"details":un("toggle",l),C=b;break;case"input":Le(l,b),C=Ce(l,b),un("invalid",l);break;case"option":C=b;break;case"select":l._wrapperState={wasMultiple:!!b.multiple},C=Q({},b,{value:void 0}),un("invalid",l);break;case"textarea":xt(l,b),C=et(l,b),un("invalid",l);break;default:C=b}En(m,C),Y=C;for(_ in Y)if(Y.hasOwnProperty(_)){var te=Y[_];_==="style"?nr(l,te):_==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&Dt(l,te)):_==="children"?typeof te=="string"?(m!=="textarea"||te!=="")&&kt(l,te):typeof te=="number"&&kt(l,""+te):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(a.hasOwnProperty(_)?te!=null&&_==="onScroll"&&un("scroll",l):te!=null&&A(l,_,te,M))}switch(m){case"input":ke(l),Ne(l,b,!1);break;case"textarea":ke(l),ye(l);break;case"option":b.value!=null&&l.setAttribute("value",""+ce(b.value));break;case"select":l.multiple=!!b.multiple,_=b.value,_!=null?$e(l,!!b.multiple,_,!1):b.defaultValue!=null&&$e(l,!!b.multiple,b.defaultValue,!0);break;default:typeof C.onClick=="function"&&(l.onclick=zf)}switch(m){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}}b&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return ir(u),null;case 6:if(l&&u.stateNode!=null)yE(l,u,l.memoizedProps,b);else{if(typeof b!="string"&&u.stateNode===null)throw Error(n(166));if(m=no(bu.current),no(rs.current),Gf(u)){if(b=u.stateNode,m=u.memoizedProps,b[ns]=u,(_=b.nodeValue!==m)&&(l=Dr,l!==null))switch(l.tag){case 3:Bf(b.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Bf(b.nodeValue,m,(l.mode&1)!==0)}_&&(u.flags|=4)}else b=(m.nodeType===9?m:m.ownerDocument).createTextNode(b),b[ns]=u,u.stateNode=b}return ir(u),null;case 13:if(dn(vn),b=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(hn&&Lr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)wA(),ul(),u.flags|=98560,_=!1;else if(_=Gf(u),b!==null&&b.dehydrated!==null){if(l===null){if(!_)throw Error(n(318));if(_=u.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[ns]=u}else ul(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ir(u),_=!1}else Ea!==null&&(Ay(Ea),Ea=null),_=!0;if(!_)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=m,u):(b=b!==null,b!==(l!==null&&l.memoizedState!==null)&&b&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(vn.current&1)!==0?Mn===0&&(Mn=3):Py())),u.updateQueue!==null&&(u.flags|=4),ir(u),null);case 4:return hl(),my(l,u),l===null&&pu(u.stateNode.containerInfo),ir(u),null;case 10:return qg(u.type._context),ir(u),null;case 17:return wr(u.type)&&qf(),ir(u),null;case 19:if(dn(vn),_=u.memoizedState,_===null)return ir(u),null;if(b=(u.flags&128)!==0,M=_.rendering,M===null)if(b)Cu(_,!1);else{if(Mn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(M=ep(l),M!==null){for(u.flags|=128,Cu(_,!1),b=M.updateQueue,b!==null&&(u.updateQueue=b,u.flags|=4),u.subtreeFlags=0,b=m,m=u.child;m!==null;)_=m,l=b,_.flags&=14680066,M=_.alternate,M===null?(_.childLanes=0,_.lanes=l,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=M.childLanes,_.lanes=M.lanes,_.child=M.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=M.memoizedProps,_.memoizedState=M.memoizedState,_.updateQueue=M.updateQueue,_.type=M.type,l=M.dependencies,_.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),m=m.sibling;return rn(vn,vn.current&1|2),u.child}l=l.sibling}_.tail!==null&&he()>yl&&(u.flags|=128,b=!0,Cu(_,!1),u.lanes=4194304)}else{if(!b)if(l=ep(M),l!==null){if(u.flags|=128,b=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),Cu(_,!0),_.tail===null&&_.tailMode==="hidden"&&!M.alternate&&!hn)return ir(u),null}else 2*he()-_.renderingStartTime>yl&&m!==1073741824&&(u.flags|=128,b=!0,Cu(_,!1),u.lanes=4194304);_.isBackwards?(M.sibling=u.child,u.child=M):(m=_.last,m!==null?m.sibling=M:u.child=M,_.last=M)}return _.tail!==null?(u=_.tail,_.rendering=u,_.tail=u.sibling,_.renderingStartTime=he(),u.sibling=null,m=vn.current,rn(vn,b?m&1|2:m&1),u):(ir(u),null);case 22:case 23:return _y(),b=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==b&&(u.flags|=8192),b&&(u.mode&1)!==0?(Fr&1073741824)!==0&&(ir(u),u.subtreeFlags&6&&(u.flags|=8192)):ir(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function G6(l,u){switch(Dg(u),u.tag){case 1:return wr(u.type)&&qf(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return hl(),dn(br),dn(ar),Xg(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return Gg(u),null;case 13:if(dn(vn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));ul()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return dn(vn),null;case 4:return hl(),null;case 10:return qg(u.type._context),null;case 22:case 23:return _y(),null;case 24:return null;default:return null}}var cp=!1,or=!1,Y6=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function vl(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(b){wn(l,u,b)}else m.current=null}function vy(l,u,m){try{m()}catch(b){wn(l,u,b)}}var xE=!1;function X6(l,u){if(_g=Pf,l=QC(),bg(l)){if("selectionStart"in l)var m={start:l.selectionStart,end:l.selectionEnd};else e:{m=(m=l.ownerDocument)&&m.defaultView||window;var b=m.getSelection&&m.getSelection();if(b&&b.rangeCount!==0){m=b.anchorNode;var C=b.anchorOffset,_=b.focusNode;b=b.focusOffset;try{m.nodeType,_.nodeType}catch{m=null;break e}var M=0,Y=-1,te=-1,me=0,Ee=0,Re=l,Ae=null;t:for(;;){for(var Ve;Re!==m||C!==0&&Re.nodeType!==3||(Y=M+C),Re!==_||b!==0&&Re.nodeType!==3||(te=M+b),Re.nodeType===3&&(M+=Re.nodeValue.length),(Ve=Re.firstChild)!==null;)Ae=Re,Re=Ve;for(;;){if(Re===l)break t;if(Ae===m&&++me===C&&(Y=M),Ae===_&&++Ee===b&&(te=M),(Ve=Re.nextSibling)!==null)break;Re=Ae,Ae=Re.parentNode}Re=Ve}m=Y===-1||te===-1?null:{start:Y,end:te}}else m=null}m=m||{start:0,end:0}}else m=null;for(Pg={focusedElem:l,selectionRange:m},Pf=!1,Xe=u;Xe!==null;)if(u=Xe,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Xe=l;else for(;Xe!==null;){u=Xe;try{var Ze=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Ze!==null){var tt=Ze.memoizedProps,Nn=Ze.memoizedState,le=u.stateNode,re=le.getSnapshotBeforeUpdate(u.elementType===u.type?tt:_a(u.type,tt),Nn);le.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var fe=u.stateNode.containerInfo;fe.nodeType===1?fe.textContent="":fe.nodeType===9&&fe.documentElement&&fe.removeChild(fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Me){wn(u,u.return,Me)}if(l=u.sibling,l!==null){l.return=u.return,Xe=l;break}Xe=u.return}return Ze=xE,xE=!1,Ze}function Au(l,u,m){var b=u.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var C=b=b.next;do{if((C.tag&l)===l){var _=C.destroy;C.destroy=void 0,_!==void 0&&vy(u,m,_)}C=C.next}while(C!==b)}}function up(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&l)===l){var b=m.create;m.destroy=b()}m=m.next}while(m!==u)}}function gy(l){var u=l.ref;if(u!==null){var m=l.stateNode;l.tag,l=m,typeof u=="function"?u(l):u.current=l}}function bE(l){var u=l.alternate;u!==null&&(l.alternate=null,bE(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[ns],delete u[mu],delete u[Tg],delete u[R6],delete u[T6])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function wE(l){return l.tag===5||l.tag===3||l.tag===4}function jE(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||wE(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function yy(l,u,m){var b=l.tag;if(b===5||b===6)l=l.stateNode,u?m.nodeType===8?m.parentNode.insertBefore(l,u):m.insertBefore(l,u):(m.nodeType===8?(u=m.parentNode,u.insertBefore(l,m)):(u=m,u.appendChild(l)),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=zf));else if(b!==4&&(l=l.child,l!==null))for(yy(l,u,m),l=l.sibling;l!==null;)yy(l,u,m),l=l.sibling}function xy(l,u,m){var b=l.tag;if(b===5||b===6)l=l.stateNode,u?m.insertBefore(l,u):m.appendChild(l);else if(b!==4&&(l=l.child,l!==null))for(xy(l,u,m),l=l.sibling;l!==null;)xy(l,u,m),l=l.sibling}var Xn=null,Pa=!1;function mi(l,u,m){for(m=m.child;m!==null;)SE(l,u,m),m=m.sibling}function SE(l,u,m){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Ge,m)}catch{}switch(m.tag){case 5:or||vl(m,u);case 6:var b=Xn,C=Pa;Xn=null,mi(l,u,m),Xn=b,Pa=C,Xn!==null&&(Pa?(l=Xn,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):Xn.removeChild(m.stateNode));break;case 18:Xn!==null&&(Pa?(l=Xn,m=m.stateNode,l.nodeType===8?Rg(l.parentNode,m):l.nodeType===1&&Rg(l,m),au(l)):Rg(Xn,m.stateNode));break;case 4:b=Xn,C=Pa,Xn=m.stateNode.containerInfo,Pa=!0,mi(l,u,m),Xn=b,Pa=C;break;case 0:case 11:case 14:case 15:if(!or&&(b=m.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){C=b=b.next;do{var _=C,M=_.destroy;_=_.tag,M!==void 0&&((_&2)!==0||(_&4)!==0)&&vy(m,u,M),C=C.next}while(C!==b)}mi(l,u,m);break;case 1:if(!or&&(vl(m,u),b=m.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=m.memoizedProps,b.state=m.memoizedState,b.componentWillUnmount()}catch(Y){wn(m,u,Y)}mi(l,u,m);break;case 21:mi(l,u,m);break;case 22:m.mode&1?(or=(b=or)||m.memoizedState!==null,mi(l,u,m),or=b):mi(l,u,m);break;default:mi(l,u,m)}}function NE(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new Y6),u.forEach(function(b){var C=s7.bind(null,l,b);m.has(b)||(m.add(b),b.then(C,C))})}}function Oa(l,u){var m=u.deletions;if(m!==null)for(var b=0;b<m.length;b++){var C=m[b];try{var _=l,M=u,Y=M;e:for(;Y!==null;){switch(Y.tag){case 5:Xn=Y.stateNode,Pa=!1;break e;case 3:Xn=Y.stateNode.containerInfo,Pa=!0;break e;case 4:Xn=Y.stateNode.containerInfo,Pa=!0;break e}Y=Y.return}if(Xn===null)throw Error(n(160));SE(_,M,C),Xn=null,Pa=!1;var te=C.alternate;te!==null&&(te.return=null),C.return=null}catch(me){wn(C,u,me)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)CE(u,l),u=u.sibling}function CE(l,u){var m=l.alternate,b=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Oa(u,l),ss(l),b&4){try{Au(3,l,l.return),up(3,l)}catch(tt){wn(l,l.return,tt)}try{Au(5,l,l.return)}catch(tt){wn(l,l.return,tt)}}break;case 1:Oa(u,l),ss(l),b&512&&m!==null&&vl(m,m.return);break;case 5:if(Oa(u,l),ss(l),b&512&&m!==null&&vl(m,m.return),l.flags&32){var C=l.stateNode;try{kt(C,"")}catch(tt){wn(l,l.return,tt)}}if(b&4&&(C=l.stateNode,C!=null)){var _=l.memoizedProps,M=m!==null?m.memoizedProps:_,Y=l.type,te=l.updateQueue;if(l.updateQueue=null,te!==null)try{Y==="input"&&_.type==="radio"&&_.name!=null&&se(C,_),kr(Y,M);var me=kr(Y,_);for(M=0;M<te.length;M+=2){var Ee=te[M],Re=te[M+1];Ee==="style"?nr(C,Re):Ee==="dangerouslySetInnerHTML"?Dt(C,Re):Ee==="children"?kt(C,Re):A(C,Ee,Re,me)}switch(Y){case"input":de(C,_);break;case"textarea":Jt(C,_);break;case"select":var Ae=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!_.multiple;var Ve=_.value;Ve!=null?$e(C,!!_.multiple,Ve,!1):Ae!==!!_.multiple&&(_.defaultValue!=null?$e(C,!!_.multiple,_.defaultValue,!0):$e(C,!!_.multiple,_.multiple?[]:"",!1))}C[mu]=_}catch(tt){wn(l,l.return,tt)}}break;case 6:if(Oa(u,l),ss(l),b&4){if(l.stateNode===null)throw Error(n(162));C=l.stateNode,_=l.memoizedProps;try{C.nodeValue=_}catch(tt){wn(l,l.return,tt)}}break;case 3:if(Oa(u,l),ss(l),b&4&&m!==null&&m.memoizedState.isDehydrated)try{au(u.containerInfo)}catch(tt){wn(l,l.return,tt)}break;case 4:Oa(u,l),ss(l);break;case 13:Oa(u,l),ss(l),C=l.child,C.flags&8192&&(_=C.memoizedState!==null,C.stateNode.isHidden=_,!_||C.alternate!==null&&C.alternate.memoizedState!==null||(jy=he())),b&4&&NE(l);break;case 22:if(Ee=m!==null&&m.memoizedState!==null,l.mode&1?(or=(me=or)||Ee,Oa(u,l),or=me):Oa(u,l),ss(l),b&8192){if(me=l.memoizedState!==null,(l.stateNode.isHidden=me)&&!Ee&&(l.mode&1)!==0)for(Xe=l,Ee=l.child;Ee!==null;){for(Re=Xe=Ee;Xe!==null;){switch(Ae=Xe,Ve=Ae.child,Ae.tag){case 0:case 11:case 14:case 15:Au(4,Ae,Ae.return);break;case 1:vl(Ae,Ae.return);var Ze=Ae.stateNode;if(typeof Ze.componentWillUnmount=="function"){b=Ae,m=Ae.return;try{u=b,Ze.props=u.memoizedProps,Ze.state=u.memoizedState,Ze.componentWillUnmount()}catch(tt){wn(b,m,tt)}}break;case 5:vl(Ae,Ae.return);break;case 22:if(Ae.memoizedState!==null){_E(Re);continue}}Ve!==null?(Ve.return=Ae,Xe=Ve):_E(Re)}Ee=Ee.sibling}e:for(Ee=null,Re=l;;){if(Re.tag===5){if(Ee===null){Ee=Re;try{C=Re.stateNode,me?(_=C.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(Y=Re.stateNode,te=Re.memoizedProps.style,M=te!=null&&te.hasOwnProperty("display")?te.display:null,Y.style.display=tr("display",M))}catch(tt){wn(l,l.return,tt)}}}else if(Re.tag===6){if(Ee===null)try{Re.stateNode.nodeValue=me?"":Re.memoizedProps}catch(tt){wn(l,l.return,tt)}}else if((Re.tag!==22&&Re.tag!==23||Re.memoizedState===null||Re===l)&&Re.child!==null){Re.child.return=Re,Re=Re.child;continue}if(Re===l)break e;for(;Re.sibling===null;){if(Re.return===null||Re.return===l)break e;Ee===Re&&(Ee=null),Re=Re.return}Ee===Re&&(Ee=null),Re.sibling.return=Re.return,Re=Re.sibling}}break;case 19:Oa(u,l),ss(l),b&4&&NE(l);break;case 21:break;default:Oa(u,l),ss(l)}}function ss(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(wE(m)){var b=m;break e}m=m.return}throw Error(n(160))}switch(b.tag){case 5:var C=b.stateNode;b.flags&32&&(kt(C,""),b.flags&=-33);var _=jE(l);xy(l,_,C);break;case 3:case 4:var M=b.stateNode.containerInfo,Y=jE(l);yy(l,Y,M);break;default:throw Error(n(161))}}catch(te){wn(l,l.return,te)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function Q6(l,u,m){Xe=l,AE(l)}function AE(l,u,m){for(var b=(l.mode&1)!==0;Xe!==null;){var C=Xe,_=C.child;if(C.tag===22&&b){var M=C.memoizedState!==null||cp;if(!M){var Y=C.alternate,te=Y!==null&&Y.memoizedState!==null||or;Y=cp;var me=or;if(cp=M,(or=te)&&!me)for(Xe=C;Xe!==null;)M=Xe,te=M.child,M.tag===22&&M.memoizedState!==null?PE(C):te!==null?(te.return=M,Xe=te):PE(C);for(;_!==null;)Xe=_,AE(_),_=_.sibling;Xe=C,cp=Y,or=me}EE(l)}else(C.subtreeFlags&8772)!==0&&_!==null?(_.return=C,Xe=_):EE(l)}}function EE(l){for(;Xe!==null;){var u=Xe;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:or||up(5,u);break;case 1:var b=u.stateNode;if(u.flags&4&&!or)if(m===null)b.componentDidMount();else{var C=u.elementType===u.type?m.memoizedProps:_a(u.type,m.memoizedProps);b.componentDidUpdate(C,m.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var _=u.updateQueue;_!==null&&_A(u,_,b);break;case 3:var M=u.updateQueue;if(M!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}_A(u,M,m)}break;case 5:var Y=u.stateNode;if(m===null&&u.flags&4){m=Y;var te=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&m.focus();break;case"img":te.src&&(m.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var me=u.alternate;if(me!==null){var Ee=me.memoizedState;if(Ee!==null){var Re=Ee.dehydrated;Re!==null&&au(Re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}or||u.flags&512&&gy(u)}catch(Ae){wn(u,u.return,Ae)}}if(u===l){Xe=null;break}if(m=u.sibling,m!==null){m.return=u.return,Xe=m;break}Xe=u.return}}function _E(l){for(;Xe!==null;){var u=Xe;if(u===l){Xe=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Xe=m;break}Xe=u.return}}function PE(l){for(;Xe!==null;){var u=Xe;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{up(4,u)}catch(te){wn(u,m,te)}break;case 1:var b=u.stateNode;if(typeof b.componentDidMount=="function"){var C=u.return;try{b.componentDidMount()}catch(te){wn(u,C,te)}}var _=u.return;try{gy(u)}catch(te){wn(u,_,te)}break;case 5:var M=u.return;try{gy(u)}catch(te){wn(u,M,te)}}}catch(te){wn(u,u.return,te)}if(u===l){Xe=null;break}var Y=u.sibling;if(Y!==null){Y.return=u.return,Xe=Y;break}Xe=u.return}}var J6=Math.ceil,dp=P.ReactCurrentDispatcher,by=P.ReactCurrentOwner,sa=P.ReactCurrentBatchConfig,Rt=0,Vn=null,Pn=null,Qn=0,Fr=0,gl=ui(0),Mn=0,Eu=null,ao=0,fp=0,wy=0,_u=null,Sr=null,jy=0,yl=1/0,Ps=null,pp=!1,Sy=null,vi=null,hp=!1,gi=null,mp=0,Pu=0,Ny=null,vp=-1,gp=0;function dr(){return(Rt&6)!==0?he():vp!==-1?vp:vp=he()}function yi(l){return(l.mode&1)===0?1:(Rt&2)!==0&&Qn!==0?Qn&-Qn:M6.transition!==null?(gp===0&&(gp=jC()),gp):(l=Ht,l!==0||(l=window.event,l=l===void 0?16:kC(l.type)),l)}function ka(l,u,m,b){if(50<Pu)throw Pu=0,Ny=null,Error(n(185));Zc(l,m,b),((Rt&2)===0||l!==Vn)&&(l===Vn&&((Rt&2)===0&&(fp|=m),Mn===4&&xi(l,Qn)),Nr(l,b),m===1&&Rt===0&&(u.mode&1)===0&&(yl=he()+500,Vf&&fi()))}function Nr(l,u){var m=l.callbackNode;Af(l,u);var b=Qo(l,l===Vn?Qn:0);if(b===0)m!==null&&Na(m),l.callbackNode=null,l.callbackPriority=0;else if(u=b&-b,l.callbackPriority!==u){if(m!=null&&Na(m),u===1)l.tag===0?I6(kE.bind(null,l)):vA(kE.bind(null,l)),O6(function(){(Rt&6)===0&&fi()}),m=null;else{switch(SC(b)){case 1:m=T;break;case 4:m=ne;break;case 16:m=be;break;case 536870912:m=rt;break;default:m=be}m=FE(m,OE.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function OE(l,u){if(vp=-1,gp=0,(Rt&6)!==0)throw Error(n(327));var m=l.callbackNode;if(xl()&&l.callbackNode!==m)return null;var b=Qo(l,l===Vn?Qn:0);if(b===0)return null;if((b&30)!==0||(b&l.expiredLanes)!==0||u)u=yp(l,b);else{u=b;var C=Rt;Rt|=2;var _=TE();(Vn!==l||Qn!==u)&&(Ps=null,yl=he()+500,io(l,u));do try{t7();break}catch(Y){RE(l,Y)}while(!0);Ug(),dp.current=_,Rt=C,Pn!==null?u=0:(Vn=null,Qn=0,u=Mn)}if(u!==0){if(u===2&&(C=Mr(l),C!==0&&(b=C,u=Cy(l,C))),u===1)throw m=Eu,io(l,0),xi(l,b),Nr(l,he()),m;if(u===6)xi(l,b);else{if(C=l.current.alternate,(b&30)===0&&!Z6(C)&&(u=yp(l,b),u===2&&(_=Mr(l),_!==0&&(b=_,u=Cy(l,_))),u===1))throw m=Eu,io(l,0),xi(l,b),Nr(l,he()),m;switch(l.finishedWork=C,l.finishedLanes=b,u){case 0:case 1:throw Error(n(345));case 2:oo(l,Sr,Ps);break;case 3:if(xi(l,b),(b&130023424)===b&&(u=jy+500-he(),10<u)){if(Qo(l,0)!==0)break;if(C=l.suspendedLanes,(C&b)!==b){dr(),l.pingedLanes|=l.suspendedLanes&C;break}l.timeoutHandle=kg(oo.bind(null,l,Sr,Ps),u);break}oo(l,Sr,Ps);break;case 4:if(xi(l,b),(b&4194240)===b)break;for(u=l.eventTimes,C=-1;0<b;){var M=31-Ct(b);_=1<<M,M=u[M],M>C&&(C=M),b&=~_}if(b=C,b=he()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*J6(b/1960))-b,10<b){l.timeoutHandle=kg(oo.bind(null,l,Sr,Ps),b);break}oo(l,Sr,Ps);break;case 5:oo(l,Sr,Ps);break;default:throw Error(n(329))}}}return Nr(l,he()),l.callbackNode===m?OE.bind(null,l):null}function Cy(l,u){var m=_u;return l.current.memoizedState.isDehydrated&&(io(l,u).flags|=256),l=yp(l,u),l!==2&&(u=Sr,Sr=m,u!==null&&Ay(u)),l}function Ay(l){Sr===null?Sr=l:Sr.push.apply(Sr,l)}function Z6(l){for(var u=l;;){if(u.flags&16384){var m=u.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var b=0;b<m.length;b++){var C=m[b],_=C.getSnapshot;C=C.value;try{if(!Aa(_(),C))return!1}catch{return!1}}}if(m=u.child,u.subtreeFlags&16384&&m!==null)m.return=u,u=m;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function xi(l,u){for(u&=~wy,u&=~fp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-Ct(u),b=1<<m;l[m]=-1,u&=~b}}function kE(l){if((Rt&6)!==0)throw Error(n(327));xl();var u=Qo(l,0);if((u&1)===0)return Nr(l,he()),null;var m=yp(l,u);if(l.tag!==0&&m===2){var b=Mr(l);b!==0&&(u=b,m=Cy(l,b))}if(m===1)throw m=Eu,io(l,0),xi(l,u),Nr(l,he()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,oo(l,Sr,Ps),Nr(l,he()),null}function Ey(l,u){var m=Rt;Rt|=1;try{return l(u)}finally{Rt=m,Rt===0&&(yl=he()+500,Vf&&fi())}}function so(l){gi!==null&&gi.tag===0&&(Rt&6)===0&&xl();var u=Rt;Rt|=1;var m=sa.transition,b=Ht;try{if(sa.transition=null,Ht=1,l)return l()}finally{Ht=b,sa.transition=m,Rt=u,(Rt&6)===0&&fi()}}function _y(){Fr=gl.current,dn(gl)}function io(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,P6(m)),Pn!==null)for(m=Pn.return;m!==null;){var b=m;switch(Dg(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&qf();break;case 3:hl(),dn(br),dn(ar),Xg();break;case 5:Gg(b);break;case 4:hl();break;case 13:dn(vn);break;case 19:dn(vn);break;case 10:qg(b.type._context);break;case 22:case 23:_y()}m=m.return}if(Vn=l,Pn=l=bi(l.current,null),Qn=Fr=u,Mn=0,Eu=null,wy=fp=ao=0,Sr=_u=null,to!==null){for(u=0;u<to.length;u++)if(m=to[u],b=m.interleaved,b!==null){m.interleaved=null;var C=b.next,_=m.pending;if(_!==null){var M=_.next;_.next=C,b.next=M}m.pending=b}to=null}return l}function RE(l,u){do{var m=Pn;try{if(Ug(),tp.current=sp,np){for(var b=gn.memoizedState;b!==null;){var C=b.queue;C!==null&&(C.pending=null),b=b.next}np=!1}if(ro=0,Wn=In=gn=null,wu=!1,ju=0,by.current=null,m===null||m.return===null){Mn=1,Eu=u,Pn=null;break}e:{var _=l,M=m.return,Y=m,te=u;if(u=Qn,Y.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var me=te,Ee=Y,Re=Ee.tag;if((Ee.mode&1)===0&&(Re===0||Re===11||Re===15)){var Ae=Ee.alternate;Ae?(Ee.updateQueue=Ae.updateQueue,Ee.memoizedState=Ae.memoizedState,Ee.lanes=Ae.lanes):(Ee.updateQueue=null,Ee.memoizedState=null)}var Ve=rE(M);if(Ve!==null){Ve.flags&=-257,aE(Ve,M,Y,_,u),Ve.mode&1&&nE(_,me,u),u=Ve,te=me;var Ze=u.updateQueue;if(Ze===null){var tt=new Set;tt.add(te),u.updateQueue=tt}else Ze.add(te);break e}else{if((u&1)===0){nE(_,me,u),Py();break e}te=Error(n(426))}}else if(hn&&Y.mode&1){var Nn=rE(M);if(Nn!==null){(Nn.flags&65536)===0&&(Nn.flags|=256),aE(Nn,M,Y,_,u),Bg(ml(te,Y));break e}}_=te=ml(te,Y),Mn!==4&&(Mn=2),_u===null?_u=[_]:_u.push(_),_=M;do{switch(_.tag){case 3:_.flags|=65536,u&=-u,_.lanes|=u;var le=eE(_,te,u);EA(_,le);break e;case 1:Y=te;var re=_.type,fe=_.stateNode;if((_.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||fe!==null&&typeof fe.componentDidCatch=="function"&&(vi===null||!vi.has(fe)))){_.flags|=65536,u&=-u,_.lanes|=u;var Me=tE(_,Y,u);EA(_,Me);break e}}_=_.return}while(_!==null)}ME(m)}catch(st){u=st,Pn===m&&m!==null&&(Pn=m=m.return);continue}break}while(!0)}function TE(){var l=dp.current;return dp.current=sp,l===null?sp:l}function Py(){(Mn===0||Mn===3||Mn===2)&&(Mn=4),Vn===null||(ao&268435455)===0&&(fp&268435455)===0||xi(Vn,Qn)}function yp(l,u){var m=Rt;Rt|=2;var b=TE();(Vn!==l||Qn!==u)&&(Ps=null,io(l,u));do try{e7();break}catch(C){RE(l,C)}while(!0);if(Ug(),Rt=m,dp.current=b,Pn!==null)throw Error(n(261));return Vn=null,Qn=0,Mn}function e7(){for(;Pn!==null;)IE(Pn)}function t7(){for(;Pn!==null&&!Jc();)IE(Pn)}function IE(l){var u=LE(l.alternate,l,Fr);l.memoizedProps=l.pendingProps,u===null?ME(l):Pn=u,by.current=null}function ME(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=K6(m,u,Fr),m!==null){Pn=m;return}}else{if(m=G6(m,u),m!==null){m.flags&=32767,Pn=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Mn=6,Pn=null;return}}if(u=u.sibling,u!==null){Pn=u;return}Pn=u=l}while(u!==null);Mn===0&&(Mn=5)}function oo(l,u,m){var b=Ht,C=sa.transition;try{sa.transition=null,Ht=1,n7(l,u,m,b)}finally{sa.transition=C,Ht=b}return null}function n7(l,u,m,b){do xl();while(gi!==null);if((Rt&6)!==0)throw Error(n(327));m=l.finishedWork;var C=l.finishedLanes;if(m===null)return null;if(l.finishedWork=null,l.finishedLanes=0,m===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var _=m.lanes|m.childLanes;if($z(l,_),l===Vn&&(Pn=Vn=null,Qn=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||hp||(hp=!0,FE(be,function(){return xl(),null})),_=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||_){_=sa.transition,sa.transition=null;var M=Ht;Ht=1;var Y=Rt;Rt|=4,by.current=null,X6(l,m),CE(m,l),j6(Pg),Pf=!!_g,Pg=_g=null,l.current=m,Q6(m),K(),Rt=Y,Ht=M,sa.transition=_}else l.current=m;if(hp&&(hp=!1,gi=l,mp=C),_=l.pendingLanes,_===0&&(vi=null),Be(m.stateNode),Nr(l,he()),u!==null)for(b=l.onRecoverableError,m=0;m<u.length;m++)C=u[m],b(C.value,{componentStack:C.stack,digest:C.digest});if(pp)throw pp=!1,l=Sy,Sy=null,l;return(mp&1)!==0&&l.tag!==0&&xl(),_=l.pendingLanes,(_&1)!==0?l===Ny?Pu++:(Pu=0,Ny=l):Pu=0,fi(),null}function xl(){if(gi!==null){var l=SC(mp),u=sa.transition,m=Ht;try{if(sa.transition=null,Ht=16>l?16:l,gi===null)var b=!1;else{if(l=gi,gi=null,mp=0,(Rt&6)!==0)throw Error(n(331));var C=Rt;for(Rt|=4,Xe=l.current;Xe!==null;){var _=Xe,M=_.child;if((Xe.flags&16)!==0){var Y=_.deletions;if(Y!==null){for(var te=0;te<Y.length;te++){var me=Y[te];for(Xe=me;Xe!==null;){var Ee=Xe;switch(Ee.tag){case 0:case 11:case 15:Au(8,Ee,_)}var Re=Ee.child;if(Re!==null)Re.return=Ee,Xe=Re;else for(;Xe!==null;){Ee=Xe;var Ae=Ee.sibling,Ve=Ee.return;if(bE(Ee),Ee===me){Xe=null;break}if(Ae!==null){Ae.return=Ve,Xe=Ae;break}Xe=Ve}}}var Ze=_.alternate;if(Ze!==null){var tt=Ze.child;if(tt!==null){Ze.child=null;do{var Nn=tt.sibling;tt.sibling=null,tt=Nn}while(tt!==null)}}Xe=_}}if((_.subtreeFlags&2064)!==0&&M!==null)M.return=_,Xe=M;else e:for(;Xe!==null;){if(_=Xe,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:Au(9,_,_.return)}var le=_.sibling;if(le!==null){le.return=_.return,Xe=le;break e}Xe=_.return}}var re=l.current;for(Xe=re;Xe!==null;){M=Xe;var fe=M.child;if((M.subtreeFlags&2064)!==0&&fe!==null)fe.return=M,Xe=fe;else e:for(M=re;Xe!==null;){if(Y=Xe,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:up(9,Y)}}catch(st){wn(Y,Y.return,st)}if(Y===M){Xe=null;break e}var Me=Y.sibling;if(Me!==null){Me.return=Y.return,Xe=Me;break e}Xe=Y.return}}if(Rt=C,fi(),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(Ge,l)}catch{}b=!0}return b}finally{Ht=m,sa.transition=u}}return!1}function $E(l,u,m){u=ml(m,u),u=eE(l,u,1),l=hi(l,u,1),u=dr(),l!==null&&(Zc(l,1,u),Nr(l,u))}function wn(l,u,m){if(l.tag===3)$E(l,l,m);else for(;u!==null;){if(u.tag===3){$E(u,l,m);break}else if(u.tag===1){var b=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(vi===null||!vi.has(b))){l=ml(m,l),l=tE(u,l,1),u=hi(u,l,1),l=dr(),u!==null&&(Zc(u,1,l),Nr(u,l));break}}u=u.return}}function r7(l,u,m){var b=l.pingCache;b!==null&&b.delete(u),u=dr(),l.pingedLanes|=l.suspendedLanes&m,Vn===l&&(Qn&m)===m&&(Mn===4||Mn===3&&(Qn&130023424)===Qn&&500>he()-jy?io(l,0):wy|=m),Nr(l,u)}function DE(l,u){u===0&&((l.mode&1)===0?u=1:(u=Xi,Xi<<=1,(Xi&130023424)===0&&(Xi=4194304)));var m=dr();l=As(l,u),l!==null&&(Zc(l,u,m),Nr(l,m))}function a7(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),DE(l,m)}function s7(l,u){var m=0;switch(l.tag){case 13:var b=l.stateNode,C=l.memoizedState;C!==null&&(m=C.retryLane);break;case 19:b=l.stateNode;break;default:throw Error(n(314))}b!==null&&b.delete(u),DE(l,m)}var LE;LE=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||br.current)jr=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return jr=!1,H6(l,u,m);jr=(l.flags&131072)!==0}else jr=!1,hn&&(u.flags&1048576)!==0&&gA(u,Kf,u.index);switch(u.lanes=0,u.tag){case 2:var b=u.type;lp(l,u),l=u.pendingProps;var C=ol(u,ar.current);pl(u,m),C=Zg(null,u,b,l,C,m);var _=ey();return u.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,wr(b)?(_=!0,Wf(u)):_=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Hg(u),C.updater=ip,u.stateNode=C,C._reactInternals=u,iy(u,b,l,m),u=uy(null,u,b,!0,_,m)):(u.tag=0,hn&&_&&$g(u),ur(null,u,C,m),u=u.child),u;case 16:b=u.elementType;e:{switch(lp(l,u),l=u.pendingProps,C=b._init,b=C(b._payload),u.type=b,C=u.tag=o7(b),l=_a(b,l),C){case 0:u=cy(null,u,b,l,m);break e;case 1:u=uE(null,u,b,l,m);break e;case 11:u=sE(null,u,b,l,m);break e;case 14:u=iE(null,u,b,_a(b.type,l),m);break e}throw Error(n(306,b,""))}return u;case 0:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:_a(b,C),cy(l,u,b,C,m);case 1:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:_a(b,C),uE(l,u,b,C,m);case 3:e:{if(dE(u),l===null)throw Error(n(387));b=u.pendingProps,_=u.memoizedState,C=_.element,AA(l,u),Zf(u,b,null,m);var M=u.memoizedState;if(b=M.element,_.isDehydrated)if(_={element:b,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},u.updateQueue.baseState=_,u.memoizedState=_,u.flags&256){C=ml(Error(n(423)),u),u=fE(l,u,b,m,C);break e}else if(b!==C){C=ml(Error(n(424)),u),u=fE(l,u,b,m,C);break e}else for(Lr=ci(u.stateNode.containerInfo.firstChild),Dr=u,hn=!0,Ea=null,m=NA(u,null,b,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(ul(),b===C){u=_s(l,u,m);break e}ur(l,u,b,m)}u=u.child}return u;case 5:return PA(u),l===null&&Fg(u),b=u.type,C=u.pendingProps,_=l!==null?l.memoizedProps:null,M=C.children,Og(b,C)?M=null:_!==null&&Og(b,_)&&(u.flags|=32),cE(l,u),ur(l,u,M,m),u.child;case 6:return l===null&&Fg(u),null;case 13:return pE(l,u,m);case 4:return Kg(u,u.stateNode.containerInfo),b=u.pendingProps,l===null?u.child=dl(u,null,b,m):ur(l,u,b,m),u.child;case 11:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:_a(b,C),sE(l,u,b,C,m);case 7:return ur(l,u,u.pendingProps,m),u.child;case 8:return ur(l,u,u.pendingProps.children,m),u.child;case 12:return ur(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(b=u.type._context,C=u.pendingProps,_=u.memoizedProps,M=C.value,rn(Xf,b._currentValue),b._currentValue=M,_!==null)if(Aa(_.value,M)){if(_.children===C.children&&!br.current){u=_s(l,u,m);break e}}else for(_=u.child,_!==null&&(_.return=u);_!==null;){var Y=_.dependencies;if(Y!==null){M=_.child;for(var te=Y.firstContext;te!==null;){if(te.context===b){if(_.tag===1){te=Es(-1,m&-m),te.tag=2;var me=_.updateQueue;if(me!==null){me=me.shared;var Ee=me.pending;Ee===null?te.next=te:(te.next=Ee.next,Ee.next=te),me.pending=te}}_.lanes|=m,te=_.alternate,te!==null&&(te.lanes|=m),Wg(_.return,m,u),Y.lanes|=m;break}te=te.next}}else if(_.tag===10)M=_.type===u.type?null:_.child;else if(_.tag===18){if(M=_.return,M===null)throw Error(n(341));M.lanes|=m,Y=M.alternate,Y!==null&&(Y.lanes|=m),Wg(M,m,u),M=_.sibling}else M=_.child;if(M!==null)M.return=_;else for(M=_;M!==null;){if(M===u){M=null;break}if(_=M.sibling,_!==null){_.return=M.return,M=_;break}M=M.return}_=M}ur(l,u,C.children,m),u=u.child}return u;case 9:return C=u.type,b=u.pendingProps.children,pl(u,m),C=ra(C),b=b(C),u.flags|=1,ur(l,u,b,m),u.child;case 14:return b=u.type,C=_a(b,u.pendingProps),C=_a(b.type,C),iE(l,u,b,C,m);case 15:return oE(l,u,u.type,u.pendingProps,m);case 17:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:_a(b,C),lp(l,u),u.tag=1,wr(b)?(l=!0,Wf(u)):l=!1,pl(u,m),JA(u,b,C),iy(u,b,C,m),uy(null,u,b,!0,l,m);case 19:return mE(l,u,m);case 22:return lE(l,u,m)}throw Error(n(156,u.tag))};function FE(l,u){return ts(l,u)}function i7(l,u,m,b){this.tag=l,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ia(l,u,m,b){return new i7(l,u,m,b)}function Oy(l){return l=l.prototype,!(!l||!l.isReactComponent)}function o7(l){if(typeof l=="function")return Oy(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===H)return 14}return 2}function bi(l,u){var m=l.alternate;return m===null?(m=ia(l.tag,u,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=u,m.type=l.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=l.flags&14680064,m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,u=l.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function xp(l,u,m,b,C,_){var M=2;if(b=l,typeof l=="function")Oy(l)&&(M=1);else if(typeof l=="string")M=5;else e:switch(l){case k:return lo(m.children,C,_,u);case R:M=8,C|=8;break;case D:return l=ia(12,m,u,C|2),l.elementType=D,l.lanes=_,l;case G:return l=ia(13,m,u,C),l.elementType=G,l.lanes=_,l;case q:return l=ia(19,m,u,C),l.elementType=q,l.lanes=_,l;case Z:return bp(m,C,_,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case U:M=10;break e;case z:M=9;break e;case L:M=11;break e;case H:M=14;break e;case X:M=16,b=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=ia(M,m,u,C),u.elementType=l,u.type=b,u.lanes=_,u}function lo(l,u,m,b){return l=ia(7,l,b,u),l.lanes=m,l}function bp(l,u,m,b){return l=ia(22,l,b,u),l.elementType=Z,l.lanes=m,l.stateNode={isHidden:!1},l}function ky(l,u,m){return l=ia(6,l,null,u),l.lanes=m,l}function Ry(l,u,m){return u=ia(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function l7(l,u,m,b,C){this.tag=u,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sg(0),this.expirationTimes=sg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sg(0),this.identifierPrefix=b,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function Ty(l,u,m,b,C,_,M,Y,te){return l=new l7(l,u,m,Y,te),u===1?(u=1,_===!0&&(u|=8)):u=0,_=ia(3,null,null,u),l.current=_,_.stateNode=l,_.memoizedState={element:b,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hg(_),l}function c7(l,u,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:b==null?null:""+b,children:l,containerInfo:u,implementation:m}}function BE(l){if(!l)return di;l=l._reactInternals;e:{if(Tr(l)!==l||l.tag!==1)throw Error(n(170));var u=l;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(wr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(l.tag===1){var m=l.type;if(wr(m))return hA(l,m,u)}return u}function zE(l,u,m,b,C,_,M,Y,te){return l=Ty(m,b,!0,l,C,_,M,Y,te),l.context=BE(null),m=l.current,b=dr(),C=yi(m),_=Es(b,C),_.callback=u??null,hi(m,_,C),l.current.lanes=C,Zc(l,C,b),Nr(l,b),l}function wp(l,u,m,b){var C=u.current,_=dr(),M=yi(C);return m=BE(m),u.context===null?u.context=m:u.pendingContext=m,u=Es(_,M),u.payload={element:l},b=b===void 0?null:b,b!==null&&(u.callback=b),l=hi(C,u,M),l!==null&&(ka(l,C,M,_),Jf(l,C,M)),M}function jp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function UE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function Iy(l,u){UE(l,u),(l=l.alternate)&&UE(l,u)}function u7(){return null}var qE=typeof reportError=="function"?reportError:function(l){console.error(l)};function My(l){this._internalRoot=l}Sp.prototype.render=My.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));wp(l,u,null,null)},Sp.prototype.unmount=My.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;so(function(){wp(null,l,null,null)}),u[js]=null}};function Sp(l){this._internalRoot=l}Sp.prototype.unstable_scheduleHydration=function(l){if(l){var u=AC();l={blockedOn:null,target:l,priority:u};for(var m=0;m<ii.length&&u!==0&&u<ii[m].priority;m++);ii.splice(m,0,l),m===0&&PC(l)}};function $y(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Np(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function WE(){}function d7(l,u,m,b,C){if(C){if(typeof b=="function"){var _=b;b=function(){var me=jp(M);_.call(me)}}var M=zE(u,b,l,0,null,!1,!1,"",WE);return l._reactRootContainer=M,l[js]=M.current,pu(l.nodeType===8?l.parentNode:l),so(),M}for(;C=l.lastChild;)l.removeChild(C);if(typeof b=="function"){var Y=b;b=function(){var me=jp(te);Y.call(me)}}var te=Ty(l,0,!1,null,null,!1,!1,"",WE);return l._reactRootContainer=te,l[js]=te.current,pu(l.nodeType===8?l.parentNode:l),so(function(){wp(u,te,m,b)}),te}function Cp(l,u,m,b,C){var _=m._reactRootContainer;if(_){var M=_;if(typeof C=="function"){var Y=C;C=function(){var te=jp(M);Y.call(te)}}wp(u,M,l,C)}else M=d7(m,u,l,C,b);return jp(M)}NC=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=Ca(u.pendingLanes);m!==0&&(ig(u,m|1),Nr(u,he()),(Rt&6)===0&&(yl=he()+500,fi()))}break;case 13:so(function(){var b=As(l,1);if(b!==null){var C=dr();ka(b,l,1,C)}}),Iy(l,1)}},og=function(l){if(l.tag===13){var u=As(l,134217728);if(u!==null){var m=dr();ka(u,l,134217728,m)}Iy(l,134217728)}},CC=function(l){if(l.tag===13){var u=yi(l),m=As(l,u);if(m!==null){var b=dr();ka(m,l,u,b)}Iy(l,u)}},AC=function(){return Ht},EC=function(l,u){var m=Ht;try{return Ht=l,u()}finally{Ht=m}},_n=function(l,u,m){switch(u){case"input":if(de(l,m),u=m.name,m.type==="radio"&&u!=null){for(m=l;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<m.length;u++){var b=m[u];if(b!==l&&b.form===l.form){var C=Uf(b);if(!C)throw Error(n(90));pe(b),de(b,C)}}}break;case"textarea":Jt(l,m);break;case"select":u=m.value,u!=null&&$e(l,!!m.multiple,u,!1)}},ct=Ey,bt=so;var f7={usingClientEntryPoint:!1,Events:[vu,sl,Uf,ue,Ie,Ey]},Ou={findFiberByHostInstance:Qi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},p7={bundleType:Ou.bundleType,version:Ou.version,rendererPackageName:Ou.rendererPackageName,rendererConfig:Ou.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Xo(l),l===null?null:l.stateNode},findFiberByHostInstance:Ou.findFiberByHostInstance||u7,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 Ap=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ap.isDisabled&&Ap.supportsFiber)try{Ge=Ap.inject(p7),vt=Ap}catch{}}return Cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=f7,Cr.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$y(u))throw Error(n(200));return c7(l,u,null,m)},Cr.createRoot=function(l,u){if(!$y(l))throw Error(n(299));var m=!1,b="",C=qE;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),u=Ty(l,1,!1,null,null,m,!1,b,C),l[js]=u.current,pu(l.nodeType===8?l.parentNode:l),new My(u)},Cr.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=Xo(u),l=l===null?null:l.stateNode,l},Cr.flushSync=function(l){return so(l)},Cr.hydrate=function(l,u,m){if(!Np(u))throw Error(n(200));return Cp(null,l,u,!0,m)},Cr.hydrateRoot=function(l,u,m){if(!$y(l))throw Error(n(405));var b=m!=null&&m.hydratedSources||null,C=!1,_="",M=qE;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(_=m.identifierPrefix),m.onRecoverableError!==void 0&&(M=m.onRecoverableError)),u=zE(u,null,l,1,m??null,C,!1,_,M),l[js]=u.current,pu(l),b)for(l=0;l<b.length;l++)m=b[l],C=m._getVersion,C=C(m._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[m,C]:u.mutableSourceEagerHydrationData.push(m,C);return new Sp(u)},Cr.render=function(l,u,m){if(!Np(u))throw Error(n(200));return Cp(null,l,u,!1,m)},Cr.unmountComponentAtNode=function(l){if(!Np(l))throw Error(n(40));return l._reactRootContainer?(so(function(){Cp(null,null,l,!1,function(){l._reactRootContainer=null,l[js]=null})}),!0):!1},Cr.unstable_batchedUpdates=Ey,Cr.unstable_renderSubtreeIntoContainer=function(l,u,m,b){if(!Np(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Cp(l,u,m,!1,b)},Cr.version="18.3.1-next-f1338f8080-20240426",Cr}var JE;function OM(){if(JE)return Fy.exports;JE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Fy.exports=w7(),Fy.exports}var ZE;function j7(){if(ZE)return _p;ZE=1;var e=OM();return _p.createRoot=e.createRoot,_p.hydrateRoot=e.hydrateRoot,_p}var S7=j7(),v=bS();const W=Yt(v),Am=m7({__proto__:null,default:W},[v]),N7=1,C7=1e6;let Uy=0;function A7(){return Uy=(Uy+1)%Number.MAX_SAFE_INTEGER,Uy.toString()}const qy=new Map,e_=e=>{if(qy.has(e))return;const t=setTimeout(()=>{qy.delete(e),Ju({type:"REMOVE_TOAST",toastId:e})},C7);qy.set(e,t)},E7=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,N7)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?e_(n):e.toasts.forEach(r=>{e_(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Zp=[];let eh={toasts:[]};function Ju(e){eh=E7(eh,e),Zp.forEach(t=>{t(eh)})}function Oe({...e}){const t=A7(),n=a=>Ju({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Ju({type:"DISMISS_TOAST",toastId:t});return Ju({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function _7(){const[e,t]=v.useState(eh);return v.useEffect(()=>(Zp.push(t),()=>{const n=Zp.indexOf(t);n>-1&&Zp.splice(n,1)}),[e]),{...e,toast:Oe,dismiss:n=>Ju({type:"DISMISS_TOAST",toastId:n})}}var Pc=OM();const kM=Yt(Pc);function Pe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function t_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=t_(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():t_(e[a],null)}}}}function pt(...e){return v.useCallback(vr(...e),e)}function P7(e,t){const n=v.createContext(t),r=i=>{const{children:o,...c}=i,d=v.useMemo(()=>c,Object.values(c));return s.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function a(i){const o=v.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function er(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:g,children:y,...j}=p,w=g?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(w.Provider,{value:x,children:y})};f.displayName=i+"Provider";function h(p,g){const y=g?.[e]?.[d]||c,j=v.useContext(y);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>v.createContext(o));return function(c){const d=c?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,O7(a,...t)]}function O7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function n_(e){const t=k7(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(T7);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function k7(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=M7(a),c=I7(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var R7=Symbol("radix.slottable");function T7(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===R7}function I7(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function M7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Zd(e){const t=e+"CollectionProvider",[n,r]=er(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:x,children:S}=w,N=W.useRef(null),A=W.useRef(new Map).current;return s.jsx(a,{scope:x,itemMap:A,collectionRef:N,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=n_(c),f=W.forwardRef((w,x)=>{const{scope:S,children:N}=w,A=i(c,S),P=pt(x,A.collectionRef);return s.jsx(d,{ref:P,children:N})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=n_(h),y=W.forwardRef((w,x)=>{const{scope:S,children:N,...A}=w,P=W.useRef(null),E=pt(x,P),O=i(h,S);return W.useEffect(()=>(O.itemMap.set(P,{ref:P,...A}),()=>{O.itemMap.delete(P)})),s.jsx(g,{[p]:"",ref:E,children:N})});y.displayName=h;function j(w){const x=i(e+"CollectionConsumer",w);return W.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const A=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((O,k)=>A.indexOf(O.ref.current)-A.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:f,ItemSlot:y},j,r]}function $7(e){const t=D7(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(F7);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function D7(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=z7(a),c=B7(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var L7=Symbol("radix.slottable");function F7(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===L7}function B7(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function z7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var U7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=U7.reduce((e,t)=>{const n=$7(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wS(e,t){e&&Pc.flushSync(()=>e.dispatchEvent(t))}function Cn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function q7(e,t=globalThis?.document){const n=Cn(e);v.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var W7="DismissableLayer",p1="dismissableLayer.update",V7="dismissableLayer.pointerDownOutside",H7="dismissableLayer.focusOutside",r_,RM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Do=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(RM),[h,p]=v.useState(null),g=h?.ownerDocument??globalThis?.document,[,y]=v.useState({}),j=pt(t,k=>p(k)),w=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(x),N=h?w.indexOf(h):-1,A=f.layersWithOutsidePointerEventsDisabled.size>0,P=N>=S,E=G7(k=>{const R=k.target,D=[...f.branches].some(U=>U.contains(R));!P||D||(a?.(k),o?.(k),k.defaultPrevented||c?.())},g),O=Y7(k=>{const R=k.target;[...f.branches].some(U=>U.contains(R))||(i?.(k),o?.(k),k.defaultPrevented||c?.())},g);return q7(k=>{N===f.layers.size-1&&(r?.(k),!k.defaultPrevented&&c&&(k.preventDefault(),c()))},g),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(r_=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),a_(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=r_)}},[h,g,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),a_())},[h,f]),v.useEffect(()=>{const k=()=>y({});return document.addEventListener(p1,k),()=>document.removeEventListener(p1,k)},[]),s.jsx(qe.div,{...d,ref:j,style:{pointerEvents:A?P?"auto":"none":void 0,...e.style},onFocusCapture:Pe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Pe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Pe(e.onPointerDownCapture,E.onPointerDownCapture)})});Do.displayName=W7;var K7="DismissableLayerBranch",TM=v.forwardRef((e,t)=>{const n=v.useContext(RM),r=v.useRef(null),a=pt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(qe.div,{...e,ref:a})});TM.displayName=K7;function G7(e,t=globalThis?.document){const n=Cn(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){IM(V7,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Y7(e,t=globalThis?.document){const n=Cn(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&IM(H7,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function a_(){const e=new CustomEvent(p1);document.dispatchEvent(e)}function IM(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?wS(a,i):a.dispatchEvent(i)}var X7=Do,Q7=TM,zn=globalThis?.document?v.useLayoutEffect:()=>{},J7="Portal",Oc=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=v.useState(!1);zn(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?kM.createPortal(s.jsx(qe.div,{...r,ref:t}),o):null});Oc.displayName=J7;function Z7(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Un=e=>{const{present:t,children:n}=e,r=eU(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=pt(r.ref,tU(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};Un.displayName="Presence";function eU(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=Z7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Pp(r.current);i.current=c==="mounted"?f:"none"},[c]),zn(()=>{const f=r.current,h=a.current;if(h!==e){const g=i.current,y=Pp(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&g!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),zn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=y=>{const w=Pp(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(d("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=y=>{y.target===t&&(i.current=Pp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Pp(e){return e?.animationName||"none"}function tU(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var nU=Am[" useInsertionEffect ".trim().toString()]||zn;function Zr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=rU({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:a;{const h=v.useRef(e!==void 0);v.useEffect(()=>{const p=h.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=c},[c,r])}const f=v.useCallback(h=>{if(c){const p=aU(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function rU({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return nU(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function aU(e){return typeof e=="function"}var MM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sU="VisuallyHidden",Em=v.forwardRef((e,t)=>s.jsx(qe.span,{...e,ref:t,style:{...MM,...e.style}}));Em.displayName=sU;var iU=Em,jS="ToastProvider",[SS,oU,lU]=Zd("Toast"),[$M]=er("Toast",[lU]),[cU,_m]=$M(jS),DM=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[c,d]=v.useState(null),[f,h]=v.useState(0),p=v.useRef(!1),g=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${jS}\`. Expected non-empty \`string\`.`),s.jsx(SS.Provider,{scope:t,children:s.jsx(cU,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:v.useCallback(()=>h(y=>y+1),[]),onToastRemove:v.useCallback(()=>h(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:o})})};DM.displayName=jS;var LM="ToastViewport",uU=["F8"],h1="toast.viewportPause",m1="toast.viewportResume",FM=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=uU,label:a="Notifications ({hotkey})",...i}=e,o=_m(LM,n),c=oU(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),g=pt(t,p,o.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;v.useEffect(()=>{const x=S=>{r.length!==0&&r.every(A=>S[A]||S.code===A)&&p.current?.focus()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),v.useEffect(()=>{const x=d.current,S=p.current;if(j&&x&&S){const N=()=>{if(!o.isClosePausedRef.current){const O=new CustomEvent(h1);S.dispatchEvent(O),o.isClosePausedRef.current=!0}},A=()=>{if(o.isClosePausedRef.current){const O=new CustomEvent(m1);S.dispatchEvent(O),o.isClosePausedRef.current=!1}},P=O=>{!x.contains(O.relatedTarget)&&A()},E=()=>{x.contains(document.activeElement)||A()};return x.addEventListener("focusin",N),x.addEventListener("focusout",P),x.addEventListener("pointermove",N),x.addEventListener("pointerleave",E),window.addEventListener("blur",N),window.addEventListener("focus",A),()=>{x.removeEventListener("focusin",N),x.removeEventListener("focusout",P),x.removeEventListener("pointermove",N),x.removeEventListener("pointerleave",E),window.removeEventListener("blur",N),window.removeEventListener("focus",A)}}},[j,o.isClosePausedRef]);const w=v.useCallback(({tabbingDirection:x})=>{const N=c().map(A=>{const P=A.ref.current,E=[P,...SU(P)];return x==="forwards"?E:E.reverse()});return(x==="forwards"?N.reverse():N).flat()},[c]);return v.useEffect(()=>{const x=p.current;if(x){const S=N=>{const A=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!A){const E=document.activeElement,O=N.shiftKey;if(N.target===x&&O){f.current?.focus();return}const D=w({tabbingDirection:O?"backwards":"forwards"}),U=D.findIndex(z=>z===E);Wy(D.slice(U+1))?N.preventDefault():O?f.current?.focus():h.current?.focus()}};return x.addEventListener("keydown",S),()=>x.removeEventListener("keydown",S)}},[c,w]),s.jsxs(Q7,{ref:d,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(v1,{ref:f,onFocusFromOutsideViewport:()=>{const x=w({tabbingDirection:"forwards"});Wy(x)}}),s.jsx(SS.Slot,{scope:n,children:s.jsx(qe.ol,{tabIndex:-1,...i,ref:g})}),j&&s.jsx(v1,{ref:h,onFocusFromOutsideViewport:()=>{const x=w({tabbingDirection:"backwards"});Wy(x)}})]})});FM.displayName=LM;var BM="ToastFocusProxy",v1=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=_m(BM,n);return s.jsx(Em,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});v1.displayName=BM;var ef="Toast",dU="toast.swipeStart",fU="toast.swipeMove",pU="toast.swipeCancel",hU="toast.swipeEnd",zM=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=Zr({prop:r,defaultProp:a??!0,onChange:i,caller:ef});return s.jsx(Un,{present:n||c,children:s.jsx(gU,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Cn(e.onPause),onResume:Cn(e.onResume),onSwipeStart:Pe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Pe(e.onSwipeMove,f=>{const{x:h,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:Pe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Pe(e.onSwipeEnd,f=>{const{x:h,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});zM.displayName=ef;var[mU,vU]=$M(ef,{onClose(){}}),gU=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:c,onPause:d,onResume:f,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:y,...j}=e,w=_m(ef,n),[x,S]=v.useState(null),N=pt(t,q=>S(q)),A=v.useRef(null),P=v.useRef(null),E=a||w.duration,O=v.useRef(0),k=v.useRef(E),R=v.useRef(0),{onToastAdd:D,onToastRemove:U}=w,z=Cn(()=>{x?.contains(document.activeElement)&&w.viewport?.focus(),o()}),L=v.useCallback(q=>{!q||q===1/0||(window.clearTimeout(R.current),O.current=new Date().getTime(),R.current=window.setTimeout(z,q))},[z]);v.useEffect(()=>{const q=w.viewport;if(q){const H=()=>{L(k.current),f?.()},X=()=>{const Z=new Date().getTime()-O.current;k.current=k.current-Z,window.clearTimeout(R.current),d?.()};return q.addEventListener(h1,X),q.addEventListener(m1,H),()=>{q.removeEventListener(h1,X),q.removeEventListener(m1,H)}}},[w.viewport,E,d,f,L]),v.useEffect(()=>{i&&!w.isClosePausedRef.current&&L(E)},[i,E,w.isClosePausedRef,L]),v.useEffect(()=>(D(),()=>U()),[D,U]);const G=v.useMemo(()=>x?GM(x):null,[x]);return w.viewport?s.jsxs(s.Fragment,{children:[G&&s.jsx(yU,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:G}),s.jsx(mU,{scope:n,onClose:z,children:Pc.createPortal(s.jsx(SS.ItemSlot,{scope:n,children:s.jsx(X7,{asChild:!0,onEscapeKeyDown:Pe(c,()=>{w.isFocusedToastEscapeKeyDownRef.current||z(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(qe.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":w.swipeDirection,...j,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Pe(e.onKeyDown,q=>{q.key==="Escape"&&(c?.(q.nativeEvent),q.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:Pe(e.onPointerDown,q=>{q.button===0&&(A.current={x:q.clientX,y:q.clientY})}),onPointerMove:Pe(e.onPointerMove,q=>{if(!A.current)return;const H=q.clientX-A.current.x,X=q.clientY-A.current.y,Z=!!P.current,I=["left","right"].includes(w.swipeDirection),F=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,Q=I?F(0,H):0,B=I?0:F(0,X),$=q.pointerType==="touch"?10:2,ee={x:Q,y:B},V={originalEvent:q,delta:ee};Z?(P.current=ee,Op(fU,p,V,{discrete:!1})):s_(ee,w.swipeDirection,$)?(P.current=ee,Op(dU,h,V,{discrete:!1}),q.target.setPointerCapture(q.pointerId)):(Math.abs(H)>$||Math.abs(X)>$)&&(A.current=null)}),onPointerUp:Pe(e.onPointerUp,q=>{const H=P.current,X=q.target;if(X.hasPointerCapture(q.pointerId)&&X.releasePointerCapture(q.pointerId),P.current=null,A.current=null,H){const Z=q.currentTarget,I={originalEvent:q,delta:H};s_(H,w.swipeDirection,w.swipeThreshold)?Op(hU,y,I,{discrete:!0}):Op(pU,g,I,{discrete:!0}),Z.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),yU=e=>{const{__scopeToast:t,children:n,...r}=e,a=_m(ef,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return wU(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Oc,{asChild:!0,children:s.jsx(Em,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},xU="ToastTitle",UM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});UM.displayName=xU;var bU="ToastDescription",qM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});qM.displayName=bU;var WM="ToastAction",VM=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(KM,{altText:n,asChild:!0,children:s.jsx(NS,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${WM}\`. Expected non-empty \`string\`.`),null)});VM.displayName=WM;var HM="ToastClose",NS=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=vU(HM,n);return s.jsx(KM,{asChild:!0,children:s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,a.onClose)})})});NS.displayName=HM;var KM=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(qe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function GM(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),jU(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...GM(r))}}),t}function Op(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?wS(a,i):a.dispatchEvent(i)}var s_=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function wU(e=()=>{}){const t=Cn(e);zn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function jU(e){return e.nodeType===e.ELEMENT_NODE}function SU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Wy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var NU=DM,YM=FM,XM=zM,QM=UM,JM=qM,ZM=VM,e$=NS;function t$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=t$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function St(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=t$(e))&&(r&&(r+=" "),r+=t);return r}const i_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,o_=St,Lo=(e,t)=>n=>{var r;if(t?.variants==null)return o_(e,n?.class,n?.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(f=>{const h=n?.[f],p=i?.[f];if(h===null)return null;const g=i_(h)||i_(p);return a[f][g]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,g]=h;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:g,...y}=h;return Object.entries(y).every(j=>{let[w,x]=j;return Array.isArray(x)?x.includes({...i,...c}[w]):{...i,...c}[w]===x})?[...f,p,g]:f},[]);return o_(e,o,d,n?.class,n?.className)};const CU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),n$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var AU={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const EU=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...c},d)=>v.createElement("svg",{ref:d,...AU,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:n$("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const ot=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(EU,{ref:i,iconNode:t,className:n$(`lucide-${CU(e)}`,r),...a}));return n.displayName=`${e}`,n};const r$=ot("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const _U=ot("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);const No=ot("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const fa=ot("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const ld=ot("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);const Ql=ot("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const It=ot("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const a$=ot("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const Fa=ot("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const $l=ot("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const Vy=ot("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Dl=ot("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const PU=ot("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const th=ot("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const OU=ot("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Pm=ot("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ii=ot("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const s$=ot("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const ma=ot("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const Om=ot("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const oh=ot("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const kU=ot("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const i$=ot("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);const l_=ot("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const o$=ot("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);const CS=ot("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);const RU=ot("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);const g1=ot("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);const l$=ot("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);const TU=ot("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);const Zn=ot("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const c$=ot("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);const IU=ot("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const u$=ot("NotebookTabs",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M15 2v20",key:"dcj49h"}],["path",{d:"M15 7h5",key:"1xj5lc"}],["path",{d:"M15 12h5",key:"w5shd9"}],["path",{d:"M15 17h5",key:"1qaofu"}]]);const lh=ot("NotepadText",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]]);const MU=ot("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const c_=ot("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const u_=ot("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);const km=ot("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Ll=ot("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Ba=ot("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const d$=ot("RectangleEllipsis",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]);const za=ot("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const $U=ot("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const AS=ot("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const f$=ot("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const d_=ot("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const ES=ot("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const ua=ot("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const y1=ot("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const p$=ot("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);const _r=ot("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const nh=ot("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const DU=ot("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const _S=ot("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const h$=ot("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const Ms=ot("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const Mi=ot("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),PS="-",LU=e=>{const t=BU(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(PS);return c[0]===""&&c.length!==1&&c.shift(),m$(c,t)||FU(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},m$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?m$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(PS);return t.validators.find(({validator:o})=>o(i))?.classGroupId},f_=/^\[(.+)\]$/,FU=e=>{if(f_.test(e)){const t=f_.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},BU=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return UU(Object.entries(e.classGroups),n).forEach(([i,o])=>{x1(o,r,i,t)}),r},x1=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:p_(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(zU(a)){x1(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{x1(o,p_(t,i),n,r)})})},p_=(e,t)=>{let n=e;return t.split(PS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},zU=e=>e.isThemeGetter,UU=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,c])=>[t+o,c])):i);return[n,a]}):e,qU=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},v$="!",WU=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=c=>{const d=[];let f=0,h=0,p;for(let x=0;x<c.length;x++){let S=c[x];if(f===0){if(S===a&&(r||c.slice(x,x+i)===t)){d.push(c.slice(h,x)),h=x+i;continue}if(S==="/"){p=x;continue}}S==="["?f++:S==="]"&&f--}const g=d.length===0?c:c.substring(h),y=g.startsWith(v$),j=y?g.substring(1):g,w=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:y,baseClassName:j,maybePostfixModifierPosition:w}};return n?c=>n({className:c,parseClassName:o}):o},VU=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},HU=e=>({cache:qU(e.cacheSize),parseClassName:WU(e),...LU(e)}),KU=/\s+/,GU=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(KU);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}=n(f);let j=!!y,w=r(j?g.substring(0,y):g);if(!w){if(!j){c=f+(c.length>0?" "+c:c);continue}if(w=r(g),!w){c=f+(c.length>0?" "+c:c);continue}j=!1}const x=VU(h).join(":"),S=p?x+v$:x,N=S+w;if(i.includes(N))continue;i.push(N);const A=a(w,j);for(let P=0;P<A.length;++P){const E=A[P];i.push(S+E)}c=f+(c.length>0?" "+c:c)}return c};function YU(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=g$(t))&&(r&&(r+=" "),r+=n);return r}const g$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=g$(e[r]))&&(n&&(n+=" "),n+=t);return n};function XU(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=HU(f),r=n.cache.get,a=n.cache.set,i=c,c(d)}function c(d){const f=r(d);if(f)return f;const h=GU(d,n);return a(d,h),h}return function(){return i(YU.apply(null,arguments))}}const fn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},y$=/^\[(?:([a-z-]+):)?(.+)\]$/i,QU=/^\d+\/\d+$/,JU=new Set(["px","full","screen"]),ZU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eq=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Os=e=>Fl(e)||JU.has(e)||QU.test(e),ji=e=>kc(e,"length",dq),Fl=e=>!!e&&!Number.isNaN(Number(e)),Hy=e=>kc(e,"number",Fl),Ru=e=>!!e&&Number.isInteger(Number(e)),aq=e=>e.endsWith("%")&&Fl(e.slice(0,-1)),Nt=e=>y$.test(e),Si=e=>ZU.test(e),sq=new Set(["length","size","percentage"]),iq=e=>kc(e,sq,x$),oq=e=>kc(e,"position",x$),lq=new Set(["image","url"]),cq=e=>kc(e,lq,pq),uq=e=>kc(e,"",fq),Tu=()=>!0,kc=(e,t,n)=>{const r=y$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},dq=e=>eq.test(e)&&!tq.test(e),x$=()=>!1,fq=e=>nq.test(e),pq=e=>rq.test(e),hq=()=>{const e=fn("colors"),t=fn("spacing"),n=fn("blur"),r=fn("brightness"),a=fn("borderColor"),i=fn("borderRadius"),o=fn("borderSpacing"),c=fn("borderWidth"),d=fn("contrast"),f=fn("grayscale"),h=fn("hueRotate"),p=fn("invert"),g=fn("gap"),y=fn("gradientColorStops"),j=fn("gradientColorStopPositions"),w=fn("inset"),x=fn("margin"),S=fn("opacity"),N=fn("padding"),A=fn("saturate"),P=fn("scale"),E=fn("sepia"),O=fn("skew"),k=fn("space"),R=fn("translate"),D=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",Nt,t],L=()=>[Nt,t],G=()=>["",Os,ji],q=()=>["auto",Fl,Nt],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",Nt],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Fl,Nt];return{cacheSize:500,separator:":",theme:{colors:[Tu],spacing:[Os,ji],blur:["none","",Si,Nt],brightness:B(),borderColor:[e],borderRadius:["none","","full",Si,Nt],borderSpacing:L(),borderWidth:G(),contrast:B(),grayscale:F(),hueRotate:B(),invert:F(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[aq,ji],inset:z(),margin:z(),opacity:B(),padding:L(),saturate:B(),scale:B(),sepia:F(),skew:B(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Nt]}],container:["container"],columns:[{columns:[Si]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),Nt]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ru,Nt]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Nt]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Ru,Nt]}],"grid-cols":[{"grid-cols":[Tu]}],"col-start-end":[{col:["auto",{span:["full",Ru,Nt]},Nt]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[Tu]}],"row-start-end":[{row:["auto",{span:[Ru,Nt]},Nt]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Nt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Nt]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Nt,t]}],"min-w":[{"min-w":[Nt,t,"min","max","fit"]}],"max-w":[{"max-w":[Nt,t,"none","full","min","max","fit","prose",{screen:[Si]},Si]}],h:[{h:[Nt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Nt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Nt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Nt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Si,ji]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hy]}],"font-family":[{font:[Tu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Nt]}],"line-clamp":[{"line-clamp":["none",Fl,Hy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Os,Nt]}],"list-image":[{"list-image":["none",Nt]}],"list-style-type":[{list:["none","disc","decimal",Nt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Os,ji]}],"underline-offset":[{"underline-offset":["auto",Os,Nt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Nt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),oq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",iq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},cq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:X()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[Os,Nt]}],"outline-w":[{outline:[Os,ji]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Os,ji]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Si,uq]}],"shadow-color":[{shadow:[Tu]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Si,Nt]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[A]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Nt]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Nt]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Nt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Ru,Nt]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Nt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Nt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Nt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Os,ji,Hy]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},mq=XU(hq);function Se(...e){return mq(St(e))}const vq=NU,b$=v.forwardRef(({className:e,...t},n)=>s.jsx(YM,{ref:n,className:Se("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));b$.displayName=YM.displayName;const gq=Lo("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),w$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(XM,{ref:r,className:Se(gq({variant:t}),e),...n}));w$.displayName=XM.displayName;const yq=v.forwardRef(({className:e,...t},n)=>s.jsx(ZM,{ref:n,className:Se("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));yq.displayName=ZM.displayName;const j$=v.forwardRef(({className:e,...t},n)=>s.jsx(e$,{ref:n,className:Se("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(Mi,{className:"h-4 w-4"})}));j$.displayName=e$.displayName;const S$=v.forwardRef(({className:e,...t},n)=>s.jsx(QM,{ref:n,className:Se("text-sm font-semibold",e),...t}));S$.displayName=QM.displayName;const N$=v.forwardRef(({className:e,...t},n)=>s.jsx(JM,{ref:n,className:Se("text-sm opacity-90",e),...t}));N$.displayName=JM.displayName;function xq(){const{toasts:e}=_7();return s.jsxs(vq,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(w$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(S$,{children:n}),r&&s.jsx(N$,{children:r})]}),a,s.jsx(j$,{})]},t)}),s.jsx(b$,{})]})}var h_=["light","dark"],bq="(prefers-color-scheme: dark)",wq=v.createContext(void 0),jq={setTheme:e=>{},themes:[]},Sq=()=>{var e;return(e=v.useContext(wq))!=null?e:jq};v.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:o,attrs:c,nonce:d})=>{let f=i==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(j=>`'${j}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=a?h_.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",g=(j,w=!1,x=!0)=>{let S=o?o[j]:j,N=w?j+"|| ''":`'${S}'`,A="";return a&&x&&!w&&h_.includes(j)&&(A+=`d.style.colorScheme = '${j}';`),n==="class"?w||S?A+=`c.add(${N})`:A+="null":S&&(A+=`d[s](n,${N})`),A},y=e?`!function(){${h}${g(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${bq}',m=window.matchMedia(t);if(m.media!==t||m.matches){${g("dark")}}else{${g("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${g(o?"x[e]":"e",!0)}}${f?"":"else{"+g(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${g(o?"x[e]":"e",!0)}}else{${g(i,!1,!1)};}${p}}catch(t){}}();`;return v.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:y}})});var Nq=e=>{switch(e){case"success":return Eq;case"info":return Pq;case"warning":return _q;case"error":return Oq;default:return null}},Cq=Array(12).fill(0),Aq=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},Cq.map((n,r)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Eq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),_q=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Pq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Oq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),kq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Rq=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},b1=1,Tq=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:b1++,i=this.toasts.find(c=>c.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:o,title:n}):c):this.addToast({title:n,...r,dismissible:o,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,o=r.then(async d=>{if(i=["resolve",d],W.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Mq(d)&&!d.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${d.status}`):t.error,h=typeof t.description=="function"?await t.description(`HTTP error! status: ${d.status}`):t.description;this.create({id:n,type:"error",message:f,description:h})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(d):t.success,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"success",message:f,description:h})}}).catch(async d=>{if(i=["reject",d],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(d):t.error,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"error",message:f,description:h})}}).finally(()=>{var d;a&&(this.dismiss(n),n=void 0),(d=t.finally)==null||d.call(t)}),c=()=>new Promise((d,f)=>o.then(()=>i[0]==="reject"?f(i[1]):d(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||b1++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ar=new Tq,Iq=(e,t)=>{let n=t?.id||b1++;return Ar.addToast({title:e,...t,id:n}),n},Mq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",$q=Iq,Dq=()=>Ar.toasts,Lq=()=>Ar.getActiveToasts();Object.assign($q,{success:Ar.success,info:Ar.info,warning:Ar.warning,error:Ar.error,custom:Ar.custom,message:Ar.message,promise:Ar.promise,dismiss:Ar.dismiss,loading:Ar.loading},{getHistory:Dq,getToasts:Lq});function Fq(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Fq(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
9
|
-
`);function kp(e){return e.label!==void 0}var Bq=3,zq="32px",Uq="16px",m_=4e3,qq=356,Wq=14,Vq=20,Hq=200;function Ra(...e){return e.filter(Boolean).join(" ")}function Kq(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Gq=e=>{var t,n,r,a,i,o,c,d,f,h,p;let{invert:g,toast:y,unstyled:j,interacting:w,setHeights:x,visibleToasts:S,heights:N,index:A,toasts:P,expanded:E,removeToast:O,defaultRichColors:k,closeButton:R,style:D,cancelButtonStyle:U,actionButtonStyle:z,className:L="",descriptionClassName:G="",duration:q,position:H,gap:X,loadingIcon:Z,expandByDefault:I,classNames:F,icons:Q,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:$}=e,[ee,V]=W.useState(null),[J,ge]=W.useState(null),[ie,ce]=W.useState(!1),[oe,xe]=W.useState(!1),[ke,pe]=W.useState(!1),[ve,Ce]=W.useState(!1),[Le,se]=W.useState(!1),[de,Ne]=W.useState(0),[Fe,je]=W.useState(0),$e=W.useRef(y.duration||q||m_),et=W.useRef(null),xt=W.useRef(null),Jt=A===0,ye=A+1<=S,We=y.type,Ye=y.dismissible!==!1,Ot=y.className||"",Dt=y.descriptionClassName||"",kt=W.useMemo(()=>N.findIndex(Ie=>Ie.toastId===y.id)||0,[N,y.id]),Zt=W.useMemo(()=>{var Ie;return(Ie=y.closeButton)!=null?Ie:R},[y.closeButton,R]),Sn=W.useMemo(()=>y.duration||q||m_,[y.duration,q]),tr=W.useRef(0),nr=W.useRef(0),wa=W.useRef(0),En=W.useRef(null),[kr,Rr]=H.split("-"),yr=W.useMemo(()=>N.reduce((Ie,ct,bt)=>bt>=kt?Ie:Ie+ct.height,0),[N,kt]),_n=Rq(),Rn=y.invert||g,xn=We==="loading";nr.current=W.useMemo(()=>kt*X+yr,[kt,yr]),W.useEffect(()=>{$e.current=Sn},[Sn]),W.useEffect(()=>{ce(!0)},[]),W.useEffect(()=>{let Ie=xt.current;if(Ie){let ct=Ie.getBoundingClientRect().height;return je(ct),x(bt=>[{toastId:y.id,height:ct,position:y.position},...bt]),()=>x(bt=>bt.filter(Wt=>Wt.toastId!==y.id))}},[x,y.id]),W.useLayoutEffect(()=>{if(!ie)return;let Ie=xt.current,ct=Ie.style.height;Ie.style.height="auto";let bt=Ie.getBoundingClientRect().height;Ie.style.height=ct,je(bt),x(Wt=>Wt.find(ln=>ln.toastId===y.id)?Wt.map(ln=>ln.toastId===y.id?{...ln,height:bt}:ln):[{toastId:y.id,height:bt,position:y.position},...Wt])},[ie,y.title,y.description,x,y.id]);let Tn=W.useCallback(()=>{xe(!0),Ne(nr.current),x(Ie=>Ie.filter(ct=>ct.toastId!==y.id)),setTimeout(()=>{O(y)},Hq)},[y,O,x,nr]);W.useEffect(()=>{if(y.promise&&We==="loading"||y.duration===1/0||y.type==="loading")return;let Ie;return E||w||$&&_n?(()=>{if(wa.current<tr.current){let ct=new Date().getTime()-tr.current;$e.current=$e.current-ct}wa.current=new Date().getTime()})():$e.current!==1/0&&(tr.current=new Date().getTime(),Ie=setTimeout(()=>{var ct;(ct=y.onAutoClose)==null||ct.call(y,y),Tn()},$e.current)),()=>clearTimeout(Ie)},[E,w,y,We,$,_n,Tn]),W.useEffect(()=>{y.delete&&Tn()},[Tn,y.delete]);function ue(){var Ie,ct,bt;return Q!=null&&Q.loading?W.createElement("div",{className:Ra(F?.loader,(Ie=y?.classNames)==null?void 0:Ie.loader,"sonner-loader"),"data-visible":We==="loading"},Q.loading):Z?W.createElement("div",{className:Ra(F?.loader,(ct=y?.classNames)==null?void 0:ct.loader,"sonner-loader"),"data-visible":We==="loading"},Z):W.createElement(Aq,{className:Ra(F?.loader,(bt=y?.classNames)==null?void 0:bt.loader),visible:We==="loading"})}return W.createElement("li",{tabIndex:0,ref:xt,className:Ra(L,Ot,F?.toast,(t=y?.classNames)==null?void 0:t.toast,F?.default,F?.[We],(n=y?.classNames)==null?void 0:n[We]),"data-sonner-toast":"","data-rich-colors":(r=y.richColors)!=null?r:k,"data-styled":!(y.jsx||y.unstyled||j),"data-mounted":ie,"data-promise":!!y.promise,"data-swiped":Le,"data-removed":oe,"data-visible":ye,"data-y-position":kr,"data-x-position":Rr,"data-index":A,"data-front":Jt,"data-swiping":ke,"data-dismissible":Ye,"data-type":We,"data-invert":Rn,"data-swipe-out":ve,"data-swipe-direction":J,"data-expanded":!!(E||I&&ie),style:{"--index":A,"--toasts-before":A,"--z-index":P.length-A,"--offset":`${oe?de:nr.current}px`,"--initial-height":I?"auto":`${Fe}px`,...D,...y.style},onDragEnd:()=>{pe(!1),V(null),En.current=null},onPointerDown:Ie=>{xn||!Ye||(et.current=new Date,Ne(nr.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(pe(!0),En.current={x:Ie.clientX,y:Ie.clientY}))},onPointerUp:()=>{var Ie,ct,bt,Wt;if(ve||!Ye)return;En.current=null;let ln=Number(((Ie=xt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Pt=Number(((ct=xt.current)==null?void 0:ct.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),rr=new Date().getTime()-((bt=et.current)==null?void 0:bt.getTime()),cn=ee==="x"?ln:Pt,Xt=Math.abs(cn)/rr;if(Math.abs(cn)>=Vq||Xt>.11){Ne(nr.current),(Wt=y.onDismiss)==null||Wt.call(y,y),ge(ee==="x"?ln>0?"right":"left":Pt>0?"down":"up"),Tn(),Ce(!0),se(!1);return}pe(!1),V(null)},onPointerMove:Ie=>{var ct,bt,Wt,ln;if(!En.current||!Ye||((ct=window.getSelection())==null?void 0:ct.toString().length)>0)return;let Pt=Ie.clientY-En.current.y,rr=Ie.clientX-En.current.x,cn=(bt=e.swipeDirections)!=null?bt:Kq(H);!ee&&(Math.abs(rr)>1||Math.abs(Pt)>1)&&V(Math.abs(rr)>Math.abs(Pt)?"x":"y");let Xt={x:0,y:0};ee==="y"?(cn.includes("top")||cn.includes("bottom"))&&(cn.includes("top")&&Pt<0||cn.includes("bottom")&&Pt>0)&&(Xt.y=Pt):ee==="x"&&(cn.includes("left")||cn.includes("right"))&&(cn.includes("left")&&rr<0||cn.includes("right")&&rr>0)&&(Xt.x=rr),(Math.abs(Xt.x)>0||Math.abs(Xt.y)>0)&&se(!0),(Wt=xt.current)==null||Wt.style.setProperty("--swipe-amount-x",`${Xt.x}px`),(ln=xt.current)==null||ln.style.setProperty("--swipe-amount-y",`${Xt.y}px`)}},Zt&&!y.jsx?W.createElement("button",{"aria-label":B,"data-disabled":xn,"data-close-button":!0,onClick:xn||!Ye?()=>{}:()=>{var Ie;Tn(),(Ie=y.onDismiss)==null||Ie.call(y,y)},className:Ra(F?.closeButton,(a=y?.classNames)==null?void 0:a.closeButton)},(i=Q?.close)!=null?i:kq):null,y.jsx||v.isValidElement(y.title)?y.jsx?y.jsx:typeof y.title=="function"?y.title():y.title:W.createElement(W.Fragment,null,We||y.icon||y.promise?W.createElement("div",{"data-icon":"",className:Ra(F?.icon,(o=y?.classNames)==null?void 0:o.icon)},y.promise||y.type==="loading"&&!y.icon?y.icon||ue():null,y.type!=="loading"?y.icon||Q?.[We]||Nq(We):null):null,W.createElement("div",{"data-content":"",className:Ra(F?.content,(c=y?.classNames)==null?void 0:c.content)},W.createElement("div",{"data-title":"",className:Ra(F?.title,(d=y?.classNames)==null?void 0:d.title)},typeof y.title=="function"?y.title():y.title),y.description?W.createElement("div",{"data-description":"",className:Ra(G,Dt,F?.description,(f=y?.classNames)==null?void 0:f.description)},typeof y.description=="function"?y.description():y.description):null),v.isValidElement(y.cancel)?y.cancel:y.cancel&&kp(y.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:y.cancelButtonStyle||U,onClick:Ie=>{var ct,bt;kp(y.cancel)&&Ye&&((bt=(ct=y.cancel).onClick)==null||bt.call(ct,Ie),Tn())},className:Ra(F?.cancelButton,(h=y?.classNames)==null?void 0:h.cancelButton)},y.cancel.label):null,v.isValidElement(y.action)?y.action:y.action&&kp(y.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:y.actionButtonStyle||z,onClick:Ie=>{var ct,bt;kp(y.action)&&((bt=(ct=y.action).onClick)==null||bt.call(ct,Ie),!Ie.defaultPrevented&&Tn())},className:Ra(F?.actionButton,(p=y?.classNames)==null?void 0:p.actionButton)},y.action.label):null))};function v_(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Yq(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?Uq:zq;function d(f){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${o}-${f}`]=c:n[`${o}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}var Xq=v.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:c,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:g,style:y,visibleToasts:j=Bq,toastOptions:w,dir:x=v_(),gap:S=Wq,loadingIcon:N,icons:A,containerAriaLabel:P="Notifications",pauseWhenPageIsHidden:E}=e,[O,k]=W.useState([]),R=W.useMemo(()=>Array.from(new Set([r].concat(O.filter($=>$.position).map($=>$.position)))),[O,r]),[D,U]=W.useState([]),[z,L]=W.useState(!1),[G,q]=W.useState(!1),[H,X]=W.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=W.useRef(null),I=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=W.useRef(null),Q=W.useRef(!1),B=W.useCallback($=>{k(ee=>{var V;return(V=ee.find(J=>J.id===$.id))!=null&&V.delete||Ar.dismiss($.id),ee.filter(({id:J})=>J!==$.id)})},[]);return W.useEffect(()=>Ar.subscribe($=>{if($.dismiss){k(ee=>ee.map(V=>V.id===$.id?{...V,delete:!0}:V));return}setTimeout(()=>{kM.flushSync(()=>{k(ee=>{let V=ee.findIndex(J=>J.id===$.id);return V!==-1?[...ee.slice(0,V),{...ee[V],...$},...ee.slice(V+1)]:[$,...ee]})})})}),[]),W.useEffect(()=>{if(h!=="system"){X(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:ee})=>{X(ee?"dark":"light")})}catch{$.addListener(({matches:V})=>{try{X(V?"dark":"light")}catch(J){console.error(J)}})}},[h]),W.useEffect(()=>{O.length<=1&&L(!1)},[O]),W.useEffect(()=>{let $=ee=>{var V,J;a.every(ge=>ee[ge]||ee.code===ge)&&(L(!0),(V=Z.current)==null||V.focus()),ee.code==="Escape"&&(document.activeElement===Z.current||(J=Z.current)!=null&&J.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[a]),W.useEffect(()=>{if(Z.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,Q.current=!1)}},[Z.current]),W.createElement("section",{ref:t,"aria-label":`${P} ${I}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map(($,ee)=>{var V;let[J,ge]=$.split("-");return O.length?W.createElement("ol",{key:$,dir:x==="auto"?v_():x,tabIndex:-1,ref:Z,className:c,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":J,"data-lifted":z&&O.length>1&&!i,"data-x-position":ge,style:{"--front-toast-height":`${((V=D[0])==null?void 0:V.height)||0}px`,"--width":`${qq}px`,"--gap":`${S}px`,...y,...Yq(d,f)},onBlur:ie=>{Q.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(Q.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,F.current=ie.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{G||L(!1)},onDragEnd:()=>L(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},O.filter(ie=>!ie.position&&ee===0||ie.position===$).map((ie,ce)=>{var oe,xe;return W.createElement(Gq,{key:ie.id,icons:A,index:ce,toast:ie,defaultRichColors:p,duration:(oe=w?.duration)!=null?oe:g,className:w?.className,descriptionClassName:w?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(xe=w?.closeButton)!=null?xe:o,interacting:G,position:$,style:w?.style,unstyled:w?.unstyled,classNames:w?.classNames,cancelButtonStyle:w?.cancelButtonStyle,actionButtonStyle:w?.actionButtonStyle,removeToast:B,toasts:O.filter(ke=>ke.position==ie.position),heights:D.filter(ke=>ke.position==ie.position),setHeights:U,expandByDefault:i,gap:S,loadingIcon:N,expanded:z,pauseWhenPageIsHidden:E,swipeDirections:e.swipeDirections})})):null}))});const Qq=({...e})=>{const{theme:t="system"}=Sq();return s.jsx(Xq,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var Jq=Am[" useId ".trim().toString()]||(()=>{}),Zq=0;function Bn(e){const[t,n]=v.useState(Jq());return zn(()=>{n(r=>r??String(Zq++))},[e]),e||(t?`radix-${t}`:"")}const e9=["top","right","bottom","left"],$i=Math.min,Wr=Math.max,ch=Math.round,Rp=Math.floor,cs=e=>({x:e,y:e}),t9={left:"right",right:"left",bottom:"top",top:"bottom"},n9={start:"end",end:"start"};function w1(e,t,n){return Wr(e,$i(t,n))}function qs(e,t){return typeof e=="function"?e(t):e}function Ws(e){return e.split("-")[0]}function Rc(e){return e.split("-")[1]}function OS(e){return e==="x"?"y":"x"}function kS(e){return e==="y"?"height":"width"}const r9=new Set(["top","bottom"]);function os(e){return r9.has(Ws(e))?"y":"x"}function RS(e){return OS(os(e))}function a9(e,t,n){n===void 0&&(n=!1);const r=Rc(e),a=RS(e),i=kS(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=uh(o)),[o,uh(o)]}function s9(e){const t=uh(e);return[j1(e),t,j1(t)]}function j1(e){return e.replace(/start|end/g,t=>n9[t])}const g_=["left","right"],y_=["right","left"],i9=["top","bottom"],o9=["bottom","top"];function l9(e,t,n){switch(e){case"top":case"bottom":return n?t?y_:g_:t?g_:y_;case"left":case"right":return t?i9:o9;default:return[]}}function c9(e,t,n,r){const a=Rc(e);let i=l9(Ws(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(j1)))),i}function uh(e){return e.replace(/left|right|bottom|top/g,t=>t9[t])}function u9(e){return{top:0,right:0,bottom:0,left:0,...e}}function C$(e){return typeof e!="number"?u9(e):{top:e,right:e,bottom:e,left:e}}function dh(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function x_(e,t,n){let{reference:r,floating:a}=e;const i=os(t),o=RS(t),c=kS(o),d=Ws(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,g=r[c]/2-a[c]/2;let y;switch(d){case"top":y={x:h,y:r.y-a.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(Rc(t)){case"start":y[o]-=g*(n&&f?-1:1);break;case"end":y[o]+=g*(n&&f?-1:1);break}return y}async function d9(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:y=0}=qs(t,e),j=C$(y),x=c[g?p==="floating"?"reference":"floating":p],S=dh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),N=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),P=await(i.isElement==null?void 0:i.isElement(A))?await(i.getScale==null?void 0:i.getScale(A))||{x:1,y:1}:{x:1,y:1},E=dh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:A,strategy:d}):N);return{top:(S.top-E.top+j.top)/P.y,bottom:(E.bottom-S.bottom+j.bottom)/P.y,left:(S.left-E.left+j.left)/P.x,right:(E.right-S.right+j.right)/P.x}}const f9=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,c=i.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=x_(f,r,d),g=r,y={},j=0;for(let x=0;x<c.length;x++){var w;const{name:S,fn:N}=c[x],{x:A,y:P,data:E,reset:O}=await N({x:h,y:p,initialPlacement:r,placement:g,strategy:a,middlewareData:y,rects:f,platform:{...o,detectOverflow:(w=o.detectOverflow)!=null?w:d9},elements:{reference:e,floating:t}});h=A??h,p=P??p,y={...y,[S]:{...y[S],...E}},O&&j<=50&&(j++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(f=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):O.rects),{x:h,y:p}=x_(f,g,d)),x=-1)}return{x:h,y:p,placement:g,strategy:a,middlewareData:y}},p9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=qs(e,t)||{};if(f==null)return{};const p=C$(h),g={x:n,y:r},y=RS(a),j=kS(y),w=await o.getDimensions(f),x=y==="y",S=x?"top":"left",N=x?"bottom":"right",A=x?"clientHeight":"clientWidth",P=i.reference[j]+i.reference[y]-g[y]-i.floating[j],E=g[y]-i.reference[y],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let k=O?O[A]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=c.floating[A]||i.floating[j]);const R=P/2-E/2,D=k/2-w[j]/2-1,U=$i(p[S],D),z=$i(p[N],D),L=U,G=k-w[j]-z,q=k/2-w[j]/2+R,H=w1(L,q,G),X=!d.arrow&&Rc(a)!=null&&q!==H&&i.reference[j]/2-(q<L?U:z)-w[j]/2<0,Z=X?q<L?q-L:q-G:0;return{[y]:g[y]+Z,data:{[y]:H,centerOffset:q-H-Z,...X&&{alignmentOffset:Z}},reset:X}}}),h9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:w=!0,...x}=qs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=Ws(a),N=os(c),A=Ws(c)===c,P=await(d.isRTL==null?void 0:d.isRTL(f.floating)),E=g||(A||!w?[uh(c)]:s9(c)),O=j!=="none";!g&&O&&E.push(...c9(c,w,j,P));const k=[c,...E],R=await d.detectOverflow(t,x),D=[];let U=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&D.push(R[S]),p){const q=a9(a,o,P);D.push(R[q[0]],R[q[1]])}if(U=[...U,{placement:a,overflows:D}],!D.every(q=>q<=0)){var z,L;const q=(((z=i.flip)==null?void 0:z.index)||0)+1,H=k[q];if(H&&(!(p==="alignment"?N!==os(H):!1)||U.every(I=>os(I.placement)===N?I.overflows[0]>0:!0)))return{data:{index:q,overflows:U},reset:{placement:H}};let X=(L=U.filter(Z=>Z.overflows[0]<=0).sort((Z,I)=>Z.overflows[1]-I.overflows[1])[0])==null?void 0:L.placement;if(!X)switch(y){case"bestFit":{var G;const Z=(G=U.filter(I=>{if(O){const F=os(I.placement);return F===N||F==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(F=>F>0).reduce((F,Q)=>F+Q,0)]).sort((I,F)=>I[1]-F[1])[0])==null?void 0:G[0];Z&&(X=Z);break}case"initialPlacement":X=c;break}if(a!==X)return{reset:{placement:X}}}return{}}}};function b_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function w_(e){return e9.some(t=>e[t]>=0)}const m9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=qs(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=b_(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:w_(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=b_(o,n.floating);return{data:{escapedOffsets:c,escaped:w_(c)}}}default:return{}}}}},A$=new Set(["left","top"]);async function v9(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Ws(n),c=Rc(n),d=os(n)==="y",f=A$.has(o)?-1:1,h=i&&d?-1:1,p=qs(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(y=c==="end"?j*-1:j),d?{x:y*h,y:g*f}:{x:g*f,y:y*h}}const g9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:c}=t,d=await v9(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:o}}}}},y9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:N,y:A}=S;return{x:N,y:A}}},...f}=qs(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),g=os(Ws(a)),y=OS(g);let j=h[y],w=h[g];if(o){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",A=j+p[S],P=j-p[N];j=w1(A,j,P)}if(c){const S=g==="y"?"top":"left",N=g==="y"?"bottom":"right",A=w+p[S],P=w-p[N];w=w1(A,w,P)}const x=d.fn({...t,[y]:j,[g]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[y]:o,[g]:c}}}}}},x9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=qs(e,t),h={x:n,y:r},p=os(a),g=OS(p);let y=h[g],j=h[p];const w=qs(c,t),x=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const A=g==="y"?"height":"width",P=i.reference[g]-i.floating[A]+x.mainAxis,E=i.reference[g]+i.reference[A]-x.mainAxis;y<P?y=P:y>E&&(y=E)}if(f){var S,N;const A=g==="y"?"width":"height",P=A$.has(Ws(a)),E=i.reference[p]-i.floating[A]+(P&&((S=o.offset)==null?void 0:S[p])||0)+(P?0:x.crossAxis),O=i.reference[p]+i.reference[A]+(P?0:((N=o.offset)==null?void 0:N[p])||0)-(P?x.crossAxis:0);j<E?j=E:j>O&&(j=O)}return{[g]:y,[p]:j}}}},b9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:c}=t,{apply:d=()=>{},...f}=qs(e,t),h=await o.detectOverflow(t,f),p=Ws(a),g=Rc(a),y=os(a)==="y",{width:j,height:w}=i.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=g===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,x=g==="end"?"top":"bottom");const N=w-h.top-h.bottom,A=j-h.left-h.right,P=$i(w-h[x],N),E=$i(j-h[S],A),O=!t.middlewareData.shift;let k=P,R=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=A),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=N),O&&!g){const U=Wr(h.left,0),z=Wr(h.right,0),L=Wr(h.top,0),G=Wr(h.bottom,0);y?R=j-2*(U!==0||z!==0?U+z:Wr(h.left,h.right)):k=w-2*(L!==0||G!==0?L+G:Wr(h.top,h.bottom))}await d({...t,availableWidth:R,availableHeight:k});const D=await o.getDimensions(c.floating);return j!==D.width||w!==D.height?{reset:{rects:!0}}:{}}}};function Rm(){return typeof window<"u"}function Tc(e){return E$(e)?(e.nodeName||"").toLowerCase():"#document"}function Xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ms(e){var t;return(t=(E$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function E$(e){return Rm()?e instanceof Node||e instanceof Xr(e).Node:!1}function Ua(e){return Rm()?e instanceof Element||e instanceof Xr(e).Element:!1}function fs(e){return Rm()?e instanceof HTMLElement||e instanceof Xr(e).HTMLElement:!1}function j_(e){return!Rm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xr(e).ShadowRoot}const w9=new Set(["inline","contents"]);function tf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=qa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!w9.has(a)}const j9=new Set(["table","td","th"]);function S9(e){return j9.has(Tc(e))}const N9=[":popover-open",":modal"];function Tm(e){return N9.some(t=>{try{return e.matches(t)}catch{return!1}})}const C9=["transform","translate","scale","rotate","perspective"],A9=["transform","translate","scale","rotate","perspective","filter"],E9=["paint","layout","strict","content"];function TS(e){const t=IS(),n=Ua(e)?qa(e):e;return C9.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||A9.some(r=>(n.willChange||"").includes(r))||E9.some(r=>(n.contain||"").includes(r))}function _9(e){let t=Di(e);for(;fs(t)&&!Jl(t);){if(TS(t))return t;if(Tm(t))return null;t=Di(t)}return null}function IS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const P9=new Set(["html","body","#document"]);function Jl(e){return P9.has(Tc(e))}function qa(e){return Xr(e).getComputedStyle(e)}function Im(e){return Ua(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Di(e){if(Tc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||j_(e)&&e.host||ms(e);return j_(t)?t.host:t}function _$(e){const t=Di(e);return Jl(t)?e.ownerDocument?e.ownerDocument.body:e.body:fs(t)&&tf(t)?t:_$(t)}function cd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=_$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=Xr(a);if(i){const c=S1(o);return t.concat(o,o.visualViewport||[],tf(a)?a:[],c&&n?cd(c):[])}return t.concat(a,cd(a,[],n))}function S1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function P$(e){const t=qa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=fs(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=ch(n)!==i||ch(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function MS(e){return Ua(e)?e:e.contextElement}function Bl(e){const t=MS(e);if(!fs(t))return cs(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=P$(t);let o=(i?ch(n.width):n.width)/r,c=(i?ch(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const O9=cs(0);function O$(e){const t=Xr(e);return!IS()||!t.visualViewport?O9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function k9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xr(e)?!1:t}function Co(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=MS(e);let o=cs(1);t&&(r?Ua(r)&&(o=Bl(r)):o=Bl(e));const c=k9(i,n,r)?O$(i):cs(0);let d=(a.left+c.x)/o.x,f=(a.top+c.y)/o.y,h=a.width/o.x,p=a.height/o.y;if(i){const g=Xr(i),y=r&&Ua(r)?Xr(r):r;let j=g,w=S1(j);for(;w&&r&&y!==j;){const x=Bl(w),S=w.getBoundingClientRect(),N=qa(w),A=S.left+(w.clientLeft+parseFloat(N.paddingLeft))*x.x,P=S.top+(w.clientTop+parseFloat(N.paddingTop))*x.y;d*=x.x,f*=x.y,h*=x.x,p*=x.y,d+=A,f+=P,j=Xr(w),w=S1(j)}}return dh({width:h,height:p,x:d,y:f})}function Mm(e,t){const n=Im(e).scrollLeft;return t?t.left+n:Co(ms(e)).left+n}function k$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Mm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function R9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=ms(r),c=t?Tm(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=cs(1);const h=cs(0),p=fs(r);if((p||!p&&!i)&&((Tc(r)!=="body"||tf(o))&&(d=Im(r)),fs(r))){const y=Co(r);f=Bl(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const g=o&&!p&&!i?k$(o,d):cs(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-d.scrollTop*f.y+h.y+g.y}}function T9(e){return Array.from(e.getClientRects())}function I9(e){const t=ms(e),n=Im(e),r=e.ownerDocument.body,a=Wr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Wr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Mm(e);const c=-n.scrollTop;return qa(r).direction==="rtl"&&(o+=Wr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const S_=25;function M9(e,t){const n=Xr(e),r=ms(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,c=0,d=0;if(a){i=a.width,o=a.height;const h=IS();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Mm(r);if(f<=0){const h=r.ownerDocument,p=h.body,g=getComputedStyle(p),y=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-y);j<=S_&&(i-=j)}else f<=S_&&(i+=f);return{width:i,height:o,x:c,y:d}}const $9=new Set(["absolute","fixed"]);function D9(e,t){const n=Co(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=fs(e)?Bl(e):cs(1),o=e.clientWidth*i.x,c=e.clientHeight*i.y,d=a*i.x,f=r*i.y;return{width:o,height:c,x:d,y:f}}function N_(e,t,n){let r;if(t==="viewport")r=M9(e,n);else if(t==="document")r=I9(ms(e));else if(Ua(t))r=D9(t,n);else{const a=O$(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return dh(r)}function R$(e,t){const n=Di(e);return n===t||!Ua(n)||Jl(n)?!1:qa(n).position==="fixed"||R$(n,t)}function L9(e,t){const n=t.get(e);if(n)return n;let r=cd(e,[],!1).filter(c=>Ua(c)&&Tc(c)!=="body"),a=null;const i=qa(e).position==="fixed";let o=i?Di(e):e;for(;Ua(o)&&!Jl(o);){const c=qa(o),d=TS(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&$9.has(a.position)||tf(o)&&!d&&R$(e,o))?r=r.filter(h=>h!==o):a=c,o=Di(o)}return t.set(e,r),r}function F9(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Tm(t)?[]:L9(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=N_(t,h,a);return f.top=Wr(p.top,f.top),f.right=$i(p.right,f.right),f.bottom=$i(p.bottom,f.bottom),f.left=Wr(p.left,f.left),f},N_(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function B9(e){const{width:t,height:n}=P$(e);return{width:t,height:n}}function z9(e,t,n){const r=fs(t),a=ms(t),i=n==="fixed",o=Co(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=cs(0);function f(){d.x=Mm(a)}if(r||!r&&!i)if((Tc(t)!=="body"||tf(a))&&(c=Im(t)),r){const y=Co(t,!0,i,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else a&&f();i&&!r&&a&&f();const h=a&&!r&&!i?k$(a,c):cs(0),p=o.left+c.scrollLeft-d.x-h.x,g=o.top+c.scrollTop-d.y-h.y;return{x:p,y:g,width:o.width,height:o.height}}function Ky(e){return qa(e).position==="static"}function C_(e,t){if(!fs(e)||qa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ms(e)===n&&(n=n.ownerDocument.body),n}function T$(e,t){const n=Xr(e);if(Tm(e))return n;if(!fs(e)){let a=Di(e);for(;a&&!Jl(a);){if(Ua(a)&&!Ky(a))return a;a=Di(a)}return n}let r=C_(e,t);for(;r&&S9(r)&&Ky(r);)r=C_(r,t);return r&&Jl(r)&&Ky(r)&&!TS(r)?n:r||_9(e)||n}const U9=async function(e){const t=this.getOffsetParent||T$,n=this.getDimensions,r=await n(e.floating);return{reference:z9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function q9(e){return qa(e).direction==="rtl"}const W9={convertOffsetParentRelativeRectToViewportRelativeRect:R9,getDocumentElement:ms,getClippingRect:F9,getOffsetParent:T$,getElementRects:U9,getClientRects:T9,getDimensions:B9,getScale:Bl,isElement:Ua,isRTL:q9};function I$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function V9(e,t){let n=null,r;const a=ms(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function o(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:h,top:p,width:g,height:y}=f;if(c||t(),!g||!y)return;const j=Rp(p),w=Rp(a.clientWidth-(h+g)),x=Rp(a.clientHeight-(p+y)),S=Rp(h),A={rootMargin:-j+"px "+-w+"px "+-x+"px "+-S+"px",threshold:Wr(0,$i(1,d))||1};let P=!0;function E(O){const k=O[0].intersectionRatio;if(k!==d){if(!P)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!I$(f,e.getBoundingClientRect())&&o(),P=!1}try{n=new IntersectionObserver(E,{...A,root:a.ownerDocument})}catch{n=new IntersectionObserver(E,A)}n.observe(e)}return o(!0),i}function H9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=MS(e),h=a||i?[...f?cd(f):[],...cd(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?V9(f,n):null;let g=-1,y=null;o&&(y=new ResizeObserver(S=>{let[N]=S;N&&N.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var A;(A=y)==null||A.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let j,w=d?Co(e):null;d&&x();function x(){const S=Co(e);w&&!I$(w,S)&&n(),w=S,j=requestAnimationFrame(x)}return n(),()=>{var S;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p?.(),(S=y)==null||S.disconnect(),y=null,d&&cancelAnimationFrame(j)}}const K9=g9,G9=y9,Y9=h9,X9=b9,Q9=m9,A_=p9,J9=x9,Z9=(e,t,n)=>{const r=new Map,a={platform:W9,...n},i={...a.platform,_c:r};return f9(e,t,{...a,platform:i})};var eW=typeof document<"u",tW=function(){},rh=eW?v.useLayoutEffect:tW;function fh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fh(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!fh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function M$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function E_(e,t){const n=M$(e);return Math.round(t*n)/n}function Gy(e){const t=v.useRef(e);return rh(()=>{t.current=e}),t}function nW(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[h,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=v.useState(r);fh(g,r)||y(r);const[j,w]=v.useState(null),[x,S]=v.useState(null),N=v.useCallback(I=>{I!==O.current&&(O.current=I,w(I))},[]),A=v.useCallback(I=>{I!==k.current&&(k.current=I,S(I))},[]),P=i||j,E=o||x,O=v.useRef(null),k=v.useRef(null),R=v.useRef(h),D=d!=null,U=Gy(d),z=Gy(a),L=Gy(f),G=v.useCallback(()=>{if(!O.current||!k.current)return;const I={placement:t,strategy:n,middleware:g};z.current&&(I.platform=z.current),Z9(O.current,k.current,I).then(F=>{const Q={...F,isPositioned:L.current!==!1};q.current&&!fh(R.current,Q)&&(R.current=Q,Pc.flushSync(()=>{p(Q)}))})},[g,t,n,z,L]);rh(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(I=>({...I,isPositioned:!1})))},[f]);const q=v.useRef(!1);rh(()=>(q.current=!0,()=>{q.current=!1}),[]),rh(()=>{if(P&&(O.current=P),E&&(k.current=E),P&&E){if(U.current)return U.current(P,E,G);G()}},[P,E,G,U,D]);const H=v.useMemo(()=>({reference:O,floating:k,setReference:N,setFloating:A}),[N,A]),X=v.useMemo(()=>({reference:P,floating:E}),[P,E]),Z=v.useMemo(()=>{const I={position:n,left:0,top:0};if(!X.floating)return I;const F=E_(X.floating,h.x),Q=E_(X.floating,h.y);return c?{...I,transform:"translate("+F+"px, "+Q+"px)",...M$(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Q}},[n,c,X.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:G,refs:H,elements:X,floatingStyles:Z}),[h,G,H,X,Z])}const rW=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?A_({element:r.current,padding:a}).fn(n):{}:r?A_({element:r,padding:a}).fn(n):{}}}},aW=(e,t)=>({...K9(e),options:[e,t]}),sW=(e,t)=>({...G9(e),options:[e,t]}),iW=(e,t)=>({...J9(e),options:[e,t]}),oW=(e,t)=>({...Y9(e),options:[e,t]}),lW=(e,t)=>({...X9(e),options:[e,t]}),cW=(e,t)=>({...Q9(e),options:[e,t]}),uW=(e,t)=>({...rW(e),options:[e,t]});var dW="Arrow",$$=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(qe.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});$$.displayName=dW;var fW=$$;function $m(e){const[t,n]=v.useState(void 0);return zn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,c;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;o=f.inlineSize,c=f.blockSize}else o=e.offsetWidth,c=e.offsetHeight;n({width:o,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $S="Popper",[D$,Fi]=er($S),[pW,L$]=D$($S),F$=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(pW,{scope:t,anchor:r,onAnchorChange:a,children:n})};F$.displayName=$S;var B$="PopperAnchor",z$=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=L$(B$,n),o=v.useRef(null),c=pt(t,o),d=v.useRef(null);return v.useEffect(()=>{const f=d.current;d.current=r?.current||o.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:s.jsx(qe.div,{...a,ref:c})});z$.displayName=B$;var DS="PopperContent",[hW,mW]=D$(DS),U$=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:j,...w}=e,x=L$(DS,n),[S,N]=v.useState(null),A=pt(t,ie=>N(ie)),[P,E]=v.useState(null),O=$m(P),k=O?.width??0,R=O?.height??0,D=r+(i!=="center"?"-"+i:""),U=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(f)?f:[f],L=z.length>0,G={padding:U,boundary:z.filter(gW),altBoundary:L},{refs:q,floatingStyles:H,placement:X,isPositioned:Z,middlewareData:I}=nW({strategy:"fixed",placement:D,whileElementsMounted:(...ie)=>H9(...ie,{animationFrame:y==="always"}),elements:{reference:x.anchor},middleware:[aW({mainAxis:a+R,alignmentAxis:o}),d&&sW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?iW():void 0,...G}),d&&oW({...G}),lW({...G,apply:({elements:ie,rects:ce,availableWidth:oe,availableHeight:xe})=>{const{width:ke,height:pe}=ce.reference,ve=ie.floating.style;ve.setProperty("--radix-popper-available-width",`${oe}px`),ve.setProperty("--radix-popper-available-height",`${xe}px`),ve.setProperty("--radix-popper-anchor-width",`${ke}px`),ve.setProperty("--radix-popper-anchor-height",`${pe}px`)}}),P&&uW({element:P,padding:c}),yW({arrowWidth:k,arrowHeight:R}),g&&cW({strategy:"referenceHidden",...G})]}),[F,Q]=V$(X),B=Cn(j);zn(()=>{Z&&B?.()},[Z,B]);const $=I.arrow?.x,ee=I.arrow?.y,V=I.arrow?.centerOffset!==0,[J,ge]=v.useState();return zn(()=>{S&&ge(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Z?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(hW,{scope:n,placedSide:F,onArrowChange:E,arrowX:$,arrowY:ee,shouldHideArrow:V,children:s.jsx(qe.div,{"data-side":F,"data-align":Q,...w,ref:A,style:{...w.style,animation:Z?void 0:"none"}})})})});U$.displayName=DS;var q$="PopperArrow",vW={top:"bottom",right:"left",bottom:"top",left:"right"},W$=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=mW(q$,r),o=vW[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(fW,{...a,ref:n,style:{...a.style,display:"block"}})})});W$.displayName=q$;function gW(e){return e!==null}var yW=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,c=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[f,h]=V$(n),p={start:"0%",center:"50%",end:"100%"}[h],g=(a.arrow?.x??0)+c/2,y=(a.arrow?.y??0)+d/2;let j="",w="";return f==="bottom"?(j=o?p:`${g}px`,w=`${-d}px`):f==="top"?(j=o?p:`${g}px`,w=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,w=o?p:`${y}px`):f==="left"&&(j=`${r.floating.width+d}px`,w=o?p:`${y}px`),{data:{x:j,y:w}}}});function V$(e){const[t,n="center"]=e.split("-");return[t,n]}var Dm=F$,nf=z$,Lm=U$,Fm=W$,xW=Symbol("radix.slottable");function bW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=xW,t}var[Bm]=er("Tooltip",[Fi]),zm=Fi(),H$="TooltipProvider",wW=700,N1="tooltip.open",[jW,LS]=Bm(H$),K$=e=>{const{__scopeTooltip:t,delayDuration:n=wW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=v.useRef(!0),c=v.useRef(!1),d=v.useRef(0);return v.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(jW,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(f=>{c.current=f},[]),disableHoverableContent:a,children:i})};K$.displayName=H$;var ud="Tooltip",[SW,Um]=Bm(ud),G$=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=LS(ud,e.__scopeTooltip),f=zm(t),[h,p]=v.useState(null),g=Bn(),y=v.useRef(0),j=o??d.disableHoverableContent,w=c??d.delayDuration,x=v.useRef(!1),[S,N]=Zr({prop:r,defaultProp:a??!1,onChange:k=>{k?(d.onOpen(),document.dispatchEvent(new CustomEvent(N1))):d.onClose(),i?.(k)},caller:ud}),A=v.useMemo(()=>S?x.current?"delayed-open":"instant-open":"closed",[S]),P=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,x.current=!1,N(!0)},[N]),E=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,N(!1)},[N]),O=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{x.current=!0,N(!0),y.current=0},w)},[w,N]);return v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),s.jsx(Dm,{...f,children:s.jsx(SW,{scope:t,contentId:g,open:S,stateAttribute:A,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?O():P()},[d.isOpenDelayedRef,O,P]),onTriggerLeave:v.useCallback(()=>{j?E():(window.clearTimeout(y.current),y.current=0)},[E,j]),onOpen:P,onClose:E,disableHoverableContent:j,children:n})})};G$.displayName=ud;var C1="TooltipTrigger",Y$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Um(C1,n),i=LS(C1,n),o=zm(n),c=v.useRef(null),d=pt(t,c,a.onTriggerChange),f=v.useRef(!1),h=v.useRef(!1),p=v.useCallback(()=>f.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(nf,{asChild:!0,...o,children:s.jsx(qe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Pe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Pe(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Pe(e.onBlur,a.onClose),onClick:Pe(e.onClick,a.onClose)})})});Y$.displayName=C1;var NW="TooltipPortal",[Oge,CW]=Bm(NW,{forceMount:void 0}),Zl="TooltipContent",X$=v.forwardRef((e,t)=>{const n=CW(Zl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Um(Zl,e.__scopeTooltip);return s.jsx(Un,{present:r||o.open,children:o.disableHoverableContent?s.jsx(Q$,{side:a,...i,ref:t}):s.jsx(AW,{side:a,...i,ref:t})})}),AW=v.forwardRef((e,t)=>{const n=Um(Zl,e.__scopeTooltip),r=LS(Zl,e.__scopeTooltip),a=v.useRef(null),i=pt(t,a),[o,c]=v.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,g=v.useCallback(()=>{c(null),p(!1)},[p]),y=v.useCallback((j,w)=>{const x=j.currentTarget,S={x:j.clientX,y:j.clientY},N=kW(S,x.getBoundingClientRect()),A=RW(S,N),P=TW(w.getBoundingClientRect()),E=MW([...A,...P]);c(E),p(!0)},[p]);return v.useEffect(()=>()=>g(),[g]),v.useEffect(()=>{if(d&&h){const j=x=>y(x,h),w=x=>y(x,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",w)}}},[d,h,y,g]),v.useEffect(()=>{if(o){const j=w=>{const x=w.target,S={x:w.clientX,y:w.clientY},N=d?.contains(x)||h?.contains(x),A=!IW(S,o);N?g():A&&(g(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,g]),s.jsx(Q$,{...e,ref:i})}),[EW,_W]=Bm(ud,{isInside:!1}),PW=bW("TooltipContent"),Q$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Um(Zl,n),f=zm(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(N1,h),()=>document.removeEventListener(N1,h)),[h]),v.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(Do,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(Lm,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(PW,{children:r}),s.jsx(EW,{scope:n,isInside:!0,children:s.jsx(iU,{id:d.contentId,role:"tooltip",children:a||r})})]})})});X$.displayName=Zl;var J$="TooltipArrow",OW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=zm(n);return _W(J$,n).isInside?null:s.jsx(Fm,{...a,...r,ref:t})});OW.displayName=J$;function kW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function RW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function TW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function IW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(a=!a)}return a}function MW(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),$W(t)}function $W(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var DW=K$,LW=G$,FW=Y$,Z$=X$;const eD=DW,tD=LW,nD=FW,FS=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Z$,{ref:r,sideOffset:t,className:Se("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));FS.displayName=Z$.displayName;var qm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},BW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zW=class{#e=BW;#n=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},A1=new zW;function UW(e){setTimeout(e,0)}var Wm=typeof window>"u"||"Deno"in globalThis;function Ma(){}function qW(e,t){return typeof e=="function"?e(t):e}function WW(e){return typeof e=="number"&&e>=0&&e!==1/0}function VW(e,t){return Math.max(e+(t||0)-Date.now(),0)}function E1(e,t){return typeof e=="function"?e(t):e}function HW(e,t){return typeof e=="function"?e(t):e}function __(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==BS(o,t.options))return!1}else if(!fd(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||i&&!i(t))}function P_(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(dd(t.options.mutationKey)!==dd(i))return!1}else if(!fd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function BS(e,t){return(t?.queryKeyHashFn||dd)(e)}function dd(e){return JSON.stringify(e,(t,n)=>_1(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function fd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fd(e[n],t[n])):!1}var KW=Object.prototype.hasOwnProperty;function rD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=O_(e)&&O_(t);if(!r&&!(_1(e)&&_1(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:o[h],g=e[p],y=t[p];if(g===y){d[p]=g,(r?h<i:KW.call(e,p))&&f++;continue}if(g===null||y===null||typeof g!="object"||typeof y!="object"){d[p]=y;continue}const j=rD(g,y,n+1);d[p]=j,j===g&&f++}return i===c&&f===i?e:d}function O_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _1(e){if(!k_(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!k_(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function k_(e){return Object.prototype.toString.call(e)==="[object Object]"}function GW(e){return new Promise(t=>{A1.setTimeout(t,e)})}function YW(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?rD(e,t):t}function XW(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function QW(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zS=Symbol();function aD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===zS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function JW(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??=t(),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var ZW=class extends qm{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!Wm&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},sD=new ZW;function eV(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var tV=UW;function nV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=tV;const i=c=>{t?e.push(c):a(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{i(()=>{c(...d)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var fr=nV(),rV=class extends qm{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!Wm&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ph=new rV;function aV(e){return Math.min(1e3*2**e,3e4)}function iD(e){return(e??"online")==="online"?ph.isOnline():!0}var P1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function oD(e){let t=!1,n=0,r;const a=eV(),i=()=>a.status!=="pending",o=w=>{if(!i()){const x=new P1(w);g(x),e.onCancel?.(x)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>sD.isFocused()&&(e.networkMode==="always"||ph.isOnline())&&e.canRun(),h=()=>iD(e.networkMode)&&e.canRun(),p=w=>{i()||(r?.(),a.resolve(w))},g=w=>{i()||(r?.(),a.reject(w))},y=()=>new Promise(w=>{r=x=>{(i()||f())&&w(x)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())return;let w;const x=n===0?e.initialPromise:void 0;try{w=x??e.fn()}catch(S){w=Promise.reject(S)}Promise.resolve(w).then(p).catch(S=>{if(i())return;const N=e.retry??(Wm?0:3),A=e.retryDelay??aV,P=typeof A=="function"?A(n,S):A,E=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!E){g(S);return}n++,e.onFail?.(n,S),GW(P).then(()=>f()?void 0:y()).then(()=>{t?g(S):j()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():y().then(j),a)}}var lD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),WW(this.gcTime)&&(this.#e=A1.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Wm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(A1.clearTimeout(this.#e),this.#e=void 0)}},sV=class extends lD{#e;#n;#t;#a;#r;#i;#o;constructor(e){super(),this.#o=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#t=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=T_(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=T_(this.options);t.data!==void 0&&(this.setState(R_(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=YW(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Ma).catch(Ma):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>HW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>E1(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!VW(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},a=()=>{const c=aD(this.options,t),f=(()=>{const h={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(h),h})();return this.#o=!1,this.options.persister?this.options.persister(c,f,this):c(f)},o=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:a};return r(c),c})();this.options.behavior?.onFetch(o,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=oD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof P1&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#t.config.onSuccess?.(c,this),this.#t.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof P1){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#t.config.onError?.(c,this),this.#t.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...iV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...R_(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const a=e.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),fr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function iV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:iD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function R_(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function T_(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function I_(e){return{onFetch:(t,n)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let h=!1;const p=j=>{JW(j,()=>t.signal,()=>h=!0)},g=aD(t.options,t.fetchOptions),y=async(j,w,x)=>{if(h)return Promise.reject();if(w==null&&j.pages.length)return Promise.resolve(j);const N=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:w,direction:x?"backward":"forward",meta:t.options.meta};return p(O),O})(),A=await g(N),{maxPages:P}=t.options,E=x?QW:XW;return{pages:E(j.pages,A,P),pageParams:E(j.pageParams,w,P)}};if(a&&i.length){const j=a==="backward",w=j?oV:M_,x={pages:i,pageParams:o},S=w(r,x);c=await y(x,S,j)}else{const j=e??i.length;do{const w=d===0?o[0]??r.initialPageParam:M_(r,c);if(d>0&&w==null)break;c=await y(c,w),d++}while(d<j)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function M_(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function oV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var lV=class extends lD{#e;#n;#t;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||cV(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=oD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#r({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",a=!this.#a.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:a}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:a})}const i=await this.#a.start();return await this.#t.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#r({type:"success",data:i}),i}catch(i){try{await this.#t.config.onError?.(i,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:i}),i}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),fr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function cV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var uV=class extends qm{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,n){const r=new lV({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Tp(e);if(typeof t=="string"){const n=this.#n.get(t);n?n.push(e):this.#n.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Tp(e);if(typeof t=="string"){const n=this.#n.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#n.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Tp(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(a=>a.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Tp(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){fr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>P_(t,n))}findAll(e={}){return this.getAll().filter(t=>P_(e,t))}notify(e){fr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return fr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ma))))}};function Tp(e){return e.options.scope?.id}var dV=class extends qm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??BS(r,t);let i=this.get(a);return i||(i=new sV({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){fr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>__(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>__(e,n)):t}notify(e){fr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){fr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){fr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new dV,this.#n=e.mutationCache||new uV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=sD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ph.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(E1(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,o=qW(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return fr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;fr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return fr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=fr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Ma).catch(Ma)}invalidateQueries(e,t={}){return fr.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=fr.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ma)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ma)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(E1(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ma).catch(Ma)}fetchInfiniteQuery(e){return e.behavior=I_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ma).catch(Ma)}ensureInfiniteQueryData(e){return e.behavior=I_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ph.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(e){this.#t=e}setQueryDefaults(e,t){this.#a.set(dd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{fd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(dd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{fd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#t.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=BS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zS&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#t.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},pV=v.createContext(void 0),hV=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(pV.Provider,{value:e,children:t}));function pd(){return pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pd.apply(this,arguments)}var _i;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(_i||(_i={}));const $_="popstate";function mV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return O1("",{pathname:i,search:o,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:hh(a)}return gV(t,n,null,e)}function yn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function US(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vV(){return Math.random().toString(36).substr(2,8)}function D_(e,t){return{usr:e.state,key:e.key,idx:t}}function O1(e,t,n,r){return n===void 0&&(n=null),pd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ic(t):t,{state:n,key:t&&t.key||r||vV()})}function hh(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 Ic(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 gV(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=_i.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(pd({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=_i.Pop;let x=h(),S=x==null?null:x-f;f=x,d&&d({action:c,location:w.location,delta:S})}function g(x,S){c=_i.Push;let N=O1(w.location,x,S);f=h()+1;let A=D_(N,f),P=w.createHref(N);try{o.pushState(A,"",P)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;a.location.assign(P)}i&&d&&d({action:c,location:w.location,delta:1})}function y(x,S){c=_i.Replace;let N=O1(w.location,x,S);f=h();let A=D_(N,f),P=w.createHref(N);o.replaceState(A,"",P),i&&d&&d({action:c,location:w.location,delta:0})}function j(x){let S=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof x=="string"?x:hh(x);return N=N.replace(/ $/,"%20"),yn(S,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,S)}let w={get action(){return c},get location(){return e(a,o)},listen(x){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener($_,p),d=x,()=>{a.removeEventListener($_,p),d=null}},createHref(x){return t(a,x)},createURL:j,encodeLocation(x){let S=j(x);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:g,replace:y,go(x){return o.go(x)}};return w}var L_;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(L_||(L_={}));function yV(e,t,n){return n===void 0&&(n="/"),xV(e,t,n)}function xV(e,t,n,r){let a=typeof t=="string"?Ic(t):t,i=ec(a.pathname||"/",n);if(i==null)return null;let o=cD(e);bV(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=kV(i);c=PV(o[d],f)}return c}function cD(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,c)=>{let d={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};d.relativePath.startsWith("/")&&(yn(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let f=Oi([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(yn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),cD(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:EV(f,i.index),routesMeta:h})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))a(i,o);else for(let d of uD(i.path))a(i,o,d)}),t}function uD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=uD(r.join("/")),c=[];return c.push(...o.map(d=>d===""?i:[i,d].join("/"))),a&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function bV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_V(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const wV=/^:[\w-]+$/,jV=3,SV=2,NV=1,CV=10,AV=-2,F_=e=>e==="*";function EV(e,t){let n=e.split("/"),r=n.length;return n.some(F_)&&(r+=AV),t&&(r+=SV),n.filter(a=>!F_(a)).reduce((a,i)=>a+(wV.test(i)?jV:i===""?NV:CV),r)}function _V(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function PV(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",p=tn({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),g=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:Oi([i,p.pathname]),pathnameBase:$V(Oi([i,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(i=Oi([i,p.pathnameBase]))}return o}function tn(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=OV(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:g,isOptional:y}=h;if(g==="*"){let w=c[p]||"";o=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const j=c[p];return y&&!j?f[g]=void 0:f[g]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function OV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),US(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function kV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return US(!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 ec(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 RV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,TV=e=>RV.test(e);function IV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Ic(e):e,i;if(n)if(TV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),US(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=B_(n.substring(1),"/"):i=B_(n,t)}else i=t;return{pathname:i,search:DV(r),hash:LV(a)}}function B_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Yy(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 MV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qS(e,t){let n=MV(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function WS(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Ic(e):(a=pd({},e),yn(!a.pathname||!a.pathname.includes("?"),Yy("?","pathname","search",a)),yn(!a.pathname||!a.pathname.includes("#"),Yy("#","pathname","hash",a)),yn(!a.search||!a.search.includes("#"),Yy("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,c;if(o==null)c=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),p-=1;a.pathname=g.join("/")}c=p>=0?t[p]:"/"}let d=IV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Oi=e=>e.join("/").replace(/\/\/+/g,"/"),$V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),DV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,LV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function FV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const dD=["post","put","patch","delete"];new Set(dD);const BV=["get",...dD];new Set(BV);function hd(){return hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hd.apply(this,arguments)}const Vm=v.createContext(null),fD=v.createContext(null),Ys=v.createContext(null),Hm=v.createContext(null),vs=v.createContext({outlet:null,matches:[],isDataRoute:!1}),pD=v.createContext(null);function zV(e,t){let{relative:n}=t===void 0?{}:t;Mc()||yn(!1);let{basename:r,navigator:a}=v.useContext(Ys),{hash:i,pathname:o,search:c}=Km(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Oi([r,o])),a.createHref({pathname:d,search:c,hash:i})}function Mc(){return v.useContext(Hm)!=null}function gs(){return Mc()||yn(!1),v.useContext(Hm).location}function hD(e){v.useContext(Ys).static||v.useLayoutEffect(e)}function ya(){let{isDataRoute:e}=v.useContext(vs);return e?nH():UV()}function UV(){Mc()||yn(!1);let e=v.useContext(Vm),{basename:t,future:n,navigator:r}=v.useContext(Ys),{matches:a}=v.useContext(vs),{pathname:i}=gs(),o=JSON.stringify(qS(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return hD(()=>{c.current=!0}),v.useCallback(function(f,h){if(h===void 0&&(h={}),!c.current)return;if(typeof f=="number"){r.go(f);return}let p=WS(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Oi([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const qV=v.createContext(null);function WV(e){let t=v.useContext(vs).outlet;return t&&v.createElement(qV.Provider,{value:e},t)}function Fo(){let{matches:e}=v.useContext(vs),t=e[e.length-1];return t?t.params:{}}function Km(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Ys),{matches:a}=v.useContext(vs),{pathname:i}=gs(),o=JSON.stringify(qS(a,r.v7_relativeSplatPath));return v.useMemo(()=>WS(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function VV(e,t){return HV(e,t)}function HV(e,t,n,r){Mc()||yn(!1);let{navigator:a}=v.useContext(Ys),{matches:i}=v.useContext(vs),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=gs(),h;if(t){var p;let x=typeof t=="string"?Ic(t):t;d==="/"||(p=x.pathname)!=null&&p.startsWith(d)||yn(!1),h=x}else h=f;let g=h.pathname||"/",y=g;if(d!=="/"){let x=d.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(x.length).join("/")}let j=yV(e,{pathname:y}),w=QV(j&&j.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Oi([d,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:Oi([d,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&w?v.createElement(Hm.Provider,{value:{location:hd({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:_i.Pop}},w):w}function KV(){let e=tH(),t=FV(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,null)}const GV=v.createElement(KV,null);class YV extends v.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?v.createElement(vs.Provider,{value:this.props.routeContext},v.createElement(pD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function XV(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(Vm);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(vs.Provider,{value:t},r)}function QV(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,c=(a=n)==null?void 0:a.errors;if(c!=null){let h=o.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);h>=0||yn(!1),o=o.slice(0,Math.min(o.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let p=o[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:g,errors:y}=n,j=p.route.loader&&g[p.route.id]===void 0&&(!y||y[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,p,g)=>{let y,j=!1,w=null,x=null;n&&(y=c&&p.route.id?c[p.route.id]:void 0,w=p.route.errorElement||GV,d&&(f<0&&g===0?(rH("route-fallback"),j=!0,x=null):f===g&&(j=!0,x=p.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,g+1)),N=()=>{let A;return y?A=w:j?A=x:p.route.Component?A=v.createElement(p.route.Component,null):p.route.element?A=p.route.element:A=h,v.createElement(XV,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:A})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?v.createElement(YV,{location:n.location,revalidation:n.revalidation,component:w,error:y,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):N()},null)}var mD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(mD||{}),vD=(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})(vD||{});function JV(e){let t=v.useContext(Vm);return t||yn(!1),t}function ZV(e){let t=v.useContext(fD);return t||yn(!1),t}function eH(e){let t=v.useContext(vs);return t||yn(!1),t}function gD(e){let t=eH(),n=t.matches[t.matches.length-1];return n.route.id||yn(!1),n.route.id}function tH(){var e;let t=v.useContext(pD),n=ZV(),r=gD();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function nH(){let{router:e}=JV(mD.UseNavigateStable),t=gD(vD.UseNavigateStable),n=v.useRef(!1);return hD(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,hd({fromRouteId:t},i)))},[e,t])}const z_={};function rH(e,t,n){z_[e]||(z_[e]=!0)}function aH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function yD(e){let{to:t,replace:n,state:r,relative:a}=e;Mc()||yn(!1);let{future:i,static:o}=v.useContext(Ys),{matches:c}=v.useContext(vs),{pathname:d}=gs(),f=ya(),h=WS(t,qS(c,i.v7_relativeSplatPath),d,a==="path"),p=JSON.stringify(h);return v.useEffect(()=>f(JSON.parse(p),{replace:n,state:r,relative:a}),[f,p,a,n,r]),null}function U_(e){return WV(e.context)}function en(e){yn(!1)}function sH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=_i.Pop,navigator:i,static:o=!1,future:c}=e;Mc()&&yn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:hd({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=Ic(r));let{pathname:h="/",search:p="",hash:g="",state:y=null,key:j="default"}=r,w=v.useMemo(()=>{let x=ec(h,d);return x==null?null:{location:{pathname:x,search:p,hash:g,state:y,key:j},navigationType:a}},[d,h,p,g,y,j,a]);return w==null?null:v.createElement(Ys.Provider,{value:f},v.createElement(Hm.Provider,{children:n,value:w}))}function iH(e){let{children:t,location:n}=e;return VV(k1(t),n)}new Promise(()=>{});function k1(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,a)=>{if(!v.isValidElement(r))return;let i=[...t,a];if(r.type===v.Fragment){n.push.apply(n,k1(r.props.children,i));return}r.type!==en&&yn(!1),!r.props.index||!r.props.children||yn(!1);let o={id:r.props.id||i.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&&(o.children=k1(r.props.children,i)),n.push(o)}),n}function mh(){return mh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mh.apply(this,arguments)}function xD(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function oH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lH(e,t){return e.button===0&&(!t||t==="_self")&&!oH(e)}function R1(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function cH(e,t){let n=R1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const uH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],dH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],fH="6";try{window.__reactRouterVersion=fH}catch{}const pH=v.createContext({isTransitioning:!1}),hH="startTransition",q_=Am[hH];function mH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=mV({window:a,v5Compat:!0}));let o=i.current,[c,d]=v.useState({action:o.action,location:o.location}),{v7_startTransition:f}=r||{},h=v.useCallback(p=>{f&&q_?q_(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>aH(r),[r]),v.createElement(sH,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const vH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yt=v.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,g=xD(t,uH),{basename:y}=v.useContext(Ys),j,w=!1;if(typeof f=="string"&&gH.test(f)&&(j=f,vH))try{let A=new URL(window.location.href),P=f.startsWith("//")?new URL(A.protocol+f):new URL(f),E=ec(P.pathname,y);P.origin===A.origin&&E!=null?f=E+P.search+P.hash:w=!0}catch{}let x=zV(f,{relative:a}),S=bH(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function N(A){r&&r(A),A.defaultPrevented||S(A)}return v.createElement("a",mh({},g,{href:j||x,onClick:w||i?r:N,ref:n,target:d}))}),yH=v.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:o=!1,style:c,to:d,viewTransition:f,children:h}=t,p=xD(t,dH),g=Km(d,{relative:p.relative}),y=gs(),j=v.useContext(fD),{navigator:w,basename:x}=v.useContext(Ys),S=j!=null&&wH(g)&&f===!0,N=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,A=y.pathname,P=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;a||(A=A.toLowerCase(),P=P?P.toLowerCase():null,N=N.toLowerCase()),P&&x&&(P=ec(P,x)||P);const E=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let O=A===N||!o&&A.startsWith(N)&&A.charAt(E)==="/",k=P!=null&&(P===N||!o&&P.startsWith(N)&&P.charAt(N.length)==="/"),R={isActive:O,isPending:k,isTransitioning:S},D=O?r:void 0,U;typeof i=="function"?U=i(R):U=[i,O?"active":null,k?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let z=typeof c=="function"?c(R):c;return v.createElement(yt,mh({},p,{"aria-current":D,className:U,ref:n,style:z,to:d,viewTransition:f}),typeof h=="function"?h(R):h)});var T1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(T1||(T1={}));var W_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(W_||(W_={}));function xH(e){let t=v.useContext(Vm);return t||yn(!1),t}function bH(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=ya(),f=gs(),h=Km(e,{relative:o});return v.useCallback(p=>{if(lH(p,n)){p.preventDefault();let g=r!==void 0?r:hh(f)===hh(h);d(e,{replace:g,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function $c(e){let t=v.useRef(R1(e)),n=v.useRef(!1),r=gs(),a=v.useMemo(()=>cH(r.search,n.current?null:t.current),[r.search]),i=ya(),o=v.useCallback((c,d)=>{const f=R1(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function wH(e,t){t===void 0&&(t={});let n=v.useContext(pH);n==null&&yn(!1);let{basename:r}=xH(T1.useViewTransitionState),a=Km(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=ec(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ec(n.nextLocation.pathname,r)||n.nextLocation.pathname;return tn(a.pathname,o)!=null||tn(a.pathname,i)!=null}var jH=Symbol.for("react.lazy"),vh=Am[" use ".trim().toString()];function SH(e){return typeof e=="object"&&e!==null&&"then"in e}function bD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===jH&&"_payload"in e&&SH(e._payload)}function Gm(e){const t=NH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;bD(i)&&typeof vh=="function"&&(i=vh(i._payload));const c=v.Children.toArray(i),d=c.find(AH);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var Bi=Gm("Slot");function NH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(bD(a)&&typeof vh=="function"&&(a=vh(a._payload)),v.isValidElement(a)){const o=_H(a),c=EH(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var CH=Symbol("radix.slottable");function AH(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===CH}function EH(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function _H(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Xy=768;function PH(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Xy-1}px)`),r=()=>{t(window.innerWidth<Xy)};return n.addEventListener("change",r),t(window.innerWidth<Xy),()=>n.removeEventListener("change",r)},[]),!!e}const VS=Lo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ae=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Bi:"button";return s.jsx(o,{className:Se(VS({variant:t,size:n,className:e})),ref:i,...a})});ae.displayName="Button";const it=v.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:Se("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));it.displayName="Input";var OH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kH=OH.reduce((e,t)=>{const n=Gm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),RH="Separator",V_="horizontal",TH=["horizontal","vertical"],wD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=V_,...a}=e,i=IH(r)?r:V_,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(kH.div,{"data-orientation":i,...c,...a,ref:t})});wD.displayName=RH;function IH(e){return TH.includes(e)}var jD=wD;const SD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(jD,{ref:a,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));SD.displayName=jD.displayName;var Qy="focusScope.autoFocusOnMount",Jy="focusScope.autoFocusOnUnmount",H_={bubbles:!1,cancelable:!0},MH="FocusScope",rf=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=Cn(a),h=Cn(i),p=v.useRef(null),g=pt(t,w=>d(w)),y=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let w=function(A){if(y.paused||!c)return;const P=A.target;c.contains(P)?p.current=P:Ni(p.current,{select:!0})},x=function(A){if(y.paused||!c)return;const P=A.relatedTarget;P!==null&&(c.contains(P)||Ni(p.current,{select:!0}))},S=function(A){if(document.activeElement===document.body)for(const E of A)E.removedNodes.length>0&&Ni(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",x);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),N.disconnect()}}},[r,c,y.paused]),v.useEffect(()=>{if(c){G_.add(y);const w=document.activeElement;if(!c.contains(w)){const S=new CustomEvent(Qy,H_);c.addEventListener(Qy,f),c.dispatchEvent(S),S.defaultPrevented||($H(zH(ND(c)),{select:!0}),document.activeElement===w&&Ni(c))}return()=>{c.removeEventListener(Qy,f),setTimeout(()=>{const S=new CustomEvent(Jy,H_);c.addEventListener(Jy,h),c.dispatchEvent(S),S.defaultPrevented||Ni(w??document.body,{select:!0}),c.removeEventListener(Jy,h),G_.remove(y)},0)}}},[c,f,h,y]);const j=v.useCallback(w=>{if(!n&&!r||y.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(x&&S){const N=w.currentTarget,[A,P]=DH(N);A&&P?!w.shiftKey&&S===P?(w.preventDefault(),n&&Ni(A,{select:!0})):w.shiftKey&&S===A&&(w.preventDefault(),n&&Ni(P,{select:!0})):S===N&&w.preventDefault()}},[n,r,y.paused]);return s.jsx(qe.div,{tabIndex:-1,...o,ref:g,onKeyDown:j})});rf.displayName=MH;function $H(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ni(r,{select:t}),document.activeElement!==n)return}function DH(e){const t=ND(e),n=K_(t,e),r=K_(t.reverse(),e);return[n,r]}function ND(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function K_(e,t){for(const n of e)if(!LH(n,{upTo:t}))return n}function LH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function FH(e){return e instanceof HTMLInputElement&&"select"in e}function Ni(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&FH(e)&&t&&e.select()}}var G_=BH();function BH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Y_(e,t),e.unshift(t)},remove(t){e=Y_(e,t),e[0]?.resume()}}}function Y_(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function zH(e){return e.filter(t=>t.tagName!=="A")}var Zy=0;function Ym(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??X_()),document.body.insertAdjacentElement("beforeend",e[1]??X_()),Zy++,()=>{Zy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zy--}},[])}function X_(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var is=function(){return is=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},is.apply(this,arguments)};function CD(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function UH(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ah="right-scroll-bar-position",sh="width-before-scroll-bar",qH="with-scroll-bars-hidden",WH="--removed-body-scroll-bar-size";function ex(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function VH(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var HH=typeof window<"u"?v.useLayoutEffect:v.useEffect,Q_=new WeakMap;function KH(e,t){var n=VH(null,function(r){return e.forEach(function(a){return ex(a,r)})});return HH(function(){var r=Q_.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||ex(c,null)}),i.forEach(function(c){a.has(c)||ex(c,o)})}Q_.set(n,e)},[e]),n}function GH(e){return e}function YH(e,t){t===void 0&&(t=GH);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(i),o=n}var d=function(){var h=o;o=[],h.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),n}}}};return a}function XH(e){e===void 0&&(e={});var t=YH(null);return t.options=is({async:!0,ssr:!1},e),t}var AD=function(e){var t=e.sideCar,n=CD(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,is({},n))};AD.isSideCarExport=!0;function QH(e,t){return e.useMedium(t),AD}var ED=XH(),tx=function(){},Xm=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:tx,onWheelCapture:tx,onTouchMoveCapture:tx}),a=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,y=e.noRelative,j=e.noIsolation,w=e.inert,x=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,A=e.gapMode,P=CD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,O=KH([n,t]),k=is(is({},P),a);return v.createElement(v.Fragment,null,h&&v.createElement(E,{sideCar:ED,removeScrollBar:f,shards:p,noRelative:y,noIsolation:j,inert:w,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:A}),o?v.cloneElement(v.Children.only(c),is(is({},k),{ref:O})):v.createElement(N,is({},k,{className:d,ref:O}),c))});Xm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xm.classNames={fullWidth:sh,zeroRight:ah};var JH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ZH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=JH();return t&&e.setAttribute("nonce",t),e}function eK(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var nK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ZH())&&(eK(t,n),tK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rK=function(){var e=nK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},_D=function(){var e=rK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},aK={left:0,top:0,right:0,gap:0},nx=function(e){return parseInt(e||"",10)||0},sK=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[nx(n),nx(r),nx(a)]},iK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aK;var t=sK(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},oK=_D(),zl="data-scroll-locked",lK=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
10
|
-
.`.concat(qH,` {
|
|
11
|
-
overflow: hidden `).concat(r,`;
|
|
12
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
13
|
-
}
|
|
14
|
-
body[`).concat(zl,`] {
|
|
15
|
-
overflow: hidden `).concat(r,`;
|
|
16
|
-
overscroll-behavior: contain;
|
|
17
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
18
|
-
padding-left: `.concat(a,`px;
|
|
19
|
-
padding-top: `).concat(i,`px;
|
|
20
|
-
padding-right: `).concat(o,`px;
|
|
21
|
-
margin-left:0;
|
|
22
|
-
margin-top:0;
|
|
23
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
24
|
-
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.`).concat(ah,` {
|
|
28
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(sh,` {
|
|
32
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(ah," .").concat(ah,` {
|
|
36
|
-
right: 0 `).concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(sh," .").concat(sh,` {
|
|
40
|
-
margin-right: 0 `).concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[`).concat(zl,`] {
|
|
44
|
-
`).concat(WH,": ").concat(c,`px;
|
|
45
|
-
}
|
|
46
|
-
`)},J_=function(){var e=parseInt(document.body.getAttribute(zl)||"0",10);return isFinite(e)?e:0},cK=function(){v.useEffect(function(){return document.body.setAttribute(zl,(J_()+1).toString()),function(){var e=J_()-1;e<=0?document.body.removeAttribute(zl):document.body.setAttribute(zl,e.toString())}},[])},uK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;cK();var i=v.useMemo(function(){return iK(a)},[a]);return v.createElement(oK,{styles:lK(i,!t,a,n?"":"!important")})},I1=!1;if(typeof window<"u")try{var Ip=Object.defineProperty({},"passive",{get:function(){return I1=!0,!0}});window.addEventListener("test",Ip,Ip),window.removeEventListener("test",Ip,Ip)}catch{I1=!1}var bl=I1?{passive:!1}:!1,dK=function(e){return e.tagName==="TEXTAREA"},PD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!dK(e)&&n[t]==="visible")},fK=function(e){return PD(e,"overflowY")},pK=function(e){return PD(e,"overflowX")},Z_=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=OD(e,r);if(a){var i=kD(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},OD=function(e,t){return e==="v"?fK(t):pK(t)},kD=function(e,t){return e==="v"?hK(t):mK(t)},vK=function(e,t){return e==="h"&&t==="rtl"?-1:1},gK=function(e,t,n,r,a){var i=vK(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,g=0;do{if(!c)break;var y=kD(e,c),j=y[0],w=y[1],x=y[2],S=w-x-i*j;(j||S)&&OD(e,c)&&(p+=S,g+=j);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(f=!0),f},Mp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eP=function(e){return[e.deltaX,e.deltaY]},tP=function(e){return e&&"current"in e?e.current:e},yK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xK=function(e){return`
|
|
47
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
-
`)},bK=0,wl=[];function wK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(bK++)[0],i=v.useState(_D)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var w=UH([e.lockRef.current],(e.shards||[]).map(tP),!0).filter(Boolean);return w.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),w.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(w,x){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var S=Mp(w),N=n.current,A="deltaX"in w?w.deltaX:N[0]-S[0],P="deltaY"in w?w.deltaY:N[1]-S[1],E,O=w.target,k=Math.abs(A)>Math.abs(P)?"h":"v";if("touches"in w&&k==="h"&&O.type==="range")return!1;var R=window.getSelection(),D=R&&R.anchorNode,U=D?D===O||D.contains(O):!1;if(U)return!1;var z=Z_(k,O);if(!z)return!0;if(z?E=k:(E=k==="v"?"h":"v",z=Z_(k,O)),!z)return!1;if(!r.current&&"changedTouches"in w&&(A||P)&&(r.current=E),!E)return!0;var L=r.current||E;return gK(L,x,w,L==="h"?A:P)},[]),d=v.useCallback(function(w){var x=w;if(!(!wl.length||wl[wl.length-1]!==i)){var S="deltaY"in x?eP(x):Mp(x),N=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&yK(E.delta,S)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}if(!N){var A=(o.current.shards||[]).map(tP).filter(Boolean).filter(function(E){return E.contains(x.target)}),P=A.length>0?c(x,A[0]):!o.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),f=v.useCallback(function(w,x,S,N){var A={name:w,delta:x,target:S,should:N,shadowParent:jK(S)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(P){return P!==A})},1)},[]),h=v.useCallback(function(w){n.current=Mp(w),r.current=void 0},[]),p=v.useCallback(function(w){f(w.type,eP(w),w.target,c(w,e.lockRef.current))},[]),g=v.useCallback(function(w){f(w.type,Mp(w),w.target,c(w,e.lockRef.current))},[]);v.useEffect(function(){return wl.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,bl),document.addEventListener("touchmove",d,bl),document.addEventListener("touchstart",h,bl),function(){wl=wl.filter(function(w){return w!==i}),document.removeEventListener("wheel",d,bl),document.removeEventListener("touchmove",d,bl),document.removeEventListener("touchstart",h,bl)}},[]);var y=e.removeScrollBar,j=e.inert;return v.createElement(v.Fragment,null,j?v.createElement(i,{styles:xK(a)}):null,y?v.createElement(uK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SK=QH(ED,wK);var af=v.forwardRef(function(e,t){return v.createElement(Xm,is({},e,{ref:t,sideCar:SK}))});af.classNames=Xm.classNames;var NK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jl=new WeakMap,$p=new WeakMap,Dp={},rx=0,RD=function(e){return e&&(e.host||RD(e.parentNode))},CK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=RD(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},AK=function(e,t,n,r){var a=CK(t,Array.isArray(e)?e:[e]);Dp[n]||(Dp[n]=new WeakMap);var i=Dp[n],o=[],c=new Set,d=new Set(a),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};a.forEach(f);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(c.has(g))h(g);else try{var y=g.getAttribute(r),j=y!==null&&y!=="false",w=(jl.get(g)||0)+1,x=(i.get(g)||0)+1;jl.set(g,w),i.set(g,x),o.push(g),w===1&&j&&$p.set(g,!0),x===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return h(t),c.clear(),rx++,function(){o.forEach(function(p){var g=jl.get(p)-1,y=i.get(p)-1;jl.set(p,g),i.set(p,y),g||($p.has(p)||p.removeAttribute(r),$p.delete(p)),y||p.removeAttribute(n)}),rx--,rx||(jl=new WeakMap,jl=new WeakMap,$p=new WeakMap,Dp={})}},Qm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=NK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),AK(r,a,n,"aria-hidden")):function(){return null}};function EK(e){const t=_K(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(OK);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function _K(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=RK(a),c=kK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var PK=Symbol("radix.slottable");function OK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===PK}function kK(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function RK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jm="Dialog",[TD,ID]=er(Jm),[TK,Wa]=TD(Jm),MD=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,c=v.useRef(null),d=v.useRef(null),[f,h]=Zr({prop:r,defaultProp:a??!1,onChange:i,caller:Jm});return s.jsx(TK,{scope:t,triggerRef:c,contentRef:d,contentId:Bn(),titleId:Bn(),descriptionId:Bn(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};MD.displayName=Jm;var $D="DialogTrigger",DD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa($D,n),i=pt(t,a.triggerRef);return s.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":GS(a.open),...r,ref:i,onClick:Pe(e.onClick,a.onOpenToggle)})});DD.displayName=$D;var HS="DialogPortal",[IK,LD]=TD(HS,{forceMount:void 0}),FD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Wa(HS,t);return s.jsx(IK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(Un,{present:n||i.open,children:s.jsx(Oc,{asChild:!0,container:a,children:o})}))})};FD.displayName=HS;var gh="DialogOverlay",BD=v.forwardRef((e,t)=>{const n=LD(gh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Wa(gh,e.__scopeDialog);return i.modal?s.jsx(Un,{present:r||i.open,children:s.jsx($K,{...a,ref:t})}):null});BD.displayName=gh;var MK=EK("DialogOverlay.RemoveScroll"),$K=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa(gh,n);return s.jsx(af,{as:MK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(qe.div,{"data-state":GS(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ao="DialogContent",zD=v.forwardRef((e,t)=>{const n=LD(Ao,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Wa(Ao,e.__scopeDialog);return s.jsx(Un,{present:r||i.open,children:i.modal?s.jsx(DK,{...a,ref:t}):s.jsx(LK,{...a,ref:t})})});zD.displayName=Ao;var DK=v.forwardRef((e,t)=>{const n=Wa(Ao,e.__scopeDialog),r=v.useRef(null),a=pt(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return Qm(i)},[]),s.jsx(UD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Pe(e.onFocusOutside,i=>i.preventDefault())})}),LK=v.forwardRef((e,t)=>{const n=Wa(Ao,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(UD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),UD=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Wa(Ao,n),d=v.useRef(null),f=pt(t,d);return Ym(),s.jsxs(s.Fragment,{children:[s.jsx(rf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Do,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":GS(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(BK,{titleId:c.titleId}),s.jsx(UK,{contentRef:d,descriptionId:c.descriptionId})]})]})}),KS="DialogTitle",qD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa(KS,n);return s.jsx(qe.h2,{id:a.titleId,...r,ref:t})});qD.displayName=KS;var WD="DialogDescription",VD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa(WD,n);return s.jsx(qe.p,{id:a.descriptionId,...r,ref:t})});VD.displayName=WD;var HD="DialogClose",KD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa(HD,n);return s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>a.onOpenChange(!1))})});KD.displayName=HD;function GS(e){return e?"open":"closed"}var GD="DialogTitleWarning",[FK,YD]=P7(GD,{contentName:Ao,titleName:KS,docsSlug:"dialog"}),BK=({titleId:e})=>{const t=YD(GD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
-
|
|
51
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
-
|
|
53
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},zK="DialogDescriptionWarning",UK=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${YD(zK).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Zm=MD,qK=DD,ev=FD,Dc=BD,Lc=zD,sf=qD,of=VD,tv=KD;const XD=Zm,WK=ev,QD=v.forwardRef(({className:e,...t},n)=>s.jsx(Dc,{className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));QD.displayName=Dc.displayName;const VK=Lo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),YS=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(WK,{children:[s.jsx(QD,{}),s.jsxs(Lc,{ref:a,className:Se(VK({side:e}),t),...r,children:[n,s.jsxs(tv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Mi,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));YS.displayName=Lc.displayName;const JD=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});JD.displayName="SheetHeader";const ZD=v.forwardRef(({className:e,...t},n)=>s.jsx(sf,{ref:n,className:Se("text-lg font-semibold text-foreground",e),...t}));ZD.displayName=sf.displayName;const HK=v.forwardRef(({className:e,...t},n)=>s.jsx(of,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));HK.displayName=of.displayName;function nP({className:e,...t}){return s.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}const KK="sidebar:state",GK=3600*24*7,YK="16rem",XK="18rem",QK="3rem",JK="b",e3=v.createContext(null);function lf(){const e=v.useContext(e3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const t3=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=PH(),[f,h]=v.useState(!1),[p,g]=v.useState(e),y=t??p,j=v.useCallback(N=>{const A=typeof N=="function"?N(y):N;n?n(A):g(A),document.cookie=`${KK}=${A}; path=/; max-age=${GK}`},[n,y]),w=v.useCallback(()=>d?h(N=>!N):j(N=>!N),[d,j,h]);v.useEffect(()=>{const N=A=>{A.key===JK&&(A.metaKey||A.ctrlKey)&&(A.preventDefault(),w())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[w]);const x=y?"expanded":"collapsed",S=v.useMemo(()=>({state:x,open:y,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:w}),[x,y,j,d,f,h,w]);return s.jsx(e3.Provider,{value:S,children:s.jsx(eD,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":YK,"--sidebar-width-icon":QK,...a},className:Se("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});t3.displayName="SidebarProvider";const n3=v.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,...i},o)=>{const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=lf();return n==="none"?s.jsx("div",{className:Se("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(XD,{open:f,onOpenChange:h,...i,children:s.jsx(YS,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":XK},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):s.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,children:[s.jsx("div",{className:Se("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:Se("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});n3.displayName="Sidebar";const r3=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=lf();return s.jsxs(ae,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Se("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(MU,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});r3.displayName="SidebarTrigger";const ZK=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=lf();return s.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Se("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});ZK.displayName="SidebarRail";const eG=v.forwardRef(({className:e,...t},n)=>s.jsx("main",{ref:n,className:Se("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));eG.displayName="SidebarInset";const tG=v.forwardRef(({className:e,...t},n)=>s.jsx(it,{ref:n,"data-sidebar":"input",className:Se("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));tG.displayName="SidebarInput";const a3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:Se("flex flex-col gap-2 p-2",e),...t}));a3.displayName="SidebarHeader";const s3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:Se("flex flex-col gap-2 p-2",e),...t}));s3.displayName="SidebarFooter";const M1=v.forwardRef(({className:e,...t},n)=>s.jsx(SD,{ref:n,"data-sidebar":"separator",className:Se("mx-2 w-auto bg-sidebar-border",e),...t}));M1.displayName="SidebarSeparator";const i3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:Se("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));i3.displayName="SidebarContent";const o3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:Se("relative flex w-full min-w-0 flex-col p-2",e),...t}));o3.displayName="SidebarGroup";const l3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Bi:"div";return s.jsx(a,{ref:r,"data-sidebar":"group-label",className:Se("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});l3.displayName="SidebarGroupLabel";const nG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Bi:"button";return s.jsx(a,{ref:r,"data-sidebar":"group-action",className:Se("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});nG.displayName="SidebarGroupAction";const c3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:Se("w-full text-sm",e),...t}));c3.displayName="SidebarGroupContent";const u3=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:Se("flex w-full min-w-0 flex-col gap-1",e),...t}));u3.displayName="SidebarMenu";const d3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Se("group/menu-item relative",e),...t}));d3.displayName="SidebarMenuItem";const rG=Lo("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),f3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?Bi:"button",{isMobile:f,state:h}=lf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Se(rG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(tD,{children:[s.jsx(nD,{asChild:!0,children:p}),s.jsx(FS,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});f3.displayName="SidebarMenuButton";const aG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Bi:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:Se("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});aG.displayName="SidebarMenuAction";const sG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Se("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));sG.displayName="SidebarMenuBadge";const iG=v.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const a=v.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Se("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(nP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(nP,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});iG.displayName="SidebarMenuSkeleton";const oG=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Se("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));oG.displayName="SidebarMenuSub";const lG=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));lG.displayName="SidebarMenuSubItem";const cG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Bi:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:Se("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...a})});cG.displayName="SidebarMenuSubButton";const p3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(yH,{ref:i,to:r,className:({isActive:o,isPending:c})=>Se(e,o&&t,c&&n),...a}));p3.displayName="NavLink";function uG({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...a}){const i=`grad-${v.useId().slice(1)}`;return s.jsxs("svg",{className:"inline-block",width:e,height:t,viewBox:"0 0 1648 1648",xmlns:"http://www.w3.org/2000/svg",...a,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:n}}),s.jsx("stop",{offset:"100%",style:{stopColor:r}})]})}),s.jsx("path",{d:"m610 216.654c-66.158 4.092-126.119 35.849-164.917 87.346-8.408 11.16-13.344 19.191-19.983 32.513-12.431 24.946-19.521 50.434-22.11 79.487-1.665 18.687-.854 826.238.841 837.939 7.867 54.284 32.465 101.134 70.706 134.667 16.297 14.291 32.283 24.657 53.963 34.991 16.889 8.05 34.568 13.468 60.5 18.541 9.019 1.764 52.201 1.795 61.5.044 26.487-4.989 43.97-10.341 61-18.675 15.131-7.406 21.53-11.135 60.5-35.267 20.813-12.887 23.095-14.298 29.5-18.24l13-8 13-8c6.901-4.247 12.593-7.767 29.54-18.271 5.796-3.593 12.771-7.863 15.5-9.49 2.728-1.626 8.56-5.19 12.96-7.921 4.4-2.73 72.575-44.711 151.5-93.29s150.925-92.918 160-98.531c9.075-5.612 24.15-14.936 33.5-20.719s23.075-14.234 30.5-18.78c85.169-52.142 120.029-73.942 130.014-81.304 40.974-30.211 68.344-69.764 81.788-118.194 13.864-49.94 8.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5 77.269c-39.541 6.402-76.013 29.73-97.661 62.467-13.001 19.66-19.718 38.39-22.802 63.584-1.472 12.028-1.434 802.191.04 818.026 1.861 19.998 6.142 35.48 14.415 52.133 17.942 36.114 53.025 64.18 91.508 73.203 3.575.839 8.975 2.118 12 2.844 8.221 1.973 40.343 1.613 49.971-.56 32.301-7.289 65.233-26.686 94.817-55.849 15.26-15.042 22.884-24.803 33.571-42.979 13.939-23.706 20.949-43.36 27.745-77.792 1.004-5.086 1.428-50 1.949-206.5.465-139.686 1.001-201.809 1.777-206 .611-3.3 1.608-9.15 2.217-13 1.672-10.583 4.039-21.117 7.191-32 8.179-28.247 20.714-55.13 37.188-79.751 24.262-36.262 53.189-63.572 93.074-87.872 4.95-3.016 12.825-7.435 17.5-9.82s8.95-4.668 9.5-5.074c3.565-2.63 34.688-13.266 52.465-17.93 6.2-1.627 11.49-3.174 11.754-3.439 1.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5 305.564c-5.775.685-11.625 1.491-13 1.792-1.375.3-5.2 1.088-8.5 1.749-7.914 1.587-27.103 7.461-36.5 11.174-38.797 15.33-75.171 44.925-98.829 80.41-11.24 16.86-21.329 38.407-26.167 55.888-2.443 8.825-3.85 14.608-4.866 20-.621 3.3-1.653 8.475-2.292 11.5-.846 4.008-1.345 59.624-1.837 205-.618 182.331-.824 200.361-2.399 209.5-1.629 9.459-4.196 22.506-6.744 34.279-.628 2.903-.881 5.54-.561 5.859.596.596 455.986-279.084 472.195-290.001 17.547-11.819 36.335-33.412 46.291-53.203 3.956-7.863 9.527-23.924 11.597-33.434 4.848-22.272 3.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25 1048.256c3.988.189 10.513.189 14.5 0 3.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346",fill:`url(#${i})`,fillRule:"evenodd"})]})}const dG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:l$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:o$},{title:"Analyze MCP",url:"/tool-analysis",icon:c$}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:i$},{title:"Servers",url:"/libraries/servers",icon:s$},{title:"Agents",url:"/libraries/agents",icon:fa}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:Ll},{title:"Evaluation Results",url:"/results",icon:ld},{title:"Compare Evaluations",url:"/compare",icon:CS},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:u$},{title:"Custom Reports",url:"/markdown-reports",icon:lh}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:ES}]}];function fG(e={version:null}){const t=e.version??null,{state:n}=lf(),r=n==="collapsed",a=gs(),i=v.useMemo(()=>dG,[]);return s.jsxs(n3,{collapsible:"icon",children:[s.jsx(a3,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:s.jsxs("div",{className:`flex items-center ${r?"justify-center":"gap-2.5"} overflow-hidden`,children:[s.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-accent/50 border border-primary/60",children:s.jsx(uG,{width:22,height:22,from:"#f97316",to:"#fb923c"})}),!r&&s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm font-semibold text-sidebar-foreground",children:"MCPLab"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Evaluation Lab"})]})]})}),s.jsx(i3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(M1,{className:"my-1.5"}),s.jsxs(o3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(l3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(c3,{children:s.jsx(u3,{children:o.items.map(d=>s.jsx(d3,{children:s.jsx(f3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(p3,{to:d.url,end:d.url==="/",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground",children:[s.jsx(d.icon,{className:"h-4 w-4"}),s.jsx("span",{children:d.title})]})})},d.title))})})]})]},o.title))}),s.jsxs(s3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(M1,{className:"my-1.5"}),s.jsxs("div",{className:`flex ${r?"justify-center":"items-center justify-center gap-2"} w-full`,children:[s.jsxs("a",{href:"https://github.com/inspectr-hq/mcp-lab",target:"_blank",rel:"noreferrer",className:`inline-flex items-center rounded-md border border-sidebar-border/70 bg-sidebar-accent/20 text-sidebar-foreground/85 transition-colors hover:bg-sidebar-accent/35 hover:text-sidebar-foreground ${r?"justify-center p-2":"gap-2 px-2.5 py-1.5"}`,title:`GitHub${t?` · v${t}`:""}`,"aria-label":"GitHub repository",children:[s.jsx(RU,{className:"h-4 w-4 shrink-0"}),!r&&s.jsx("span",{className:"text-xs text-sidebar-foreground/85",children:`v${t??"unknown"}`})]}),!r&&s.jsxs("a",{href:"https://inspectr.dev",target:"_blank",rel:"noreferrer",className:"text-xs text-muted-foreground transition-colors hover:text-sidebar-foreground",children:["Built by ",s.jsx("span",{className:"text-[#00e5ff] hover:text-[#00b8d4]",children:"Inspectr"})]})]})]})]})}const h3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));h3.displayName="Breadcrumb";const m3=v.forwardRef(({className:e,...t},n)=>s.jsx("ol",{ref:n,className:Se("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));m3.displayName="BreadcrumbList";const v3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:Se("inline-flex items-center gap-1.5",e),...t}));v3.displayName="BreadcrumbItem";const g3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?Bi:"a";return s.jsx(a,{ref:r,className:Se("transition-colors hover:text-foreground",t),...n})});g3.displayName="BreadcrumbLink";const y3=v.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Se("font-normal text-foreground",e),...t}));y3.displayName="BreadcrumbPage";const x3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:Se("[&>svg]:size-3.5",t),...n,children:e??s.jsx(a$,{})});x3.displayName="BreadcrumbSeparator";function pG(e,t){return`${e}-${t+1}`}function El(e){const t=typeof e.config.name=="string"&&e.config.name.trim().length>0?e.config.name.trim():void 0,n=Array.isArray(e.config.servers)?e.config.servers:[],r=Array.isArray(e.config.agents)?e.config.agents:[],a=new Map,i=[],o=[];for(const p of n){if("ref"in p){const x=String(p.ref||"").trim();if(!x)continue;a.set(x,x),o.push({kind:"referenced",ref:x});continue}const g=String(p.id||p.name||"").trim();if(!g)continue;const y=g;a.set(g,y);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",w={id:y,name:String(p.name||g),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.env:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"?p.auth.scope:void 0};i.push(w),o.push({kind:"inline",server:w})}const c=[],d=[];for(const p of r){if("ref"in p){const x=String(p.ref||"").trim();if(!x)continue;d.push({kind:"referenced",ref:x});continue}const g=String(p.id||p.name||"").trim();if(!g)continue;const y=g,j=p.provider==="azure_openai"?"azure":p.provider,w={id:y,name:String(p.name||g),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,systemPrompt:p.system};c.push(w),d.push({kind:"inline",agent:w})}const f=[],h=[];return e.config.scenarios.forEach((p,g)=>{if("ref"in p){const w=String(p.ref||"").trim();if(!w)return;h.push({kind:"referenced",ref:w});return}const y=[];for(const w of p.eval?.tool_constraints?.required_tools??[])y.push({type:"required_tool",value:w});for(const w of p.eval?.tool_constraints?.forbidden_tools??[])y.push({type:"forbidden_tool",value:w});for(const w of p.eval?.response_assertions??[])w.type==="regex"?y.push({type:"response_contains",value:w.pattern}):y.push({type:"response_contains",value:`${w.path}${w.equals!==void 0?` == ${w.equals}`:""}`});const j={id:p.id||pG("scn",g),name:p.name||p.id||`Scenario ${g+1}`,serverIds:p.servers.map(w=>a.get(w)).filter(Boolean),prompt:p.prompt,snapshotEval:p.snapshot_eval?{enabled:p.snapshot_eval.enabled,baselineSnapshotId:p.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:p.snapshot_eval.baseline_source_run_id,lastUpdatedAt:p.snapshot_eval.last_updated_at}:void 0,evalRules:y,extractRules:(p.extract??[]).map(w=>({name:w.name,pattern:w.regex}))};f.push(j),h.push({kind:"inline",scenario:j})}),{id:e.id,name:t||e.name,configName:t,description:e.path,loadError:e.error,loadWarnings:e.warnings,servers:i,serverEntries:o,agents:c,agentEntries:d,scenarios:f,scenarioEntries:h,runDefaults:e.config.run_defaults?.selected_agents&&e.config.run_defaults.selected_agents.length>0?{selectedAgentNames:[...e.config.run_defaults.selected_agents]}:void 0,snapshotEval:e.config.snapshot_eval?{enabled:e.config.snapshot_eval.enabled,mode:e.config.snapshot_eval.mode,baselineSnapshotId:e.config.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.config.snapshot_eval.baseline_source_run_id,lastUpdatedAt:e.config.snapshot_eval.last_updated_at}:void 0,createdAt:e.mtime,updatedAt:e.mtime,sourcePath:e.path}}function hG(e){const t={id:"library",name:"library",path:"library",mtime:new Date(0).toISOString(),config:{servers:Object.entries(e.servers).map(([r,a])=>({id:r,name:a.name||r,transport:a.transport,url:a.url,auth:a.auth})),agents:Object.entries(e.agents).map(([r,a])=>({id:r,name:a.name||r,provider:a.provider,model:a.model,temperature:a.temperature,max_tokens:a.max_tokens,system:a.system})),scenarios:e.scenarios}},n=El(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function rP(e){const t=new Map,n=g=>{const y=g.id;return{id:y,...g.name&&g.name!==y?{name:g.name}:{},transport:"http",url:g.url||"http://localhost:3000/mcp",auth:g.authType==="bearer"?{type:"bearer",env:g.authValue||"MCP_TOKEN"}:g.authType==="oauth2"?{type:"oauth_authorization_code",client_id:g.oauthClientId||"",client_secret:g.oauthClientSecret||void 0,redirect_url:g.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:g.oauthScope||void 0}:void 0}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(g=>({kind:"inline",server:g}))],a=new Set,i=r.flatMap(g=>{if(g.kind==="referenced"){const j=String(g.ref||"").trim();return!j||a.has(j)?[]:(a.add(j),t.set(j,j),[{ref:j}])}const y=n(g.server);return t.set(g.server.id,y.id),[y]}),o=g=>{const y=g.id;return{id:y,...g.name&&g.name!==y?{name:g.name}:{},provider:g.provider==="azure"?"azure_openai":g.provider==="anthropic"?"anthropic":"openai",model:g.model,temperature:g.temperature,max_tokens:g.maxTokens,system:g.systemPrompt}},c=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(g=>({kind:"inline",agent:g}))],d=new Set,f=c.flatMap(g=>{if(g.kind==="referenced"){const y=String(g.ref||"").trim();return!y||d.has(y)?[]:(d.add(y),[{ref:y}])}return[o(g.agent)]}),h=g=>{const y=g.evalRules.filter(x=>x.type==="required_tool").map(x=>x.value),j=g.evalRules.filter(x=>x.type==="forbidden_tool").map(x=>x.value),w=g.evalRules.filter(x=>x.type==="response_contains"||x.type==="response_not_contains").map(x=>({type:"regex",pattern:x.value}));return{id:g.id,name:g.name||void 0,servers:g.serverIds.map(x=>t.get(x)).filter(Boolean),prompt:g.prompt,...g.snapshotEval?{snapshot_eval:{enabled:g.snapshotEval.enabled,baseline_snapshot_id:g.snapshotEval.baselineSnapshotId,baseline_source_run_id:g.snapshotEval.baselineSourceRunId,last_updated_at:g.snapshotEval.lastUpdatedAt}}:{},eval:{tool_constraints:{required_tools:y,forbidden_tools:j},response_assertions:w},extract:g.extractRules.map(x=>({name:x.name,from:"final_text",regex:x.pattern}))}},p=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(g=>g.kind==="referenced"?{ref:g.ref}:h(g.scenario)):[...e.scenarios.map(g=>h(g))];return{name:e.configName?.trim()||void 0,servers:i,agents:f,scenarios:p,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0,snapshot_eval:e.snapshotEval?{enabled:e.snapshotEval.enabled,mode:e.snapshotEval.mode,baseline_snapshot_id:e.snapshotEval.baselineSnapshotId,baseline_source_run_id:e.snapshotEval.baselineSourceRunId,last_updated_at:e.snapshotEval.lastUpdatedAt}:void 0}}function mG(e){const t=Object.fromEntries(e.servers.map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?{type:"bearer",env:r.authValue||"MCP_TOKEN"}:r.authType==="oauth2"?{type:"oauth_authorization_code",client_id:r.oauthClientId||"",client_secret:r.oauthClientSecret||void 0,redirect_url:r.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:r.oauthScope||void 0}:void 0}])),n=Object.fromEntries(e.agents.map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},provider:r.provider==="azure"?"azure_openai":r.provider==="anthropic"?"anthropic":"openai",model:r.model,temperature:r.temperature,max_tokens:r.maxTokens,system:r.systemPrompt}]));return{servers:t,agents:n,scenarios:e.scenarios.map(r=>({id:r.id,name:r.name||void 0,servers:r.serverIds,prompt:r.prompt,snapshot_eval:r.snapshotEval?{enabled:r.snapshotEval.enabled,baseline_snapshot_id:r.snapshotEval.baselineSnapshotId,baseline_source_run_id:r.snapshotEval.baselineSourceRunId,last_updated_at:r.snapshotEval.lastUpdatedAt}:void 0,eval:{tool_constraints:{required_tools:r.evalRules.filter(a=>a.type==="required_tool").map(a=>a.value),forbidden_tools:r.evalRules.filter(a=>a.type==="forbidden_tool").map(a=>a.value)},response_assertions:r.evalRules.filter(a=>a.type==="response_contains"||a.type==="response_not_contains").map(a=>({type:"regex",pattern:a.value}))},extract:r.extractRules.map(a=>({name:a.name,from:"final_text",regex:a.pattern}))}))}}function vG(e,t){if(e)return`${e}::${t??""}`}function Lp(e){return e.type==="text"}function gG(e,t){if(!t)return e.tool_calls.map((a,i)=>({name:a,arguments:{},duration:e.tool_durations_ms[i]??0,timestamp:new Date().toISOString()}));const n=[],r=new Map;for(const a of t.messages)for(const i of a.content)i.type==="tool_use"?n.push({id:i.id,name:i.name,input:i.input??{},ts:a.ts}):i.type==="tool_result"&&r.set(i.tool_use_id,{durationMs:i.duration_ms,tsEnd:i.ts_end});return n.map((a,i)=>{const o=r.get(a.id);return{name:a.name,arguments:a.input,duration:o?.durationMs??e.tool_durations_ms[i]??0,timestamp:o?.tsEnd??a.ts??new Date().toISOString()}})}function yG(e,t){const n=[];if(!e)return n;let r;const a=e.messages??[];for(let i=0;i<a.length;i+=1){const o=a[i];if(o.role==="user"){const c=o.content.filter(Lp);for(const d of c)n.push({id:`user_prompt-${n.length}`,kind:"user_prompt",text:d.text,timestamp:o.ts});continue}if(o.role==="assistant"){const c=o.content.filter(h=>h.type==="tool_use");for(const h of o.content)h.type==="text"&&(n.push({id:`assistant_thought-${n.length}`,kind:"assistant_thought",text:h.text,timestamp:o.ts}),r=n.length-1);const d=a[i+1],f=d?.role==="tool";if(c.length>0&&f){const h=new Map,p=[];for(const g of d.content)g.type==="tool_result"&&(g.tool_use_id?h.set(g.tool_use_id,g):p.push(g));for(const g of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:aP(g.input??{}),toolName:g.name,timestamp:o.ts});const y=h.get(g.id);if(!y)continue;const j=y.content.filter(Lp).map(w=>w.text).join(`
|
|
54
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,toolName:y.name,ok:!y.is_error,durationMs:y.duration_ms,timestamp:y.ts_end??d.ts}),h.delete(g.id)}for(const g of[...h.values(),...p]){const y=g.content.filter(Lp).map(j=>j.text).join(`
|
|
55
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:y,toolName:g.name,ok:!g.is_error,durationMs:g.duration_ms,timestamp:g.ts_end??d.ts})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:aP(h.input??{}),toolName:h.name,timestamp:o.ts});continue}if(o.role==="tool")for(const c of o.content){if(c.type!=="tool_result")continue;const d=c.content.filter(Lp).map(f=>f.text).join(`
|
|
56
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:d,toolName:c.name,ok:!c.is_error,durationMs:c.duration_ms,timestamp:c.ts_end??o.ts})}}return typeof r=="number"&&n[r]&&(n[r]={...n[r],kind:"assistant_final"}),n}function aP(e){try{return JSON.stringify(e)}catch{return String(e)}}function sP(e,t=[]){const n=new Map;for(const a of t){const i=vG(a.scenario_id,a.agent);if(!i)continue;const o=n.get(i)??[];o.push(a),n.set(i,o)}const r=e.scenarios.map(a=>{const i=n.get(`${a.scenario_id}::${a.agent}`)??[],o=new Map;for(const h of i)o.set(h.run_index,h);const c=a.runs.map((h,p)=>{const g=o.get(h.run_index)??i[p];return{runIndex:h.run_index,passed:h.pass,toolCalls:gG(h,g),finalAnswer:h.final_text,conversation:yG(g),duration:h.tool_durations_ms.reduce((y,j)=>y+j,0),extractedValues:Object.fromEntries(Object.entries(h.extracted).map(([y,j])=>[y,String(j??"")])),failureReasons:h.failures}}),d=c.length===0?0:Math.round(c.reduce((h,p)=>h+p.duration,0)/c.length),f=c.length===0?0:c.reduce((h,p)=>h+p.toolCalls.length,0)/c.length;return{scenarioId:a.scenario_id,scenarioName:a.scenario_name||a.scenario_id,agentId:a.agent,agentName:a.agent,runs:c,passRate:a.pass_rate,avgToolCalls:f,avgDuration:d}});return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,timestamp:e.metadata.timestamp,scenarios:r,overallPassRate:e.summary.pass_rate,totalScenarios:e.summary.total_scenarios,totalRuns:e.summary.total_runs,avgToolCalls:e.summary.avg_tool_calls_per_run,avgLatency:Math.round(e.summary.avg_tool_latency_ms??0),snapshotEval:e.metadata.snapshot_eval?{applied:e.metadata.snapshot_eval.applied,mode:e.metadata.snapshot_eval.mode,baselineSnapshotId:e.metadata.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.metadata.snapshot_eval.baseline_source_run_id,overallScore:e.metadata.snapshot_eval.overall_score,status:e.metadata.snapshot_eval.status,impactedScenarios:e.metadata.snapshot_eval.impacted_scenarios}:void 0}}function xG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Zu=xG();async function ft(e,t){const n=await fetch(`${Zu}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return await n.json()}async function bG(e,t){const n=await fetch(`${Zu}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return n.text()}const lt={health:()=>ft("/api/health"),getSettings:()=>ft("/api/settings"),updateSettings:e=>ft("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>ft("/api/evals"),createConfig:(e,t)=>ft("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>ft(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>ft(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>ft("/api/runs"),listMarkdownReports:()=>ft("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>ft(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>ft(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>ft(`/api/runs/${e}`),deleteRun:e=>ft(`/api/runs/${e}`,{method:"DELETE"}),getRunTrace:e=>ft(`/api/runs/${e}/trace`),listSnapshots:()=>ft("/api/snapshots"),createSnapshotFromRun:(e,t)=>ft("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>ft(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>ft(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>ft(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>ft(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>ft("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>ft(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>ft(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>ft(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>ft(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>ft(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>ft("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>ft(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>ft("/api/libraries"),saveLibraries:e=>ft("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>ft("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>ft(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>ft("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>ft(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>ft(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>ft(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>ft(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>ft(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>ft("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>ft("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>ft(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>ft(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${Zu}/api/tool-analysis/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},listToolAnalysisResults:()=>ft("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>ft(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>ft(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>ft("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>ft(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>ft(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${Zu}/api/oauth-debugger/sessions/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error"||c.type==="stopped")&&a()}catch{}};return["started","step_started","step_completed","step_failed","http_request","http_response","validation","log","waiting_for_user","waiting_for_browser_callback","completed","error","stopped"].forEach(o=>n.addEventListener(o,i)),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},submitOAuthDebuggerManualCallback:(e,t)=>ft(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>ft(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?ft(`/api/oauth-debugger/sessions/${e}/export?format=json`):bG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),stopRun:e=>ft(`/api/runs/jobs/${e}/stop`,{method:"POST"}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Zu}/api/runs/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>{a()}}};function wG(e){if(e.sourcePath){const t=e.sourcePath.split("/");return t[t.length-1].replace(/\.(yaml|yml)$/i,"")}return e.name||`config-${Date.now()}`}function jG(e){return e||`config-${Date.now()}`}const SG={async listConfigs(){return(await lt.listConfigs()).map(El)},async createConfig(e){const t=await lt.createConfig(wG(e),rP(e));return El(t)},async updateConfig(e){const t=await lt.updateConfig(e.id,rP(e),jG(e.name));return El(t)},async deleteConfig(e){await lt.deleteConfig(e)},async listResults(){const t=(await lt.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([lt.getRun(n.runId),lt.getRunTrace(n.runId)]);return sP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([lt.getRun(e),lt.getRunTrace(e)]);return sP(t,n.records)}catch{return}},async deleteResult(e){await lt.deleteRun(e)},async listMarkdownReports(){return lt.listMarkdownReports()},async getMarkdownReport(e){return lt.getMarkdownReport(e)},async deleteMarkdownReport(e){await lt.deleteMarkdownReport(e)},async startRun(e){return lt.startRun(e)},async stopRun(e){await lt.stopRun(e)},subscribeRunJob(e,t){return lt.subscribeRunJob(e,t)},async listSnapshots(){return lt.listSnapshots()},async createSnapshotFromRun(e,t){return lt.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await lt.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return lt.compareSnapshot(e,t)},async askResultAssistant(e,t){return lt.askResultAssistant(e,t)},async applyResultAssistantReport(e){return lt.applyResultAssistantReport(e)},async createResultAssistantSession(e){return lt.createResultAssistantSession(e)},async getResultAssistantSession(e){return lt.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return lt.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return lt.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return lt.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await lt.closeResultAssistantSession(e)},async generateSnapshotEvalBaseline(e,t,n){const r=await lt.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:El(r.config)}},async updateSnapshotPolicy(e,t){const n=await lt.updateSnapshotPolicy(e,t);return El(n)},async getLibraries(){const e=await lt.getLibraries();return hG(e)},async saveLibraries(e){await lt.saveLibraries(mG(e))},async listProviderModels(e){return lt.listProviderModels(e)},async getWorkspaceSettings(){return lt.getSettings()},async updateWorkspaceSettings(e){return lt.updateSettings(e)},async createScenarioAssistantSession(e){return lt.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return lt.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return lt.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return lt.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return lt.denyScenarioAssistantToolCall(e,t)},async closeScenarioAssistantSession(e){await lt.closeScenarioAssistantSession(e)},async discoverToolsForAnalysis(e){return lt.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return lt.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return lt.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return lt.getToolAnalysisResult(e)},async stopToolAnalysis(e){return lt.stopToolAnalysis(e)},async listToolAnalysisResults(){return lt.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return lt.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await lt.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return lt.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return lt.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return lt.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return lt.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return lt.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return lt.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return lt.exportOAuthDebuggerSession(e,t)}},b3=v.createContext(null);function NG({children:e}){const t="workspace",[n,r]=v.useState("checking"),[a,i]=v.useState(null);v.useEffect(()=>{r("checking"),lt.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=v.useMemo(()=>SG,[]);return s.jsx(b3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function An(){const e=v.useContext(b3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const CG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(tn("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(tn("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(tn("/settings",e))return t.push({label:"Settings"}),t;if(tn("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(tn("/tool-analysis-results/:id",e)){const n=tn("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(tn("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(tn("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(tn("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(tn("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(tn("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(tn("/results",e))return t.push({label:"Evaluation Results"}),t;if(tn("/run",e))return t.push({label:"Run Evaluation"}),t;if(tn("/libraries/servers/:serverId",e)){const n=tn("/libraries/servers/:serverId",e),r=n?.params.serverId?decodeURIComponent(n.params.serverId):"Server";return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers",to:"/libraries/servers"},{label:r==="new"?"New Server":r}),t}if(tn("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(tn("/libraries/agents/:agentName",e)){const n=tn("/libraries/agents/:agentName",e),r=n?.params.agentName?decodeURIComponent(n.params.agentName):"Agent";return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents",to:"/libraries/agents"},{label:r==="new"?"New Agent":r}),t}if(tn("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(tn("/libraries/test-cases/:testCaseId",e)){const n=tn("/libraries/test-cases/:testCaseId",e),r=n?.params.testCaseId?decodeURIComponent(n.params.testCaseId):"Test Case";return t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases",to:"/libraries/test-cases"},{label:r}),t}return tn("/libraries/test-cases",e)?(t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),t):tn("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(tn("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function AG(){const e=gs(),t=new URLSearchParams(e.search).get("embed")==="1",n=CG(e.pathname),{connection:r,version:a}=An();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(U_,{})}):s.jsx(t3,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(fG,{version:a}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsxs("header",{className:"flex h-12 items-center gap-2 border-b bg-card px-4",children:[s.jsx(r3,{}),s.jsx(h3,{children:s.jsx(m3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(v3,{children:i.to&&!c?s.jsx(g3,{asChild:!0,children:s.jsx(yt,{to:i.to,children:i.label})}):s.jsx(y3,{children:i.label})}),!c&&s.jsx(x3,{})]},`${i.label}-${o}`)})})}),s.jsx("div",{className:"ml-auto flex items-center gap-2",children:s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border px-2.5 py-1",children:[s.jsx("span",{className:`h-2 w-2 rounded-full ${r==="connected"?"bg-emerald-500":r==="checking"?"bg-amber-400":"bg-rose-500"}`,"aria-hidden":"true"}),s.jsx("span",{className:`text-xs ${r==="connected"?"text-emerald-700":r==="checking"?"text-muted-foreground":"text-destructive"}`,children:r})]})})]}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsx(U_,{})})]})]})})}const w3=v.createContext(null);function EG({children:e}){const{source:t}=An(),[n,r]=v.useState([]),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const g=await t.listConfigs();r(g)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[o]);const c=v.useCallback(g=>n.find(y=>y.id===g),[n]),d=v.useCallback(async g=>{const y=await t.createConfig(g);return r(j=>[...j,y]),y},[t]),f=v.useCallback(async(g,y)=>{const j=await t.updateConfig({...y,id:g});return r(w=>w.map(x=>x.id===g?j:x)),j},[t]),h=v.useCallback(async g=>{await t.deleteConfig(g),r(y=>y.filter(j=>j.id!==g))},[t]),p=v.useCallback(async g=>{const y=n.find(x=>x.id===g);if(!y)throw new Error("Config not found");const j={...structuredClone(y),id:`cfg-${Date.now()}`,name:`${y.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},w=await t.createConfig(j);return r(x=>[...x,w]),w},[n,t]);return s.jsx(w3.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function cf(){const e=v.useContext(w3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const j3=v.createContext(null);function _G({children:e}){const{source:t}=An(),[n,r]=v.useState({servers:[],agents:[],scenarios:[]}),[a,i]=v.useState(!0),o=async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}};v.useEffect(()=>{o()},[t]),v.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=async f=>{r(f),await t.saveLibraries(f)},d=v.useMemo(()=>({...n,loading:a,setServers:async f=>c({...n,servers:f}),setAgents:async f=>c({...n,agents:f}),setScenarios:async f=>c({...n,scenarios:f}),reload:o}),[n,a]);return s.jsx(j3.Provider,{value:d,children:e})}function Va(){const e=v.useContext(j3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const ze=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ze.displayName="Card";const At=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));At.displayName="CardHeader";const Et=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));Et.displayName="CardTitle";const Ls=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Ls.displayName="CardDescription";const Ue=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("p-6 pt-0",e),...t}));Ue.displayName="CardContent";const PG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));PG.displayName="CardFooter";const Kr=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:Se("w-full caption-bottom text-sm",e),...t})}));Kr.displayName="Table";const Gr=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Gr.displayName="TableHeader";const Yr=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Yr.displayName="TableBody";const OG=v.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:Se("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));OG.displayName="TableFooter";const zt=v.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:Se("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));zt.displayName="TableRow";const nt=v.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:Se("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));nt.displayName="TableHead";const He=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));He.displayName="TableCell";const kG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));kG.displayName="TableCaption";function Is({title:e,value:t,subtitle:n,icon:r,trend:a}){return s.jsx(ze,{children:s.jsx(Ue,{className:"p-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e}),s.jsx("p",{className:"text-2xl font-bold",children:t}),n&&s.jsxs("p",{className:`text-xs ${a==="up"?"text-success":a==="down"?"text-destructive":"text-muted-foreground"}`,children:[a==="up"&&"↑ ",a==="down"&&"↓ ",n]})]}),s.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:s.jsx(r,{className:"h-4 w-4 text-primary"})})]})})})}const RG=Lo("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ke({className:e,variant:t,asChild:n,...r}){const a=n?Bi:"div";return s.jsx(a,{className:Se(RG({variant:t}),e),...r})}function wo({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(Ke,{variant:r,className:`font-mono text-xs ${n>=80?"bg-success/15 text-success hover:bg-success/20 border-0":n>=50?"bg-warning/15 text-warning hover:bg-warning/20 border-0":"bg-destructive/15 text-destructive hover:bg-destructive/20 border-0"} ${t??""}`,children:[n,"%"]})}var ax,iP;function Pr(){if(iP)return ax;iP=1;var e=Array.isArray;return ax=e,ax}var sx,oP;function S3(){if(oP)return sx;oP=1;var e=typeof Ep=="object"&&Ep&&Ep.Object===Object&&Ep;return sx=e,sx}var ix,lP;function ys(){if(lP)return ix;lP=1;var e=S3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return ix=n,ix}var ox,cP;function uf(){if(cP)return ox;cP=1;var e=ys(),t=e.Symbol;return ox=t,ox}var lx,uP;function TG(){if(uP)return lx;uP=1;var e=uf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(o){var c=n.call(o,a),d=o[a];try{o[a]=void 0;var f=!0}catch{}var h=r.call(o);return f&&(c?o[a]=d:delete o[a]),h}return lx=i,lx}var cx,dP;function IG(){if(dP)return cx;dP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return cx=n,cx}var ux,fP;function Xs(){if(fP)return ux;fP=1;var e=uf(),t=TG(),n=IG(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function o(c){return c==null?c===void 0?a:r:i&&i in Object(c)?t(c):n(c)}return ux=o,ux}var dx,pP;function Qs(){if(pP)return dx;pP=1;function e(t){return t!=null&&typeof t=="object"}return dx=e,dx}var fx,hP;function Fc(){if(hP)return fx;hP=1;var e=Xs(),t=Qs(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return fx=r,fx}var px,mP;function XS(){if(mP)return px;mP=1;var e=Pr(),t=Fc(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,o){if(e(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||o!=null&&i in Object(o)}return px=a,px}var hx,vP;function zi(){if(vP)return hx;vP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return hx=e,hx}var mx,gP;function QS(){if(gP)return mx;gP=1;var e=Xs(),t=zi(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(c){if(!t(c))return!1;var d=e(c);return d==r||d==a||d==n||d==i}return mx=o,mx}var vx,yP;function MG(){if(yP)return vx;yP=1;var e=ys(),t=e["__core-js_shared__"];return vx=t,vx}var gx,xP;function $G(){if(xP)return gx;xP=1;var e=MG(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return gx=n,gx}var yx,bP;function N3(){if(bP)return yx;bP=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return yx=n,yx}var xx,wP;function DG(){if(wP)return xx;wP=1;var e=QS(),t=$G(),n=zi(),r=N3(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,d=o.toString,f=c.hasOwnProperty,h=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var y=e(g)?h:i;return y.test(r(g))}return xx=p,xx}var bx,jP;function LG(){if(jP)return bx;jP=1;function e(t,n){return t?.[n]}return bx=e,bx}var wx,SP;function Bo(){if(SP)return wx;SP=1;var e=DG(),t=LG();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return wx=n,wx}var jx,NP;function nv(){if(NP)return jx;NP=1;var e=Bo(),t=e(Object,"create");return jx=t,jx}var Sx,CP;function FG(){if(CP)return Sx;CP=1;var e=nv();function t(){this.__data__=e?e(null):{},this.size=0}return Sx=t,Sx}var Nx,AP;function BG(){if(AP)return Nx;AP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Nx=e,Nx}var Cx,EP;function zG(){if(EP)return Cx;EP=1;var e=nv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var o=this.__data__;if(e){var c=o[i];return c===t?void 0:c}return r.call(o,i)?o[i]:void 0}return Cx=a,Cx}var Ax,_P;function UG(){if(_P)return Ax;_P=1;var e=nv(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Ax=r,Ax}var Ex,PP;function qG(){if(PP)return Ex;PP=1;var e=nv(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return Ex=n,Ex}var _x,OP;function WG(){if(OP)return _x;OP=1;var e=FG(),t=BG(),n=zG(),r=UG(),a=qG();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,_x=i,_x}var Px,kP;function VG(){if(kP)return Px;kP=1;function e(){this.__data__=[],this.size=0}return Px=e,Px}var Ox,RP;function JS(){if(RP)return Ox;RP=1;function e(t,n){return t===n||t!==t&&n!==n}return Ox=e,Ox}var kx,TP;function rv(){if(TP)return kx;TP=1;var e=JS();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return kx=t,kx}var Rx,IP;function HG(){if(IP)return Rx;IP=1;var e=rv(),t=Array.prototype,n=t.splice;function r(a){var i=this.__data__,o=e(i,a);if(o<0)return!1;var c=i.length-1;return o==c?i.pop():n.call(i,o,1),--this.size,!0}return Rx=r,Rx}var Tx,MP;function KG(){if(MP)return Tx;MP=1;var e=rv();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Tx=t,Tx}var Ix,$P;function GG(){if($P)return Ix;$P=1;var e=rv();function t(n){return e(this.__data__,n)>-1}return Ix=t,Ix}var Mx,DP;function YG(){if(DP)return Mx;DP=1;var e=rv();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return Mx=t,Mx}var $x,LP;function av(){if(LP)return $x;LP=1;var e=VG(),t=HG(),n=KG(),r=GG(),a=YG();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,$x=i,$x}var Dx,FP;function ZS(){if(FP)return Dx;FP=1;var e=Bo(),t=ys(),n=e(t,"Map");return Dx=n,Dx}var Lx,BP;function XG(){if(BP)return Lx;BP=1;var e=WG(),t=av(),n=ZS();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Lx=r,Lx}var Fx,zP;function QG(){if(zP)return Fx;zP=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Fx=e,Fx}var Bx,UP;function sv(){if(UP)return Bx;UP=1;var e=QG();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return Bx=t,Bx}var zx,qP;function JG(){if(qP)return zx;qP=1;var e=sv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return zx=t,zx}var Ux,WP;function ZG(){if(WP)return Ux;WP=1;var e=sv();function t(n){return e(this,n).get(n)}return Ux=t,Ux}var qx,VP;function eY(){if(VP)return qx;VP=1;var e=sv();function t(n){return e(this,n).has(n)}return qx=t,qx}var Wx,HP;function tY(){if(HP)return Wx;HP=1;var e=sv();function t(n,r){var a=e(this,n),i=a.size;return a.set(n,r),this.size+=a.size==i?0:1,this}return Wx=t,Wx}var Vx,KP;function eN(){if(KP)return Vx;KP=1;var e=XG(),t=JG(),n=ZG(),r=eY(),a=tY();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Vx=i,Vx}var Hx,GP;function C3(){if(GP)return Hx;GP=1;var e=eN(),t="Expected a function";function n(r,a){if(typeof r!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var o=arguments,c=a?a.apply(this,o):o[0],d=i.cache;if(d.has(c))return d.get(c);var f=r.apply(this,o);return i.cache=d.set(c,f)||d,f};return i.cache=new(n.Cache||e),i}return n.Cache=e,Hx=n,Hx}var Kx,YP;function nY(){if(YP)return Kx;YP=1;var e=C3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return Kx=n,Kx}var Gx,XP;function rY(){if(XP)return Gx;XP=1;var e=nY(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(o,c,d,f){i.push(d?f.replace(n,"$1"):c||o)}),i});return Gx=r,Gx}var Yx,QP;function tN(){if(QP)return Yx;QP=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=Array(a);++r<a;)i[r]=n(t[r],r,t);return i}return Yx=e,Yx}var Xx,JP;function aY(){if(JP)return Xx;JP=1;var e=uf(),t=tN(),n=Pr(),r=Fc(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function o(c){if(typeof c=="string")return c;if(n(c))return t(c,o)+"";if(r(c))return i?i.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return Xx=o,Xx}var Qx,ZP;function A3(){if(ZP)return Qx;ZP=1;var e=aY();function t(n){return n==null?"":e(n)}return Qx=t,Qx}var Jx,eO;function E3(){if(eO)return Jx;eO=1;var e=Pr(),t=XS(),n=rY(),r=A3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return Jx=a,Jx}var Zx,tO;function iv(){if(tO)return Zx;tO=1;var e=Fc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Zx=t,Zx}var eb,nO;function nN(){if(nO)return eb;nO=1;var e=E3(),t=iv();function n(r,a){a=e(a,r);for(var i=0,o=a.length;r!=null&&i<o;)r=r[t(a[i++])];return i&&i==o?r:void 0}return eb=n,eb}var tb,rO;function _3(){if(rO)return tb;rO=1;var e=nN();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return tb=t,tb}var sY=_3();const Qr=Yt(sY);var nb,aO;function iY(){if(aO)return nb;aO=1;function e(t){return t==null}return nb=e,nb}var oY=iY();const jt=Yt(oY);var rb,sO;function lY(){if(sO)return rb;sO=1;var e=Xs(),t=Pr(),n=Qs(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return rb=a,rb}var cY=lY();const Eo=Yt(cY);var uY=QS();const wt=Yt(uY);var dY=zi();const Bc=Yt(dY);var ab={exports:{}},Ft={};var iO;function fY(){if(iO)return Ft;iO=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function w(x){if(typeof x=="object"&&x!==null){var S=x.$$typeof;switch(S){case e:switch(x=x.type,x){case n:case a:case r:case f:case h:return x;default:switch(x=x&&x.$$typeof,x){case c:case o:case d:case g:case p:case i:return x;default:return S}}case t:return S}}}return Ft.ContextConsumer=o,Ft.ContextProvider=i,Ft.Element=e,Ft.ForwardRef=d,Ft.Fragment=n,Ft.Lazy=g,Ft.Memo=p,Ft.Portal=t,Ft.Profiler=a,Ft.StrictMode=r,Ft.Suspense=f,Ft.SuspenseList=h,Ft.isAsyncMode=function(){return!1},Ft.isConcurrentMode=function(){return!1},Ft.isContextConsumer=function(x){return w(x)===o},Ft.isContextProvider=function(x){return w(x)===i},Ft.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Ft.isForwardRef=function(x){return w(x)===d},Ft.isFragment=function(x){return w(x)===n},Ft.isLazy=function(x){return w(x)===g},Ft.isMemo=function(x){return w(x)===p},Ft.isPortal=function(x){return w(x)===t},Ft.isProfiler=function(x){return w(x)===a},Ft.isStrictMode=function(x){return w(x)===r},Ft.isSuspense=function(x){return w(x)===f},Ft.isSuspenseList=function(x){return w(x)===h},Ft.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===a||x===r||x===f||x===h||x===y||typeof x=="object"&&x!==null&&(x.$$typeof===g||x.$$typeof===p||x.$$typeof===i||x.$$typeof===o||x.$$typeof===d||x.$$typeof===j||x.getModuleId!==void 0)},Ft.typeOf=w,Ft}var oO;function pY(){return oO||(oO=1,ab.exports=fY()),ab.exports}var hY=pY(),sb,lO;function P3(){if(lO)return sb;lO=1;var e=Xs(),t=Qs(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return sb=r,sb}var ib,cO;function mY(){if(cO)return ib;cO=1;var e=P3();function t(n){return e(n)&&n!=+n}return ib=t,ib}var vY=mY();const df=Yt(vY);var gY=P3();const yY=Yt(gY);var pr=function(t){return t===0?0:t>0?1:-1},go=function(t){return Eo(t)&&t.indexOf("%")===t.length-1},De=function(t){return yY(t)&&!df(t)},xY=function(t){return jt(t)},Fn=function(t){return De(t)||Eo(t)},bY=0,zc=function(t){var n=++bY;return"".concat(t||"").concat(n)},hr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!De(t)&&!Eo(t))return r;var i;if(go(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return df(i)&&(i=r),a&&i>n&&(i=n),i},_l=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},wY=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},Vr=function(t,n){return De(t)&&De(n)?function(r){return t+r*(n-t)}:function(){return n}};function yh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Qr(r,t))===n})}var jY=function(t,n){return De(t)&&De(n)?t-n:Eo(t)&&Eo(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Ul(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function $1(e){"@babel/helpers - typeof";return $1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$1(e)}var SY=["viewBox","children"],NY=["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"],uO=["points","pathLength"],ob={svg:SY,polygon:uO,polyline:uO},rN=["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"],xh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!Bc(r))return null;var a={};return Object.keys(r).forEach(function(i){rN.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},CY=function(t,n,r){return function(a){return t(n,r,a),null}},_o=function(t,n,r){if(!Bc(t)||$1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];rN.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=CY(o,n,r))}),a},AY=["children"],EY=["children"];function dO(e,t){if(e==null)return{};var n=_Y(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _Y(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function D1(e){"@babel/helpers - typeof";return D1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D1(e)}var fO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Fs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},pO=null,lb=null,aN=function e(t){if(t===pO&&Array.isArray(lb))return lb;var n=[];return v.Children.forEach(t,function(r){jt(r)||(hY.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),lb=n,pO=t,n};function Jr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Fs(a)}):r=[Fs(t)],aN(e).forEach(function(a){var i=Qr(a,"type.displayName")||Qr(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Ur(e,t){var n=Jr(e,t);return n&&n[0]}var hO=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!De(r)||r<=0||!De(a)||a<=0)},PY=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],OY=function(t){return t&&t.type&&Eo(t.type)&&PY.indexOf(t.type)>=0},kY=function(t){return t&&D1(t)==="object"&&"clipDot"in t},RY=function(t,n,r,a){var i,o=(i=ob?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!wt(t)&&(a&&o.includes(n)||NY.includes(n))||r&&rN.includes(n)},ht=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!Bc(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;RY((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},L1=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return mO(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var i=t[a],o=n[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!mO(i,o))return!1}return!0},mO=function(t,n){if(jt(t)&&jt(n))return!0;if(!jt(t)&&!jt(n)){var r=t.props||{},a=r.children,i=dO(r,AY),o=n.props||{},c=o.children,d=dO(o,EY);return a&&c?Ul(i,d)&&L1(a,c):!a&&!c?Ul(i,d):!1}return!1},vO=function(t,n){var r=[],a={};return aN(t).forEach(function(i,o){if(OY(i))r.push(i);else if(i){var c=Fs(i.type),d=n[c]||{},f=d.handler,h=d.once;if(f&&(!h||!a[c])){var p=f(i,c,o);r.push(p),a[c]=!0}}}),r},TY=function(t){var n=t&&t.type;return n&&fO[n]?fO[n]:null},IY=function(t,n){return aN(n).indexOf(t)},MY=["children","width","height","viewBox","className","style","title","desc"];function F1(){return F1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F1.apply(this,arguments)}function $Y(e,t){if(e==null)return{};var n=DY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function B1(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,i=e.className,o=e.style,c=e.title,d=e.desc,f=$Y(e,MY),h=a||{width:n,height:r,x:0,y:0},p=St("recharts-surface",i);return W.createElement("svg",F1({},ht(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),W.createElement("title",null,c),W.createElement("desc",null,d),t)}var LY=["children","className"];function z1(){return z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z1.apply(this,arguments)}function FY(e,t){if(e==null)return{};var n=BY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Mt=W.forwardRef(function(e,t){var n=e.children,r=e.className,a=FY(e,LY),i=St("recharts-layer",r);return W.createElement("g",z1({className:i},ht(a,!0),{ref:t}),n)}),Bs=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),i=2;i<r;i++)a[i-2]=arguments[i]},cb,gO;function zY(){if(gO)return cb;gO=1;function e(t,n,r){var a=-1,i=t.length;n<0&&(n=-n>i?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(i);++a<i;)o[a]=t[a+n];return o}return cb=e,cb}var ub,yO;function UY(){if(yO)return ub;yO=1;var e=zY();function t(n,r,a){var i=n.length;return a=a===void 0?i:a,!r&&a>=i?n:e(n,r,a)}return ub=t,ub}var db,xO;function O3(){if(xO)return db;xO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+e+a+i+"]");function d(f){return c.test(f)}return db=d,db}var fb,bO;function qY(){if(bO)return fb;bO=1;function e(t){return t.split("")}return fb=e,fb}var pb,wO;function WY(){if(wO)return pb;wO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",o="["+e+"]",c="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",j=f+"?",w="["+i+"]?",x="(?:"+y+"(?:"+[h,p,g].join("|")+")"+w+j+")*",S=w+j+x,N="(?:"+[h+c+"?",c,p,g,o].join("|")+")",A=RegExp(d+"(?="+d+")|"+N+S,"g");function P(E){return E.match(A)||[]}return pb=P,pb}var hb,jO;function VY(){if(jO)return hb;jO=1;var e=qY(),t=O3(),n=WY();function r(a){return t(a)?n(a):e(a)}return hb=r,hb}var mb,SO;function HY(){if(SO)return mb;SO=1;var e=UY(),t=O3(),n=VY(),r=A3();function a(i){return function(o){o=r(o);var c=t(o)?n(o):void 0,d=c?c[0]:o.charAt(0),f=c?e(c,1).join(""):o.slice(1);return d[i]()+f}}return mb=a,mb}var vb,NO;function KY(){if(NO)return vb;NO=1;var e=HY(),t=e("toUpperCase");return vb=t,vb}var GY=KY();const ov=Yt(GY);function sn(e){return function(){return e}}const k3=Math.cos,bh=Math.sin,Ha=Math.sqrt,wh=Math.PI,lv=2*wh,U1=Math.PI,q1=2*U1,ho=1e-6,YY=q1-ho;function R3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function XY(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return R3;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class QY{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?R3:XY(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,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,i,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,r,a,i){if(t=+t,n=+n,r=+r,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,c=this._y1,d=r-t,f=a-n,h=o-t,p=c-n,g=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>ho)if(!(Math.abs(p*d-f*h)>ho)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-o,j=a-c,w=d*d+f*f,x=y*y+j*j,S=Math.sqrt(w),N=Math.sqrt(g),A=i*Math.tan((U1-Math.acos((w+g-x)/(2*S*N)))/2),P=A/N,E=A/S;Math.abs(P-1)>ho&&this._append`L${t+P*h},${n+P*p}`,this._append`A${i},${i},0,0,${+(p*y>h*j)},${this._x1=t+E*d},${this._y1=n+E*f}`}}arc(t,n,r,a,i,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(a),d=r*Math.sin(a),f=t+c,h=n+d,p=1^o,g=o?a-i:i-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>ho||Math.abs(this._y1-h)>ho)&&this._append`L${f},${h}`,r&&(g<0&&(g=g%q1+q1),g>YY?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:g>ho&&this._append`A${r},${r},0,${+(g>=U1)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function sN(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 QY(t)}function iN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function T3(e){this._context=e}T3.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 cv(e){return new T3(e)}function I3(e){return e[0]}function M3(e){return e[1]}function $3(e,t){var n=sn(!0),r=null,a=cv,i=null,o=sN(c);e=typeof e=="function"?e:e===void 0?I3:sn(e),t=typeof t=="function"?t:t===void 0?M3:sn(t);function c(d){var f,h=(d=iN(d)).length,p,g=!1,y;for(r==null&&(i=a(y=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===g&&((g=!g)?i.lineStart():i.lineEnd()),g&&i.point(+e(p,f,d),+t(p,f,d));if(y)return i=null,y+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:sn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:sn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:sn(!!d),c):n},c.curve=function(d){return arguments.length?(a=d,r!=null&&(i=a(r)),c):a},c.context=function(d){return arguments.length?(d==null?r=i=null:i=a(r=d),c):r},c}function Fp(e,t,n){var r=null,a=sn(!0),i=null,o=cv,c=null,d=sN(f);e=typeof e=="function"?e:e===void 0?I3:sn(+e),t=typeof t=="function"?t:sn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?M3:sn(+n);function f(p){var g,y,j,w=(p=iN(p)).length,x,S=!1,N,A=new Array(w),P=new Array(w);for(i==null&&(c=o(N=d())),g=0;g<=w;++g){if(!(g<w&&a(x=p[g],g,p))===S)if(S=!S)y=g,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=g-1;j>=y;--j)c.point(A[j],P[j]);c.lineEnd(),c.areaEnd()}S&&(A[g]=+e(x,g,p),P[g]=+t(x,g,p),c.point(r?+r(x,g,p):A[g],n?+n(x,g,p):P[g]))}if(N)return c=null,N+""||null}function h(){return $3().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:sn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:sn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:sn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:sn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:sn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:sn(+p),f):n},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(n)},f.lineX1=function(){return h().x(r).y(t)},f.defined=function(p){return arguments.length?(a=typeof p=="function"?p:sn(!!p),f):a},f.curve=function(p){return arguments.length?(o=p,i!=null&&(c=o(i)),f):o},f.context=function(p){return arguments.length?(p==null?i=c=null:c=o(i=p),f):i},f}class D3{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 JY(e){return new D3(e,!0)}function ZY(e){return new D3(e,!1)}const oN={draw(e,t){const n=Ha(t/wh);e.moveTo(n,0),e.arc(0,0,n,0,lv)}},eX={draw(e,t){const n=Ha(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()}},L3=Ha(1/3),tX=L3*2,nX={draw(e,t){const n=Ha(t/tX),r=n*L3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},rX={draw(e,t){const n=Ha(t),r=-n/2;e.rect(r,r,n,n)}},aX=.8908130915292852,F3=bh(wh/10)/bh(7*wh/10),sX=bh(lv/10)*F3,iX=-k3(lv/10)*F3,oX={draw(e,t){const n=Ha(t*aX),r=sX*n,a=iX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=lv*i/5,c=k3(o),d=bh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},gb=Ha(3),lX={draw(e,t){const n=-Ha(t/(gb*3));e.moveTo(0,n*2),e.lineTo(-gb*n,-n),e.lineTo(gb*n,-n),e.closePath()}},oa=-.5,la=Ha(3)/2,W1=1/Ha(12),cX=(W1/2+1)*3,uX={draw(e,t){const n=Ha(t/cX),r=n/2,a=n*W1,i=r,o=n*W1+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(oa*r-la*a,la*r+oa*a),e.lineTo(oa*i-la*o,la*i+oa*o),e.lineTo(oa*c-la*d,la*c+oa*d),e.lineTo(oa*r+la*a,oa*a-la*r),e.lineTo(oa*i+la*o,oa*o-la*i),e.lineTo(oa*c+la*d,oa*d-la*c),e.closePath()}};function dX(e,t){let n=null,r=sN(a);e=typeof e=="function"?e:sn(e||oN),t=typeof t=="function"?t:sn(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:sn(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:sn(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function jh(){}function Sh(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 B3(e){this._context=e}B3.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:Sh(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:Sh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fX(e){return new B3(e)}function z3(e){this._context=e}z3.prototype={areaStart:jh,areaEnd:jh,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:Sh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pX(e){return new z3(e)}function U3(e){this._context=e}U3.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:Sh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hX(e){return new U3(e)}function q3(e){this._context=e}q3.prototype={areaStart:jh,areaEnd:jh,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 mX(e){return new q3(e)}function CO(e){return e<0?-1:1}function AO(e,t,n){var r=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),c=(i*a+o*r)/(r+a);return(CO(i)+CO(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function EO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function yb(e,t,n){var r=e._x0,a=e._y0,i=e._x1,o=e._y1,c=(i-r)/3;e._context.bezierCurveTo(r+c,a+c*t,i-c,o-c*n,i,o)}function Nh(e){this._context=e}Nh.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:yb(this,this._t0,EO(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,yb(this,EO(this,n=AO(this,e,t)),n);break;default:yb(this,this._t0,n=AO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function W3(e){this._context=new V3(e)}(W3.prototype=Object.create(Nh.prototype)).point=function(e,t){Nh.prototype.point.call(this,t,e)};function V3(e){this._context=e}V3.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,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function vX(e){return new Nh(e)}function gX(e){return new W3(e)}function H3(e){this._context=e}H3.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=_O(e),a=_O(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(r[0][i],a[0][i],r[1][i],a[1][i],e[o],t[o]);(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 _O(e){var t,n=e.length-1,r,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function yX(e){return new H3(e)}function uv(e,t){this._context=e,this._t=t}uv.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 xX(e){return new uv(e,.5)}function bX(e){return new uv(e,0)}function wX(e){return new uv(e,1)}function tc(e,t){if((o=e.length)>1)for(var n=1,r,a,i=e[t[0]],o,c=i.length;n<o;++n)for(a=i,i=e[t[n]],r=0;r<c;++r)i[r][1]+=i[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function V1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function jX(e,t){return e[t]}function SX(e){const t=[];return t.key=e,t}function NX(){var e=sn([]),t=V1,n=tc,r=jX;function a(i){var o=Array.from(e.apply(this,arguments),SX),c,d=o.length,f=-1,h;for(const p of i)for(c=0,++f;c<d;++c)(o[c][f]=[0,+r(p,o[c].key,f,i)]).data=p;for(c=0,h=iN(t(o));c<d;++c)o[h[c]].index=c;return n(o,h),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:sn(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:sn(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?V1:typeof i=="function"?i:sn(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??tc,a):n},a}function CX(e,t){if((r=e.length)>0){for(var n,r,a=0,i=e[0].length,o;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}tc(e,t)}}function AX(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,i=r.length;n<i;++n){for(var o=0,c=0;o<a;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}tc(e,t)}}function EX(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,o;r<i;++r){for(var c=0,d=0,f=0;c<o;++c){for(var h=e[t[c]],p=h[r][1]||0,g=h[r-1][1]||0,y=(p-g)/2,j=0;j<c;++j){var w=e[t[j]],x=w[r][1]||0,S=w[r-1][1]||0;y+=x-S}d+=p,f+=y*p}a[r-1][1]+=a[r-1][0]=n,d&&(n-=f/d)}a[r-1][1]+=a[r-1][0]=n,tc(e,t)}}function md(e){"@babel/helpers - typeof";return md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},md(e)}var _X=["type","size","sizeType"];function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H1.apply(this,arguments)}function PO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function OO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PO(Object(n),!0).forEach(function(r){PX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PX(e,t,n){return t=OX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OX(e){var t=kX(e,"string");return md(t)=="symbol"?t:t+""}function kX(e,t){if(md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RX(e,t){if(e==null)return{};var n=TX(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TX(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var K3={symbolCircle:oN,symbolCross:eX,symbolDiamond:nX,symbolSquare:rX,symbolStar:oX,symbolTriangle:lX,symbolWye:uX},IX=Math.PI/180,MX=function(t){var n="symbol".concat(ov(t));return K3[n]||oN},$X=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*IX;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},DX=function(t,n){K3["symbol".concat(ov(t))]=n},lN=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,o=t.sizeType,c=o===void 0?"area":o,d=RX(t,_X),f=OO(OO({},d),{},{type:r,size:i,sizeType:c}),h=function(){var x=MX(r),S=dX().type(x).size($X(i,c,r));return S()},p=f.className,g=f.cx,y=f.cy,j=ht(f,!0);return g===+g&&y===+y&&i===+i?W.createElement("path",H1({},j,{className:St("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(y,")"),d:h()})):null};lN.registerSymbol=DX;function nc(e){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nc(e)}function K1(){return K1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K1.apply(this,arguments)}function kO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function LX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kO(Object(n),!0).forEach(function(r){vd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Y3(r.key),r)}}function zX(e,t,n){return t&&BX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function UX(e,t,n){return t=Ch(t),qX(e,G3()?Reflect.construct(t,n||[],Ch(e).constructor):t.apply(e,n))}function qX(e,t){if(t&&(nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WX(e)}function WX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G3=function(){return!!e})()}function Ch(e){return Ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ch(e)}function VX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G1(e,t)}function G1(e,t){return G1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},G1(e,t)}function vd(e,t,n){return t=Y3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y3(e){var t=HX(e,"string");return nc(t)=="symbol"?t:t+""}function HX(e,t){if(nc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ca=32,cN=(function(e){function t(){return FX(this,t),UX(this,t,arguments)}return VX(t,e),zX(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=ca/2,o=ca/6,c=ca/3,d=r.inactive?a:r.color;if(r.type==="plainline")return W.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:ca,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return W.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(i,"h").concat(c,`
|
|
57
|
-
A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(i,`
|
|
58
|
-
H`).concat(ca,"M").concat(2*c,",").concat(i,`
|
|
59
|
-
A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(i),className:"recharts-legend-icon"});if(r.type==="rect")return W.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(ca/8,"h").concat(ca,"v").concat(ca*3/4,"h").concat(-ca,"z"),className:"recharts-legend-icon"});if(W.isValidElement(r.legendIcon)){var f=LX({},r);return delete f.legendIcon,W.cloneElement(r.legendIcon,f)}return W.createElement(lN,{fill:d,cx:i,cy:i,size:ca,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,i=a.payload,o=a.iconSize,c=a.layout,d=a.formatter,f=a.inactiveColor,h={x:0,y:0,width:ca,height:ca},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(y,j){var w=y.formatter||d,x=St(vd(vd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",y.inactive));if(y.type==="none")return null;var S=wt(y.value)?null:y.value;Bs(!wt(y.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var N=y.inactive?f:y.color;return W.createElement("li",K1({className:x,style:p,key:"legend-item-".concat(j)},_o(r.props,y,j)),W.createElement(B1,{width:o,height:o,viewBox:h,style:g},r.renderIcon(y)),W.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},w?w(S,y,j):S))})}},{key:"render",value:function(){var r=this.props,a=r.payload,i=r.layout,o=r.align;if(!a||!a.length)return null;var c={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return W.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(v.PureComponent);vd(cN,"displayName","Legend");vd(cN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var xb,RO;function KX(){if(RO)return xb;RO=1;var e=av();function t(){this.__data__=new e,this.size=0}return xb=t,xb}var bb,TO;function GX(){if(TO)return bb;TO=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return bb=e,bb}var wb,IO;function YX(){if(IO)return wb;IO=1;function e(t){return this.__data__.get(t)}return wb=e,wb}var jb,MO;function XX(){if(MO)return jb;MO=1;function e(t){return this.__data__.has(t)}return jb=e,jb}var Sb,$O;function QX(){if($O)return Sb;$O=1;var e=av(),t=ZS(),n=eN(),r=200;function a(i,o){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<r-1)return d.push([i,o]),this.size=++c.size,this;c=this.__data__=new n(d)}return c.set(i,o),this.size=c.size,this}return Sb=a,Sb}var Nb,DO;function X3(){if(DO)return Nb;DO=1;var e=av(),t=KX(),n=GX(),r=YX(),a=XX(),i=QX();function o(c){var d=this.__data__=new e(c);this.size=d.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=a,o.prototype.set=i,Nb=o,Nb}var Cb,LO;function JX(){if(LO)return Cb;LO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Cb=t,Cb}var Ab,FO;function ZX(){if(FO)return Ab;FO=1;function e(t){return this.__data__.has(t)}return Ab=e,Ab}var Eb,BO;function Q3(){if(BO)return Eb;BO=1;var e=eN(),t=JX(),n=ZX();function r(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new e;++i<o;)this.add(a[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,Eb=r,Eb}var _b,zO;function J3(){if(zO)return _b;zO=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(n(t[r],r,t))return!0;return!1}return _b=e,_b}var Pb,UO;function Z3(){if(UO)return Pb;UO=1;function e(t,n){return t.has(n)}return Pb=e,Pb}var Ob,qO;function e5(){if(qO)return Ob;qO=1;var e=Q3(),t=J3(),n=Z3(),r=1,a=2;function i(o,c,d,f,h,p){var g=d&r,y=o.length,j=c.length;if(y!=j&&!(g&&j>y))return!1;var w=p.get(o),x=p.get(c);if(w&&x)return w==c&&x==o;var S=-1,N=!0,A=d&a?new e:void 0;for(p.set(o,c),p.set(c,o);++S<y;){var P=o[S],E=c[S];if(f)var O=g?f(E,P,S,c,o,p):f(P,E,S,o,c,p);if(O!==void 0){if(O)continue;N=!1;break}if(A){if(!t(c,function(k,R){if(!n(A,R)&&(P===k||h(P,k,d,f,p)))return A.push(R)})){N=!1;break}}else if(!(P===E||h(P,E,d,f,p))){N=!1;break}}return p.delete(o),p.delete(c),N}return Ob=i,Ob}var kb,WO;function eQ(){if(WO)return kb;WO=1;var e=ys(),t=e.Uint8Array;return kb=t,kb}var Rb,VO;function tQ(){if(VO)return Rb;VO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return Rb=e,Rb}var Tb,HO;function uN(){if(HO)return Tb;HO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return Tb=e,Tb}var Ib,KO;function nQ(){if(KO)return Ib;KO=1;var e=uf(),t=eQ(),n=JS(),r=e5(),a=tQ(),i=uN(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",g="[object Number]",y="[object RegExp]",j="[object Set]",w="[object String]",x="[object Symbol]",S="[object ArrayBuffer]",N="[object DataView]",A=e?e.prototype:void 0,P=A?A.valueOf:void 0;function E(O,k,R,D,U,z,L){switch(R){case N:if(O.byteLength!=k.byteLength||O.byteOffset!=k.byteOffset)return!1;O=O.buffer,k=k.buffer;case S:return!(O.byteLength!=k.byteLength||!z(new t(O),new t(k)));case d:case f:case g:return n(+O,+k);case h:return O.name==k.name&&O.message==k.message;case y:case w:return O==k+"";case p:var G=a;case j:var q=D&o;if(G||(G=i),O.size!=k.size&&!q)return!1;var H=L.get(O);if(H)return H==k;D|=c,L.set(O,k);var X=r(G(O),G(k),D,U,z,L);return L.delete(O),X;case x:if(P)return P.call(O)==P.call(k)}return!1}return Ib=E,Ib}var Mb,GO;function t5(){if(GO)return Mb;GO=1;function e(t,n){for(var r=-1,a=n.length,i=t.length;++r<a;)t[i+r]=n[r];return t}return Mb=e,Mb}var $b,YO;function rQ(){if(YO)return $b;YO=1;var e=t5(),t=Pr();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return $b=n,$b}var Db,XO;function aQ(){if(XO)return Db;XO=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=0,o=[];++r<a;){var c=t[r];n(c,r,t)&&(o[i++]=c)}return o}return Db=e,Db}var Lb,QO;function sQ(){if(QO)return Lb;QO=1;function e(){return[]}return Lb=e,Lb}var Fb,JO;function iQ(){if(JO)return Fb;JO=1;var e=aQ(),t=sQ(),n=Object.prototype,r=n.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),e(a(o),function(c){return r.call(o,c)}))}:t;return Fb=i,Fb}var Bb,ZO;function oQ(){if(ZO)return Bb;ZO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return Bb=e,Bb}var zb,ek;function lQ(){if(ek)return zb;ek=1;var e=Xs(),t=Qs(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return zb=r,zb}var Ub,tk;function dN(){if(tk)return Ub;tk=1;var e=lQ(),t=Qs(),n=Object.prototype,r=n.hasOwnProperty,a=n.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(o){return t(o)&&r.call(o,"callee")&&!a.call(o,"callee")};return Ub=i,Ub}var Ku={exports:{}},qb,nk;function cQ(){if(nk)return qb;nk=1;function e(){return!1}return qb=e,qb}Ku.exports;var rk;function n5(){return rk||(rk=1,(function(e,t){var n=ys(),r=cQ(),a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,c=o?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(Ku,Ku.exports)),Ku.exports}var Wb,ak;function fN(){if(ak)return Wb;ak=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,a){var i=typeof r;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<a}return Wb=n,Wb}var Vb,sk;function pN(){if(sk)return Vb;sk=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Vb=t,Vb}var Hb,ik;function uQ(){if(ik)return Hb;ik=1;var e=Xs(),t=pN(),n=Qs(),r="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",g="[object RegExp]",y="[object Set]",j="[object String]",w="[object WeakMap]",x="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",A="[object Float64Array]",P="[object Int8Array]",E="[object Int16Array]",O="[object Int32Array]",k="[object Uint8Array]",R="[object Uint8ClampedArray]",D="[object Uint16Array]",U="[object Uint32Array]",z={};z[N]=z[A]=z[P]=z[E]=z[O]=z[k]=z[R]=z[D]=z[U]=!0,z[r]=z[a]=z[x]=z[i]=z[S]=z[o]=z[c]=z[d]=z[f]=z[h]=z[p]=z[g]=z[y]=z[j]=z[w]=!1;function L(G){return n(G)&&t(G.length)&&!!z[e(G)]}return Hb=L,Hb}var Kb,ok;function r5(){if(ok)return Kb;ok=1;function e(t){return function(n){return t(n)}}return Kb=e,Kb}var Gu={exports:{}};Gu.exports;var lk;function dQ(){return lk||(lk=1,(function(e,t){var n=S3(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,c=(function(){try{var d=a&&a.require&&a.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(Gu,Gu.exports)),Gu.exports}var Gb,ck;function a5(){if(ck)return Gb;ck=1;var e=uQ(),t=r5(),n=dQ(),r=n&&n.isTypedArray,a=r?t(r):e;return Gb=a,Gb}var Yb,uk;function fQ(){if(uk)return Yb;uk=1;var e=oQ(),t=dN(),n=Pr(),r=n5(),a=fN(),i=a5(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),g=!p&&t(f),y=!p&&!g&&r(f),j=!p&&!g&&!y&&i(f),w=p||g||y||j,x=w?e(f.length,String):[],S=x.length;for(var N in f)(h||c.call(f,N))&&!(w&&(N=="length"||y&&(N=="offset"||N=="parent")||j&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,S)))&&x.push(N);return x}return Yb=d,Yb}var Xb,dk;function pQ(){if(dk)return Xb;dk=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return Xb=t,Xb}var Qb,fk;function s5(){if(fk)return Qb;fk=1;function e(t,n){return function(r){return t(n(r))}}return Qb=e,Qb}var Jb,pk;function hQ(){if(pk)return Jb;pk=1;var e=s5(),t=e(Object.keys,Object);return Jb=t,Jb}var Zb,hk;function mQ(){if(hk)return Zb;hk=1;var e=pQ(),t=hQ(),n=Object.prototype,r=n.hasOwnProperty;function a(i){if(!e(i))return t(i);var o=[];for(var c in Object(i))r.call(i,c)&&c!="constructor"&&o.push(c);return o}return Zb=a,Zb}var e0,mk;function ff(){if(mk)return e0;mk=1;var e=QS(),t=pN();function n(r){return r!=null&&t(r.length)&&!e(r)}return e0=n,e0}var t0,vk;function dv(){if(vk)return t0;vk=1;var e=fQ(),t=mQ(),n=ff();function r(a){return n(a)?e(a):t(a)}return t0=r,t0}var n0,gk;function vQ(){if(gk)return n0;gk=1;var e=rQ(),t=iQ(),n=dv();function r(a){return e(a,n,t)}return n0=r,n0}var r0,yk;function gQ(){if(yk)return r0;yk=1;var e=vQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,o,c,d,f,h){var p=c&t,g=e(i),y=g.length,j=e(o),w=j.length;if(y!=w&&!p)return!1;for(var x=y;x--;){var S=g[x];if(!(p?S in o:r.call(o,S)))return!1}var N=h.get(i),A=h.get(o);if(N&&A)return N==o&&A==i;var P=!0;h.set(i,o),h.set(o,i);for(var E=p;++x<y;){S=g[x];var O=i[S],k=o[S];if(d)var R=p?d(k,O,S,o,i,h):d(O,k,S,i,o,h);if(!(R===void 0?O===k||f(O,k,c,d,h):R)){P=!1;break}E||(E=S=="constructor")}if(P&&!E){var D=i.constructor,U=o.constructor;D!=U&&"constructor"in i&&"constructor"in o&&!(typeof D=="function"&&D instanceof D&&typeof U=="function"&&U instanceof U)&&(P=!1)}return h.delete(i),h.delete(o),P}return r0=a,r0}var a0,xk;function yQ(){if(xk)return a0;xk=1;var e=Bo(),t=ys(),n=e(t,"DataView");return a0=n,a0}var s0,bk;function xQ(){if(bk)return s0;bk=1;var e=Bo(),t=ys(),n=e(t,"Promise");return s0=n,s0}var i0,wk;function i5(){if(wk)return i0;wk=1;var e=Bo(),t=ys(),n=e(t,"Set");return i0=n,i0}var o0,jk;function bQ(){if(jk)return o0;jk=1;var e=Bo(),t=ys(),n=e(t,"WeakMap");return o0=n,o0}var l0,Sk;function wQ(){if(Sk)return l0;Sk=1;var e=yQ(),t=ZS(),n=xQ(),r=i5(),a=bQ(),i=Xs(),o=N3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",g="[object DataView]",y=o(e),j=o(t),w=o(n),x=o(r),S=o(a),N=i;return(e&&N(new e(new ArrayBuffer(1)))!=g||t&&N(new t)!=c||n&&N(n.resolve())!=f||r&&N(new r)!=h||a&&N(new a)!=p)&&(N=function(A){var P=i(A),E=P==d?A.constructor:void 0,O=E?o(E):"";if(O)switch(O){case y:return g;case j:return c;case w:return f;case x:return h;case S:return p}return P}),l0=N,l0}var c0,Nk;function jQ(){if(Nk)return c0;Nk=1;var e=X3(),t=e5(),n=nQ(),r=gQ(),a=wQ(),i=Pr(),o=n5(),c=a5(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",g=Object.prototype,y=g.hasOwnProperty;function j(w,x,S,N,A,P){var E=i(w),O=i(x),k=E?h:a(w),R=O?h:a(x);k=k==f?p:k,R=R==f?p:R;var D=k==p,U=R==p,z=k==R;if(z&&o(w)){if(!o(x))return!1;E=!0,D=!1}if(z&&!D)return P||(P=new e),E||c(w)?t(w,x,S,N,A,P):n(w,x,k,S,N,A,P);if(!(S&d)){var L=D&&y.call(w,"__wrapped__"),G=U&&y.call(x,"__wrapped__");if(L||G){var q=L?w.value():w,H=G?x.value():x;return P||(P=new e),A(q,H,S,N,P)}}return z?(P||(P=new e),r(w,x,S,N,A,P)):!1}return c0=j,c0}var u0,Ck;function hN(){if(Ck)return u0;Ck=1;var e=jQ(),t=Qs();function n(r,a,i,o,c){return r===a?!0:r==null||a==null||!t(r)&&!t(a)?r!==r&&a!==a:e(r,a,i,o,n,c)}return u0=n,u0}var d0,Ak;function SQ(){if(Ak)return d0;Ak=1;var e=X3(),t=hN(),n=1,r=2;function a(i,o,c,d){var f=c.length,h=f,p=!d;if(i==null)return!h;for(i=Object(i);f--;){var g=c[f];if(p&&g[2]?g[1]!==i[g[0]]:!(g[0]in i))return!1}for(;++f<h;){g=c[f];var y=g[0],j=i[y],w=g[1];if(p&&g[2]){if(j===void 0&&!(y in i))return!1}else{var x=new e;if(d)var S=d(j,w,y,i,o,x);if(!(S===void 0?t(w,j,n|r,d,x):S))return!1}}return!0}return d0=a,d0}var f0,Ek;function o5(){if(Ek)return f0;Ek=1;var e=zi();function t(n){return n===n&&!e(n)}return f0=t,f0}var p0,_k;function NQ(){if(_k)return p0;_k=1;var e=o5(),t=dv();function n(r){for(var a=t(r),i=a.length;i--;){var o=a[i],c=r[o];a[i]=[o,c,e(c)]}return a}return p0=n,p0}var h0,Pk;function l5(){if(Pk)return h0;Pk=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return h0=e,h0}var m0,Ok;function CQ(){if(Ok)return m0;Ok=1;var e=SQ(),t=NQ(),n=l5();function r(a){var i=t(a);return i.length==1&&i[0][2]?n(i[0][0],i[0][1]):function(o){return o===a||e(o,a,i)}}return m0=r,m0}var v0,kk;function AQ(){if(kk)return v0;kk=1;function e(t,n){return t!=null&&n in Object(t)}return v0=e,v0}var g0,Rk;function EQ(){if(Rk)return g0;Rk=1;var e=E3(),t=dN(),n=Pr(),r=fN(),a=pN(),i=iv();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,g=!1;++h<p;){var y=i(d[h]);if(!(g=c!=null&&f(c,y)))break;c=c[y]}return g||++h!=p?g:(p=c==null?0:c.length,!!p&&a(p)&&r(y,p)&&(n(c)||t(c)))}return g0=o,g0}var y0,Tk;function _Q(){if(Tk)return y0;Tk=1;var e=AQ(),t=EQ();function n(r,a){return r!=null&&t(r,a,e)}return y0=n,y0}var x0,Ik;function PQ(){if(Ik)return x0;Ik=1;var e=hN(),t=_3(),n=_Q(),r=XS(),a=o5(),i=l5(),o=iv(),c=1,d=2;function f(h,p){return r(h)&&a(p)?i(o(h),p):function(g){var y=t(g,h);return y===void 0&&y===p?n(g,h):e(p,y,c|d)}}return x0=f,x0}var b0,Mk;function Uc(){if(Mk)return b0;Mk=1;function e(t){return t}return b0=e,b0}var w0,$k;function OQ(){if($k)return w0;$k=1;function e(t){return function(n){return n?.[t]}}return w0=e,w0}var j0,Dk;function kQ(){if(Dk)return j0;Dk=1;var e=nN();function t(n){return function(r){return e(r,n)}}return j0=t,j0}var S0,Lk;function RQ(){if(Lk)return S0;Lk=1;var e=OQ(),t=kQ(),n=XS(),r=iv();function a(i){return n(i)?e(r(i)):t(i)}return S0=a,S0}var N0,Fk;function xs(){if(Fk)return N0;Fk=1;var e=CQ(),t=PQ(),n=Uc(),r=Pr(),a=RQ();function i(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):a(o)}return N0=i,N0}var C0,Bk;function c5(){if(Bk)return C0;Bk=1;function e(t,n,r,a){for(var i=t.length,o=r+(a?1:-1);a?o--:++o<i;)if(n(t[o],o,t))return o;return-1}return C0=e,C0}var A0,zk;function TQ(){if(zk)return A0;zk=1;function e(t){return t!==t}return A0=e,A0}var E0,Uk;function IQ(){if(Uk)return E0;Uk=1;function e(t,n,r){for(var a=r-1,i=t.length;++a<i;)if(t[a]===n)return a;return-1}return E0=e,E0}var _0,qk;function MQ(){if(qk)return _0;qk=1;var e=c5(),t=TQ(),n=IQ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return _0=r,_0}var P0,Wk;function $Q(){if(Wk)return P0;Wk=1;var e=MQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return P0=t,P0}var O0,Vk;function DQ(){if(Vk)return O0;Vk=1;function e(t,n,r){for(var a=-1,i=t==null?0:t.length;++a<i;)if(r(n,t[a]))return!0;return!1}return O0=e,O0}var k0,Hk;function LQ(){if(Hk)return k0;Hk=1;function e(){}return k0=e,k0}var R0,Kk;function FQ(){if(Kk)return R0;Kk=1;var e=i5(),t=LQ(),n=uN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return R0=a,R0}var T0,Gk;function BQ(){if(Gk)return T0;Gk=1;var e=Q3(),t=$Q(),n=DQ(),r=Z3(),a=FQ(),i=uN(),o=200;function c(d,f,h){var p=-1,g=t,y=d.length,j=!0,w=[],x=w;if(h)j=!1,g=n;else if(y>=o){var S=f?null:a(d);if(S)return i(S);j=!1,g=r,x=new e}else x=f?[]:w;e:for(;++p<y;){var N=d[p],A=f?f(N):N;if(N=h||N!==0?N:0,j&&A===A){for(var P=x.length;P--;)if(x[P]===A)continue e;f&&x.push(A),w.push(N)}else g(x,A,h)||(x!==w&&x.push(A),w.push(N))}return w}return T0=c,T0}var I0,Yk;function zQ(){if(Yk)return I0;Yk=1;var e=xs(),t=BQ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return I0=n,I0}var UQ=zQ();const Xk=Yt(UQ);function u5(e,t,n){return t===!0?Xk(e,n):wt(t)?Xk(e,t):e}function rc(e){"@babel/helpers - typeof";return rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(e)}var qQ=["ref"];function Qk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ks(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qk(Object(n),!0).forEach(function(r){fv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f5(r.key),r)}}function VQ(e,t,n){return t&&Jk(e.prototype,t),n&&Jk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function HQ(e,t,n){return t=Ah(t),KQ(e,d5()?Reflect.construct(t,n||[],Ah(e).constructor):t.apply(e,n))}function KQ(e,t){if(t&&(rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GQ(e)}function GQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(d5=function(){return!!e})()}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ah(e)}function YQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y1(e,t)}function Y1(e,t){return Y1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Y1(e,t)}function fv(e,t,n){return t=f5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f5(e){var t=XQ(e,"string");return rc(t)=="symbol"?t:t+""}function XQ(e,t){if(rc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function QQ(e,t){if(e==null)return{};var n=JQ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ZQ(e){return e.value}function eJ(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=QQ(t,qQ);return W.createElement(cN,n)}var Zk=1,ql=(function(e){function t(){var n;WQ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=HQ(this,t,[].concat(a)),fv(n,"lastBoundingBox",{width:-1,height:-1}),n}return YQ(t,e),VQ(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>Zk||Math.abs(a.height-this.lastBoundingBox.height)>Zk)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?ks({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,i=a.layout,o=a.align,c=a.verticalAlign,d=a.margin,f=a.chartWidth,h=a.chartHeight,p,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var y=this.getBBoxSnapshot();p={left:((f||0)-y.width)/2}}else p=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var j=this.getBBoxSnapshot();g={top:((h||0)-j.height)/2}}else g=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return ks(ks({},p),g)}},{key:"render",value:function(){var r=this,a=this.props,i=a.content,o=a.width,c=a.height,d=a.wrapperStyle,f=a.payloadUniqBy,h=a.payload,p=ks(ks({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return W.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(y){r.wrapperNode=y}},eJ(i,ks(ks({},this.props),{},{payload:u5(h,f,ZQ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=ks(ks({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&De(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);fv(ql,"displayName","Legend");fv(ql,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var M0,e2;function tJ(){if(e2)return M0;e2=1;var e=uf(),t=dN(),n=Pr(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return M0=a,M0}var $0,t2;function p5(){if(t2)return $0;t2=1;var e=t5(),t=tJ();function n(r,a,i,o,c){var d=-1,f=r.length;for(i||(i=t),c||(c=[]);++d<f;){var h=r[d];a>0&&i(h)?a>1?n(h,a-1,i,o,c):e(c,h):o||(c[c.length]=h)}return c}return $0=n,$0}var D0,n2;function nJ(){if(n2)return D0;n2=1;function e(t){return function(n,r,a){for(var i=-1,o=Object(n),c=a(n),d=c.length;d--;){var f=c[t?d:++i];if(r(o[f],f,o)===!1)break}return n}}return D0=e,D0}var L0,r2;function rJ(){if(r2)return L0;r2=1;var e=nJ(),t=e();return L0=t,L0}var F0,a2;function h5(){if(a2)return F0;a2=1;var e=rJ(),t=dv();function n(r,a){return r&&e(r,a,t)}return F0=n,F0}var B0,s2;function aJ(){if(s2)return B0;s2=1;var e=ff();function t(n,r){return function(a,i){if(a==null)return a;if(!e(a))return n(a,i);for(var o=a.length,c=r?o:-1,d=Object(a);(r?c--:++c<o)&&i(d[c],c,d)!==!1;);return a}}return B0=t,B0}var z0,i2;function mN(){if(i2)return z0;i2=1;var e=h5(),t=aJ(),n=t(e);return z0=n,z0}var U0,o2;function m5(){if(o2)return U0;o2=1;var e=mN(),t=ff();function n(r,a){var i=-1,o=t(r)?Array(r.length):[];return e(r,function(c,d,f){o[++i]=a(c,d,f)}),o}return U0=n,U0}var q0,l2;function sJ(){if(l2)return q0;l2=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return q0=e,q0}var W0,c2;function iJ(){if(c2)return W0;c2=1;var e=Fc();function t(n,r){if(n!==r){var a=n!==void 0,i=n===null,o=n===n,c=e(n),d=r!==void 0,f=r===null,h=r===r,p=e(r);if(!f&&!p&&!c&&n>r||c&&d&&h&&!f&&!p||i&&d&&h||!a&&h||!o)return 1;if(!i&&!c&&!p&&n<r||p&&a&&o&&!i&&!c||f&&a&&o||!d&&o||!h)return-1}return 0}return W0=t,W0}var V0,u2;function oJ(){if(u2)return V0;u2=1;var e=iJ();function t(n,r,a){for(var i=-1,o=n.criteria,c=r.criteria,d=o.length,f=a.length;++i<d;){var h=e(o[i],c[i]);if(h){if(i>=f)return h;var p=a[i];return h*(p=="desc"?-1:1)}}return n.index-r.index}return V0=t,V0}var H0,d2;function lJ(){if(d2)return H0;d2=1;var e=tN(),t=nN(),n=xs(),r=m5(),a=sJ(),i=r5(),o=oJ(),c=Uc(),d=Pr();function f(h,p,g){p.length?p=e(p,function(w){return d(w)?function(x){return t(x,w.length===1?w[0]:w)}:w}):p=[c];var y=-1;p=e(p,i(n));var j=r(h,function(w,x,S){var N=e(p,function(A){return A(w)});return{criteria:N,index:++y,value:w}});return a(j,function(w,x){return o(w,x,g)})}return H0=f,H0}var K0,f2;function cJ(){if(f2)return K0;f2=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return K0=e,K0}var G0,p2;function uJ(){if(p2)return G0;p2=1;var e=cJ(),t=Math.max;function n(r,a,i){return a=t(a===void 0?r.length-1:a,0),function(){for(var o=arguments,c=-1,d=t(o.length-a,0),f=Array(d);++c<d;)f[c]=o[a+c];c=-1;for(var h=Array(a+1);++c<a;)h[c]=o[c];return h[a]=i(f),e(r,this,h)}}return G0=n,G0}var Y0,h2;function dJ(){if(h2)return Y0;h2=1;function e(t){return function(){return t}}return Y0=e,Y0}var X0,m2;function v5(){if(m2)return X0;m2=1;var e=Bo(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return X0=t,X0}var Q0,v2;function fJ(){if(v2)return Q0;v2=1;var e=dJ(),t=v5(),n=Uc(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return Q0=r,Q0}var J0,g2;function pJ(){if(g2)return J0;g2=1;var e=800,t=16,n=Date.now;function r(a){var i=0,o=0;return function(){var c=n(),d=t-(c-o);if(o=c,d>0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return J0=r,J0}var Z0,y2;function hJ(){if(y2)return Z0;y2=1;var e=fJ(),t=pJ(),n=t(e);return Z0=n,Z0}var ew,x2;function mJ(){if(x2)return ew;x2=1;var e=Uc(),t=uJ(),n=hJ();function r(a,i){return n(t(a,i,e),a+"")}return ew=r,ew}var tw,b2;function pv(){if(b2)return tw;b2=1;var e=JS(),t=ff(),n=fN(),r=zi();function a(i,o,c){if(!r(c))return!1;var d=typeof o;return(d=="number"?t(c)&&n(o,c.length):d=="string"&&o in c)?e(c[o],i):!1}return tw=a,tw}var nw,w2;function vJ(){if(w2)return nw;w2=1;var e=p5(),t=lJ(),n=mJ(),r=pv(),a=n(function(i,o){if(i==null)return[];var c=o.length;return c>1&&r(i,o[0],o[1])?o=[]:c>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return nw=a,nw}var gJ=vJ();const vN=Yt(gJ);function gd(e){"@babel/helpers - typeof";return gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gd(e)}function X1(){return X1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X1.apply(this,arguments)}function yJ(e,t){return jJ(e)||wJ(e,t)||bJ(e,t)||xJ()}function xJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
60
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bJ(e,t){if(e){if(typeof e=="string")return j2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j2(e,t)}}function j2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function jJ(e){if(Array.isArray(e))return e}function S2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?S2(Object(n),!0).forEach(function(r){SJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SJ(e,t,n){return t=NJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NJ(e){var t=CJ(e,"string");return gd(t)=="symbol"?t:t+""}function CJ(e,t){if(gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AJ(e){return Array.isArray(e)&&Fn(e[0])&&Fn(e[1])?e.join(" ~ "):e}var EJ=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,c=o===void 0?{}:o,d=t.labelStyle,f=d===void 0?{}:d,h=t.payload,p=t.formatter,g=t.itemSorter,y=t.wrapperClassName,j=t.labelClassName,w=t.label,x=t.labelFormatter,S=t.accessibilityLayer,N=S===void 0?!1:S,A=function(){if(h&&h.length){var L={padding:0,margin:0},G=(g?vN(h,g):h).map(function(q,H){if(q.type==="none")return null;var X=rw({display:"block",paddingTop:4,paddingBottom:4,color:q.color||"#000"},c),Z=q.formatter||p||AJ,I=q.value,F=q.name,Q=I,B=F;if(Z&&Q!=null&&B!=null){var $=Z(I,F,q,H,h);if(Array.isArray($)){var ee=yJ($,2);Q=ee[0],B=ee[1]}else Q=$}return W.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(H),style:X},Fn(B)?W.createElement("span",{className:"recharts-tooltip-item-name"},B):null,Fn(B)?W.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,W.createElement("span",{className:"recharts-tooltip-item-value"},Q),W.createElement("span",{className:"recharts-tooltip-item-unit"},q.unit||""))});return W.createElement("ul",{className:"recharts-tooltip-item-list",style:L},G)}return null},P=rw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),E=rw({margin:0},f),O=!jt(w),k=O?w:"",R=St("recharts-default-tooltip",y),D=St("recharts-tooltip-label",j);O&&x&&h!==void 0&&h!==null&&(k=x(w,h));var U=N?{role:"status","aria-live":"assertive"}:{};return W.createElement("div",X1({className:R,style:P},U),W.createElement("p",{className:D,style:E},W.isValidElement(k)?k:"".concat(k)),A())};function yd(e){"@babel/helpers - typeof";return yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yd(e)}function Bp(e,t,n){return t=_J(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _J(e){var t=PJ(e,"string");return yd(t)=="symbol"?t:t+""}function PJ(e,t){if(yd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Iu="recharts-tooltip-wrapper",OJ={visibility:"hidden"};function kJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return St(Iu,Bp(Bp(Bp(Bp({},"".concat(Iu,"-right"),De(n)&&t&&De(t.x)&&n>=t.x),"".concat(Iu,"-left"),De(n)&&t&&De(t.x)&&n<t.x),"".concat(Iu,"-bottom"),De(r)&&t&&De(t.y)&&r>=t.y),"".concat(Iu,"-top"),De(r)&&t&&De(t.y)&&r<t.y))}function N2(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,c=e.tooltipDimension,d=e.viewBox,f=e.viewBoxDimension;if(i&&De(i[r]))return i[r];var h=n[r]-c-a,p=n[r]+a;if(t[r])return o[r]?h:p;if(o[r]){var g=h,y=d[r];return g<y?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,w=d[r]+f;return j>w?Math.max(h,d[r]):Math.max(p,d[r])}function RJ(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 TJ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,c=e.useTranslate3d,d=e.viewBox,f,h,p;return o.height>0&&o.width>0&&n?(h=N2({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=N2({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=RJ({translateX:h,translateY:p,useTranslate3d:c})):f=OJ,{cssProperties:f,cssClasses:kJ({translateX:h,translateY:p,coordinate:n})}}function ac(e){"@babel/helpers - typeof";return ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ac(e)}function C2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function A2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C2(Object(n),!0).forEach(function(r){J1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y5(r.key),r)}}function $J(e,t,n){return t&&MJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function DJ(e,t,n){return t=Eh(t),LJ(e,g5()?Reflect.construct(t,n||[],Eh(e).constructor):t.apply(e,n))}function LJ(e,t){if(t&&(ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FJ(e)}function FJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g5=function(){return!!e})()}function Eh(e){return Eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Eh(e)}function BJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q1(e,t)}function Q1(e,t){return Q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Q1(e,t)}function J1(e,t,n){return t=y5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y5(e){var t=zJ(e,"string");return ac(t)=="symbol"?t:t+""}function zJ(e,t){if(ac(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ac(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var E2=1,UJ=(function(e){function t(){var n;IJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=DJ(this,t,[].concat(a)),J1(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),J1(n,"handleKeyDown",function(o){if(o.key==="Escape"){var c,d,f,h;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(c=(d=n.props.coordinate)===null||d===void 0?void 0:d.x)!==null&&c!==void 0?c:0,y:(f=(h=n.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&f!==void 0?f:0}})}}),n}return BJ(t,e),$J(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>E2||Math.abs(r.height-this.state.lastBoundingBox.height)>E2)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.children,h=a.coordinate,p=a.hasPayload,g=a.isAnimationActive,y=a.offset,j=a.position,w=a.reverseDirection,x=a.useTranslate3d,S=a.viewBox,N=a.wrapperStyle,A=TJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:y,position:j,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:S}),P=A.cssClasses,E=A.cssProperties,O=A2(A2({transition:g&&i?"transform ".concat(c,"ms ").concat(d):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},N);return W.createElement("div",{tabIndex:-1,className:P,style:O,ref:function(R){r.wrapperNode=R}},f)}}])})(v.PureComponent),qJ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},zo={isSsr:qJ()};function sc(e){"@babel/helpers - typeof";return sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(e)}function _2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function P2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_2(Object(n),!0).forEach(function(r){gN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,b5(r.key),r)}}function HJ(e,t,n){return t&&VJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function KJ(e,t,n){return t=_h(t),GJ(e,x5()?Reflect.construct(t,n||[],_h(e).constructor):t.apply(e,n))}function GJ(e,t){if(t&&(sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YJ(e)}function YJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x5=function(){return!!e})()}function _h(e){return _h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_h(e)}function XJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Z1(e,t)}function Z1(e,t){return Z1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Z1(e,t)}function gN(e,t,n){return t=b5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b5(e){var t=QJ(e,"string");return sc(t)=="symbol"?t:t+""}function QJ(e,t){if(sc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function JJ(e){return e.dataKey}function ZJ(e,t){return W.isValidElement(e)?W.cloneElement(e,t):typeof e=="function"?W.createElement(e,t):W.createElement(EJ,t)}var qr=(function(e){function t(){return WJ(this,t),KJ(this,t,arguments)}return XJ(t,e),HJ(t,[{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.content,h=a.coordinate,p=a.filterNull,g=a.isAnimationActive,y=a.offset,j=a.payload,w=a.payloadUniqBy,x=a.position,S=a.reverseDirection,N=a.useTranslate3d,A=a.viewBox,P=a.wrapperStyle,E=j??[];p&&E.length&&(E=u5(j.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),w,JJ));var O=E.length>0;return W.createElement(UJ,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:g,active:i,coordinate:h,hasPayload:O,offset:y,position:x,reverseDirection:S,useTranslate3d:N,viewBox:A,wrapperStyle:P},ZJ(f,P2(P2({},this.props),{},{payload:E})))}}])})(v.PureComponent);gN(qr,"displayName","Tooltip");gN(qr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!zo.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var aw,O2;function eZ(){if(O2)return aw;O2=1;var e=ys(),t=function(){return e.Date.now()};return aw=t,aw}var sw,k2;function tZ(){if(k2)return sw;k2=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return sw=t,sw}var iw,R2;function nZ(){if(R2)return iw;R2=1;var e=tZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return iw=n,iw}var ow,T2;function w5(){if(T2)return ow;T2=1;var e=nZ(),t=zi(),n=Fc(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=t(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=i.test(f);return p||o.test(f)?c(f.slice(2),p?2:8):a.test(f)?r:+f}return ow=d,ow}var lw,I2;function rZ(){if(I2)return lw;I2=1;var e=zi(),t=eZ(),n=w5(),r="Expected a function",a=Math.max,i=Math.min;function o(c,d,f){var h,p,g,y,j,w,x=0,S=!1,N=!1,A=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,N="maxWait"in f,g=N?a(n(f.maxWait)||0,d):g,A="trailing"in f?!!f.trailing:A);function P(G){var q=h,H=p;return h=p=void 0,x=G,y=c.apply(H,q),y}function E(G){return x=G,j=setTimeout(R,d),S?P(G):y}function O(G){var q=G-w,H=G-x,X=d-q;return N?i(X,g-H):X}function k(G){var q=G-w,H=G-x;return w===void 0||q>=d||q<0||N&&H>=g}function R(){var G=t();if(k(G))return D(G);j=setTimeout(R,O(G))}function D(G){return j=void 0,A&&h?P(G):(h=p=void 0,y)}function U(){j!==void 0&&clearTimeout(j),x=0,h=w=p=j=void 0}function z(){return j===void 0?y:D(t())}function L(){var G=t(),q=k(G);if(h=arguments,p=this,w=G,q){if(j===void 0)return E(w);if(N)return clearTimeout(j),j=setTimeout(R,d),P(w)}return j===void 0&&(j=setTimeout(R,d)),y}return L.cancel=U,L.flush=z,L}return lw=o,lw}var cw,M2;function aZ(){if(M2)return cw;M2=1;var e=rZ(),t=zi(),n="Expected a function";function r(a,i,o){var c=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(o)&&(c="leading"in o?!!o.leading:c,d="trailing"in o?!!o.trailing:d),e(a,i,{leading:c,maxWait:i,trailing:d})}return cw=r,cw}var sZ=aZ();const j5=Yt(sZ);function xd(e){"@babel/helpers - typeof";return xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xd(e)}function $2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$2(Object(n),!0).forEach(function(r){iZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iZ(e,t,n){return t=oZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oZ(e){var t=lZ(e,"string");return xd(t)=="symbol"?t:t+""}function lZ(e,t){if(xd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cZ(e,t){return pZ(e)||fZ(e,t)||dZ(e,t)||uZ()}function uZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
61
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dZ(e,t){if(e){if(typeof e=="string")return D2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D2(e,t)}}function D2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function pZ(e){if(Array.isArray(e))return e}var ej=v.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,c=e.height,d=c===void 0?"100%":c,f=e.minWidth,h=f===void 0?0:f,p=e.minHeight,g=e.maxHeight,y=e.children,j=e.debounce,w=j===void 0?0:j,x=e.id,S=e.className,N=e.onResize,A=e.style,P=A===void 0?{}:A,E=v.useRef(null),O=v.useRef();O.current=N,v.useImperativeHandle(t,function(){return Object.defineProperty(E.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),E.current},configurable:!0})});var k=v.useState({containerWidth:a.width,containerHeight:a.height}),R=cZ(k,2),D=R[0],U=R[1],z=v.useCallback(function(G,q){U(function(H){var X=Math.round(G),Z=Math.round(q);return H.containerWidth===X&&H.containerHeight===Z?H:{containerWidth:X,containerHeight:Z}})},[]);v.useEffect(function(){var G=function(F){var Q,B=F[0].contentRect,$=B.width,ee=B.height;z($,ee),(Q=O.current)===null||Q===void 0||Q.call(O,$,ee)};w>0&&(G=j5(G,w,{trailing:!0,leading:!1}));var q=new ResizeObserver(G),H=E.current.getBoundingClientRect(),X=H.width,Z=H.height;return z(X,Z),q.observe(E.current),function(){q.disconnect()}},[z,w]);var L=v.useMemo(function(){var G=D.containerWidth,q=D.containerHeight;if(G<0||q<0)return null;Bs(go(o)||go(d),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
-
maybe you don't need to use a ResponsiveContainer.`,o,d),Bs(!n||n>0,"The aspect(%s) must be greater than zero.",n);var H=go(o)?G:o,X=go(d)?q:d;n&&n>0&&(H?X=H/n:X&&(H=X*n),g&&X>g&&(X=g)),Bs(H>0||X>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
63
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
64
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
65
|
-
height and width.`,H,X,o,d,h,p,n);var Z=!Array.isArray(y)&&Fs(y.type).endsWith("Chart");return W.Children.map(y,function(I){return W.isValidElement(I)?v.cloneElement(I,zp({width:H,height:X},Z?{style:zp({height:"100%",width:"100%",maxHeight:X,maxWidth:H},I.props.style)}:{})):I})},[n,y,d,g,p,h,D,o]);return W.createElement("div",{id:x?"".concat(x):void 0,className:St("recharts-responsive-container",S),style:zp(zp({},P),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:g}),ref:E},L)}),hv=function(t){return null};hv.displayName="Cell";function bd(e){"@babel/helpers - typeof";return bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bd(e)}function L2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tj(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){hZ(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 hZ(e,t,n){return t=mZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mZ(e){var t=vZ(e,"string");return bd(t)=="symbol"?t:t+""}function vZ(e,t){if(bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sl={widthCache:{},cacheCount:0},gZ=2e3,yZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},F2="recharts_measurement_span";function xZ(e){var t=tj({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var ed=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||zo.isSsr)return{width:0,height:0};var r=xZ(n),a=JSON.stringify({text:t,copyStyle:r});if(Sl.widthCache[a])return Sl.widthCache[a];try{var i=document.getElementById(F2);i||(i=document.createElement("span"),i.setAttribute("id",F2),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=tj(tj({},yZ),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return Sl.widthCache[a]=d,++Sl.cacheCount>gZ&&(Sl.cacheCount=0,Sl.widthCache={}),d}catch{return{width:0,height:0}}},bZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function wd(e){"@babel/helpers - typeof";return wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wd(e)}function Ph(e,t){return NZ(e)||SZ(e,t)||jZ(e,t)||wZ()}function wZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
66
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jZ(e,t){if(e){if(typeof e=="string")return B2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return B2(e,t)}}function B2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function SZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function NZ(e){if(Array.isArray(e))return e}function CZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z2(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,EZ(r.key),r)}}function AZ(e,t,n){return t&&z2(e.prototype,t),n&&z2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function EZ(e){var t=_Z(e,"string");return wd(t)=="symbol"?t:t+""}function _Z(e,t){if(wd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var U2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,q2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,PZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,OZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,S5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},kZ=Object.keys(S5),kl="NaN";function RZ(e,t){return e*S5[t]}var Up=(function(){function e(t,n){CZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!PZ.test(n)&&(this.num=NaN,this.unit=""),kZ.includes(n)&&(this.num=RZ(t,n),this.unit="px")}return AZ(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=OZ.exec(n))!==null&&r!==void 0?r:[],i=Ph(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function N5(e){if(e.includes(kl))return kl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=U2.exec(t))!==null&&n!==void 0?n:[],a=Ph(r,4),i=a[1],o=a[2],c=a[3],d=Up.parse(i??""),f=Up.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return kl;t=t.replace(U2,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=q2.exec(t))!==null&&p!==void 0?p:[],y=Ph(g,4),j=y[1],w=y[2],x=y[3],S=Up.parse(j??""),N=Up.parse(x??""),A=w==="+"?S.add(N):S.subtract(N);if(A.isNaN())return kl;t=t.replace(q2,A.toString())}return t}var W2=/\(([^()]*)\)/;function TZ(e){for(var t=e;t.includes("(");){var n=W2.exec(t),r=Ph(n,2),a=r[1];t=t.replace(W2,N5(a))}return t}function IZ(e){var t=e.replace(/\s+/g,"");return t=TZ(t),t=N5(t),t}function MZ(e){try{return IZ(e)}catch{return kl}}function uw(e){var t=MZ(e.slice(5,-1));return t===kl?"":t}var $Z=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],DZ=["dx","dy","angle","className","breakAll"];function nj(){return nj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nj.apply(this,arguments)}function V2(e,t){if(e==null)return{};var n=LZ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function H2(e,t){return UZ(e)||zZ(e,t)||BZ(e,t)||FZ()}function FZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
67
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BZ(e,t){if(e){if(typeof e=="string")return K2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K2(e,t)}}function K2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function UZ(e){if(Array.isArray(e))return e}var C5=/[ \f\n\r\t\v\u2028\u2029]+/,A5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];jt(n)||(r?i=n.toString().split(""):i=n.toString().split(C5));var o=i.map(function(d){return{word:d,width:ed(d,a).width}}),c=r?0:ed(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},qZ=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=De(o),p=c,g=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return H.reduce(function(X,Z){var I=Z.word,F=Z.width,Q=X[X.length-1];if(Q&&(a==null||i||Q.width+F+r<Number(a)))Q.words.push(I),Q.width+=F+r;else{var B={words:[I],width:F};X.push(B)}return X},[])},y=g(n),j=function(H){return H.reduce(function(X,Z){return X.width>Z.width?X:Z})};if(!h)return y;for(var w="…",x=function(H){var X=p.slice(0,H),Z=A5({breakAll:f,style:d,children:X+w}).wordsWithComputedWidth,I=g(Z),F=I.length>o||j(I).width>Number(a);return[F,I]},S=0,N=p.length-1,A=0,P;S<=N&&A<=p.length-1;){var E=Math.floor((S+N)/2),O=E-1,k=x(O),R=H2(k,2),D=R[0],U=R[1],z=x(E),L=H2(z,1),G=L[0];if(!D&&!G&&(S=E+1),D&&G&&(N=E-1),!D&&G){P=U;break}A++}return P||y},G2=function(t){var n=jt(t)?[]:t.toString().split(C5);return[{words:n}]},WZ=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!zo.isSsr){var d,f,h=A5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,g=h.spaceWidth;d=p,f=g}else return G2(a);return qZ({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return G2(a)},Y2="#808080",Po=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.lineHeight,c=o===void 0?"1em":o,d=t.capHeight,f=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,g=t.textAnchor,y=g===void 0?"start":g,j=t.verticalAnchor,w=j===void 0?"end":j,x=t.fill,S=x===void 0?Y2:x,N=V2(t,$Z),A=v.useMemo(function(){return WZ({breakAll:N.breakAll,children:N.children,maxLines:N.maxLines,scaleToFit:p,style:N.style,width:N.width})},[N.breakAll,N.children,N.maxLines,p,N.style,N.width]),P=N.dx,E=N.dy,O=N.angle,k=N.className,R=N.breakAll,D=V2(N,DZ);if(!Fn(r)||!Fn(i))return null;var U=r+(De(P)?P:0),z=i+(De(E)?E:0),L;switch(w){case"start":L=uw("calc(".concat(f,")"));break;case"middle":L=uw("calc(".concat((A.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:L=uw("calc(".concat(A.length-1," * -").concat(c,")"));break}var G=[];if(p){var q=A[0].width,H=N.width;G.push("scale(".concat((De(H)?H/q:1)/q,")"))}return O&&G.push("rotate(".concat(O,", ").concat(U,", ").concat(z,")")),G.length&&(D.transform=G.join(" ")),W.createElement("text",nj({},ht(D,!0),{x:U,y:z,className:St("recharts-text",k),textAnchor:y,fill:S.includes("url")?Y2:S}),A.map(function(X,Z){var I=X.words.join(R?"":" ");return W.createElement("tspan",{x:U,dy:Z===0?L:c,key:"".concat(I,"-").concat(Z)},I)}))};function ki(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function VZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function yN(e){let t,n,r;e.length!==2?(t=ki,n=(c,d)=>ki(e(c),d),r=(c,d)=>e(c)-d):(t=e===ki||e===VZ?e:HZ,n=e,r=e);function a(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<0?f=p+1:h=p}while(f<h)}return f}function i(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<=0?f=p+1:h=p}while(f<h)}return f}function o(c,d,f=0,h=c.length){const p=a(c,d,f,h-1);return p>f&&r(c[p-1],d)>-r(c[p],d)?p-1:p}return{left:a,center:o,right:i}}function HZ(){return 0}function E5(e){return e===null?NaN:+e}function*KZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const GZ=yN(ki),pf=GZ.right;yN(E5).center;class X2 extends Map{constructor(t,n=QZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(Q2(this,t))}has(t){return super.has(Q2(this,t))}set(t,n){return super.set(YZ(this,t),n)}delete(t){return super.delete(XZ(this,t))}}function Q2({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function YZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function XZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function QZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function JZ(e=ki){if(e===ki)return _5;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 _5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const ZZ=Math.sqrt(50),eee=Math.sqrt(10),tee=Math.sqrt(2);function Oh(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=ZZ?10:i>=eee?5:i>=tee?2:1;let c,d,f;return a<0?(f=Math.pow(10,-a)/o,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,a)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Oh(e,t,n*2):[c,d,f]}function rj(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,i,o]=r?Oh(t,e,n):Oh(e,t,n);if(!(i>=a))return[];const c=i-a+1,d=new Array(c);if(r)if(o<0)for(let f=0;f<c;++f)d[f]=(i-f)/-o;else for(let f=0;f<c;++f)d[f]=(i-f)*o;else if(o<0)for(let f=0;f<c;++f)d[f]=(a+f)/-o;else for(let f=0;f<c;++f)d[f]=(a+f)*o;return d}function aj(e,t,n){return t=+t,e=+e,n=+n,Oh(e,t,n)[2]}function sj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?aj(t,e,n):aj(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function J2(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Z2(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function P5(e,t,n=0,r=1/0,a){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(a=a===void 0?_5:JZ(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),y=Math.max(n,Math.floor(t-f*p/d+g)),j=Math.min(r,Math.floor(t+(d-f)*p/d+g));P5(e,t,y,j,a)}const i=e[t];let o=n,c=r;for(Mu(e,n,t),a(e[r],i)>0&&Mu(e,n,r);o<c;){for(Mu(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Mu(e,n,c):(++c,Mu(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Mu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function nee(e,t,n){if(e=Float64Array.from(KZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Z2(e);if(t>=1)return J2(e);var r,a=(r-1)*t,i=Math.floor(a),o=J2(P5(e,i).subarray(0,i+1)),c=Z2(e.subarray(i+1));return o+(c-o)*(a-i)}}function ree(e,t,n=E5){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,a=(r-1)*t,i=Math.floor(a),o=+n(e[i],i,e),c=+n(e[i+1],i+1,e);return o+(c-o)*(a-i)}}function aee(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function xa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Js(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 ij=Symbol("implicit");function xN(){var e=new X2,t=[],n=[],r=ij;function a(i){let o=e.get(i);if(o===void 0){if(r!==ij)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new X2;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return xN(t,n).unknown(r)},xa.apply(a,arguments),a}function jd(){var e=xN().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,o,c=!1,d=0,f=0,h=.5;delete e.unknown;function p(){var g=t().length,y=a<r,j=y?a:r,w=y?r:a;i=(w-j)/Math.max(1,g-d+f*2),c&&(i=Math.floor(i)),j+=(w-j-i*(g-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var x=aee(g).map(function(S){return j+i*S});return n(y?x.reverse():x)}return e.domain=function(g){return arguments.length?(t(g),p()):t()},e.range=function(g){return arguments.length?([r,a]=g,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(g){return[r,a]=g,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(g){return arguments.length?(c=!!g,p()):c},e.padding=function(g){return arguments.length?(d=Math.min(1,f=+g),p()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),p()):d},e.paddingOuter=function(g){return arguments.length?(f=+g,p()):f},e.align=function(g){return arguments.length?(h=Math.max(0,Math.min(1,g)),p()):h},e.copy=function(){return jd(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},xa.apply(p(),arguments)}function O5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return O5(t())},e}function td(){return O5(jd.apply(null,arguments).paddingInner(1))}function bN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function k5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hf(){}var Sd=.7,kh=1/Sd,Wl="\\s*([+-]?\\d+)\\s*",Nd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",us="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",see=/^#([0-9a-f]{3,8})$/,iee=new RegExp(`^rgb\\(${Wl},${Wl},${Wl}\\)$`),oee=new RegExp(`^rgb\\(${us},${us},${us}\\)$`),lee=new RegExp(`^rgba\\(${Wl},${Wl},${Wl},${Nd}\\)$`),cee=new RegExp(`^rgba\\(${us},${us},${us},${Nd}\\)$`),uee=new RegExp(`^hsl\\(${Nd},${us},${us}\\)$`),dee=new RegExp(`^hsla\\(${Nd},${us},${us},${Nd}\\)$`),eR={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};bN(hf,Cd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tR,formatHex:tR,formatHex8:fee,formatHsl:pee,formatRgb:nR,toString:nR});function tR(){return this.rgb().formatHex()}function fee(){return this.rgb().formatHex8()}function pee(){return R5(this).formatHsl()}function nR(){return this.rgb().formatRgb()}function Cd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=see.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?rR(t):n===3?new Er(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qp(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=iee.exec(e))?new Er(t[1],t[2],t[3],1):(t=oee.exec(e))?new Er(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lee.exec(e))?qp(t[1],t[2],t[3],t[4]):(t=cee.exec(e))?qp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uee.exec(e))?iR(t[1],t[2]/100,t[3]/100,1):(t=dee.exec(e))?iR(t[1],t[2]/100,t[3]/100,t[4]):eR.hasOwnProperty(e)?rR(eR[e]):e==="transparent"?new Er(NaN,NaN,NaN,0):null}function rR(e){return new Er(e>>16&255,e>>8&255,e&255,1)}function qp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Er(e,t,n,r)}function hee(e){return e instanceof hf||(e=Cd(e)),e?(e=e.rgb(),new Er(e.r,e.g,e.b,e.opacity)):new Er}function oj(e,t,n,r){return arguments.length===1?hee(e):new Er(e,t,n,r??1)}function Er(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}bN(Er,oj,k5(hf,{brighter(e){return e=e==null?kh:Math.pow(kh,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sd:Math.pow(Sd,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Er(jo(this.r),jo(this.g),jo(this.b),Rh(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:aR,formatHex:aR,formatHex8:mee,formatRgb:sR,toString:sR}));function aR(){return`#${yo(this.r)}${yo(this.g)}${yo(this.b)}`}function mee(){return`#${yo(this.r)}${yo(this.g)}${yo(this.b)}${yo((isNaN(this.opacity)?1:this.opacity)*255)}`}function sR(){const e=Rh(this.opacity);return`${e===1?"rgb(":"rgba("}${jo(this.r)}, ${jo(this.g)}, ${jo(this.b)}${e===1?")":`, ${e})`}`}function Rh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yo(e){return e=jo(e),(e<16?"0":"")+e.toString(16)}function iR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new La(e,t,n,r)}function R5(e){if(e instanceof La)return new La(e.h,e.s,e.l,e.opacity);if(e instanceof hf||(e=Cd(e)),!e)return new La;if(e instanceof La)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,c=i-a,d=(i+a)/2;return c?(t===i?o=(n-r)/c+(n<r)*6:n===i?o=(r-t)/c+2:o=(t-n)/c+4,c/=d<.5?i+a:2-i-a,o*=60):c=d>0&&d<1?0:o,new La(o,c,d,e.opacity)}function vee(e,t,n,r){return arguments.length===1?R5(e):new La(e,t,n,r??1)}function La(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}bN(La,vee,k5(hf,{brighter(e){return e=e==null?kh:Math.pow(kh,e),new La(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sd:Math.pow(Sd,e),new La(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,a=2*n-r;return new Er(dw(e>=240?e-240:e+120,a,r),dw(e,a,r),dw(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new La(oR(this.h),Wp(this.s),Wp(this.l),Rh(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=Rh(this.opacity);return`${e===1?"hsl(":"hsla("}${oR(this.h)}, ${Wp(this.s)*100}%, ${Wp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function oR(e){return e=(e||0)%360,e<0?e+360:e}function Wp(e){return Math.max(0,Math.min(1,e||0))}function dw(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 wN=e=>()=>e;function gee(e,t){return function(n){return e+n*t}}function yee(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 xee(e){return(e=+e)==1?T5:function(t,n){return n-t?yee(t,n,e):wN(isNaN(t)?n:t)}}function T5(e,t){var n=t-e;return n?gee(e,n):wN(isNaN(e)?t:e)}const lR=(function e(t){var n=xee(t);function r(a,i){var o=n((a=oj(a)).r,(i=oj(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=T5(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=c(h),a.b=d(h),a.opacity=f(h),a+""}}return r.gamma=e,r})(1);function bee(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function wee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function jee(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=qc(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(c){for(o=0;o<r;++o)i[o]=a[o](c);return i}}function See(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Th(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Nee(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=qc(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var lj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fw=new RegExp(lj.source,"g");function Cee(e){return function(){return e}}function Aee(e){return function(t){return e(t)+""}}function Eee(e,t){var n=lj.lastIndex=fw.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=lj.exec(e))&&(a=fw.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),c[o]?c[o]+=i:c[++o]=i),(r=r[0])===(a=a[0])?c[o]?c[o]+=a:c[++o]=a:(c[++o]=null,d.push({i:o,x:Th(r,a)})),n=fw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Aee(d[0].x):Cee(t):(t=d.length,function(f){for(var h=0,p;h<t;++h)c[(p=d[h]).i]=p.x(f);return c.join("")})}function qc(e,t){var n=typeof t,r;return t==null||n==="boolean"?wN(t):(n==="number"?Th:n==="string"?(r=Cd(t))?(t=r,lR):Eee:t instanceof Cd?lR:t instanceof Date?See:wee(t)?bee:Array.isArray(t)?jee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Nee:Th)(e,t)}function jN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function _ee(e,t){t===void 0&&(t=e,e=qc);for(var n=0,r=t.length-1,a=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(a,a=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return i[c](o-c)}}function Pee(e){return function(){return e}}function Ih(e){return+e}var cR=[0,1];function mr(e){return e}function cj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Pee(isNaN(t)?NaN:.5)}function Oee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function kee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=cj(a,r),i=n(o,i)):(r=cj(r,a),i=n(i,o)),function(c){return i(r(c))}}function Ree(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=cj(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=pf(e,c,1,r)-1;return i[d](a[d](c))}}function mf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function mv(){var e=cR,t=cR,n=qc,r,a,i,o=mr,c,d,f;function h(){var g=Math.min(e.length,t.length);return o!==mr&&(o=Oee(e[0],e[g-1])),c=g>2?Ree:kee,d=f=null,p}function p(g){return g==null||isNaN(g=+g)?i:(d||(d=c(e.map(r),t,n)))(r(o(g)))}return p.invert=function(g){return o(a((f||(f=c(t,e.map(r),Th)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,Ih),h()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),h()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=jN,h()},p.clamp=function(g){return arguments.length?(o=g?!0:mr,h()):o!==mr},p.interpolate=function(g){return arguments.length?(n=g,h()):n},p.unknown=function(g){return arguments.length?(i=g,p):i},function(g,y){return r=g,a=y,h()}}function SN(){return mv()(mr,mr)}function Tee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Mh(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 ic(e){return e=Mh(Math.abs(e)),e?e[1]:NaN}function Iee(e,t){return function(n,r){for(var a=n.length,i=[],o=0,c=e[0],d=0;a>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),i.push(n.substring(a-=c,a+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function Mee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var $ee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ad(e){if(!(t=$ee.exec(e)))throw new Error("invalid format: "+e);var t;return new NN({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]})}Ad.prototype=NN.prototype;function NN(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+""}NN.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 Dee(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var $h;function Lee(e,t){var n=Mh(e,t);if(!n)return $h=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-($h=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Mh(e,Math.max(0,t+i-1))[0]}function uR(e,t){var n=Mh(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const dR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Tee,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)=>uR(e*100,t),r:uR,s:Lee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function fR(e){return e}var pR=Array.prototype.map,hR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fee(e){var t=e.grouping===void 0||e.thousands===void 0?fR:Iee(pR.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?fR:Mee(pR.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p,g){p=Ad(p);var y=p.fill,j=p.align,w=p.sign,x=p.symbol,S=p.zero,N=p.width,A=p.comma,P=p.precision,E=p.trim,O=p.type;O==="n"?(A=!0,O="g"):dR[O]||(P===void 0&&(P=12),E=!0,O="g"),(S||y==="0"&&j==="=")&&(S=!0,y="0",j="=");var k=(g&&g.prefix!==void 0?g.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),R=(x==="$"?r:/[%p]/.test(O)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),D=dR[O],U=/[defgprs%]/.test(O);P=P===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function z(L){var G=k,q=R,H,X,Z;if(O==="c")q=D(L)+q,L="";else{L=+L;var I=L<0||1/L<0;if(L=isNaN(L)?d:D(Math.abs(L),P),E&&(L=Dee(L)),I&&+L==0&&w!=="+"&&(I=!1),G=(I?w==="("?w:c:w==="-"||w==="("?"":w)+G,q=(O==="s"&&!isNaN(L)&&$h!==void 0?hR[8+$h/3]:"")+q+(I&&w==="("?")":""),U){for(H=-1,X=L.length;++H<X;)if(Z=L.charCodeAt(H),48>Z||Z>57){q=(Z===46?a+L.slice(H+1):L.slice(H))+q,L=L.slice(0,H);break}}}A&&!S&&(L=t(L,1/0));var F=G.length+L.length+q.length,Q=F<N?new Array(N-F+1).join(y):"";switch(A&&S&&(L=t(Q+L,Q.length?N-q.length:1/0),Q=""),j){case"<":L=G+L+q+Q;break;case"=":L=G+Q+L+q;break;case"^":L=Q.slice(0,F=Q.length>>1)+G+L+q+Q.slice(F);break;default:L=Q+G+L+q;break}return i(L)}return z.toString=function(){return p+""},z}function h(p,g){var y=Math.max(-8,Math.min(8,Math.floor(ic(g)/3)))*3,j=Math.pow(10,-y),w=f((p=Ad(p),p.type="f",p),{suffix:hR[8+y/3]});return function(x){return w(j*x)}}return{format:f,formatPrefix:h}}var Vp,CN,I5;Bee({thousands:",",grouping:[3],currency:["$",""]});function Bee(e){return Vp=Fee(e),CN=Vp.format,I5=Vp.formatPrefix,Vp}function zee(e){return Math.max(0,-ic(Math.abs(e)))}function Uee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ic(t)/3)))*3-ic(Math.abs(e)))}function qee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ic(t)-ic(e))+1}function M5(e,t,n,r){var a=sj(e,t,n),i;switch(r=Ad(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=Uee(a,o))&&(r.precision=i),I5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=qee(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=zee(a))&&(r.precision=i-(r.type==="%")*2);break}}return CN(r)}function Ui(e){var t=e.domain;return e.ticks=function(n){var r=t();return rj(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return M5(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,o=r[a],c=r[i],d,f,h=10;for(c<o&&(f=o,o=c,c=f,f=a,a=i,i=f);h-- >0;){if(f=aj(o,c,n),f===d)return r[a]=o,r[i]=c,t(r);if(f>0)o=Math.floor(o/f)*f,c=Math.ceil(c/f)*f;else if(f<0)o=Math.ceil(o*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function Dh(){var e=SN();return e.copy=function(){return mf(e,Dh())},xa.apply(e,arguments),Ui(e)}function $5(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,Ih),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return $5(e).unknown(t)},e=arguments.length?Array.from(e,Ih):[0,1],Ui(n)}function D5(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],o;return i<a&&(o=n,n=r,r=o,o=a,a=i,i=o),e[n]=t.floor(a),e[r]=t.ceil(i),e}function mR(e){return Math.log(e)}function vR(e){return Math.exp(e)}function Wee(e){return-Math.log(-e)}function Vee(e){return-Math.exp(-e)}function Hee(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Kee(e){return e===10?Hee:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Gee(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 gR(e){return(t,n)=>-e(-t,n)}function AN(e){const t=e(mR,vR),n=t.domain;let r=10,a,i;function o(){return a=Gee(r),i=Kee(r),n()[0]<0?(a=gR(a),i=gR(i),e(Wee,Vee)):e(mR,vR),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],h=d[d.length-1];const p=h<f;p&&([f,h]=[h,f]);let g=a(f),y=a(h),j,w;const x=c==null?10:+c;let S=[];if(!(r%1)&&y-g<x){if(g=Math.floor(g),y=Math.ceil(y),f>0){for(;g<=y;++g)for(j=1;j<r;++j)if(w=g<0?j/i(-g):j*i(g),!(w<f)){if(w>h)break;S.push(w)}}else for(;g<=y;++g)for(j=r-1;j>=1;--j)if(w=g>0?j/i(-g):j*i(g),!(w<f)){if(w>h)break;S.push(w)}S.length*2<x&&(S=rj(f,h,x))}else S=rj(g,y,Math.min(y-g,x)).map(i);return p?S.reverse():S},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Ad(d)).precision==null&&(d.trim=!0),d=CN(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return h=>{let p=h/i(Math.round(a(h)));return p*r<r-.5&&(p*=r),p<=f?d(h):""}},t.nice=()=>n(D5(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function L5(){const e=AN(mv()).domain([1,10]);return e.copy=()=>mf(e,L5()).base(e.base()),xa.apply(e,arguments),e}function yR(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function xR(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function EN(e){var t=1,n=e(yR(t),xR(t));return n.constant=function(r){return arguments.length?e(yR(t=+r),xR(t)):t},Ui(n)}function F5(){var e=EN(mv());return e.copy=function(){return mf(e,F5()).constant(e.constant())},xa.apply(e,arguments)}function bR(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Yee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Xee(e){return e<0?-e*e:e*e}function _N(e){var t=e(mr,mr),n=1;function r(){return n===1?e(mr,mr):n===.5?e(Yee,Xee):e(bR(n),bR(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Ui(t)}function PN(){var e=_N(mv());return e.copy=function(){return mf(e,PN()).exponent(e.exponent())},xa.apply(e,arguments),e}function Qee(){return PN.apply(null,arguments).exponent(.5)}function wR(e){return Math.sign(e)*e*e}function Jee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function B5(){var e=SN(),t=[0,1],n=!1,r;function a(i){var o=Jee(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(wR(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,Ih)).map(wR)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return B5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},xa.apply(a,arguments),Ui(a)}function z5(){var e=[],t=[],n=[],r;function a(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=ree(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[pf(n,o)]}return i.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(ki),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return z5().domain(e).range(t).unknown(r)},xa.apply(i,arguments)}function U5(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[pf(r,d,0,n)]:i}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(a=Array.from(d)).length-1,c()):a.slice()},o.invertExtent=function(d){var f=a.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(i=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return U5().domain([e,t]).range(a).unknown(i)},xa.apply(Ui(o),arguments)}function q5(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[pf(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return q5().domain(e).range(t).unknown(n)},xa.apply(a,arguments)}const pw=new Date,hw=new Date;function qn(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),c=a.ceil(i);return i-o<c-i?o:c},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,c)=>{const d=[];if(i=a.ceil(i),c=c==null?1:Math.floor(c),!(i<o)||!(c>0))return d;let f;do d.push(f=new Date(+i)),t(i,c),e(i);while(f<i&&i<o);return d},a.filter=i=>qn(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!i(o););else for(;--c>=0;)for(;t(o,1),!i(o););}),n&&(a.count=(i,o)=>(pw.setTime(+i),hw.setTime(+o),e(pw),e(hw),Math.floor(n(pw,hw))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?o=>r(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const Lh=qn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Lh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Lh);Lh.range;const $s=1e3,pa=$s*60,Ds=pa*60,Vs=Ds*24,ON=Vs*7,jR=Vs*30,mw=Vs*365,xo=qn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*$s)},(e,t)=>(t-e)/$s,e=>e.getUTCSeconds());xo.range;const kN=qn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$s)},(e,t)=>{e.setTime(+e+t*pa)},(e,t)=>(t-e)/pa,e=>e.getMinutes());kN.range;const RN=qn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pa)},(e,t)=>(t-e)/pa,e=>e.getUTCMinutes());RN.range;const TN=qn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$s-e.getMinutes()*pa)},(e,t)=>{e.setTime(+e+t*Ds)},(e,t)=>(t-e)/Ds,e=>e.getHours());TN.range;const IN=qn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ds)},(e,t)=>(t-e)/Ds,e=>e.getUTCHours());IN.range;const vf=qn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pa)/Vs,e=>e.getDate()-1);vf.range;const vv=qn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vs,e=>e.getUTCDate()-1);vv.range;const W5=qn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Vs,e=>Math.floor(e/Vs));W5.range;function Uo(e){return qn(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())*pa)/ON)}const gv=Uo(0),Fh=Uo(1),Zee=Uo(2),ete=Uo(3),oc=Uo(4),tte=Uo(5),nte=Uo(6);gv.range;Fh.range;Zee.range;ete.range;oc.range;tte.range;nte.range;function qo(e){return qn(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)/ON)}const yv=qo(0),Bh=qo(1),rte=qo(2),ate=qo(3),lc=qo(4),ste=qo(5),ite=qo(6);yv.range;Bh.range;rte.range;ate.range;lc.range;ste.range;ite.range;const MN=qn(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());MN.range;const $N=qn(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());$N.range;const Hs=qn(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());Hs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qn(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)});Hs.range;const Ks=qn(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());Ks.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qn(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)});Ks.range;function V5(e,t,n,r,a,i){const o=[[xo,1,$s],[xo,5,5*$s],[xo,15,15*$s],[xo,30,30*$s],[i,1,pa],[i,5,5*pa],[i,15,15*pa],[i,30,30*pa],[a,1,Ds],[a,3,3*Ds],[a,6,6*Ds],[a,12,12*Ds],[r,1,Vs],[r,2,2*Vs],[n,1,ON],[t,1,jR],[t,3,3*jR],[e,1,mw]];function c(f,h,p){const g=h<f;g&&([f,h]=[h,f]);const y=p&&typeof p.range=="function"?p:d(f,h,p),j=y?y.range(f,+h+1):[];return g?j.reverse():j}function d(f,h,p){const g=Math.abs(h-f)/p,y=yN(([,,x])=>x).right(o,g);if(y===o.length)return e.every(sj(f/mw,h/mw,p));if(y===0)return Lh.every(Math.max(sj(f,h,p),1));const[j,w]=o[g/o[y-1][2]<o[y][2]/g?y-1:y];return j.every(w)}return[c,d]}const[ote,lte]=V5(Ks,$N,yv,W5,IN,RN),[cte,ute]=V5(Hs,MN,gv,vf,TN,kN);function vw(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 gw(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 $u(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function dte(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=Du(a),h=Lu(a),p=Du(i),g=Lu(i),y=Du(o),j=Lu(o),w=Du(c),x=Lu(c),S=Du(d),N=Lu(d),A={a:Z,A:I,b:F,B:Q,c:null,d:_R,e:_R,f:Ite,g:Wte,G:Hte,H:kte,I:Rte,j:Tte,L:H5,m:Mte,M:$te,p:B,q:$,Q:kR,s:RR,S:Dte,u:Lte,U:Fte,V:Bte,w:zte,W:Ute,x:null,X:null,y:qte,Y:Vte,Z:Kte,"%":OR},P={a:ee,A:V,b:J,B:ge,c:null,d:PR,e:PR,f:Qte,g:one,G:cne,H:Gte,I:Yte,j:Xte,L:G5,m:Jte,M:Zte,p:ie,q:ce,Q:kR,s:RR,S:ene,u:tne,U:nne,V:rne,w:ane,W:sne,x:null,X:null,y:ine,Y:lne,Z:une,"%":OR},E={a:U,A:z,b:L,B:G,c:q,d:AR,e:AR,f:Ete,g:CR,G:NR,H:ER,I:ER,j:Ste,L:Ate,m:jte,M:Nte,p:D,q:wte,Q:Pte,s:Ote,S:Cte,u:vte,U:gte,V:yte,w:mte,W:xte,x:H,X,y:CR,Y:NR,Z:bte,"%":_te};A.x=O(n,A),A.X=O(r,A),A.c=O(t,A),P.x=O(n,P),P.X=O(r,P),P.c=O(t,P);function O(oe,xe){return function(ke){var pe=[],ve=-1,Ce=0,Le=oe.length,se,de,Ne;for(ke instanceof Date||(ke=new Date(+ke));++ve<Le;)oe.charCodeAt(ve)===37&&(pe.push(oe.slice(Ce,ve)),(de=SR[se=oe.charAt(++ve)])!=null?se=oe.charAt(++ve):de=se==="e"?" ":"0",(Ne=xe[se])&&(se=Ne(ke,de)),pe.push(se),Ce=ve+1);return pe.push(oe.slice(Ce,ve)),pe.join("")}}function k(oe,xe){return function(ke){var pe=$u(1900,void 0,1),ve=R(pe,oe,ke+="",0),Ce,Le;if(ve!=ke.length)return null;if("Q"in pe)return new Date(pe.Q);if("s"in pe)return new Date(pe.s*1e3+("L"in pe?pe.L:0));if(xe&&!("Z"in pe)&&(pe.Z=0),"p"in pe&&(pe.H=pe.H%12+pe.p*12),pe.m===void 0&&(pe.m="q"in pe?pe.q:0),"V"in pe){if(pe.V<1||pe.V>53)return null;"w"in pe||(pe.w=1),"Z"in pe?(Ce=gw($u(pe.y,0,1)),Le=Ce.getUTCDay(),Ce=Le>4||Le===0?Bh.ceil(Ce):Bh(Ce),Ce=vv.offset(Ce,(pe.V-1)*7),pe.y=Ce.getUTCFullYear(),pe.m=Ce.getUTCMonth(),pe.d=Ce.getUTCDate()+(pe.w+6)%7):(Ce=vw($u(pe.y,0,1)),Le=Ce.getDay(),Ce=Le>4||Le===0?Fh.ceil(Ce):Fh(Ce),Ce=vf.offset(Ce,(pe.V-1)*7),pe.y=Ce.getFullYear(),pe.m=Ce.getMonth(),pe.d=Ce.getDate()+(pe.w+6)%7)}else("W"in pe||"U"in pe)&&("w"in pe||(pe.w="u"in pe?pe.u%7:"W"in pe?1:0),Le="Z"in pe?gw($u(pe.y,0,1)).getUTCDay():vw($u(pe.y,0,1)).getDay(),pe.m=0,pe.d="W"in pe?(pe.w+6)%7+pe.W*7-(Le+5)%7:pe.w+pe.U*7-(Le+6)%7);return"Z"in pe?(pe.H+=pe.Z/100|0,pe.M+=pe.Z%100,gw(pe)):vw(pe)}}function R(oe,xe,ke,pe){for(var ve=0,Ce=xe.length,Le=ke.length,se,de;ve<Ce;){if(pe>=Le)return-1;if(se=xe.charCodeAt(ve++),se===37){if(se=xe.charAt(ve++),de=E[se in SR?xe.charAt(ve++):se],!de||(pe=de(oe,ke,pe))<0)return-1}else if(se!=ke.charCodeAt(pe++))return-1}return pe}function D(oe,xe,ke){var pe=f.exec(xe.slice(ke));return pe?(oe.p=h.get(pe[0].toLowerCase()),ke+pe[0].length):-1}function U(oe,xe,ke){var pe=y.exec(xe.slice(ke));return pe?(oe.w=j.get(pe[0].toLowerCase()),ke+pe[0].length):-1}function z(oe,xe,ke){var pe=p.exec(xe.slice(ke));return pe?(oe.w=g.get(pe[0].toLowerCase()),ke+pe[0].length):-1}function L(oe,xe,ke){var pe=S.exec(xe.slice(ke));return pe?(oe.m=N.get(pe[0].toLowerCase()),ke+pe[0].length):-1}function G(oe,xe,ke){var pe=w.exec(xe.slice(ke));return pe?(oe.m=x.get(pe[0].toLowerCase()),ke+pe[0].length):-1}function q(oe,xe,ke){return R(oe,t,xe,ke)}function H(oe,xe,ke){return R(oe,n,xe,ke)}function X(oe,xe,ke){return R(oe,r,xe,ke)}function Z(oe){return o[oe.getDay()]}function I(oe){return i[oe.getDay()]}function F(oe){return d[oe.getMonth()]}function Q(oe){return c[oe.getMonth()]}function B(oe){return a[+(oe.getHours()>=12)]}function $(oe){return 1+~~(oe.getMonth()/3)}function ee(oe){return o[oe.getUTCDay()]}function V(oe){return i[oe.getUTCDay()]}function J(oe){return d[oe.getUTCMonth()]}function ge(oe){return c[oe.getUTCMonth()]}function ie(oe){return a[+(oe.getUTCHours()>=12)]}function ce(oe){return 1+~~(oe.getUTCMonth()/3)}return{format:function(oe){var xe=O(oe+="",A);return xe.toString=function(){return oe},xe},parse:function(oe){var xe=k(oe+="",!1);return xe.toString=function(){return oe},xe},utcFormat:function(oe){var xe=O(oe+="",P);return xe.toString=function(){return oe},xe},utcParse:function(oe){var xe=k(oe+="",!0);return xe.toString=function(){return oe},xe}}}var SR={"-":"",_:" ",0:"0"},Yn=/^\s*\d+/,fte=/^%/,pte=/[\\^$*+?|[\]().{}]/g;function $t(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function hte(e){return e.replace(pte,"\\$&")}function Du(e){return new RegExp("^(?:"+e.map(hte).join("|")+")","i")}function Lu(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function mte(e,t,n){var r=Yn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vte(e,t,n){var r=Yn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function gte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function yte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function NR(e,t,n){var r=Yn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function CR(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bte(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 wte(e,t,n){var r=Yn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function jte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function AR(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ste(e,t,n){var r=Yn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ER(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Nte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Cte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ate(e,t,n){var r=Yn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ete(e,t,n){var r=Yn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function _te(e,t,n){var r=fte.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Pte(e,t,n){var r=Yn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ote(e,t,n){var r=Yn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function _R(e,t){return $t(e.getDate(),t,2)}function kte(e,t){return $t(e.getHours(),t,2)}function Rte(e,t){return $t(e.getHours()%12||12,t,2)}function Tte(e,t){return $t(1+vf.count(Hs(e),e),t,3)}function H5(e,t){return $t(e.getMilliseconds(),t,3)}function Ite(e,t){return H5(e,t)+"000"}function Mte(e,t){return $t(e.getMonth()+1,t,2)}function $te(e,t){return $t(e.getMinutes(),t,2)}function Dte(e,t){return $t(e.getSeconds(),t,2)}function Lte(e){var t=e.getDay();return t===0?7:t}function Fte(e,t){return $t(gv.count(Hs(e)-1,e),t,2)}function K5(e){var t=e.getDay();return t>=4||t===0?oc(e):oc.ceil(e)}function Bte(e,t){return e=K5(e),$t(oc.count(Hs(e),e)+(Hs(e).getDay()===4),t,2)}function zte(e){return e.getDay()}function Ute(e,t){return $t(Fh.count(Hs(e)-1,e),t,2)}function qte(e,t){return $t(e.getFullYear()%100,t,2)}function Wte(e,t){return e=K5(e),$t(e.getFullYear()%100,t,2)}function Vte(e,t){return $t(e.getFullYear()%1e4,t,4)}function Hte(e,t){var n=e.getDay();return e=n>=4||n===0?oc(e):oc.ceil(e),$t(e.getFullYear()%1e4,t,4)}function Kte(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$t(t/60|0,"0",2)+$t(t%60,"0",2)}function PR(e,t){return $t(e.getUTCDate(),t,2)}function Gte(e,t){return $t(e.getUTCHours(),t,2)}function Yte(e,t){return $t(e.getUTCHours()%12||12,t,2)}function Xte(e,t){return $t(1+vv.count(Ks(e),e),t,3)}function G5(e,t){return $t(e.getUTCMilliseconds(),t,3)}function Qte(e,t){return G5(e,t)+"000"}function Jte(e,t){return $t(e.getUTCMonth()+1,t,2)}function Zte(e,t){return $t(e.getUTCMinutes(),t,2)}function ene(e,t){return $t(e.getUTCSeconds(),t,2)}function tne(e){var t=e.getUTCDay();return t===0?7:t}function nne(e,t){return $t(yv.count(Ks(e)-1,e),t,2)}function Y5(e){var t=e.getUTCDay();return t>=4||t===0?lc(e):lc.ceil(e)}function rne(e,t){return e=Y5(e),$t(lc.count(Ks(e),e)+(Ks(e).getUTCDay()===4),t,2)}function ane(e){return e.getUTCDay()}function sne(e,t){return $t(Bh.count(Ks(e)-1,e),t,2)}function ine(e,t){return $t(e.getUTCFullYear()%100,t,2)}function one(e,t){return e=Y5(e),$t(e.getUTCFullYear()%100,t,2)}function lne(e,t){return $t(e.getUTCFullYear()%1e4,t,4)}function cne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?lc(e):lc.ceil(e),$t(e.getUTCFullYear()%1e4,t,4)}function une(){return"+0000"}function OR(){return"%"}function kR(e){return+e}function RR(e){return Math.floor(+e/1e3)}var Nl,X5,Q5;dne({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 dne(e){return Nl=dte(e),X5=Nl.format,Nl.parse,Q5=Nl.utcFormat,Nl.utcParse,Nl}function fne(e){return new Date(e)}function pne(e){return e instanceof Date?+e:+new Date(+e)}function DN(e,t,n,r,a,i,o,c,d,f){var h=SN(),p=h.invert,g=h.domain,y=f(".%L"),j=f(":%S"),w=f("%I:%M"),x=f("%I %p"),S=f("%a %d"),N=f("%b %d"),A=f("%B"),P=f("%Y");function E(O){return(d(O)<O?y:c(O)<O?j:o(O)<O?w:i(O)<O?x:r(O)<O?a(O)<O?S:N:n(O)<O?A:P)(O)}return h.invert=function(O){return new Date(p(O))},h.domain=function(O){return arguments.length?g(Array.from(O,pne)):g().map(fne)},h.ticks=function(O){var k=g();return e(k[0],k[k.length-1],O??10)},h.tickFormat=function(O,k){return k==null?E:f(k)},h.nice=function(O){var k=g();return(!O||typeof O.range!="function")&&(O=t(k[0],k[k.length-1],O??10)),O?g(D5(k,O)):h},h.copy=function(){return mf(h,DN(e,t,n,r,a,i,o,c,d,f))},h}function hne(){return xa.apply(DN(cte,ute,Hs,MN,gv,vf,TN,kN,xo,X5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function mne(){return xa.apply(DN(ote,lte,Ks,$N,yv,vv,IN,RN,xo,Q5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function xv(){var e=0,t=1,n,r,a,i,o=mr,c=!1,d;function f(p){return p==null||isNaN(p=+p)?d:o(a===0?.5:(p=(i(p)-n)*a,c?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,n=i(e=+e),r=i(t=+t),a=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(p){return arguments.length?(c=!!p,f):c},f.interpolator=function(p){return arguments.length?(o=p,f):o};function h(p){return function(g){var y,j;return arguments.length?([y,j]=g,o=p(y,j),f):[o(0),o(1)]}}return f.range=h(qc),f.rangeRound=h(jN),f.unknown=function(p){return arguments.length?(d=p,f):d},function(p){return i=p,n=p(e),r=p(t),a=n===r?0:1/(r-n),f}}function qi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function J5(){var e=Ui(xv()(mr));return e.copy=function(){return qi(e,J5())},Js.apply(e,arguments)}function Z5(){var e=AN(xv()).domain([1,10]);return e.copy=function(){return qi(e,Z5()).base(e.base())},Js.apply(e,arguments)}function eL(){var e=EN(xv());return e.copy=function(){return qi(e,eL()).constant(e.constant())},Js.apply(e,arguments)}function LN(){var e=_N(xv());return e.copy=function(){return qi(e,LN()).exponent(e.exponent())},Js.apply(e,arguments)}function vne(){return LN.apply(null,arguments).exponent(.5)}function tL(){var e=[],t=mr;function n(r){if(r!=null&&!isNaN(r=+r))return t((pf(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(ki),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>nee(e,i/r))},n.copy=function(){return tL(t).domain(e)},Js.apply(n,arguments)}function bv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=mr,h,p=!1,g;function y(w){return isNaN(w=+w)?g:(w=.5+((w=+h(w))-i)*(r*w<r*i?c:d),f(p?Math.max(0,Math.min(1,w)):w))}y.domain=function(w){return arguments.length?([e,t,n]=w,a=h(e=+e),i=h(t=+t),o=h(n=+n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,y):[e,t,n]},y.clamp=function(w){return arguments.length?(p=!!w,y):p},y.interpolator=function(w){return arguments.length?(f=w,y):f};function j(w){return function(x){var S,N,A;return arguments.length?([S,N,A]=x,f=_ee(w,[S,N,A]),y):[f(0),f(.5),f(1)]}}return y.range=j(qc),y.rangeRound=j(jN),y.unknown=function(w){return arguments.length?(g=w,y):g},function(w){return h=w,a=w(e),i=w(t),o=w(n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,y}}function nL(){var e=Ui(bv()(mr));return e.copy=function(){return qi(e,nL())},Js.apply(e,arguments)}function rL(){var e=AN(bv()).domain([.1,1,10]);return e.copy=function(){return qi(e,rL()).base(e.base())},Js.apply(e,arguments)}function aL(){var e=EN(bv());return e.copy=function(){return qi(e,aL()).constant(e.constant())},Js.apply(e,arguments)}function FN(){var e=_N(bv());return e.copy=function(){return qi(e,FN()).exponent(e.exponent())},Js.apply(e,arguments)}function gne(){return FN.apply(null,arguments).exponent(.5)}const TR=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:jd,scaleDiverging:nL,scaleDivergingLog:rL,scaleDivergingPow:FN,scaleDivergingSqrt:gne,scaleDivergingSymlog:aL,scaleIdentity:$5,scaleImplicit:ij,scaleLinear:Dh,scaleLog:L5,scaleOrdinal:xN,scalePoint:td,scalePow:PN,scaleQuantile:z5,scaleQuantize:U5,scaleRadial:B5,scaleSequential:J5,scaleSequentialLog:Z5,scaleSequentialPow:LN,scaleSequentialQuantile:tL,scaleSequentialSqrt:vne,scaleSequentialSymlog:eL,scaleSqrt:Qee,scaleSymlog:F5,scaleThreshold:q5,scaleTime:hne,scaleUtc:mne,tickFormat:M5},Symbol.toStringTag,{value:"Module"}));var yw,IR;function wv(){if(IR)return yw;IR=1;var e=Fc();function t(n,r,a){for(var i=-1,o=n.length;++i<o;){var c=n[i],d=r(c);if(d!=null&&(f===void 0?d===d&&!e(d):a(d,f)))var f=d,h=c}return h}return yw=t,yw}var xw,MR;function sL(){if(MR)return xw;MR=1;function e(t,n){return t>n}return xw=e,xw}var bw,$R;function yne(){if($R)return bw;$R=1;var e=wv(),t=sL(),n=Uc();function r(a){return a&&a.length?e(a,n,t):void 0}return bw=r,bw}var xne=yne();const jv=Yt(xne);var ww,DR;function iL(){if(DR)return ww;DR=1;function e(t,n){return t<n}return ww=e,ww}var jw,LR;function bne(){if(LR)return jw;LR=1;var e=wv(),t=iL(),n=Uc();function r(a){return a&&a.length?e(a,n,t):void 0}return jw=r,jw}var wne=bne();const Sv=Yt(wne);var Sw,FR;function jne(){if(FR)return Sw;FR=1;var e=tN(),t=xs(),n=m5(),r=Pr();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return Sw=a,Sw}var Nw,BR;function Sne(){if(BR)return Nw;BR=1;var e=p5(),t=jne();function n(r,a){return e(t(r,a),1)}return Nw=n,Nw}var Nne=Sne();const Cne=Yt(Nne);var Cw,zR;function Ane(){if(zR)return Cw;zR=1;var e=hN();function t(n,r){return e(n,r)}return Cw=t,Cw}var Ene=Ane();const gf=Yt(Ene);var Wc=1e9,_ne={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},zN,mn=!0,ga="[DecimalError] ",So=ga+"Invalid argument: ",BN=ga+"Exponent out of range: ",Vc=Math.floor,mo=Math.pow,Pne=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Hr,Kn=1e7,pn=7,oL=9007199254740991,zh=Vc(oL/pn),Qe={};Qe.absoluteValue=Qe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Qe.comparedTo=Qe.cmp=function(e){var t,n,r,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};Qe.decimalPlaces=Qe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*pn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Qe.dividedBy=Qe.div=function(e){return zs(this,new this.constructor(e))};Qe.dividedToIntegerBy=Qe.idiv=function(e){var t=this,n=t.constructor;return nn(zs(t,new n(e),0,1),n.precision)};Qe.equals=Qe.eq=function(e){return!this.cmp(e)};Qe.exponent=function(){return kn(this)};Qe.greaterThan=Qe.gt=function(e){return this.cmp(e)>0};Qe.greaterThanOrEqualTo=Qe.gte=function(e){return this.cmp(e)>=0};Qe.isInteger=Qe.isint=function(){return this.e>this.d.length-2};Qe.isNegative=Qe.isneg=function(){return this.s<0};Qe.isPositive=Qe.ispos=function(){return this.s>0};Qe.isZero=function(){return this.s===0};Qe.lessThan=Qe.lt=function(e){return this.cmp(e)<0};Qe.lessThanOrEqualTo=Qe.lte=function(e){return this.cmp(e)<1};Qe.logarithm=Qe.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Hr))throw Error(ga+"NaN");if(n.s<1)throw Error(ga+(n.s?"NaN":"-Infinity"));return n.eq(Hr)?new r(0):(mn=!1,t=zs(Ed(n,i),Ed(e,i),i),mn=!0,nn(t,a))};Qe.minus=Qe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?uL(t,e):lL(t,(e.s=-e.s,e))};Qe.modulo=Qe.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(ga+"NaN");return n.s?(mn=!1,t=zs(n,e,0,1).times(e),mn=!0,n.minus(t)):nn(new r(n),a)};Qe.naturalExponential=Qe.exp=function(){return cL(this)};Qe.naturalLogarithm=Qe.ln=function(){return Ed(this)};Qe.negated=Qe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Qe.plus=Qe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?lL(t,e):uL(t,(e.s=-e.s,e))};Qe.precision=Qe.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(So+e);if(t=kn(a)+1,r=a.d.length-1,n=r*pn+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Qe.squareRoot=Qe.sqrt=function(){var e,t,n,r,a,i,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(ga+"NaN")}for(e=kn(c),mn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ls(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Vc((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(a.toString()),n=d.precision,a=o=n+3;;)if(i=r,r=i.plus(zs(c,i,o+2)).times(.5),ls(i.d).slice(0,o)===(t=ls(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(nn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return mn=!0,nn(r,n)};Qe.times=Qe.mul=function(e){var t,n,r,a,i,o,c,d,f,h=this,p=h.constructor,g=h.d,y=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,d=g.length,f=y.length,d<f&&(i=g,g=y,y=i,o=d,d=f,f=o),i=[],o=d+f,r=o;r--;)i.push(0);for(r=f;--r>=0;){for(t=0,a=d+r;a>r;)c=i[a]+y[r]*g[a-r-1]+t,i[a--]=c%Kn|0,t=c/Kn|0;i[a]=(i[a]+t)%Kn|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,mn?nn(e,p.precision):e};Qe.toDecimalPlaces=Qe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ps(e,0,Wc),t===void 0?t=r.rounding:ps(t,0,8),nn(n,e+kn(n)+1,t))};Qe.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Oo(r,!0):(ps(e,0,Wc),t===void 0?t=a.rounding:ps(t,0,8),r=nn(new a(r),e+1,t),n=Oo(r,!0,e+1)),n};Qe.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Oo(a):(ps(e,0,Wc),t===void 0?t=i.rounding:ps(t,0,8),r=nn(new i(a),e+kn(a)+1,t),n=Oo(r.abs(),!1,e+kn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Qe.toInteger=Qe.toint=function(){var e=this,t=e.constructor;return nn(new t(e),kn(e)+1,t.rounding)};Qe.toNumber=function(){return+this};Qe.toPower=Qe.pow=function(e){var t,n,r,a,i,o,c=this,d=c.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(Hr);if(c=new d(c),!c.s){if(e.s<1)throw Error(ga+"Infinity");return c}if(c.eq(Hr))return c;if(r=d.precision,e.eq(Hr))return nn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=oL){for(a=new d(Hr),t=Math.ceil(r/pn+4),mn=!1;n%2&&(a=a.times(c),qR(a.d,t)),n=Vc(n/2),n!==0;)c=c.times(c),qR(c.d,t);return mn=!0,e.s<0?new d(Hr).div(a):nn(a,r)}}else if(i<0)throw Error(ga+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,mn=!1,a=e.times(Ed(c,r+f)),mn=!0,a=cL(a),a.s=i,a};Qe.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=kn(a),r=Oo(a,n<=i.toExpNeg||n>=i.toExpPos)):(ps(e,1,Wc),t===void 0?t=i.rounding:ps(t,0,8),a=nn(new i(a),e,t),n=kn(a),r=Oo(a,e<=n||n<=i.toExpNeg,e)),r};Qe.toSignificantDigits=Qe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ps(e,1,Wc),t===void 0?t=r.rounding:ps(t,0,8)),nn(new r(n),e,t)};Qe.toString=Qe.valueOf=Qe.val=Qe.toJSON=Qe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=kn(e),n=e.constructor;return Oo(e,t<=n.toExpNeg||t>=n.toExpPos)};function lL(e,t){var n,r,a,i,o,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),mn?nn(t,p):t;if(d=e.d,f=t.d,o=e.e,a=t.e,d=d.slice(),i=o-a,i){for(i<0?(r=d,i=-i,c=f.length):(r=f,a=o,c=d.length),o=Math.ceil(p/pn),c=o>c?o+1:c+1,i>c&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(c=d.length,i=f.length,c-i<0&&(i=c,r=f,f=d,d=r),n=0;i;)n=(d[--i]=d[i]+f[i]+n)/Kn|0,d[i]%=Kn;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,mn?nn(t,p):t}function ps(e,t,n){if(e!==~~e||e<t||e>n)throw Error(So+e)}function ls(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)r=e[t]+"",n=pn-r.length,n&&(i+=Ci(n)),i+=r;o=e[t],r=o+"",n=pn-r.length,n&&(i+=Ci(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var zs=(function(){function e(r,a){var i,o=0,c=r.length;for(r=r.slice();c--;)i=r[c]*a+o,r[c]=i%Kn|0,o=i/Kn|0;return o&&r.unshift(o),r}function t(r,a,i,o){var c,d;if(i!=o)d=i>o?1:-1;else for(c=d=0;c<i;c++)if(r[c]!=a[c]){d=r[c]>a[c]?1:-1;break}return d}function n(r,a,i){for(var o=0;i--;)r[i]-=o,o=r[i]<a[i]?1:0,r[i]=o*Kn+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var c,d,f,h,p,g,y,j,w,x,S,N,A,P,E,O,k,R,D=r.constructor,U=r.s==a.s?1:-1,z=r.d,L=a.d;if(!r.s)return new D(r);if(!a.s)throw Error(ga+"Division by zero");for(d=r.e-a.e,k=L.length,E=z.length,y=new D(U),j=y.d=[],f=0;L[f]==(z[f]||0);)++f;if(L[f]>(z[f]||0)&&--d,i==null?N=i=D.precision:o?N=i+(kn(r)-kn(a))+1:N=i,N<0)return new D(0);if(N=N/pn+2|0,f=0,k==1)for(h=0,L=L[0],N++;(f<E||h)&&N--;f++)A=h*Kn+(z[f]||0),j[f]=A/L|0,h=A%L|0;else{for(h=Kn/(L[0]+1)|0,h>1&&(L=e(L,h),z=e(z,h),k=L.length,E=z.length),P=k,w=z.slice(0,k),x=w.length;x<k;)w[x++]=0;R=L.slice(),R.unshift(0),O=L[0],L[1]>=Kn/2&&++O;do h=0,c=t(L,w,k,x),c<0?(S=w[0],k!=x&&(S=S*Kn+(w[1]||0)),h=S/O|0,h>1?(h>=Kn&&(h=Kn-1),p=e(L,h),g=p.length,x=w.length,c=t(p,w,g,x),c==1&&(h--,n(p,k<g?R:L,g))):(h==0&&(c=h=1),p=L.slice()),g=p.length,g<x&&p.unshift(0),n(w,p,x),c==-1&&(x=w.length,c=t(L,w,k,x),c<1&&(h++,n(w,k<x?R:L,x))),x=w.length):c===0&&(h++,w=[0]),j[f++]=h,c&&w[0]?w[x++]=z[P]||0:(w=[z[P]],x=1);while((P++<E||w[0]!==void 0)&&N--)}return j[0]||j.shift(),y.e=d,nn(y,o?i+kn(y)+1:i)}})();function cL(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(kn(e)>16)throw Error(BN+kn(e));if(!e.s)return new h(Hr);for(mn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(mo(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(Hr),h.precision=c;;){if(a=nn(a.times(e),c),n=n.times(++d),o=i.plus(zs(a,n,c)),ls(o.d).slice(0,c)===ls(i.d).slice(0,c)){for(;f--;)i=nn(i.times(i),c);return h.precision=p,t==null?(mn=!0,nn(i,p)):i}i=o}}function kn(e){for(var t=e.e*pn,n=e.d[0];n>=10;n/=10)t++;return t}function Aw(e,t,n){if(t>e.LN10.sd())throw mn=!0,n&&(e.precision=n),Error(ga+"LN10 precision limit exceeded");return nn(new e(e.LN10),t)}function Ci(e){for(var t="";e--;)t+="0";return t}function Ed(e,t){var n,r,a,i,o,c,d,f,h,p=1,g=10,y=e,j=y.d,w=y.constructor,x=w.precision;if(y.s<1)throw Error(ga+(y.s?"NaN":"-Infinity"));if(y.eq(Hr))return new w(0);if(t==null?(mn=!1,f=x):f=t,y.eq(10))return t==null&&(mn=!0),Aw(w,f);if(f+=g,w.precision=f,n=ls(j),r=n.charAt(0),i=kn(y),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=ls(y.d),r=n.charAt(0),p++;i=kn(y),r>1?(y=new w("0."+n),i++):y=new w(r+"."+n.slice(1))}else return d=Aw(w,f+2,x).times(i+""),y=Ed(new w(r+"."+n.slice(1)),f-g).plus(d),w.precision=x,t==null?(mn=!0,nn(y,x)):y;for(c=o=y=zs(y.minus(Hr),y.plus(Hr),f),h=nn(y.times(y),f),a=3;;){if(o=nn(o.times(h),f),d=c.plus(zs(o,new w(a),f)),ls(d.d).slice(0,f)===ls(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Aw(w,f+2,x).times(i+""))),c=zs(c,new w(p),f),w.precision=x,t==null?(mn=!0,nn(c,x)):c;c=d,a+=2}}function UR(e,t){var n,r,a;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(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=Vc(n/pn),e.d=[],r=(n+1)%pn,n<0&&(r+=pn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=pn;r<a;)e.d.push(+t.slice(r,r+=pn));t=t.slice(r),r=pn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),mn&&(e.e>zh||e.e<-zh))throw Error(BN+n)}else e.s=0,e.e=0,e.d=[0];return e}function nn(e,t,n){var r,a,i,o,c,d,f,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=pn,a=t,f=p[h=0];else{if(h=Math.ceil((r+1)/pn),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=pn,a=r-pn+o}if(n!==void 0&&(i=mo(10,o-a-1),c=f/i%10|0,d=t<0||p[h+1]!==void 0||f%i,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?a>0?f/mo(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=kn(e),p.length=1,t=t-i-1,p[0]=mo(10,(pn-t%pn)%pn),e.e=Vc(-t/pn)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,i=1,h--):(p.length=h+1,i=mo(10,pn-r),p[h]=a>0?(f/mo(10,o-a)%mo(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==Kn&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=Kn)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(mn&&(e.e>zh||e.e<-zh))throw Error(BN+kn(e));return e}function uL(e,t){var n,r,a,i,o,c,d,f,h,p,g=e.constructor,y=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),mn?nn(t,y):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(h=o<0,h?(n=d,o=-o,c=p.length):(n=p,r=f,c=d.length),a=Math.max(Math.ceil(y/pn),c)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=d.length,c=p.length,h=a<c,h&&(c=a),a=0;a<c;a++)if(d[a]!=p[a]){h=d[a]<p[a];break}o=0}for(h&&(n=d,d=p,p=n,t.s=-t.s),c=d.length,a=p.length-c;a>0;--a)d[c++]=0;for(a=p.length;a>o;){if(d[--a]<p[a]){for(i=a;i&&d[--i]===0;)d[i]=Kn-1;--d[i],d[a]+=Kn}d[a]-=p[a]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,mn?nn(t,y):t):new g(0)}function Oo(e,t,n){var r,a=kn(e),i=ls(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ci(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ci(-a-1)+i,n&&(r=n-o)>0&&(i+=Ci(r))):a>=o?(i+=Ci(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+Ci(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=Ci(r))),e.s<0?"-"+i:i}function qR(e,t){if(e.length>t)return e.length=t,!0}function dL(e){var t,n,r;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(So+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return UR(o,i.toString())}else if(typeof i!="string")throw Error(So+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Pne.test(i))UR(o,i);else throw Error(So+i)}if(a.prototype=Qe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=dL,a.config=a.set=One,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 a.config(e),a}function One(e){if(!e||typeof e!="object")throw Error(ga+"Object expected");var t,n,r,a=["precision",1,Wc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(Vc(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(So+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(So+n+": "+r);return this}var zN=dL(_ne);Hr=new zN(1);const Qt=zN;function kne(e){return Mne(e)||Ine(e)||Tne(e)||Rne()}function Rne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tne(e,t){if(e){if(typeof e=="string")return uj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uj(e,t)}}function Ine(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Mne(e){if(Array.isArray(e))return uj(e)}function uj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $ne=function(t){return t},fL={},pL=function(t){return t===fL},WR=function(t){return function n(){return arguments.length===0||arguments.length===1&&pL(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Dne=function e(t,n){return t===1?n:WR(function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var o=a.filter(function(c){return c!==fL}).length;return o>=t?n.apply(void 0,a):e(t-o,WR(function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var h=a.map(function(p){return pL(p)?d.shift():p});return n.apply(void 0,kne(h).concat(d))}))})},Nv=function(t){return Dne(t.length,t)},dj=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Lne=Nv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Fne=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return $ne;var a=n.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(c,d){return d(c)},i.apply(void 0,arguments))}},fj=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},hL=function(t){var n=null,r=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n&&i.every(function(c,d){return c===n[d]})||(n=i,r=t.apply(void 0,i)),r}};function Bne(e){var t;return e===0?t=1:t=Math.floor(new Qt(e).abs().log(10).toNumber())+1,t}function zne(e,t,n){for(var r=new Qt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var Une=Nv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),qne=Nv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Wne=Nv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Cv={rangeStep:zne,getDigitCount:Bne,interpolateNumber:Une,uninterpolateNumber:qne,uninterpolateTruncation:Wne};function pj(e){return Kne(e)||Hne(e)||mL(e)||Vne()}function Vne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
69
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Kne(e){if(Array.isArray(e))return hj(e)}function _d(e,t){return Xne(e)||Yne(e,t)||mL(e,t)||Gne()}function Gne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mL(e,t){if(e){if(typeof e=="string")return hj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hj(e,t)}}function hj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yne(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),c;!(r=(c=o.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,i=d}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw i}}return n}}function Xne(e){if(Array.isArray(e))return e}function vL(e){var t=_d(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function gL(e,t,n){if(e.lte(0))return new Qt(0);var r=Cv.getDigitCount(e.toNumber()),a=new Qt(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new Qt(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new Qt(Math.ceil(d))}function Qne(e,t,n){var r=1,a=new Qt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Qt(10).pow(Cv.getDigitCount(e)-1),a=new Qt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Qt(Math.floor(e)))}else e===0?a=new Qt(Math.floor((t-1)/2)):n||(a=new Qt(Math.floor(e)));var o=Math.floor((t-1)/2),c=Fne(Lne(function(d){return a.add(new Qt(d-o).mul(r)).toNumber()}),dj);return c(0,t)}function yL(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Qt(0),tickMin:new Qt(0),tickMax:new Qt(0)};var i=gL(new Qt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Qt(0):(o=new Qt(e).add(t).div(2),o=o.sub(new Qt(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new Qt(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?yL(e,t,n,r,a+1):(f<n&&(d=t>0?d+(n-f):d,c=t>0?c:c+(n-f)),{step:i,tickMin:o.sub(new Qt(c).mul(i)),tickMax:o.add(new Qt(d).mul(i))})}function Jne(e){var t=_d(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),c=vL([n,r]),d=_d(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(pj(dj(0,a-1).map(function(){return 1/0}))):[].concat(pj(dj(0,a-1).map(function(){return-1/0})),[h]);return n>r?fj(p):p}if(f===h)return Qne(f,a,i);var g=yL(f,h,o,i),y=g.step,j=g.tickMin,w=g.tickMax,x=Cv.rangeStep(j,w.add(new Qt(.1).mul(y)),y);return n>r?fj(x):x}function Zne(e,t){var n=_d(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=vL([r,a]),c=_d(o,2),d=c[0],f=c[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var h=Math.max(t,2),p=gL(new Qt(f).sub(d).div(h-1),i,0),g=[].concat(pj(Cv.rangeStep(new Qt(d),new Qt(f).sub(new Qt(.99).mul(p)),p)),[f]);return r>a?fj(g):g}var ere=hL(Jne),tre=hL(Zne),nre="Invariant failed";function ko(e,t){throw new Error(nre)}var rre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function cc(e){"@babel/helpers - typeof";return cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cc(e)}function Uh(){return Uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uh.apply(this,arguments)}function are(e,t){return lre(e)||ore(e,t)||ire(e,t)||sre()}function sre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
71
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ire(e,t){if(e){if(typeof e=="string")return VR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VR(e,t)}}function VR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ore(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function lre(e){if(Array.isArray(e))return e}function cre(e,t){if(e==null)return{};var n=ure(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ure(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function dre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wL(r.key),r)}}function pre(e,t,n){return t&&fre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hre(e,t,n){return t=qh(t),mre(e,xL()?Reflect.construct(t,n||[],qh(e).constructor):t.apply(e,n))}function mre(e,t){if(t&&(cc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vre(e)}function vre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xL=function(){return!!e})()}function qh(e){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qh(e)}function gre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mj(e,t)}function mj(e,t){return mj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},mj(e,t)}function bL(e,t,n){return t=wL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wL(e){var t=yre(e,"string");return cc(t)=="symbol"?t:t+""}function yre(e,t){if(cc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yf=(function(e){function t(){return dre(this,t),hre(this,t,arguments)}return gre(t,e),pre(t,[{key:"render",value:function(){var r=this.props,a=r.offset,i=r.layout,o=r.width,c=r.dataKey,d=r.data,f=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,g=cre(r,rre),y=ht(g,!1);this.props.direction==="x"&&h.type!=="number"&&ko();var j=d.map(function(w){var x=f(w,c),S=x.x,N=x.y,A=x.value,P=x.errorVal;if(!P)return null;var E=[],O,k;if(Array.isArray(P)){var R=are(P,2);O=R[0],k=R[1]}else O=k=P;if(i==="vertical"){var D=h.scale,U=N+a,z=U+o,L=U-o,G=D(A-O),q=D(A+k);E.push({x1:q,y1:z,x2:q,y2:L}),E.push({x1:G,y1:U,x2:q,y2:U}),E.push({x1:G,y1:z,x2:G,y2:L})}else if(i==="horizontal"){var H=p.scale,X=S+a,Z=X-o,I=X+o,F=H(A-O),Q=H(A+k);E.push({x1:Z,y1:Q,x2:I,y2:Q}),E.push({x1:X,y1:F,x2:X,y2:Q}),E.push({x1:Z,y1:F,x2:I,y2:F})}return W.createElement(Mt,Uh({className:"recharts-errorBar",key:"bar-".concat(E.map(function(B){return"".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))},y),E.map(function(B){return W.createElement("line",Uh({},B,{key:"line-".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))}))});return W.createElement(Mt,{className:"recharts-errorBars"},j)}}])})(W.Component);bL(yf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});bL(yf,"displayName","ErrorBar");function Pd(e){"@babel/helpers - typeof";return Pd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pd(e)}function HR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function co(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HR(Object(n),!0).forEach(function(r){xre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xre(e,t,n){return t=bre(t),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 Pd(t)=="symbol"?t:t+""}function wre(e,t){if(Pd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Ur(n,ql);if(!o)return null;var c=ql.defaultProps,d=c!==void 0?co(co({},c),o.props):{},f;return o.props&&o.props.payload?f=o.props&&o.props.payload:i==="children"?f=(r||[]).reduce(function(h,p){var g=p.item,y=p.props,j=y.sectors||y.data||[];return h.concat(j.map(function(w){return{type:o.props.iconType||g.props.legendType,value:w.name,color:w.fill,payload:w}}))},[]):f=(r||[]).map(function(h){var p=h.item,g=p.type.defaultProps,y=g!==void 0?co(co({},g),p.props):{},j=y.dataKey,w=y.name,x=y.legendType,S=y.hide;return{inactive:S,dataKey:j,type:d.iconType||x||"square",color:UN(p),value:w||j,payload:y}}),co(co(co({},d),ql.getWithHeight(o,a)),{},{payload:f,item:o})};function Od(e){"@babel/helpers - typeof";return Od=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Od(e)}function KR(e){return Cre(e)||Nre(e)||Sre(e)||jre()}function jre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
72
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sre(e,t){if(e){if(typeof e=="string")return vj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vj(e,t)}}function Nre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cre(e){if(Array.isArray(e))return vj(e)}function vj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function GR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GR(Object(n),!0).forEach(function(r){Vl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vl(e,t,n){return t=Are(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Are(e){var t=Ere(e,"string");return Od(t)=="symbol"?t:t+""}function Ere(e,t){if(Od(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Od(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ln(e,t,n){return jt(e)||jt(t)?n:Fn(t)?Qr(e,t,n):wt(t)?t(e):n}function nd(e,t,n,r){var a=Cne(e,function(c){return Ln(c,t)});if(n==="number"){var i=a.filter(function(c){return De(c)||parseFloat(c)});return i.length?[Sv(i),jv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!jt(c)}):a;return o.map(function(c){return Fn(c)||c instanceof Date?c:""})}var _re=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,c=(n=r?.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,f=0;f<c;f++){var h=f>0?a[f-1].coordinate:a[c-1].coordinate,p=a[f].coordinate,g=f>=c-1?a[0].coordinate:a[f+1].coordinate,y=void 0;if(pr(p-h)!==pr(g-p)){var j=[];if(pr(g-p)===pr(d[1]-d[0])){y=g;var w=p+d[1]-d[0];j[0]=Math.min(w,(w+h)/2),j[1]=Math.max(w,(w+h)/2)}else{y=h;var x=g+d[1]-d[0];j[0]=Math.min(p,(x+p)/2),j[1]=Math.max(p,(x+p)/2)}var S=[Math.min(p,(y+p)/2),Math.max(p,(y+p)/2)];if(t>S[0]&&t<=S[1]||t>=j[0]&&t<=j[1]){o=a[f].index;break}}else{var N=Math.min(h,g),A=Math.max(h,g);if(t>(N+p)/2&&t<=(A+p)/2){o=a[f].index;break}}}else for(var P=0;P<c;P++)if(P===0&&t<=(r[P].coordinate+r[P+1].coordinate)/2||P>0&&P<c-1&&t>(r[P].coordinate+r[P-1].coordinate)/2&&t<=(r[P].coordinate+r[P+1].coordinate)/2||P===c-1&&t>(r[P].coordinate+r[P-1].coordinate)/2){o=r[P].index;break}return o},UN=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?jn(jn({},t.type.defaultProps),t.props):t.props,o=i.stroke,c=i.fill,d;switch(a){case"Line":d=o;break;case"Area":case"Radar":d=o&&o!=="none"?o:c;break;default:d=c;break}return d},Pre=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},c=Object.keys(i),d=0,f=c.length;d<f;d++)for(var h=i[c[d]].stackGroups,p=Object.keys(h),g=0,y=p.length;g<y;g++){var j=h[p[g]],w=j.items,x=j.cateAxisId,S=w.filter(function(k){return Fs(k.type).indexOf("Bar")>=0});if(S&&S.length){var N=S[0].type.defaultProps,A=N!==void 0?jn(jn({},N),S[0].props):S[0].props,P=A.barSize,E=A[x];o[E]||(o[E]=[]);var O=jt(P)?n:P;o[E].push({item:S[0],stackList:S.slice(1),barSize:jt(O)?void 0:hr(O,r,0)})}}return o},Ore=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,c=t.maxBarSize,d=o.length;if(d<1)return null;var f=hr(n,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var g=!1,y=a/d,j=o.reduce(function(P,E){return P+E.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&y>0&&(g=!0,y*=.9,j=d*y);var w=(a-j)/2>>0,x={offset:w-f,size:0};h=o.reduce(function(P,E){var O={item:E.item,position:{offset:x.offset+x.size+f,size:g?y:E.barSize}},k=[].concat(KR(P),[O]);return x=k[k.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){k.push({item:R,position:x})}),k},p)}else{var S=hr(r,a,0,!0);a-2*S-(d-1)*f<=0&&(f=0);var N=(a-2*S-(d-1)*f)/d;N>1&&(N>>=0);var A=c===+c?Math.min(N,c):N;h=o.reduce(function(P,E,O){var k=[].concat(KR(P),[{item:E.item,position:{offset:S+(N+f)*O+(N-A)/2,size:A}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){k.push({item:R,position:k[k.length-1].position})}),k},p)}return h},kre=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=jL({children:i,legendWidth:d});if(f){var h=a||{},p=h.width,g=h.height,y=f.align,j=f.verticalAlign,w=f.layout;if((w==="vertical"||w==="horizontal"&&j==="middle")&&y!=="center"&&De(t[y]))return jn(jn({},t),{},Vl({},y,t[y]+(p||0)));if((w==="horizontal"||w==="vertical"&&y==="center")&&j!=="middle"&&De(t[j]))return jn(jn({},t),{},Vl({},j,t[j]+(g||0)))}return t},Rre=function(t,n,r){return jt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},SL=function(t,n,r,a,i){var o=n.props.children,c=Jr(o,yf).filter(function(f){return Rre(a,i,f.props.direction)});if(c&&c.length){var d=c.map(function(f){return f.props.dataKey});return t.reduce(function(f,h){var p=Ln(h,r);if(jt(p))return f;var g=Array.isArray(p)?[Sv(p),jv(p)]:[p,p],y=d.reduce(function(j,w){var x=Ln(h,w,0),S=g[0]-Math.abs(Array.isArray(x)?x[0]:x),N=g[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(S,j[0]),Math.max(N,j[1])]},[1/0,-1/0]);return[Math.min(y[0],f[0]),Math.max(y[1],f[1])]},[1/0,-1/0])}return null},Tre=function(t,n,r,a,i){var o=n.map(function(c){return SL(t,c,r,i,a)}).filter(function(c){return!jt(c)});return o&&o.length?o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]):null},NL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&SL(t,d,f,a)||nd(t,f,r,i)});if(r==="number")return o.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var c={};return o.reduce(function(d,f){for(var h=0,p=f.length;h<p;h++)c[f[h]]||(c[f[h]]=!0,d.push(f[h]));return d},[])},CL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},bo=function(t,n,r){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,c=t.range,d=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,f=(n||r)&&o==="category"&&a.bandwidth?a.bandwidth()/d:0;if(f=t.axisType==="angleAxis"&&c?.length>=2?pr(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var g=i?i.indexOf(p):p;return{coordinate:a(g)+f,value:p,offset:f}});return h.filter(function(p){return!df(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:a(p)+f,value:p,index:g,offset:f}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+f,value:p,offset:f}}):a.domain().map(function(p,g){return{coordinate:a(p)+f,value:i?i[p]:p,index:g,offset:f}})},Ew=new WeakMap,Hp=function(t,n){if(typeof n!="function")return t;Ew.has(t)||Ew.set(t,new WeakMap);var r=Ew.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},AL=function(t,n,r){var a=t.scale,i=t.type,o=t.layout,c=t.axisType;if(a==="auto")return o==="radial"&&c==="radiusAxis"?{scale:jd(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:Dh(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:td(),realScaleType:"point"}:i==="category"?{scale:jd(),realScaleType:"band"}:{scale:Dh(),realScaleType:"linear"};if(Eo(a)){var d="scale".concat(ov(a));return{scale:(TR[d]||td)(),realScaleType:TR[d]?d:"point"}}return wt(a)?{scale:a}:{scale:td(),realScaleType:"point"}},YR=1e-4,EL=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),i=Math.min(a[0],a[1])-YR,o=Math.max(a[0],a[1])+YR,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},Ire=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},Mre=function(t,n){if(!n||n.length!==2||!De(n[0])||!De(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),i=[t[0],t[1]];return(!De(t[0])||t[0]<r)&&(i[0]=r),(!De(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},$re=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0,c=0;c<n;++c){var d=df(t[c][r][1])?t[c][r][0]:t[c][r][1];d>=0?(t[c][r][0]=i,t[c][r][1]=i+d,i=t[c][r][1]):(t[c][r][0]=o,t[c][r][1]=o+d,o=t[c][r][1])}},Dre=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0;o<n;++o){var c=df(t[o][r][1])?t[o][r][0]:t[o][r][1];c>=0?(t[o][r][0]=i,t[o][r][1]=i+c,i=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},Lre={sign:$re,expand:CX,none:tc,silhouette:AX,wiggle:EX,positive:Dre},Fre=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=Lre[r],o=NX().keys(a).value(function(c,d){return+Ln(c,d,0)}).order(V1).offset(i);return o(t)},Bre=function(t,n,r,a,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,g){var y,j=(y=g.type)!==null&&y!==void 0&&y.defaultProps?jn(jn({},g.type.defaultProps),g.props):g.props,w=j.stackId,x=j.hide;if(x)return p;var S=j[r],N=p[S]||{hasStack:!1,stackGroups:{}};if(Fn(w)){var A=N.stackGroups[w]||{numericAxisId:r,cateAxisId:a,items:[]};A.items.push(g),N.hasStack=!0,N.stackGroups[w]=A}else N.stackGroups[zc("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[g]};return jn(jn({},p),{},Vl({},S,N))},d),h={};return Object.keys(f).reduce(function(p,g){var y=f[g];if(y.hasStack){var j={};y.stackGroups=Object.keys(y.stackGroups).reduce(function(w,x){var S=y.stackGroups[x];return jn(jn({},w),{},Vl({},x,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:Fre(t,S.items,i)}))},j)}return jn(jn({},p),{},Vl({},g,y))},h)},_L=function(t,n){var r=n.realScaleType,a=n.type,i=n.tickCount,o=n.originalDomain,c=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=ere(f,i,c);return t.domain([Sv(h),jv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),g=tre(p,i,c);return{niceTicks:g}}return null};function XR(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!jt(a[t.dataKey])){var c=yh(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=Ln(a,jt(o)?t.dataKey:o);return jt(d)?null:t.scale(d)}var QR=function(t){var n=t.axis,r=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+a:null;var d=Ln(o,n.dataKey,n.domain[c]);return jt(d)?null:n.scale(d)-i/2+a},zre=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return a<=0&&i>=0?0:i<0?i:a}return r[0]},Ure=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?jn(jn({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Fn(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},qre=function(t){return t.reduce(function(n,r){return[Sv(r.concat([n[0]]).filter(De)),jv(r.concat([n[1]]).filter(De))]},[1/0,-1/0])},PL=function(t,n,r){return Object.keys(t).reduce(function(a,i){var o=t[i],c=o.stackedData,d=c.reduce(function(f,h){var p=qre(h.slice(n,r+1));return[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},JR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ZR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gj=function(t,n,r){if(wt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(De(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(JR.test(t[0])){var i=+JR.exec(t[0])[1];a[0]=n[0]-i}else wt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(De(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(ZR.test(t[1])){var o=+ZR.exec(t[1])[1];a[1]=n[1]+o}else wt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Wh=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var i=vN(n,function(p){return p.coordinate}),o=1/0,c=1,d=i.length;c<d;c++){var f=i[c],h=i[c-1];o=Math.min((f.coordinate||0)-(h.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},eT=function(t,n,r){return!t||!t.length||gf(t,Qr(r,"type.defaultProps.domain"))?n:t},OL=function(t,n){var r=t.type.defaultProps?jn(jn({},t.type.defaultProps),t.props):t.props,a=r.dataKey,i=r.name,o=r.unit,c=r.formatter,d=r.tooltipType,f=r.chartType,h=r.hide;return jn(jn({},ht(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:UN(t),value:Ln(n,a),type:d,payload:n,chartType:f,hide:h})};function kd(e){"@babel/helpers - typeof";return kd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kd(e)}function tT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Rs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tT(Object(n),!0).forEach(function(r){kL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kL(e,t,n){return t=Wre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wre(e){var t=Vre(e,"string");return kd(t)=="symbol"?t:t+""}function Vre(e,t){if(kd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hre(e,t){return Xre(e)||Yre(e,t)||Gre(e,t)||Kre()}function Kre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
73
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gre(e,t){if(e){if(typeof e=="string")return nT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nT(e,t)}}function nT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Yre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Xre(e){if(Array.isArray(e))return e}var Vh=Math.PI/180,Qre=function(t){return t*180/Math.PI},on=function(t,n,r,a){return{x:t+Math.cos(-Vh*a)*r,y:n+Math.sin(-Vh*a)*r}},RL=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},Jre=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=hr(t.cx,o,o/2),p=hr(t.cy,c,c/2),g=RL(o,c,r),y=hr(t.innerRadius,g,0),j=hr(t.outerRadius,g,g*.8),w=Object.keys(n);return w.reduce(function(x,S){var N=n[S],A=N.domain,P=N.reversed,E;if(jt(N.range))a==="angleAxis"?E=[d,f]:a==="radiusAxis"&&(E=[y,j]),P&&(E=[E[1],E[0]]);else{E=N.range;var O=E,k=Hre(O,2);d=k[0],f=k[1]}var R=AL(N,i),D=R.realScaleType,U=R.scale;U.domain(A).range(E),EL(U);var z=_L(U,Rs(Rs({},N),{},{realScaleType:D})),L=Rs(Rs(Rs({},N),z),{},{range:E,radius:j,realScaleType:D,scale:U,cx:h,cy:p,innerRadius:y,outerRadius:j,startAngle:d,endAngle:f});return Rs(Rs({},x),{},kL({},S,L))},{})},Zre=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(a-o,2))},eae=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=Zre({x:r,y:a},{x:i,y:o});if(c<=0)return{radius:c};var d=(r-i)/c,f=Math.acos(d);return a>o&&(f=2*Math.PI-f),{radius:c,angle:Qre(f),angleInRadian:f}},tae=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(a,i);return{startAngle:n-o*360,endAngle:r-o*360}},nae=function(t,n){var r=n.startAngle,a=n.endAngle,i=Math.floor(r/360),o=Math.floor(a/360),c=Math.min(i,o);return t+c*360},rT=function(t,n){var r=t.x,a=t.y,i=eae({x:r,y:a},n),o=i.radius,c=i.angle,d=n.innerRadius,f=n.outerRadius;if(o<d||o>f)return!1;if(o===0)return!0;var h=tae(n),p=h.startAngle,g=h.endAngle,y=c,j;if(p<=g){for(;y>g;)y-=360;for(;y<p;)y+=360;j=y>=p&&y<=g}else{for(;y>p;)y-=360;for(;y<g;)y+=360;j=y>=g&&y<=p}return j?Rs(Rs({},n),{},{radius:o,angle:nae(y,n)}):null},TL=function(t){return!v.isValidElement(t)&&!wt(t)&&typeof t!="boolean"?t.className:""};function Rd(e){"@babel/helpers - typeof";return Rd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rd(e)}var rae=["offset"];function aae(e){return lae(e)||oae(e)||iae(e)||sae()}function sae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
74
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iae(e,t){if(e){if(typeof e=="string")return yj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yj(e,t)}}function oae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lae(e){if(Array.isArray(e))return yj(e)}function yj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cae(e,t){if(e==null)return{};var n=uae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function uae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function aT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aT(Object(n),!0).forEach(function(r){dae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dae(e,t,n){return t=fae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fae(e){var t=pae(e,"string");return Rd(t)=="symbol"?t:t+""}function pae(e,t){if(Rd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Td(){return Td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Td.apply(this,arguments)}var hae=function(t){var n=t.value,r=t.formatter,a=jt(t.children)?n:t.children;return wt(r)?r(a):a},mae=function(t,n){var r=pr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},vae=function(t,n,r){var a=t.position,i=t.viewBox,o=t.offset,c=t.className,d=i,f=d.cx,h=d.cy,p=d.innerRadius,g=d.outerRadius,y=d.startAngle,j=d.endAngle,w=d.clockWise,x=(p+g)/2,S=mae(y,j),N=S>=0?1:-1,A,P;a==="insideStart"?(A=y+N*o,P=w):a==="insideEnd"?(A=j-N*o,P=!w):a==="end"&&(A=j+N*o,P=w),P=S<=0?P:!P;var E=on(f,h,x,A),O=on(f,h,x,A+(P?1:-1)*359),k="M".concat(E.x,",").concat(E.y,`
|
|
75
|
-
A`).concat(x,",").concat(x,",0,1,").concat(P?0:1,`,
|
|
76
|
-
`).concat(O.x,",").concat(O.y),R=jt(t.id)?zc("recharts-radial-line-"):t.id;return W.createElement("text",Td({},r,{dominantBaseline:"central",className:St("recharts-radial-bar-label",c)}),W.createElement("defs",null,W.createElement("path",{id:R,d:k})),W.createElement("textPath",{xlinkHref:"#".concat(R)},n))},gae=function(t){var n=t.viewBox,r=t.offset,a=t.position,i=n,o=i.cx,c=i.cy,d=i.innerRadius,f=i.outerRadius,h=i.startAngle,p=i.endAngle,g=(h+p)/2;if(a==="outside"){var y=on(o,c,f+r,g),j=y.x,w=y.y;return{x:j,y:w,textAnchor:j>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var x=(d+f)/2,S=on(o,c,x,g),N=S.x,A=S.y;return{x:N,y:A,textAnchor:"middle",verticalAnchor:"middle"}},yae=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,i=t.position,o=n,c=o.x,d=o.y,f=o.width,h=o.height,p=h>=0?1:-1,g=p*a,y=p>0?"end":"start",j=p>0?"start":"end",w=f>=0?1:-1,x=w*a,S=w>0?"end":"start",N=w>0?"start":"end";if(i==="top"){var A={x:c+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:y};return Dn(Dn({},A),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var P={x:c+f/2,y:d+h+g,textAnchor:"middle",verticalAnchor:j};return Dn(Dn({},P),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var E={x:c-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Dn(Dn({},E),r?{width:Math.max(E.x-r.x,0),height:h}:{})}if(i==="right"){var O={x:c+f+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return Dn(Dn({},O),r?{width:Math.max(r.x+r.width-O.x,0),height:h}:{})}var k=r?{width:f,height:h}:{};return i==="insideLeft"?Dn({x:c+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},k):i==="insideRight"?Dn({x:c+f-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},k):i==="insideTop"?Dn({x:c+f/2,y:d+g,textAnchor:"middle",verticalAnchor:j},k):i==="insideBottom"?Dn({x:c+f/2,y:d+h-g,textAnchor:"middle",verticalAnchor:y},k):i==="insideTopLeft"?Dn({x:c+x,y:d+g,textAnchor:N,verticalAnchor:j},k):i==="insideTopRight"?Dn({x:c+f-x,y:d+g,textAnchor:S,verticalAnchor:j},k):i==="insideBottomLeft"?Dn({x:c+x,y:d+h-g,textAnchor:N,verticalAnchor:y},k):i==="insideBottomRight"?Dn({x:c+f-x,y:d+h-g,textAnchor:S,verticalAnchor:y},k):Bc(i)&&(De(i.x)||go(i.x))&&(De(i.y)||go(i.y))?Dn({x:c+hr(i.x,f),y:d+hr(i.y,h),textAnchor:"end",verticalAnchor:"end"},k):Dn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},k)},xae=function(t){return"cx"in t&&De(t.cx)};function Gn(e){var t=e.offset,n=t===void 0?5:t,r=cae(e,rae),a=Dn({offset:n},r),i=a.viewBox,o=a.position,c=a.value,d=a.children,f=a.content,h=a.className,p=h===void 0?"":h,g=a.textBreakAll;if(!i||jt(c)&&jt(d)&&!v.isValidElement(f)&&!wt(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var y;if(wt(f)){if(y=v.createElement(f,a),v.isValidElement(y))return y}else y=hae(a);var j=xae(i),w=ht(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return vae(a,y,w);var x=j?gae(a):yae(a);return W.createElement(Po,Td({className:St("recharts-label",p)},w,x,{breakAll:g}),y)}Gn.displayName="Label";var IL=function(t){var n=t.cx,r=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,c=t.r,d=t.radius,f=t.innerRadius,h=t.outerRadius,p=t.x,g=t.y,y=t.top,j=t.left,w=t.width,x=t.height,S=t.clockWise,N=t.labelViewBox;if(N)return N;if(De(w)&&De(x)){if(De(p)&&De(g))return{x:p,y:g,width:w,height:x};if(De(y)&&De(j))return{x:y,y:j,width:w,height:x}}return De(p)&&De(g)?{x:p,y:g,width:0,height:0}:De(n)&&De(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:o||a||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:S}:t.viewBox?t.viewBox:{}},bae=function(t,n){return t?t===!0?W.createElement(Gn,{key:"label-implicit",viewBox:n}):Fn(t)?W.createElement(Gn,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===Gn?v.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(Gn,{key:"label-implicit",content:t,viewBox:n}):wt(t)?W.createElement(Gn,{key:"label-implicit",content:t,viewBox:n}):Bc(t)?W.createElement(Gn,Td({viewBox:n},t,{key:"label-implicit"})):null:null},wae=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,i=IL(t),o=Jr(a,Gn).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=bae(t.label,n||i);return[c].concat(aae(o))};Gn.parseViewBox=IL;Gn.renderCallByParent=wae;var _w,sT;function jae(){if(sT)return _w;sT=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return _w=e,_w}var Sae=jae();const Nae=Yt(Sae);function Id(e){"@babel/helpers - typeof";return Id=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Id(e)}var Cae=["valueAccessor"],Aae=["data","dataKey","clockWise","id","textBreakAll"];function Eae(e){return kae(e)||Oae(e)||Pae(e)||_ae()}function _ae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
77
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pae(e,t){if(e){if(typeof e=="string")return xj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xj(e,t)}}function Oae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kae(e){if(Array.isArray(e))return xj(e)}function xj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Hh(){return Hh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hh.apply(this,arguments)}function iT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function oT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iT(Object(n),!0).forEach(function(r){Rae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rae(e,t,n){return t=Tae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tae(e){var t=Iae(e,"string");return Id(t)=="symbol"?t:t+""}function Iae(e,t){if(Id(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lT(e,t){if(e==null)return{};var n=Mae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var $ae=function(t){return Array.isArray(t.value)?Nae(t.value):t.value};function Us(e){var t=e.valueAccessor,n=t===void 0?$ae:t,r=lT(e,Cae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=lT(r,Aae);return!a||!a.length?null:W.createElement(Mt,{className:"recharts-label-list"},a.map(function(h,p){var g=jt(i)?n(h,p):Ln(h&&h.payload,i),y=jt(c)?{}:{id:"".concat(c,"-").concat(p)};return W.createElement(Gn,Hh({},ht(h,!0),f,y,{parentViewBox:h.parentViewBox,value:g,textBreakAll:d,viewBox:Gn.parseViewBox(jt(o)?h:oT(oT({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}Us.displayName="LabelList";function Dae(e,t){return e?e===!0?W.createElement(Us,{key:"labelList-implicit",data:t}):W.isValidElement(e)||wt(e)?W.createElement(Us,{key:"labelList-implicit",data:t,content:e}):Bc(e)?W.createElement(Us,Hh({data:t},e,{key:"labelList-implicit"})):null:null}function Lae(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=Jr(r,Us).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=Dae(e.label,t);return[i].concat(Eae(a))}Us.renderCallByParent=Lae;function Md(e){"@babel/helpers - typeof";return Md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Md(e)}function bj(){return bj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bj.apply(this,arguments)}function cT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function uT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cT(Object(n),!0).forEach(function(r){Fae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fae(e,t,n){return t=Bae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bae(e){var t=zae(e,"string");return Md(t)=="symbol"?t:t+""}function zae(e,t){if(Md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uae=function(t,n){var r=pr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},Kp=function(t){var n=t.cx,r=t.cy,a=t.radius,i=t.angle,o=t.sign,c=t.isExternal,d=t.cornerRadius,f=t.cornerIsExternal,h=d*(c?1:-1)+a,p=Math.asin(d/h)/Vh,g=f?i:i+o*p,y=on(n,r,h,g),j=on(n,r,a,g),w=f?i-o*p:i,x=on(n,r,h*Math.cos(p*Vh),w);return{center:y,circleTangency:j,lineTangency:x,theta:p}},ML=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=Uae(o,c),f=o+d,h=on(n,r,i,o),p=on(n,r,i,f),g="M ".concat(h.x,",").concat(h.y,`
|
|
78
|
-
A `).concat(i,",").concat(i,`,0,
|
|
79
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(o>f),`,
|
|
80
|
-
`).concat(p.x,",").concat(p.y,`
|
|
81
|
-
`);if(a>0){var y=on(n,r,a,o),j=on(n,r,a,f);g+="L ".concat(j.x,",").concat(j.y,`
|
|
82
|
-
A `).concat(a,",").concat(a,`,0,
|
|
83
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(o<=f),`,
|
|
84
|
-
`).concat(y.x,",").concat(y.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},qae=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,p=pr(h-f),g=Kp({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),y=g.circleTangency,j=g.lineTangency,w=g.theta,x=Kp({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),S=x.circleTangency,N=x.lineTangency,A=x.theta,P=d?Math.abs(f-h):Math.abs(f-h)-w-A;if(P<0)return c?"M ".concat(j.x,",").concat(j.y,`
|
|
85
|
-
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
|
|
86
|
-
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
|
|
87
|
-
`):ML({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h});var E="M ".concat(j.x,",").concat(j.y,`
|
|
88
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(y.x,",").concat(y.y,`
|
|
89
|
-
A`).concat(i,",").concat(i,",0,").concat(+(P>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
|
|
90
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(N.x,",").concat(N.y,`
|
|
91
|
-
`);if(a>0){var O=Kp({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),k=O.circleTangency,R=O.lineTangency,D=O.theta,U=Kp({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),z=U.circleTangency,L=U.lineTangency,G=U.theta,q=d?Math.abs(f-h):Math.abs(f-h)-D-G;if(q<0&&o===0)return"".concat(E,"L").concat(n,",").concat(r,"Z");E+="L".concat(L.x,",").concat(L.y,`
|
|
92
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(z.x,",").concat(z.y,`
|
|
93
|
-
A`).concat(a,",").concat(a,",0,").concat(+(q>180),",").concat(+(p>0),",").concat(k.x,",").concat(k.y,`
|
|
94
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else E+="L".concat(n,",").concat(r,"Z");return E},Wae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},$L=function(t){var n=uT(uT({},Wae),t),r=n.cx,a=n.cy,i=n.innerRadius,o=n.outerRadius,c=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,g=n.className;if(o<i||h===p)return null;var y=St("recharts-sector",g),j=o-i,w=hr(c,j,0,!0),x;return w>0&&Math.abs(h-p)<360?x=qae({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(w,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):x=ML({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),W.createElement("path",bj({},ht(n,!0),{className:y,d:x,role:"img"}))};function $d(e){"@babel/helpers - typeof";return $d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$d(e)}function wj(){return wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wj.apply(this,arguments)}function dT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function fT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dT(Object(n),!0).forEach(function(r){Vae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vae(e,t,n){return t=Hae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hae(e){var t=Kae(e,"string");return $d(t)=="symbol"?t:t+""}function Kae(e,t){if($d(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pT={curveBasisClosed:pX,curveBasisOpen:hX,curveBasis:fX,curveBumpX:JY,curveBumpY:ZY,curveLinearClosed:mX,curveLinear:cv,curveMonotoneX:vX,curveMonotoneY:gX,curveNatural:yX,curveStep:xX,curveStepAfter:wX,curveStepBefore:bX},Gp=function(t){return t.x===+t.x&&t.y===+t.y},Fu=function(t){return t.x},Bu=function(t){return t.y},Gae=function(t,n){if(wt(t))return t;var r="curve".concat(ov(t));return(r==="curveMonotone"||r==="curveBump")&&n?pT["".concat(r).concat(n==="vertical"?"Y":"X")]:pT[r]||cv},Yae=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,i=a===void 0?[]:a,o=t.baseLine,c=t.layout,d=t.connectNulls,f=d===void 0?!1:d,h=Gae(r,c),p=f?i.filter(function(w){return Gp(w)}):i,g;if(Array.isArray(o)){var y=f?o.filter(function(w){return Gp(w)}):o,j=p.map(function(w,x){return fT(fT({},w),{},{base:y[x]})});return c==="vertical"?g=Fp().y(Bu).x1(Fu).x0(function(w){return w.base.x}):g=Fp().x(Fu).y1(Bu).y0(function(w){return w.base.y}),g.defined(Gp).curve(h),g(j)}return c==="vertical"&&De(o)?g=Fp().y(Bu).x1(Fu).x0(o):De(o)?g=Fp().x(Fu).y1(Bu).y0(o):g=$3().x(Fu).y(Bu),g.defined(Gp).curve(h),g(p)},Kh=function(t){var n=t.className,r=t.points,a=t.path,i=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?Yae(t):a;return v.createElement("path",wj({},ht(t,!1),xh(t),{className:St("recharts-curve",n),d:o,ref:i}))},Pw={exports:{}},Ow,hT;function Xae(){if(hT)return Ow;hT=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ow=e,Ow}var kw,mT;function Qae(){if(mT)return kw;mT=1;var e=Xae();function t(){}function n(){}return n.resetWarningCache=t,kw=function(){function r(o,c,d,f,h,p){if(p!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},kw}var vT;function Jae(){return vT||(vT=1,Pw.exports=Qae()()),Pw.exports}var Zae=Jae();const Bt=Yt(Zae),{getOwnPropertyNames:ese,getOwnPropertySymbols:tse}=Object,{hasOwnProperty:nse}=Object.prototype;function Rw(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function Yp(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);const{cache:i}=a,o=i.get(n),c=i.get(r);if(o&&c)return o===r&&c===n;i.set(n,r),i.set(r,n);const d=e(n,r,a);return i.delete(n),i.delete(r),d}}function rse(e){return e?.[Symbol.toStringTag]}function gT(e){return ese(e).concat(tse(e))}const ase=Object.hasOwn||((e,t)=>nse.call(e,t));function Wo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const sse="__v",ise="__o",ose="_owner",{getOwnPropertyDescriptor:yT,keys:xT}=Object;function lse(e,t){return e.byteLength===t.byteLength&&Gh(new Uint8Array(e),new Uint8Array(t))}function cse(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function use(e,t){return e.byteLength===t.byteLength&&Gh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function dse(e,t){return Wo(e.getTime(),t.getTime())}function fse(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function pse(e,t){return e===t}function bT(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),i=e.entries();let o,c,d=0;for(;(o=i.next())&&!o.done;){const f=t.entries();let h=!1,p=0;for(;(c=f.next())&&!c.done;){if(a[p]){p++;continue}const g=o.value,y=c.value;if(n.equals(g[0],y[0],d,p,e,t,n)&&n.equals(g[1],y[1],g[0],y[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const hse=Wo;function mse(e,t,n){const r=xT(e);let a=r.length;if(xT(t).length!==a)return!1;for(;a-- >0;)if(!DL(e,t,n,r[a]))return!1;return!0}function zu(e,t,n){const r=gT(e);let a=r.length;if(gT(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!DL(e,t,n,i)||(o=yT(e,i),c=yT(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function vse(e,t){return Wo(e.valueOf(),t.valueOf())}function gse(e,t){return e.source===t.source&&e.flags===t.flags}function wT(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),i=e.values();let o,c;for(;(o=i.next())&&!o.done;){const d=t.values();let f=!1,h=0;for(;(c=d.next())&&!c.done;){if(!a[h]&&n.equals(o.value,c.value,o.value,c.value,e,t,n)){f=a[h]=!0;break}h++}if(!f)return!1}return!0}function Gh(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function yse(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function DL(e,t,n,r){return(r===ose||r===ise||r===sse)&&(e.$$typeof||t.$$typeof)?!0:ase(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const xse="[object ArrayBuffer]",bse="[object Arguments]",wse="[object Boolean]",jse="[object DataView]",Sse="[object Date]",Nse="[object Error]",Cse="[object Map]",Ase="[object Number]",Ese="[object Object]",_se="[object RegExp]",Pse="[object Set]",Ose="[object String]",kse={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Rse="[object URL]",Tse=Object.prototype.toString;function Ise({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:g,areUrlsEqual:y,unknownTagComparators:j}){return function(x,S,N){if(x===S)return!0;if(x==null||S==null)return!1;const A=typeof x;if(A!==typeof S)return!1;if(A!=="object")return A==="number"?c(x,S,N):A==="function"?i(x,S,N):!1;const P=x.constructor;if(P!==S.constructor)return!1;if(P===Object)return d(x,S,N);if(Array.isArray(x))return t(x,S,N);if(P===Date)return r(x,S,N);if(P===RegExp)return h(x,S,N);if(P===Map)return o(x,S,N);if(P===Set)return p(x,S,N);const E=Tse.call(x);if(E===Sse)return r(x,S,N);if(E===_se)return h(x,S,N);if(E===Cse)return o(x,S,N);if(E===Pse)return p(x,S,N);if(E===Ese)return typeof x.then!="function"&&typeof S.then!="function"&&d(x,S,N);if(E===Rse)return y(x,S,N);if(E===Nse)return a(x,S,N);if(E===bse)return d(x,S,N);if(kse[E])return g(x,S,N);if(E===xse)return e(x,S,N);if(E===jse)return n(x,S,N);if(E===wse||E===Ase||E===Ose)return f(x,S,N);if(j){let O=j[E];if(!O){const k=rse(x);k&&(O=j[k])}if(O)return O(x,S,N)}return!1}}function Mse({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:lse,areArraysEqual:n?zu:cse,areDataViewsEqual:use,areDatesEqual:dse,areErrorsEqual:fse,areFunctionsEqual:pse,areMapsEqual:n?Rw(bT,zu):bT,areNumbersEqual:hse,areObjectsEqual:n?zu:mse,arePrimitiveWrappersEqual:vse,areRegExpsEqual:gse,areSetsEqual:n?Rw(wT,zu):wT,areTypedArraysEqual:n?Rw(Gh,zu):Gh,areUrlsEqual:yse,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=Yp(r.areArraysEqual),i=Yp(r.areMapsEqual),o=Yp(r.areObjectsEqual),c=Yp(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function $se(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function Dse({circular:e,comparator:t,createState:n,equals:r,strict:a}){if(n)return function(c,d){const{cache:f=e?new WeakMap:void 0,meta:h}=n();return t(c,d,{cache:f,equals:r,meta:h,strict:a})};if(e)return function(c,d){return t(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:a})};const i={cache:void 0,equals:r,meta:void 0,strict:a};return function(c,d){return t(c,d,i)}}const Lse=Wi();Wi({strict:!0});Wi({circular:!0});Wi({circular:!0,strict:!0});Wi({createInternalComparator:()=>Wo});Wi({strict:!0,createInternalComparator:()=>Wo});Wi({circular:!0,createInternalComparator:()=>Wo});Wi({circular:!0,createInternalComparator:()=>Wo,strict:!0});function Wi(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=Mse(e),o=Ise(i),c=n?n(o):$se(o);return Dse({circular:t,comparator:o,createState:r,equals:c,strict:a})}function Fse(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function jT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):Fse(a)};requestAnimationFrame(r)}function jj(e){"@babel/helpers - typeof";return jj=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jj(e)}function Bse(e){return Wse(e)||qse(e)||Use(e)||zse()}function zse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
95
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Use(e,t){if(e){if(typeof e=="string")return ST(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ST(e,t)}}function ST(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wse(e){if(Array.isArray(e))return e}function Vse(){var e={},t=function(){return null},n=!1,r=function a(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,c=Bse(o),d=c[0],f=c.slice(1);if(typeof d=="number"){jT(a.bind(null,f),d);return}a(d),jT(a.bind(null,f));return}jj(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){n=!0},start:function(i){n=!1,r(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function Dd(e){"@babel/helpers - typeof";return Dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dd(e)}function NT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function CT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NT(Object(n),!0).forEach(function(r){LL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LL(e,t,n){return t=Hse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hse(e){var t=Kse(e,"string");return Dd(t)==="symbol"?t:String(t)}function Kse(e,t){if(Dd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gse=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},Yse=function(t){return t},Xse=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},rd=function(t,n){return Object.keys(n).reduce(function(r,a){return CT(CT({},r),{},LL({},a,t(a,n[a])))},{})},AT=function(t,n,r){return t.map(function(a){return"".concat(Xse(a)," ").concat(n,"ms ").concat(r)}).join(",")};function Qse(e,t){return eie(e)||Zse(e,t)||FL(e,t)||Jse()}function Jse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
96
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zse(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function eie(e){if(Array.isArray(e))return e}function tie(e){return aie(e)||rie(e)||FL(e)||nie()}function nie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
97
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FL(e,t){if(e){if(typeof e=="string")return Sj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sj(e,t)}}function rie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aie(e){if(Array.isArray(e))return Sj(e)}function Sj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yh=1e-4,BL=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},zL=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},ET=function(t,n){return function(r){var a=BL(t,n);return zL(a,r)}},sie=function(t,n){return function(r){var a=BL(t,n),i=[].concat(tie(a.map(function(o,c){return o*c}).slice(1)),[0]);return zL(i,r)}},_T=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],i=n[1],o=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,c=1;break;case"ease":a=.25,i=.1,o=.25,c=1;break;case"ease-in":a=.42,i=0,o=1,c=1;break;case"ease-out":a=.42,i=0,o=.58,c=1;break;case"ease-in-out":a=0,i=0,o=.58,c=1;break;default:{var d=n[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var f=d[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),h=Qse(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=ET(a,o),g=ET(i,c),y=sie(a,o),j=function(S){return S>1?1:S<0?0:S},w=function(S){for(var N=S>1?1:S,A=N,P=0;P<8;++P){var E=p(A)-N,O=y(A);if(Math.abs(E-N)<Yh||O<Yh)return g(A);A=j(A-E/O)}return g(A)};return w.isStepper=!1,w},iie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,o=t.dt,c=o===void 0?17:o,d=function(h,p,g){var y=-(h-p)*r,j=g*i,w=g+(y-j)*c/1e3,x=g*c/1e3+h;return Math.abs(x-p)<Yh&&Math.abs(w)<Yh?[p,0]:[x,w]};return d.isStepper=!0,d.dt=c,d},oie=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return _T(a);case"spring":return iie();default:if(a.split("(")[0]==="cubic-bezier")return _T(a)}return typeof a=="function"?a:null};function Ld(e){"@babel/helpers - typeof";return Ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ld(e)}function PT(e){return uie(e)||cie(e)||UL(e)||lie()}function lie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
98
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uie(e){if(Array.isArray(e))return Cj(e)}function OT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OT(Object(n),!0).forEach(function(r){Nj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nj(e,t,n){return t=die(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function die(e){var t=fie(e,"string");return Ld(t)==="symbol"?t:String(t)}function fie(e,t){if(Ld(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ld(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pie(e,t){return vie(e)||mie(e,t)||UL(e,t)||hie()}function hie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
99
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UL(e,t){if(e){if(typeof e=="string")return Cj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cj(e,t)}}function Cj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function vie(e){if(Array.isArray(e))return e}var Xh=function(t,n,r){return t+(n-t)*r},Aj=function(t){var n=t.from,r=t.to;return n!==r},gie=function e(t,n,r){var a=rd(function(i,o){if(Aj(o)){var c=t(o.from,o.to,o.velocity),d=pie(c,2),f=d[0],h=d[1];return Jn(Jn({},o),{},{from:f,velocity:h})}return o},n);return r<1?rd(function(i,o){return Aj(o)?Jn(Jn({},o),{},{velocity:Xh(o.velocity,a[i].velocity,r),from:Xh(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const yie=(function(e,t,n,r,a){var i=Gse(e,t),o=i.reduce(function(x,S){return Jn(Jn({},x),{},Nj({},S,[e[S],t[S]]))},{}),c=i.reduce(function(x,S){return Jn(Jn({},x),{},Nj({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},g=function(){return rd(function(S,N){return N.from},c)},y=function(){return!Object.values(c).filter(Aj).length},j=function(S){f||(f=S);var N=S-f,A=N/n.dt;c=gie(n,c,A),a(Jn(Jn(Jn({},e),t),g())),f=S,y()||(d=requestAnimationFrame(p))},w=function(S){h||(h=S);var N=(S-h)/r,A=rd(function(E,O){return Xh.apply(void 0,PT(O).concat([n(N)]))},o);if(a(Jn(Jn(Jn({},e),t),A)),N<1)d=requestAnimationFrame(p);else{var P=rd(function(E,O){return Xh.apply(void 0,PT(O).concat([n(1)]))},o);a(Jn(Jn(Jn({},e),t),P))}};return p=n.isStepper?j:w,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function uc(e){"@babel/helpers - typeof";return uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(e)}var xie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function bie(e,t){if(e==null)return{};var n=wie(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wie(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Tw(e){return Cie(e)||Nie(e)||Sie(e)||jie()}function jie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
100
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sie(e,t){if(e){if(typeof e=="string")return Ej(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ej(e,t)}}function Nie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cie(e){if(Array.isArray(e))return Ej(e)}function Ej(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function kT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kT(Object(n),!0).forEach(function(r){Yu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yu(e,t,n){return t=qL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Aie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qL(r.key),r)}}function _ie(e,t,n){return t&&Eie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qL(e){var t=Pie(e,"string");return uc(t)==="symbol"?t:String(t)}function Pie(e,t){if(uc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Oie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_j(e,t)}function _j(e,t){return _j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_j(e,t)}function kie(e){var t=Rie();return function(){var r=Qh(e),a;if(t){var i=Qh(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Pj(this,a)}}function Pj(e,t){if(t&&(uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oj(e)}function Oj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qh(e){return Qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qh(e)}var hs=(function(e){Oie(n,e);var t=kie(n);function n(r,a){var i;Aie(this,n),i=t.call(this,r,a);var o=i.props,c=o.isActive,d=o.attributeName,f=o.from,h=o.to,p=o.steps,g=o.children,y=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Oj(i)),i.changeStyle=i.changeStyle.bind(Oj(i)),!c||y<=0)return i.state={style:{}},typeof g=="function"&&(i.state={style:h}),Pj(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof g=="function")return i.state={style:f},Pj(i);i.state={style:d?Yu({},d,f):f}}else i.state={style:{}};return i}return _ie(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,c=i.canBegin,d=i.attributeName,f=i.shouldReAnimate,h=i.to,p=i.from,g=this.state.style;if(c){if(!o){var y={style:d?Yu({},d,h):h};this.state&&g&&(d&&g[d]!==h||!d&&g!==h)&&this.setState(y);return}if(!(Lse(a.to,h)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=j||f?p:a.to;if(this.state&&g){var x={style:d?Yu({},d,w):w};(d&&g[d]!==w||!d&&g!==w)&&this.setState(x)}this.runAnimation(Ta(Ta({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,c=a.to,d=a.duration,f=a.easing,h=a.begin,p=a.onAnimationEnd,g=a.onAnimationStart,y=yie(o,c,oie(f),d,this.changeStyle),j=function(){i.stopJSAnimation=y()};this.manager.start([g,h,j,d,p])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,c=a.begin,d=a.onAnimationStart,f=o[0],h=f.style,p=f.duration,g=p===void 0?0:p,y=function(w,x,S){if(S===0)return w;var N=x.duration,A=x.easing,P=A===void 0?"ease":A,E=x.style,O=x.properties,k=x.onAnimationEnd,R=S>0?o[S-1]:x,D=O||Object.keys(E);if(typeof P=="function"||P==="spring")return[].concat(Tw(w),[i.runJSAnimation.bind(i,{from:R.style,to:E,duration:N,easing:P}),N]);var U=AT(D,N,P),z=Ta(Ta(Ta({},R.style),E),{},{transition:U});return[].concat(Tw(w),[z,N,k]).filter(Yse)};return this.manager.start([d].concat(Tw(o.reduce(y,[h,Math.max(g,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Vse());var i=a.begin,o=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,g=a.steps,y=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof y=="function"||f==="spring"){this.runJSAnimation(a);return}if(g.length>1){this.runStepAnimation(a);return}var w=c?Yu({},c,d):d,x=AT(Object.keys(w),o,f);j.start([h,i,Ta(Ta({},w),{},{transition:x}),o,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var c=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=bie(a,xie),f=v.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!c||f===0||o<=0)return i;var p=function(y){var j=y.props,w=j.style,x=w===void 0?{}:w,S=j.className,N=v.cloneElement(y,Ta(Ta({},d),{},{style:Ta(Ta({},x),h),className:S}));return N};return f===1?p(v.Children.only(i)):W.createElement("div",null,v.Children.map(i,function(g){return p(g)}))}}]),n})(v.PureComponent);hs.displayName="Animate";hs.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};hs.propTypes={from:Bt.oneOfType([Bt.object,Bt.string]),to:Bt.oneOfType([Bt.object,Bt.string]),attributeName:Bt.string,duration:Bt.number,begin:Bt.number,easing:Bt.oneOfType([Bt.string,Bt.func]),steps:Bt.arrayOf(Bt.shape({duration:Bt.number.isRequired,style:Bt.object.isRequired,easing:Bt.oneOfType([Bt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Bt.func]),properties:Bt.arrayOf("string"),onAnimationEnd:Bt.func})),children:Bt.oneOfType([Bt.node,Bt.func]),isActive:Bt.bool,canBegin:Bt.bool,onAnimationEnd:Bt.func,shouldReAnimate:Bt.bool,onAnimationStart:Bt.func,onAnimationReStart:Bt.func};function Fd(e){"@babel/helpers - typeof";return Fd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fd(e)}function Jh(){return Jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jh.apply(this,arguments)}function Tie(e,t){return Die(e)||$ie(e,t)||Mie(e,t)||Iie()}function Iie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
101
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mie(e,t){if(e){if(typeof e=="string")return RT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return RT(e,t)}}function RT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $ie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Die(e){if(Array.isArray(e))return e}function TT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function IT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TT(Object(n),!0).forEach(function(r){Lie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lie(e,t,n){return t=Fie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fie(e){var t=Bie(e,"string");return Fd(t)=="symbol"?t:t+""}function Bie(e,t){if(Fd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MT=function(t,n,r,a,i){var o=Math.min(Math.abs(r)/2,Math.abs(a)/2),c=a>=0?1:-1,d=r>=0?1:-1,f=a>=0&&r>=0||a<0&&r<0?1:0,h;if(o>0&&i instanceof Array){for(var p=[0,0,0,0],g=0,y=4;g<y;g++)p[g]=i[g]>o?o:i[g];h="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),h+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`,
|
|
102
|
-
`).concat(t+r,",").concat(n+c*p[1])),h+="L ".concat(t+r,",").concat(n+a-c*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`,
|
|
103
|
-
`).concat(t+r-d*p[2],",").concat(n+a)),h+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`,
|
|
104
|
-
`).concat(t,",").concat(n+a-c*p[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var j=Math.min(o,i);h="M ".concat(t,",").concat(n+c*j,`
|
|
105
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,`
|
|
106
|
-
L `).concat(t+r-d*j,",").concat(n,`
|
|
107
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+c*j,`
|
|
108
|
-
L `).concat(t+r,",").concat(n+a-c*j,`
|
|
109
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,`
|
|
110
|
-
L `).concat(t+d*j,",").concat(n+a,`
|
|
111
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-c*j," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return h},zie=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,o=n.y,c=n.width,d=n.height;if(Math.abs(c)>0&&Math.abs(d)>0){var f=Math.min(i,i+c),h=Math.max(i,i+c),p=Math.min(o,o+d),g=Math.max(o,o+d);return r>=f&&r<=h&&a>=p&&a<=g}return!1},Uie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qN=function(t){var n=IT(IT({},Uie),t),r=v.useRef(),a=v.useState(-1),i=Tie(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var P=r.current.getTotalLength();P&&c(P)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,g=n.radius,y=n.className,j=n.animationEasing,w=n.animationDuration,x=n.animationBegin,S=n.isAnimationActive,N=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var A=St("recharts-rectangle",y);return N?W.createElement(hs,{canBegin:o>0,from:{width:h,height:p,x:d,y:f},to:{width:h,height:p,x:d,y:f},duration:w,animationEasing:j,isActive:N},function(P){var E=P.width,O=P.height,k=P.x,R=P.y;return W.createElement(hs,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:w,isActive:S,easing:j},W.createElement("path",Jh({},ht(n,!0),{className:A,d:MT(k,R,E,O,g),ref:r})))}):W.createElement("path",Jh({},ht(n,!0),{className:A,d:MT(d,f,h,p,g)}))},qie=["points","className","baseLinePoints","connectNulls"];function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rl.apply(this,arguments)}function Wie(e,t){if(e==null)return{};var n=Vie(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Vie(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $T(e){return Yie(e)||Gie(e)||Kie(e)||Hie()}function Hie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
112
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kie(e,t){if(e){if(typeof e=="string")return kj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kj(e,t)}}function Gie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Yie(e){if(Array.isArray(e))return kj(e)}function kj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var DT=function(t){return t&&t.x===+t.x&&t.y===+t.y},Xie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){DT(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),DT(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},ad=function(t,n){var r=Xie(t);n&&(r=[r.reduce(function(i,o){return[].concat($T(i),$T(o))},[])]);var a=r.map(function(i){return i.reduce(function(o,c,d){return"".concat(o).concat(d===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},Qie=function(t,n,r){var a=ad(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(ad(n.reverse(),r).slice(1))},Jie=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=Wie(t,qie);if(!n||!n.length)return null;var c=St("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=Qie(n,a,i);return W.createElement("g",{className:c},W.createElement("path",Rl({},ht(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?W.createElement("path",Rl({},ht(o,!0),{fill:"none",d:ad(n,i)})):null,d?W.createElement("path",Rl({},ht(o,!0),{fill:"none",d:ad(a,i)})):null)}var h=ad(n,i);return W.createElement("path",Rl({},ht(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function Rj(){return Rj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rj.apply(this,arguments)}var Av=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=St("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",Rj({},ht(t,!1),xh(t),{className:o,cx:n,cy:r,r:a})):null};function Bd(e){"@babel/helpers - typeof";return Bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bd(e)}var Zie=["x","y","top","left","width","height","className"];function Tj(){return Tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tj.apply(this,arguments)}function LT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function eoe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LT(Object(n),!0).forEach(function(r){toe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function toe(e,t,n){return t=noe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function noe(e){var t=roe(e,"string");return Bd(t)=="symbol"?t:t+""}function roe(e,t){if(Bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aoe(e,t){if(e==null)return{};var n=soe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function soe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ioe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},ooe=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.top,c=o===void 0?0:o,d=t.left,f=d===void 0?0:d,h=t.width,p=h===void 0?0:h,g=t.height,y=g===void 0?0:g,j=t.className,w=aoe(t,Zie),x=eoe({x:r,y:i,top:c,left:f,width:p,height:y},w);return!De(r)||!De(i)||!De(p)||!De(y)||!De(c)||!De(f)?null:W.createElement("path",Tj({},ht(x,!0),{className:St("recharts-cross",j),d:ioe(r,i,p,y,c,f)}))},Iw,FT;function loe(){if(FT)return Iw;FT=1;var e=wv(),t=sL(),n=xs();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return Iw=r,Iw}var coe=loe();const uoe=Yt(coe);var Mw,BT;function doe(){if(BT)return Mw;BT=1;var e=wv(),t=xs(),n=iL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return Mw=r,Mw}var foe=doe();const poe=Yt(foe);var hoe=["cx","cy","angle","ticks","axisLine"],moe=["ticks","tick","angle","tickFormatter","stroke"];function dc(e){"@babel/helpers - typeof";return dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dc(e)}function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sd.apply(this,arguments)}function zT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function uo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zT(Object(n),!0).forEach(function(r){Ev(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UT(e,t){if(e==null)return{};var n=voe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function voe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function goe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,VL(r.key),r)}}function yoe(e,t,n){return t&&qT(e.prototype,t),n&&qT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xoe(e,t,n){return t=Zh(t),boe(e,WL()?Reflect.construct(t,n||[],Zh(e).constructor):t.apply(e,n))}function boe(e,t){if(t&&(dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return woe(e)}function woe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WL=function(){return!!e})()}function Zh(e){return Zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zh(e)}function joe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ij(e,t)}function Ij(e,t){return Ij=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Ij(e,t)}function Ev(e,t,n){return t=VL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VL(e){var t=Soe(e,"string");return dc(t)=="symbol"?t:t+""}function Soe(e,t){if(dc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _v=(function(e){function t(){return goe(this,t),xoe(this,t,arguments)}return joe(t,e),yoe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return on(c,d,a,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,a;switch(r){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=uoe(c,function(h){return h.coordinate||0}),f=poe(c,function(h){return h.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:f.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=r.axisLine,f=UT(r,hoe),h=c.reduce(function(j,w){return[Math.min(j[0],w.coordinate),Math.max(j[1],w.coordinate)]},[1/0,-1/0]),p=on(a,i,h[0],o),g=on(a,i,h[1],o),y=uo(uo(uo({},ht(f,!1)),{},{fill:"none"},ht(d,!1)),{},{x1:p.x,y1:p.y,x2:g.x,y2:g.y});return W.createElement("line",sd({className:"recharts-polar-radius-axis-line"},y))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,c=a.angle,d=a.tickFormatter,f=a.stroke,h=UT(a,moe),p=this.getTickTextAnchor(),g=ht(h,!1),y=ht(o,!1),j=i.map(function(w,x){var S=r.getTickValueCoord(w),N=uo(uo(uo(uo({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},g),{},{stroke:"none",fill:f},y),{},{index:x},S),{},{payload:w});return W.createElement(Mt,sd({className:St("recharts-polar-radius-axis-tick",TL(o)),key:"tick-".concat(w.coordinate)},_o(r.props,w,x)),t.renderTickItem(o,N,d?d(w.value,x):w.value))});return W.createElement(Mt,{className:"recharts-polar-radius-axis-ticks"},j)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.axisLine,o=r.tick;return!a||!a.length?null:W.createElement(Mt,{className:St("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),Gn.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):wt(r)?o=r(a):o=W.createElement(Po,sd({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Ev(_v,"displayName","PolarRadiusAxis");Ev(_v,"axisType","radiusAxis");Ev(_v,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function fc(e){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(e)}function vo(){return vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vo.apply(this,arguments)}function WT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function fo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WT(Object(n),!0).forEach(function(r){Pv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Noe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,KL(r.key),r)}}function Coe(e,t,n){return t&&VT(e.prototype,t),n&&VT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Aoe(e,t,n){return t=em(t),Eoe(e,HL()?Reflect.construct(t,n||[],em(e).constructor):t.apply(e,n))}function Eoe(e,t){if(t&&(fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _oe(e)}function _oe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HL=function(){return!!e})()}function em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},em(e)}function Poe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mj(e,t)}function Mj(e,t){return Mj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Mj(e,t)}function Pv(e,t,n){return t=KL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KL(e){var t=Ooe(e,"string");return fc(t)=="symbol"?t:t+""}function Ooe(e,t){if(fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var koe=Math.PI/180,HT=1e-5,Ov=(function(e){function t(){return Noe(this,t),Aoe(this,t,arguments)}return Poe(t,e),Coe(t,[{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.cx,o=a.cy,c=a.radius,d=a.orientation,f=a.tickSize,h=f||8,p=on(i,o,c,r.coordinate),g=on(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:g.x,y2:g.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*koe),o;return i>HT?o=a==="outer"?"start":"end":i<-HT?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.radius,c=r.axisLine,d=r.axisLineType,f=fo(fo({},ht(this.props,!1)),{},{fill:"none"},ht(c,!1));if(d==="circle")return W.createElement(Av,vo({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(g){return on(a,i,o,g.coordinate)});return W.createElement(Jie,vo({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,c=a.tickLine,d=a.tickFormatter,f=a.stroke,h=ht(this.props,!1),p=ht(o,!1),g=fo(fo({},h),{},{fill:"none"},ht(c,!1)),y=i.map(function(j,w){var x=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),N=fo(fo(fo({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:w,payload:j,x:x.x2,y:x.y2});return W.createElement(Mt,vo({className:St("recharts-polar-angle-axis-tick",TL(o)),key:"tick-".concat(j.coordinate)},_o(r.props,j,w)),c&&W.createElement("line",vo({className:"recharts-polar-angle-axis-tick-line"},g,x)),o&&t.renderTickItem(o,N,d?d(j.value,w):j.value))});return W.createElement(Mt,{className:"recharts-polar-angle-axis-ticks"},y)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:W.createElement(Mt,{className:St("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):wt(r)?o=r(a):o=W.createElement(Po,vo({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);Pv(Ov,"displayName","PolarAngleAxis");Pv(Ov,"axisType","angleAxis");Pv(Ov,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var $w,KT;function Roe(){if(KT)return $w;KT=1;var e=s5(),t=e(Object.getPrototypeOf,Object);return $w=t,$w}var Dw,GT;function Toe(){if(GT)return Dw;GT=1;var e=Xs(),t=Roe(),n=Qs(),r="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,c=i.hasOwnProperty,d=o.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var g=c.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&o.call(g)==d}return Dw=f,Dw}var Ioe=Toe();const Moe=Yt(Ioe);var Lw,YT;function $oe(){if(YT)return Lw;YT=1;var e=Xs(),t=Qs(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return Lw=r,Lw}var Doe=$oe();const Loe=Yt(Doe);function zd(e){"@babel/helpers - typeof";return zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zd(e)}function tm(){return tm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tm.apply(this,arguments)}function Foe(e,t){return qoe(e)||Uoe(e,t)||zoe(e,t)||Boe()}function Boe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zoe(e,t){if(e){if(typeof e=="string")return XT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return XT(e,t)}}function XT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Uoe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function qoe(e){if(Array.isArray(e))return e}function QT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function JT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QT(Object(n),!0).forEach(function(r){Woe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Woe(e,t,n){return t=Voe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Voe(e){var t=Hoe(e,"string");return zd(t)=="symbol"?t:t+""}function Hoe(e,t){if(zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZT=function(t,n,r,a,i){var o=r-a,c;return c="M ".concat(t,",").concat(n),c+="L ".concat(t+r,",").concat(n),c+="L ".concat(t+r-o/2,",").concat(n+i),c+="L ".concat(t+r-o/2-a,",").concat(n+i),c+="L ".concat(t,",").concat(n," Z"),c},Koe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Goe=function(t){var n=JT(JT({},Koe),t),r=v.useRef(),a=v.useState(-1),i=Foe(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&c(A)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,g=n.height,y=n.className,j=n.animationEasing,w=n.animationDuration,x=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||g!==+g||h===0&&p===0||g===0)return null;var N=St("recharts-trapezoid",y);return S?W.createElement(hs,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:g,x:d,y:f},duration:w,animationEasing:j,isActive:S},function(A){var P=A.upperWidth,E=A.lowerWidth,O=A.height,k=A.x,R=A.y;return W.createElement(hs,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:w,easing:j},W.createElement("path",tm({},ht(n,!0),{className:N,d:ZT(k,R,P,E,O),ref:r})))}):W.createElement("g",null,W.createElement("path",tm({},ht(n,!0),{className:N,d:ZT(d,f,h,p,g)})))},Yoe=["option","shapeType","propTransformer","activeClassName","isActive"];function Ud(e){"@babel/helpers - typeof";return Ud=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ud(e)}function Xoe(e,t){if(e==null)return{};var n=Qoe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qoe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function eI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function nm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eI(Object(n),!0).forEach(function(r){Joe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Joe(e,t,n){return t=Zoe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zoe(e){var t=ele(e,"string");return Ud(t)=="symbol"?t:t+""}function ele(e,t){if(Ud(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ud(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tle(e,t){return nm(nm({},t),e)}function nle(e,t){return e==="symbols"}function tI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return W.createElement(qN,n);case"trapezoid":return W.createElement(Goe,n);case"sector":return W.createElement($L,n);case"symbols":if(nle(t))return W.createElement(lN,n);break;default:return null}}function rle(e){return v.isValidElement(e)?e.props:e}function GL(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?tle:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=Xoe(e,Yoe),f;if(v.isValidElement(t))f=v.cloneElement(t,nm(nm({},d),rle(t)));else if(wt(t))f=t(d);else if(Moe(t)&&!Loe(t)){var h=a(t,d);f=W.createElement(tI,{shapeType:n,elementProps:h})}else{var p=d;f=W.createElement(tI,{shapeType:n,elementProps:p})}return c?W.createElement(Mt,{className:o},f):f}function kv(e,t){return t!=null&&"trapezoids"in e.props}function Rv(e,t){return t!=null&&"sectors"in e.props}function qd(e,t){return t!=null&&"points"in e.props}function ale(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,i=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&i}function sle(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function ile(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function ole(e,t){var n;return kv(e,t)?n=ale:Rv(e,t)?n=sle:qd(e,t)&&(n=ile),n}function lle(e,t){var n;return kv(e,t)?n="trapezoids":Rv(e,t)?n="sectors":qd(e,t)&&(n="points"),n}function cle(e,t){if(kv(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(Rv(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return qd(e,t)?t.payload:{}}function ule(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=lle(n,t),i=cle(n,t),o=r.filter(function(d,f){var h=gf(i,d),p=n.props[a].filter(function(j){var w=ole(n,t);return w(j,t)}),g=n.props[a].indexOf(p[p.length-1]),y=f===g;return h&&y}),c=r.indexOf(o[o.length-1]);return c}var ih;function pc(e){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pc(e)}function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tl.apply(this,arguments)}function nI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function an(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nI(Object(n),!0).forEach(function(r){da(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,XL(r.key),r)}}function fle(e,t,n){return t&&rI(e.prototype,t),n&&rI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ple(e,t,n){return t=rm(t),hle(e,YL()?Reflect.construct(t,n||[],rm(e).constructor):t.apply(e,n))}function hle(e,t){if(t&&(pc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mle(e)}function mle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YL=function(){return!!e})()}function rm(e){return rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rm(e)}function vle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$j(e,t)}function $j(e,t){return $j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$j(e,t)}function da(e,t,n){return t=XL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XL(e){var t=gle(e,"string");return pc(t)=="symbol"?t:t+""}function gle(e,t){if(pc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Zs=(function(e){function t(n){var r;return dle(this,t),r=ple(this,t,[n]),da(r,"pieRef",null),da(r,"sectorRefs",[]),da(r,"id",zc("recharts-pie-")),da(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),wt(a)&&a()}),da(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),wt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return vle(t,e),fle(t,[{key:"isActiveIndex",value:function(r){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(r)!==-1:r===a}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,c=i.labelLine,d=i.dataKey,f=i.valueKey,h=ht(this.props,!1),p=ht(o,!1),g=ht(c,!1),y=o&&o.offsetRadius||20,j=r.map(function(w,x){var S=(w.startAngle+w.endAngle)/2,N=on(w.cx,w.cy,w.outerRadius+y,S),A=an(an(an(an({},h),w),{},{stroke:"none"},p),{},{index:x,textAnchor:t.getTextAnchor(N.x,w.cx)},N),P=an(an(an(an({},h),w),{},{fill:"none",stroke:w.fill},g),{},{index:x,points:[on(w.cx,w.cy,w.outerRadius,S),N]}),E=d;return jt(d)&&jt(f)?E="value":jt(d)&&(E=f),W.createElement(Mt,{key:"label-".concat(w.startAngle,"-").concat(w.endAngle,"-").concat(w.midAngle,"-").concat(x)},c&&t.renderLabelLineItem(c,P,"line"),t.renderLabelItem(o,A,Ln(w,E)))});return W.createElement(Mt,{className:"recharts-pie-labels"},j)}},{key:"renderSectorsStatically",value:function(r){var a=this,i=this.props,o=i.activeShape,c=i.blendStroke,d=i.inactiveShape;return r.map(function(f,h){if(f?.startAngle===0&&f?.endAngle===0&&r.length!==1)return null;var p=a.isActiveIndex(h),g=d&&a.hasActiveIndex()?d:null,y=p?o:g,j=an(an({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return W.createElement(Mt,Tl({ref:function(x){x&&!a.sectorRefs.includes(x)&&a.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},_o(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),W.createElement(GL,Tl({option:y,isActive:p,shapeType:"sector"},j)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,a=this.props,i=a.sectors,o=a.isAnimationActive,c=a.animationBegin,d=a.animationDuration,f=a.animationEasing,h=a.animationId,p=this.state,g=p.prevSectors,y=p.prevIsAnimationActive;return W.createElement(hs,{begin:c,duration:d,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(y),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var w=j.t,x=[],S=i&&i[0],N=S.startAngle;return i.forEach(function(A,P){var E=g&&g[P],O=P>0?Qr(A,"paddingAngle",0):0;if(E){var k=Vr(E.endAngle-E.startAngle,A.endAngle-A.startAngle),R=an(an({},A),{},{startAngle:N+O,endAngle:N+k(w)+O});x.push(R),N=R.endAngle}else{var D=A.endAngle,U=A.startAngle,z=Vr(0,D-U),L=z(w),G=an(an({},A),{},{startAngle:N+O,endAngle:N+L+O});x.push(G),N=G.endAngle}}),W.createElement(Mt,null,r.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!gf(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,o=a.sectors,c=a.className,d=a.label,f=a.cx,h=a.cy,p=a.innerRadius,g=a.outerRadius,y=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!De(f)||!De(h)||!De(p)||!De(g))return null;var w=St("recharts-pie",c);return W.createElement(Mt,{tabIndex:this.props.rootTabIndex,className:w,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),Gn.renderCallByParent(this.props,null,!1),(!y||j)&&Us.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,a,i){if(W.isValidElement(r))return W.cloneElement(r,a);if(wt(r))return r(a);var o=St("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return W.createElement(Kh,Tl({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(W.isValidElement(r))return W.cloneElement(r,a);var o=i;if(wt(r)&&(o=r(a),W.isValidElement(o)))return o;var c=St("recharts-pie-label-text",typeof r!="boolean"&&!wt(r)?r.className:"");return W.createElement(Po,Tl({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);ih=Zs;da(Zs,"displayName","Pie");da(Zs,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!zo.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});da(Zs,"parseDeltaAngle",function(e,t){var n=pr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});da(Zs,"getRealPieData",function(e){var t=e.data,n=e.children,r=ht(e,!1),a=Jr(n,hv);return t&&t.length?t.map(function(i,o){return an(an(an({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return an(an({},r),i.props)}):[]});da(Zs,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=RL(a,i),c=r+hr(e.cx,a,a/2),d=n+hr(e.cy,i,i/2),f=hr(e.innerRadius,o,0),h=hr(e.outerRadius,o,o*.8),p=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:c,cy:d,innerRadius:f,outerRadius:h,maxRadius:p}});da(Zs,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?an(an({},t.type.defaultProps),t.props):t.props,a=ih.getRealPieData(r);if(!a||!a.length)return null;var i=r.cornerRadius,o=r.startAngle,c=r.endAngle,d=r.paddingAngle,f=r.dataKey,h=r.nameKey,p=r.valueKey,g=r.tooltipType,y=Math.abs(r.minAngle),j=ih.parseCoordinateOfPie(r,n),w=ih.parseDeltaAngle(o,c),x=Math.abs(w),S=f;jt(f)&&jt(p)?(Bs(!1,`Use "dataKey" to specify the value of pie,
|
|
114
|
-
the props "valueKey" will be deprecated in 1.1.0`),S="value"):jt(f)&&(Bs(!1,`Use "dataKey" to specify the value of pie,
|
|
115
|
-
the props "valueKey" will be deprecated in 1.1.0`),S=p);var N=a.filter(function(R){return Ln(R,S,0)!==0}).length,A=(x>=360?N:N-1)*d,P=x-N*y-A,E=a.reduce(function(R,D){var U=Ln(D,S,0);return R+(De(U)?U:0)},0),O;if(E>0){var k;O=a.map(function(R,D){var U=Ln(R,S,0),z=Ln(R,h,D),L=(De(U)?U:0)/E,G;D?G=k.endAngle+pr(w)*d*(U!==0?1:0):G=o;var q=G+pr(w)*((U!==0?y:0)+L*P),H=(G+q)/2,X=(j.innerRadius+j.outerRadius)/2,Z=[{name:z,value:U,payload:R,dataKey:S,type:g}],I=on(j.cx,j.cy,X,H);return k=an(an(an({percent:L,cornerRadius:i,name:z,tooltipPayload:Z,midAngle:H,middleRadius:X,tooltipPosition:I},R),j),{},{value:Ln(R,S),startAngle:G,endAngle:q,payload:R,paddingAngle:pr(w)*d}),k})}return an(an({},j),{},{sectors:O,data:a})});var Fw,aI;function yle(){if(aI)return Fw;aI=1;var e=Math.ceil,t=Math.max;function n(r,a,i,o){for(var c=-1,d=t(e((a-r)/(i||1)),0),f=Array(d);d--;)f[o?d:++c]=r,r+=i;return f}return Fw=n,Fw}var Bw,sI;function QL(){if(sI)return Bw;sI=1;var e=w5(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*n}return a===a?a:0}return Bw=r,Bw}var zw,iI;function xle(){if(iI)return zw;iI=1;var e=yle(),t=pv(),n=QL();function r(a){return function(i,o,c){return c&&typeof c!="number"&&t(i,o,c)&&(o=c=void 0),i=n(i),o===void 0?(o=i,i=0):o=n(o),c=c===void 0?i<o?1:-1:n(c),e(i,o,c,a)}}return zw=r,zw}var Uw,oI;function ble(){if(oI)return Uw;oI=1;var e=xle(),t=e();return Uw=t,Uw}var wle=ble();const am=Yt(wle);function Wd(e){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wd(e)}function lI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function cI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lI(Object(n),!0).forEach(function(r){JL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JL(e,t,n){return t=jle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jle(e){var t=Sle(e,"string");return Wd(t)=="symbol"?t:t+""}function Sle(e,t){if(Wd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Nle=["Webkit","Moz","O","ms"],Cle=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Nle.reduce(function(i,o){return cI(cI({},i),{},JL({},o+r,n))},{});return a[t]=n,a};function hc(e){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hc(e)}function sm(){return sm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sm.apply(this,arguments)}function uI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uI(Object(n),!0).forEach(function(r){zr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ale(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,e4(r.key),r)}}function Ele(e,t,n){return t&&dI(e.prototype,t),n&&dI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _le(e,t,n){return t=im(t),Ple(e,ZL()?Reflect.construct(t,n||[],im(e).constructor):t.apply(e,n))}function Ple(e,t){if(t&&(hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ole(e)}function Ole(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZL=function(){return!!e})()}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},im(e)}function kle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dj(e,t)}function Dj(e,t){return Dj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Dj(e,t)}function zr(e,t,n){return t=e4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e4(e){var t=Rle(e,"string");return hc(t)=="symbol"?t:t+""}function Rle(e,t){if(hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Tle=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,i=t.x,o=t.width,c=t.travellerWidth;if(!n||!n.length)return{};var d=n.length,f=td().domain(am(0,d)).range([i,i+o-c]),h=f.domain().map(function(p){return f(p)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:f(r),endX:f(a),scale:f,scaleValues:h}},fI=function(t){return t.changedTouches&&!!t.changedTouches.length},mc=(function(e){function t(n){var r;return Ale(this,t),r=_le(this,t,[n]),zr(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),zr(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),zr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,o=a.onDragEnd,c=a.startIndex;o?.({endIndex:i,startIndex:c})}),r.detachDragEndListener()}),zr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),zr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),zr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),zr(r,"handleSlideDragStart",function(a){var i=fI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return kle(t,e),Ele(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,o=this.state.scaleValues,c=this.props,d=c.gap,f=c.data,h=f.length-1,p=Math.min(a,i),g=Math.max(a,i),y=t.getIndexInRange(o,p),j=t.getIndexInRange(o,g);return{startIndex:y-y%d,endIndex:j===h?h:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,o=a.tickFormatter,c=a.dataKey,d=Ln(i[r],c,r);return wt(o)?o(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,o=a.startX,c=a.endX,d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.startIndex,y=d.endIndex,j=d.onChange,w=r.pageX-i;w>0?w=Math.min(w,f+h-p-c,f+h-p-o):w<0&&(w=Math.max(w,f-o,f-c));var x=this.getIndex({startX:o+w,endX:c+w});(x.startIndex!==g||x.endIndex!==y)&&j&&j(x),this.setState({startX:o+w,endX:c+w,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=fI(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,c=a.endX,d=a.startX,f=this.state[o],h=this.props,p=h.x,g=h.width,y=h.travellerWidth,j=h.onChange,w=h.gap,x=h.data,S={startX:this.state.startX,endX:this.state.endX},N=r.pageX-i;N>0?N=Math.min(N,p+g-y-f):N<0&&(N=Math.max(N,p-f)),S[o]=f+N;var A=this.getIndex(S),P=A.startIndex,E=A.endIndex,O=function(){var R=x.length-1;return o==="startX"&&(c>d?P%w===0:E%w===0)||c<d&&E===R||o==="endX"&&(c>d?E%w===0:P%w===0)||c>d&&E===R};this.setState(zr(zr({},o,f+N),"brushMoveStartX",r.pageX),function(){j&&O()&&j(A)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,o=this.state,c=o.scaleValues,d=o.startX,f=o.endX,h=this.state[a],p=c.indexOf(h);if(p!==-1){var g=p+r;if(!(g===-1||g>=c.length)){var y=c[g];a==="startX"&&y>=f||a==="endX"&&y<=d||this.setState(zr({},a,y),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.fill,f=r.stroke;return W.createElement("rect",{stroke:f,fill:d,x:a,y:i,width:o,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.data,f=r.children,h=r.padding,p=v.Children.only(f);return p?W.cloneElement(p,{x:a,y:i,width:o,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,o,c=this,d=this.props,f=d.y,h=d.travellerWidth,p=d.height,g=d.traveller,y=d.ariaLabel,j=d.data,w=d.startIndex,x=d.endIndex,S=Math.max(r,this.props.x),N=qw(qw({},ht(this.props,!1)),{},{x:S,y:f,width:h,height:p}),A=y||"Min value: ".concat((i=j[w])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[x])===null||o===void 0?void 0:o.name);return W.createElement(Mt,{tabIndex:0,role:"slider","aria-label":A,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),c.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,N))}},{key:"renderSlide",value:function(r,a){var i=this.props,o=i.y,c=i.height,d=i.stroke,f=i.travellerWidth,h=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return W.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:o,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,o=r.y,c=r.height,d=r.travellerWidth,f=r.stroke,h=this.state,p=h.startX,g=h.endX,y=5,j={pointerEvents:"none",fill:f};return W.createElement(Mt,{className:"recharts-brush-texts"},W.createElement(Po,sm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-y,y:o+c/2},j),this.getTextOfTick(a)),W.createElement(Po,sm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+y,y:o+c/2},j),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,o=r.children,c=r.x,d=r.y,f=r.width,h=r.height,p=r.alwaysShowText,g=this.state,y=g.startX,j=g.endX,w=g.isTextActive,x=g.isSlideMoving,S=g.isTravellerMoving,N=g.isTravellerFocused;if(!a||!a.length||!De(c)||!De(d)||!De(f)||!De(h)||f<=0||h<=0)return null;var A=St("recharts-brush",i),P=W.Children.count(o)===1,E=Cle("userSelect","none");return W.createElement(Mt,{className:A,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),P&&this.renderPanorama(),this.renderSlide(y,j),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(j,"endX"),(w||x||S||N||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,o=r.width,c=r.height,d=r.stroke,f=Math.floor(i+c/2)-1;return W.createElement(W.Fragment,null,W.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),W.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),W.createElement("line",{x1:a+1,y1:f+2,x2:a+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return W.isValidElement(r)?i=W.cloneElement(r,a):wt(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,o=r.width,c=r.x,d=r.travellerWidth,f=r.updateId,h=r.startIndex,p=r.endIndex;if(i!==a.prevData||f!==a.prevUpdateId)return qw({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Tle({data:i,width:o,x:c,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||c!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([c,c+o-d]);var g=a.scale.domain().map(function(y){return a.scale(y)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,o=0,c=i-1;c-o>1;){var d=Math.floor((o+c)/2);r[d]>a?c=d:o=d}return a>=r[c]?c:o}}])})(v.PureComponent);zr(mc,"displayName","Brush");zr(mc,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Ww,pI;function Ile(){if(pI)return Ww;pI=1;var e=mN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return Ww=t,Ww}var Vw,hI;function Mle(){if(hI)return Vw;hI=1;var e=J3(),t=xs(),n=Ile(),r=Pr(),a=pv();function i(o,c,d){var f=r(o)?e:n;return d&&a(o,c,d)&&(c=void 0),f(o,t(c,3))}return Vw=i,Vw}var $le=Mle();const Dle=Yt($le);var ds=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},Hw,mI;function Lle(){if(mI)return Hw;mI=1;var e=v5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return Hw=t,Hw}var Kw,vI;function Fle(){if(vI)return Kw;vI=1;var e=Lle(),t=h5(),n=xs();function r(a,i){var o={};return i=n(i,3),t(a,function(c,d,f){e(o,d,i(c,d,f))}),o}return Kw=r,Kw}var Ble=Fle();const zle=Yt(Ble);var Gw,gI;function Ule(){if(gI)return Gw;gI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(!n(t[r],r,t))return!1;return!0}return Gw=e,Gw}var Yw,yI;function qle(){if(yI)return Yw;yI=1;var e=mN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return Yw=t,Yw}var Xw,xI;function Wle(){if(xI)return Xw;xI=1;var e=Ule(),t=qle(),n=xs(),r=Pr(),a=pv();function i(o,c,d){var f=r(o)?e:t;return d&&a(o,c,d)&&(c=void 0),f(o,n(c,3))}return Xw=i,Xw}var Vle=Wle();const Hle=Yt(Vle);var Kle=["x","y"];function Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}function Lj(){return Lj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lj.apply(this,arguments)}function bI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Uu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(n),!0).forEach(function(r){Gle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gle(e,t,n){return t=Yle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yle(e){var t=Xle(e,"string");return Vd(t)=="symbol"?t:t+""}function Xle(e,t){if(Vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qle(e,t){if(e==null)return{};var n=Jle(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jle(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Zle(e,t){var n=e.x,r=e.y,a=Qle(e,Kle),i="".concat(n),o=parseInt(i,10),c="".concat(r),d=parseInt(c,10),f="".concat(t.height||a.height),h=parseInt(f,10),p="".concat(t.width||a.width),g=parseInt(p,10);return Uu(Uu(Uu(Uu(Uu({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:g,name:t.name,radius:t.radius})}function wI(e){return W.createElement(GL,Lj({shapeType:"rectangle",propTransformer:Zle,activeClassName:"recharts-active-bar"},e))}var ece=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=De(r)||xY(r);return i?t(r,a):(i||ko(),n)}},tce=["value","background"],t4;function vc(e){"@babel/helpers - typeof";return vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(e)}function nce(e,t){if(e==null)return{};var n=rce(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rce(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function om(){return om=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},om.apply(this,arguments)}function jI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jI(Object(n),!0).forEach(function(r){Pi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ace(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r4(r.key),r)}}function sce(e,t,n){return t&&SI(e.prototype,t),n&&SI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ice(e,t,n){return t=lm(t),oce(e,n4()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}function oce(e,t){if(t&&(vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return lce(e)}function lce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(n4=function(){return!!e})()}function lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lm(e)}function cce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fj(e,t)}function Fj(e,t){return Fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Fj(e,t)}function Pi(e,t,n){return t=r4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r4(e){var t=uce(e,"string");return vc(t)=="symbol"?t:t+""}function uce(e,t){if(vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Vo=(function(e){function t(){var n;ace(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=ice(this,t,[].concat(a)),Pi(n,"state",{isAnimationFinished:!1}),Pi(n,"id",zc("recharts-bar-")),Pi(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Pi(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return cce(t,e),sce(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,i=this.props,o=i.shape,c=i.dataKey,d=i.activeIndex,f=i.activeBar,h=ht(this.props,!1);return r&&r.map(function(p,g){var y=g===d,j=y?f:o,w=On(On(On({},h),p),{},{isActive:y,option:j,index:g,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return W.createElement(Mt,om({className:"recharts-bar-rectangle"},_o(a.props,p,g),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(g)}),W.createElement(wI,w))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,i=a.data,o=a.layout,c=a.isAnimationActive,d=a.animationBegin,f=a.animationDuration,h=a.animationEasing,p=a.animationId,g=this.state.prevData;return W.createElement(hs,{begin:d,duration:f,isActive:c,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var j=y.t,w=i.map(function(x,S){var N=g&&g[S];if(N){var A=Vr(N.x,x.x),P=Vr(N.y,x.y),E=Vr(N.width,x.width),O=Vr(N.height,x.height);return On(On({},x),{},{x:A(j),y:P(j),width:E(j),height:O(j)})}if(o==="horizontal"){var k=Vr(0,x.height),R=k(j);return On(On({},x),{},{y:x.y+x.height-R,height:R})}var D=Vr(0,x.width),U=D(j);return On(On({},x),{},{width:U})});return W.createElement(Mt,null,r.renderRectanglesStatically(w))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!gf(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,i=a.data,o=a.dataKey,c=a.activeIndex,d=ht(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,g=nce(f,tce);if(!p)return null;var y=On(On(On(On(On({},g),{},{fill:"#eee"},p),d),_o(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return W.createElement(wI,om({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},y))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=Jr(h,yf);if(!p)return null;var g=f==="vertical"?o[0].height/2:o[0].width/2,y=function(x,S){var N=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:N,errorVal:Ln(x,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(Mt,j,p.map(function(w){return W.cloneElement(w,{key:"error-bar-".concat(a,"-").concat(w.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:g,dataPointFormatter:y})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.data,o=r.className,c=r.xAxis,d=r.yAxis,f=r.left,h=r.top,p=r.width,g=r.height,y=r.isAnimationActive,j=r.background,w=r.id;if(a||!i||!i.length)return null;var x=this.state.isAnimationFinished,S=St("recharts-bar",o),N=c&&c.allowDataOverflow,A=d&&d.allowDataOverflow,P=N||A,E=jt(w)?this.id:w;return W.createElement(Mt,{className:S},N||A?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(E)},W.createElement("rect",{x:N?f:f-p/2,y:A?h:h-g/2,width:N?p:p*2,height:A?g:g*2}))):null,W.createElement(Mt,{className:"recharts-bar-rectangles",clipPath:P?"url(#clipPath-".concat(E,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(P,E),(!y||x)&&Us.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])})(v.PureComponent);t4=Vo;Pi(Vo,"displayName","Bar");Pi(Vo,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!zo.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Pi(Vo,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,p=e.displayedData,g=e.offset,y=Ire(r,n);if(!y)return null;var j=t.layout,w=n.type.defaultProps,x=w!==void 0?On(On({},w),n.props):n.props,S=x.dataKey,N=x.children,A=x.minPointSize,P=j==="horizontal"?o:i,E=f?P.scale.domain():null,O=zre({numericAxis:P}),k=Jr(N,hv),R=p.map(function(D,U){var z,L,G,q,H,X;f?z=Mre(f[h+U],E):(z=Ln(D,S),Array.isArray(z)||(z=[O,z]));var Z=ece(A,t4.defaultProps.minPointSize)(z[1],U);if(j==="horizontal"){var I,F=[o.scale(z[0]),o.scale(z[1])],Q=F[0],B=F[1];L=QR({axis:i,ticks:c,bandSize:a,offset:y.offset,entry:D,index:U}),G=(I=B??Q)!==null&&I!==void 0?I:void 0,q=y.size;var $=Q-B;if(H=Number.isNaN($)?0:$,X={x:L,y:o.y,width:q,height:o.height},Math.abs(Z)>0&&Math.abs(H)<Math.abs(Z)){var ee=pr(H||Z)*(Math.abs(Z)-Math.abs(H));G-=ee,H+=ee}}else{var V=[i.scale(z[0]),i.scale(z[1])],J=V[0],ge=V[1];if(L=J,G=QR({axis:o,ticks:d,bandSize:a,offset:y.offset,entry:D,index:U}),q=ge-J,H=y.size,X={x:i.x,y:G,width:i.width,height:H},Math.abs(Z)>0&&Math.abs(q)<Math.abs(Z)){var ie=pr(q||Z)*(Math.abs(Z)-Math.abs(q));q+=ie}}return On(On(On({},D),{},{x:L,y:G,width:q,height:H,value:f?z:z[1],payload:D,background:X},k&&k[U]&&k[U].props),{},{tooltipPayload:[OL(n,D)],tooltipPosition:{x:L+q/2,y:G+H/2}})});return On({data:R,layout:j},g)});function Hd(e){"@babel/helpers - typeof";return Hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hd(e)}function dce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a4(r.key),r)}}function fce(e,t,n){return t&&NI(e.prototype,t),n&&NI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function CI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CI(Object(n),!0).forEach(function(r){Tv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tv(e,t,n){return t=a4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a4(e){var t=pce(e,"string");return Hd(t)=="symbol"?t:t+""}function pce(e,t){if(Hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var s4=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.layout,f=t.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:c-r.bottom,bottomMirror:c-r.bottom},g=!!Ur(f,Vo);return h.reduce(function(y,j){var w=n[j],x=w.orientation,S=w.domain,N=w.padding,A=N===void 0?{}:N,P=w.mirror,E=w.reversed,O="".concat(x).concat(P?"Mirror":""),k,R,D,U,z;if(w.type==="number"&&(w.padding==="gap"||w.padding==="no-gap")){var L=S[1]-S[0],G=1/0,q=w.categoricalDomain.sort(jY);if(q.forEach(function(V,J){J>0&&(G=Math.min((V||0)-(q[J-1]||0),G))}),Number.isFinite(G)){var H=G/L,X=w.layout==="vertical"?r.height:r.width;if(w.padding==="gap"&&(k=H*X/2),w.padding==="no-gap"){var Z=hr(t.barCategoryGap,H*X),I=H*X/2;k=I-Z-(I-Z)/X*Z}}}a==="xAxis"?R=[r.left+(A.left||0)+(k||0),r.left+r.width-(A.right||0)-(k||0)]:a==="yAxis"?R=d==="horizontal"?[r.top+r.height-(A.bottom||0),r.top+(A.top||0)]:[r.top+(A.top||0)+(k||0),r.top+r.height-(A.bottom||0)-(k||0)]:R=w.range,E&&(R=[R[1],R[0]]);var F=AL(w,i,g),Q=F.scale,B=F.realScaleType;Q.domain(S).range(R),EL(Q);var $=_L(Q,$a($a({},w),{},{realScaleType:B}));a==="xAxis"?(z=x==="top"&&!P||x==="bottom"&&P,D=r.left,U=p[O]-z*w.height):a==="yAxis"&&(z=x==="left"&&!P||x==="right"&&P,D=p[O]-z*w.width,U=r.top);var ee=$a($a($a({},w),$),{},{realScaleType:B,x:D,y:U,scale:Q,width:a==="xAxis"?r.width:w.width,height:a==="yAxis"?r.height:w.height});return ee.bandSize=Wh(ee,$),!w.hide&&a==="xAxis"?p[O]+=(z?-1:1)*ee.height:w.hide||(p[O]+=(z?-1:1)*ee.width),$a($a({},y),{},Tv({},j,ee))},{})},i4=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(a,o),width:Math.abs(i-r),height:Math.abs(o-a)}},hce=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return i4({x:n,y:r},{x:a,y:i})},o4=(function(){function e(t){dce(this,e),this.scale=t}return fce(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();Tv(o4,"EPS",1e-4);var WN=function(t){var n=Object.keys(t).reduce(function(r,a){return $a($a({},r),{},Tv({},a,o4.create(t[a])))},{});return $a($a({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return zle(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return Hle(a,function(i,o){return n[o].isInRange(i)})}})};function mce(e){return(e%180+180)%180}var vce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=mce(a),o=i*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},Qw,AI;function gce(){if(AI)return Qw;AI=1;var e=xs(),t=ff(),n=dv();function r(a){return function(i,o,c){var d=Object(i);if(!t(i)){var f=e(o,3);i=n(i),o=function(p){return f(d[p],p,d)}}var h=a(i,o,c);return h>-1?d[f?i[h]:h]:void 0}}return Qw=r,Qw}var Jw,EI;function yce(){if(EI)return Jw;EI=1;var e=QL();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return Jw=t,Jw}var Zw,_I;function xce(){if(_I)return Zw;_I=1;var e=c5(),t=xs(),n=yce(),r=Math.max;function a(i,o,c){var d=i==null?0:i.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(i,t(o,3),f)}return Zw=a,Zw}var e1,PI;function bce(){if(PI)return e1;PI=1;var e=gce(),t=xce(),n=e(t);return e1=n,e1}bce();var wce=C3();const jce=Yt(wce);var Sce=jce(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),l4=v.createContext(void 0),c4=v.createContext(void 0),u4=v.createContext(void 0),Nce=v.createContext({}),d4=v.createContext(void 0),f4=v.createContext(0),p4=v.createContext(0),OI=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,i=n.offset,o=t.clipPathId,c=t.children,d=t.width,f=t.height,h=Sce(i);return W.createElement(l4.Provider,{value:r},W.createElement(c4.Provider,{value:a},W.createElement(Nce.Provider,{value:i},W.createElement(u4.Provider,{value:h},W.createElement(d4.Provider,{value:o},W.createElement(f4.Provider,{value:f},W.createElement(p4.Provider,{value:d},c)))))))},Cce=function(){return v.useContext(d4)},h4=function(t){var n=v.useContext(l4);n==null&&ko();var r=n[t];return r==null&&ko(),r},m4=function(t){var n=v.useContext(c4);n==null&&ko();var r=n[t];return r==null&&ko(),r},Ace=function(){var t=v.useContext(u4);return t},v4=function(){return v.useContext(p4)},g4=function(){return v.useContext(f4)};function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function Ece(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,x4(r.key),r)}}function Pce(e,t,n){return t&&_ce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oce(e,t,n){return t=cm(t),kce(e,y4()?Reflect.construct(t,n||[],cm(e).constructor):t.apply(e,n))}function kce(e,t){if(t&&(gc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rce(e)}function Rce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y4=function(){return!!e})()}function cm(e){return cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cm(e)}function Tce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bj(e,t)}function Bj(e,t){return Bj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Bj(e,t)}function kI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function RI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(n),!0).forEach(function(r){VN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VN(e,t,n){return t=x4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x4(e){var t=Ice(e,"string");return gc(t)=="symbol"?t:t+""}function Ice(e,t){if(gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Mce(e,t){return Fce(e)||Lce(e,t)||Dce(e,t)||$ce()}function $ce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
116
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dce(e,t){if(e){if(typeof e=="string")return TI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TI(e,t)}}function TI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Lce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Fce(e){if(Array.isArray(e))return e}function zj(){return zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zj.apply(this,arguments)}var Bce=function(t,n){var r;return W.isValidElement(t)?r=W.cloneElement(t,n):wt(t)?r=t(n):r=W.createElement("line",zj({},n,{className:"recharts-reference-line-line"})),r},zce=function(t,n,r,a,i,o,c,d,f){var h=i.x,p=i.y,g=i.width,y=i.height;if(r){var j=f.y,w=t.y.apply(j,{position:o});if(ds(f,"discard")&&!t.y.isInRange(w))return null;var x=[{x:h+g,y:w},{x:h,y:w}];return d==="left"?x.reverse():x}if(n){var S=f.x,N=t.x.apply(S,{position:o});if(ds(f,"discard")&&!t.x.isInRange(N))return null;var A=[{x:N,y:p+y},{x:N,y:p}];return c==="top"?A.reverse():A}if(a){var P=f.segment,E=P.map(function(O){return t.apply(O,{position:o})});return ds(f,"discard")&&Dle(E,function(O){return!t.isInRange(O)})?null:E}return null};function Uce(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,c=e.className,d=e.alwaysShow,f=Cce(),h=h4(a),p=m4(i),g=Ace();if(!f||!g)return null;Bs(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var y=WN({x:h.scale,y:p.scale}),j=Fn(t),w=Fn(n),x=r&&r.length===2,S=zce(y,j,w,x,g,e.position,h.orientation,p.orientation,e);if(!S)return null;var N=Mce(S,2),A=N[0],P=A.x,E=A.y,O=N[1],k=O.x,R=O.y,D=ds(e,"hidden")?"url(#".concat(f,")"):void 0,U=RI(RI({clipPath:D},ht(e,!0)),{},{x1:P,y1:E,x2:k,y2:R});return W.createElement(Mt,{className:St("recharts-reference-line",c)},Bce(o,U),Gn.renderCallByParent(e,hce({x1:P,y1:E,x2:k,y2:R})))}var HN=(function(e){function t(){return Ece(this,t),Oce(this,t,arguments)}return Tce(t,e),Pce(t,[{key:"render",value:function(){return W.createElement(Uce,this.props)}}])})(W.Component);VN(HN,"displayName","ReferenceLine");VN(HN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Uj(){return Uj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uj.apply(this,arguments)}function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function II(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function MI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?II(Object(n),!0).forEach(function(r){Iv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,w4(r.key),r)}}function Vce(e,t,n){return t&&Wce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hce(e,t,n){return t=um(t),Kce(e,b4()?Reflect.construct(t,n||[],um(e).constructor):t.apply(e,n))}function Kce(e,t){if(t&&(yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gce(e)}function Gce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(b4=function(){return!!e})()}function um(e){return um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},um(e)}function Yce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qj(e,t)}function qj(e,t){return qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},qj(e,t)}function Iv(e,t,n){return t=w4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w4(e){var t=Xce(e,"string");return yc(t)=="symbol"?t:t+""}function Xce(e,t){if(yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qce=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=WN({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return ds(t,"discard")&&!o.isInRange(c)?null:c},Mv=(function(e){function t(){return qce(this,t),Hce(this,t,arguments)}return Yce(t,e),Vce(t,[{key:"render",value:function(){var r=this.props,a=r.x,i=r.y,o=r.r,c=r.alwaysShow,d=r.clipPathId,f=Fn(a),h=Fn(i);if(Bs(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=Qce(this.props);if(!p)return null;var g=p.x,y=p.y,j=this.props,w=j.shape,x=j.className,S=ds(this.props,"hidden")?"url(#".concat(d,")"):void 0,N=MI(MI({clipPath:S},ht(this.props,!0)),{},{cx:g,cy:y});return W.createElement(Mt,{className:St("recharts-reference-dot",x)},t.renderDot(w,N),Gn.renderCallByParent(this.props,{x:g-o,y:y-o,width:2*o,height:2*o}))}}])})(W.Component);Iv(Mv,"displayName","ReferenceDot");Iv(Mv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Iv(Mv,"renderDot",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):wt(e)?n=e(t):n=W.createElement(Av,Uj({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function Wj(){return Wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wj.apply(this,arguments)}function xc(e){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(e)}function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function DI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(n),!0).forEach(function(r){$v(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,S4(r.key),r)}}function eue(e,t,n){return t&&Zce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tue(e,t,n){return t=dm(t),nue(e,j4()?Reflect.construct(t,n||[],dm(e).constructor):t.apply(e,n))}function nue(e,t){if(t&&(xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rue(e)}function rue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function j4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(j4=function(){return!!e})()}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dm(e)}function aue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vj(e,t)}function Vj(e,t){return Vj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Vj(e,t)}function $v(e,t,n){return t=S4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S4(e){var t=sue(e,"string");return xc(t)=="symbol"?t:t+""}function sue(e,t){if(xc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var iue=function(t,n,r,a,i){var o=i.x1,c=i.x2,d=i.y1,f=i.y2,h=i.xAxis,p=i.yAxis;if(!h||!p)return null;var g=WN({x:h.scale,y:p.scale}),y={x:t?g.x.apply(o,{position:"start"}):g.x.rangeMin,y:r?g.y.apply(d,{position:"start"}):g.y.rangeMin},j={x:n?g.x.apply(c,{position:"end"}):g.x.rangeMax,y:a?g.y.apply(f,{position:"end"}):g.y.rangeMax};return ds(i,"discard")&&(!g.isInRange(y)||!g.isInRange(j))?null:i4(y,j)},Dv=(function(e){function t(){return Jce(this,t),tue(this,t,arguments)}return aue(t,e),eue(t,[{key:"render",value:function(){var r=this.props,a=r.x1,i=r.x2,o=r.y1,c=r.y2,d=r.className,f=r.alwaysShow,h=r.clipPathId;Bs(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Fn(a),g=Fn(i),y=Fn(o),j=Fn(c),w=this.props.shape;if(!p&&!g&&!y&&!j&&!w)return null;var x=iue(p,g,y,j,this.props);if(!x&&!w)return null;var S=ds(this.props,"hidden")?"url(#".concat(h,")"):void 0;return W.createElement(Mt,{className:St("recharts-reference-area",d)},t.renderRect(w,DI(DI({clipPath:S},ht(this.props,!0)),x)),Gn.renderCallByParent(this.props,x))}}])})(W.Component);$v(Dv,"displayName","ReferenceArea");$v(Dv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});$v(Dv,"renderRect",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):wt(e)?n=e(t):n=W.createElement(qN,Wj({},t,{className:"recharts-reference-area-rect"})),n});function N4(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function oue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return vce(r,n)}function lue(e,t,n){var r=n==="width",a=e.x,i=e.y,o=e.width,c=e.height;return t===1?{start:r?a:i,end:r?a+o:i+c}:{start:r?a+o:i+c,end:r?a:i}}function fm(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function cue(e,t){return N4(e,t+1)}function uue(e,t,n,r,a){for(var i=(r||[]).slice(),o=t.start,c=t.end,d=0,f=1,h=o,p=function(){var j=r?.[d];if(j===void 0)return{v:N4(r,f)};var w=d,x,S=function(){return x===void 0&&(x=n(j,w)),x},N=j.coordinate,A=d===0||fm(e,N,S,h,c);A||(d=0,h=o,f+=1),A&&(h=N+e*(S()/2+a),d+=f)},g;f<=i.length;)if(g=p(),g)return g.v;return[]}function Kd(e){"@babel/helpers - typeof";return Kd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kd(e)}function LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function lr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(r){due(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function due(e,t,n){return t=fue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fue(e){var t=pue(e,"string");return Kd(t)=="symbol"?t:t+""}function pue(e,t){if(Kd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hue(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(g){var y=i[g],j,w=function(){return j===void 0&&(j=n(y,g)),j};if(g===o-1){var x=e*(y.coordinate+e*w()/2-d);i[g]=y=lr(lr({},y),{},{tickCoord:x>0?y.coordinate-x*e:y.coordinate})}else i[g]=y=lr(lr({},y),{},{tickCoord:y.coordinate});var S=fm(e,y.tickCoord,w,c,d);S&&(d=y.tickCoord-e*(w()/2+a),i[g]=lr(lr({},y),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function mue(e,t,n,r,a,i){var o=(r||[]).slice(),c=o.length,d=t.start,f=t.end;if(i){var h=r[c-1],p=n(h,c-1),g=e*(h.coordinate+e*p/2-f);o[c-1]=h=lr(lr({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate});var y=fm(e,h.tickCoord,function(){return p},d,f);y&&(f=h.tickCoord-e*(p/2+a),o[c-1]=lr(lr({},h),{},{isShow:!0}))}for(var j=i?c-1:c,w=function(N){var A=o[N],P,E=function(){return P===void 0&&(P=n(A,N)),P};if(N===0){var O=e*(A.coordinate-e*E()/2-d);o[N]=A=lr(lr({},A),{},{tickCoord:O<0?A.coordinate-O*e:A.coordinate})}else o[N]=A=lr(lr({},A),{},{tickCoord:A.coordinate});var k=fm(e,A.tickCoord,E,d,f);k&&(d=A.tickCoord+e*(E()/2+a),o[N]=lr(lr({},A),{},{isShow:!0}))},x=0;x<j;x++)w(x);return o}function vue(e,t,n){var r=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,c=e.orientation,d=e.interval,f=e.tickFormatter,h=e.unit,p=e.angle;if(!a||!a.length||!r)return[];if(De(d)||zo.isSsr)return cue(a,typeof d=="number"&&De(d)?d:0);var g=[],y=c==="top"||c==="bottom"?"width":"height",j=h&&y==="width"?ed(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},w=function(A,P){var E=wt(f)?f(A.value,P):A.value;return y==="width"?oue(ed(E,{fontSize:t,letterSpacing:n}),j,p):ed(E,{fontSize:t,letterSpacing:n})[y]},x=a.length>=2?pr(a[1].coordinate-a[0].coordinate):1,S=lue(i,x,y);return d==="equidistantPreserveStart"?uue(x,S,w,a,o):(d==="preserveStart"||d==="preserveStartEnd"?g=mue(x,S,w,a,o,d==="preserveStartEnd"):g=hue(x,S,w,a,o),g.filter(function(N){return N.isShow}))}var gue=["viewBox"],yue=["viewBox"],xue=["ticks"];function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function Il(){return Il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Il.apply(this,arguments)}function FI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FI(Object(n),!0).forEach(function(r){KN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t1(e,t){if(e==null)return{};var n=bue(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function wue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,A4(r.key),r)}}function jue(e,t,n){return t&&BI(e.prototype,t),n&&BI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sue(e,t,n){return t=pm(t),Nue(e,C4()?Reflect.construct(t,n||[],pm(e).constructor):t.apply(e,n))}function Nue(e,t){if(t&&(bc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cue(e)}function Cue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(C4=function(){return!!e})()}function pm(e){return pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pm(e)}function Aue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hj(e,t)}function Hj(e,t){return Hj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Hj(e,t)}function KN(e,t,n){return t=A4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A4(e){var t=Eue(e,"string");return bc(t)=="symbol"?t:t+""}function Eue(e,t){if(bc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lv=(function(e){function t(n){var r;return wue(this,t),r=Sue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Aue(t,e),jue(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=t1(r,gue),c=this.props,d=c.viewBox,f=t1(c,yue);return!Ul(i,d)||!Ul(o,f)||!Ul(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.x,o=a.y,c=a.width,d=a.height,f=a.orientation,h=a.tickSize,p=a.mirror,g=a.tickMargin,y,j,w,x,S,N,A=p?-1:1,P=r.tickSize||h,E=De(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":y=j=r.coordinate,x=o+ +!p*d,w=x-A*P,N=w-A*g,S=E;break;case"left":w=x=r.coordinate,j=i+ +!p*c,y=j-A*P,S=y-A*g,N=E;break;case"right":w=x=r.coordinate,j=i+ +p*c,y=j+A*P,S=y+A*g,N=E;break;default:y=j=r.coordinate,x=o+ +p*d,w=x+A*P,N=w+A*g,S=E;break}return{line:{x1:y,y1:w,x2:j,y2:x},tick:{x:S,y:N}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.orientation,f=r.mirror,h=r.axisLine,p=$n($n($n({},ht(this.props,!1)),ht(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var g=+(d==="top"&&!f||d==="bottom"&&f);p=$n($n({},p),{},{x1:a,y1:i+g*c,x2:a+o,y2:i+g*c})}else{var y=+(d==="left"&&!f||d==="right"&&f);p=$n($n({},p),{},{x1:a+y*o,y1:i,x2:a+y*o,y2:i+c})}return W.createElement("line",Il({},p,{className:St("recharts-cartesian-axis-line",Qr(h,"className"))}))}},{key:"renderTicks",value:function(r,a,i){var o=this,c=this.props,d=c.tickLine,f=c.stroke,h=c.tick,p=c.tickFormatter,g=c.unit,y=vue($n($n({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),w=this.getTickVerticalAnchor(),x=ht(this.props,!1),S=ht(h,!1),N=$n($n({},x),{},{fill:"none"},ht(d,!1)),A=y.map(function(P,E){var O=o.getTickLineCoord(P),k=O.line,R=O.tick,D=$n($n($n($n({textAnchor:j,verticalAnchor:w},x),{},{stroke:"none",fill:f},S),R),{},{index:E,payload:P,visibleTicksCount:y.length,tickFormatter:p});return W.createElement(Mt,Il({className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},_o(o.props,P,E)),d&&W.createElement("line",Il({},N,k,{className:St("recharts-cartesian-axis-tick-line",Qr(d,"className"))})),h&&t.renderTickItem(h,D,"".concat(wt(p)?p(P.value,E):P.value).concat(g||"")))});return W.createElement("g",{className:"recharts-cartesian-axis-ticks"},A)}},{key:"render",value:function(){var r=this,a=this.props,i=a.axisLine,o=a.width,c=a.height,d=a.ticksGenerator,f=a.className,h=a.hide;if(h)return null;var p=this.props,g=p.ticks,y=t1(p,xue),j=g;return wt(d)&&(j=g&&g.length>0?d(this.props):d(y)),o<=0||c<=0||!j||!j.length?null:W.createElement(Mt,{className:St("recharts-cartesian-axis",f),ref:function(x){r.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),Gn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=St(a.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?o=W.cloneElement(r,$n($n({},a),{},{className:c})):wt(r)?o=r($n($n({},a),{},{className:c})):o=W.createElement(Po,Il({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);KN(Lv,"displayName","CartesianAxis");KN(Lv,"defaultProps",{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"});var _ue=["type","layout","connectNulls","ref"],Pue=["key"];function wc(e){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(e)}function zI(e,t){if(e==null)return{};var n=Oue(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Oue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function id(){return id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},id.apply(this,arguments)}function UI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(n),!0).forEach(function(r){Da(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cl(e){return Iue(e)||Tue(e)||Rue(e)||kue()}function kue(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
117
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rue(e,t){if(e){if(typeof e=="string")return Kj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kj(e,t)}}function Tue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Iue(e){if(Array.isArray(e))return Kj(e)}function Kj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_4(r.key),r)}}function $ue(e,t,n){return t&&qI(e.prototype,t),n&&qI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Due(e,t,n){return t=hm(t),Lue(e,E4()?Reflect.construct(t,n||[],hm(e).constructor):t.apply(e,n))}function Lue(e,t){if(t&&(wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fue(e)}function Fue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E4=function(){return!!e})()}function hm(e){return hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hm(e)}function Bue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gj(e,t)}function Gj(e,t){return Gj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Gj(e,t)}function Da(e,t,n){return t=_4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _4(e){var t=zue(e,"string");return wc(t)=="symbol"?t:t+""}function zue(e,t){if(wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jc=(function(e){function t(){var n;Mue(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Due(this,t,[].concat(a)),Da(n,"state",{isAnimationFinished:!0,totalLength:0}),Da(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),Da(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(S,N){return S+N});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,g=c-o,y=[],j=0,w=0;j<d.length;w+=d[j],++j)if(w+d[j]>p){y=[].concat(Cl(d.slice(0,j)),[p-w]);break}var x=y.length%2===0?[0,g]:[g];return[].concat(Cl(t.repeat(d,h)),Cl(y),x).map(function(S){return"".concat(S,"px")}).join(", ")}),Da(n,"id",zc("recharts-line-")),Da(n,"pathRef",function(o){n.mainCurve=o}),Da(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Da(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Bue(t,e),$ue(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=Jr(h,yf);if(!p)return null;var g=function(w,x){return{x:w.x,y:w.y,value:w.value,errorVal:Ln(w.payload,x)}},y={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(Mt,y,p.map(function(j){return W.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var c=this.props,d=c.dot,f=c.points,h=c.dataKey,p=ht(this.props,!1),g=ht(d,!0),y=f.map(function(w,x){var S=Br(Br(Br({key:"dot-".concat(x),r:3},p),g),{},{index:x,cx:w.x,cy:w.y,value:w.value,dataKey:h,payload:w.payload,points:f});return t.renderDotItem(d,S)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return W.createElement(Mt,id({className:"recharts-line-dots",key:"dots"},j),y)}},{key:"renderCurveStatically",value:function(r,a,i,o){var c=this.props,d=c.type,f=c.layout,h=c.connectNulls;c.ref;var p=zI(c,_ue),g=Br(Br(Br({},ht(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:r},o),{},{type:d,layout:f,connectNulls:h});return W.createElement(Kh,id({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var i=this,o=this.props,c=o.points,d=o.strokeDasharray,f=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,g=o.animationEasing,y=o.animationId,j=o.animateNewValues,w=o.width,x=o.height,S=this.state,N=S.prevPoints,A=S.totalLength;return W.createElement(hs,{begin:h,duration:p,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var E=P.t;if(N){var O=N.length/c.length,k=c.map(function(L,G){var q=Math.floor(G*O);if(N[q]){var H=N[q],X=Vr(H.x,L.x),Z=Vr(H.y,L.y);return Br(Br({},L),{},{x:X(E),y:Z(E)})}if(j){var I=Vr(w*2,L.x),F=Vr(x/2,L.y);return Br(Br({},L),{},{x:I(E),y:F(E)})}return Br(Br({},L),{},{x:L.x,y:L.y})});return i.renderCurveStatically(k,r,a)}var R=Vr(0,A),D=R(E),U;if(d){var z="".concat(d).split(/[,\s]+/gim).map(function(L){return parseFloat(L)});U=i.getStrokeDasharray(D,A,z)}else U=i.generateSimpleStrokeDasharray(A,D);return i.renderCurveStatically(c,r,a,{strokeDasharray:U})})}},{key:"renderCurve",value:function(r,a){var i=this.props,o=i.points,c=i.isAnimationActive,d=this.state,f=d.prevPoints,h=d.totalLength;return c&&o&&o.length&&(!f&&h>0||!gf(f,o))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(o,r,a)}},{key:"render",value:function(){var r,a=this.props,i=a.hide,o=a.dot,c=a.points,d=a.className,f=a.xAxis,h=a.yAxis,p=a.top,g=a.left,y=a.width,j=a.height,w=a.isAnimationActive,x=a.id;if(i||!c||!c.length)return null;var S=this.state.isAnimationFinished,N=c.length===1,A=St("recharts-line",d),P=f&&f.allowDataOverflow,E=h&&h.allowDataOverflow,O=P||E,k=jt(x)?this.id:x,R=(r=ht(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},D=R.r,U=D===void 0?3:D,z=R.strokeWidth,L=z===void 0?2:z,G=kY(o)?o:{},q=G.clipDot,H=q===void 0?!0:q,X=U*2+L;return W.createElement(Mt,{className:A},P||E?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(k)},W.createElement("rect",{x:P?g:g-y/2,y:E?p:p-j/2,width:P?y:y*2,height:E?j:j*2})),!H&&W.createElement("clipPath",{id:"clipPath-dots-".concat(k)},W.createElement("rect",{x:g-X/2,y:p-X/2,width:y+X,height:j+X}))):null,!N&&this.renderCurve(O,k),this.renderErrorBar(O,k),(N||o)&&this.renderDots(O,H,k),(!w||S)&&Us.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var i=r.length%2!==0?[].concat(Cl(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(Cl(o),Cl(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(W.isValidElement(r))i=W.cloneElement(r,a);else if(wt(r))i=r(a);else{var o=a.key,c=zI(a,Pue),d=St("recharts-line-dot",typeof r!="boolean"?r.className:"");i=W.createElement(Av,id({key:o},c,{className:d}))}return i}}])})(v.PureComponent);Da(jc,"displayName","Line");Da(jc,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!zo.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Da(jc,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,a=e.xAxisTicks,i=e.yAxisTicks,o=e.dataKey,c=e.bandSize,d=e.displayedData,f=e.offset,h=t.layout,p=d.map(function(g,y){var j=Ln(g,o);return h==="horizontal"?{x:XR({axis:n,ticks:a,bandSize:c,entry:g,index:y}),y:jt(j)?null:r.scale(j),value:j,payload:g}:{x:jt(j)?null:n.scale(j),y:XR({axis:r,ticks:i,bandSize:c,entry:g,index:y}),value:j,payload:g}});return Br({points:p,layout:h},f)});function Sc(e){"@babel/helpers - typeof";return Sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sc(e)}function Uue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function que(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,k4(r.key),r)}}function Wue(e,t,n){return t&&que(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vue(e,t,n){return t=mm(t),Hue(e,P4()?Reflect.construct(t,n||[],mm(e).constructor):t.apply(e,n))}function Hue(e,t){if(t&&(Sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kue(e)}function Kue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P4=function(){return!!e})()}function mm(e){return mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mm(e)}function Gue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yj(e,t)}function Yj(e,t){return Yj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Yj(e,t)}function O4(e,t,n){return t=k4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k4(e){var t=Yue(e,"string");return Sc(t)=="symbol"?t:t+""}function Yue(e,t){if(Sc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Xj(){return Xj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xj.apply(this,arguments)}function Xue(e){var t=e.xAxisId,n=v4(),r=g4(),a=h4(t);return a==null?null:v.createElement(Lv,Xj({},a,{className:St("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return bo(o,!0)}}))}var Ro=(function(e){function t(){return Uue(this,t),Vue(this,t,arguments)}return Gue(t,e),Wue(t,[{key:"render",value:function(){return v.createElement(Xue,this.props)}}])})(v.Component);O4(Ro,"displayName","XAxis");O4(Ro,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Nc(e){"@babel/helpers - typeof";return Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}function Que(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,I4(r.key),r)}}function Zue(e,t,n){return t&&Jue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ede(e,t,n){return t=vm(t),tde(e,R4()?Reflect.construct(t,n||[],vm(e).constructor):t.apply(e,n))}function tde(e,t){if(t&&(Nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nde(e)}function nde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(R4=function(){return!!e})()}function vm(e){return vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vm(e)}function rde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qj(e,t)}function Qj(e,t){return Qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Qj(e,t)}function T4(e,t,n){return t=I4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I4(e){var t=ade(e,"string");return Nc(t)=="symbol"?t:t+""}function ade(e,t){if(Nc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Jj(){return Jj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jj.apply(this,arguments)}var sde=function(t){var n=t.yAxisId,r=v4(),a=g4(),i=m4(n);return i==null?null:v.createElement(Lv,Jj({},i,{className:St("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return bo(c,!0)}}))},To=(function(e){function t(){return Que(this,t),ede(this,t,arguments)}return rde(t,e),Zue(t,[{key:"render",value:function(){return v.createElement(sde,this.props)}}])})(v.Component);T4(To,"displayName","YAxis");T4(To,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function WI(e){return cde(e)||lde(e)||ode(e)||ide()}function ide(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
118
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ode(e,t){if(e){if(typeof e=="string")return Zj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zj(e,t)}}function lde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cde(e){if(Array.isArray(e))return Zj(e)}function Zj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var eS=function(t,n,r,a,i){var o=Jr(t,HN),c=Jr(t,Mv),d=[].concat(WI(o),WI(c)),f=Jr(t,Dv),h="".concat(a,"Id"),p=a[0],g=n;if(d.length&&(g=d.reduce(function(w,x){if(x.props[h]===r&&ds(x.props,"extendDomain")&&De(x.props[p])){var S=x.props[p];return[Math.min(w[0],S),Math.max(w[1],S)]}return w},g)),f.length){var y="".concat(p,"1"),j="".concat(p,"2");g=f.reduce(function(w,x){if(x.props[h]===r&&ds(x.props,"extendDomain")&&De(x.props[y])&&De(x.props[j])){var S=x.props[y],N=x.props[j];return[Math.min(w[0],S,N),Math.max(w[1],S,N)]}return w},g)}return i&&i.length&&(g=i.reduce(function(w,x){return De(x)?[Math.min(w[0],x),Math.max(w[1],x)]:w},g)),g},n1={exports:{}},VI;function ude(){return VI||(VI=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(d,f,h){this.fn=d,this.context=f,this.once=h||!1}function i(d,f,h,p,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var y=new a(h,p||d,g),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],y]:d._events[j].push(y):(d._events[j]=y,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},c.prototype.listeners=function(f){var h=n?n+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var g=0,y=p.length,j=new Array(y);g<y;g++)j[g]=p[g].fn;return j},c.prototype.listenerCount=function(f){var h=n?n+f:f,p=this._events[h];return p?p.fn?1:p.length:0},c.prototype.emit=function(f,h,p,g,y,j){var w=n?n+f:f;if(!this._events[w])return!1;var x=this._events[w],S=arguments.length,N,A;if(x.fn){switch(x.once&&this.removeListener(f,x.fn,void 0,!0),S){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,h),!0;case 3:return x.fn.call(x.context,h,p),!0;case 4:return x.fn.call(x.context,h,p,g),!0;case 5:return x.fn.call(x.context,h,p,g,y),!0;case 6:return x.fn.call(x.context,h,p,g,y,j),!0}for(A=1,N=new Array(S-1);A<S;A++)N[A-1]=arguments[A];x.fn.apply(x.context,N)}else{var P=x.length,E;for(A=0;A<P;A++)switch(x[A].once&&this.removeListener(f,x[A].fn,void 0,!0),S){case 1:x[A].fn.call(x[A].context);break;case 2:x[A].fn.call(x[A].context,h);break;case 3:x[A].fn.call(x[A].context,h,p);break;case 4:x[A].fn.call(x[A].context,h,p,g);break;default:if(!N)for(E=1,N=new Array(S-1);E<S;E++)N[E-1]=arguments[E];x[A].fn.apply(x[A].context,N)}}return!0},c.prototype.on=function(f,h,p){return i(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return i(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,g){var y=n?n+f:f;if(!this._events[y])return this;if(!h)return o(this,y),this;var j=this._events[y];if(j.fn)j.fn===h&&(!g||j.once)&&(!p||j.context===p)&&o(this,y);else{for(var w=0,x=[],S=j.length;w<S;w++)(j[w].fn!==h||g&&!j[w].once||p&&j[w].context!==p)&&x.push(j[w]);x.length?this._events[y]=x.length===1?x[0]:x:o(this,y)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(n1)),n1.exports}var dde=ude();const fde=Yt(dde);var r1=new fde,a1="recharts.syncMouseEvents";function Gd(e){"@babel/helpers - typeof";return Gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gd(e)}function pde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,M4(r.key),r)}}function mde(e,t,n){return t&&hde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s1(e,t,n){return t=M4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M4(e){var t=vde(e,"string");return Gd(t)=="symbol"?t:t+""}function vde(e,t){if(Gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var gde=(function(){function e(){pde(this,e),s1(this,"activeIndex",0),s1(this,"coordinateList",[]),s1(this,"layout","horizontal")}return mde(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,i=a===void 0?null:a,o=n.container,c=o===void 0?null:o,d=n.layout,f=d===void 0?null:d,h=n.offset,p=h===void 0?null:h,g=n.mouseHandlerCallback,y=g===void 0?null:g;this.coordinateList=(r=i??this.coordinateList)!==null&&r!==void 0?r:[],this.container=c??this.container,this.layout=f??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=y??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,c=a.height,d=this.coordinateList[this.activeIndex].coordinate,f=((n=window)===null||n===void 0?void 0:n.scrollX)||0,h=((r=window)===null||r===void 0?void 0:r.scrollY)||0,p=i+d+f,g=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:g})}}}])})();function yde(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&De(r)&&De(a))return!0}return!1}function xde(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function $4(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=on(t,n,r,a),c=on(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function bde(e,t,n){var r,a,i,o;if(e==="horizontal")r=t.x,i=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var c=t.cx,d=t.cy,f=t.innerRadius,h=t.outerRadius,p=t.angle,g=on(c,d,f,p),y=on(c,d,h,p);r=g.x,a=g.y,i=y.x,o=y.y}else return $4(t);return[{x:r,y:a},{x:i,y:o}]}function Yd(e){"@babel/helpers - typeof";return Yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yd(e)}function HI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Xp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HI(Object(n),!0).forEach(function(r){wde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wde(e,t,n){return t=jde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jde(e){var t=Sde(e,"string");return Yd(t)=="symbol"?t:t+""}function Sde(e,t){if(Yd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nde(e){var t,n,r=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,c=e.activePayload,d=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,g=e.chartName,y=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!y||!i||!o||g!=="ScatterChart"&&a!=="axis")return null;var j,w=Kh;if(g==="ScatterChart")j=o,w=ooe;else if(g==="BarChart")j=xde(p,o,d,h),w=qN;else if(p==="radial"){var x=$4(o),S=x.cx,N=x.cy,A=x.radius,P=x.startAngle,E=x.endAngle;j={cx:S,cy:N,startAngle:P,endAngle:E,innerRadius:A,outerRadius:A},w=$L}else j={points:bde(p,o,d)},w=Kh;var O=Xp(Xp(Xp(Xp({stroke:"#ccc",pointerEvents:"none"},d),j),ht(y,!1)),{},{payload:c,payloadIndex:f,className:St("recharts-tooltip-cursor",y.className)});return v.isValidElement(y)?v.cloneElement(y,O):v.createElement(w,O)}var Cde=["item"],Ade=["children","className","width","height","style","compact","title","desc"];function Cc(e){"@babel/helpers - typeof";return Cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cc(e)}function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ml.apply(this,arguments)}function KI(e,t){return Pde(e)||_de(e,t)||L4(e,t)||Ede()}function Ede(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
119
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _de(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Pde(e){if(Array.isArray(e))return e}function GI(e,t){if(e==null)return{};var n=Ode(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ode(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function kde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,F4(r.key),r)}}function Tde(e,t,n){return t&&Rde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ide(e,t,n){return t=gm(t),Mde(e,D4()?Reflect.construct(t,n||[],gm(e).constructor):t.apply(e,n))}function Mde(e,t){if(t&&(Cc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $de(e)}function $de(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D4=function(){return!!e})()}function gm(e){return gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gm(e)}function Dde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tS(e,t)}function tS(e,t){return tS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},tS(e,t)}function Ac(e){return Bde(e)||Fde(e)||L4(e)||Lde()}function Lde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
120
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L4(e,t){if(e){if(typeof e=="string")return nS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nS(e,t)}}function Fde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bde(e){if(Array.isArray(e))return nS(e)}function nS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function YI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YI(Object(n),!0).forEach(function(r){mt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mt(e,t,n){return t=F4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F4(e){var t=zde(e,"string");return Cc(t)=="symbol"?t:t+""}function zde(e,t){if(Cc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ude={xAxis:["bottom","top"],yAxis:["left","right"]},qde={width:"100%",height:"100%"},B4={x:0,y:0};function Qp(e){return e}var Wde=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Vde=function(t,n,r,a){var i=n.find(function(h){return h&&h.index===r});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,c=a.radius;return we(we(we({},a),on(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return we(we(we({},a),on(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return B4},Fv=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,i=n.dataEndIndex,o=(r??[]).reduce(function(c,d){var f=d.props.data;return f&&f.length?[].concat(Ac(c),Ac(f)):c},[]);return o.length>0?o:t&&t.length&&De(a)&&De(i)?t.slice(a,i+1):[]};function z4(e){return e==="number"?[0,"auto"]:void 0}var rS=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=Fv(n,t);return r<0||!i||!i.length||r>=c.length?null:i.reduce(function(d,f){var h,p=(h=f.props.data)!==null&&h!==void 0?h:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(o.dataKey&&!o.allowDuplicatedCategory){var y=p===void 0?c:p;g=yh(y,o.dataKey,a)}else g=p&&p[r]||c[r];return g?[].concat(Ac(d),[OL(f,g)]):d},[])},XI=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=Wde(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=_re(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,g=rS(t,n,h,p),y=Vde(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:g,activeCoordinate:y}}return null},Hde=function(t,n){var r=n.axes,a=n.graphicalItems,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,g=t.stackOffset,y=CL(h,i);return r.reduce(function(j,w){var x,S=w.type.defaultProps!==void 0?we(we({},w.type.defaultProps),w.props):w.props,N=S.type,A=S.dataKey,P=S.allowDataOverflow,E=S.allowDuplicatedCategory,O=S.scale,k=S.ticks,R=S.includeHidden,D=S[o];if(j[D])return j;var U=Fv(t.data,{graphicalItems:a.filter(function($){var ee,V=o in $.props?$.props[o]:(ee=$.type.defaultProps)===null||ee===void 0?void 0:ee[o];return V===D}),dataStartIndex:d,dataEndIndex:f}),z=U.length,L,G,q;yde(S.domain,P,N)&&(L=gj(S.domain,null,P),y&&(N==="number"||O!=="auto")&&(q=nd(U,A,"category")));var H=z4(N);if(!L||L.length===0){var X,Z=(X=S.domain)!==null&&X!==void 0?X:H;if(A){if(L=nd(U,A,N),N==="category"&&y){var I=wY(L);E&&I?(G=L,L=am(0,z)):E||(L=eT(Z,L,w).reduce(function($,ee){return $.indexOf(ee)>=0?$:[].concat(Ac($),[ee])},[]))}else if(N==="category")E?L=L.filter(function($){return $!==""&&!jt($)}):L=eT(Z,L,w).reduce(function($,ee){return $.indexOf(ee)>=0||ee===""||jt(ee)?$:[].concat(Ac($),[ee])},[]);else if(N==="number"){var F=Tre(U,a.filter(function($){var ee,V,J=o in $.props?$.props[o]:(ee=$.type.defaultProps)===null||ee===void 0?void 0:ee[o],ge="hide"in $.props?$.props.hide:(V=$.type.defaultProps)===null||V===void 0?void 0:V.hide;return J===D&&(R||!ge)}),A,i,h);F&&(L=F)}y&&(N==="number"||O!=="auto")&&(q=nd(U,A,"category"))}else y?L=am(0,z):c&&c[D]&&c[D].hasStack&&N==="number"?L=g==="expand"?[0,1]:PL(c[D].stackGroups,d,f):L=NL(U,a.filter(function($){var ee=o in $.props?$.props[o]:$.type.defaultProps[o],V="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return ee===D&&(R||!V)}),N,h,!0);if(N==="number")L=eS(p,L,D,i,k),Z&&(L=gj(Z,L,P));else if(N==="category"&&Z){var Q=Z,B=L.every(function($){return Q.indexOf($)>=0});B&&(L=Q)}}return we(we({},j),{},mt({},D,we(we({},S),{},{axisType:i,domain:L,categoricalDomain:q,duplicateDomain:G,originalDomain:(x=S.domain)!==null&&x!==void 0?x:H,isCategorical:y,layout:h})))},{})},Kde=function(t,n){var r=n.graphicalItems,a=n.Axis,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,g=Fv(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),y=g.length,j=CL(h,i),w=-1;return r.reduce(function(x,S){var N=S.type.defaultProps!==void 0?we(we({},S.type.defaultProps),S.props):S.props,A=N[o],P=z4("number");if(!x[A]){w++;var E;return j?E=am(0,y):c&&c[A]&&c[A].hasStack?(E=PL(c[A].stackGroups,d,f),E=eS(p,E,A,i)):(E=gj(P,NL(g,r.filter(function(O){var k,R,D=o in O.props?O.props[o]:(k=O.type.defaultProps)===null||k===void 0?void 0:k[o],U="hide"in O.props?O.props.hide:(R=O.type.defaultProps)===null||R===void 0?void 0:R.hide;return D===A&&!U}),"number",h),a.defaultProps.allowDataOverflow),E=eS(p,E,A,i)),we(we({},x),{},mt({},A,we(we({axisType:i},a.defaultProps),{},{hide:!0,orientation:Qr(Ude,"".concat(i,".").concat(w%2),null),domain:E,originalDomain:P,isCategorical:j,layout:h})))}return x},{})},Gde=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,i=n.AxisComp,o=n.graphicalItems,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.children,p="".concat(a,"Id"),g=Jr(h,i),y={};return g&&g.length?y=Hde(t,{axes:g,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(y=Kde(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),y},Yde=function(t){var n=_l(t),r=bo(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:vN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Wh(n,r)}},QI=function(t){var n=t.children,r=t.defaultShowTooltip,a=Ur(n,mc),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},Xde=function(t){return!t||!t.length?!1:t.some(function(n){var r=Fs(n&&n.type);return r&&r.indexOf("Bar")>=0})},JI=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Qde=function(t,n){var r=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,c=t.yAxisMap,d=c===void 0?{}:c,f=r.width,h=r.height,p=r.children,g=r.margin||{},y=Ur(p,mc),j=Ur(p,ql),w=Object.keys(d).reduce(function(E,O){var k=d[O],R=k.orientation;return!k.mirror&&!k.hide?we(we({},E),{},mt({},R,E[R]+k.width)):E},{left:g.left||0,right:g.right||0}),x=Object.keys(o).reduce(function(E,O){var k=o[O],R=k.orientation;return!k.mirror&&!k.hide?we(we({},E),{},mt({},R,Qr(E,"".concat(R))+k.height)):E},{top:g.top||0,bottom:g.bottom||0}),S=we(we({},x),w),N=S.bottom;y&&(S.bottom+=y.props.height||mc.defaultProps.height),j&&n&&(S=kre(S,a,r,n));var A=f-S.left-S.right,P=h-S.top-S.bottom;return we(we({brushBottom:N},S),{},{width:Math.max(A,0),height:Math.max(P,0)})},Jde=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},GN=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,c=o===void 0?["axis"]:o,d=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,g=function(S,N){var A=N.graphicalItems,P=N.stackGroups,E=N.offset,O=N.updateId,k=N.dataStartIndex,R=N.dataEndIndex,D=S.barSize,U=S.layout,z=S.barGap,L=S.barCategoryGap,G=S.maxBarSize,q=JI(U),H=q.numericAxisName,X=q.cateAxisName,Z=Xde(A),I=[];return A.forEach(function(F,Q){var B=Fv(S.data,{graphicalItems:[F],dataStartIndex:k,dataEndIndex:R}),$=F.type.defaultProps!==void 0?we(we({},F.type.defaultProps),F.props):F.props,ee=$.dataKey,V=$.maxBarSize,J=$["".concat(H,"Id")],ge=$["".concat(X,"Id")],ie={},ce=d.reduce(function($e,et){var xt=N["".concat(et.axisType,"Map")],Jt=$["".concat(et.axisType,"Id")];xt&&xt[Jt]||et.axisType==="zAxis"||ko();var ye=xt[Jt];return we(we({},$e),{},mt(mt({},et.axisType,ye),"".concat(et.axisType,"Ticks"),bo(ye)))},ie),oe=ce[X],xe=ce["".concat(X,"Ticks")],ke=P&&P[J]&&P[J].hasStack&&Ure(F,P[J].stackGroups),pe=Fs(F.type).indexOf("Bar")>=0,ve=Wh(oe,xe),Ce=[],Le=Z&&Pre({barSize:D,stackGroups:P,totalSize:Jde(ce,X)});if(pe){var se,de,Ne=jt(V)?G:V,Fe=(se=(de=Wh(oe,xe,!0))!==null&&de!==void 0?de:Ne)!==null&&se!==void 0?se:0;Ce=Ore({barGap:z,barCategoryGap:L,bandSize:Fe!==ve?Fe:ve,sizeList:Le[ge],maxBarSize:Ne}),Fe!==ve&&(Ce=Ce.map(function($e){return we(we({},$e),{},{position:we(we({},$e.position),{},{offset:$e.position.offset-Fe/2})})}))}var je=F&&F.type&&F.type.getComposedData;je&&I.push({props:we(we({},je(we(we({},ce),{},{displayedData:B,props:S,dataKey:ee,item:F,bandSize:ve,barPosition:Ce,offset:E,stackedData:ke,layout:U,dataStartIndex:k,dataEndIndex:R}))),{},mt(mt(mt({key:F.key||"item-".concat(Q)},H,ce[H]),X,ce[X]),"animationId",O)),childIndex:IY(F,S.children),item:F})}),I},y=function(S,N){var A=S.props,P=S.dataStartIndex,E=S.dataEndIndex,O=S.updateId;if(!hO({props:A}))return null;var k=A.children,R=A.layout,D=A.stackOffset,U=A.data,z=A.reverseStackOrder,L=JI(R),G=L.numericAxisName,q=L.cateAxisName,H=Jr(k,r),X=Bre(U,H,"".concat(G,"Id"),"".concat(q,"Id"),D,z),Z=d.reduce(function($,ee){var V="".concat(ee.axisType,"Map");return we(we({},$),{},mt({},V,Gde(A,we(we({},ee),{},{graphicalItems:H,stackGroups:ee.axisType===G&&X,dataStartIndex:P,dataEndIndex:E}))))},{}),I=Qde(we(we({},Z),{},{props:A,graphicalItems:H}),N?.legendBBox);Object.keys(Z).forEach(function($){Z[$]=h(A,Z[$],I,$.replace("Map",""),n)});var F=Z["".concat(q,"Map")],Q=Yde(F),B=g(A,we(we({},Z),{},{dataStartIndex:P,dataEndIndex:E,updateId:O,graphicalItems:H,stackGroups:X,offset:I}));return we(we({formattedGraphicalItems:B,graphicalItems:H,offset:I,stackGroups:X},Q),Z)},j=(function(x){function S(N){var A,P,E;return kde(this,S),E=Ide(this,S,[N]),mt(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),mt(E,"accessibilityManager",new gde),mt(E,"handleLegendBBoxUpdate",function(O){if(O){var k=E.state,R=k.dataStartIndex,D=k.dataEndIndex,U=k.updateId;E.setState(we({legendBBox:O},y({props:E.props,dataStartIndex:R,dataEndIndex:D,updateId:U},we(we({},E.state),{},{legendBBox:O}))))}}),mt(E,"handleReceiveSyncEvent",function(O,k,R){if(E.props.syncId===O){if(R===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(k)}}),mt(E,"handleBrushChange",function(O){var k=O.startIndex,R=O.endIndex;if(k!==E.state.dataStartIndex||R!==E.state.dataEndIndex){var D=E.state.updateId;E.setState(function(){return we({dataStartIndex:k,dataEndIndex:R},y({props:E.props,dataStartIndex:k,dataEndIndex:R,updateId:D},E.state))}),E.triggerSyncEvent({dataStartIndex:k,dataEndIndex:R})}}),mt(E,"handleMouseEnter",function(O){var k=E.getMouseInfo(O);if(k){var R=we(we({},k),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var D=E.props.onMouseEnter;wt(D)&&D(R,O)}}),mt(E,"triggeredAfterMouseMove",function(O){var k=E.getMouseInfo(O),R=k?we(we({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(R),E.triggerSyncEvent(R);var D=E.props.onMouseMove;wt(D)&&D(R,O)}),mt(E,"handleItemMouseEnter",function(O){E.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),mt(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),mt(E,"handleMouseMove",function(O){O.persist(),E.throttleTriggeredAfterMouseMove(O)}),mt(E,"handleMouseLeave",function(O){E.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};E.setState(k),E.triggerSyncEvent(k);var R=E.props.onMouseLeave;wt(R)&&R(k,O)}),mt(E,"handleOuterEvent",function(O){var k=TY(O),R=Qr(E.props,"".concat(k));if(k&&wt(R)){var D,U;/.*touch.*/i.test(k)?U=E.getMouseInfo(O.changedTouches[0]):U=E.getMouseInfo(O),R((D=U)!==null&&D!==void 0?D:{},O)}}),mt(E,"handleClick",function(O){var k=E.getMouseInfo(O);if(k){var R=we(we({},k),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var D=E.props.onClick;wt(D)&&D(R,O)}}),mt(E,"handleMouseDown",function(O){var k=E.props.onMouseDown;if(wt(k)){var R=E.getMouseInfo(O);k(R,O)}}),mt(E,"handleMouseUp",function(O){var k=E.props.onMouseUp;if(wt(k)){var R=E.getMouseInfo(O);k(R,O)}}),mt(E,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),mt(E,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&E.handleMouseDown(O.changedTouches[0])}),mt(E,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&E.handleMouseUp(O.changedTouches[0])}),mt(E,"handleDoubleClick",function(O){var k=E.props.onDoubleClick;if(wt(k)){var R=E.getMouseInfo(O);k(R,O)}}),mt(E,"handleContextMenu",function(O){var k=E.props.onContextMenu;if(wt(k)){var R=E.getMouseInfo(O);k(R,O)}}),mt(E,"triggerSyncEvent",function(O){E.props.syncId!==void 0&&r1.emit(a1,E.props.syncId,O,E.eventEmitterSymbol)}),mt(E,"applySyncEvent",function(O){var k=E.props,R=k.layout,D=k.syncMethod,U=E.state.updateId,z=O.dataStartIndex,L=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)E.setState(we({dataStartIndex:z,dataEndIndex:L},y({props:E.props,dataStartIndex:z,dataEndIndex:L,updateId:U},E.state)));else if(O.activeTooltipIndex!==void 0){var G=O.chartX,q=O.chartY,H=O.activeTooltipIndex,X=E.state,Z=X.offset,I=X.tooltipTicks;if(!Z)return;if(typeof D=="function")H=D(I,O);else if(D==="value"){H=-1;for(var F=0;F<I.length;F++)if(I[F].value===O.activeLabel){H=F;break}}var Q=we(we({},Z),{},{x:Z.left,y:Z.top}),B=Math.min(G,Q.x+Q.width),$=Math.min(q,Q.y+Q.height),ee=I[H]&&I[H].value,V=rS(E.state,E.props.data,H),J=I[H]?{x:R==="horizontal"?I[H].coordinate:B,y:R==="horizontal"?$:I[H].coordinate}:B4;E.setState(we(we({},O),{},{activeLabel:ee,activeCoordinate:J,activePayload:V,activeTooltipIndex:H}))}else E.setState(O)}),mt(E,"renderCursor",function(O){var k,R=E.state,D=R.isTooltipActive,U=R.activeCoordinate,z=R.activePayload,L=R.offset,G=R.activeTooltipIndex,q=R.tooltipAxisBandSize,H=E.getTooltipEventType(),X=(k=O.props.active)!==null&&k!==void 0?k:D,Z=E.props.layout,I=O.key||"_recharts-cursor";return W.createElement(Nde,{key:I,activeCoordinate:U,activePayload:z,activeTooltipIndex:G,chartName:n,element:O,isActive:X,layout:Z,offset:L,tooltipAxisBandSize:q,tooltipEventType:H})}),mt(E,"renderPolarAxis",function(O,k,R){var D=Qr(O,"type.axisType"),U=Qr(E.state,"".concat(D,"Map")),z=O.type.defaultProps,L=z!==void 0?we(we({},z),O.props):O.props,G=U&&U[L["".concat(D,"Id")]];return v.cloneElement(O,we(we({},G),{},{className:St(D,G.className),key:O.key||"".concat(k,"-").concat(R),ticks:bo(G,!0)}))}),mt(E,"renderPolarGrid",function(O){var k=O.props,R=k.radialLines,D=k.polarAngles,U=k.polarRadius,z=E.state,L=z.radiusAxisMap,G=z.angleAxisMap,q=_l(L),H=_l(G),X=H.cx,Z=H.cy,I=H.innerRadius,F=H.outerRadius;return v.cloneElement(O,{polarAngles:Array.isArray(D)?D:bo(H,!0).map(function(Q){return Q.coordinate}),polarRadius:Array.isArray(U)?U:bo(q,!0).map(function(Q){return Q.coordinate}),cx:X,cy:Z,innerRadius:I,outerRadius:F,key:O.key||"polar-grid",radialLines:R})}),mt(E,"renderLegend",function(){var O=E.state.formattedGraphicalItems,k=E.props,R=k.children,D=k.width,U=k.height,z=E.props.margin||{},L=D-(z.left||0)-(z.right||0),G=jL({children:R,formattedGraphicalItems:O,legendWidth:L,legendContent:f});if(!G)return null;var q=G.item,H=GI(G,Cde);return v.cloneElement(q,we(we({},H),{},{chartWidth:D,chartHeight:U,margin:z,onBBoxUpdate:E.handleLegendBBoxUpdate}))}),mt(E,"renderTooltip",function(){var O,k=E.props,R=k.children,D=k.accessibilityLayer,U=Ur(R,qr);if(!U)return null;var z=E.state,L=z.isTooltipActive,G=z.activeCoordinate,q=z.activePayload,H=z.activeLabel,X=z.offset,Z=(O=U.props.active)!==null&&O!==void 0?O:L;return v.cloneElement(U,{viewBox:we(we({},X),{},{x:X.left,y:X.top}),active:Z,label:H,payload:Z?q:[],coordinate:G,accessibilityLayer:D})}),mt(E,"renderBrush",function(O){var k=E.props,R=k.margin,D=k.data,U=E.state,z=U.offset,L=U.dataStartIndex,G=U.dataEndIndex,q=U.updateId;return v.cloneElement(O,{key:O.key||"_recharts-brush",onChange:Hp(E.handleBrushChange,O.props.onChange),data:D,x:De(O.props.x)?O.props.x:z.left,y:De(O.props.y)?O.props.y:z.top+z.height+z.brushBottom-(R.bottom||0),width:De(O.props.width)?O.props.width:z.width,startIndex:L,endIndex:G,updateId:"brush-".concat(q)})}),mt(E,"renderReferenceElement",function(O,k,R){if(!O)return null;var D=E,U=D.clipPathId,z=E.state,L=z.xAxisMap,G=z.yAxisMap,q=z.offset,H=O.type.defaultProps||{},X=O.props,Z=X.xAxisId,I=Z===void 0?H.xAxisId:Z,F=X.yAxisId,Q=F===void 0?H.yAxisId:F;return v.cloneElement(O,{key:O.key||"".concat(k,"-").concat(R),xAxis:L[I],yAxis:G[Q],viewBox:{x:q.left,y:q.top,width:q.width,height:q.height},clipPathId:U})}),mt(E,"renderActivePoints",function(O){var k=O.item,R=O.activePoint,D=O.basePoint,U=O.childIndex,z=O.isRange,L=[],G=k.props.key,q=k.item.type.defaultProps!==void 0?we(we({},k.item.type.defaultProps),k.item.props):k.item.props,H=q.activeDot,X=q.dataKey,Z=we(we({index:U,dataKey:X,cx:R.x,cy:R.y,r:4,fill:UN(k.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},ht(H,!1)),xh(H));return L.push(S.renderActiveDot(H,Z,"".concat(G,"-activePoint-").concat(U))),D?L.push(S.renderActiveDot(H,we(we({},Z),{},{cx:D.x,cy:D.y}),"".concat(G,"-basePoint-").concat(U))):z&&L.push(null),L}),mt(E,"renderGraphicChild",function(O,k,R){var D=E.filterFormatItem(O,k,R);if(!D)return null;var U=E.getTooltipEventType(),z=E.state,L=z.isTooltipActive,G=z.tooltipAxis,q=z.activeTooltipIndex,H=z.activeLabel,X=E.props.children,Z=Ur(X,qr),I=D.props,F=I.points,Q=I.isRange,B=I.baseLine,$=D.item.type.defaultProps!==void 0?we(we({},D.item.type.defaultProps),D.item.props):D.item.props,ee=$.activeDot,V=$.hide,J=$.activeBar,ge=$.activeShape,ie=!!(!V&&L&&Z&&(ee||J||ge)),ce={};U!=="axis"&&Z&&Z.props.trigger==="click"?ce={onClick:Hp(E.handleItemMouseEnter,O.props.onClick)}:U!=="axis"&&(ce={onMouseLeave:Hp(E.handleItemMouseLeave,O.props.onMouseLeave),onMouseEnter:Hp(E.handleItemMouseEnter,O.props.onMouseEnter)});var oe=v.cloneElement(O,we(we({},D.props),ce));function xe(et){return typeof G.dataKey=="function"?G.dataKey(et.payload):null}if(ie)if(q>=0){var ke,pe;if(G.dataKey&&!G.allowDuplicatedCategory){var ve=typeof G.dataKey=="function"?xe:"payload.".concat(G.dataKey.toString());ke=yh(F,ve,H),pe=Q&&B&&yh(B,ve,H)}else ke=F?.[q],pe=Q&&B&&B[q];if(ge||J){var Ce=O.props.activeIndex!==void 0?O.props.activeIndex:q;return[v.cloneElement(O,we(we(we({},D.props),ce),{},{activeIndex:Ce})),null,null]}if(!jt(ke))return[oe].concat(Ac(E.renderActivePoints({item:D,activePoint:ke,basePoint:pe,childIndex:q,isRange:Q})))}else{var Le,se=(Le=E.getItemByXY(E.state.activeCoordinate))!==null&&Le!==void 0?Le:{graphicalItem:oe},de=se.graphicalItem,Ne=de.item,Fe=Ne===void 0?O:Ne,je=de.childIndex,$e=we(we(we({},D.props),ce),{},{activeIndex:je});return[v.cloneElement(Fe,$e),null,null]}return Q?[oe,null,null]:[oe,null]}),mt(E,"renderCustomized",function(O,k,R){return v.cloneElement(O,we(we({key:"recharts-customized-".concat(R)},E.props),E.state))}),mt(E,"renderMap",{CartesianGrid:{handler:Qp,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Qp},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Qp},YAxis:{handler:Qp},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((A=N.id)!==null&&A!==void 0?A:zc("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=j5(E.triggeredAfterMouseMove,(P=N.throttleDelay)!==null&&P!==void 0?P:1e3/60),E.state={},E}return Dde(S,x),Tde(S,[{key:"componentDidMount",value:function(){var A,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var A=this.props,P=A.children,E=A.data,O=A.height,k=A.layout,R=Ur(P,qr);if(R){var D=R.props.defaultIndex;if(!(typeof D!="number"||D<0||D>this.state.tooltipTicks.length-1)){var U=this.state.tooltipTicks[D]&&this.state.tooltipTicks[D].value,z=rS(this.state,E,D,U),L=this.state.tooltipTicks[D].coordinate,G=(this.state.offset.top+O)/2,q=k==="horizontal",H=q?{x:L,y:G}:{y:L,x:G},X=this.state.formattedGraphicalItems.find(function(I){var F=I.item;return F.type.name==="Scatter"});X&&(H=we(we({},H),X.props.points[D].tooltipPosition),z=X.props.points[D].tooltipPayload);var Z={activeTooltipIndex:D,isTooltipActive:!0,activeLabel:U,activePayload:z,activeCoordinate:H};this.setState(Z),this.renderCursor(R),this.accessibilityManager.setIndex(D)}}}},{key:"getSnapshotBeforeUpdate",value:function(A,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==A.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==A.margin){var E,O;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(A){L1([Ur(A.children,qr)],[Ur(this.props.children,qr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var A=Ur(this.props.children,qr);if(A&&typeof A.props.shared=="boolean"){var P=A.props.shared?"axis":"item";return c.indexOf(P)>=0?P:i}return i}},{key:"getMouseInfo",value:function(A){if(!this.container)return null;var P=this.container,E=P.getBoundingClientRect(),O=bZ(E),k={chartX:Math.round(A.pageX-O.left),chartY:Math.round(A.pageY-O.top)},R=E.width/P.offsetWidth||1,D=this.inRange(k.chartX,k.chartY,R);if(!D)return null;var U=this.state,z=U.xAxisMap,L=U.yAxisMap,G=this.getTooltipEventType(),q=XI(this.state,this.props.data,this.props.layout,D);if(G!=="axis"&&z&&L){var H=_l(z).scale,X=_l(L).scale,Z=H&&H.invert?H.invert(k.chartX):null,I=X&&X.invert?X.invert(k.chartY):null;return we(we({},k),{},{xValue:Z,yValue:I},q)}return q?we(we({},k),q):null}},{key:"inRange",value:function(A,P){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,k=A/E,R=P/E;if(O==="horizontal"||O==="vertical"){var D=this.state.offset,U=k>=D.left&&k<=D.left+D.width&&R>=D.top&&R<=D.top+D.height;return U?{x:k,y:R}:null}var z=this.state,L=z.angleAxisMap,G=z.radiusAxisMap;if(L&&G){var q=_l(L);return rT({x:k,y:R},q)}return null}},{key:"parseEventsOfWrapper",value:function(){var A=this.props.children,P=this.getTooltipEventType(),E=Ur(A,qr),O={};E&&P==="axis"&&(E.props.trigger==="click"?O={onClick:this.handleClick}:O={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var k=xh(this.props,this.handleOuterEvent);return we(we({},k),O)}},{key:"addListener",value:function(){r1.on(a1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){r1.removeListener(a1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(A,P,E){for(var O=this.state.formattedGraphicalItems,k=0,R=O.length;k<R;k++){var D=O[k];if(D.item===A||D.props.key===A.key||P===Fs(D.item.type)&&E===D.childIndex)return D}return null}},{key:"renderClipPath",value:function(){var A=this.clipPathId,P=this.state.offset,E=P.left,O=P.top,k=P.height,R=P.width;return W.createElement("defs",null,W.createElement("clipPath",{id:A},W.createElement("rect",{x:E,y:O,height:k,width:R})))}},{key:"getXScales",value:function(){var A=this.state.xAxisMap;return A?Object.entries(A).reduce(function(P,E){var O=KI(E,2),k=O[0],R=O[1];return we(we({},P),{},mt({},k,R.scale))},{}):null}},{key:"getYScales",value:function(){var A=this.state.yAxisMap;return A?Object.entries(A).reduce(function(P,E){var O=KI(E,2),k=O[0],R=O[1];return we(we({},P),{},mt({},k,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(A){var P;return(P=this.state.xAxisMap)===null||P===void 0||(P=P[A])===null||P===void 0?void 0:P.scale}},{key:"getYScaleByAxisId",value:function(A){var P;return(P=this.state.yAxisMap)===null||P===void 0||(P=P[A])===null||P===void 0?void 0:P.scale}},{key:"getItemByXY",value:function(A){var P=this.state,E=P.formattedGraphicalItems,O=P.activeItem;if(E&&E.length)for(var k=0,R=E.length;k<R;k++){var D=E[k],U=D.props,z=D.item,L=z.type.defaultProps!==void 0?we(we({},z.type.defaultProps),z.props):z.props,G=Fs(z.type);if(G==="Bar"){var q=(U.data||[]).find(function(I){return zie(A,I)});if(q)return{graphicalItem:D,payload:q}}else if(G==="RadialBar"){var H=(U.data||[]).find(function(I){return rT(A,I)});if(H)return{graphicalItem:D,payload:H}}else if(kv(D,O)||Rv(D,O)||qd(D,O)){var X=ule({graphicalItem:D,activeTooltipItem:O,itemData:L.data}),Z=L.activeIndex===void 0?X:L.activeIndex;return{graphicalItem:we(we({},D),{},{childIndex:Z}),payload:qd(D,O)?L.data[X]:D.props.data[X]}}}return null}},{key:"render",value:function(){var A=this;if(!hO(this))return null;var P=this.props,E=P.children,O=P.className,k=P.width,R=P.height,D=P.style,U=P.compact,z=P.title,L=P.desc,G=GI(P,Ade),q=ht(G,!1);if(U)return W.createElement(OI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement(B1,Ml({},q,{width:k,height:R,title:z,desc:L}),this.renderClipPath(),vO(E,this.renderMap)));if(this.props.accessibilityLayer){var H,X;q.tabIndex=(H=this.props.tabIndex)!==null&&H!==void 0?H:0,q.role=(X=this.props.role)!==null&&X!==void 0?X:"application",q.onKeyDown=function(I){A.accessibilityManager.keyboardEvent(I)},q.onFocus=function(){A.accessibilityManager.focus()}}var Z=this.parseEventsOfWrapper();return W.createElement(OI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement("div",Ml({className:St("recharts-wrapper",O),style:we({position:"relative",cursor:"default",width:k,height:R},D)},Z,{ref:function(F){A.container=F}}),W.createElement(B1,Ml({},q,{width:k,height:R,title:z,desc:L,style:qde}),this.renderClipPath(),vO(E,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);mt(j,"displayName",n),mt(j,"defaultProps",we({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),mt(j,"getDerivedStateFromProps",function(x,S){var N=x.dataKey,A=x.data,P=x.children,E=x.width,O=x.height,k=x.layout,R=x.stackOffset,D=x.margin,U=S.dataStartIndex,z=S.dataEndIndex;if(S.updateId===void 0){var L=QI(x);return we(we(we({},L),{},{updateId:0},y(we(we({props:x},L),{},{updateId:0}),S)),{},{prevDataKey:N,prevData:A,prevWidth:E,prevHeight:O,prevLayout:k,prevStackOffset:R,prevMargin:D,prevChildren:P})}if(N!==S.prevDataKey||A!==S.prevData||E!==S.prevWidth||O!==S.prevHeight||k!==S.prevLayout||R!==S.prevStackOffset||!Ul(D,S.prevMargin)){var G=QI(x),q={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},H=we(we({},XI(S,A,k)),{},{updateId:S.updateId+1}),X=we(we(we({},G),q),H);return we(we(we({},X),y(we({props:x},X),S)),{},{prevDataKey:N,prevData:A,prevWidth:E,prevHeight:O,prevLayout:k,prevStackOffset:R,prevMargin:D,prevChildren:P})}if(!L1(P,S.prevChildren)){var Z,I,F,Q,B=Ur(P,mc),$=B&&(Z=(I=B.props)===null||I===void 0?void 0:I.startIndex)!==null&&Z!==void 0?Z:U,ee=B&&(F=(Q=B.props)===null||Q===void 0?void 0:Q.endIndex)!==null&&F!==void 0?F:z,V=$!==U||ee!==z,J=!jt(A),ge=J&&!V?S.updateId:S.updateId+1;return we(we({updateId:ge},y(we(we({props:x},S),{},{updateId:ge,dataStartIndex:$,dataEndIndex:ee}),S)),{},{prevChildren:P,dataStartIndex:$,dataEndIndex:ee})}return null}),mt(j,"renderActiveDot",function(x,S,N){var A;return v.isValidElement(x)?A=v.cloneElement(x,S):wt(x)?A=x(S):A=W.createElement(Av,S),W.createElement(Mt,{className:"recharts-active-dot",key:N},A)});var w=v.forwardRef(function(S,N){return W.createElement(j,Ml({},S,{ref:N}))});return w.displayName=j.displayName,w},ZI=GN({chartName:"LineChart",GraphicalChild:jc,axisComponents:[{axisType:"xAxis",AxisComp:Ro},{axisType:"yAxis",AxisComp:To}],formatAxisMap:s4}),Zde=GN({chartName:"BarChart",GraphicalChild:Vo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ro},{axisType:"yAxis",AxisComp:To}],formatAxisMap:s4}),efe=GN({chartName:"PieChart",GraphicalChild:Zs,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Ov},{axisType:"radiusAxis",AxisComp:_v}],formatAxisMap:Jre,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const tfe=()=>{const{configs:e}=cf(),{source:t}=An(),[n,r]=v.useState([]),[a,i]=v.useState("timestamp"),[o,c]=v.useState("desc"),d=x=>{if(a===x){c(S=>S==="asc"?"desc":"asc");return}i(x),c("desc")};v.useEffect(()=>{let x=!0;return t.listResults().then(S=>{x&&r(S)}),()=>{x=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((x,S)=>x+S.overallPassRate,0)/h,g=h===0?0:Math.round(n.reduce((x,S)=>x+S.avgLatency,0)/h),y=v.useMemo(()=>[...n].sort((S,N)=>{let A=0;return a==="timestamp"&&(A=new Date(S.timestamp).getTime()-new Date(N.timestamp).getTime()),a==="passRate"&&(A=S.overallPassRate-N.overallPassRate),a==="latency"&&(A=S.avgLatency-N.avgLatency),a==="scenarios"&&(A=S.totalScenarios-N.totalScenarios),o==="asc"?A:-A}),[n,a,o]),j=[...y].reverse().map(x=>({date:new Date(x.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(x.overallPassRate*100),latency:x.avgLatency})),w=x=>{const S=Array.from(new Set(x.scenarios.map(E=>E.scenarioId).filter(Boolean))),N=Array.from(new Set(x.scenarios.map(E=>E.agentName).filter(Boolean))),A=S.slice(0,2).join(", "),P=S.length>2?` +${S.length-2}`:"";return{scenarioCount:S.length,agentCount:N.length,scenarioPreview:A?`${A}${P}`:"n/a"}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(l$,{className:"h-6 w-6"}),"Dashboard"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Overview of your MCP evaluation runs"})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(ae,{asChild:!0,children:s.jsxs(yt,{to:"/mcp-evaluations/new",children:[s.jsx(ES,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(ae,{variant:"outline",asChild:!0,children:s.jsxs(yt,{to:"/run",children:[s.jsx(Ll,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(ae,{variant:"outline",asChild:!0,children:s.jsxs(yt,{to:"/results",children:[s.jsx(ld,{className:"mr-2 h-4 w-4"}),"Browse Results"]})})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(Is,{title:"MCP Evaluations",value:f,icon:g1,subtitle:`${f} active`}),s.jsx(Is,{title:"Total Runs",value:h,icon:r$,subtitle:"Last 30 days"}),s.jsx(Is,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:ld,subtitle:"+5% from last week",trend:"up"}),s.jsx(Is,{title:"Avg Latency",value:`${g}ms`,icon:p$,subtitle:"-120ms from last week",trend:"up"})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(Ue,{children:s.jsx(ej,{width:"100%",height:200,children:s.jsxs(ZI,{data:j,children:[s.jsx(Ro,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(To,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:x=>`${x}%`}),s.jsx(qr,{formatter:x=>[`${x}%`,"Pass Rate"]}),s.jsx(jc,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(Ue,{children:s.jsx(ej,{width:"100%",height:200,children:s.jsxs(ZI,{data:j,children:[s.jsx(Ro,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(To,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(qr,{formatter:x=>[`${x}ms`,"Latency"]}),s.jsx(jc,{type:"monotone",dataKey:"latency",stroke:"hsl(200, 80%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(200, 80%, 50%)"}})]})})})]})]}),s.jsx("div",{className:"grid gap-6",children:s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Recent Runs"})}),s.jsx(Ue,{className:"p-0",children:s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Run ID"}),s.jsx(nt,{children:"Evaluated"}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("timestamp"),children:["Timestamp",a==="timestamp"?o==="asc"?s.jsx(Fa,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}):s.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("passRate"),children:["Pass Rate",a==="passRate"?o==="asc"?s.jsx(Fa,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}):s.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(nt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("scenarios"),children:["Scenarios",a==="scenarios"?o==="asc"?s.jsx(Fa,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}):s.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(Yr,{children:y.map(x=>s.jsxs(zt,{className:"cursor-pointer",children:[s.jsx(He,{children:s.jsx(yt,{to:`/results/${x.id}`,className:"font-mono text-xs text-primary hover:underline",children:x.id})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=w(x);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",S.scenarioCount," scenario",S.scenarioCount===1?"":"s"," · ",S.agentCount," agent",S.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:S.scenarioPreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Pm,{className:"h-3 w-3"}),new Date(x.timestamp).toLocaleString()]})}),s.jsx(He,{children:s.jsx(wo,{rate:x.overallPassRate})}),s.jsx(He,{className:"text-right font-mono text-sm",children:x.totalScenarios})]},x.id))})]})})]})})]})};var nfe=v.createContext(void 0);function Hc(e){const t=v.useContext(nfe);return e||t||"ltr"}var i1="rovingFocusGroup.onEntryFocus",rfe={bubbles:!1,cancelable:!0},xf="RovingFocusGroup",[aS,U4,afe]=Zd(xf),[sfe,Bv]=er(xf,[afe]),[ife,ofe]=sfe(xf),q4=v.forwardRef((e,t)=>s.jsx(aS.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(aS.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(lfe,{...e,ref:t})})}));q4.displayName=xf;var lfe=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,g=v.useRef(null),y=pt(t,g),j=Hc(i),[w,x]=Zr({prop:o,defaultProp:c??null,onChange:d,caller:xf}),[S,N]=v.useState(!1),A=Cn(f),P=U4(n),E=v.useRef(!1),[O,k]=v.useState(0);return v.useEffect(()=>{const R=g.current;if(R)return R.addEventListener(i1,A),()=>R.removeEventListener(i1,A)},[A]),s.jsx(ife,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:w,onItemFocus:v.useCallback(R=>x(R),[x]),onItemShiftTab:v.useCallback(()=>N(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(R=>R+1),[]),onFocusableItemRemove:v.useCallback(()=>k(R=>R-1),[]),children:s.jsx(qe.div,{tabIndex:S||O===0?-1:0,"data-orientation":r,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{E.current=!0}),onFocus:Pe(e.onFocus,R=>{const D=!E.current;if(R.target===R.currentTarget&&D&&!S){const U=new CustomEvent(i1,rfe);if(R.currentTarget.dispatchEvent(U),!U.defaultPrevented){const z=P().filter(X=>X.focusable),L=z.find(X=>X.active),G=z.find(X=>X.id===w),H=[L,G,...z].filter(Boolean).map(X=>X.ref.current);H4(H,h)}}E.current=!1}),onBlur:Pe(e.onBlur,()=>N(!1))})})}),W4="RovingFocusGroupItem",V4=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=Bn(),f=i||d,h=ofe(W4,n),p=h.currentTabStopId===f,g=U4(n),{onFocusableItemAdd:y,onFocusableItemRemove:j,currentTabStopId:w}=h;return v.useEffect(()=>{if(r)return y(),()=>j()},[r,y,j]),s.jsx(aS.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(qe.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Pe(e.onMouseDown,x=>{r?h.onItemFocus(f):x.preventDefault()}),onFocus:Pe(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Pe(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){h.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=dfe(x,h.orientation,h.dir);if(S!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let A=g().filter(P=>P.focusable).map(P=>P.ref.current);if(S==="last")A.reverse();else if(S==="prev"||S==="next"){S==="prev"&&A.reverse();const P=A.indexOf(x.currentTarget);A=h.loop?ffe(A,P+1):A.slice(P+1)}setTimeout(()=>H4(A))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:w!=null}):o})})});V4.displayName=W4;var cfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ufe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dfe(e,t,n){const r=ufe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cfe[r]}function H4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ffe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var K4=q4,G4=V4;function pfe(e){const t=hfe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(vfe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function hfe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=yfe(a),c=gfe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mfe=Symbol("radix.slottable");function vfe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mfe}function gfe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function yfe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sS=["Enter"," "],xfe=["ArrowDown","PageUp","Home"],Y4=["ArrowUp","PageDown","End"],bfe=[...xfe,...Y4],wfe={ltr:[...sS,"ArrowRight"],rtl:[...sS,"ArrowLeft"]},jfe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bf="Menu",[Xd,Sfe,Nfe]=Zd(bf),[Ho,X4]=er(bf,[Nfe,Fi,Bv]),zv=Fi(),Q4=Bv(),[Cfe,Ko]=Ho(bf),[Afe,wf]=Ho(bf),J4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=zv(t),[d,f]=v.useState(null),h=v.useRef(!1),p=Cn(i),g=Hc(a);return v.useEffect(()=>{const y=()=>{h.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>h.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(Dm,{...c,children:s.jsx(Cfe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Afe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:g,modal:o,children:r})})})};J4.displayName=bf;var Efe="MenuAnchor",YN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=zv(n);return s.jsx(nf,{...a,...r,ref:t})});YN.displayName=Efe;var XN="MenuPortal",[_fe,Z4]=Ho(XN,{forceMount:void 0}),eF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Ko(XN,t);return s.jsx(_fe,{scope:t,forceMount:n,children:s.jsx(Un,{present:n||i.open,children:s.jsx(Oc,{asChild:!0,container:a,children:r})})})};eF.displayName=XN;var va="MenuContent",[Pfe,QN]=Ho(va),tF=v.forwardRef((e,t)=>{const n=Z4(va,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Ko(va,e.__scopeMenu),o=wf(va,e.__scopeMenu);return s.jsx(Xd.Provider,{scope:e.__scopeMenu,children:s.jsx(Un,{present:r||i.open,children:s.jsx(Xd.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Ofe,{...a,ref:t}):s.jsx(kfe,{...a,ref:t})})})})}),Ofe=v.forwardRef((e,t)=>{const n=Ko(va,e.__scopeMenu),r=v.useRef(null),a=pt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return Qm(i)},[]),s.jsx(JN,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),kfe=v.forwardRef((e,t)=>{const n=Ko(va,e.__scopeMenu);return s.jsx(JN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Rfe=pfe("MenuContent.ScrollLock"),JN=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:y,disableOutsideScroll:j,...w}=e,x=Ko(va,n),S=wf(va,n),N=zv(n),A=Q4(n),P=Sfe(n),[E,O]=v.useState(null),k=v.useRef(null),R=pt(t,k,x.onContentChange),D=v.useRef(0),U=v.useRef(""),z=v.useRef(0),L=v.useRef(null),G=v.useRef("right"),q=v.useRef(0),H=j?af:v.Fragment,X=j?{as:Rfe,allowPinchZoom:!0}:void 0,Z=F=>{const Q=U.current+F,B=P().filter(ie=>!ie.disabled),$=document.activeElement,ee=B.find(ie=>ie.ref.current===$)?.textValue,V=B.map(ie=>ie.textValue),J=Wfe(V,Q,ee),ge=B.find(ie=>ie.textValue===J)?.ref.current;(function ie(ce){U.current=ce,window.clearTimeout(D.current),ce!==""&&(D.current=window.setTimeout(()=>ie(""),1e3))})(Q),ge&&setTimeout(()=>ge.focus())};v.useEffect(()=>()=>window.clearTimeout(D.current),[]),Ym();const I=v.useCallback(F=>G.current===L.current?.side&&Hfe(F,L.current?.area),[]);return s.jsx(Pfe,{scope:n,searchRef:U,onItemEnter:v.useCallback(F=>{I(F)&&F.preventDefault()},[I]),onItemLeave:v.useCallback(F=>{I(F)||(k.current?.focus(),O(null))},[I]),onTriggerLeave:v.useCallback(F=>{I(F)&&F.preventDefault()},[I]),pointerGraceTimerRef:z,onPointerGraceIntentChange:v.useCallback(F=>{L.current=F},[]),children:s.jsx(H,{...X,children:s.jsx(rf,{asChild:!0,trapped:a,onMountAutoFocus:Pe(i,F=>{F.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Do,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:y,children:s.jsx(K4,{asChild:!0,...A,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:O,onEntryFocus:Pe(d,F=>{S.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Lm,{role:"menu","aria-orientation":"vertical","data-state":gF(x.open),"data-radix-menu-content":"",dir:S.dir,...N,...w,ref:R,style:{outline:"none",...w.style},onKeyDown:Pe(w.onKeyDown,F=>{const B=F.target.closest("[data-radix-menu-content]")===F.currentTarget,$=F.ctrlKey||F.altKey||F.metaKey,ee=F.key.length===1;B&&(F.key==="Tab"&&F.preventDefault(),!$&&ee&&Z(F.key));const V=k.current;if(F.target!==V||!bfe.includes(F.key))return;F.preventDefault();const ge=P().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);Y4.includes(F.key)&&ge.reverse(),Ufe(ge)}),onBlur:Pe(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(D.current),U.current="")}),onPointerMove:Pe(e.onPointerMove,Qd(F=>{const Q=F.target,B=q.current!==F.clientX;if(F.currentTarget.contains(Q)&&B){const $=F.clientX>q.current?"right":"left";G.current=$,q.current=F.clientX}}))})})})})})})});tF.displayName=va;var Tfe="MenuGroup",ZN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(qe.div,{role:"group",...r,ref:t})});ZN.displayName=Tfe;var Ife="MenuLabel",nF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});nF.displayName=Ife;var ym="MenuItem",eM="menu.itemSelect",Uv=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=wf(ym,e.__scopeMenu),c=QN(ym,e.__scopeMenu),d=pt(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const g=new CustomEvent(eM,{bubbles:!0,cancelable:!0});p.addEventListener(eM,y=>r?.(y),{once:!0}),wS(p,g),g.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(rF,{...a,ref:d,disabled:n,onClick:Pe(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Pe(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Pe(e.onKeyDown,p=>{const g=c.searchRef.current!=="";n||g&&p.key===" "||sS.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Uv.displayName=ym;var rF=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=QN(ym,n),c=Q4(n),d=v.useRef(null),f=pt(t,d),[h,p]=v.useState(!1),[g,y]=v.useState("");return v.useEffect(()=>{const j=d.current;j&&y((j.textContent??"").trim())},[i.children]),s.jsx(Xd.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:s.jsx(G4,{asChild:!0,...c,focusable:!r,children:s.jsx(qe.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Pe(e.onPointerMove,Qd(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,Qd(j=>o.onItemLeave(j))),onFocus:Pe(e.onFocus,()=>p(!0)),onBlur:Pe(e.onBlur,()=>p(!1))})})})}),Mfe="MenuCheckboxItem",aF=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(cF,{scope:e.__scopeMenu,checked:n,children:s.jsx(Uv,{role:"menuitemcheckbox","aria-checked":xm(n)?"mixed":n,...a,ref:t,"data-state":tC(n),onSelect:Pe(a.onSelect,()=>r?.(xm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});aF.displayName=Mfe;var sF="MenuRadioGroup",[$fe,Dfe]=Ho(sF,{value:void 0,onValueChange:()=>{}}),iF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Cn(r);return s.jsx($fe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(ZN,{...a,ref:t})})});iF.displayName=sF;var oF="MenuRadioItem",lF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=Dfe(oF,e.__scopeMenu),i=n===a.value;return s.jsx(cF,{scope:e.__scopeMenu,checked:i,children:s.jsx(Uv,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":tC(i),onSelect:Pe(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});lF.displayName=oF;var eC="MenuItemIndicator",[cF,Lfe]=Ho(eC,{checked:!1}),uF=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=Lfe(eC,n);return s.jsx(Un,{present:r||xm(i.checked)||i.checked===!0,children:s.jsx(qe.span,{...a,ref:t,"data-state":tC(i.checked)})})});uF.displayName=eC;var Ffe="MenuSeparator",dF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(qe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});dF.displayName=Ffe;var Bfe="MenuArrow",fF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=zv(n);return s.jsx(Fm,{...a,...r,ref:t})});fF.displayName=Bfe;var zfe="MenuSub",[kge,pF]=Ho(zfe),Xu="MenuSubTrigger",hF=v.forwardRef((e,t)=>{const n=Ko(Xu,e.__scopeMenu),r=wf(Xu,e.__scopeMenu),a=pF(Xu,e.__scopeMenu),i=QN(Xu,e.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},h=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>h,[h]),v.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),s.jsx(YN,{asChild:!0,...f,children:s.jsx(rF,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":gF(n.open),...e,ref:vr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,Qd(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Pe(e.onPointerLeave,Qd(p=>{h();const g=n.content?.getBoundingClientRect();if(g){const y=n.content?.dataset.side,j=y==="right",w=j?-5:5,x=g[j?"left":"right"],S=g[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+w,y:p.clientY},{x,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,p=>{const g=i.searchRef.current!=="";e.disabled||g&&p.key===" "||wfe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});hF.displayName=Xu;var mF="MenuSubContent",vF=v.forwardRef((e,t)=>{const n=Z4(va,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Ko(va,e.__scopeMenu),o=wf(va,e.__scopeMenu),c=pF(mF,e.__scopeMenu),d=v.useRef(null),f=pt(t,d);return s.jsx(Xd.Provider,{scope:e.__scopeMenu,children:s.jsx(Un,{present:r||i.open,children:s.jsx(Xd.Slot,{scope:e.__scopeMenu,children:s.jsx(JN,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:f,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{o.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Pe(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),g=jfe[o.dir].includes(h.key);p&&g&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});vF.displayName=mF;function gF(e){return e?"open":"closed"}function xm(e){return e==="indeterminate"}function tC(e){return xm(e)?"indeterminate":e?"checked":"unchecked"}function Ufe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function qfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Wfe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=qfe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Vfe(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(a=!a)}return a}function Hfe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Vfe(n,t)}function Qd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Kfe=J4,Gfe=YN,Yfe=eF,Xfe=tF,Qfe=ZN,Jfe=nF,Zfe=Uv,epe=aF,tpe=iF,npe=lF,rpe=uF,ape=dF,spe=fF,ipe=hF,ope=vF,qv="DropdownMenu",[lpe]=er(qv,[X4]),gr=X4(),[cpe,yF]=lpe(qv),xF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=gr(t),f=v.useRef(null),[h,p]=Zr({prop:a,defaultProp:i??!1,onChange:o,caller:qv});return s.jsx(cpe,{scope:t,triggerId:Bn(),triggerRef:f,contentId:Bn(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(g=>!g),[p]),modal:c,children:s.jsx(Kfe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};xF.displayName=qv;var bF="DropdownMenuTrigger",wF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=yF(bF,n),o=gr(n);return s.jsx(Gfe,{asChild:!0,...o,children:s.jsx(qe.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:vr(t,i.triggerRef),onPointerDown:Pe(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Pe(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});wF.displayName=bF;var upe="DropdownMenuPortal",jF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=gr(t);return s.jsx(Yfe,{...r,...n})};jF.displayName=upe;var SF="DropdownMenuContent",NF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=yF(SF,n),i=gr(n),o=v.useRef(!1);return s.jsx(Xfe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Pe(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!a.modal||h)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});NF.displayName=SF;var dpe="DropdownMenuGroup",fpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(Qfe,{...a,...r,ref:t})});fpe.displayName=dpe;var ppe="DropdownMenuLabel",CF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(Jfe,{...a,...r,ref:t})});CF.displayName=ppe;var hpe="DropdownMenuItem",AF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(Zfe,{...a,...r,ref:t})});AF.displayName=hpe;var mpe="DropdownMenuCheckboxItem",EF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(epe,{...a,...r,ref:t})});EF.displayName=mpe;var vpe="DropdownMenuRadioGroup",gpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(tpe,{...a,...r,ref:t})});gpe.displayName=vpe;var ype="DropdownMenuRadioItem",_F=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(npe,{...a,...r,ref:t})});_F.displayName=ype;var xpe="DropdownMenuItemIndicator",PF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(rpe,{...a,...r,ref:t})});PF.displayName=xpe;var bpe="DropdownMenuSeparator",OF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(ape,{...a,...r,ref:t})});OF.displayName=bpe;var wpe="DropdownMenuArrow",jpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(spe,{...a,...r,ref:t})});jpe.displayName=wpe;var Spe="DropdownMenuSubTrigger",kF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(ipe,{...a,...r,ref:t})});kF.displayName=Spe;var Npe="DropdownMenuSubContent",RF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(ope,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});RF.displayName=Npe;var Cpe=xF,Ape=wF,Epe=jF,TF=NF,IF=CF,MF=AF,$F=EF,DF=_F,LF=PF,FF=OF,BF=kF,zF=RF;const Kc=Cpe,Gc=Ape,_pe=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(BF,{ref:a,className:Se("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,s.jsx(a$,{className:"ml-auto h-4 w-4"})]}));_pe.displayName=BF.displayName;const Ppe=v.forwardRef(({className:e,...t},n)=>s.jsx(zF,{ref:n,className:Se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Ppe.displayName=zF.displayName;const Go=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Epe,{children:s.jsx(TF,{ref:r,sideOffset:t,className:Se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Go.displayName=TF.displayName;const cr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(MF,{ref:r,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));cr.displayName=MF.displayName;const Ope=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs($F,{ref:a,className:Se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(LF,{children:s.jsx(Ql,{className:"h-4 w-4"})})}),t]}));Ope.displayName=$F.displayName;const kpe=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(DF,{ref:r,className:Se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(LF,{children:s.jsx(OU,{className:"h-2 w-2 fill-current"})})}),t]}));kpe.displayName=DF.displayName;const nC=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(IF,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));nC.displayName=IF.displayName;const rC=v.forwardRef(({className:e,...t},n)=>s.jsx(FF,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));rC.displayName=FF.displayName;const qu=e=>e.configName?.trim()||e.name,Rpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=cf(),i=ya(),[o,c]=v.useState("name"),[d,f]=v.useState("asc"),h=S=>{if(o===S){f(N=>N==="asc"?"desc":"asc");return}c(S),f(S==="updatedAt"?"desc":"asc")};v.useEffect(()=>{a();const S=()=>{a()};return window.addEventListener("focus",S),()=>{window.removeEventListener("focus",S)}},[a]);const p=async(S,N)=>{await t(S),Oe({title:"Deleted",description:`"${N}" has been removed.`})},g=async S=>{const N=await n(S);Oe({title:"Cloned",description:`Created "${qu(N)}".`}),i(`/mcp-evaluations/${N.id}`)},y=S=>S.agentEntries?.length??S.agents?.length??0,j=S=>S.scenarioEntries?.length??S.scenarios?.length??0,w=v.useMemo(()=>[...e].sort((N,A)=>{let P=0;return o==="name"&&(P=qu(N).localeCompare(qu(A))),o==="scenarios"&&(P=j(N)-j(A)),o==="agents"&&(P=y(N)-y(A)),o==="updatedAt"&&(P=new Date(N.updatedAt).getTime()-new Date(A.updatedAt).getTime()),d==="asc"?P:-P}),[e,o,d]),x=S=>o!==S?s.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(Fa,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(o$,{className:"h-6 w-6"}),"MCP Evaluations"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your MCP evaluation suites"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ae,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(za,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ae,{variant:"outline",size:"sm",children:[s.jsx(DU,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(ae,{size:"sm",asChild:!0,children:s.jsxs(yt,{to:"/mcp-evaluations/new",children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("name"),children:["Name",x("name")]})}),s.jsx(nt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("scenarios"),children:["Scenarios",x("scenarios")]})}),s.jsx(nt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("agents"),children:["Agents",x("agents")]})}),s.jsx(nt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("updatedAt"),children:["Last Updated",x("updatedAt")]})}),s.jsx(nt,{className:"w-10"})]})}),s.jsxs(Yr,{children:[w.map(S=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsxs("div",{children:[s.jsx(yt,{to:`/mcp-evaluations/${S.id}`,className:"font-medium text-sm hover:text-primary",children:qu(S)}),S.loadError&&s.jsxs(Ke,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(nh,{className:"mr-1 h-3 w-3"}),"Broken"]}),S.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:S.description}),S.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:S.loadError})]})}),s.jsx(He,{className:"text-right font-mono text-sm",children:j(S)}),s.jsx(He,{className:"text-right font-mono text-sm",children:y(S)}),s.jsx(He,{className:"text-right text-xs text-muted-foreground",children:new Date(S.updatedAt).toLocaleDateString()}),s.jsx(He,{children:s.jsxs(Kc,{children:[s.jsx(Gc,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Go,{align:"end",children:[s.jsxs(cr,{onClick:()=>i(`/mcp-evaluations/${S.id}`),children:[s.jsx(km,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(cr,{onClick:()=>{g(S.id)},children:[s.jsx(Ii,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(cr,{children:[s.jsx(ma,{className:"mr-2 h-3.5 w-3.5"}),"Download YAML"]}),s.jsxs(cr,{className:"text-destructive",onClick:()=>{p(S.id,qu(S))},children:[s.jsx(_r,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},S.id)),!r&&e.length===0&&s.jsx(zt,{children:s.jsx(He,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),r&&s.jsx(zt,{children:s.jsx(He,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Tpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ipe=Tpe.reduce((e,t)=>{const n=Gm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Mpe="Label",UF=v.forwardRef((e,t)=>s.jsx(Ipe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));UF.displayName=Mpe;var qF=UF;const $pe=Lo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Te=v.forwardRef(({className:e,...t},n)=>s.jsx(qF,{ref:n,className:Se($pe(),e),...t}));Te.displayName=qF.displayName;const Gs=v.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:Se("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Gs.displayName="Textarea";function Wv(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Vv="Switch",[Dpe]=er(Vv),[Lpe,Fpe]=Dpe(Vv),WF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:o,disabled:c,value:d="on",onCheckedChange:f,form:h,...p}=e,[g,y]=v.useState(null),j=pt(t,A=>y(A)),w=v.useRef(!1),x=g?h||!!g.closest("form"):!0,[S,N]=Zr({prop:a,defaultProp:i??!1,onChange:f,caller:Vv});return s.jsxs(Lpe,{scope:n,checked:S,disabled:c,children:[s.jsx(qe.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":GF(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Pe(e.onClick,A=>{N(P=>!P),x&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})}),x&&s.jsx(KF,{control:g,bubbles:!w.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});WF.displayName=Vv;var VF="SwitchThumb",HF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Fpe(VF,n);return s.jsx(qe.span,{"data-state":GF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});HF.displayName=VF;var Bpe="SwitchBubbleInput",KF=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=pt(o,i),d=Wv(n),f=$m(t);return v.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&y){const j=new Event("click",{bubbles:r});y.call(h,n),h.dispatchEvent(j)}},[d,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});KF.displayName=Bpe;function GF(e){return e?"checked":"unchecked"}var YF=WF,zpe=HF;const bm=v.forwardRef(({className:e,...t},n)=>s.jsx(YF,{className:Se("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:s.jsx(zpe,{className:Se("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));bm.displayName=YF.displayName;var Hv="Tabs",[Upe]=er(Hv,[Bv]),XF=Bv(),[qpe,aC]=Upe(Hv),QF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=Hc(c),[p,g]=Zr({prop:r,onChange:a,defaultProp:i??"",caller:Hv});return s.jsx(qpe,{scope:n,baseId:Bn(),value:p,onValueChange:g,orientation:o,dir:h,activationMode:d,children:s.jsx(qe.div,{dir:h,"data-orientation":o,...f,ref:t})})});QF.displayName=Hv;var JF="TabsList",ZF=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=aC(JF,n),o=XF(n);return s.jsx(K4,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(qe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});ZF.displayName=JF;var eB="TabsTrigger",tB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=aC(eB,n),c=XF(n),d=aB(o.baseId,r),f=sB(o.baseId,r),h=r===o.value;return s.jsx(G4,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(qe.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...i,ref:t,onMouseDown:Pe(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Pe(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Pe(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});tB.displayName=eB;var nB="TabsContent",rB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=aC(nB,n),d=aB(c.baseId,r),f=sB(c.baseId,r),h=r===c.value,p=v.useRef(h);return v.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(Un,{present:a||h,children:({present:g})=>s.jsx(qe.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&i})})});rB.displayName=nB;function aB(e,t){return`${e}-trigger-${t}`}function sB(e,t){return`${e}-content-${t}`}var Wpe=QF,iB=ZF,oB=tB,lB=rB;const sC=Wpe,Kv=v.forwardRef(({className:e,...t},n)=>s.jsx(iB,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Kv.displayName=iB.displayName;const Ri=v.forwardRef(({className:e,...t},n)=>s.jsx(oB,{ref:n,className:Se("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Ri.displayName=oB.displayName;const Hl=v.forwardRef(({className:e,...t},n)=>s.jsx(lB,{ref:n,className:Se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Hl.displayName=lB.displayName;const tM={openai:"bg-emerald-100 text-emerald-800",anthropic:"bg-orange-100 text-orange-800",azure:"bg-blue-100 text-blue-800",google:"bg-yellow-100 text-yellow-800",custom:"bg-gray-100 text-gray-800"};function cB({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${tM[e]??tM.custom}`,children:e})}function Jd(e,[t,n]){return Math.min(n,Math.max(t,e))}function Vpe(e){const t=Hpe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Gpe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Hpe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Xpe(a),c=Ype(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kpe=Symbol("radix.slottable");function Gpe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kpe}function Ype(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Xpe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qpe=[" ","Enter","ArrowUp","ArrowDown"],Jpe=[" ","Enter"],Io="Select",[Gv,Yv,Zpe]=Zd(Io),[Yc]=er(Io,[Zpe,Fi]),Xv=Fi(),[ehe,Vi]=Yc(Io),[the,nhe]=Yc(Io),uB=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:o,defaultValue:c,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:g,required:y,form:j}=e,w=Xv(t),[x,S]=v.useState(null),[N,A]=v.useState(null),[P,E]=v.useState(!1),O=Hc(f),[k,R]=Zr({prop:r,defaultProp:a??!1,onChange:i,caller:Io}),[D,U]=Zr({prop:o,defaultProp:c,onChange:d,caller:Io}),z=v.useRef(null),L=x?j||!!x.closest("form"):!0,[G,q]=v.useState(new Set),H=Array.from(G).map(X=>X.props.value).join(";");return s.jsx(Dm,{...w,children:s.jsxs(ehe,{required:y,scope:t,trigger:x,onTriggerChange:S,valueNode:N,onValueNodeChange:A,valueNodeHasChildren:P,onValueNodeHasChildrenChange:E,contentId:Bn(),value:D,onValueChange:U,open:k,onOpenChange:R,dir:O,triggerPointerDownPosRef:z,disabled:g,children:[s.jsx(Gv.Provider,{scope:t,children:s.jsx(the,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(X=>{q(Z=>new Set(Z).add(X))},[]),onNativeOptionRemove:v.useCallback(X=>{q(Z=>{const I=new Set(Z);return I.delete(X),I})},[]),children:n})}),L?s.jsxs(IB,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:p,value:D,onChange:X=>U(X.target.value),disabled:g,form:j,children:[D===void 0?s.jsx("option",{value:""}):null,Array.from(G)]},H):null]})})};uB.displayName=Io;var dB="SelectTrigger",fB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Xv(n),o=Vi(dB,n),c=o.disabled||r,d=pt(t,o.onTriggerChange),f=Yv(n),h=v.useRef("touch"),[p,g,y]=$B(w=>{const x=f().filter(A=>!A.disabled),S=x.find(A=>A.value===o.value),N=DB(x,w,S);N!==void 0&&o.onValueChange(N.value)}),j=w=>{c||(o.onOpenChange(!0),y()),w&&(o.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return s.jsx(nf,{asChild:!0,...i,children:s.jsx(qe.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":MB(o.value)?"":void 0,...a,ref:d,onClick:Pe(a.onClick,w=>{w.currentTarget.focus(),h.current!=="mouse"&&j(w)}),onPointerDown:Pe(a.onPointerDown,w=>{h.current=w.pointerType;const x=w.target;x.hasPointerCapture(w.pointerId)&&x.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(j(w),w.preventDefault())}),onKeyDown:Pe(a.onKeyDown,w=>{const x=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(x&&w.key===" ")&&Qpe.includes(w.key)&&(j(),w.preventDefault())})})})});fB.displayName=dB;var pB="SelectValue",hB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=Vi(pB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=pt(t,d.onValueNodeChange);return zn(()=>{f(h)},[f,h]),s.jsx(qe.span,{...c,ref:p,style:{pointerEvents:"none"},children:MB(d.value)?s.jsx(s.Fragment,{children:o}):i})});hB.displayName=pB;var rhe="SelectIcon",mB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(qe.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});mB.displayName=rhe;var ahe="SelectPortal",vB=e=>s.jsx(Oc,{asChild:!0,...e});vB.displayName=ahe;var Mo="SelectContent",gB=v.forwardRef((e,t)=>{const n=Vi(Mo,e.__scopeSelect),[r,a]=v.useState();if(zn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?Pc.createPortal(s.jsx(yB,{scope:e.__scopeSelect,children:s.jsx(Gv.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(xB,{...e,ref:t})});gB.displayName=Mo;var Ia=10,[yB,Hi]=Yc(Mo),she="SelectContentImpl",ihe=Vpe("SelectContent.RemoveScroll"),xB=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:j,hideWhenDetached:w,avoidCollisions:x,...S}=e,N=Vi(Mo,n),[A,P]=v.useState(null),[E,O]=v.useState(null),k=pt(t,ie=>P(ie)),[R,D]=v.useState(null),[U,z]=v.useState(null),L=Yv(n),[G,q]=v.useState(!1),H=v.useRef(!1);v.useEffect(()=>{if(A)return Qm(A)},[A]),Ym();const X=v.useCallback(ie=>{const[ce,...oe]=L().map(pe=>pe.ref.current),[xe]=oe.slice(-1),ke=document.activeElement;for(const pe of ie)if(pe===ke||(pe?.scrollIntoView({block:"nearest"}),pe===ce&&E&&(E.scrollTop=0),pe===xe&&E&&(E.scrollTop=E.scrollHeight),pe?.focus(),document.activeElement!==ke))return},[L,E]),Z=v.useCallback(()=>X([R,A]),[X,R,A]);v.useEffect(()=>{G&&Z()},[G,Z]);const{onOpenChange:I,triggerPointerDownPosRef:F}=N;v.useEffect(()=>{if(A){let ie={x:0,y:0};const ce=xe=>{ie={x:Math.abs(Math.round(xe.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(F.current?.y??0))}},oe=xe=>{ie.x<=10&&ie.y<=10?xe.preventDefault():A.contains(xe.target)||I(!1),document.removeEventListener("pointermove",ce),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",oe,{capture:!0})}}},[A,I,F]),v.useEffect(()=>{const ie=()=>I(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[I]);const[Q,B]=$B(ie=>{const ce=L().filter(ke=>!ke.disabled),oe=ce.find(ke=>ke.ref.current===document.activeElement),xe=DB(ce,ie,oe);xe&&setTimeout(()=>xe.ref.current.focus())}),$=v.useCallback((ie,ce,oe)=>{const xe=!H.current&&!oe;(N.value!==void 0&&N.value===ce||xe)&&(D(ie),xe&&(H.current=!0))},[N.value]),ee=v.useCallback(()=>A?.focus(),[A]),V=v.useCallback((ie,ce,oe)=>{const xe=!H.current&&!oe;(N.value!==void 0&&N.value===ce||xe)&&z(ie)},[N.value]),J=r==="popper"?iS:bB,ge=J===iS?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:j,hideWhenDetached:w,avoidCollisions:x}:{};return s.jsx(yB,{scope:n,content:A,viewport:E,onViewportChange:O,itemRefCallback:$,selectedItem:R,onItemLeave:ee,itemTextRefCallback:V,focusSelectedItem:Z,selectedItemText:U,position:r,isPositioned:G,searchRef:Q,children:s.jsx(af,{as:ihe,allowPinchZoom:!0,children:s.jsx(rf,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Pe(a,ie=>{N.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:s.jsx(Do,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(J,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...S,...ge,onPlaced:()=>q(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Pe(S.onKeyDown,ie=>{const ce=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!ce&&ie.key.length===1&&B(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let xe=L().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const ke=ie.target,pe=xe.indexOf(ke);xe=xe.slice(pe+1)}setTimeout(()=>X(xe)),ie.preventDefault()}})})})})})})});xB.displayName=she;var ohe="SelectItemAlignedPosition",bB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Vi(Mo,n),o=Hi(Mo,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=pt(t,k=>h(k)),g=Yv(n),y=v.useRef(!1),j=v.useRef(!0),{viewport:w,selectedItem:x,selectedItemText:S,focusSelectedItem:N}=o,A=v.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&w&&x&&S){const k=i.trigger.getBoundingClientRect(),R=f.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),U=S.getBoundingClientRect();if(i.dir!=="rtl"){const ke=U.left-R.left,pe=D.left-ke,ve=k.left-pe,Ce=k.width+ve,Le=Math.max(Ce,R.width),se=window.innerWidth-Ia,de=Jd(pe,[Ia,Math.max(Ia,se-Le)]);c.style.minWidth=Ce+"px",c.style.left=de+"px"}else{const ke=R.right-U.right,pe=window.innerWidth-D.right-ke,ve=window.innerWidth-k.right-pe,Ce=k.width+ve,Le=Math.max(Ce,R.width),se=window.innerWidth-Ia,de=Jd(pe,[Ia,Math.max(Ia,se-Le)]);c.style.minWidth=Ce+"px",c.style.right=de+"px"}const z=g(),L=window.innerHeight-Ia*2,G=w.scrollHeight,q=window.getComputedStyle(f),H=parseInt(q.borderTopWidth,10),X=parseInt(q.paddingTop,10),Z=parseInt(q.borderBottomWidth,10),I=parseInt(q.paddingBottom,10),F=H+X+G+I+Z,Q=Math.min(x.offsetHeight*5,F),B=window.getComputedStyle(w),$=parseInt(B.paddingTop,10),ee=parseInt(B.paddingBottom,10),V=k.top+k.height/2-Ia,J=L-V,ge=x.offsetHeight/2,ie=x.offsetTop+ge,ce=H+X+ie,oe=F-ce;if(ce<=V){const ke=z.length>0&&x===z[z.length-1].ref.current;c.style.bottom="0px";const pe=f.clientHeight-w.offsetTop-w.offsetHeight,ve=Math.max(J,ge+(ke?ee:0)+pe+Z),Ce=ce+ve;c.style.height=Ce+"px"}else{const ke=z.length>0&&x===z[0].ref.current;c.style.top="0px";const ve=Math.max(V,H+w.offsetTop+(ke?$:0)+ge)+oe;c.style.height=ve+"px",w.scrollTop=ce-V+w.offsetTop}c.style.margin=`${Ia}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[g,i.trigger,i.valueNode,c,f,w,x,S,i.dir,r]);zn(()=>A(),[A]);const[P,E]=v.useState();zn(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const O=v.useCallback(k=>{k&&j.current===!0&&(A(),N?.(),j.current=!1)},[A,N]);return s.jsx(che,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:O,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:s.jsx(qe.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});bB.displayName=ohe;var lhe="SelectPopperPosition",iS=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Ia,...i}=e,o=Xv(n);return s.jsx(Lm,{...o,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});iS.displayName=lhe;var[che,iC]=Yc(Mo,{}),oS="SelectViewport",wB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Hi(oS,n),o=iC(oS,n),c=pt(t,i.onViewportChange),d=v.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(Gv.Slot,{scope:n,children:s.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Pe(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=o;if(g?.current&&p){const y=Math.abs(d.current-h.scrollTop);if(y>0){const j=window.innerHeight-Ia*2,w=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),S=Math.max(w,x);if(S<j){const N=S+y,A=Math.min(j,N),P=N-A;p.style.height=A+"px",p.style.bottom==="0px"&&(h.scrollTop=P>0?P:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});wB.displayName=oS;var jB="SelectGroup",[uhe,dhe]=Yc(jB),fhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Bn();return s.jsx(uhe,{scope:n,id:a,children:s.jsx(qe.div,{role:"group","aria-labelledby":a,...r,ref:t})})});fhe.displayName=jB;var SB="SelectLabel",NB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=dhe(SB,n);return s.jsx(qe.div,{id:a.id,...r,ref:t})});NB.displayName=SB;var wm="SelectItem",[phe,CB]=Yc(wm),AB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=Vi(wm,n),d=Hi(wm,n),f=c.value===r,[h,p]=v.useState(i??""),[g,y]=v.useState(!1),j=pt(t,N=>d.itemRefCallback?.(N,r,a)),w=Bn(),x=v.useRef("touch"),S=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(phe,{scope:n,value:r,disabled:a,textId:w,isSelected:f,onItemTextChange:v.useCallback(N=>{p(A=>A||(N?.textContent??"").trim())},[]),children:s.jsx(Gv.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(qe.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:j,onFocus:Pe(o.onFocus,()=>y(!0)),onBlur:Pe(o.onBlur,()=>y(!1)),onClick:Pe(o.onClick,()=>{x.current!=="mouse"&&S()}),onPointerUp:Pe(o.onPointerUp,()=>{x.current==="mouse"&&S()}),onPointerDown:Pe(o.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:Pe(o.onPointerMove,N=>{x.current=N.pointerType,a?d.onItemLeave?.():x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Pe(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(Jpe.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});AB.displayName=wm;var Qu="SelectItemText",EB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=Vi(Qu,n),c=Hi(Qu,n),d=CB(Qu,n),f=nhe(Qu,n),[h,p]=v.useState(null),g=pt(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),y=h?.textContent,j=v.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:y},d.value),[d.disabled,d.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=f;return zn(()=>(w(j),()=>x(j)),[w,x,j]),s.jsxs(s.Fragment,{children:[s.jsx(qe.span,{id:d.textId,...i,ref:g}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Pc.createPortal(i.children,o.valueNode):null]})});EB.displayName=Qu;var _B="SelectItemIndicator",PB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return CB(_B,n).isSelected?s.jsx(qe.span,{"aria-hidden":!0,...r,ref:t}):null});PB.displayName=_B;var lS="SelectScrollUpButton",OB=v.forwardRef((e,t)=>{const n=Hi(lS,e.__scopeSelect),r=iC(lS,e.__scopeSelect),[a,i]=v.useState(!1),o=pt(t,r.onScrollButtonChange);return zn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(RB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});OB.displayName=lS;var cS="SelectScrollDownButton",kB=v.forwardRef((e,t)=>{const n=Hi(cS,e.__scopeSelect),r=iC(cS,e.__scopeSelect),[a,i]=v.useState(!1),o=pt(t,r.onScrollButtonChange);return zn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;i(h)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(RB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});kB.displayName=cS;var RB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Hi("SelectScrollButton",n),o=v.useRef(null),c=Yv(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),zn(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(qe.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Pe(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Pe(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Pe(a.onPointerLeave,()=>{d()})})}),hhe="SelectSeparator",TB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(qe.div,{"aria-hidden":!0,...r,ref:t})});TB.displayName=hhe;var uS="SelectArrow",mhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Xv(n),i=Vi(uS,n),o=Hi(uS,n);return i.open&&o.position==="popper"?s.jsx(Fm,{...a,...r,ref:t}):null});mhe.displayName=uS;var vhe="SelectBubbleInput",IB=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=pt(r,a),o=Wv(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("change",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(qe.select,{...n,style:{...MM,...n.style},ref:i,defaultValue:t})});IB.displayName=vhe;function MB(e){return e===""||e===void 0}function $B(e){const t=Cn(e),n=v.useRef(""),r=v.useRef(0),a=v.useCallback(o=>{const c=n.current+o;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),i=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function DB(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=ghe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function ghe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var yhe=uB,LB=fB,xhe=hB,bhe=mB,whe=vB,FB=gB,jhe=wB,BB=NB,zB=AB,She=EB,Nhe=PB,UB=OB,qB=kB,WB=TB;const Kt=yhe,Gt=xhe,Ut=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(LB,{ref:r,className:Se("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(bhe,{asChild:!0,children:s.jsx(It,{className:"h-4 w-4 opacity-50"})})]}));Ut.displayName=LB.displayName;const VB=v.forwardRef(({className:e,...t},n)=>s.jsx(UB,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Fa,{className:"h-4 w-4"})}));VB.displayName=UB.displayName;const HB=v.forwardRef(({className:e,...t},n)=>s.jsx(qB,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(It,{className:"h-4 w-4"})}));HB.displayName=qB.displayName;const qt=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(whe,{children:s.jsxs(FB,{ref:a,className:Se("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(VB,{}),s.jsx(jhe,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(HB,{})]})}));qt.displayName=FB.displayName;const Che=v.forwardRef(({className:e,...t},n)=>s.jsx(BB,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Che.displayName=BB.displayName;const Je=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(zB,{ref:r,className:Se("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Nhe,{children:s.jsx(Ql,{className:"h-4 w-4"})})}),s.jsx(She,{children:t})]}));Je.displayName=zB.displayName;const Ahe=v.forwardRef(({className:e,...t},n)=>s.jsx(WB,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));Ahe.displayName=WB.displayName;const Ehe=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"});function _he({servers:e,onChange:t,readOnly:n,allowAdd:r=!n,allowStructureEdits:a=!n,showHeader:i=!0}){const o=(h,p)=>{const g=e.map((y,j)=>j===h?{...y,...p}:y);t(g)},c=(h,p)=>{const g=e[h];g&&o(h,{authType:p,...p!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:g.oauthRedirectUrl||"http://localhost:6274/oauth/"}})},d=h=>t(e.filter((p,g)=>g!==h)),f=()=>t([...e,Ehe()]);return s.jsxs("div",{className:"space-y-4",children:[i&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Servers"}),!n&&r&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",onClick:f,children:[s.jsx(Ba,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Server"]})]}),e.map((h,p)=>s.jsxs(ze,{className:"border-dashed",children:[s.jsxs(At,{className:"pb-3 flex-row items-center justify-between space-y-0",children:[s.jsx(Et,{className:"text-sm font-medium",children:h.name||`Server ${p+1}`}),!n&&a&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>d(p),children:s.jsx(_r,{className:"h-3.5 w-3.5 text-destructive"})})]}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Name"}),s.jsx(it,{value:h.name,onChange:g=>o(p,{name:g.target.value}),disabled:n,placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Transport"}),s.jsxs(Kt,{value:h.transport,onValueChange:g=>o(p,{transport:g}),disabled:n,children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"stdio",children:"stdio"}),s.jsx(Je,{value:"sse",children:"SSE"}),s.jsx(Je,{value:"streamable-http",children:"Streamable HTTP"})]})]})]})]}),h.transport==="stdio"?s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Command"}),s.jsx(it,{value:h.command||"",onChange:g=>o(p,{command:g.target.value}),disabled:n,placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Args (comma-separated)"}),s.jsx(it,{value:(h.args||[]).join(", "),onChange:g=>o(p,{args:g.target.value.split(",").map(y=>y.trim()).filter(Boolean)}),disabled:n,placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"URL"}),s.jsx(it,{value:h.url||"",onChange:g=>o(p,{url:g.target.value}),disabled:n,placeholder:"http://localhost:3001/sse",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Auth Type"}),s.jsxs(Kt,{value:h.authType||"none",onValueChange:g=>c(p,g),disabled:n,children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"none",children:"None"}),s.jsx(Je,{value:"bearer",children:"Bearer Token"}),s.jsx(Je,{value:"api-key",children:"API Key"}),s.jsx(Je,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),h.authType&&h.authType!=="none"&&h.authType!=="oauth2"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:h.authType==="bearer"?"Token":"API Key"}),s.jsx(it,{type:"password",value:h.authValue||"",onChange:g=>o(p,{authValue:g.target.value}),disabled:n,placeholder:"••••••••",className:"font-mono text-xs"})]})]}),h.authType==="oauth2"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Client ID"}),s.jsx(it,{value:h.oauthClientId||"",onChange:g=>o(p,{oauthClientId:g.target.value}),disabled:n,placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(it,{type:"password",value:h.oauthClientSecret||"",onChange:g=>o(p,{oauthClientSecret:g.target.value}),disabled:n,placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Redirect URL"}),s.jsx(it,{value:h.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:g=>o(p,{oauthRedirectUrl:g.target.value}),disabled:n,placeholder:"http://localhost:6274/oauth/",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(it,{value:h.oauthScope||"",onChange:g=>o(p,{oauthScope:g.target.value}),disabled:n,placeholder:"openid profile mcp",className:"font-mono text-xs"})]})]})]})]})]},h.id)),e.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No servers configured. Add one to get started."})]})}var Qv="Collapsible",[Phe]=er(Qv),[Ohe,oC]=Phe(Qv),KB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=Zr({prop:r,defaultProp:a??!1,onChange:o,caller:Qv});return s.jsx(Ohe,{scope:n,disabled:i,contentId:Bn(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(qe.div,{"data-state":cC(d),"data-disabled":i?"":void 0,...c,ref:t})})});KB.displayName=Qv;var GB="CollapsibleTrigger",YB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=oC(GB,n);return s.jsx(qe.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":cC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Pe(e.onClick,a.onOpenToggle)})});YB.displayName=GB;var lC="CollapsibleContent",XB=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=oC(lC,e.__scopeCollapsible);return s.jsx(Un,{present:n||a.open,children:({present:i})=>s.jsx(khe,{...r,ref:t,present:i})})});XB.displayName=lC;var khe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=oC(lC,n),[c,d]=v.useState(r),f=v.useRef(null),h=pt(t,f),p=v.useRef(0),g=p.current,y=v.useRef(0),j=y.current,w=o.open||c,x=v.useRef(w),S=v.useRef(void 0);return v.useEffect(()=>{const N=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(N)},[]),zn(()=>{const N=f.current;if(N){S.current=S.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const A=N.getBoundingClientRect();p.current=A.height,y.current=A.width,x.current||(N.style.transitionDuration=S.current.transitionDuration,N.style.animationName=S.current.animationName),d(r)}},[o.open,r]),s.jsx(qe.div,{"data-state":cC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!w,...i,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:w&&a})});function cC(e){return e?"open":"closed"}var Rhe=KB;const Ai=Rhe,Ts=YB,Ei=XB,The=Zm,Ihe=ev,QB=v.forwardRef(({className:e,...t},n)=>s.jsx(Dc,{ref:n,className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));QB.displayName=Dc.displayName;const JB=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Ihe,{children:[s.jsx(QB,{}),s.jsxs(Lc,{ref:r,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,s.jsxs(tv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Mi,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));JB.displayName=Lc.displayName;const ZB=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ZB.displayName="DialogHeader";const e8=v.forwardRef(({className:e,...t},n)=>s.jsx(sf,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));e8.displayName=sf.displayName;const t8=v.forwardRef(({className:e,...t},n)=>s.jsx(of,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));t8.displayName=of.displayName;function Mhe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var uC="ScrollArea",[n8]=er(uC),[$he,ba]=n8(uC),r8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...o}=e,[c,d]=v.useState(null),[f,h]=v.useState(null),[p,g]=v.useState(null),[y,j]=v.useState(null),[w,x]=v.useState(null),[S,N]=v.useState(0),[A,P]=v.useState(0),[E,O]=v.useState(!1),[k,R]=v.useState(!1),D=pt(t,z=>d(z)),U=Hc(a);return s.jsx($he,{scope:n,type:r,dir:U,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:g,scrollbarX:y,onScrollbarXChange:j,scrollbarXEnabled:E,onScrollbarXEnabledChange:O,scrollbarY:w,onScrollbarYChange:x,scrollbarYEnabled:k,onScrollbarYEnabledChange:R,onCornerWidthChange:N,onCornerHeightChange:P,children:s.jsx(qe.div,{dir:U,...o,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});r8.displayName=uC;var a8="ScrollAreaViewport",s8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=ba(a8,n),c=v.useRef(null),d=pt(t,c,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(qe.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});s8.displayName=a8;var bs="ScrollAreaScrollbar",dC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ba(bs,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,c=e.orientation==="horizontal";return v.useEffect(()=>(c?i(!0):o(!0),()=>{c?i(!1):o(!1)}),[c,i,o]),a.type==="hover"?s.jsx(Dhe,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Lhe,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(i8,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(fC,{...r,ref:t}):null});dC.displayName=bs;var Dhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ba(bs,e.__scopeScrollArea),[i,o]=v.useState(!1);return v.useEffect(()=>{const c=a.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),o(!0)},h=()=>{d=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return c.addEventListener("pointerenter",f),c.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",f),c.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(Un,{present:n||i,children:s.jsx(i8,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Lhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ba(bs,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Zv(()=>d("SCROLL_END"),100),[c,d]=Mhe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,a.scrollHideDelay,d]),v.useEffect(()=>{const f=a.viewport,h=i?"scrollLeft":"scrollTop";if(f){let p=f[h];const g=()=>{const y=f[h];p!==y&&(d("SCROLL"),o()),p=y};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[a.viewport,i,d,o]),s.jsx(Un,{present:n||c!=="hidden",children:s.jsx(fC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Pe(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Pe(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),i8=v.forwardRef((e,t)=>{const n=ba(bs,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=Zv(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return Ec(n.viewport,d),Ec(n.content,d),s.jsx(Un,{present:r||i,children:s.jsx(fC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),fC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=ba(bs,e.__scopeScrollArea),i=v.useRef(null),o=v.useRef(0),[c,d]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=d8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function p(g,y){return Whe(g,o.current,c,y)}return n==="horizontal"?s.jsx(Fhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const g=a.viewport.scrollLeft,y=nM(g,c,a.dir);i.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=p(g,a.dir))}}):n==="vertical"?s.jsx(Bhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const g=a.viewport.scrollTop,y=nM(g,c);i.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=p(g))}}):null}),Fhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=ba(bs,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=pt(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(l8,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Jv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const g=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),p8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Sm(o.paddingLeft),paddingEnd:Sm(o.paddingRight)}})}})}),Bhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=ba(bs,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=pt(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(l8,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Jv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const g=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),p8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Sm(o.paddingTop),paddingEnd:Sm(o.paddingBottom)}})}})}),[zhe,o8]=n8(bs),l8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...g}=e,y=ba(bs,n),[j,w]=v.useState(null),x=pt(t,D=>w(D)),S=v.useRef(null),N=v.useRef(""),A=y.viewport,P=r.content-r.viewport,E=Cn(h),O=Cn(d),k=Zv(p,10);function R(D){if(S.current){const U=D.clientX-S.current.left,z=D.clientY-S.current.top;f({x:U,y:z})}}return v.useEffect(()=>{const D=U=>{const z=U.target;j?.contains(z)&&E(U,P)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[A,j,P,E]),v.useEffect(O,[r,O]),Ec(j,k),Ec(y.content,k),s.jsx(zhe,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:Cn(i),onThumbPointerUp:Cn(o),onThumbPositionChange:O,onThumbPointerDown:Cn(c),children:s.jsx(qe.div,{...g,ref:x,style:{position:"absolute",...g.style},onPointerDown:Pe(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),S.current=j.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),R(D))}),onPointerMove:Pe(e.onPointerMove,R),onPointerUp:Pe(e.onPointerUp,D=>{const U=D.target;U.hasPointerCapture(D.pointerId)&&U.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=N.current,y.viewport&&(y.viewport.style.scrollBehavior=""),S.current=null})})})}),jm="ScrollAreaThumb",c8=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=o8(jm,e.__scopeScrollArea);return s.jsx(Un,{present:n||a.hasThumb,children:s.jsx(Uhe,{ref:t,...r})})}),Uhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=ba(jm,n),o=o8(jm,n),{onThumbPositionChange:c}=o,d=pt(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=Zv(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=i.viewport;if(p){const g=()=>{if(h(),!f.current){const y=Vhe(p,c);f.current=y,c()}};return c(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[i.viewport,h,c]),s.jsx(qe.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Pe(e.onPointerDownCapture,p=>{const y=p.target.getBoundingClientRect(),j=p.clientX-y.left,w=p.clientY-y.top;o.onThumbPointerDown({x:j,y:w})}),onPointerUp:Pe(e.onPointerUp,o.onThumbPointerUp)})});c8.displayName=jm;var pC="ScrollAreaCorner",u8=v.forwardRef((e,t)=>{const n=ba(pC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(qhe,{...e,ref:t}):null});u8.displayName=pC;var qhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=ba(pC,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return Ec(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),Ec(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(qe.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Sm(e){return e?parseInt(e,10):0}function d8(e,t){const n=e/t;return isNaN(n)?0:n}function Jv(e){const t=d8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Whe(e,t,n,r="ltr"){const a=Jv(n),i=a/2,o=t||i,c=a-o,d=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return f8([d,f],p)(e)}function nM(e,t,n="ltr"){const r=Jv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,c=i-r,d=n==="ltr"?[0,o]:[o*-1,0],f=Jd(e,d);return f8([0,o],[0,c])(f)}function f8(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function p8(e,t){return e>0&&e<t}var Vhe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,c=n.top!==i.top;(o||c)&&t(),n=i,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function Zv(e,t){const n=Cn(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ec(e,t){const n=Cn(t);zn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var h8=r8,Hhe=s8,Khe=u8;const Nm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(h8,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[s.jsx(Hhe,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(m8,{}),s.jsx(Khe,{})]}));Nm.displayName=h8.displayName;const m8=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(dC,{ref:r,orientation:t,className:Se("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(c8,{className:"relative flex-1 rounded-full bg-border"})}));m8.displayName=dC.displayName;const Ghe=[{label:"Suggest Checks",description:"Propose stronger evaluation checks for this scenario.",prompt:"Suggest checks"},{label:"Suggest Value Capture Rules",description:"Recommend extract/value capture rules for key outputs.",prompt:"Suggest value capture rules"},{label:"Improve Prompt Determinism",description:"Reduce ambiguity and improve reproducibility.",prompt:"Improve prompt determinism"},{label:"Explain Snapshot Drift Risk",description:"Assess likely causes of drift and stabilization options.",prompt:"Explain snapshot drift risk"},{label:"Generate Scenario Draft",description:"Create a draft scenario from the current context.",prompt:"Generate scenario draft"}];function Yhe({open:e,onOpenChange:t,configId:n,configPath:r,scenario:a,agents:i,servers:o,snapshotEval:c,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:h}){const{source:p}=An(),[g,y]=v.useState(null),[j,w]=v.useState(null),[x,S]=v.useState(""),[N,A]=v.useState(!1),[P,E]=v.useState(new Set),O=v.useRef(null),k=v.useRef(null),R=v.useRef(null),[D,U]=v.useState(!1),z=v.useRef(!1),L=d||i[0]?.name||i[0]?.id||"";v.useEffect(()=>{if(!e||!L||g)return;let V=!1;return A(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:L,context:{configSnapshotPolicy:c?{enabled:c.enabled,mode:c.mode,baselineSnapshotId:c.baselineSnapshotId}:void 0,scenario:{id:a.id,name:a.name,prompt:a.prompt,serverNames:a.serverIds.map(J=>o.find(ge=>ge.id===J)?.name||o.find(ge=>ge.id===J)?.id).filter(Boolean),evalRules:a.evalRules,extractRules:a.extractRules,snapshotEval:a.snapshotEval?{enabled:a.snapshotEval.enabled,baselineSnapshotId:a.snapshotEval.baselineSnapshotId}:void 0},availableServers:o.map(J=>({name:J.name||J.id,url:J.url})),availableAgents:i.map(J=>({name:J.name||J.id,provider:J.provider,model:J.model}))}}).then(J=>{V||(y(J.sessionId),w(J.session))}).catch(J=>{V||Oe({title:"Could not start Scenario Assistant",description:J instanceof Error?J.message:String(J),variant:"destructive"})}).finally(()=>{V||A(!1)}),()=>{V=!0}},[e,p,g,n,r,a,c,i,o,L]);const G=()=>{y(null),w(null),S(""),E(new Set),R.current=null},q=V=>{G(),p.closeScenarioAssistantSession(V).catch(()=>{})};v.useEffect(()=>{e||g&&(z.current||D||q(g))},[e,g,p,D]),v.useEffect(()=>()=>{g&&p.closeScenarioAssistantSession(g).catch(()=>{})},[g,p]),v.useEffect(()=>{if(!e)return;D&&U(!1),z.current&&(z.current=!1);const V=window.setTimeout(()=>{O.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[e,N,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),v.useEffect(()=>{const V=k.current;if(!V)return;V.style.height="0px";const J=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,J)}px`},[x,e]);const H=i.length>0&&a.serverIds.length>0&&!!L,X=async V=>{if(!g)return;const J=V.trim();if(!J)return;const ge=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ie={id:ge,role:"user",text:J,createdAt:new Date().toISOString()};w(ce=>ce&&{...ce,messages:[...ce.messages,ie]}),S(""),A(!0);try{const ce=await p.sendScenarioAssistantMessage(g,J);w(ce.session)}catch(ce){w(oe=>oe&&{...oe,messages:oe.messages.filter(xe=>xe.id!==ge)}),S(oe=>oe.trim()?oe:J),Oe({title:"Scenario Assistant error",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{A(!1)}},Z=V=>{S(V),requestAnimationFrame(()=>k.current?.focus())};v.useEffect(()=>{if(!e||!g||!j||!H||N)return;const V=String(f??"").trim();V&&R.current!==V&&(R.current=V,X(V))},[e,g,j,H,N,f]);const I=async V=>{if(g){A(!0);try{const J=await p.approveScenarioAssistantToolCall(g,V);w(J.session)}catch(J){Oe({title:"Tool call failed",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{A(!1)}}},F=async V=>{if(g){A(!0);try{const J=await p.denyScenarioAssistantToolCall(g,V);w(J.session)}catch(J){Oe({title:"Could not deny tool call",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{A(!1)}}},Q=(V,J,ge)=>{if(!J)return;if(ge==="prompt"&&J.prompt&&h({prompt:J.prompt.replacement}),ge==="evalRules"&&J.evalRules&&h({evalRules:J.evalRules.replacement}),ge==="extractRules"&&J.extractRules&&h({extractRules:J.extractRules.replacement}),ge==="snapshotEval"&&J.snapshotEval&&h({snapshotEval:{enabled:J.snapshotEval.patch.enabled,baselineSnapshotId:J.snapshotEval.patch.baselineSnapshotId}}),V){const ce=`${V}:${ge}`;E(oe=>new Set([...oe,ce]))}Oe({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[ge]}`})},B=V=>{V||(U(!1),z.current=!1),t(V)},$=()=>{z.current=!0,U(!0),t(!1)},ee=()=>{z.current=!1,U(!1),g&&q(g)};return s.jsxs(s.Fragment,{children:[!e&&g&&s.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium",children:"Scenario Assistant (session active)"}),s.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Resume conversation for ",s.jsx("span",{className:"font-mono",children:a.id}),j?` · ${j.messages.length} messages`:""]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(ua,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(ae,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:ee,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(Mi,{className:"h-4 w-4"})})]})]}),s.jsx(The,{open:e,onOpenChange:B,children:s.jsxs(JB,{className:"max-w-6xl h-[85vh] flex flex-col",children:[g&&s.jsxs("button",{type:"button",className:"absolute right-12 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:$,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(IU,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(ZB,{className:"pr-20",children:s.jsx("div",{className:"flex items-start justify-between gap-3",children:s.jsxs("div",{className:"min-w-0",children:[s.jsxs(e8,{className:"flex items-center gap-2",children:[s.jsx(ua,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(t8,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),H?s.jsxs("div",{className:"min-h-0 flex flex-1 flex-col gap-3",children:[s.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"MCP Context"}),s.jsxs("div",{className:"h-8 rounded-md border px-2 text-xs flex items-center gap-2",children:[s.jsx(Ms,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(Nm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((V,J)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:V},`${V}-${J}`)),j?.messages.map(V=>s.jsxs(v.Fragment,{children:[(()=>{const J=V.pendingToolCallId?(j?.pendingToolCalls??[]).find(ke=>ke.id===V.pendingToolCallId):void 0;if(!(V.role==="assistant"&&!!V.pendingToolCallId))return s.jsx("div",{className:"space-y-2",children:s.jsx(Xhe,{message:V})});const ie=V.text.match(/I need to call ['"]([^'"]+)['"]/i)?.[1]?.replace(/^.*__/,"")??void 0,ce=J?.tool??V.toolRequestName??ie,oe=J?.publicToolName??V.toolRequestPublicName,xe=ce??oe??"unknown_tool";return s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!J,className:"group w-full max-w-[92%] rounded-md border border-border/60 bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ms,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"truncate text-sm font-medium",children:`Tool call ${xe}`}),s.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold ${J?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:J?"Needs approval":"Completed"})]})}),s.jsx(It,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"space-y-2 border-t border-border/50 px-3 py-2",children:[s.jsx(dS,{text:V.text,variant:"assistant"}),J&&s.jsxs(s.Fragment,{children:[s.jsx("pre",{className:"max-h-40 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{children:JSON.stringify(J.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{F(J.id)},children:"Deny"}),s.jsx(ae,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{I(J.id)},children:"Approve"})]})]})]})]})]})})(),V.suggestions&&s.jsxs("div",{className:"ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),V.suggestions.prompt&&s.jsx(Jp,{title:"Prompt",rationale:V.suggestions.prompt.rationale,preview:V.suggestions.prompt.replacement,applied:P.has(`${V.id}:prompt`),onApply:()=>Q(V.id,V.suggestions,"prompt")}),V.suggestions.evalRules&&s.jsx(Jp,{title:"Checks",rationale:V.suggestions.evalRules.rationale,preview:JSON.stringify(V.suggestions.evalRules.replacement,null,2),applied:P.has(`${V.id}:evalRules`),onApply:()=>Q(V.id,V.suggestions,"evalRules")}),V.suggestions.extractRules&&s.jsx(Jp,{title:"Value Capture Rules",rationale:V.suggestions.extractRules.rationale,preview:JSON.stringify(V.suggestions.extractRules.replacement,null,2),applied:P.has(`${V.id}:extractRules`),onApply:()=>Q(V.id,V.suggestions,"extractRules")}),V.suggestions.snapshotEval&&s.jsx(Jp,{title:"Snapshot Settings",rationale:V.suggestions.snapshotEval.rationale,preview:JSON.stringify(V.suggestions.snapshotEval.patch,null,2),applied:P.has(`${V.id}:snapshotEval`),onApply:()=>Q(V.id,V.suggestions,"snapshotEval")}),(()=>{const J=V.suggestions?.notes,ge=Array.isArray(J)?J:typeof J=="string"?[J]:[];return ge.length===0?null:s.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[s.jsx("h5",{className:"text-sm font-medium",children:"Notes"}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground list-disc pl-4",children:ge.map((ie,ce)=>s.jsx("li",{children:ie},`${V.id}-note-${ce}`))})]})})()]})]},V.id)),(j?.pendingToolCalls??[]).filter(V=>!(j?.messages??[]).some(J=>J.pendingToolCallId===V.id)).map(V=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ms,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("p",{className:"min-w-0 truncate font-mono text-xs font-semibold",children:V.publicToolName||V.tool}),s.jsx("span",{className:"shrink-0 rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-900",children:"Needs approval"})]})}),s.jsx(It,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.jsx("pre",{className:"max-h-40 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{children:JSON.stringify(V.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{F(V.id)},children:"Deny"}),s.jsx(ae,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{I(V.id)},children:"Approve"})]})]})]},V.id)),!j&&N&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&N&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:O})]})}),s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(Gs,{ref:k,value:x,onChange:V=>S(V.target.value),placeholder:"Get assistance with creating or refining this scenario ...",disabled:!g||N,rows:1,className:"min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),X(x))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Kc,{children:[s.jsx(Gc,{asChild:!0,children:s.jsxs(ae,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-muted-foreground",disabled:!g||N,children:[s.jsx(Ba,{className:"h-3 w-3"}),"Snippets",s.jsx(It,{className:"h-3 w-3"})]})}),s.jsxs(Go,{align:"start",className:"w-[320px]",children:[s.jsx(nC,{children:"Scenario Assistant Snippets"}),s.jsx(rC,{}),Ghe.map(V=>s.jsx(cr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>Z(V.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:V.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:V.description})]})},V.label))]})]}),s.jsx(ae,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>{X(x)},disabled:!g||N||!x.trim(),"aria-label":"Send message",title:"Send message",children:N?s.jsx(Zn,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(f$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Send"})]})})]})]})]}):s.jsx("div",{className:"rounded-md border p-3 text-sm text-muted-foreground",children:"Scenario Assistant requires a configured assistant agent and at least one selected server on the scenario."})]})})]})}function Jp({title:e,rationale:t,preview:n,applied:r=!1,onApply:a}){return s.jsxs("div",{className:`space-y-2 rounded-md border p-3 ${r?"border-emerald-300 bg-emerald-50/40":""}`,children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h5",{className:"text-sm font-medium",children:e}),s.jsx(ae,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(Dl,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):"Apply"})]}),t&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t}),s.jsx("pre",{className:"max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap",children:n})]})}function Xhe({message:e}){const t=async o=>{try{await navigator.clipboard.writeText(o),Oe({title:"Copied"})}catch(c){Oe({title:"Could not copy",description:c instanceof Error?c.message:String(c),variant:"destructive"})}},n=e.role;if(n==="tool"){const o=String(e.text??"").trim();return/^(Approved|Denied) tool call\b/i.test(o)?null:s.jsxs("div",{className:"rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wide text-sky-700",children:[s.jsx(Ms,{className:"h-3.5 w-3.5"}),"Tool",s.jsx("span",{className:"font-normal normal-case text-sky-700/80",children:new Date(e.createdAt).toLocaleTimeString()})]}),s.jsx("p",{className:"whitespace-pre-wrap text-sky-900",children:e.text})]})}if(n==="system")return s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(d$,{className:"h-3 w-3"})}),s.jsx("div",{className:"max-w-[92%] rounded-md border border-amber-400/30 bg-amber-50/70 p-3 text-sm",children:s.jsx(dS,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?_S:fa,i=n==="user"||n==="assistant";return s.jsxs("div",{className:`flex items-start gap-2 text-xs ${r?"justify-end":"justify-start"}`,children:[!r&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(a,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full rounded-md border px-3 py-2 text-sm ${r?"border-primary/20 bg-primary/10":"border-border/80 bg-background shadow-sm"}`,children:[!r&&s.jsx("p",{className:"mb-2 text-[11px] font-semibold text-muted-foreground",children:"Assistant"}),r?s.jsx("p",{className:"whitespace-pre-wrap",children:e.text}):s.jsx(dS,{text:e.text,variant:"assistant"})]}),i&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:`absolute bottom-1 h-6 w-6 text-muted-foreground ${r?"-left-8":"-right-8"}`,onClick:()=>{t(e.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Ii,{className:"h-3.5 w-3.5"})})]}),r&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(a,{className:"h-3 w-3"})})]})}function dS({text:e,variant:t="assistant"}){const n=Qhe(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:Jhe(r,a,t)},`md-${a}`))})}function Qhe(e){const t=e.replace(/\r\n/g,`
|
|
121
|
-
`).split(`
|
|
122
|
-
`),n=[];let r=0;const a=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(a(o)){r+=1;continue}if(i(o)){const g=c.replace(/^```/,"").trim()||void 0;r+=1;const y=[];for(;r<t.length&&!i(t[r]);)y.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:g,code:y.join(`
|
|
123
|
-
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}const d=c.match(/^(#{1,4})\s+(.+)$/);if(d){n.push({type:"heading",level:d[1].length,text:d[2].trim()}),r+=1;continue}if(rM(t,r)){const g=aM(t[r]);r+=2;const y=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)y.push(aM(t[r])),r+=1;n.push({type:"table",headers:g,rows:y});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const g=!!f,y=[];for(;r<t.length;){const j=t[r].trim();if(g?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){y.push(j.replace(g?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:g,items:y});continue}const p=[o];for(r+=1;r<t.length;){const g=t[r],y=g.trim();if(a(g)||i(g)||/^---+$/.test(y)||/^#{1,4}\s+/.test(y)||rM(t,r)||/^\d+\.\s+/.test(y)||/^[-*+]\s+/.test(y))break;p.push(g),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
124
|
-
`)})}return n}function rM(e,t){if(t+1>=e.length)return!1;const n=e[t].trim(),r=e[t+1].trim();return n.includes("|")?/^\|?(\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?$/.test(r):!1}function aM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Jhe(e,t,n){if(e.type==="hr")return s.jsx("hr",{className:"border-border/60"});if(e.type==="heading"){const r=e.level===1?"text-base font-semibold":e.level===2?"text-sm font-semibold":"text-sm font-medium";return s.jsx("h4",{className:r,children:Wu(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Wu(e.text,`${t}-p`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Wu(a,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[s.jsx("thead",{className:"bg-muted/40",children:s.jsx("tr",{children:e.headers.map((r,a)=>s.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:Wu(r,`${t}-thc-${a}`)},`${t}-th-${a}`))})}),s.jsx("tbody",{children:e.rows.map((r,a)=>s.jsx("tr",{className:"border-t",children:r.map((i,o)=>s.jsx("td",{className:"px-2 py-1.5 align-top",children:Wu(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Wu(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*)/g).filter(Boolean).map((r,a)=>r.startsWith("`")&&r.endsWith("`")?s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${a}`):r.startsWith("**")&&r.endsWith("**")?s.jsx("strong",{children:r.slice(2,-2)},`${t}-${a}`):s.jsx(v.Fragment,{children:r},`${t}-${a}`))}const Zhe="mcplab.feature.";function jf(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${Zhe}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const eme=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function fS({scenarios:e,scenarioOrigins:t,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPromptByScenarioId:c,assistantAutoOpenNonceByScenarioId:d,snapshotEval:f,onChange:h,readOnly:p,allowAdd:g=!p,allowStructureEdits:y=!p}){const j=(N,A)=>{const P=e.map((E,O)=>O===N?{...E,...A}:E);h(P)},w=N=>h(e.filter((A,P)=>P!==N)),x=()=>h([...e,eme()]),S=(N,A)=>{const P=N+A;if(P<0||P>=e.length)return;const E=[...e],[O]=E.splice(N,1);E.splice(P,0,O),h(E)};return s.jsxs("div",{className:p?"space-y-2":"space-y-4",children:[!p&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Scenarios"}),g&&y&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",onClick:x,children:[s.jsx(Ba,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((N,A)=>s.jsx(tme,{scenario:N,scenarioOrigin:t?.[A],index:A,total:e.length,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPrompt:c?.[N.id],assistantAutoOpenNonce:d?.[N.id],snapshotEval:f,onUpdate:P=>j(A,P),onMoveUp:()=>S(A,-1),onMoveDown:()=>S(A,1),onRemove:()=>w(A),readOnly:p,allowStructureEdits:y},N.id)),e.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No scenarios configured. Add one to get started."})]})}function tme({scenario:e,scenarioOrigin:t,index:n,total:r,agents:a,servers:i,configId:o,configPath:c,defaultAssistantAgentName:d,assistantInitialPrompt:f,assistantAutoOpenNonce:h,snapshotEval:p,onUpdate:g,onMoveUp:y,onMoveDown:j,onRemove:w,readOnly:x,allowStructureEdits:S}){const{source:N}=An(),A=jf("snapshots",!1),[P,E]=v.useState("required_tool"),[O,k]=v.useState(""),[R,D]=v.useState(""),[U,z]=v.useState(null),[L,G]=v.useState(!1),[q,H]=v.useState(null),[X,Z]=v.useState(""),[I,F]=v.useState(""),[Q,B]=v.useState(!1),[$,ee]=v.useState(!x),V=()=>{O.trim()&&(g({evalRules:[...e.evalRules,{type:P,value:O.trim()}]}),k(""),D(""))},J=je=>{g({evalRules:e.evalRules.filter(($e,et)=>et!==je)})},ge=()=>{!X.trim()||!I.trim()||(g({extractRules:[...e.extractRules,{name:X.trim(),pattern:I.trim()}]}),Z(""),F(""))},ie=je=>{g({extractRules:e.extractRules.filter(($e,et)=>et!==je)})},ce=je=>{const $e=e.serverIds.includes(je)?e.serverIds.filter(et=>et!==je):[...e.serverIds,je];g({serverIds:$e})},oe={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains"},xe={required_tool:"border-sky-300/60 bg-sky-500/10 text-sky-700",forbidden_tool:"border-rose-300/60 bg-rose-500/10 text-rose-700",response_contains:"border-violet-300/60 bg-violet-500/10 text-violet-700",response_not_contains:"border-amber-300/60 bg-amber-500/10 text-amber-700"},ke=P==="required_tool"||P==="forbidden_tool",pe=e.serverIds.map(je=>i.find($e=>$e.id===je)?.name).filter(je=>!!je),ve=pe.length>0,Ce=e.snapshotEval?.baselineSnapshotId!==void 0,[Le,se]=v.useState(""),[de,Ne]=v.useState(0);v.useEffect(()=>{const je=(f??"").trim();je&&Le!==je&&(B(!0),se(je))},[f,Le]),v.useEffect(()=>{h&&h!==de&&(B(!0),Ne(h))},[h,de]),v.useEffect(()=>{z(null),H(null),D("")},[e.serverIds.join("|")]),v.useEffect(()=>{D("")},[P]);const Fe=async()=>{if(!(!ve||x)){G(!0),H(null);try{const je=new Set;for(const $e of pe){const et=await N.discoverToolsForAnalysis({serverNames:[$e]});for(const xt of et.servers)for(const Jt of xt.tools)je.add(Jt.name)}z(Array.from(je).sort(($e,et)=>$e.localeCompare(et)))}catch(je){H(je instanceof Error?je.message:"Failed to load tools")}finally{G(!1)}}};return s.jsx(Ai,{open:$,onOpenChange:ee,children:s.jsxs(ze,{className:x?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(At,{className:x?"px-3 py-3 flex-row items-center justify-between space-y-0":"pb-3 flex-row items-center justify-between space-y-0",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!x&&s.jsx(Ts,{asChild:!0,children:s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${$?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(Et,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),x?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(Ke,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),s.jsx(Ts,{asChild:!0,children:s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":$?"Collapse scenario details":"Expand scenario details",children:s.jsx(It,{className:`h-4 w-4 transition-transform ${$?"rotate-180":""}`})})})]}):S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>B(!0),title:a.length===0?"Add at least one agent in the config":e.serverIds.length===0?"Select at least one server for this scenario":"Open Scenario Assistant",children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]}),s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:y,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(Fa,{className:"h-3.5 w-3.5"})}),s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:n===r-1,"aria-label":"Move scenario down",children:s.jsx(It,{className:"h-3.5 w-3.5"})}),s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:w,children:s.jsx(_r,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(Ei,{children:s.jsxs(Ue,{className:"space-y-3",children:[s.jsx(Yhe,{open:Q,onOpenChange:B,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:je=>g({...je.prompt!==void 0?{prompt:je.prompt}:{},...je.evalRules!==void 0?{evalRules:je.evalRules}:{},...je.extractRules!==void 0?{extractRules:je.extractRules}:{},...je.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...je.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Name"}),s.jsx(it,{value:e.name,onChange:je=>g({name:je.target.value}),disabled:x,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(je=>s.jsx(Ke,{variant:e.serverIds.includes(je.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(je.id)?"":"opacity-50"}`,onClick:()=>!x&&ce(je.id),children:je.name||je.id},je.id)),i.length===0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),s.jsxs(ze,{className:"border bg-card",children:[s.jsxs(At,{className:"pb-2",children:[s.jsx(Et,{className:"text-sm",children:"Prompt"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The instruction sent to the agent for this scenario. Be explicit about the task, expected output, and constraints."})]}),s.jsx(Ue,{className:"pt-0",children:s.jsx(Gs,{value:e.prompt,onChange:je=>g({prompt:je.target.value}),disabled:x,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs(ze,{className:"border bg-muted/20",children:[s.jsx(At,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Et,{className:"text-sm",children:"Checks"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Checks determine pass/fail for the scenario. Add tool checks or text pattern checks for the final answer."})]}),!x&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>B(!0),title:"Ask for help improving checks",children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(Ue,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{className:"text-xs",children:"Checks (pass / fail)"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"These determine whether the scenario passes. Add tool checks (required/forbidden) or text pattern checks for the final answer."}),s.jsx("div",{className:"space-y-1.5",children:e.evalRules.length===0?s.jsx("p",{className:"rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground",children:"No checks yet. Add tool checks or text pattern checks below."}):e.evalRules.map((je,$e)=>s.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${xe[je.type]}`,children:oe[je.type]}),s.jsx("span",{className:"font-mono break-all",children:je.value})]})}),!x&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>J($e),"aria-label":`Remove check ${$e+1}`,children:s.jsx(Mi,{className:"h-3.5 w-3.5"})})]},$e))}),!x&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(Kt,{value:P,onValueChange:je=>E(je),children:[s.jsx(Ut,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"required_tool",children:"Required Tool"}),s.jsx(Je,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(Je,{value:"response_contains",children:"Text matches pattern"}),s.jsx(Je,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(it,{value:O,onChange:je=>k(je.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:je=>je.key==="Enter"&&(je.preventDefault(),V())}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:V,children:"Add"})]}),ke&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx(Te,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(Kt,{value:R,onValueChange:je=>{D(je),k(je)},disabled:L||!U||U.length===0,children:[s.jsx(Ut,{className:"h-8 text-xs",children:s.jsx(Gt,{placeholder:L?"Loading tools...":U&&U.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(qt,{children:(U??[]).map(je=>s.jsx(Je,{value:je,children:je},je))})]})]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Fe,disabled:!ve||L,children:L?"Loading...":U?"Refresh tools":"Load tools"})]}),!ve&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),q&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",q]})]})]})]})})]}),s.jsxs(ze,{className:"border bg-muted/10",children:[s.jsx(At,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Et,{className:"text-sm",children:"Value Capture Rules"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Formerly “Extract Rules”. These do not fail the run. They capture structured values from the final answer for reporting, snapshots, and comparisons."})]}),!x&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>B(!0),title:"Ask for help improving value capture rules",children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(Ue,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{className:"text-xs",children:"Value Capture Rules"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Use regex patterns to capture values like max concentration, product names, date ranges, or IDs from the final answer text."}),s.jsx("div",{className:"space-y-1.5",children:e.extractRules.length===0?s.jsx("p",{className:"w-full rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground",children:"No value capture rules yet. Add one below to capture structured output from the final answer."}):e.extractRules.map((je,$e)=>s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"rounded-full border border-violet-300/60 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-violet-700",children:je.name}),s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground",children:"regex:"}),s.jsx("code",{className:"font-mono break-all text-foreground",children:je.pattern})]})}),!x&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>ie($e),"aria-label":`Remove value capture rule ${$e+1}`,children:s.jsx(Mi,{className:"h-3.5 w-3.5"})})]},$e))}),!x&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(it,{value:X,onChange:je=>Z(je.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(it,{value:I,onChange:je=>F(je.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:je=>je.key==="Enter"&&(je.preventDefault(),ge())}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ge,children:"Add"})]})]})})]})]}),A&&s.jsxs(ze,{className:"border bg-amber-50/40",children:[s.jsxs(At,{className:"pb-2",children:[s.jsx(Et,{className:"text-sm",children:"Snapshot Evaluation"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Per-scenario toggle for config baseline drift checks."})]}),s.jsxs(Ue,{className:"space-y-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[s.jsx("span",{children:"Enabled for this scenario"}),s.jsx(bm,{checked:e.snapshotEval?.enabled!==!1,disabled:x,onCheckedChange:je=>g({snapshotEval:{...e.snapshotEval??{},enabled:je}})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[s.jsx("span",{children:"Use config baseline"}),s.jsx(bm,{checked:!Ce,disabled:x,onCheckedChange:je=>{if(je){g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ce&&s.jsx(it,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:je=>g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:je.target.value}}),disabled:x,placeholder:"Override baseline snapshot id",className:"h-8 text-xs font-mono"})]}),s.jsxs("p",{children:["Effective baseline snapshot:"," ",s.jsx("span",{className:"font-mono",children:e.snapshotEval?.baselineSnapshotId||p?.baselineSnapshotId||"Not configured"})]}),s.jsxs("p",{children:["Policy:"," ",s.jsx("span",{className:"font-mono",children:p?.mode??"warn"})," · config-level switch"," ",s.jsx("span",{className:"font-mono",children:p?.enabled?"on":"off"})]})]})]})]})})]})})}const nme=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),sM=()=>{const{id:e,tab:t}=Fo(),n=ya(),[r,a]=$c(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=cf(),{source:f}=An(),h=jf("snapshots",!1),{servers:p,agents:g,scenarios:y}=Va(),j=e==="new",w=!j&&!!e,x=w?i(e):void 0,[S,N]=v.useState(j),[A,P]=v.useState(()=>x?structuredClone(x):nme()),[E,O]=v.useState([]),[k,R]=v.useState(""),[D,U]=v.useState(""),[z,L]=v.useState(""),[G,q]=v.useState(null),[H,X]=v.useState(!1),[Z,I]=v.useState(!1),[F,Q]=v.useState(""),[B,$]=v.useState(""),[ee,V]=v.useState(""),[J,ge]=v.useState({}),[ie,ce]=v.useState({}),[oe,xe]=v.useState({}),[ke,pe]=v.useState({}),[ve,Ce]=v.useState({}),Le=v.useMemo(()=>{const T=t||r.get("tab");return T==="agents"||T==="scenarios"||T==="servers"?T:"agents"},[t,r]);v.useEffect(()=>{x&&!S&&P(structuredClone(x))},[x,S]),v.useEffect(()=>{let T=!0;return f.listSnapshots().then(ne=>{T&&O(ne)}).catch(()=>{T&&O([])}),()=>{T=!1}},[f]),v.useEffect(()=>{if(!k.trim()){q(null);return}let T=!0;return f.getResult(k.trim()).then(ne=>{if(!T)return;if(!ne){q(!1);return}const be=ne.overallPassRate===1&&ne.scenarios.every(_e=>_e.runs.every(rt=>rt.passed));q(be)}).catch(()=>{T&&q(!1)}),()=>{T=!1}},[k,f]);const se=T=>P(ne=>({...ne,...T})),de=v.useMemo(()=>A.serverEntries&&A.serverEntries.length>0?A.serverEntries:A.servers.map(T=>({kind:"inline",server:T})),[A.serverEntries,A.servers]),Ne=T=>{se({serverEntries:T,servers:T.filter(ne=>ne.kind==="inline").map(ne=>ne.server)})},Fe=v.useMemo(()=>A.scenarioEntries&&A.scenarioEntries.length>0?A.scenarioEntries:A.scenarios.map(T=>({kind:"inline",scenario:T})),[A.scenarioEntries,A.scenarios]),je=T=>{se({scenarioEntries:T,scenarios:T.filter(ne=>ne.kind==="inline").map(ne=>ne.scenario)})},$e=v.useMemo(()=>A.agentEntries&&A.agentEntries.length>0?A.agentEntries:A.agents.map(T=>({kind:"inline",agent:T})),[A.agentEntries,A.agents]),et=T=>{se({agentEntries:T,agents:T.filter(ne=>ne.kind==="inline").map(ne=>ne.agent)})},xt=!S,Jt=A.runDefaults?.selectedAgentNames??[],ye=async T=>{if(!A.id||xt===!1){se({snapshotEval:{enabled:T.enabled,mode:T.mode,baselineSnapshotId:T.baselineSnapshotId,baselineSourceRunId:T.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}X(!0);try{const ne=await f.updateSnapshotPolicy(A.id,T);P(ne),Oe({title:"Snapshot policy updated"})}catch(ne){Oe({title:"Could not update snapshot policy",description:ne instanceof Error?ne.message:String(ne),variant:"destructive"})}finally{X(!1)}},We=async()=>{if(!(!A.id||!k.trim())){I(!0);try{const T=await f.generateSnapshotEvalBaseline(k.trim(),A.id,D.trim()||void 0);P(T.config),L(T.snapshot.id),O(ne=>[T.snapshot,...ne.filter(be=>be.id!==T.snapshot.id)]),Oe({title:"Snapshot baseline generated",description:`${T.snapshot.name} (${T.snapshot.id})`})}catch(T){Oe({title:"Could not generate baseline",description:T instanceof Error?T.message:String(T),variant:"destructive"})}finally{I(!1)}}},Ye=async()=>{if(!A.name.trim()){Oe({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const T=de.map(Be=>Be.kind==="referenced"?{kind:"referenced",ref:p.find(Vt=>Vt.id===Be.ref)?.id||Be.ref}:Be),ne=$e.map(Be=>Be.kind==="referenced"?{kind:"referenced",ref:g.find(Vt=>Vt.id===Be.ref)?.id||Be.ref}:Be),be=Fe.map(Be=>Be.kind==="referenced"?{kind:"referenced",ref:y.find(Vt=>Vt.id===Be.ref)?.id||Be.ref}:Be);if(be.filter(Be=>Be.kind==="inline").some(Be=>!Be.scenario.name?.trim())){Oe({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const rt=new Set(ne.map(Be=>Be.kind==="inline"?Be.agent.id:Be.ref)),Ge=(A.runDefaults?.selectedAgentNames??[]).filter(Be=>rt.has(Be)),vt={...A,serverEntries:T,servers:T.filter(Be=>Be.kind==="inline").map(Be=>Be.server),agentEntries:ne,agents:ne.filter(Be=>Be.kind==="inline").map(Be=>Be.agent),scenarioEntries:be,scenarios:be.filter(Be=>Be.kind==="inline").map(Be=>Be.scenario),runDefaults:Ge.length>0?{...A.runDefaults??{},selectedAgentNames:Ge}:void 0,updatedAt:new Date().toISOString()};if(j){const Be=await o(vt);P(Be);const Ct=Be.configName?.trim()||Be.name;Oe({title:"MCP Evaluation Created",description:`"${Ct}" has been saved.`}),n(`/mcp-evaluations/${Be.id}`)}else{const Be=await c(A.id,vt);P(Be);const Ct=Be.configName?.trim()||Be.name;Oe({title:"MCP Evaluation Updated",description:`"${Ct}" has been updated.`}),N(!1),Be.id!==e&&n(`/mcp-evaluations/${Be.id}`,{replace:!0})}},Ot=A.configName?.trim()||A.name,Dt=j?"New MCP Evaluation":S?`Editing: ${Ot}`:Ot,kt=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(A.id||e||"")}`,Zt=!!x?.loadError,Sn=()=>{const T=p.find(be=>be.id===F);if(!T)return;const ne={...structuredClone(T),id:`srv-${Date.now()}`};Ne([...de,{kind:"inline",server:ne}]),ce(be=>({...be,[ne.id]:!0})),Q("")},tr=()=>{const T=p.find(_e=>_e.id===F);if(!T)return;const ne=T.id;new Set(de.filter(_e=>_e.kind==="referenced").map(_e=>_e.ref)).has(ne)||Ne([...de,{kind:"referenced",ref:ne}]),Q("")},nr=()=>{const ne={id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"};Ne([{kind:"inline",server:ne},...de]),ce(be=>({...be,[ne.id]:!0}))},wa=T=>{const ne=de[T];ne?.kind==="inline"&&ce(be=>{const _e={...be};return delete _e[ne.server.id],_e}),Ne(de.filter((be,_e)=>_e!==T))},En=(T,ne)=>{const be=T+ne;if(be<0||be>=de.length)return;const _e=[...de],[rt]=_e.splice(T,1);_e.splice(be,0,rt),Ne(_e)},kr=T=>{const ne=de[T];if(!ne||ne.kind!=="referenced")return;const be=Xt(ne.ref);if(!be){Oe({title:"Referenced server not found",variant:"destructive"});return}const _e={...structuredClone(be),id:`srv-${Date.now()}`},rt=[...de];rt[T]={kind:"inline",server:_e},Ne(rt),ce(Ge=>({...Ge,[_e.id]:!0})),Oe({title:"Referenced server converted to inline",description:_e.name||_e.id}),Q("")},Rr=v.useMemo(()=>g.map(T=>({id:T.id,ref:T.id,label:T.name||T.id,model:T.model})).sort((T,ne)=>T.label.localeCompare(ne.label)),[g]),yr=(T,ne)=>{const be=ne?Array.from(new Set([...Jt,T])):Jt.filter(_e=>_e!==T);se({runDefaults:{...A.runDefaults??{},selectedAgentNames:be}})},_n=T=>{const ne=new Set([...$e.filter(Ge=>Ge.kind==="inline").map(Ge=>Ge.agent.name||Ge.agent.id),...g.map(Ge=>Ge.name||Ge.id)]),be=`${T}-custom`;let _e=be,rt=2;for(;ne.has(_e);)_e=`${be}-${rt}`,rt+=1;return _e},Rn=()=>{const ne={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};et([{kind:"inline",agent:ne},...$e]),ge(be=>({...be,[ne.id]:!0}))},xn=()=>{const T=g.find(_e=>_e.id===ee);if(!T)return;const ne=T.id;new Set($e.filter(_e=>_e.kind==="referenced").map(_e=>_e.ref)).has(ne)||et([...$e,{kind:"referenced",ref:ne}]),V("")},Tn=()=>{const T=g.find(rt=>rt.id===ee);if(!T)return;const ne=T.name||T.id,be=_n(ne),_e={...structuredClone(T),id:`agt-${Date.now()}`,name:be};et([...$e,{kind:"inline",agent:_e}]),ge(rt=>({...rt,[_e.id]:!0})),V(""),Oe({title:"Imported agent as inline",description:be})},ue=T=>{const ne=$e[T];if(!ne)return;const be=ne.kind==="inline"?ne.agent.id:ne.ref,_e=Jt.filter(rt=>rt!==be);se({runDefaults:{...A.runDefaults??{},selectedAgentNames:_e}}),ne.kind==="inline"&&ge(rt=>{const Ge={...rt};return delete Ge[ne.agent.id],Ge}),et($e.filter((rt,Ge)=>Ge!==T))},Ie=(T,ne)=>{const be=T+ne;if(be<0||be>=$e.length)return;const _e=[...$e],[rt]=_e.splice(T,1);_e.splice(be,0,rt),et(_e)},ct=T=>{const ne=$e[T];if(!ne||ne.kind!=="referenced")return;const be=xr(ne.ref);if(!be){Oe({title:"Referenced agent not found",variant:"destructive"});return}const _e=be.name||be.id,rt=_n(_e),Ge={...structuredClone(be),id:`agt-${Date.now()}`,name:rt},vt=[...$e];if(vt[T]={kind:"inline",agent:Ge},et(vt),Jt.includes(ne.ref)){const Be=Jt.map(Ct=>Ct===ne.ref?Ge.id:Ct);se({runDefaults:{...A.runDefaults??{},selectedAgentNames:Array.from(new Set(Be))}})}ge(Be=>({...Be,[Ge.id]:!0})),Oe({title:"Referenced agent converted to inline",description:rt})},bt=()=>{const T=y.find(rt=>rt.id===B);if(!T)return;const ne=[...de],be=[];for(const rt of T.serverIds){const Ge=ne.find(Lt=>Lt.kind==="referenced"&&Lt.ref===rt);if(Ge){be.push(Ge.ref);continue}const vt=p.find(Lt=>Lt.id===rt);if(!vt)continue;const Be=vt.name||vt.id,Ct=ne.find(Lt=>Lt.kind==="inline"&&(Lt.server.id===vt.id||(Lt.server.name||Lt.server.id)===Be));if(Ct){be.push(Ct.server.id);continue}const Vt={...structuredClone(vt),id:`srv-${Date.now()}-${be.length}`};ne.push({kind:"inline",server:Vt}),be.push(Vt.id)}const _e={...structuredClone(T),id:`scn-${Date.now()}`,serverIds:be.length>0?be:[]};Ne(ne),je([...Fe,{kind:"inline",scenario:_e}]),Ce(rt=>({...rt,[_e.id]:!0})),$("")},Wt=()=>{const ne={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};je([{kind:"inline",scenario:ne},...Fe]),Ce(be=>({...be,[ne.id]:!0}))},ln=()=>{const T=y.find(_e=>_e.id===B);if(!T)return;const ne=T.id;new Set(Fe.filter(_e=>_e.kind==="referenced").map(_e=>_e.ref)).has(ne)||je([...Fe,{kind:"referenced",ref:ne}]),$("")},Pt=T=>{const ne=Fe[T];ne?.kind==="inline"&&Ce(be=>{const _e={...be};return delete _e[ne.scenario.id],_e}),je(Fe.filter((be,_e)=>_e!==T))},rr=(T,ne)=>{const be=T+ne;if(be<0||be>=Fe.length)return;const _e=[...Fe],[rt]=_e.splice(T,1);_e.splice(be,0,rt),je(_e)},cn=T=>{const ne=Fe[T];if(!ne||ne.kind!=="referenced")return;const be=ja(ne.ref);if(!be){Oe({title:"Referenced scenario not found",variant:"destructive"});return}const _e=new Set(Fe.filter(Ir=>Ir.kind==="inline").map(Ir=>Ir.scenario.name?.trim().toLowerCase()).filter(Boolean)),rt=`${(be.name||be.id).trim()}-custom`;let Ge=rt,vt=2;for(;_e.has(Ge.toLowerCase());)Ge=`${rt}-${vt}`,vt+=1;const Be=Date.now(),Ct=[...de],Vt=[];for(const Ir of be.serverIds){const Xi=Ct.find(Mr=>Mr.kind==="referenced"&&Mr.ref===Ir);if(Xi){Vt.push(Xi.ref);continue}const Ca=p.find(Mr=>Mr.id===Ir);if(!Ca)continue;const Qo=Ca.name||Ca.id,Cf=Ct.find(Mr=>Mr.kind==="inline"&&(Mr.server.id===Ca.id||(Mr.server.name||Mr.server.id)===Qo));if(Cf){Vt.push(Cf.server.id);continue}const Af={...structuredClone(Ca),id:`srv-${Be}-${Vt.length}`};Ct.push({kind:"inline",server:Af}),Vt.push(Af.id)}Ne(Ct);const Lt={...structuredClone(be),id:`scn-${Be}`,name:Ge,serverIds:Vt},bn=[...Fe];bn[T]={kind:"inline",scenario:Lt},je(bn),Ce(Ir=>({...Ir,[Lt.id]:!0})),Oe({title:"Referenced scenario converted to inline",description:Ge})},Xt=T=>p.find(ne=>ne.id===T),xr=T=>g.find(ne=>ne.id===T),ja=T=>y.find(ne=>ne.id===T),Sa=de.filter(T=>T.kind==="referenced").map(T=>T.ref),ti=Sa.map(Xt).filter(T=>!!T),Gi=de.flatMap(T=>{if(T.kind==="referenced"){const ne=Xt(T.ref);return ne?[{server:ne,origin:"referenced",ref:T.ref}]:[]}return[{server:T.server,origin:"inline",ref:void 0}]}),Yo=$e.filter(T=>T.kind==="referenced").map(T=>T.ref),ni=Yo.map(xr).filter(T=>!!T);$e.filter(T=>T.kind==="inline");const Tr=$e.flatMap(T=>{if(T.kind==="referenced"){const ne=xr(T.ref);return ne?[{agent:ne,origin:"referenced",ref:T.ref}]:[]}return[{agent:T.agent,origin:"inline",ref:void 0}]}),Yi=Fe.filter(T=>T.kind==="referenced").map(T=>T.ref),es=Fe.flatMap(T=>{if(T.kind==="referenced"){const ne=ja(T.ref);return ne?[{scenario:ne,origin:"referenced"}]:[]}return[{scenario:T.scenario,origin:"inline"}]}),Qc=Array.from(new Map([...g,...A.agents,...ni].map(T=>[T.name||T.id,T])).values()),Xo=Array.from(new Map([...p,...A.servers,...ti].map(T=>[T.name||T.id,T])).values()),ea=Sa.filter(T=>!Xt(T)),ts=Yo.filter(T=>!xr(T)),Na=Yi.filter(T=>!ja(T));new Set(ea);const Jc=new Set(Na),K=de.length,he=$e.length,at=Fe.length;return v.useEffect(()=>{if(!ee)return;g.some(ne=>ne.id===ee)||V("")},[g,ee]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(yt,{to:"/mcp-evaluations",children:s.jsx(No,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h1",{className:"text-2xl font-bold truncate",children:Dt}),s.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":x?x.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(A.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[w&&!S&&s.jsx(ae,{size:"sm",onClick:()=>N(!0),children:"Edit"}),w&&!S&&x&&!Zt&&s.jsx(ae,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(yt,{to:`/run?configId=${encodeURIComponent(x.id)}`,children:[s.jsx(Ll,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),w&&!S&&Zt&&s.jsxs(Ke,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(nh,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(ae,{variant:"outline",size:"sm",onClick:()=>{P(structuredClone(x)),N(!1)},children:"Cancel"}),s.jsxs(ae,{size:"sm",onClick:()=>{Ye()},children:[s.jsx($U,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),Zt&&!S&&s.jsx(ze,{className:"border-destructive/40",children:s.jsxs(Ue,{className:"pt-6 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(nh,{className:"mt-0.5 h-5 w-5 text-destructive"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold",children:"This configuration is broken"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The file is still present, but it could not be loaded because one or more references or fields are invalid."})]})]}),s.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1",children:"File"}),s.jsx("p",{className:"text-xs font-mono break-all",children:x?.sourcePath||x?.description})]}),s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1 text-destructive",children:"Load Error"}),s.jsx("p",{className:"text-xs break-all text-destructive",children:x?.loadError})]}),(ea.length>0||ts.length>0||Na.length>0)&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-background p-3 space-y-1.5",children:[s.jsx("p",{className:"text-xs font-medium",children:"Broken references"}),ea.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:ea.join(", ")})]}),ts.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:ts.join(", ")})]}),Na.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:Na.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!Zt&&(A.loadWarnings?.length??0)>0&&s.jsx(ze,{className:"border-amber-500/30",children:s.jsxs(Ue,{className:"pt-4 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300",children:[s.jsx(nh,{className:"h-4 w-4"}),"Migration warnings"]}),A.loadWarnings?.map((T,ne)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:T},`${T}-${ne}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Ke,{variant:Le==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${kt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(fa,{className:"h-3 w-3"}),he," agent",he!==1?"s":""]})}),s.jsx(Ke,{variant:Le==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${kt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(l_,{className:"h-3 w-3"}),at," scenario",at!==1?"s":""]})}),s.jsx(Ke,{variant:Le==="servers"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${kt}/servers`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(d_,{className:"h-3 w-3"}),K," server",K!==1?"s":""]})})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${xt||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!xt&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Config ID"}),s.jsx(it,{value:A.name,onChange:T=>se({name:T.target.value}),disabled:xt,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Name (optional)"}),s.jsx(it,{value:A.configName||"",onChange:T=>se({configName:T.target.value}),disabled:xt,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Description"}),s.jsx(it,{value:A.description||"",onChange:T=>se({description:T.target.value}),disabled:xt,placeholder:"Brief description..."})]})]})})}),h&&s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold",children:"Snapshot Evaluation"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Config baseline versioning. One active baseline is selected; scenarios can opt in/out below."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Te,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(bm,{checked:A.snapshotEval?.enabled??!1,disabled:H,onCheckedChange:T=>{const ne=A.snapshotEval;ye({enabled:T,mode:ne?.mode??"warn",baselineSnapshotId:ne?.baselineSnapshotId,baselineSourceRunId:ne?.baselineSourceRunId})}})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Drift mode"}),s.jsxs(Kt,{value:A.snapshotEval?.mode??"warn",onValueChange:T=>{const ne=A.snapshotEval;ye({enabled:ne?.enabled??!1,mode:T,baselineSnapshotId:ne?.baselineSnapshotId,baselineSourceRunId:ne?.baselineSourceRunId})},children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"warn",children:"Warn"}),s.jsx(Je,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Active baseline"}),s.jsx("p",{className:"rounded-md border bg-muted/20 px-2 py-2 text-xs font-mono",children:A.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),A.id&&s.jsxs("div",{className:"grid gap-2 rounded-md border bg-muted/20 p-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(it,{value:k,onChange:T=>R(T.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),G===!1&&s.jsx("p",{className:"text-[11px] text-destructive",children:"Run is missing or not fully passing."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(it,{value:D,onChange:T=>U(T.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Switch baseline"}),s.jsxs(Kt,{value:z||A.snapshotEval?.baselineSnapshotId||"",onValueChange:T=>{L(T),ye({enabled:A.snapshotEval?.enabled??!0,mode:A.snapshotEval?.mode??"warn",baselineSnapshotId:T||void 0,baselineSourceRunId:A.snapshotEval?.baselineSourceRunId})},children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select snapshot"})}),s.jsx(qt,{children:E.map(T=>s.jsx(Je,{value:T.id,children:T.name},T.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{We()},disabled:Z||!k.trim()||G!==!0,children:Z?"Generating...":"Generate Baseline"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{ye({enabled:A.snapshotEval?.enabled??!1,mode:A.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:H,children:"Clear Baseline"})]})]})]})}),s.jsxs(sC,{value:Le,onValueChange:T=>{if(T!=="servers"&&T!=="agents"&&T!=="scenarios")return;const ne=new URLSearchParams(r);if(ne.delete("tab"),a(ne,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${T}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${T}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(Kv,{children:[s.jsxs(Ri,{value:"agents",className:"gap-1.5",children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Agents"]}),s.jsxs(Ri,{value:"scenarios",className:"gap-1.5",children:[s.jsx(l_,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(Ri,{value:"servers",className:"gap-1.5",children:[s.jsx(d_,{className:"h-3.5 w-3.5"}),"Servers"]})]}),s.jsxs(Hl,{value:"servers",children:[!xt&&s.jsx(ze,{className:"mb-4",children:s.jsxs(Ue,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(Kt,{value:F,onValueChange:Q,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select server from library"})}),s.jsx(qt,{children:p.map(T=>s.jsx(Je,{value:T.id,children:T.name||T.id},T.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:tr,children:"Add Ref"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:Sn,children:"Import Inline"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:nr,children:"Add server"})]})]}),s.jsxs("div",{className:"space-y-2",children:[de.map((T,ne)=>{const be=T.kind==="referenced"?Xt(T.ref):null,_e=T.kind==="inline"?T.server.name?.trim()||T.server.id:be?.name||T.ref,rt=T.kind==="inline"?T.server.id:T.ref,Ge=T.kind==="referenced"&&!be,vt=T.kind==="inline"&&!!ie[T.server.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>En(ne,-1),disabled:ne===0,"aria-label":"Move server up",children:s.jsx(Fa,{className:"h-3 w-3"})}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>En(ne,1),disabled:ne===de.length-1,"aria-label":"Move server down",children:s.jsx(It,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:_e}),s.jsx(Ke,{variant:T.kind==="inline"?"secondary":"outline",children:T.kind==="inline"?"Inline":"Referenced"}),Ge&&s.jsx(Ke,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[T.kind==="inline"&&s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>ce(Be=>({...Be,[T.server.id]:!Be[T.server.id]})),"aria-label":vt?"Collapse server details":"Expand server details",children:s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${vt?"rotate-180":""}`})}),T.kind==="referenced"&&s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>kr(ne),disabled:Ge,children:"Convert to inline"}),s.jsx(ae,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>wa(ne),"aria-label":"Remove server entry",children:s.jsx(_r,{className:"h-3.5 w-3.5"})})]})]}),T.kind==="inline"&&vt&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(_he,{servers:[T.server],onChange:Be=>{const Ct=Be[0];if(!Ct)return;const Vt=[...de];Vt[ne]={kind:"inline",server:Ct},Ne(Vt)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1,showHeader:!1})})]},`server-entry-${ne}-${rt}`)}),de.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No servers configured yet. Add inline servers or references."})]}),ea.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing server refs: ",ea.join(", ")]})]})}),xt?s.jsx(ze,{children:s.jsx(Ue,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[Gi.map((T,ne)=>{const be=T.ref??T.server.id,_e=!!ke[be];return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:T.server.name||T.server.id})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{variant:T.origin==="inline"?"secondary":"outline",children:T.origin==="inline"?"Inline":"Referenced"}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>pe(rt=>({...rt,[be]:!rt[be]})),"aria-label":_e?"Collapse server details":"Expand server details",children:s.jsx(It,{className:`h-4 w-4 transition-transform ${_e?"rotate-180":""}`})})]})]}),_e&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(Ke,{variant:"outline",className:"text-xs font-mono",children:T.server.transport}),T.server.url&&s.jsx("span",{className:"text-xs font-mono text-muted-foreground break-all",children:T.server.url})]})]},`server-view-${ne}-${be}`)}),Gi.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No servers configured."})]})})}):null]}),s.jsxs(Hl,{value:"agents",children:[!xt&&s.jsx(ze,{className:"mb-4",children:s.jsxs(Ue,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(Kt,{value:ee,onValueChange:V,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select agent from library"})}),s.jsx(qt,{children:Rr.map(T=>s.jsx(Je,{value:T.id,children:T.label},T.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!ee,onClick:xn,children:"Add Ref"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!ee,onClick:Tn,children:"Import Inline"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Rn,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[$e.map((T,ne)=>{const be=T.kind==="referenced"?xr(T.ref):null,_e=T.kind==="inline"?T.agent.name?.trim()||T.agent.id:be?.name||T.ref,rt=T.kind==="inline"?T.agent.model:be?.model||"unknown",Ge=T.kind==="inline"?T.agent.id:T.ref,vt=T.kind==="referenced"&&!be,Be=T.kind==="inline"?T.agent.id:T.ref,Ct=Jt.includes(Be),Vt=T.kind==="inline"&&!!J[T.agent.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ie(ne,-1),disabled:ne===0,"aria-label":"Move agent up",children:s.jsx(Fa,{className:"h-3 w-3"})}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ie(ne,1),disabled:ne===$e.length-1,"aria-label":"Move agent down",children:s.jsx(It,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:_e}),s.jsx(Ke,{variant:T.kind==="inline"?"secondary":"outline",children:T.kind==="inline"?"Inline":"Referenced"}),s.jsx(Ke,{variant:"outline",className:"font-mono text-[10px]",children:rt}),Ct&&s.jsx(Ke,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),vt&&s.jsx(Ke,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("label",{className:"mx-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx("input",{type:"checkbox",checked:Ct,onChange:Lt=>yr(Be,Lt.target.checked)}),s.jsx("span",{children:"Default"})]}),T.kind==="inline"&&s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>ge(Lt=>({...Lt,[T.agent.id]:!Lt[T.agent.id]})),children:Vt?"Collapse":"Expand"}),T.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>ct(ne),disabled:vt,children:"Convert to inline"})}),s.jsx(ae,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>ue(ne),"aria-label":"Remove agent entry",children:s.jsx(_r,{className:"h-3.5 w-3.5"})})]})]}),T.kind==="inline"&&Vt&&s.jsxs("div",{className:"border-t px-3 py-3 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Name"}),s.jsx(it,{value:T.agent.name,onChange:Lt=>{const bn=[...$e];bn[ne]={kind:"inline",agent:{...T.agent,name:Lt.target.value}},et(bn)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Provider"}),s.jsxs(Kt,{value:T.agent.provider,onValueChange:Lt=>{const bn=[...$e];bn[ne]={kind:"inline",agent:{...T.agent,provider:Lt}},et(bn)},children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"openai",children:"OpenAI"}),s.jsx(Je,{value:"anthropic",children:"Anthropic"}),s.jsx(Je,{value:"azure",children:"Azure OpenAI"}),s.jsx(Je,{value:"google",children:"Google"}),s.jsx(Je,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Model"}),s.jsx(it,{value:T.agent.model,onChange:Lt=>{const bn=[...$e];bn[ne]={kind:"inline",agent:{...T.agent,model:Lt.target.value}},et(bn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Max Tokens"}),s.jsx(it,{type:"number",min:1,max:128e3,value:T.agent.maxTokens,onChange:Lt=>{const bn=[...$e];bn[ne]={kind:"inline",agent:{...T.agent,maxTokens:parseInt(Lt.target.value)||0}},et(bn)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Temperature"}),s.jsx(it,{type:"number",min:0,max:2,step:.01,value:T.agent.temperature,onChange:Lt=>{const bn=[...$e];bn[ne]={kind:"inline",agent:{...T.agent,temperature:Number(Lt.target.value)||0}},et(bn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"System Prompt"}),s.jsx(Gs,{value:T.agent.systemPrompt||"",onChange:Lt=>{const bn=[...$e];bn[ne]={kind:"inline",agent:{...T.agent,systemPrompt:Lt.target.value}},et(bn)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ne}-${Ge}`)}),$e.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),ts.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",ts.join(", ")]})]})}),xt?s.jsx(ze,{children:s.jsx(Ue,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[Tr.map((T,ne)=>{const be=T.agent.name||T.agent.id,_e=Jt.includes(T.origin==="inline"?T.agent.id:T.ref||T.agent.id),rt=T.ref??T.agent.id,Ge=!!oe[rt];return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:be})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[_e&&s.jsx(Ke,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Ke,{variant:T.origin==="inline"?"secondary":"outline",children:T.origin==="inline"?"Inline":"Referenced"}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>xe(vt=>({...vt,[rt]:!vt[rt]})),"aria-label":Ge?"Collapse agent details":"Expand agent details",children:s.jsx(It,{className:`h-4 w-4 transition-transform ${Ge?"rotate-180":""}`})})]})]}),Ge&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(cB,{provider:T.agent.provider}),s.jsx(Ke,{variant:"outline",className:"text-xs font-mono",children:T.agent.model}),s.jsxs(Ke,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",T.agent.maxTokens]}),s.jsxs(Ke,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",T.agent.temperature]})]})]},`agent-view-${ne}-${T.ref??T.agent.id}`)}),Tr.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(Hl,{value:"scenarios",children:[!xt&&s.jsx(ze,{className:"mb-4",children:s.jsxs(Ue,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(Kt,{value:B,onValueChange:$,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select scenario from library"})}),s.jsx(qt,{children:y.map(T=>s.jsx(Je,{value:T.id,children:T.name||T.id},T.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:ln,children:"Add Ref"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:bt,children:"Import Inline"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Wt,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[Fe.map((T,ne)=>{const be=T.kind==="referenced"?ja(T.ref):null,_e=T.kind==="inline"?T.scenario.name?.trim()||T.scenario.id:be?.name||T.ref,rt=T.kind==="inline"&&!T.scenario.name?.trim(),Ge=T.kind==="referenced"&&Jc.has(T.ref),vt=T.kind==="inline"&&!!ve[T.scenario.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>rr(ne,-1),disabled:ne===0,"aria-label":"Move scenario up",children:s.jsx(Fa,{className:"h-3 w-3"})}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>rr(ne,1),disabled:ne===Fe.length-1,"aria-label":"Move scenario down",children:s.jsx(It,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:_e}),s.jsx(Ke,{variant:T.kind==="inline"?"secondary":"outline",children:T.kind==="inline"?"Inline":"Referenced"}),rt&&s.jsx(Ke,{variant:"destructive",children:"Name required"}),Ge&&s.jsx(Ke,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[T.kind==="inline"&&s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>Ce(Be=>({...Be,[T.scenario.id]:!Be[T.scenario.id]})),"aria-label":vt?"Collapse scenario details":"Expand scenario details",children:s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${vt?"rotate-180":""}`})}),T.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>cn(ne),disabled:Ge,children:"Convert to inline"})}),s.jsx(ae,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Pt(ne),"aria-label":"Remove scenario entry",children:s.jsx(_r,{className:"h-3.5 w-3.5"})})]})]}),T.kind==="inline"&&vt&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(fS,{scenarios:[T.scenario],scenarioOrigins:["inline"],agents:[...A.agents,...ni],servers:[...A.servers,...ti],configId:A.id,configPath:A.sourcePath,defaultAssistantAgentName:A.runDefaults?.selectedAgentNames?.[0],snapshotEval:A.snapshotEval,onChange:Be=>{const Ct=Be[0];if(!Ct)return;const Vt=[...Fe];Vt[ne]={kind:"inline",scenario:Ct},je(Vt)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${ne}-${T.kind==="inline"?T.scenario.id:T.ref}`)}),Fe.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),Na.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",Na.join(", ")]})]})}),xt?s.jsx(ze,{children:s.jsx(Ue,{className:"pt-4",children:s.jsx(fS,{scenarios:es.map(T=>T.scenario),scenarioOrigins:es.map(T=>T.origin),agents:Qc,servers:Xo,configId:A.id,configPath:A.sourcePath,defaultAssistantAgentName:A.runDefaults?.selectedAgentNames?.[0],snapshotEval:A.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var rme=Symbol("radix.slottable");function ame(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=rme,t}var v8="AlertDialog",[sme]=er(v8,[ID]),ei=ID(),g8=e=>{const{__scopeAlertDialog:t,...n}=e,r=ei(t);return s.jsx(Zm,{...r,...n,modal:!0})};g8.displayName=v8;var ime="AlertDialogTrigger",ome=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(qK,{...a,...r,ref:t})});ome.displayName=ime;var lme="AlertDialogPortal",y8=e=>{const{__scopeAlertDialog:t,...n}=e,r=ei(t);return s.jsx(ev,{...r,...n})};y8.displayName=lme;var cme="AlertDialogOverlay",x8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(Dc,{...a,...r,ref:t})});x8.displayName=cme;var Kl="AlertDialogContent",[ume,dme]=sme(Kl),fme=ame("AlertDialogContent"),b8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=ei(n),o=v.useRef(null),c=pt(t,o),d=v.useRef(null);return s.jsx(FK,{contentName:Kl,titleName:w8,docsSlug:"alert-dialog",children:s.jsx(ume,{scope:n,cancelRef:d,children:s.jsxs(Lc,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Pe(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(fme,{children:r}),s.jsx(hme,{contentRef:o})]})})})});b8.displayName=Kl;var w8="AlertDialogTitle",j8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(sf,{...a,...r,ref:t})});j8.displayName=w8;var S8="AlertDialogDescription",N8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(of,{...a,...r,ref:t})});N8.displayName=S8;var pme="AlertDialogAction",C8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ei(n);return s.jsx(tv,{...a,...r,ref:t})});C8.displayName=pme;var A8="AlertDialogCancel",E8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=dme(A8,n),i=ei(n),o=pt(t,a);return s.jsx(tv,{...i,...r,ref:o})});E8.displayName=A8;var hme=({contentRef:e})=>{const t=`\`${Kl}\` requires a description for the component to be accessible for screen reader users.
|
|
125
|
-
|
|
126
|
-
You can add a description to the \`${Kl}\` by passing a \`${S8}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
127
|
-
|
|
128
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Kl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
129
|
-
|
|
130
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},mme=g8,vme=y8,_8=x8,P8=b8,O8=C8,k8=E8,R8=j8,T8=N8;const ws=mme,gme=vme,I8=v.forwardRef(({className:e,...t},n)=>s.jsx(_8,{className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));I8.displayName=_8.displayName;const Ka=v.forwardRef(({className:e,...t},n)=>s.jsxs(gme,{children:[s.jsx(I8,{}),s.jsx(P8,{ref:n,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Ka.displayName=P8.displayName;const Ga=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ga.displayName="AlertDialogHeader";const Ya=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ya.displayName="AlertDialogFooter";const Xa=v.forwardRef(({className:e,...t},n)=>s.jsx(R8,{ref:n,className:Se("text-lg font-semibold",e),...t}));Xa.displayName=R8.displayName;const Qa=v.forwardRef(({className:e,...t},n)=>s.jsx(T8,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Qa.displayName=T8.displayName;const Ja=v.forwardRef(({className:e,...t},n)=>s.jsx(O8,{ref:n,className:Se(VS(),e),...t}));Ja.displayName=O8.displayName;const Za=v.forwardRef(({className:e,...t},n)=>s.jsx(k8,{ref:n,className:Se(VS({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Za.displayName=k8.displayName;const yme=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Va(),a=ya(),[i,o]=v.useState(null),c=p=>p.name?.trim()||p.id,d=async p=>{const g=`${c(p)}-copy`;let y=g,j=1;for(;e.some(x=>(x.name?.trim()||x.id)===y);)y=`${g}-${j}`,j+=1;const w={...structuredClone(p),id:`srv-${Date.now()}`,name:y};await t([...e,w]),Oe({title:"Server duplicated",description:`Created ${y}.`})},f=async p=>{await t(e.filter(g=>g.id!==p.id)),Oe({title:"Server deleted",description:`${c(p)} was removed.`}),o(null)},h=p=>p.transport==="stdio"?[p.command,...p.args||[]].filter(Boolean).join(" "):p.url||"";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(s$,{className:"h-6 w-6"}),"Servers"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable MCP server definitions shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(za,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ae,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Add Server"]})]})]}),e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers configured. Add one to get started."}),s.jsxs(ae,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Name"}),s.jsx(nt,{children:"Transport"}),s.jsx(nt,{children:"Endpoint"}),s.jsx(nt,{children:"Auth"}),s.jsx(nt,{className:"text-right",children:"Actions"})]})}),s.jsx(Yr,{children:e.map(p=>s.jsxs(zt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(He,{className:"font-medium",children:c(p)}),s.jsx(He,{children:s.jsx(Ke,{variant:"secondary",className:"font-mono text-xs",children:p.transport})}),s.jsx(He,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h(p)})}),s.jsx(He,{children:!p.authType||p.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(Ke,{variant:"outline",className:"text-xs",children:p.authType})}),s.jsx(He,{className:"text-right",onClick:g=>g.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(p),children:[s.jsx(_r,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{d(p)},children:[s.jsx(Ii,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(km,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},p.id))})]})})}),s.jsx(ws,{open:!!i,onOpenChange:p=>!p&&o(null),children:s.jsxs(Ka,{children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:"Delete server?"}),s.jsxs(Qa,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?c(i):""})," from the library. This action cannot be undone."]})]}),s.jsxs(Ya,{children:[s.jsx(Za,{children:"Cancel"}),s.jsx(Ja,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&f(i)},children:"Delete Server"})]})]})})]})},iM={stdio:"Check that the command is installed and the args are correct",sse:"Check that the server is running and the URL is reachable","streamable-http":"Check that the server is running and the URL is reachable"},xme=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"}),bme=()=>{const{serverId:e}=Fo(),t=ya(),{servers:n,setServers:r}=Va(),{source:a}=An(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(R=>R.id===o||R.name===o),d=R=>R.name?.trim()||R.id,[f,h]=v.useState(()=>c??xme()),[p,g]=v.useState(!1),[y,j]=v.useState(!1),[w,x]=v.useState({status:"idle"}),[S,N]=v.useState(!1);v.useEffect(()=>{c&&h(c)},[c]);const A=R=>{h(D=>({...D,authType:R,...R!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:D.oauthRedirectUrl||"http://localhost:6274/oauth/"}}))},P=async()=>{N(!0),x({status:"loading"});try{const D=(await a.discoverToolsForAnalysis({serverNames:[d(f)]})).servers[0];D&&D.warnings.length===0?x({status:"success",toolNames:D.tools.map(U=>U.name),toolCount:D.tools.length,testedAt:new Date().toISOString()}):x({status:"error",message:D?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(R){x({status:"error",message:R instanceof Error?R.message:String(R),testedAt:new Date().toISOString()})}},E=async()=>{if(!f.name.trim()){Oe({title:"Name is required",variant:"destructive"});return}j(!0);try{if(i)await r([...n,f]),Oe({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(f.id)}`);else{const R=n.map(D=>D.id===c?.id?f:D);await r(R),Oe({title:"Server saved"}),f.id!==o&&t(`/libraries/servers/${encodeURIComponent(f.id)}`,{replace:!0})}}finally{j(!1)}},O=async()=>{const R=n.filter(D=>D.id!==c?.id);await r(R),Oe({title:"Server deleted"}),t("/libraries/servers")},k=()=>f.transport==="stdio"?[f.command,...f.args||[]].filter(Boolean).join(" "):f.url||"";return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(yt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(No,{className:"h-4 w-4"})," Servers"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(yt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(No,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(ae,{type:"button",onClick:()=>{P()},children:[s.jsx(h$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(ze,{children:[s.jsxs(At,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Et,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>N(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Mi,{className:"h-4 w-4"})})]}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Server:"}),s.jsx("span",{className:"font-medium text-foreground",children:d(f)}),s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Transport:"}),s.jsx("span",{className:"font-medium text-foreground",children:f.transport}),k()&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsx("code",{className:"font-mono text-xs",children:k()})]})]}),w.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Connecting to MCP server…"]}),w.status==="success"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[s.jsx(Ql,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",w.toolCount," tool",w.toolCount!==1?"s":""]}),w.toolNames.length>0&&s.jsxs("div",{className:"rounded-md bg-muted p-3",children:[s.jsx("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"First 5 tools:"}),s.jsx("ul",{className:"space-y-0.5",children:w.toolNames.slice(0,5).map(R=>s.jsx("li",{className:"font-mono text-xs",children:R},R))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(w.testedAt).toLocaleString()]})]}),w.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," — ",w.message]}),iM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",iM[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(w.testedAt).toLocaleString()]})]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{children:s.jsx(Et,{className:"text-base",children:"Configuration"})}),s.jsxs(Ue,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Name"}),s.jsx(it,{value:f.name,onChange:R=>h(D=>({...D,name:R.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Transport"}),s.jsxs(Kt,{value:f.transport,onValueChange:R=>h(D=>({...D,transport:R})),children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"stdio",children:"stdio"}),s.jsx(Je,{value:"sse",children:"SSE"}),s.jsx(Je,{value:"streamable-http",children:"Streamable HTTP"})]})]})]})]}),f.transport==="stdio"?s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Command"}),s.jsx(it,{value:f.command||"",onChange:R=>h(D=>({...D,command:R.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Args (comma-separated)"}),s.jsx(it,{value:(f.args||[]).join(", "),onChange:R=>h(D=>({...D,args:R.target.value.split(",").map(U=>U.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"URL"}),s.jsx(it,{value:f.url||"",onChange:R=>h(D=>({...D,url:R.target.value})),placeholder:"http://localhost:3001/sse",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Auth Type"}),s.jsxs(Kt,{value:f.authType||"none",onValueChange:R=>A(R),children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"none",children:"None"}),s.jsx(Je,{value:"bearer",children:"Bearer Token"}),s.jsx(Je,{value:"api-key",children:"API Key"}),s.jsx(Je,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType&&f.authType!=="none"&&f.authType!=="oauth2"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:f.authType==="bearer"?"Token":"API Key"}),s.jsx(it,{type:"password",value:f.authValue||"",onChange:R=>h(D=>({...D,authValue:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),f.authType==="oauth2"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Client ID"}),s.jsx(it,{value:f.oauthClientId||"",onChange:R=>h(D=>({...D,oauthClientId:R.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(it,{type:"password",value:f.oauthClientSecret||"",onChange:R=>h(D=>({...D,oauthClientSecret:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Redirect URL"}),s.jsx(it,{value:f.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:R=>h(D=>({...D,oauthRedirectUrl:R.target.value})),placeholder:"http://localhost:6274/oauth/",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(it,{value:f.oauthScope||"",onChange:R=>h(D=>({...D,oauthScope:R.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(ae,{type:"button",variant:"destructive",size:"sm",onClick:()=>g(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(ae,{type:"button",size:"sm",onClick:()=>{E()},disabled:y,children:[y&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(ws,{open:p,onOpenChange:g,children:s.jsxs(Ka,{children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:"Delete server?"}),s.jsxs(Qa,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(Ya,{children:[s.jsx(Za,{children:"Cancel"}),s.jsx(Ja,{onClick:()=>{O()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},wme=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Va(),a=ya(),[i,o]=v.useState(null),c=async f=>{const h=`${f.name}-copy`;let p=h,g=1;for(;e.some(j=>j.name===p);)p=`${h}-${g}`,g+=1;const y={...structuredClone(f),id:`agt-${Date.now()}`,name:p};await t([...e,y]),Oe({title:"Agent duplicated",description:`Created ${p}.`})},d=async f=>{await t(e.filter(h=>h.id!==f.id)),Oe({title:"Agent deleted",description:`${f.name} was removed.`}),o(null)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(fa,{className:"h-6 w-6"}),"Agents"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable agent profiles shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(za,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ae,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]})]}),e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents configured. Add one to get started."}),s.jsxs(ae,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Name"}),s.jsx(nt,{children:"Provider"}),s.jsx(nt,{children:"Model"}),s.jsx(nt,{children:"Max Tokens"}),s.jsx(nt,{children:"Temperature"}),s.jsx(nt,{className:"text-right",children:"Actions"})]})}),s.jsx(Yr,{children:e.map(f=>s.jsxs(zt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(He,{className:"font-medium",children:f.name}),s.jsx(He,{children:s.jsx(cB,{provider:f.provider})}),s.jsx(He,{children:s.jsx("span",{className:"font-mono text-xs",children:f.model})}),s.jsx(He,{className:"font-mono text-xs",children:f.maxTokens}),s.jsx(He,{className:"font-mono text-xs",children:f.temperature.toFixed(2)}),s.jsx(He,{className:"text-right",onClick:h=>h.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(f),children:[s.jsx(_r,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{c(f)},children:[s.jsx(Ii,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(km,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},f.id))})]})})}),s.jsx(ws,{open:!!i,onOpenChange:f=>!f&&o(null),children:s.jsxs(Ka,{children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:"Delete agent?"}),s.jsxs(Qa,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(Ya,{children:[s.jsx(Za,{children:"Cancel"}),s.jsx(Ja,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&d(i)},children:"Delete Agent"})]})]})})]})};var M8=["PageUp","PageDown"],$8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],D8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Xc="Slider",[pS,jme,Sme]=Zd(Xc),[L8]=er(Xc,[Sme]),[Nme,eg]=L8(Xc),F8=v.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:i=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:y=!1,form:j,...w}=e,x=v.useRef(new Set),S=v.useRef(0),A=o==="horizontal"?Cme:Ame,[P=[],E]=Zr({prop:h,defaultProp:f,onChange:z=>{[...x.current][S.current]?.focus(),p(z)}}),O=v.useRef(P);function k(z){const L=kme(P,z);U(z,L)}function R(z){U(z,S.current)}function D(){const z=O.current[S.current];P[S.current]!==z&&g(P)}function U(z,L,{commit:G}={commit:!1}){const q=Mme(i),H=$me(Math.round((z-r)/i)*i+r,q),X=Jd(H,[r,a]);E((Z=[])=>{const I=Pme(Z,X,L);if(Ime(I,d*i)){S.current=I.indexOf(X);const F=String(I)!==String(Z);return F&&G&&g(I),F?I:Z}else return Z})}return s.jsx(Nme,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:S,thumbs:x.current,values:P,orientation:o,form:j,children:s.jsx(pS.Provider,{scope:e.__scopeSlider,children:s.jsx(pS.Slot,{scope:e.__scopeSlider,children:s.jsx(A,{"aria-disabled":c,"data-disabled":c?"":void 0,...w,ref:t,onPointerDown:Pe(w.onPointerDown,()=>{c||(O.current=P)}),min:r,max:a,inverted:y,onSlideStart:c?void 0:k,onSlideMove:c?void 0:R,onSlideEnd:c?void 0:D,onHomeKeyDown:()=>!c&&U(r,0,{commit:!0}),onEndKeyDown:()=>!c&&U(a,P.length-1,{commit:!0}),onStepKeyDown:({event:z,direction:L})=>{if(!c){const H=M8.includes(z.key)||z.shiftKey&&$8.includes(z.key)?10:1,X=S.current,Z=P[X],I=i*H*L;U(Z+I,X,{commit:!0})}}})})})})});F8.displayName=Xc;var[B8,z8]=L8(Xc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Cme=v.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,g]=v.useState(null),y=pt(t,A=>g(A)),j=v.useRef(void 0),w=Hc(a),x=w==="ltr",S=x&&!i||!x&&i;function N(A){const P=j.current||p.getBoundingClientRect(),E=[0,P.width],k=hC(E,S?[n,r]:[r,n]);return j.current=P,k(A-P.left)}return s.jsx(B8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(U8,{dir:w,"data-orientation":"horizontal",...h,ref:y,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:A=>{const P=N(A.clientX);o?.(P)},onSlideMove:A=>{const P=N(A.clientX);c?.(P)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:A=>{const E=D8[S?"from-left":"from-right"].includes(A.key);f?.({event:A,direction:E?-1:1})}})})}),Ame=v.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=v.useRef(null),p=pt(t,h),g=v.useRef(void 0),y=!a;function j(w){const x=g.current||h.current.getBoundingClientRect(),S=[0,x.height],A=hC(S,y?[r,n]:[n,r]);return g.current=x,A(w-x.top)}return s.jsx(B8,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:s.jsx(U8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const x=j(w.clientY);i?.(x)},onSlideMove:w=>{const x=j(w.clientY);o?.(x)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:w=>{const S=D8[y?"from-bottom":"from-top"].includes(w.key);d?.({event:w,direction:S?-1:1})}})})}),U8=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=eg(Xc,n);return s.jsx(qe.span,{...f,ref:t,onKeyDown:Pe(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):M8.concat($8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Pe(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(g)?g.focus():r(p)}),onPointerMove:Pe(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Pe(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),i(p))})})}),q8="SliderTrack",W8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=eg(q8,n);return s.jsx(qe.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});W8.displayName=q8;var hS="SliderRange",V8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=eg(hS,n),i=z8(hS,n),o=v.useRef(null),c=pt(t,o),d=a.values.length,f=a.values.map(g=>G8(g,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(qe.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});V8.displayName=hS;var mS="SliderThumb",H8=v.forwardRef((e,t)=>{const n=jme(e.__scopeSlider),[r,a]=v.useState(null),i=pt(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Eme,{...e,ref:i,index:o})}),Eme=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=eg(mS,n),c=z8(mS,n),[d,f]=v.useState(null),h=pt(t,N=>f(N)),p=d?o.form||!!d.closest("form"):!0,g=$m(d),y=o.values[r],j=y===void 0?0:G8(y,o.min,o.max),w=Ome(r,o.values.length),x=g?.[c.size],S=x?Rme(x,j,c.direction):0;return v.useEffect(()=>{if(d)return o.thumbs.add(d),()=>{o.thumbs.delete(d)}},[d,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${j}% + ${S}px)`},children:[s.jsx(pS.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(qe.span,{role:"slider","aria-label":e["aria-label"]||w,"aria-valuemin":o.min,"aria-valuenow":y,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:h,style:y===void 0?{display:"none"}:e.style,onFocus:Pe(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(K8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:y},r)]})});H8.displayName=mS;var _me="RadioBubbleInput",K8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=pt(a,r),o=Wv(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("input",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(qe.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});K8.displayName=_me;function Pme(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function G8(e,t,n){const i=100/(n-t)*(e-t);return Jd(i,[0,100])}function Ome(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function kme(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function Rme(e,t,n){const r=e/2,i=hC([0,50],[0,r]);return(r-i(t)*n)*n}function Tme(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Ime(e,t){if(t>0){const n=Tme(e);return Math.min(...n)>=t}return!0}function hC(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Mme(e){return(String(e).split(".")[1]||"").length}function $me(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Y8=F8,Dme=W8,Lme=V8,Fme=H8;const X8=v.forwardRef(({className:e,...t},n)=>s.jsxs(Y8,{ref:n,className:Se("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Dme,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Lme,{className:"absolute h-full bg-primary"})}),s.jsx(Fme,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));X8.displayName=Y8.displayName;function Bme(e){const t=zme(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(qme);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function zme(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Vme(a),c=Wme(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ume=Symbol("radix.slottable");function qme(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ume}function Wme(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Vme(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tg="Popover",[Q8]=er(tg,[Fi]),Sf=Fi(),[Hme,Ki]=Q8(tg),J8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=Sf(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,g]=Zr({prop:r,defaultProp:a??!1,onChange:i,caller:tg});return s.jsx(Dm,{...c,children:s.jsx(Hme,{scope:t,contentId:Bn(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:v.useCallback(()=>g(y=>!y),[g]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:o,children:n})})};J8.displayName=tg;var Z8="PopoverAnchor",Kme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ki(Z8,n),i=Sf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(nf,{...i,...r,ref:t})});Kme.displayName=Z8;var ez="PopoverTrigger",tz=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ki(ez,n),i=Sf(n),o=pt(t,a.triggerRef),c=s.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":iz(a.open),...r,ref:o,onClick:Pe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(nf,{asChild:!0,...i,children:c})});tz.displayName=ez;var mC="PopoverPortal",[Gme,Yme]=Q8(mC,{forceMount:void 0}),nz=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Ki(mC,t);return s.jsx(Gme,{scope:t,forceMount:n,children:s.jsx(Un,{present:n||i.open,children:s.jsx(Oc,{asChild:!0,container:a,children:r})})})};nz.displayName=mC;var _c="PopoverContent",rz=v.forwardRef((e,t)=>{const n=Yme(_c,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Ki(_c,e.__scopePopover);return s.jsx(Un,{present:r||i.open,children:i.modal?s.jsx(Qme,{...a,ref:t}):s.jsx(Jme,{...a,ref:t})})});rz.displayName=_c;var Xme=Bme("PopoverContent.RemoveScroll"),Qme=v.forwardRef((e,t)=>{const n=Ki(_c,e.__scopePopover),r=v.useRef(null),a=pt(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return Qm(o)},[]),s.jsx(af,{as:Xme,allowPinchZoom:!0,children:s.jsx(az,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Jme=v.forwardRef((e,t)=>{const n=Ki(_c,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(az,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),az=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,g=Ki(_c,n),y=Sf(n);return Ym(),s.jsx(rf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Do,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:s.jsx(Lm,{"data-state":iz(g.open),role:"dialog",id:g.contentId,...y,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),sz="PopoverClose",Zme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ki(sz,n);return s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>a.onOpenChange(!1))})});Zme.displayName=sz;var eve="PopoverArrow",tve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Sf(n);return s.jsx(Fm,{...a,...r,ref:t})});tve.displayName=eve;function iz(e){return e?"open":"closed"}var nve=J8,rve=tz,ave=nz,oz=rz;const sve=nve,ive=rve,lz=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(ave,{children:s.jsx(oz,{ref:a,align:t,sideOffset:n,className:Se("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));lz.displayName=oz.displayName;var oM=1,ove=.9,lve=.8,cve=.17,o1=.1,l1=.999,uve=.9999,dve=.99,fve=/[\\\/_+.#"@\[\(\{&]/,pve=/[\\\/_+.#"@\[\(\{&]/g,hve=/[\s-]/,cz=/[\s-]/g;function vS(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?oM:dve;var c=`${a},${i}`;if(o[c]!==void 0)return o[c];for(var d=r.charAt(i),f=n.indexOf(d,a),h=0,p,g,y,j;f>=0;)p=vS(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=oM:fve.test(e.charAt(f-1))?(p*=lve,y=e.slice(a,f-1).match(pve),y&&a>0&&(p*=Math.pow(l1,y.length))):hve.test(e.charAt(f-1))?(p*=ove,j=e.slice(a,f-1).match(cz),j&&a>0&&(p*=Math.pow(l1,j.length))):(p*=cve,a>0&&(p*=Math.pow(l1,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=uve)),(p<o1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(g=vS(e,t,n,r,f+1,i+2,o),g*o1>p&&(p=g*o1)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function lM(e){return e.toLowerCase().replace(cz," ")}function mve(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,vS(e,t,lM(e),lM(t),0,0,{})}var Vu='[cmdk-group=""]',c1='[cmdk-group-items=""]',vve='[cmdk-group-heading=""]',uz='[cmdk-item=""]',cM=`${uz}:not([aria-disabled="true"])`,gS="cmdk-item-select",Pl="data-value",gve=(e,t,n)=>mve(e,t,n),dz=v.createContext(void 0),Nf=()=>v.useContext(dz),fz=v.createContext(void 0),vC=()=>v.useContext(fz),pz=v.createContext(void 0),hz=v.forwardRef((e,t)=>{let n=Ol(()=>{var $,ee;return{search:"",value:(ee=($=e.value)!=null?$:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ol(()=>new Set),a=Ol(()=>new Map),i=Ol(()=>new Map),o=Ol(()=>new Set),c=mz(e),{label:d,children:f,value:h,onValueChange:p,filter:g,shouldFilter:y,loop:j,disablePointerSelection:w=!1,vimBindings:x=!0,...S}=e,N=Bn(),A=Bn(),P=Bn(),E=v.useRef(null),O=_ve();$o(()=>{if(h!==void 0){let $=h.trim();n.current.value=$,k.emit()}},[h]),$o(()=>{O(6,G)},[]);let k=v.useMemo(()=>({subscribe:$=>(o.current.add($),()=>o.current.delete($)),snapshot:()=>n.current,setState:($,ee,V)=>{var J,ge,ie,ce;if(!Object.is(n.current[$],ee)){if(n.current[$]=ee,$==="search")L(),U(),O(1,z);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let oe=document.getElementById(P);oe?oe.focus():(J=document.getElementById(N))==null||J.focus()}if(O(7,()=>{var oe;n.current.selectedItemId=(oe=q())==null?void 0:oe.id,k.emit()}),V||O(5,G),((ge=c.current)==null?void 0:ge.value)!==void 0){let oe=ee??"";(ce=(ie=c.current).onValueChange)==null||ce.call(ie,oe);return}}k.emit()}},emit:()=>{o.current.forEach($=>$())}}),[]),R=v.useMemo(()=>({value:($,ee,V)=>{var J;ee!==((J=i.current.get($))==null?void 0:J.value)&&(i.current.set($,{value:ee,keywords:V}),n.current.filtered.items.set($,D(ee,V)),O(2,()=>{U(),k.emit()}))},item:($,ee)=>(r.current.add($),ee&&(a.current.has(ee)?a.current.get(ee).add($):a.current.set(ee,new Set([$]))),O(3,()=>{L(),U(),n.current.value||z(),k.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let V=q();O(4,()=>{L(),V?.getAttribute("id")===$&&z(),k.emit()})}),group:$=>(a.current.has($)||a.current.set($,new Set),()=>{i.current.delete($),a.current.delete($)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:P,labelId:A,listInnerRef:E}),[]);function D($,ee){var V,J;let ge=(J=(V=c.current)==null?void 0:V.filter)!=null?J:gve;return $?ge($,n.current.search,ee):0}function U(){if(!n.current.search||c.current.shouldFilter===!1)return;let $=n.current.filtered.items,ee=[];n.current.filtered.groups.forEach(J=>{let ge=a.current.get(J),ie=0;ge.forEach(ce=>{let oe=$.get(ce);ie=Math.max(oe,ie)}),ee.push([J,ie])});let V=E.current;H().sort((J,ge)=>{var ie,ce;let oe=J.getAttribute("id"),xe=ge.getAttribute("id");return((ie=$.get(xe))!=null?ie:0)-((ce=$.get(oe))!=null?ce:0)}).forEach(J=>{let ge=J.closest(c1);ge?ge.appendChild(J.parentElement===ge?J:J.closest(`${c1} > *`)):V.appendChild(J.parentElement===V?J:J.closest(`${c1} > *`))}),ee.sort((J,ge)=>ge[1]-J[1]).forEach(J=>{var ge;let ie=(ge=E.current)==null?void 0:ge.querySelector(`${Vu}[${Pl}="${encodeURIComponent(J[0])}"]`);ie?.parentElement.appendChild(ie)})}function z(){let $=H().find(V=>V.getAttribute("aria-disabled")!=="true"),ee=$?.getAttribute(Pl);k.setState("value",ee||void 0)}function L(){var $,ee,V,J;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ge=0;for(let ie of r.current){let ce=(ee=($=i.current.get(ie))==null?void 0:$.value)!=null?ee:"",oe=(J=(V=i.current.get(ie))==null?void 0:V.keywords)!=null?J:[],xe=D(ce,oe);n.current.filtered.items.set(ie,xe),xe>0&&ge++}for(let[ie,ce]of a.current)for(let oe of ce)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=ge}function G(){var $,ee,V;let J=q();J&&((($=J.parentElement)==null?void 0:$.firstChild)===J&&((V=(ee=J.closest(Vu))==null?void 0:ee.querySelector(vve))==null||V.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function q(){var $;return($=E.current)==null?void 0:$.querySelector(`${uz}[aria-selected="true"]`)}function H(){var $;return Array.from((($=E.current)==null?void 0:$.querySelectorAll(cM))||[])}function X($){let ee=H()[$];ee&&k.setState("value",ee.getAttribute(Pl))}function Z($){var ee;let V=q(),J=H(),ge=J.findIndex(ce=>ce===V),ie=J[ge+$];(ee=c.current)!=null&&ee.loop&&(ie=ge+$<0?J[J.length-1]:ge+$===J.length?J[0]:J[ge+$]),ie&&k.setState("value",ie.getAttribute(Pl))}function I($){let ee=q(),V=ee?.closest(Vu),J;for(;V&&!J;)V=$>0?Ave(V,Vu):Eve(V,Vu),J=V?.querySelector(cM);J?k.setState("value",J.getAttribute(Pl)):Z($)}let F=()=>X(H().length-1),Q=$=>{$.preventDefault(),$.metaKey?F():$.altKey?I(1):Z(1)},B=$=>{$.preventDefault(),$.metaKey?X(0):$.altKey?I(-1):Z(-1)};return v.createElement(qe.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:$=>{var ee;(ee=S.onKeyDown)==null||ee.call(S,$);let V=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||V))switch($.key){case"n":case"j":{x&&$.ctrlKey&&Q($);break}case"ArrowDown":{Q($);break}case"p":case"k":{x&&$.ctrlKey&&B($);break}case"ArrowUp":{B($);break}case"Home":{$.preventDefault(),X(0);break}case"End":{$.preventDefault(),F();break}case"Enter":{$.preventDefault();let J=q();if(J){let ge=new Event(gS);J.dispatchEvent(ge)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Ove},d),ng(e,$=>v.createElement(fz.Provider,{value:k},v.createElement(dz.Provider,{value:R},$))))}),yve=v.forwardRef((e,t)=>{var n,r;let a=Bn(),i=v.useRef(null),o=v.useContext(pz),c=Nf(),d=mz(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;$o(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=vz(a,i,[e.value,e.children,i],e.keywords),p=vC(),g=Li(O=>O.value&&O.value===h.current),y=Li(O=>f||c.filter()===!1?!0:O.search?O.filtered.items.get(a)>0:!0);v.useEffect(()=>{let O=i.current;if(!(!O||e.disabled))return O.addEventListener(gS,j),()=>O.removeEventListener(gS,j)},[y,e.onSelect,e.disabled]);function j(){var O,k;w(),(k=(O=d.current).onSelect)==null||k.call(O,h.current)}function w(){p.setState("value",h.current,!0)}if(!y)return null;let{disabled:x,value:S,onSelect:N,forceMount:A,keywords:P,...E}=e;return v.createElement(qe.div,{ref:vr(i,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!g,"data-disabled":!!x,"data-selected":!!g,onPointerMove:x||c.getDisablePointerSelection()?void 0:w,onClick:x?void 0:j},e.children)}),xve=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=Bn(),c=v.useRef(null),d=v.useRef(null),f=Bn(),h=Nf(),p=Li(y=>a||h.filter()===!1?!0:y.search?y.filtered.groups.has(o):!0);$o(()=>h.group(o),[]),vz(o,c,[e.value,e.heading,d]);let g=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(qe.div,{ref:vr(c,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&v.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),ng(e,y=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(pz.Provider,{value:g},y))))}),bve=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=Li(o=>!o.search);return!n&&!i?null:v.createElement(qe.div,{ref:vr(a,t),...r,"cmdk-separator":"",role:"separator"})}),wve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=vC(),o=Li(f=>f.search),c=Li(f=>f.selectedItemId),d=Nf();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.createElement(qe.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":c,id:d.inputId,type:"text",value:a?e.value:o,onChange:f=>{a||i.setState("search",f.target.value),n?.(f.target.value)}})}),jve=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=Li(f=>f.selectedItemId),d=Nf();return v.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let y=f.offsetHeight;h.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),v.createElement(qe.div,{ref:vr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},ng(e,f=>v.createElement("div",{ref:vr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Sve=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(Zm,{open:n,onOpenChange:r},v.createElement(ev,{container:o},v.createElement(Dc,{"cmdk-overlay":"",className:a}),v.createElement(Lc,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement(hz,{ref:t,...c}))))}),Nve=v.forwardRef((e,t)=>Li(n=>n.filtered.count===0)?v.createElement(qe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Cve=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(qe.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},ng(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),Or=Object.assign(hz,{List:jve,Item:yve,Input:wve,Group:xve,Separator:bve,Dialog:Sve,Empty:Nve,Loading:Cve});function Ave(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Eve(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function mz(e){let t=v.useRef(e);return $o(()=>{t.current=e}),t}var $o=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Ol(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Li(e){let t=vC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function vz(e,t,n,r=[]){let a=v.useRef(),i=Nf();return $o(()=>{var o;let c=(()=>{var f;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(f=h.current.textContent)==null?void 0:f.trim():a.current}})(),d=r.map(f=>f.trim());i.value(e,c,d),(o=t.current)==null||o.setAttribute(Pl,c),a.current=c}),a}var _ve=()=>{let[e,t]=v.useState(),n=Ol(()=>new Map);return $o(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Pve(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ng({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(Pve(t),{ref:t.ref},n(t.props.children)):n(t)}var Ove={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const gz=v.forwardRef(({className:e,...t},n)=>s.jsx(Or,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));gz.displayName=Or.displayName;const yz=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(AS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Or.Input,{ref:n,className:Se("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));yz.displayName=Or.Input.displayName;const xz=v.forwardRef(({className:e,...t},n)=>s.jsx(Or.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));xz.displayName=Or.List.displayName;const bz=v.forwardRef((e,t)=>s.jsx(Or.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));bz.displayName=Or.Empty.displayName;const wz=v.forwardRef(({className:e,...t},n)=>s.jsx(Or.Group,{ref:n,className:Se("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));wz.displayName=Or.Group.displayName;const kve=v.forwardRef(({className:e,...t},n)=>s.jsx(Or.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",e),...t}));kve.displayName=Or.Separator.displayName;const yS=v.forwardRef(({className:e,...t},n)=>s.jsx(Or.Item,{ref:n,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));yS.displayName=Or.Item.displayName;const uM={openai:["gpt-4o","gpt-4o-mini","gpt-4-turbo","o1","o1-mini"],anthropic:["claude-3-5-sonnet-latest","claude-3-5-haiku-latest","claude-3-opus-latest"],azure:["gpt-4o","gpt-4-turbo"],google:["gemini-2.0-flash","gemini-1.5-pro"],custom:[]},dM={anthropic:"Check that `ANTHROPIC_API_KEY` is set in your environment",openai:"Check that `OPENAI_API_KEY` is set in your environment",azure:"Check that Azure OpenAI env vars are configured in your environment"},Rve=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Tve=()=>{const{agentName:e}=Fo(),t=ya(),{agents:n,setAgents:r}=Va(),{source:a}=An(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(I=>I.id===o)??n.find(I=>I.name===o),[d,f]=v.useState(()=>c??Rve()),[h,p]=v.useState(!1),[g,y]=v.useState(!1),[j,w]=v.useState({status:"idle"}),[x,S]=v.useState(!1),[N,A]=v.useState([]),[P,E]=v.useState(!1),[O,k]=v.useState(!1),[R,D]=v.useState(!1);v.useEffect(()=>{c&&f(c)},[c]);const U=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",z=Array.from(new Set([...uM[d.provider]||[],...N])),L=z.includes(d.model),G=R||!!d.model&&!L,q=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){w({status:"unsupported"});return}w({status:"loading"});try{const I=await a.listProviderModels(d.provider);w({status:"success",items:I.items,source:I.source,kind:I.kind,testedAt:new Date().toISOString()})}catch(I){w({status:"error",message:I instanceof Error?I.message:String(I),testedAt:new Date().toISOString()})}},H=async()=>{if(!U){Oe({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}E(!0);try{const I=await a.listProviderModels(d.provider);A(I.items),Oe({title:I.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${I.items.length} ${I.kind} from ${I.source}`})}catch(I){Oe({title:"Could not load provider models",description:String(I instanceof Error?I.message:I),variant:"destructive"})}finally{E(!1)}},X=async()=>{if(!d.name.trim()){Oe({title:"Name is required",variant:"destructive"});return}y(!0);try{if(i)await r([...n,d]),Oe({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const I=n.map(F=>F.id===c?.id?d:F);await r(I),Oe({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{y(!1)}},Z=async()=>{const I=n.filter(F=>F.id!==c?.id);await r(I),Oe({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(yt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(No,{className:"h-4 w-4"})," Agents"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(yt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(No,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(ae,{type:"button",onClick:()=>{q()},children:[s.jsx(h$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),x&&s.jsxs(ze,{children:[s.jsxs(At,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Et,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>S(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Mi,{className:"h-4 w-4"})})]}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Provider:"}),s.jsx("span",{className:"font-medium text-foreground",children:d.provider}),s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsxs("code",{className:"font-mono text-xs",children:["/api/providers/models?provider=",d.provider]})]}),j.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Testing connection..."]}),j.status==="success"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[s.jsx(Ql,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",j.items.length," ",j.kind," from"," ",j.source]}),s.jsxs("div",{className:"rounded-md bg-muted p-3",children:[s.jsxs("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:["First 5 ",j.kind,":"]}),s.jsx("ul",{className:"space-y-0.5",children:j.items.slice(0,5).map(I=>s.jsx("li",{className:"font-mono text-xs",children:I},I))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," —"," ",j.message]}),dM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",dM[d.provider]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="unsupported"&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:["Connection testing is not supported for the"," ",s.jsx("span",{className:"font-medium",children:d.provider})," provider. Supported providers: Anthropic, OpenAI, Azure OpenAI."]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{children:s.jsx(Et,{className:"text-base",children:"Configuration"})}),s.jsxs(Ue,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Name"}),s.jsx(it,{value:d.name,onChange:I=>f(F=>({...F,name:I.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Provider"}),s.jsxs(Kt,{value:d.provider,onValueChange:I=>f(F=>({...F,provider:I,model:uM[I]?.[0]||""})),children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"openai",children:"OpenAI"}),s.jsx(Je,{value:"anthropic",children:"Anthropic"}),s.jsx(Je,{value:"azure",children:"Azure OpenAI"}),s.jsx(Je,{value:"google",children:"Google"}),s.jsx(Je,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(sve,{open:O,onOpenChange:k,children:[s.jsx(ive,{asChild:!0,children:s.jsxs(ae,{type:"button",variant:"outline",role:"combobox","aria-expanded":O,className:"h-9 flex-1 justify-between font-mono text-xs",children:[s.jsx("span",{className:"truncate text-left",children:d.model||"Select model..."}),s.jsx(It,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(lz,{className:"w-[420px] p-0",align:"start",children:s.jsxs(gz,{children:[s.jsx(yz,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(xz,{children:[s.jsxs(bz,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(wz,{heading:d.provider==="azure"?"Deployments":"Models",children:[z.map(I=>s.jsxs(yS,{value:I,onSelect:F=>{f(Q=>({...Q,model:F})),D(!1),k(!1)},children:[s.jsx(Ql,{className:Se("mr-2 h-4 w-4",d.model===I?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:I})]},I)),s.jsx(yS,{value:"__custom_model_id__",onSelect:()=>{D(!0),k(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),U&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{H()},disabled:P,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[P?s.jsx(Zn,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(za,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),G&&s.jsx(it,{value:d.model,onChange:I=>f(F=>({...F,model:I.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),N.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",N.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Max Tokens"}),s.jsx(it,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:I=>f(F=>({...F,maxTokens:parseInt(I.target.value)||0})),className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Te,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(X8,{value:[d.temperature],onValueChange:([I])=>f(F=>({...F,temperature:I})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"System Prompt"}),s.jsx(Gs,{value:d.systemPrompt||"",onChange:I=>f(F=>({...F,systemPrompt:I.target.value})),placeholder:"Optional system prompt...",rows:3,className:"text-xs"})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(ae,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(ae,{type:"button",size:"sm",onClick:()=>{X()},disabled:g,children:[g&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(ws,{open:h,onOpenChange:p,children:s.jsxs(Ka,{children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:"Delete agent?"}),s.jsxs(Qa,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(Ya,{children:[s.jsx(Za,{children:"Cancel"}),s.jsx(Ja,{onClick:()=>{Z()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},fM="mcplab.resultAssistantScenarioHandoff",pM=()=>{const{testCaseId:e}=Fo(),[t,n]=$c(),r=ya(),{source:a}=An(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Va(),[p,g]=v.useState(""),[y,j]=v.useState("all"),[w,x]=v.useState("name"),[S,N]=v.useState("asc"),[A,P]=v.useState(""),[E,O]=v.useState(null),[k,R]=v.useState("idle"),[D,U]=v.useState(""),[z,L]=v.useState(""),[G,q]=v.useState(0),[H,X]=v.useState(null),Z=v.useRef(null),I=v.useRef(!1),F=v.useRef(!1),Q=v.useRef(null),B=v.useRef(0),$=e?decodeURIComponent(e):void 0,ee=$?i.findIndex(se=>se.id===$):-1,V=ee>=0?i[ee]:void 0,J=async se=>{if(!V||ee<0||!se)return;const de=[...i];de[ee]=se,await o(de)},ge=async()=>{const se=Q.current;if(!se||!V)return;if(I.current){F.current=!0;return}I.current=!0,F.current=!1;const de=++B.current;R("saving"),U("");try{await J(se),de===B.current&&R("saved")}catch(Ne){const Fe=Ne instanceof Error?Ne.message:String(Ne);de===B.current&&(R("error"),U(Fe)),Oe({title:"Could not save scenario",description:Fe,variant:"destructive"})}finally{I.current=!1,F.current&&(F.current=!1,ge())}},ie=se=>{Q.current=se,R("dirty"),U(""),Z.current&&window.clearTimeout(Z.current),Z.current=window.setTimeout(()=>{Z.current=null,ge()},700)},ce=async()=>{const se=`scn-${Date.now()}`;let de=se,Ne=1;for(;i.some(je=>je.id===de);)de=`${se}-${Ne}`,Ne+=1;const Fe={id:de,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,Fe]),r(`/libraries/test-cases/${encodeURIComponent(de)}`),Oe({title:"Test case created",description:`Opened ${de} for editing.`})},oe=se=>{const de=(se||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let Ne=de,Fe=1;for(;i.some(je=>je.id===Ne);)Ne=`${de}-${Fe}`,Fe+=1;return Ne},xe=async(se,de=!1)=>{const Ne=oe(`${se.id}-copy`),Fe={...structuredClone(se),id:Ne,name:se.name?`${se.name} (Copy)`:""};await o([...i,Fe]),Oe({title:"Test case duplicated",description:`Created ${Fe.id}.`}),de&&r(`/libraries/test-cases/${encodeURIComponent(Fe.id)}`)},ke=async se=>{Z.current&&(window.clearTimeout(Z.current),Z.current=null);const de=i.filter(Ne=>Ne.id!==se.id);await o(de),Oe({title:"Test case deleted",description:`${se.id} was removed.`}),V?.id===se.id&&(O(null),Q.current=null,R("idle"),U(""),r("/libraries/test-cases"))},pe=se=>se.map(de=>d.find(Ne=>Ne.id===de)).filter(Boolean).map(de=>de?.name||de?.id).filter(Boolean),ve=v.useMemo(()=>{const se=new Set;for(const de of i)for(const Ne of pe(de.serverIds))se.add(Ne);return Array.from(se).sort((de,Ne)=>de.localeCompare(Ne))},[i,d]),Ce=v.useMemo(()=>{const se=p.trim().toLowerCase(),de=i.filter(Ne=>{const Fe=(Ne.name||"").toLowerCase(),je=Ne.id.toLowerCase(),$e=(Ne.prompt||"").toLowerCase(),et=pe(Ne.serverIds);return y!=="all"&&!et.includes(y)?!1:se?Fe.includes(se)||je.includes(se)||$e.includes(se)||et.some(xt=>xt.toLowerCase().includes(se)):!0});return de.sort((Ne,Fe)=>{const je=pe(Ne.serverIds),$e=pe(Fe.serverIds);let et=0;switch(w){case"id":et=Ne.id.localeCompare(Fe.id);break;case"servers":et=je.length-$e.length;break;case"evalRules":et=Ne.evalRules.length-Fe.evalRules.length;break;case"extractRules":et=Ne.extractRules.length-Fe.extractRules.length;break;default:et=(Ne.name||Ne.id).localeCompare(Fe.name||Fe.id);break}return et===0&&(et=Ne.id.localeCompare(Fe.id)),S==="asc"?et:-et}),de},[i,p,y,w,S,d]);v.useEffect(()=>{let se=!0;return a.getWorkspaceSettings().then(de=>{!se||!de||P(de.scenarioAssistantAgentName??"")}).catch(()=>{se&&P("")}),()=>{se=!1}},[a]),v.useEffect(()=>{if($&&t.get("assistantHandoff")==="1")try{const se=window.sessionStorage.getItem(fM);if(!se)return;const de=JSON.parse(se);if(!de||de.scenarioId!==$||!de.prompt)return;L(String(de.prompt)),q(Date.now()),window.sessionStorage.removeItem(fM);const Ne=new URLSearchParams(t);Ne.delete("assistantHandoff"),n(Ne,{replace:!0}),Oe({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[$,t,n]),v.useEffect(()=>{V?(O(structuredClone(V)),Q.current=structuredClone(V),R("idle"),U("")):(O(null),Q.current=null,R("idle"),U("")),Z.current&&(window.clearTimeout(Z.current),Z.current=null),I.current=!1,F.current=!1},[V]),v.useEffect(()=>()=>{Z.current&&window.clearTimeout(Z.current)},[]);const Le=A||c[0]?.name||"";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(i$,{className:"h-6 w-6"}),"Manage Test Cases"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable test case templates shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[V&&s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(No,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(za,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!V&&s.jsxs(ae,{type:"button",size:"sm",onClick:()=>{ce()},children:[s.jsx(Ba,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!V&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/30 p-3 md:grid-cols-[1.6fr_1fr_1fr_auto]",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(AS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(it,{value:p,onChange:se=>g(se.target.value),placeholder:"Search by name, id, prompt, server...",className:"h-8 pl-8 text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Server Filter"}),s.jsxs(Kt,{value:y,onValueChange:j,children:[s.jsx(Ut,{className:"h-8 text-xs",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All servers"}),ve.map(se=>s.jsx(Je,{value:se,children:se},se))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Sort By"}),s.jsxs(Kt,{value:w,onValueChange:se=>x(se),children:[s.jsx(Ut,{className:"h-8 text-xs",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"name",children:"Name"}),s.jsx(Je,{value:"id",children:"ID"}),s.jsx(Je,{value:"servers",children:"# Servers"}),s.jsx(Je,{value:"evalRules",children:"# Eval Rules"}),s.jsx(Je,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Direction"}),s.jsxs(Kt,{value:S,onValueChange:se=>N(se),children:[s.jsx(Ut,{className:"h-8 w-28 text-xs",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"asc",children:"Ascending"}),s.jsx(Je,{value:"desc",children:"Descending"})]})]})]})]}),s.jsx(ze,{children:s.jsxs(Ue,{className:"space-y-3 pt-6",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",Ce.length," of ",i.length," test case",i.length!==1?"s":"","."]}),$&&!V&&s.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Test case ",s.jsx("code",{className:"font-mono",children:$})," was not found."]}),i.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):Ce.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No test cases match the current filters."}):s.jsx("div",{className:"grid gap-3",children:Ce.map(se=>{const de=$===se.id,Ne=`/libraries/test-cases/${encodeURIComponent(se.id)}`,Fe=pe(se.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${de?"border-primary bg-primary/5":""}`,children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"space-y-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(yt,{to:Ne,className:"font-medium truncate hover:underline",children:se.name||se.id}),s.jsx(Ke,{variant:"outline",className:"font-mono text-[10px]",children:se.id}),de&&s.jsx(Ke,{children:"Selected"})]}),s.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1",children:[s.jsxs("span",{children:[Fe.length," server",Fe.length!==1?"s":""]}),s.jsxs("span",{children:[se.evalRules.length," eval rule",se.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[se.extractRules.length," extract rule",se.extractRules.length!==1?"s":""]})]}),Fe.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:Fe.map(je=>s.jsx(Ke,{variant:"secondary",className:"text-[10px]",children:je},`${se.id}-${je}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>X(se),children:[s.jsx(_r,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{xe(se)},children:[s.jsx(Ii,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(ae,{type:"button",size:"sm",variant:de?"default":"outline",asChild:!0,children:s.jsxs(yt,{to:Ne,children:[s.jsx(km,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},se.id)})})]})})]}),V&&E?s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("div",{children:s.jsx(Et,{className:"text-base",children:"Edit Test Case"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{xe(E,!0)},children:[s.jsx(Ii,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>X(E),children:[s.jsx(_r,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("span",{children:["Focused editor for ",s.jsx("code",{className:"font-mono",children:V.id}),"."]}),s.jsx(Ke,{variant:"outline",className:`text-[10px] ${k==="saving"?"border-amber-300 text-amber-700":k==="saved"?"border-emerald-300 text-emerald-700":k==="error"?"border-destructive/40 text-destructive":k==="dirty"?"border-sky-300 text-sky-700":""}`,children:k==="saving"?"Saving...":k==="saved"?"Saved":k==="error"?"Save failed":k==="dirty"?"Unsaved changes":"Ready"}),k==="error"&&D&&s.jsx("span",{className:"text-[11px] text-destructive",children:D})]})})]}),s.jsx(Ue,{className:"pt-3",children:s.jsx(fS,{scenarios:[E],agents:c,servers:d,defaultAssistantAgentName:Le,assistantInitialPromptByScenarioId:z&&E?.id?{[E.id]:z}:void 0,assistantAutoOpenNonceByScenarioId:E?.id&&G?{[E.id]:G}:void 0,onChange:se=>{const de=se[0];de&&(O(de),ie(de))},allowAdd:!1})})]}):null,s.jsx(ws,{open:!!H,onOpenChange:se=>!se&&X(null),children:s.jsxs(Ka,{children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:"Delete test case?"}),s.jsxs(Qa,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:H?.name||H?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Ya,{children:[s.jsx(Za,{children:"Cancel"}),s.jsx(Ja,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{H&&(ke(H),X(null))},children:"Delete Test Case"})]})]})})]})},Ive=()=>{const{source:e}=An(),{agents:t,reload:n,loading:r}=Va(),[a,i]=v.useState(!1),[o,c]=v.useState(!1),[d,f]=v.useState(""),h=v.useMemo(()=>d||t[0]?.name||"",[d,t]),p=async()=>{i(!0);try{const j=await e.getWorkspaceSettings();f(j?.scenarioAssistantAgentName??"")}catch(j){f(""),Oe({title:"Could not load settings",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{p()},[e]);const g=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),Oe({title:"Settings updated",description:j?`Scenario Assistant Agent set to ${j}.`:"Scenario Assistant Agent cleared (will use first available agent by default)."})}catch(w){Oe({title:"Could not save settings",description:w instanceof Error?w.message:String(w),variant:"destructive"})}finally{c(!1)}},y=async()=>{await Promise.all([n(),p()])};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(ES,{className:"h-6 w-6"}),"Settings"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Workspace-level MCP Lab settings and defaults."})]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{y()},disabled:r||a,children:[s.jsx(za,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(Et,{className:"text-base",children:"Scenario Assistant"}),s.jsx(Ls,{children:"Default assistant model used on library test case pages. If unset, MCP Lab uses the first available agent automatically."})]}),s.jsxs(Ue,{className:"grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Assistant Agent"}),s.jsxs(Kt,{value:h||"__none__",onValueChange:j=>{g(j==="__none__"?"":j)},disabled:o,children:[s.jsx(Ut,{className:"h-9 text-sm",children:s.jsx(Gt,{placeholder:"Select assistant agent"})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(Je,{value:j.name||j.id,children:[j.name||j.id," · ",j.model]},j.id))]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Applies to `/libraries/test-cases/:testCaseId`. MCP Evaluation editors can still override the assistant agent from their evaluation context."})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Saved in workspace settings"})]})]})]})};var rg="Checkbox",[Mve]=er(rg),[$ve,gC]=Mve(rg);function Dve(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:o,name:c,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:p}=e,[g,y]=Zr({prop:n,defaultProp:a??!1,onChange:d,caller:rg}),[j,w]=v.useState(null),[x,S]=v.useState(null),N=v.useRef(!1),A=j?!!o||!!j.closest("form"):!0,P={checked:g,disabled:i,setChecked:y,control:j,setControl:w,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:Ti(a)?!1:a,isFormControl:A,bubbleInput:x,setBubbleInput:S};return s.jsx($ve,{scope:t,...P,children:Lve(p)?p(P):r})}var jz="CheckboxTrigger",Sz=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:o,disabled:c,checked:d,required:f,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:y,bubbleInput:j}=gC(jz,e),w=pt(a,h),x=v.useRef(d);return v.useEffect(()=>{const S=i?.form;if(S){const N=()=>p(x.current);return S.addEventListener("reset",N),()=>S.removeEventListener("reset",N)}},[i,p]),s.jsx(qe.button,{type:"button",role:"checkbox","aria-checked":Ti(d)?"mixed":d,"aria-required":f,"data-state":_z(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:w,onKeyDown:Pe(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Pe(n,S=>{p(N=>Ti(N)?!0:!N),j&&y&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})})});Sz.displayName=jz;var yC=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:o,disabled:c,value:d,onCheckedChange:f,form:h,...p}=e;return s.jsx(Dve,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:g})=>s.jsxs(s.Fragment,{children:[s.jsx(Sz,{...p,ref:t,__scopeCheckbox:n}),g&&s.jsx(Ez,{__scopeCheckbox:n})]})})});yC.displayName=rg;var Nz="CheckboxIndicator",Cz=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=gC(Nz,n);return s.jsx(Un,{present:r||Ti(i.checked)||i.checked===!0,children:s.jsx(qe.span,{"data-state":_z(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});Cz.displayName=Nz;var Az="CheckboxBubbleInput",Ez=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:g,setBubbleInput:y}=gC(Az,e),j=pt(n,y),w=Wv(i),x=$m(r);v.useEffect(()=>{const N=g;if(!N)return;const A=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(A,"checked").set,O=!a.current;if(w!==i&&E){const k=new Event("click",{bubbles:O});N.indeterminate=Ti(i),E.call(N,Ti(i)?!1:i),N.dispatchEvent(k)}},[g,w,i,a]);const S=v.useRef(Ti(i)?!1:i);return s.jsx(qe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ez.displayName=Az;function Lve(e){return typeof e=="function"}function Ti(e){return e==="indeterminate"}function _z(e){return Ti(e)?"indeterminate":e?"checked":"unchecked"}const ha=v.forwardRef(({className:e,...t},n)=>s.jsx(yC,{ref:n,className:Se("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(Cz,{className:Se("flex items-center justify-center text-current"),children:s.jsx(Ql,{className:"h-4 w-4"})})}));ha.displayName=yC.displayName;const Fve=Lo("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Gl=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:Se(Fve({variant:t}),e),...n}));Gl.displayName="Alert";const Yl=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Se("mb-1 font-medium leading-none tracking-tight",e),...t}));Yl.displayName="AlertTitle";const Xl=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("text-sm [&_p]:leading-relaxed",e),...t}));Xl.displayName="AlertDescription";function Bve(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o);c.displayName=i+"Context";const d=n.length;n=[...n,o];const f=p=>{const{scope:g,children:y,...j}=p,w=g?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(w.Provider,{value:x,children:y})};f.displayName=i+"Provider";function h(p,g){const y=g?.[e]?.[d]||c,j=v.useContext(y);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>v.createContext(o));return function(c){const d=c?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,zve(a,...t)]}function zve(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Uve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pz=Uve.reduce((e,t)=>{const n=Gm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),xC="Progress",bC=100,[qve]=Bve(xC),[Wve,Vve]=qve(xC),Oz=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=Hve,...o}=e;(a||a===0)&&!hM(a)&&console.error(Kve(`${a}`,"Progress"));const c=hM(a)?a:bC;r!==null&&!mM(r,c)&&console.error(Gve(`${r}`,"Progress"));const d=mM(r,c)?r:null,f=Cm(d)?i(d,c):void 0;return s.jsx(Wve,{scope:n,value:d,max:c,children:s.jsx(Pz.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Cm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":Tz(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});Oz.displayName=xC;var kz="ProgressIndicator",Rz=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Vve(kz,n);return s.jsx(Pz.div,{"data-state":Tz(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});Rz.displayName=kz;function Hve(e,t){return`${Math.round(e/t*100)}%`}function Tz(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Cm(e){return typeof e=="number"}function hM(e){return Cm(e)&&!isNaN(e)&&e>0}function mM(e,t){return Cm(e)&&!isNaN(e)&&e<=t&&e>=0}function Kve(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${bC}\`.`}function Gve(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
131
|
-
- a positive number
|
|
132
|
-
- less than the value passed to \`max\` (or ${bC} if no \`max\` prop is set)
|
|
133
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
134
|
-
|
|
135
|
-
Defaulting to \`null\`.`}var Iz=Oz,Yve=Rz;const ag=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(Iz,{ref:r,className:Se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(Yve,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ag.displayName=Iz.displayName;const Hu=["critical","high","medium","low","info"];function u1(e){switch(e){case"critical":return"border-red-300 bg-red-100 text-red-900";case"high":return"border-orange-300 bg-orange-100 text-orange-900";case"medium":return"border-amber-300 bg-amber-100 text-amber-900";case"low":return"border-sky-300 bg-sky-100 text-sky-900";default:return"border-slate-300 bg-slate-100 text-slate-800"}}function Xve(e){switch(e){case"critical":return"border-red-300 bg-background text-red-900";case"high":return"border-orange-300 bg-background text-orange-900";case"medium":return"border-amber-300 bg-background text-amber-900";case"low":return"border-sky-300 bg-background text-sky-900";default:return"border-slate-300 bg-background text-slate-800"}}function vM({text:e}){return s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800",children:[s.jsxs("div",{className:"mb-1 inline-flex items-center gap-1 font-medium text-slate-700",children:[s.jsx(TU,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function wC(e){const t=[];t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),t.push(`- Modes: ${[e.modes.metadataReview?"metadata review":null,e.modes.deeperAnalysis?"deeper analysis":null].filter(Boolean).join(" + ")}`),t.push("","## Summary"),t.push(`- Servers analyzed: ${e.summary.serversAnalyzed}`),t.push(`- Tools analyzed: ${e.summary.toolsAnalyzed}`),t.push(`- Tools skipped: ${e.summary.toolsSkipped}`,"");for(const n of e.servers){t.push(`## Server: ${n.serverName}`),n.warnings.length>0&&t.push(...n.warnings.map(r=>`- Warning: ${r}`),"");for(const r of n.tools){if(t.push(`### ${r.publicToolName}`),t.push(`- Safety: ${r.safetyClassification} (${r.classificationReason})`),r.metadataReview?.issues.length){t.push("#### Metadata issues");for(const a of r.metadataReview.issues)t.push(` - [${a.severity}] ${a.title}: ${a.detail}`)}if(r.deeperAnalysis)if(!r.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${r.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${r.deeperAnalysis.sampleCalls.length}`);for(const a of r.deeperAnalysis.sampleCalls){t.push(` - Call ${a.callIndex}: ${a.ok?"ok":"error"}${a.durationMs?` (${a.durationMs}ms)`:""}`),a.error&&t.push(` - Error: ${a.error}`);for(const i of a.observations)t.push(` - ${i}`)}}if(r.overallRecommendations.length>0){t.push("#### Recommendations");for(const a of r.overallRecommendations)t.push(` - ${a}`)}if(r.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const a of r.metadataReview.evalReadinessNotes)t.push(` - ${a}`)}t.push("")}}return`${t.join(`
|
|
136
|
-
`)}
|
|
137
|
-
`}function Mz({report:e}){const[t,n]=v.useState([...Hu]),r=v.useMemo(()=>new Set(t),[t]),a=i=>{n(o=>{const c=o.includes(i)?o.filter(d=>d!==i):[...o,i];return c.length===0?[...Hu]:c})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools analyzed"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsAnalyzed})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools skipped"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsSkipped})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Findings"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.findings.length})]})})]}),s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(Et,{className:"text-base",children:"Analysis Overview"}),s.jsx(Ls,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),s.jsx(Ue,{children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[Hu.filter(i=>e.summary.issueCounts[i]>0).map(i=>{const o=r.has(i);return s.jsx("button",{type:"button",onClick:()=>a(i),className:"rounded-full","aria-pressed":o,children:s.jsxs(Ke,{variant:"outline",className:`capitalize font-normal ${o?u1(i):Xve(i)} ${o?"ring-1 ring-current":"opacity-70"}`,children:[i,": ",e.summary.issueCounts[i]]})},i)}),s.jsx(ae,{type:"button",size:"sm",variant:"ghost",onClick:()=>n([...Hu]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsx("div",{className:"space-y-4",children:e.servers.map(i=>{const o=i.tools.filter(c=>{const d=[...c.metadataReview?.issues??[],...c.deeperAnalysis?.sampleCalls.flatMap(f=>f.issues)??[]];return d.length===0?t.length===Hu.length:d.some(f=>r.has(f.severity))});return o.length===0?null:s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(Et,{className:"text-base",children:i.serverName}),s.jsxs(Ls,{children:["Discovered ",i.toolCountDiscovered," · Showing ",o.length," of ",i.toolCountAnalyzed," analyzed · Skipped ",i.toolCountSkipped]})]}),s.jsxs(Ue,{className:"space-y-3",children:[i.warnings.length>0&&s.jsxs(Gl,{children:[s.jsx(Yl,{children:"Warnings"}),s.jsx(Xl,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:i.warnings.map(c=>s.jsx("li",{children:c},`${i.serverName}-${c}`))})})]}),o.map(c=>s.jsxs("details",{className:"group rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-mono text-sm",children:c.publicToolName}),c.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{variant:c.safetyClassification==="read_like"?"secondary":"outline",children:c.safetyClassification}),s.jsx(It,{className:"h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180"})]})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[c.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),c.metadataReview.issues.filter(d=>r.has(d.severity)).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No metadata issues reported."}):s.jsx("div",{className:"space-y-1",children:c.metadataReview.issues.filter(d=>r.has(d.severity)).map((d,f)=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:f+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:d.title})]}),s.jsx(Ke,{variant:"outline",className:`shrink-0 text-[10px] ${u1(d.severity)}`,children:d.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",d.detail]}),d.suggestion&&s.jsx(vM,{text:d.suggestion})]},d.id))})]}),c.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),c.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:c.deeperAnalysis.sampleCalls.map(d=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[s.jsx(Ke,{variant:d.ok?"secondary":"destructive",className:"text-[10px]",children:d.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",d.callIndex]}),d.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[d.durationMs,"ms"]})]}),d.error&&s.jsx("p",{className:"text-destructive",children:d.error}),d.observations.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"mb-1 inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Observations"}),s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:d.observations.map((f,h)=>s.jsx("li",{children:f},`${c.publicToolName}-obs-${d.callIndex}-${h}`))})]}),d.issues.filter(f=>r.has(f.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:d.issues.filter(f=>r.has(f.severity)).map((f,h)=>s.jsxs("div",{className:"rounded border p-2",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:h+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:f.title})]}),s.jsx(Ke,{variant:"outline",className:`shrink-0 text-[10px] ${u1(f.severity)}`,children:f.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",f.detail]}),f.suggestion&&s.jsx(vM,{text:f.suggestion})]},`${d.callIndex}-${f.id}`))})]},`${c.publicToolName}-call-${d.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:c.deeperAnalysis.skippedReason??"Skipped"})]})]})]},c.publicToolName))]})]},i.serverName)})})]})}const d1="mcplab.toolAnalysis.activeJobId";function gM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function yM({text:e}){return s.jsxs(tD,{children:[s.jsx(nD,{asChild:!0,children:s.jsx("button",{type:"button",className:"inline-flex h-4 w-4 items-center justify-center rounded text-muted-foreground hover:text-foreground",onClick:t=>t.preventDefault(),"aria-label":e,children:s.jsx(PU,{className:"h-3.5 w-3.5"})})}),s.jsx(FS,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function Qve(e,t){const n=t.toLowerCase();return n.includes("failed to load tools")||n.includes("failed to connect to mcp server")?`Could not load tools from '${e}'. Check that the MCP server is running and reachable, then try Refresh Servers / Discover Tools again.`:t}const Jve=()=>{const{source:e}=An(),{servers:t,agents:n,loading:r,reload:a}=Va(),[i,o]=v.useState(""),[c,d]=v.useState([]),[f,h]=v.useState(!1),[p,g]=v.useState([]),[y,j]=v.useState({}),[w,x]=v.useState(""),[S,N]=v.useState(!0),[A,P]=v.useState(!1),[E,O]=v.useState(2),[k,R]=v.useState(1),[D,U]=v.useState(1e4),[z,L]=v.useState(null),[G,q]=v.useState([]),[H,X]=v.useState(null),[Z,I]=v.useState(null),[F,Q]=v.useState(!1),[B,$]=v.useState("configure"),[ee,V]=v.useState("idle"),J=v.useRef(null),ge=i||n[0]?.name||"",ie=v.useMemo(()=>{let ye=0;const We=new Set,Ye=new Set;for(const Dt of G){const kt=typeof Dt.payload?.message=="string"?Dt.payload.message:"";if(!kt)continue;const Zt=kt.match(/\((\d+)\s+tools?\)/i);Zt&&(ye=Math.max(ye,Number(Zt[1])||0));const Sn=kt.match(/^Started\s+(.+)$/);Sn&&We.add(Sn[1]);const tr=kt.match(/^Finished\s+(.+)$/);tr&&Ye.add(tr[1])}const Ot=ye>0?Math.max(0,Math.min(100,Math.round(Ye.size/ye*100))):0;return{totalTools:ye,startedTools:We.size,finishedTools:Ye.size,percent:Ot}},[G]);v.useEffect(()=>{let ye=!0;return e.getWorkspaceSettings().then(We=>{!ye||!We||o(We.scenarioAssistantAgentName??"")}).catch(()=>{ye&&o("")}),()=>{ye=!1}},[e]),v.useEffect(()=>()=>{J.current?.()},[]);const ce=()=>{try{sessionStorage.removeItem(d1)}catch{}},oe=ye=>{try{sessionStorage.setItem(d1,ye)}catch{}},xe=ye=>{J.current?.(),J.current=e.subscribeToolAnalysisJob(ye,We=>{if(q(Ye=>[...Ye,We]),We.type==="completed")e.getToolAnalysisResult(ye).then(Ye=>{X(Ye.report),I(Ye.savedReportId??null)}).catch(Ye=>Oe({title:"Could not load analysis report",description:Ye instanceof Error?Ye.message:String(Ye),variant:"destructive"})).finally(()=>{ce(),L(null),Q(!1),V("idle"),$("run")});else if(We.type==="error"){const Ye=String(We.payload?.message??"");ce(),V(Ye.toLowerCase().includes("abort")?"stopped":"error"),L(null),Q(!1)}})};v.useEffect(()=>{if(z||H)return;let ye="";try{ye=sessionStorage.getItem(d1)??""}catch{ye=""}if(ye)return $("run"),V("running"),Q(!0),L(ye),q([]),xe(ye),()=>{}},[e,z,H]);const ke=async()=>{if(c.length===0){g([]),j({});return}h(!0);try{const ye=await e.discoverToolsForAnalysis({serverNames:c});g(ye.servers),j(We=>{const Ye={};for(const Ot of ye.servers){const Dt=We[Ot.serverName]??[],kt=Ot.tools.map(Sn=>Sn.name),Zt=Dt.filter(Sn=>kt.includes(Sn));Ye[Ot.serverName]=Zt.length>0?Zt:kt}return Ye})}catch(ye){Oe({title:"Could not discover MCP tools",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{ke()},[c.join("|")]);const pe=v.useMemo(()=>{const ye=w.trim().toLowerCase();return ye?p.map(We=>({...We,tools:We.tools.filter(Ye=>Ye.name.toLowerCase().includes(ye)||(Ye.description||"").toLowerCase().includes(ye))})).filter(We=>We.tools.length>0):p},[p,w]),ve=v.useMemo(()=>Object.values(y).reduce((ye,We)=>ye+We.length,0),[y]),Ce=c[0]??"",Le=async()=>{if(!S&&!A){Oe({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Oe({title:"Select exactly one server",variant:"destructive"});return}if(ve===0){Oe({title:"Select at least one tool",variant:"destructive"});return}Q(!0),q([]),X(null),I(null),$("run"),V("running");try{const{jobId:ye}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:y,maxParallelTools:E,modes:{metadataReview:S,deeperAnalysis:A},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:k,toolCallTimeoutMs:D}});L(ye),oe(ye),xe(ye)}catch(ye){Q(!1),V("error"),$("run"),Oe({title:"Could not start tool analysis",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}},se=async()=>{if(!z)return;const ye=z;try{const We=await e.stopToolAnalysis(ye);if(We.status==="completed"){J.current?.(),J.current=null;const Ye=await e.getToolAnalysisResult(ye);X(Ye.report),I(Ye.savedReportId??null),ce(),L(null),Q(!1),V("idle"),$("run"),Oe({title:"Analysis already finished",description:"Showing the result overview."});return}if(We.status==="stopped"){J.current?.(),J.current=null,ce(),L(null),Q(!1),V("stopped"),Oe({title:"Analysis stopped"});return}if(We.status==="error"){J.current?.(),J.current=null,ce(),L(null),Q(!1),V("error"),Oe({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Oe({title:"Stopping analysis..."})}catch(We){Oe({title:"Could not stop analysis",description:We instanceof Error?We.message:String(We),variant:"destructive"})}},de=()=>{$("configure"),V("idle"),L(null)},Ne=(ye,We)=>{d(Ye=>We?[ye]:Ye.filter(Ot=>Ot!==ye))},Fe=(ye,We,Ye)=>{j(Ot=>{const Dt=new Set(Ot[ye]??[]);return Ye?Dt.add(We):Dt.delete(We),{...Ot,[ye]:Array.from(Dt)}})},je=(ye,We)=>{j(Ye=>({...Ye,[ye]:We}))},$e=!0,et=z!==null||G.length>0||ee==="stopped"||ee==="error",xt=!!H,Jt=ye=>{if(ye==="configure"&&$e){$("configure");return}if(ye==="run"&&et){$("run");return}ye==="report"&&xt&&$("report")};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(c$,{className:"h-6 w-6"}),"Analyze MCP Tools"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Review MCP tools for schema quality, ergonomics, and agent/eval readiness."})]}),s.jsxs("div",{className:"hidden flex-wrap items-center gap-2 md:flex",children:[s.jsx("button",{type:"button",onClick:()=>Jt("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Ke,{variant:B==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>Jt("run"),disabled:!et,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Ke,{variant:B==="run"?"default":"outline",className:et?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>Jt("report"),disabled:!xt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Ke,{variant:B==="report"?"default":"outline",className:xt?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),B==="configure"&&s.jsxs(ze,{children:[s.jsxs(At,{children:[s.jsx(Et,{className:"text-base",children:"Run MCP analysis"}),s.jsx(Ls,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(Ue,{className:"space-y-5",children:[!ge&&s.jsxs(Gl,{children:[s.jsx(Yl,{children:"No assistant agent available"}),s.jsxs(Xl,{children:["Add a library agent in"," ",s.jsx(yt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(yt,{to:"/settings",className:"underline",children:"Settings"}),"."]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Te,{className:"text-xs",children:"Servers"}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r,children:[s.jsx(za,{className:"mr-2 h-4 w-4"}),"Refresh Servers"]})]}),s.jsx("div",{className:"grid gap-2 rounded-md border p-3 md:grid-cols-2",children:t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library servers configured."}):t.map(ye=>{const We=ye.name||ye.id,Ye=c.includes(We);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(ha,{checked:Ye,onCheckedChange:Ot=>Ne(We,!!Ot)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:We}),ye.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:ye.url})]})]},ye.id)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Select exactly one MCP server for analysis."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(AS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(it,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:w,onChange:ye=>x(ye.target.value)})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Filtering only changes what is shown; selected tools remain selected."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Te,{className:"text-xs",children:Ce?`Tools for ${Ce}`:"Tools"}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{ke()},disabled:f||c.length===0,children:[f&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),"Discover Tools"]})]}),s.jsx("div",{className:"space-y-3 rounded-md border p-3",children:c.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a server to discover tools."}):f&&p.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading tools..."}):pe.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):pe.map(ye=>{const We=new Set(y[ye.serverName]??[]);return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[s.jsx("div",{className:"font-medium",children:ye.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"ghost",onClick:()=>je(ye.serverName,ye.tools.map(Ye=>Ye.name)),children:"Select all"}),s.jsx(ae,{type:"button",size:"sm",variant:"ghost",onClick:()=>je(ye.serverName,[]),children:"Clear"})]})]}),ye.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:ye.warnings.map(Ye=>s.jsx("div",{className:"text-xs text-amber-700",children:Qve(ye.serverName,Ye)},`${ye.serverName}-${Ye}`))}),s.jsx("div",{className:"grid gap-2",children:ye.tools.map(Ye=>s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(ha,{checked:We.has(Ye.name),onCheckedChange:Ot=>Fe(ye.serverName,Ye.name,!!Ot)}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-mono text-xs",children:Ye.name}),s.jsx(Ke,{variant:Ye.safetyClassification==="read_like"?"secondary":"outline",className:"text-[10px]",children:Ye.safetyClassification==="read_like"?"read-like":"unsafe/unknown"})]}),Ye.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ye.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:Ye.classificationReason})]})]},`${ye.serverName}-${Ye.name}`))})]},ye.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",ve]})]}),s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-sm font-medium",children:"Analysis Modes"}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ha,{checked:S,onCheckedChange:ye=>N(!!ye)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(yM,{text:"No tool execution. Reviews tool names, descriptions, and schemas only."})]})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ha,{checked:A,onCheckedChange:ye=>P(!!ye)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(yM,{text:"Runs sample MCP tool calls automatically for read-like tools only (based on the safety allowlist)."})]})]}),s.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/20 p-3 md:grid-cols-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Max parallel tools"}),s.jsx(it,{type:"number",min:1,max:8,value:E,onChange:ye=>O(Math.max(1,Math.min(8,Number(ye.target.value)||2))),className:"h-8"})]}),A?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Safety profile"}),s.jsx("div",{className:"text-sm",children:"Read-only allowlist only"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(it,{type:"number",min:1,max:5,value:k,onChange:ye=>R(Math.max(1,Math.min(5,Number(ye.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(it,{type:"number",min:1e3,max:6e4,step:500,value:D,onChange:ye=>U(Math.max(1e3,Math.min(6e4,Number(ye.target.value)||1e4))),className:"h-8"})]}),s.jsx("div",{className:"md:col-span-3 text-xs text-amber-700",children:"Deeper analysis may execute read-only MCP tools automatically."})]}):s.jsx("div",{className:"md:col-span-2 text-xs text-muted-foreground",children:"Deeper analysis is disabled. Only metadata/schema review will run."})]})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:s.jsxs(ae,{type:"button",onClick:()=>{Le()},disabled:F||!!z,children:[(F||!!z)&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),B==="run"&&s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Et,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(Ls,{children:z?"Live tool-analysis job events:":H?"Analysis finished. Review the summary below or open the saved report details.":ee==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":ee==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),z?s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{se()},children:"Stop Analysis"}):s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:de,children:"Back to Configure Analysis"})]})}),s.jsxs(Ue,{className:"space-y-2",children:[z&&s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-muted/20 px-2.5 py-1 text-xs text-muted-foreground",children:[s.jsx(Zn,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(ie.totalTools>0||z)&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:ie.totalTools>0?`${ie.finishedTools}/${ie.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:ie.totalTools>0?`${ie.percent}%`:"0%"})]}),s.jsx(ag,{value:ie.totalTools>0?ie.percent:0,className:"h-2"})]}),G.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:z?"Starting analysis...":"No progress events captured."}):s.jsx("div",{className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:G.map((ye,We)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ye.ts).toLocaleTimeString()}),s.jsx(Ke,{variant:"outline",className:"mr-2 text-[10px]",children:ye.type}),s.jsx("span",{className:"break-all",children:typeof ye.payload.message=="string"?ye.payload.message:JSON.stringify(ye.payload)})]},`${ye.ts}-${We}`))}),!z&&H&&s.jsx(ze,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:s.jsxs(Ue,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold",children:"Result overview"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[H.summary.toolsAnalyzed," tools analyzed, ",H.summary.toolsSkipped," skipped, across"," ",H.summary.serversAnalyzed," server",H.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Z&&s.jsx(ae,{asChild:!0,size:"sm",children:s.jsx(yt,{to:`/tool-analysis-results/${Z}`,children:"Open result details"})}),s.jsx(ae,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>Jt("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[H.summary.issueCounts.critical>0&&s.jsxs(Ke,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",H.summary.issueCounts.critical]}),H.summary.issueCounts.high>0&&s.jsxs(Ke,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",H.summary.issueCounts.high]}),H.summary.issueCounts.medium>0&&s.jsxs(Ke,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",H.summary.issueCounts.medium]}),H.summary.issueCounts.low>0&&s.jsxs(Ke,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",H.summary.issueCounts.low]}),H.summary.issueCounts.info>0&&s.jsxs(Ke,{variant:"outline",children:["Info: ",H.summary.issueCounts.info]}),Object.values(H.summary.issueCounts).every(ye=>ye===0)&&s.jsx(Ke,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),B==="report"&&H&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[H.summary.toolsAnalyzed," tools analyzed across ",H.summary.serversAnalyzed," server",H.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:de,children:"Back to Configure Analysis"}),Z&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(yt,{to:`/tool-analysis-results/${Z}`,children:"Open saved report"})}),s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>gM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(H,null,2)}
|
|
138
|
-
`,"application/json"),children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>gM(`tool-analysis-${Date.now()}.md`,wC(H),"text/markdown"),children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(Mz,{report:H})]})]})};function xM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function Zve(){const{source:e}=An(),[t,n]=v.useState([]),[r,a]=v.useState(!0),[i,o]=v.useState(null),[c,d]=v.useState(!1),f=async()=>{a(!0);try{n(await e.listToolAnalysisResults())}catch(y){Oe({title:"Could not load tool analysis results",description:y instanceof Error?y.message:String(y),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t.find(y=>y.reportId===i)??null,[t,i]),p=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(y=>y.filter(j=>j.reportId!==i)),Oe({title:"Tool analysis report deleted"}),o(null)}catch(y){Oe({title:"Could not delete report",description:y instanceof Error?y.message:String(y),variant:"destructive"})}finally{d(!1)}}},g=async(y,j)=>{try{const w=await e.getToolAnalysisSavedResult(y);j==="json"?xM(`${y}.json`,`${JSON.stringify(w,null,2)}
|
|
139
|
-
`,"application/json"):xM(`${y}.md`,wC(w.report),"text/markdown")}catch(w){Oe({title:"Could not export saved report",description:w instanceof Error?w.message:String(w),variant:"destructive"})}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(u$,{className:"h-6 w-6"}),"Tool Analysis Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse persisted Analyze MCP Tools reports."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{variant:"outline",onClick:()=>{f()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading tool analysis results..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No saved tool analysis reports yet."}):s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Report ID"}),s.jsx(nt,{children:"Evaluated"}),s.jsx(nt,{children:"Timestamp"}),s.jsx(nt,{children:"Issues"}),s.jsx(nt,{children:"Modes"}),s.jsx(nt,{className:"w-10"})]})}),s.jsx(Yr,{children:t.map(y=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/tool-analysis-results/${y.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:y.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[y.assistantAgentName," · ",y.assistantAgentModel]})]})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Servers: ",s.jsx("span",{className:"font-medium text-foreground",children:y.serverNames.length})," · Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:y.summary.toolsAnalyzed})," · ","Skipped: ",s.jsx("span",{className:"font-medium text-foreground",children:y.summary.toolsSkipped})]}),s.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[y.serverNames.slice(0,2).join(", "),y.serverNames.length>2?` +${y.serverNames.length-2}`:""]})]})}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Pm,{className:"h-3 w-3"}),new Date(y.createdAt).toLocaleString()]})}),s.jsx(He,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(j=>y.summary.issueCounts[j]>0?s.jsxs(Ke,{variant:"outline",className:"capitalize",children:[j,": ",y.summary.issueCounts[j]]},`${y.reportId}-${j}`):null),Object.values(y.summary.issueCounts).every(j=>j===0)&&s.jsx(Ke,{variant:"outline",children:"No issues"})]})}),s.jsx(He,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[y.modes.metadataReview&&s.jsx(Ke,{variant:"outline",children:"metadata"}),y.modes.deeperAnalysis&&s.jsx(Ke,{variant:"outline",children:"deeper"})]})}),s.jsx(He,{children:s.jsxs(Kc,{children:[s.jsx(Gc,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Go,{align:"end",children:[s.jsx(cr,{asChild:!0,children:s.jsx(yt,{to:`/tool-analysis-results/${y.reportId}`,children:"View"})}),s.jsxs(cr,{onSelect:()=>{g(y.reportId,"json")},children:[s.jsx(ma,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(cr,{onSelect:()=>{g(y.reportId,"markdown")},children:[s.jsx(ma,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(cr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(y.reportId)},children:[s.jsx(_r,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},y.reportId))})]})})}),s.jsx(ws,{open:!!i,onOpenChange:y=>!y&&o(null),children:s.jsxs(Ka,{children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:"Delete tool analysis report?"}),s.jsx(Qa,{children:h?`Delete saved report '${h.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),s.jsxs(Ya,{children:[s.jsx(Za,{disabled:c,children:"Cancel"}),s.jsx(Ja,{onClick:y=>{y.preventDefault(),p()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function bM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function ege(){const{id:e=""}=Fo(),t=ya(),{source:n}=An(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1),[p,g]=v.useState(!1);v.useEffect(()=>{let j=!0;return o(!0),d(!1),n.getToolAnalysisSavedResult(e).then(w=>{j&&a(w)}).catch(w=>{if(!j)return;const x=w instanceof Error?w.message:String(w);if(x.includes("(404)")){d(!0),a(null);return}Oe({title:"Could not load saved tool analysis report",description:x,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const y=async()=>{g(!0);try{await n.deleteToolAnalysisSavedResult(e),Oe({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Oe({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{g(!1),h(!1)}};return i?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading saved tool analysis report..."}):c||!r?s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Tool Analysis Result"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Saved report not found."}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"Back to Tool Analysis Results"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.reportId}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[new Date(r.createdAt).toLocaleString()," · ",r.serverNames.join(", ")||"—"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ae,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>bM(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
140
|
-
`,"application/json"),children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>bM(`${r.reportId}.md`,wC(r.report),"text/markdown"),children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(_r,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(Mz,{report:r.report}),s.jsx(ws,{open:f,onOpenChange:h,children:s.jsxs(Ka,{children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:"Delete tool analysis report?"}),s.jsxs(Qa,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(Ya,{children:[s.jsx(Za,{disabled:p,children:"Cancel"}),s.jsx(Ja,{onClick:j=>{j.preventDefault(),y()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const tge=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function nge(e){return navigator.clipboard.writeText(e)}function rge(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function age(e,t){const n=[];n.push("# OAuth Debugger Report"),n.push(""),n.push(`- Session ID: ${e.id}`),n.push(`- Status: ${e.status}`),n.push(`- Registration method: ${e.registrationMethod}`),n.push(`- Profile: ${e.profile}`),n.push(""),n.push("## Steps");for(const r of e.stepStates)n.push(`- ${r.title}: ${r.status}${r.outcomeSummary?` — ${r.outcomeSummary}`:""}`);if(n.push(""),n.push("## Validation Findings"),e.validations.length===0)n.push("- None");else for(const r of e.validations)n.push(`- [${r.severity}] ${r.title} (${r.stepId})`),n.push(` - ${r.detail}`),r.recommendation&&n.push(` - Recommendation: ${r.recommendation}`);n.push(""),n.push("## Event Log");for(const r of t){const a=typeof r.payload.message=="string"?r.payload.message:JSON.stringify(r.payload);n.push(`- ${new Date(r.ts).toLocaleTimeString()} [${r.type}] ${a}`)}return`${n.join(`
|
|
141
|
-
`)}
|
|
142
|
-
`}function sge(){const{source:e}=An(),{servers:t,reload:n,loading:r}=Va(),[a,i]=v.useState("configure"),[o,c]=v.useState(""),[d,f]=v.useState("pre_registered"),[h,p]=v.useState("local_callback"),[g,y]=v.useState(!0),[j,w]=v.useState(!0),[x,S]=v.useState(""),[N,A]=v.useState(""),[P,E]=v.useState(""),[O,k]=v.useState(""),[R,D]=v.useState("client_secret_basic"),[U,z]=v.useState("{}"),[L,G]=v.useState(""),[q,H]=v.useState(""),[X,Z]=v.useState(""),[I,F]=v.useState(""),[Q,B]=v.useState(""),[$,ee]=v.useState(""),[V,J]=v.useState(""),[ge,ie]=v.useState(""),[ce,oe]=v.useState(null),[xe,ke]=v.useState(null),[pe,ve]=v.useState([]),[Ce,Le]=v.useState(!1),[se,de]=v.useState(!1),[Ne,Fe]=v.useState(!1),[je,$e]=v.useState("all"),[et,xt]=v.useState("all"),[Jt,ye]=v.useState("inspector"),We=v.useRef(null),Ye=v.useRef(null);v.useEffect(()=>()=>{We.current?.(),We.current=null},[]),v.useEffect(()=>{Ye.current?.scrollIntoView({behavior:"smooth",block:"end"})},[pe.length]);const Ot=v.useMemo(()=>t.filter(ue=>ue.authType==="oauth2"),[t]),Dt=Ot.find(ue=>ue.id===o);v.useEffect(()=>{o&&(Ot.some(ue=>ue.id===o)||c(""))},[Ot,o]);const kt=v.useMemo(()=>{const ue=ce?.stepStates.length??0,Ie=ce?.stepStates.filter(Wt=>Wt.status==="completed"||Wt.status==="skipped").length??0,ct=ce?.stepStates.filter(Wt=>Wt.status==="failed").length??0,bt=ue>0?Math.round((Ie+ct)/ue*100):0;return{total:ue,completed:Ie,failed:ct,percent:bt}},[ce]),Zt=v.useMemo(()=>(ce?.network??[]).filter(Ie=>!(je!=="all"&&Ie.stepId!==je||et==="error"&&!(Ie.phase==="response"&&(Ie.status??0)>=400)||et==="ok"&&!(Ie.phase==="response"&&(Ie.status??0)<400))),[ce?.network,je,et]),Sn=!!xe,tr=!!(ce&&(ce.status==="completed"||ce.status==="error"||ce.status==="stopped")),nr=ue=>{if(ue==="configure"||ue==="run"&&Sn||ue==="report"&&tr)return i(ue)},wa=()=>{let ue;if(d==="dcr"&&U.trim())try{ue=JSON.parse(U)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Dt)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Dt.name||Dt.id,overrides:{authorizationServerMetadataUrl:X||void 0,authorizationEndpoint:I||void 0,tokenEndpoint:Q||void 0,registrationEndpoint:$||void 0,cimdUrl:L||void 0,resourceBaseUrl:V||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:P.trim(),clientSecret:O.trim()||void 0,tokenEndpointAuthMethod:R||void 0}:void 0,dcr:d==="dcr"?{metadata:ue,tokenEndpointAuthMethod:R||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:L||void 0,expectedClientId:q||void 0}:void 0},runtime:{redirectMode:h,scopes:x.split(/[,\s]+/).map(Ie=>Ie.trim()).filter(Boolean),resource:N.trim()||void 0,usePkce:j,codeChallengeMethod:"S256"},display:{showSensitiveValues:g}}},En=ue=>{We.current?.(),We.current=e.subscribeOAuthDebuggerSession(ue,Ie=>{ve(bt=>[...bt,Ie]),(Ie.type==="completed"||Ie.type==="error"||Ie.type==="stopped")&&Le(!1),e.getOAuthDebuggerSession(ue).then(bt=>{oe(bt.session),bt.session.status==="completed"&&i("report")}).catch(()=>{})})},kr=async()=>{de(!0);try{const ue=wa(),Ie=await e.createOAuthDebuggerSession(ue);ke(Ie.sessionId),oe(Ie.session),ve([]),i("run"),En(Ie.sessionId);const ct=await e.startOAuthDebuggerSession(Ie.sessionId);oe(ct.session),Le(!0),(ct.session.status==="waiting_for_user"||ct.session.status==="waiting_for_browser_callback")&&Le(!1)}catch(ue){Oe({title:"Could not start OAuth Debugger session",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{de(!1)}},Rr=async()=>{if(xe)try{de(!0);const ue=await e.submitOAuthDebuggerManualCallback(xe,{redirectUrl:ge.trim()||void 0});oe(ue.session),ie(""),Le(!0)}catch(ue){Oe({title:"Could not submit callback",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{de(!1)}},yr=async()=>{if(xe){Fe(!0);try{const ue=await e.stopOAuthDebuggerSession(xe);if(Le(!1),ue.status!=="running"){const Ie=await e.getOAuthDebuggerSession(xe);oe(Ie.session),Ie.session.status==="completed"?i("report"):i("run")}}catch(ue){Oe({title:"Could not stop session",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{Fe(!1)}}},_n=async()=>{We.current?.(),We.current=null,oe(null),ke(null),ve([]),Le(!1),Fe(!1),de(!1),ie(""),$e("all"),xt("all"),ye("inspector"),i("run"),await kr()},Rn=async ue=>{if(!(!xe||!ce))try{const Ie=await e.exportOAuthDebuggerSession(xe,ue);let ct="";const bt=ue==="json"?"json":ue==="raw"?"txt":"md";typeof Ie=="string"?ct=Ie:ct=`${JSON.stringify(Ie,null,2)}
|
|
143
|
-
`;const Wt=new Blob([ct],{type:"text/plain;charset=utf-8"}),ln=URL.createObjectURL(Wt),Pt=document.createElement("a");Pt.href=ln,Pt.download=`oauth-debugger-${xe}.${bt}`,Pt.click(),URL.revokeObjectURL(ln)}catch(Ie){if(ue==="markdown"){const ct=age(ce,pe),bt=new Blob([ct],{type:"text/markdown;charset=utf-8"}),Wt=URL.createObjectURL(bt),ln=document.createElement("a");ln.href=Wt,ln.download=`oauth-debugger-${ce.id}.md`,ln.click(),URL.revokeObjectURL(Wt);return}Oe({title:"Export failed",description:Ie instanceof Error?Ie.message:String(Ie),variant:"destructive"})}},xn=xe?`${rge()}/api/oauth-debugger/sessions/${xe}/authorize`:void 0,Tn=ue=>ue==="error"?"destructive":ue==="warning"?"outline":"secondary";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"OAuth Debugger"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile)."})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:tge.map(ue=>{const Ie=a===ue.id,ct=ue.id==="configure"||ue.id==="run"&&Sn||ue.id==="report"&&tr;return s.jsx("button",{type:"button",onClick:()=>ct&&nr(ue.id),disabled:!ct,className:"rounded-full",children:s.jsx(Ke,{variant:Ie?"default":"outline",className:ct?"":"opacity-50",children:ue.label})},ue.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Et,{className:"text-base",children:"Target MCP Server"}),s.jsx(Ls,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(za,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),s.jsx(Ue,{className:"space-y-3",children:s.jsxs("div",{className:"max-w-xl space-y-2",children:[s.jsx(Te,{children:"MCP Server"}),s.jsxs(Kt,{value:o,onValueChange:c,children:[s.jsx(Ut,{children:s.jsx(Gt,{placeholder:"Select an MCP server"})}),s.jsx(qt,{children:Ot.map(ue=>s.jsx(Je,{value:ue.id,children:ue.name||ue.id},ue.id))})]}),Ot.length===0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["No MCP servers with OAuth configured found. Add OAuth 2.0 auth in"," ",s.jsx("a",{href:"/libraries/servers",className:"underline text-primary",children:"Manage Servers"}),"."]}),Dt&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Dt.transport," · ",Dt.url||Dt.command||"No URL/command"]})]})})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Client Registration Method"})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsx("div",{className:"grid gap-2 md:grid-cols-3",children:[{id:"pre_registered",label:"Pre-registered client"},{id:"dcr",label:"Dynamic Client Registration (DCR)"},{id:"cimd",label:"Client ID Metadata Document (CIMD)"}].map(ue=>s.jsx("button",{type:"button",onClick:()=>f(ue.id),className:"rounded-md border p-3 text-left",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${d===ue.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:ue.label})]})},ue.id))}),s.jsx("div",{className:"grid gap-3 md:grid-cols-1",children:s.jsxs("div",{className:"max-w-md space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Redirect mode"}),s.jsxs(Kt,{value:h,onValueChange:ue=>p(ue),children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(Je,{value:"manual",children:"Manual paste redirect URL"})]})]})]})}),d==="pre_registered"&&s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"client_id"}),s.jsx(it,{value:P,onChange:ue=>E(ue.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"client_secret (optional)"}),s.jsx(it,{value:O,onChange:ue=>k(ue.target.value),type:"password"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"CIMD URL"}),s.jsx(it,{value:L,onChange:ue=>G(ue.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Runtime OAuth Inputs"})}),s.jsxs(Ue,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Scopes (space or comma separated)"}),s.jsx(it,{value:x,onChange:ue=>S(ue.target.value),placeholder:"openid profile mcp"})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(ha,{checked:j,onCheckedChange:ue=>w(!!ue)}),s.jsx(Te,{children:"Use PKCE (S256)"})]})]})]}),s.jsxs("details",{className:"rounded-md border bg-card p-3 shadow-sm",children:[s.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced"}),s.jsxs("div",{className:"mt-3 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Token endpoint auth method"}),s.jsx(it,{value:R,onChange:ue=>D(ue.target.value),placeholder:"client_secret_basic / none / client_secret_post"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Resource / audience (optional)"}),s.jsx(it,{value:N,onChange:ue=>A(ue.target.value),placeholder:"https://resource.example.com"})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"DCR metadata JSON (optional overrides)"}),s.jsx(Gs,{value:U,onChange:ue=>z(ue.target.value),className:"min-h-32 font-mono text-xs"})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Expected client_id (optional)"}),s.jsx(it,{value:q,onChange:ue=>H(ue.target.value)})]}),s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("div",{className:"mb-3 text-sm font-medium",children:"Endpoint overrides"}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Authorization server metadata URL"}),s.jsx(it,{value:X,onChange:ue=>Z(ue.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Resource server base URL"}),s.jsx(it,{value:V,onChange:ue=>J(ue.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Authorization endpoint"}),s.jsx(it,{value:I,onChange:ue=>F(ue.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Token endpoint"}),s.jsx(it,{value:Q,onChange:ue=>B(ue.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Registration endpoint (DCR)"}),s.jsx(it,{value:$,onChange:ue=>ee(ue.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"CIMD URL override"}),s.jsx(it,{value:L,onChange:ue=>G(ue.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Gl,{children:[s.jsx(Vy,{className:"h-4 w-4"}),s.jsx(Yl,{children:"Secrets display"}),s.jsxs(Xl,{className:"space-y-2",children:[s.jsx("p",{children:"This debugger is configured to show full tokens/secrets in network logs and exports."}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ha,{checked:!g,onCheckedChange:ue=>y(ue===!1)}),s.jsx(Te,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(ae,{type:"button",onClick:()=>{kr()},disabled:se,children:[se&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),"Start OAuth Debug Session"]})})]}),a==="run"&&s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[1.2fr_1fr]",children:[s.jsxs(ze,{className:"xl:col-span-1",children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Et,{className:"text-base",children:"Progress"}),s.jsx(Ls,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ce?.uiHints.authorizationUrl&&xn&&s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:xn,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(oh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{_n()},disabled:se,children:[s.jsx(za,{className:"mr-2 h-4 w-4"}),"Restart"]}),xe&&s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{yr()},disabled:Ne||!xe,children:[(Ne||Ce)&&Ne&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(y1,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:[kt.completed+kt.failed,"/",kt.total," steps"]}),s.jsxs("span",{children:[kt.percent,"%"]})]}),s.jsx(ag,{value:kt.percent,className:"h-2"})]}),ce?.status==="waiting_for_user"&&s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4 space-y-2",children:[s.jsx("div",{className:"text-sm font-medium",children:"Manual callback required"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the authorization URL, complete authentication, then paste the final redirect URL here."}),s.jsx(Gs,{value:ge,onChange:ue=>ie(ue.target.value),placeholder:"Paste the final redirect URL (with code and state)",className:"min-h-24 text-xs font-mono"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",onClick:()=>{Rr()},disabled:se||!ge.trim(),children:[se&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),ce.uiHints.authorizationUrl&&xn&&s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:xn,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),ce?.status==="waiting_for_browser_callback"&&s.jsxs(Gl,{children:[s.jsx(Vy,{className:"h-4 w-4"}),s.jsx(Yl,{children:"Waiting for browser callback"}),s.jsxs(Xl,{className:"space-y-1",children:[s.jsx("p",{className:"text-xs",children:"Complete the authorization flow in your browser. MCP Lab is listening for the callback at:"}),s.jsx("p",{className:"text-xs font-mono break-all",children:ce.uiHints.callbackUrl}),ce.uiHints.authorizationUrl&&xn&&s.jsx("div",{className:"pt-2",children:s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:xn,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(oh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:ce?.stepStates.map(ue=>s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:ue.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:ue.description})]}),s.jsx(Ke,{variant:ue.status==="failed"?"destructive":ue.status==="completed"?"outline":ue.status==="active"?"secondary":"outline",className:ue.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:ue.status})]}),ue.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:ue.outcomeSummary})]},ue.id))||s.jsx("p",{className:"text-sm text-muted-foreground",children:"No steps yet."})})]})]}),s.jsx("div",{className:"space-y-4 xl:col-span-1",children:s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(Et,{className:"text-base",children:"Inspect"}),s.jsx(Ls,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(Ue,{className:"space-y-3",children:s.jsxs(sC,{value:Jt,onValueChange:ue=>ye(ue),children:[s.jsxs(Kv,{className:"grid grid-cols-2",children:[s.jsx(Ri,{value:"inspector",children:"Network Inspector"}),s.jsx(Ri,{value:"events",children:"Live Debug"})]}),s.jsx(Hl,{value:"events",className:"mt-3",children:s.jsxs("div",{className:"max-h-64 space-y-1 overflow-auto rounded-md border bg-muted/10 p-3 text-xs",children:[pe.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):pe.map((ue,Ie)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ue.ts).toLocaleTimeString()}),s.jsx(Ke,{variant:"outline",className:"mr-2 text-[10px]",children:ue.type}),typeof ue.payload.message=="string"?ue.payload.message:JSON.stringify(ue.payload)]},`${ue.ts}-${Ie}`)),s.jsx("div",{ref:Ye})]})}),s.jsxs(Hl,{value:"inspector",className:"space-y-3 mt-3",children:[s.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Filter by step"}),s.jsxs(Kt,{value:je,onValueChange:$e,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All steps"}),(ce?.stepStates??[]).map(ue=>s.jsx(Je,{value:ue.id,children:ue.title},ue.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Filter by status"}),s.jsxs(Kt,{value:et,onValueChange:xt,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All"}),s.jsx(Je,{value:"ok",children:"Successful responses"}),s.jsx(Je,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:Zt.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):Zt.map(ue=>s.jsxs("details",{className:"rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:ue.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[ue.method?`${ue.method} `:"",ue.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{variant:"outline",children:ue.phase}),typeof ue.status=="number"&&s.jsx(Ke,{variant:ue.status>=400?"destructive":"secondary",children:ue.status})]})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Headers"}),s.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:JSON.stringify(ue.headers,null,2)})]}),ue.bodyText&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Body"}),s.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:ue.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{nge(JSON.stringify(ue,null,2))},children:[s.jsx(Ii,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},ue.id))})]})]})})]})})]})}),a==="report"&&ce&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report / Export"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"OAuth debug session summary, validations, and trace exports."})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rn("json")},children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rn("markdown")},children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rn("raw")},children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(Gl,{children:[s.jsx(Vy,{className:"h-4 w-4"}),s.jsx(Yl,{children:"Secrets display mode"}),s.jsx(Xl,{children:g?"This session is configured to show full tokens and secrets in network logs/exports.":"Sensitive values are hidden in the inspector for this session."})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.status})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.networkSummary.requestCount})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Network errors"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.networkSummary.errorCount})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Validation findings"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.validations.length})]})})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Key values"})}),s.jsxs(Ue,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:ce.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:ce.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:ce.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:ce.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:ce.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(ce.summary?.grantedScopes??[]).join(", ")||"-"})]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Validation findings"})}),s.jsx(Ue,{className:"space-y-2",children:ce.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):ce.validations.map((ue,Ie)=>s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:Ie+1}),s.jsx("span",{className:"font-bold",children:ue.title})]}),s.jsx(Ke,{variant:Tn(ue.severity),children:ue.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",ue.detail]}),ue.recommendation&&s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-xs",children:[s.jsx("div",{className:"mb-1 font-medium text-muted-foreground",children:"Suggested improvement"}),s.jsx("p",{children:ue.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",ue.stepId,ue.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:ue.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},ue.id))})]})]})]})}const f1="mcplab.runEvaluation.activeJobId",ige=()=>{const[e]=$c(),[t,n]=v.useState(""),[r,a]=v.useState("1"),[i,o]=v.useState(!1),[c,d]=v.useState(0),[f,h]=v.useState([]),[p,g]=v.useState(!1),[y,j]=v.useState(!1),[w,x]=v.useState(""),[S,N]=v.useState(null),[A,P]=v.useState([]),[E,O]=v.useState([]),[k,R]=v.useState(!0),[D,U]=v.useState(""),[z,L]=v.useState(!1),G=v.useRef(null),q=v.useRef(null),H=v.useRef(null),{configs:X,reload:Z}=cf(),{source:I}=An(),F=jf("snapshots",!1),{agents:Q,scenarios:B}=Va(),$=X.find(ve=>ve.id===t),ee=e.get("configId"),V=v.useMemo(()=>{if(!$)return[];const ve=new Map,Ce=$.agentEntries&&$.agentEntries.length>0?$.agentEntries:$.agents.map(Le=>({kind:"inline",agent:Le}));for(const Le of Ce){if(Le.kind==="inline"){const de=Le.agent.id;ve.has(de)||ve.set(de,Le.agent);continue}const se=Q.find(de=>de.id===Le.ref);se&&!ve.has(se.id)&&ve.set(se.id,se)}return Array.from(ve.values())},[$,Q]),J=v.useMemo(()=>{if(!$)return[];const ve=new Map,Ce=$.scenarioEntries&&$.scenarioEntries.length>0?$.scenarioEntries:$.scenarios.map(Le=>({kind:"inline",scenario:Le}));for(const Le of Ce){if(Le.kind==="inline"){ve.has(Le.scenario.id)||ve.set(Le.scenario.id,Le.scenario);continue}const se=B.find(de=>de.id===Le.ref);se&&!ve.has(se.id)&&ve.set(se.id,se)}return Array.from(ve.values())},[$,B]);v.useEffect(()=>{ee&&X.some(ve=>ve.id===ee)&&n(ee)},[ee,X]),v.useEffect(()=>{if(!$){P([]),O([]);return}const ve=V.filter(Ce=>($.runDefaults?.selectedAgentNames??[]).includes(Ce.id)).map(Ce=>Ce.id);P(ve.length>0?ve:V.map(Ce=>Ce.id)),O(J.map(Ce=>Ce.id)),R(!0)},[$?.id,$?.sourcePath,V,J]);const ge=async()=>{if(!$?.sourcePath){h(se=>[...se,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ve=V.filter(se=>A.includes(se.id));if(ve.length===0){h(se=>[...se,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const Ce=J.filter(se=>E.includes(se.id));if(Ce.length===0){h(se=>[...se,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}o(!0),g(!1),j(!1),x("");const Le=($.serverEntries??[]).some(se=>se.kind==="referenced")||($.agentEntries??[]).some(se=>se.kind==="referenced")||($.scenarioEntries??[]).some(se=>se.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${$.name} mode=${Le} agents=${ve.map(se=>se.name||se.id).join(", ")} tests=${Ce.map(se=>se.id).join(", ")} runs=${Number(r)} snapshotEval=${F&&k?"on":"off"}`]),d(10);try{const{jobId:se}=await I.startRun({configPath:$.sourcePath,runsPerScenario:Number(r),agents:ve.map(de=>de.id),scenarioIds:Ce.map(de=>de.id),applySnapshotEval:F?k:!1});N(se),ke(se),pe(se)}catch(se){const de=se instanceof Error?se.message:String(se),Ne=de.includes("Anthropic model not found")?" Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.":"";h(Fe=>[...Fe,`[${new Date().toLocaleTimeString()}] Error: ${de}${Ne}`]),o(!1),d(0),N(null)}},ie=()=>{ge()},ce=()=>{q.current&&clearInterval(q.current),S&&I.stopRun(S),H.current?.(),H.current=null,xe(),N(null),o(!1),g(!1),j(!0),h(ve=>[...ve,`[${new Date().toLocaleTimeString()}] Run aborted by user.`])},oe=async()=>{if(w){L(!0);try{const ve=await I.createSnapshotFromRun(w,D.trim()||void 0);Oe({title:"Snapshot saved",description:`Created ${ve.name} (${ve.id})`}),D.trim()||U(ve.name)}catch(ve){Oe({title:"Could not save snapshot",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{L(!1)}}};v.useEffect(()=>{G.current&&(G.current.scrollTop=G.current.scrollHeight)},[f]),v.useEffect(()=>()=>{q.current&&clearInterval(q.current),H.current?.()},[]),v.useEffect(()=>{if(S||p)return;let ve="";try{ve=sessionStorage.getItem(f1)??""}catch{ve=""}if(ve)return N(ve),o(!0),g(!1),j(!1),h(Ce=>Ce.length>0?Ce:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),pe(ve),()=>{}},[S,p]),v.useEffect(()=>{Z();const ve=()=>{Z()};return window.addEventListener("focus",ve),()=>{window.removeEventListener("focus",ve)}},[Z]);const xe=()=>{try{sessionStorage.removeItem(f1)}catch{}},ke=ve=>{try{sessionStorage.setItem(f1,ve)}catch{}},pe=ve=>{H.current?.(),H.current=I.subscribeRunJob(ve,Ce=>{const Le=new Date(Ce.ts).toLocaleTimeString();if(Ce.type==="started"&&(h(se=>{const de=`[${Le}] Run started.`;return se.includes(de)?se:[...se,de]}),d(se=>Math.max(se,30)),j(!1)),Ce.type==="log"){const se=String(Ce.payload.message??"").trim();se&&(h(de=>{const Ne=`[${Le}] ${se}`;return de.includes(Ne)?de:[...de,Ne]}),d(de=>{const Ne=se.toLowerCase();return Ne.startsWith("loading mcp evaluation config")?Math.max(de,15):Ne.startsWith("loaded config")?Math.max(de,20):Ne.startsWith("selected ")?Math.max(de,30):Ne.startsWith("using requested agents")||Ne.startsWith("using resolved default agents")?Math.max(de,35):Ne.startsWith("expanded to ")?Math.max(de,45):Ne.startsWith("running evaluation")?Math.max(de,55):Ne.startsWith("evaluation execution finished")?Math.max(de,75):Ne.startsWith("applying snapshot evaluation policy")?Math.max(de,82):Ne.includes("snapshot evaluation applied")||Ne.includes("snapshot evaluation enabled")?Math.max(de,88):Ne.startsWith("writing results to ")?Math.max(de,94):Ne.startsWith("run finished:")?Math.max(de,98):de}))}if(Ce.type==="completed"){const se=String(Ce.payload.runId??"");if(h(de=>{const Ne=`[${Le}] Run completed.`;return de.includes(Ne)?de:[...de,Ne]}),Ce.payload.snapshotEval&&typeof Ce.payload.snapshotEval=="object"){const de=Ce.payload.snapshotEval;h(Ne=>{const Fe=`[${Le}] Snapshot eval (${de.mode??"warn"}) baseline=${de.baseline_snapshot_id??"-"} score=${de.overall_score??"-"} status=${de.status??"-"}`;return Ne.includes(Fe)?Ne:[...Ne,Fe]})}d(100),o(!1),g(!0),j(!1),x(se),xe(),N(null),H.current?.(),H.current=null}if(Ce.type==="error"){const se=String(Ce.payload.message??"Unknown error"),de=se.includes("Anthropic model not found")?" Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.":"";h(Ne=>[...Ne,`[${Le}] Error: ${se}${de}`]),o(!1),g(!1),j(!1),d(0),xe(),N(null),H.current?.(),H.current=null}})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(Ll,{className:"h-6 w-6"}),"Run Evaluation"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Execute evaluation scenarios against MCP servers"})]}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6 space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Kt,{value:t,onValueChange:n,children:[s.jsx(Ut,{children:s.jsx(Gt,{placeholder:"Select a config"})}),s.jsx(qt,{children:X.map(ve=>s.jsx(Je,{value:ve.id,children:ve.name},ve.id))})]}),s.jsx(ae,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:()=>{Z()},"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(za,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{children:"Variance Runs"}),s.jsx(it,{type:"number",min:"1",max:"10",value:r,onChange:ve=>a(ve.target.value)})]})]}),$&&s.jsxs("div",{className:"space-y-2",children:[F&&$.snapshotEval?.enabled&&s.jsxs("div",{className:"rounded-md border bg-amber-500/10 p-2 text-xs text-amber-700 dark:text-amber-300",children:["Snapshot eval active (",$.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:$.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Te,{children:"Agents"}),s.jsx("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>P(V.map(ve=>ve.id)),children:"Select all"})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:V.map(ve=>{const Ce=A.includes(ve.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ha,{checked:Ce,onCheckedChange:Le=>{const se=Le===!0;P(de=>se?[...de,ve.id]:de.filter(Ne=>Ne!==ve.id))}}),s.jsx("span",{children:ve.name||ve.id})]},ve.id)})}),V.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available in this config. Add inline agents or agent references."})]}),$&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Te,{children:"Tests"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>O(J.map(ve=>ve.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>O([]),children:"Clear"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[E.length," of ",J.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:J.map(ve=>{const Ce=E.includes(ve.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(ha,{checked:Ce,onCheckedChange:Le=>{const se=Le===!0;O(de=>se?[...de,ve.id]:de.filter(Ne=>Ne!==ve.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:ve.name||ve.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:ve.id})]})]},ve.id)})})]}),F&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ha,{checked:k,onCheckedChange:ve=>R(ve===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ae,{onClick:ie,disabled:i||!t||V.length>0&&A.length===0||J.length>0&&E.length===0,children:[s.jsx(Ll,{className:"mr-2 h-4 w-4"}),"Run"]}),i&&s.jsxs(ae,{variant:"destructive",onClick:ce,children:[s.jsx(y1,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Et,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(Ue,{className:"space-y-4",children:[s.jsx(ag,{value:c,className:"h-2"}),s.jsx("div",{ref:G,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((ve,Ce)=>s.jsx("div",{className:ve.includes("✓")?"text-success":ve.includes("aborted")?"text-destructive":"text-foreground",children:ve},Ce))})]})]}),y&&!i&&!p&&s.jsx(ze,{className:"border-amber-300/60 bg-amber-50/40",children:s.jsx(Ue,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(y1,{className:"h-5 w-5 text-amber-700"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-medium",children:"Run stopped"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"The evaluation was stopped before completion. You can start it again or clear the progress log."})]}),s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[s.jsx(ae,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(ae,{type:"button",onClick:ie,disabled:!t,children:[s.jsx(Ll,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&s.jsx(ze,{className:"border-success/50",children:s.jsxs(Ue,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Dl,{className:"h-6 w-6 text-success"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Evaluation Complete"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"All scenarios have been evaluated successfully."})]}),s.jsx(ae,{asChild:!0,className:"ml-auto",children:s.jsx(yt,{to:`/results/${w||"run-a1b2c3"}${t?`?configId=${encodeURIComponent(t)}`:""}`,children:"View Results"})})]}),F&&w&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(it,{value:D,onChange:ve=>U(ve.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>{oe()},disabled:z,children:z?"Saving...":"Save Snapshot"})]})]})})]})},oge=()=>{const{source:e}=An(),[t,n]=v.useState([]),[r,a]=v.useState(!1),[i,o]=v.useState(null),[c,d]=v.useState(!1),[f,h]=v.useState("timestamp"),[p,g]=v.useState("desc"),[y,j]=v.useState("all"),w=k=>{if(f===k){g(R=>R==="asc"?"desc":"asc");return}h(k),g(k==="timestamp"?"desc":"asc")},x=async()=>{a(!0);try{n(await e.listResults())}catch(k){Oe({title:"Could not load results",description:k instanceof Error?k.message:String(k),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{let k=!0;return a(!0),e.listResults().then(R=>{k&&n(R)}).catch(R=>{k&&Oe({title:"Could not load results",description:R instanceof Error?R.message:String(R),variant:"destructive"})}).finally(()=>{k&&a(!1)}),()=>{k=!1}},[e]);const S=v.useMemo(()=>{const k=new Set;return t.forEach(R=>{R.scenarios.forEach(D=>{const U=String(D.scenarioName??"").trim(),z=String(D.scenarioId??"").trim(),L=U||z;L&&k.add(L)})}),Array.from(k).sort((R,D)=>R.localeCompare(D))},[t]),N=v.useMemo(()=>y==="all"?t:t.filter(k=>k.scenarios.some(R=>{const D=String(R.scenarioName??"").trim(),U=String(R.scenarioId??"").trim();return(D||U)===y})),[t,y]),A=v.useMemo(()=>[...N].sort((R,D)=>{let U=0;return f==="id"&&(U=R.id.localeCompare(D.id)),f==="timestamp"&&(U=new Date(R.timestamp).getTime()-new Date(D.timestamp).getTime()),f==="passRate"&&(U=R.overallPassRate-D.overallPassRate),f==="scenarios"&&(U=R.totalScenarios-D.totalScenarios),f==="avgToolCalls"&&(U=R.avgToolCalls-D.avgToolCalls),p==="asc"?U:-U}),[N,f,p]),P=k=>f!==k?s.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(Fa,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}),E=k=>{const R=Array.from(new Map(k.scenarios.map(L=>{const G=String(L.scenarioId??"").trim(),q=String(L.scenarioName??"").trim();return!G&&!q?null:[G||q,q||G]}).filter(L=>!!L)).values()),D=Array.from(new Set(k.scenarios.map(L=>L.agentName).filter(Boolean))),U=R.slice(0,2).join(", "),z=R.length>2?` +${R.length-2}`:"";return{scenarioCount:R.length,agentCount:D.length,scenarioPreview:U?`${U}${z}`:"n/a"}},O=async k=>{d(!0);try{await e.deleteResult(k),n(R=>R.filter(D=>D.id!==k)),Oe({title:"Run deleted",description:k}),o(null)}catch(R){Oe({title:"Could not delete run",description:R instanceof Error?R.message:String(R),variant:"destructive"})}finally{d(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(ws,{open:i!==null,onOpenChange:k=>{!k&&!c&&o(null)},children:s.jsxs(Ka,{children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:"Delete run?"}),s.jsxs(Qa,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(Ya,{children:[s.jsx(Za,{disabled:c,children:"Cancel"}),s.jsx(Ja,{disabled:c||!i,onClick:k=>{k.preventDefault(),i&&O(i)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c?"Deleting...":"Delete run"})]})]})}),s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(ld,{className:"h-6 w-6"}),"Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse evaluation runs and open detailed results"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Kt,{value:y,onValueChange:j,children:[s.jsx(Ut,{className:"w-[260px]",children:s.jsx(Gt,{placeholder:"Filter by scenario"})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All scenarios"}),S.map(k=>s.jsx(Je,{value:k,children:k},k))]})]}),s.jsx(ae,{variant:"outline",onClick:()=>{x()},disabled:r,children:r?"Refreshing...":"Refresh"})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("id"),children:["Run ID",P("id")]})}),s.jsx(nt,{children:"Evaluated"}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("timestamp"),children:["Timestamp",P("timestamp")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("passRate"),children:["Pass Rate",P("passRate")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("scenarios"),children:["Scenarios",P("scenarios")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("avgToolCalls"),children:["Tool Calls",P("avgToolCalls")]})}),s.jsx(nt,{className:"w-10"})]})}),s.jsx(Yr,{children:A.map(k=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/results/${k.id}`,className:"font-mono text-xs text-primary hover:underline",children:k.id}),k.configId?s.jsx("div",{className:"text-[11px] text-muted-foreground",children:k.configId}):null]})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const R=E(k);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",R.scenarioCount," scenario",R.scenarioCount===1?"":"s"," · ",R.agentCount," agent",R.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:R.scenarioPreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Pm,{className:"h-3 w-3"}),new Date(k.timestamp).toLocaleString()]})}),s.jsx(He,{children:s.jsx(wo,{rate:k.overallPassRate})}),s.jsx(He,{className:"font-mono text-sm",children:k.totalScenarios}),s.jsx(He,{className:"font-mono text-sm",children:k.avgToolCalls.toFixed(0)}),s.jsx(He,{children:s.jsxs(Kc,{children:[s.jsx(Gc,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Go,{align:"end",children:[s.jsx(cr,{asChild:!0,children:s.jsxs(yt,{to:`/results/${k.id}`,children:[s.jsx(kU,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(cr,{children:[s.jsx(ma,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(cr,{className:"text-destructive",onSelect:R=>{R.preventDefault(),o(k.id)},children:[s.jsx(_r,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},k.id))})]})})})]})};function od({text:e,variant:t="assistant",className:n}){const r=lge(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(v.Fragment,{children:cge(a,i,t)},`md-${i}`))})}function lge(e){const t=e.replace(/\r\n/g,`
|
|
144
|
-
`).split(`
|
|
145
|
-
`),n=[];let r=0;const a=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(a(o)){r+=1;continue}if(i(o)){const g=c.replace(/^```/,"").trim()||void 0;r+=1;const y=[];for(;r<t.length&&!i(t[r]);)y.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:g,code:y.join(`
|
|
146
|
-
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const g=[];for(;r<t.length&&t[r].trim().startsWith(">");)g.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:g.join(`
|
|
147
|
-
`)});continue}const d=c.match(/^(#{1,4})\s+(.+)$/);if(d){n.push({type:"heading",level:d[1].length,text:d[2].trim()}),r+=1;continue}if(wM(t,r)){const g=jM(t[r]);r+=2;const y=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)y.push(jM(t[r])),r+=1;n.push({type:"table",headers:g,rows:y});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const g=!!f,y=[];for(;r<t.length;){const j=t[r].trim();if(g?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){y.push(j.replace(g?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:g,items:y});continue}const p=[o];for(r+=1;r<t.length;){const g=t[r],y=g.trim();if(a(g)||i(g)||/^---+$/.test(y)||/^#{1,4}\s+/.test(y)||y.startsWith(">")||wM(t,r)||/^\d+\.\s+/.test(y)||/^[-*+]\s+/.test(y))break;p.push(g),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
148
|
-
`)})}return n}function wM(e,t){if(t+1>=e.length)return!1;const n=e[t].trim(),r=e[t+1].trim();return n.includes("|")?/^\|?(\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?$/.test(r):!1}function jM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function cge(e,t,n){if(e.type==="hr")return s.jsx("hr",{className:"border-border/60"});if(e.type==="heading"){const r=e.level===1?"text-base font-semibold":e.level===2?"text-sm font-semibold":"text-sm font-medium";return s.jsx("h4",{className:r,children:Al(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Al(e.text,`${t}-p`)});if(e.type==="blockquote")return s.jsx("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground italic",children:Al(e.text,`${t}-bq`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Al(a,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[s.jsx("thead",{className:"bg-muted/40",children:s.jsx("tr",{children:e.headers.map((r,a)=>s.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:Al(r,`${t}-thc-${a}`)},`${t}-th-${a}`))})}),s.jsx("tbody",{children:e.rows.map((r,a)=>s.jsx("tr",{className:"border-t",children:r.map((i,o)=>s.jsx("td",{className:"px-2 py-1.5 align-top",children:Al(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Al(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|\*[^*\n]+\*|_[^_\n]+_|~~[^~\n]+~~|\[[^\]]+\]\([^)]+\))/g).filter(Boolean).map((r,a)=>{if(r.startsWith("`")&&r.endsWith("`"))return s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("**")&&r.endsWith("**"))return s.jsx("strong",{children:r.slice(2,-2)},`${t}-${a}`);if(r.startsWith("*")&&r.endsWith("*"))return s.jsx("em",{children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("_")&&r.endsWith("_"))return s.jsx("em",{children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("~~")&&r.endsWith("~~"))return s.jsx("s",{children:r.slice(2,-2)},`${t}-${a}`);const i=r.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return i?s.jsx("a",{href:i[2],target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:i[1]},`${t}-${a}`):s.jsx(v.Fragment,{children:r},`${t}-${a}`)})}function uge(e){const t=e.scenarios.reduce((c,d)=>c+d.runs.filter(f=>f.passed).length,0),n=e.totalRuns-t,r={};e.scenarios.forEach(c=>c.runs.forEach(d=>d.toolCalls.forEach(f=>{r[f.name]=(r[f.name]||0)+1})));const a=Object.keys(r),i=Object.values(r),o=e.scenarios.map(c=>`
|
|
149
|
-
<div class="scenario-card">
|
|
150
|
-
<div class="scenario-header" onclick="this.parentElement.classList.toggle('open')">
|
|
151
|
-
<span class="chevron">▶</span>
|
|
152
|
-
<span class="scenario-name">${po(c.scenarioName)}</span>
|
|
153
|
-
<span class="scenario-agent">${po(c.agentName)}</span>
|
|
154
|
-
<span class="mono">${c.runs.length} runs</span>
|
|
155
|
-
<span class="badge ${c.passRate>=.8?"badge-pass":c.passRate>=.5?"badge-warn":"badge-fail"}">${Math.round(c.passRate*100)}%</span>
|
|
156
|
-
<span class="mono">${c.avgToolCalls.toFixed(1)} avg tools</span>
|
|
157
|
-
</div>
|
|
158
|
-
<div class="scenario-detail">
|
|
159
|
-
${c.runs.map(d=>`
|
|
160
|
-
<div class="run-row">
|
|
161
|
-
<span class="run-status ${d.passed?"pass":"fail"}">${d.passed?"✓":"✗"}</span>
|
|
162
|
-
<span class="mono run-label">Run #${d.runIndex+1}</span>
|
|
163
|
-
<span class="mono run-duration">${d.duration}ms</span>
|
|
164
|
-
<div class="tool-pills">
|
|
165
|
-
${d.toolCalls.map(f=>`<span class="pill">${po(f.name)} <small>${f.duration}ms</small></span>`).join("")}
|
|
166
|
-
</div>
|
|
167
|
-
${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>po(f)).join(", ")}</div>`:""}
|
|
168
|
-
</div>`).join("")}
|
|
169
|
-
</div>
|
|
170
|
-
</div>`).join("");return`<!DOCTYPE html>
|
|
171
|
-
<html lang="en">
|
|
172
|
-
<head>
|
|
173
|
-
<meta charset="UTF-8">
|
|
174
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
175
|
-
<title>MCPLab Report — ${po(e.id)}</title>
|
|
176
|
-
<script src="https://cdn.jsdelivr.net/npm/chart.js@4"><\/script>
|
|
177
|
-
<style>
|
|
178
|
-
*{box-sizing:border-box;margin:0;padding:0}
|
|
179
|
-
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f9fafb;color:#1f2937;padding:2rem;max-width:1100px;margin:0 auto}
|
|
180
|
-
h1{font-size:1.5rem;font-weight:700}
|
|
181
|
-
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.8rem}
|
|
182
|
-
.header{display:flex;align-items:center;gap:1rem;margin-bottom:.25rem}
|
|
183
|
-
.sub{font-size:.75rem;color:#6b7280;margin-bottom:1.5rem}
|
|
184
|
-
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin-bottom:2rem}
|
|
185
|
-
.stat{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
186
|
-
.stat-label{font-size:.7rem;color:#6b7280;text-transform:uppercase;letter-spacing:.05em}
|
|
187
|
-
.stat-value{font-size:1.5rem;font-weight:700;margin-top:.25rem}
|
|
188
|
-
.charts{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-bottom:2rem}
|
|
189
|
-
.chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
190
|
-
.chart-card h3{font-size:.85rem;font-weight:600;margin-bottom:.75rem}
|
|
191
|
-
canvas{max-height:220px}
|
|
192
|
-
.scenario-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;margin-bottom:.75rem;overflow:hidden}
|
|
193
|
-
.scenario-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;cursor:pointer;font-size:.85rem}
|
|
194
|
-
.scenario-header:hover{background:#f9fafb}
|
|
195
|
-
.chevron{font-size:.6rem;transition:transform .15s;color:#9ca3af}
|
|
196
|
-
.scenario-card.open .chevron{transform:rotate(90deg)}
|
|
197
|
-
.scenario-name{font-weight:600;flex:1}
|
|
198
|
-
.scenario-agent{color:#6b7280;font-size:.8rem}
|
|
199
|
-
.scenario-detail{display:none;border-top:1px solid #e5e7eb;padding:.75rem 1rem;background:#fafafa}
|
|
200
|
-
.scenario-card.open .scenario-detail{display:block}
|
|
201
|
-
.run-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:.8rem}
|
|
202
|
-
.run-row:last-child{border-bottom:none}
|
|
203
|
-
.run-status{font-weight:700;font-size:1rem}
|
|
204
|
-
.run-status.pass{color:#059669}
|
|
205
|
-
.run-status.fail{color:#dc2626}
|
|
206
|
-
.run-duration{color:#6b7280}
|
|
207
|
-
.tool-pills{display:flex;flex-wrap:wrap;gap:.25rem}
|
|
208
|
-
.pill{background:#fef3c7;color:#92400e;padding:2px 8px;border-radius:9999px;font-size:.7rem;font-family:'JetBrains Mono',monospace}
|
|
209
|
-
.pill small{color:#b45309;margin-left:2px}
|
|
210
|
-
.failure-reasons{width:100%;color:#dc2626;font-size:.75rem;margin-top:.25rem}
|
|
211
|
-
.badge{padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:600}
|
|
212
|
-
.badge-pass{background:#d1fae5;color:#065f46}
|
|
213
|
-
.badge-warn{background:#fef3c7;color:#92400e}
|
|
214
|
-
.badge-fail{background:#fee2e2;color:#991b1b}
|
|
215
|
-
.footer{text-align:center;color:#9ca3af;font-size:.7rem;margin-top:2rem;padding-top:1rem;border-top:1px solid #e5e7eb}
|
|
216
|
-
</style>
|
|
217
|
-
</head>
|
|
218
|
-
<body>
|
|
219
|
-
<div class="header">
|
|
220
|
-
<h1 class="mono">${po(e.id)}</h1>
|
|
221
|
-
<span class="badge ${e.overallPassRate>=.8?"badge-pass":e.overallPassRate>=.5?"badge-warn":"badge-fail"}">${Math.round(e.overallPassRate*100)}% pass</span>
|
|
222
|
-
</div>
|
|
223
|
-
<p class="sub">${new Date(e.timestamp).toLocaleString()} · Config hash: <span class="mono">${po(e.configHash)}</span></p>
|
|
224
|
-
|
|
225
|
-
<div class="stats">
|
|
226
|
-
<div class="stat"><div class="stat-label">Scenarios</div><div class="stat-value">${e.totalScenarios}</div></div>
|
|
227
|
-
<div class="stat"><div class="stat-label">Total Runs</div><div class="stat-value">${e.totalRuns}</div></div>
|
|
228
|
-
<div class="stat"><div class="stat-label">Pass Rate</div><div class="stat-value">${Math.round(e.overallPassRate*100)}%</div></div>
|
|
229
|
-
<div class="stat"><div class="stat-label">Avg Tool Calls</div><div class="stat-value">${e.avgToolCalls.toFixed(1)}</div></div>
|
|
230
|
-
<div class="stat"><div class="stat-label">Avg Latency</div><div class="stat-value">${e.avgLatency}ms</div></div>
|
|
231
|
-
</div>
|
|
232
|
-
|
|
233
|
-
<div class="charts">
|
|
234
|
-
<div class="chart-card"><h3>Pass / Fail</h3><canvas id="pieChart"></canvas></div>
|
|
235
|
-
<div class="chart-card"><h3>Tool Usage</h3><canvas id="barChart"></canvas></div>
|
|
236
|
-
</div>
|
|
237
|
-
|
|
238
|
-
<h2 style="font-size:1rem;font-weight:600;margin-bottom:.75rem">Scenarios</h2>
|
|
239
|
-
${o}
|
|
240
|
-
|
|
241
|
-
<div class="footer">Generated by MCPLab · ${new Date().toISOString()}</div>
|
|
242
|
-
|
|
243
|
-
<script>
|
|
244
|
-
new Chart(document.getElementById('pieChart'),{type:'doughnut',data:{labels:['Pass','Fail'],datasets:[{data:[${t},${n}],backgroundColor:['#059669','#dc2626'],borderWidth:0}]},options:{cutout:'60%',plugins:{legend:{position:'bottom',labels:{font:{size:11}}}}}});
|
|
245
|
-
new Chart(document.getElementById('barChart'),{type:'bar',data:{labels:${JSON.stringify(a)},datasets:[{data:${JSON.stringify(i)},backgroundColor:'#f59e0b',borderRadius:4}]},options:{indexAxis:'y',plugins:{legend:{display:false}},scales:{x:{grid:{display:false}},y:{grid:{display:false},ticks:{font:{family:'monospace',size:11}}}}}});
|
|
246
|
-
<\/script>
|
|
247
|
-
</body>
|
|
248
|
-
</html>`}function po(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const dge="mcplab.resultAssistantScenarioHandoff",fge=[{label:"Summarize Run Results",description:"Highlight failures first, then notable tool usage and extracted values.",prompt:"Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."},{label:"Compare Agent Answer Quality",description:"Rank agents by completeness, depth, and recommendation quality.",prompt:"Compare the answer quality across all agents for this run. Rank them by completeness, analytical depth, and usefulness of recommendations. Highlight concrete differences in tool usage."},{label:"Explain Key Failures",description:"Use traces and tool outputs to identify likely root causes.",prompt:"Identify the most important failures in this run and explain likely root causes using the trace and tool outputs."},{label:"Compare With Previous Run",description:"Summarize changes in outcomes, tool usage, and extracted values.",prompt:"Compare this run with the previous run and summarize changes in outcomes, tool usage, and extracted values."}];function SM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function NM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const pge=()=>{const{id:e}=Fo(),t=ya(),[n]=$c(),{source:r}=An(),a=jf("snapshots",!1),{configs:i}=cf(),{scenarios:o}=Va(),[c,d]=v.useState(void 0),[f,h]=v.useState(!0),[p,g]=v.useState(new Set),[y,j]=v.useState(new Set),[w,x]=v.useState([]),[S,N]=v.useState(""),[A,P]=v.useState(null),[E,O]=v.useState(!1),[k,R]=v.useState(""),[D,U]=v.useState(""),[z,L]=v.useState(!1),[G,q]=v.useState(!1),[H,X]=v.useState(null),[Z,I]=v.useState([]),[F,Q]=v.useState([]),[B,$]=v.useState(""),[ee,V]=v.useState(!1),[J,ge]=v.useState(!1),[ie,ce]=v.useState("assistant"),[oe,xe]=v.useState(null),[ke,pe]=v.useState(null),[ve,Ce]=v.useState(!1),[Le,se]=v.useState(""),[de,Ne]=v.useState(""),[Fe,je]=v.useState(!1),[$e,et]=v.useState(!1),[xt,Jt]=v.useState(!1),[ye,We]=v.useState([]),[Ye,Ot]=v.useState(!1),[Dt,kt]=v.useState(""),[Zt,Sn]=v.useState(null),[tr,nr]=v.useState(!1),[wa,En]=v.useState(null),kr=v.useRef(null),Rr=v.useRef(null),yr=v.useCallback(async(K,he)=>{Ot(!0);try{const T=(await r.listMarkdownReports()).filter(ne=>{const be=String(ne.relativePath??""),_e=String(ne.name??"");return be.includes(K)||_e.includes(K)});if(We(T),he&&T.length>0){const ne=T.find(be=>be.relativePath===he||be.path===he||be.relativePath.endsWith(he)||be.path.endsWith(he));ne&&kt(ne.relativePath)}return T}catch{return We([]),[]}finally{Ot(!1)}},[r]);v.useEffect(()=>{if(!e)return;let K=!0;const he=H;return he&&(r.closeResultAssistantSession(he).catch(()=>{}),X(null),I([]),Q([]),pe(null)),h(!0),r.getResult(e).then(at=>{K&&(d(at),h(!1))}),()=>{K=!1}},[e,r]),v.useEffect(()=>{let K=!0;return r.listSnapshots().then(he=>{K&&x(he)}).catch(()=>{K&&x([])}),()=>{K=!1}},[r]),v.useEffect(()=>{if(!c?.id){We([]);return}let K=!0;return(async()=>{const he=await yr(c.id)})(),()=>{K=!1}},[c?.id,yr]),v.useEffect(()=>{if(ye.length===0){kt(""),Sn(null),En(null);return}(!Dt||!ye.some(K=>K.relativePath===Dt))&&kt(ye[0].relativePath)},[ye,Dt]),v.useEffect(()=>{if(!G||ie!=="reports")return;if(!Dt){Sn(null),En(null);return}let K=!0;return nr(!0),En(null),r.getMarkdownReport(Dt).then(he=>{K&&Sn(he)}).catch(he=>{K&&(Sn(null),En(he instanceof Error?he.message:String(he)))}).finally(()=>{K&&nr(!1)}),()=>{K=!1}},[G,ie,Dt,r]);const _n=n.get("configId")??"",Rn=v.useMemo(()=>{const K=_n?i.find(he=>he.id===_n):void 0;return K||(c?i.find(he=>he.id===c.configId):void 0)},[i,_n,c]),xn=v.useMemo(()=>{const K=new Map;if(Rn){for(const he of Rn.scenarios)K.set(he.id,he),he.name&&!K.has(he.name)&&K.set(he.name,he);for(const he of Rn.scenarioEntries??[]){if(he.kind!=="referenced")continue;const at=o.find(T=>T.id===he.ref);at&&(K.set(at.id,at),at.name&&K.set(at.name,at),K.has(he.ref)||K.set(he.ref,at))}}for(const he of o)K.has(he.id)||K.set(he.id,he),he.name&&!K.has(he.name)&&K.set(he.name,he);return K},[Rn,o]),Tn=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const K=i.filter(he=>he.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return K.length===1?K[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);if(v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&N(K=>K||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if(_n&&i.some(K=>K.id===_n)){R(_n);return}Tn&&R(K=>K||Tn)},[_n,i,Tn]),v.useEffect(()=>{if(!G)return;const K=window.setTimeout(()=>{kr.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(K)},[G,Z.length,ee]),v.useEffect(()=>()=>{H&&r.closeResultAssistantSession(H).catch(()=>{})},[H,r]),v.useEffect(()=>{const K=Rr.current;if(!K)return;K.style.height="0px";const he=Math.min(K.scrollHeight,160);K.style.height=`${Math.max(40,he)}px`},[B,G]),f)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading result..."});if(!c)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Result not found"});const ue=c.scenarios.reduce((K,he)=>K+he.runs.filter(at=>at.passed).length,0),Ie=c.totalRuns-ue,ct=[{name:"Pass",value:ue,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:Ie,color:"hsl(0, 72%, 51%)"}],bt={};c.scenarios.forEach(K=>K.runs.forEach(he=>he.toolCalls.forEach(at=>{bt[at.name]=(bt[at.name]||0)+1})));const Wt=Object.entries(bt).map(([K,he])=>({name:K,count:he})).sort((K,he)=>he.count-K.count),ln=K=>{g(he=>{const at=new Set(he);return at.has(K)?at.delete(K):at.add(K),at})},Pt=(K,he,at,T)=>`${K}:${he}:${at}:${T}`,rr=(K,he)=>`${K}::${he}`,cn=K=>{j(he=>{const at=new Set(he);return at.has(K)?at.delete(K):at.add(K),at})},Xt=K=>{const he=!K.endsWith(":conversation");return y.has(K)?!he:he},xr=new Map((A?.scenario_results??[]).map(K=>[K.scenario_id,K])),ja=async()=>{if(!(!c||!S)){O(!0);try{const K=await r.compareSnapshot(S,c.id);P(K)}finally{O(!1)}}},Sa=async K=>{const he=K||c.snapshotEval?.baselineSnapshotId;if(he){N(he),O(!0);try{const at=await r.compareSnapshot(he,c.id);P(at)}catch(at){Oe({title:"Could not review drift",description:at instanceof Error?at.message:String(at),variant:"destructive"})}finally{O(!1)}}},ti=async()=>{if(!k){Oe({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}L(!0);try{const K=await r.generateSnapshotEvalBaseline(c.id,k,D.trim()||void 0);x(he=>[K.snapshot,...he.filter(at=>at.id!==K.snapshot.id)]),N(K.snapshot.id),Oe({title:"Baseline updated",description:`${K.snapshot.name} is now linked to the selected config.`}),D.trim()||U(K.snapshot.name),c.snapshotEval?.applied&&Sa(K.snapshot.id)}catch(K){Oe({title:"Could not accept new baseline",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{L(!1)}},Gi=async()=>{const K=B.trim();if(!K||!c)return;const he=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,at={id:he,role:"user",text:K,createdAt:new Date().toISOString()};$(""),I(T=>[...T,at]),V(!0);try{let T=H;if(!T){const be=await r.createResultAssistantSession(c.id);T=be.sessionId,X(be.session.id),Q(be.session.pendingToolCalls),pe({assistantAgentName:be.session.selectedAssistantAgentName,provider:be.session.provider,model:be.session.model}),I(_e=>{const rt=_e.some(vt=>vt.id===he),Ge=be.session.messages;return rt?[...Ge,at]:Ge})}const ne=await r.sendResultAssistantMessage(T,K);ni(ne.session)}catch(T){I(ne=>ne.filter(be=>be.id!==he)),Oe({title:"MCP Labs Assistant error",description:T instanceof Error?T.message:String(T),variant:"destructive"})}finally{V(!1)}},Yo=K=>{$(K),requestAnimationFrame(()=>Rr.current?.focus())},ni=K=>{X(K.id),I(K.messages),Q(K.pendingToolCalls),pe({assistantAgentName:K.selectedAssistantAgentName,provider:K.provider,model:K.model})},Tr=async K=>{if(H){V(!0);try{const he=await r.approveResultAssistantToolCall(H,K);ni(he.session)}catch(he){Oe({title:"Could not approve assistant action",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{V(!1)}}},Yi=async K=>{if(H){V(!0);try{const he=await r.denyResultAssistantToolCall(H,K);ni(he.session)}catch(he){Oe({title:"Could not deny assistant action",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{V(!1)}}},es=(K,he)=>{ce("assistant"),q(!0),xe(he?.scenarioId??null),Z.length===0&&I([{id:`msg-${Date.now()}`,role:"assistant",text:"Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result.",createdAt:new Date().toISOString()}]),K&&$(K)},Qc=K=>{ce("reports"),q(!0)},Xo=K=>{if(!c)return;if(!oe){Oe({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const he=o.find(T=>T.id===oe)??o.find(T=>T.name===oe);if(!he){Oe({title:"Scenario not found in library",description:`Could not find library scenario '${oe}' to open in Scenario Assistant.`,variant:"destructive"});return}const at=[`I am sending a suggestion from the Result Assistant for scenario '${oe}' based on run '${c.id}'.`,"Please review the suggestion, check it against the current scenario configuration, and propose concrete updates to the Checks and/or Value Capture Rules if appropriate.","","Result Assistant suggestion:",K].join(`
|
|
249
|
-
`);try{window.sessionStorage.setItem(dge,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:_n||c.configId||"",scenarioId:he.id,prompt:at,sourceReply:K})),t(`/libraries/test-cases/${encodeURIComponent(he.id)}?assistantHandoff=1`)}catch(T){Oe({title:"Could not create handoff",description:T instanceof Error?T.message:String(T),variant:"destructive"})}},ea=K=>{c&&(Jt(!1),se(K),Ne(SM(c.id)),je(!1),Ce(!0))},ts=()=>{c&&(Jt(!0),se(""),Ne(SM(c.id)),je(!1),Ce(!0))},Na=async()=>{if(!c)return;if(!Le.trim()){Oe({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}et(!0);try{const he=await r.applyResultAssistantReport({runId:c.id,markdown:Le,outputPath:de.trim()||void 0,overwrite:Fe});Oe({title:"Markdown report written",description:typeof he.path=="string"&&he.path?he.path:he.outputPath}),await yr(c.id,typeof he.path=="string"&&he.path||he.outputPath||void 0),G&&ce("reports"),Ce(!1)}catch(he){Oe({title:"Could not write markdown report",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{et(!1)}},Jc=async K=>{try{await navigator.clipboard.writeText(K),Oe({title:"Copied"})}catch(he){Oe({title:"Could not copy",description:he instanceof Error?he.message:String(he),variant:"destructive"})}};return s.jsxs("div",{className:`${G?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${G?"xl:shrink-0 xl:pb-6":"mb-6"}`,children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(ae,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(yt,{to:"/results",children:s.jsx(No,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h1",{className:"text-2xl font-bold font-mono",children:c.id}),s.jsx(wo,{rate:c.overallPassRate}),a&&c.snapshotEval?.applied&&s.jsxs(Ke,{variant:"outline",className:"text-xs",children:["Snapshot policy · ",c.snapshotEval.mode," · ",c.snapshotEval.status]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(c.timestamp).toLocaleString()," · Config hash: ",s.jsx("span",{className:"font-mono",children:c.configHash})]}),a&&c.snapshotEval?.applied&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Baseline: ",s.jsx("span",{className:"font-mono",children:c.snapshotEval.baselineSnapshotId})," · score: ",c.snapshotEval.overallScore]})]})]}),s.jsxs("div",{className:"ml-auto flex shrink-0 flex-wrap items-center justify-end gap-2",children:[a&&c.snapshotEval?.applied&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{Sa()},disabled:E,children:[s.jsx(CS,{className:"h-3.5 w-3.5"}),E?"Reviewing drift...":"Review Drift"]}),s.jsxs(ae,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const K=uge(c),he=new Blob([K],{type:"text/html"}),at=URL.createObjectURL(he),T=document.createElement("a");T.href=at,T.download=`mcplab-report-${c.id}.html`,T.click(),URL.revokeObjectURL(at)},children:[s.jsx(ma,{className:"h-3.5 w-3.5"}),"Download Report"]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Qc(),disabled:Ye,children:[s.jsx(lh,{className:"h-3.5 w-3.5"}),Ye?"Reference Reports...":`Reference Reports${ye.length?` (${ye.length})`:""}`]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>es(),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${G?J?"xl:grid-cols-[minmax(0,1fr)_52rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden":"xl:grid-cols-[minmax(0,1fr)_28rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden":"grid-cols-1"}`,children:[s.jsxs("div",{className:`min-w-0 space-y-6 ${G?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[a&&c.snapshotEval?.applied&&s.jsxs(ze,{className:"border-amber-500/30",children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Snapshot Drift Review"})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsxs(Ke,{variant:"outline",children:["Mode: ",c.snapshotEval.mode]}),s.jsxs(Ke,{variant:"outline",children:["Status: ",c.snapshotEval.status]}),s.jsxs(Ke,{variant:"outline",children:["Overall score: ",c.snapshotEval.overallScore]}),s.jsxs(Ke,{variant:"outline",className:"font-mono",children:["Baseline: ",c.snapshotEval.baselineSnapshotId]})]}),c.snapshotEval.impactedScenarios.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Impacted scenarios: ",c.snapshotEval.impactedScenarios.join(", ")]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1.2fr_1fr_auto] items-end",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Target config for baseline update"}),s.jsxs(Kt,{value:k,onValueChange:R,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select config to update"})}),s.jsx(qt,{children:i.map(K=>s.jsx(Je,{value:K.id,children:K.name},K.id))})]}),!k&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Tip: open results from the Run page to prefill the config automatically."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"New snapshot name (optional)"}),s.jsx("div",{className:"relative",children:s.jsx("input",{value:D,onChange:K=>U(K.target.value),placeholder:`Snapshot ${c.id}`,className:"h-8 w-full rounded-md border bg-background px-2 text-xs"})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{Sa()},disabled:E,children:[s.jsx(za,{className:`h-3.5 w-3.5 ${E?"animate-spin":""}`}),"Review Drift"]}),s.jsx(ae,{type:"button",size:"sm",className:"h-8",onClick:()=>{ti()},disabled:z||c.overallPassRate!==1,children:z?"Accepting...":"Accept as New Baseline"})]})]}),c.overallPassRate!==1&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Baseline updates require a fully passing run (same rule as snapshot creation)."})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-5",children:[s.jsx(Is,{title:"Scenarios",value:c.totalScenarios,icon:g1}),s.jsx(Is,{title:"Total Runs",value:c.totalRuns,icon:r$}),s.jsx(Is,{title:"Pass Rate",value:`${Math.round(c.overallPassRate*100)}%`,icon:ld}),s.jsx(Is,{title:"Avg Tool Calls",value:NM(c.avgToolCalls),icon:Dl}),s.jsx(Is,{title:"Avg Latency",value:`${c.avgLatency}ms`,icon:p$})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(ze,{children:[s.jsx(At,{className:"pb-2",children:s.jsx(Et,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(Ue,{className:"flex items-center justify-center",children:[s.jsxs(efe,{width:180,height:180,children:[s.jsx(Zs,{data:ct,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:ct.map((K,he)=>s.jsx(hv,{fill:K.color},he))}),s.jsx(qr,{})]}),s.jsxs("div",{className:"ml-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"h-3 w-3 rounded-full bg-success"}),ue," passed"]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"h-3 w-3 rounded-full bg-destructive"}),Ie," failed"]})]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-2",children:s.jsx(Et,{className:"text-base",children:"Tool Usage"})}),s.jsx(Ue,{children:s.jsx(ej,{width:"100%",height:180,children:s.jsxs(Zde,{data:Wt,layout:"vertical",children:[s.jsx(Ro,{type:"number",tick:{fontSize:11}}),s.jsx(To,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(qr,{}),s.jsx(Vo,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Et,{className:"text-base",children:"Scenarios"}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>es("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsxs(Ue,{className:"p-0",children:[a&&s.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b p-3",children:[s.jsxs("div",{className:"min-w-60 space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),s.jsxs(Kt,{value:S,onValueChange:N,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select snapshot"})}),s.jsx(qt,{children:w.map(K=>s.jsx(Je,{value:K.id,children:K.name},K.id))})]})]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",disabled:!S||E,onClick:()=>{ja()},children:E?"Comparing...":"Compare Snapshot"}),A&&s.jsxs(Ke,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",A.overall_score]})]}),s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{className:"w-8"}),s.jsx(nt,{children:"Scenario"}),s.jsx(nt,{children:"Agent"}),s.jsx(nt,{children:"Runs"}),s.jsx(nt,{children:"Pass Rate"}),s.jsx(nt,{children:"Tool Calls"}),s.jsx(nt,{children:"Snapshot"})]})}),s.jsx(Yr,{children:c.scenarios.map(K=>{const he=rr(K.scenarioId,K.agentName),at=K.scenarioName||K.scenarioId;return s.jsx(Ai,{open:p.has(he),onOpenChange:()=>ln(he),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Ts,{asChild:!0,children:s.jsxs(zt,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(He,{children:s.jsx(It,{className:`h-4 w-4 transition-transform ${p.has(he)?"rotate-180":""}`})}),s.jsx(He,{className:"font-medium text-sm",children:K.scenarioName}),s.jsx(He,{className:"text-sm",children:K.agentName}),s.jsx(He,{className:"font-mono text-sm",children:K.runs.length}),s.jsx(He,{children:s.jsx(wo,{rate:K.passRate})}),s.jsx(He,{className:"font-mono text-sm",children:NM(K.avgToolCalls)}),s.jsx(He,{children:(()=>{const T=xr.get(K.scenarioId);if(!T)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const ne=T.status==="Match"?"bg-success/15 text-success":T.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Ke,{variant:"outline",className:`text-xs ${ne}`,children:[T.status," · ",T.score]})})()})]})}),s.jsx(Ei,{asChild:!0,children:s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"p-0",children:s.jsxs("div",{className:"bg-muted/30 p-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-semibold",children:"Scenario details"}),s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[at," · ",K.agentName," · ",Math.round(K.passRate*100),"% pass rate"]})]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>es(`Explain why scenario '${at}' failed (agent: ${K.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:K.scenarioId}),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const T=xr.get(K.scenarioId);return!T||T.reasons.length===0?null:s.jsxs("div",{className:"rounded-md border bg-card p-2",children:[s.jsx("p",{className:"mb-1 text-xs font-semibold text-muted-foreground",children:"Snapshot reasons"}),s.jsxs("p",{className:"mb-1 text-[11px] text-muted-foreground",children:["Baseline agents: ",T.baseline_agents.join(", ")||"—"," · observed agents: ",T.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:T.reasons.map((ne,be)=>s.jsxs("li",{children:["• ",ne]},be))})]})})(),K.runs.map(T=>s.jsxs("div",{className:"flex items-start gap-3 rounded-md border bg-card p-3 text-sm",children:[s.jsx("div",{className:"mt-0.5",children:T.passed?s.jsx(Dl,{className:"h-4 w-4 text-success"}):s.jsx(th,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const ne=xn.get(K.scenarioId),be=ne?vge(ne.evalRules,T.failureReasons):[],_e=be.filter(Ge=>Ge.status==="failed"),rt=be.filter(Ge=>Ge.status==="passed");return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Run #",T.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[T.duration,"ms"]}),!T.passed&&s.jsx(Ke,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),T.failureReasons.length>0&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-2",children:[s.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:[s.jsx(th,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:T.failureReasons.map((Ge,vt)=>s.jsxs("li",{children:["• ",EM(Ge)]},vt))})]}),be.length>0&&s.jsx(Ai,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"checks")),onOpenChange:()=>cn(Pt(K.scenarioId,K.agentName,T.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Ts,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center gap-2 text-left",children:[s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Ke,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[rt.length," passed"]}),s.jsxs(Ke,{variant:"outline",className:`h-5 text-[10px] ${_e.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[_e.length," failed"]})]})}),s.jsx(Ei,{children:s.jsx("div",{className:"space-y-1",children:be.map((Ge,vt)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Ge.status==="failed"?"border-destructive/20 bg-destructive/5":"border-success/20 bg-success/5"}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Ge.status==="failed"?s.jsx(th,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(Dl,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:yge(Ge.rule)})]}),Ge.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:EM(Ge.failureReason)})]}),s.jsx(Ke,{variant:"outline",className:`shrink-0 text-[10px] ${Ge.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Ge.status})]},`${Ge.rule.type}-${Ge.rule.value}-${vt}`))})})]})})]})})(),s.jsx(Ai,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"extracts")),onOpenChange:()=>cn(Pt(K.scenarioId,K.agentName,T.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(Ts,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(It,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"extracts"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(g1,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(Ke,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(T.extractedValues??{}).length," total"]})]})}),s.jsx(Ei,{children:Object.keys(T.extractedValues??{}).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No extracted values captured for this run."}):s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(T.extractedValues??{}).map(([ne,be])=>s.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:ne}),s.jsx("div",{className:"font-mono break-all text-foreground",children:be===null?"null":String(be)})]},ne))})})]})}),s.jsx(Ai,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"tools")),onOpenChange:()=>cn(Pt(K.scenarioId,K.agentName,T.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(Ts,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(It,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"tools"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(Ms,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Ke,{variant:"outline",className:"h-5 text-[10px]",children:[T.toolCalls.length," total"]})]})}),s.jsx(Ei,{children:T.toolCalls.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):s.jsx("div",{className:"flex flex-wrap gap-1",children:T.toolCalls.map((ne,be)=>s.jsxs(Ke,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",be+1]}),ne.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[ne.duration,"ms"]})]},be))})})]})}),s.jsx(Ai,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"final")),onOpenChange:()=>cn(Pt(K.scenarioId,K.agentName,T.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Ts,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"final"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(Ei,{children:s.jsx(xS,{text:T.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Ai,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"conversation")),onOpenChange:()=>cn(Pt(K.scenarioId,K.agentName,T.runIndex,"conversation")),children:s.jsxs("div",{className:"rounded-md border bg-muted/10 p-2",children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[s.jsx(Ts,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(It,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"conversation"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>es(`Explain Run #${T.runIndex+1} for scenario '${at}'. It ${T.passed?"passed":"failed"} in ${T.duration}ms. Focus on the tool sequence and ${T.passed?"why it passed":"what caused the failure"}.`,{scenarioId:K.scenarioId}),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})})]}),s.jsx(Ei,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:T.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):T.conversation.map(ne=>s.jsx(hge,{item:ne,fallbackUserPrompt:xn.get(K.scenarioId)?.prompt},ne.id))})}),!Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},T.runIndex))]})})})})]})},he)})})]})]})]})]}),G&&s.jsxs("div",{className:"min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(sC,{value:ie,onValueChange:K=>ce(K),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(Kv,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(Ri,{value:"assistant",className:"-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Assistant"}),s.jsx(Ri,{value:"reports",className:"-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Reports"})]})}),ie==="assistant"?s.jsxs(ze,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(At,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Et,{className:"flex items-center gap-2 text-base",children:[s.jsx(ua,{className:"h-4 w-4 text-amber-500"}),"MCP Labs Assistant"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ge(K=>!K),children:[J?s.jsx(c_,{className:"h-3.5 w-3.5"}):s.jsx(u_,{className:"h-3.5 w-3.5"}),J?"Compact":"Expand"]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>q(!1),children:"Hide"})]})]}),s.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Ask questions about this run result, failures, tool usage, and snapshot drift."}),ke&&s.jsxs("p",{className:"shrink-0 text-[11px] text-muted-foreground",children:[ke.assistantAgentName," (",ke.provider,"/",ke.model,")"]})]})]})}),s.jsxs(Ue,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[s.jsx(Nm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[Z.map((K,he)=>{const at=K.role==="user",T=K.role==="assistant",ne=K.role==="system",be=K.role==="tool",_e=K.pendingToolCallId?F.find(Vt=>Vt.id===K.pendingToolCallId):void 0,rt=T&&!!K.pendingToolCallId;if(be&&/^(Approved|Denied) tool call\b/i.test(String(K.text??"").trim()))return null;_e?.server??K.toolRequestServer;const Ge=_e?.tool??K.toolRequestName,vt=_e?.publicToolName??K.toolRequestPublicName,Be=T&&!rt&&mge(K.text,!!oe);if(rt){const Vt=Ge??vt??"unknown_tool";return Ge&&Ge.replace(/^mcplab_/,"").replace(/_/g," "),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!_e,className:"group min-w-0 w-full max-w-[92%] rounded-md border border-border/60 bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ms,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"truncate text-sm font-medium",children:`Tool call ${Vt}`}),s.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold ${_e?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:_e?"Needs approval":"Completed"})]})}),s.jsx(It,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:[s.jsx(od,{text:K.text,className:"text-sm"}),_e&&s.jsxs(s.Fragment,{children:[s.jsx("pre",{className:"max-h-40 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{className:"break-words",children:JSON.stringify(_e.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Yi(_e.id)},children:"Deny"}),s.jsx(ae,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Tr(_e.id)},children:"Approve"})]})]})]})]})]},`${K.id??`${K.role}-${he}`}:${_e?"pending":"completed"}`)}const Ct=at||T&&!be&&!ne;return s.jsxs("div",{className:`flex items-start gap-2 ${at?"justify-end":"justify-start"}`,children:[!at&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:ne?s.jsx(d$,{className:"h-3 w-3"}):s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full rounded-md border p-3 text-sm ${at?"border-primary/20 bg-primary/10":ne?"border-amber-400/30 bg-amber-50/70":be?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(at||ne)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${at?"text-right":""}`,children:be?"Tool":"Assistant"}),s.jsx(od,{text:K.text,className:"text-sm"}),Be&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Xo(K.text),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Send to Scenario Assistant"]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>ea(K.text),children:[s.jsx(Ms,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Be&&T&&!rt&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>ea(K.text),children:[s.jsx(Ms,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),Ct&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{Jc(K.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Ii,{className:"h-3.5 w-3.5"})})]}),at&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(_S,{className:"h-3 w-3"})})]},K.id??`${K.role}-${he}`)}),F.filter(K=>!Z.some(he=>he.pendingToolCallId===K.id)).length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Pending actions (approve/deny)"}),F.filter(K=>!Z.some(he=>he.pendingToolCallId===K.id)).map(K=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"break-all font-mono text-xs font-semibold",children:K.publicToolName}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[K.server,"::",K.tool]})]}),s.jsx(It,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.jsx("pre",{className:"max-h-48 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{className:"break-words",children:JSON.stringify(K.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Yi(K.id)},children:"Deny"}),s.jsx(ae,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Tr(K.id)},children:"Approve"})]})]})]},K.id))]}),ee&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:kr})]})}),s.jsx("div",{className:"border-t bg-background px-4 py-3",children:s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(Gs,{ref:Rr,value:B,onChange:K=>$(K.target.value),placeholder:"Ask about this result...",rows:1,className:"min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",onKeyDown:K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),ee||Gi())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Kc,{children:[s.jsx(Gc,{asChild:!0,children:s.jsxs(ae,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-muted-foreground",disabled:ee,children:[s.jsx(Ba,{className:"h-3 w-3"}),"Snippets",s.jsx(It,{className:"h-3 w-3"})]})}),s.jsxs(Go,{align:"start",className:"w-[360px]",children:[s.jsx(nC,{children:"Result Assistant Snippets"}),s.jsx(rC,{}),fge.map(K=>s.jsx(cr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>Yo(K.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:K.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:K.description})]})},K.label))]})]}),s.jsx(ae,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:()=>{Gi()},disabled:ee||!B.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:ee?s.jsx(Zn,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(f$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Ask"})]})})]})]})})]})]}):s.jsxs(ze,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(At,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Et,{className:"flex items-center gap-2 text-base",children:[s.jsx(lh,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ge(K=>!K),children:[J?s.jsx(c_,{className:"h-3.5 w-3.5"}):s.jsx(u_,{className:"h-3.5 w-3.5"}),J?"Compact":"Expand"]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>q(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Review markdown reports for this run while keeping the result visible."})]})}),s.jsxs(Ue,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(Ye||ye.length===0||ye.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:Ye?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):ye.length===0?s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No reference reports for this run yet."}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>ts(),children:[s.jsx(Ba,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:ye.length>1?s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Selected report"}),s.jsxs(Kt,{value:Dt,onValueChange:kt,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select a report"})}),s.jsx(qt,{children:ye.map(K=>s.jsx(Je,{value:K.relativePath,children:K.name},K.path))})]})]}):null})}),s.jsx(Nm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:ye.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):tr?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):wa?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",wa]}):Zt?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("p",{className:"font-mono text-xs font-semibold",children:Zt.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:Zt.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(Zt.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(od,{text:Zt.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]})]}),s.jsx(ws,{open:ve,onOpenChange:K=>!$e&&Ce(K),children:s.jsxs(Ka,{className:"max-w-2xl",children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:xt?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(Qa,{children:xt?"Write a custom markdown report and save it to the workspace.":s.jsxs(s.Fragment,{children:["This will call ",s.jsx("code",{children:"mcplab_write_markdown_report"})," via the local MCPLab MCP server."]})})]}),s.jsxs("div",{className:"space-y-3",children:[!xt&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(it,{value:de,onChange:K=>Ne(K.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:$e})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ha,{checked:Fe,onCheckedChange:K=>je(K===!0),disabled:$e}),s.jsx("span",{children:"Overwrite if file exists"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:xt?"Markdown content":"Markdown preview (to be written)"}),s.jsx(Gs,{value:Le,onChange:K=>se(K.target.value),rows:10,className:"font-mono text-xs",disabled:$e})]})]}),s.jsxs(Ya,{children:[s.jsx(Za,{disabled:$e,children:"Cancel"}),s.jsx(Ja,{onClick:K=>{K.preventDefault(),Na()},disabled:$e,children:$e?"Writing...":xt?"Save Report":"Approve & Write"})]})]})})]})]})};function hge({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call")return s.jsx(AM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}`,text:e.text});if(e.kind==="tool_result"){const d=e.ok?s.jsx(Dl,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(th,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(AM,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}`,text:e.text,icon:d})}const n=e.kind==="user_prompt",r=CM(e.text,e.kind),a=t?CM(t,"user_prompt"):"",i=n&&a.length>r.length?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?_S:fa;return s.jsxs("div",{className:`flex items-start gap-2 text-xs ${n?"justify-end":"justify-start"}`,children:[!n&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:s.jsx(c,{className:"h-3 w-3"})}),s.jsxs("div",{className:`max-w-[90%] rounded-md p-2 ${n?"bg-primary/10":"bg-muted/50"}`,children:[s.jsx("p",{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?"text-right":""}`,children:o}),n?s.jsx(xS,{text:i,maxLength:280,className:"text-xs"}):s.jsx(xS,{text:i,maxLength:500,className:"text-xs"})]}),n&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(c,{className:"h-3 w-3"})})]})}function CM(e,t){const r=String(e??"").replace(/^\s+/,"");return t==="user_prompt"?r.replace(/^user:\s*/i,""):t==="assistant_final"||t==="assistant_thought"?r.replace(/^assistant:\s*/i,""):r}function mge(e,t){if(!t)return!1;const n=String(e??"").toLowerCase();if(!n.trim())return!1;const r=["check","checks","rule","rules","regex","pattern","value capture","extract rule","update","change","replace","modify","adjust","use ","set "],a=["change ","replace ","update ","use ","set the","suggested","you should","try ","text match failed","text must match pattern"];if(["i can only read","i don't have write access","i cannot directly edit","what happened","summary"].some(h=>n.includes(h))&&!a.some(h=>n.includes(h)))return!1;const o=r.some(h=>n.includes(h)),c=a.some(h=>n.includes(h)),d=/(^|\n)\s*[-*]\s+/.test(e)||/(^|\n)\s*\d+\.\s+/.test(e),f=/["'`][^"'`\n]{2,}["'`]/.test(e);return o&&(c||d||f)}function AM({variant:e,title:t,text:n,icon:r}){const[a,i]=v.useState(!1),o={call:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",result_ok:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",result_error:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300"};return s.jsx(Ai,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Ts,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[11px]",children:[r??s.jsx(Ms,{className:"h-3.5 w-3.5"}),s.jsx("span",{children:t})]}),s.jsx("span",{className:"text-[11px] font-semibold",children:a?"Hide content":"Show content"})]})}),s.jsx(Ei,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function xS({text:e,maxLength:t,className:n}){const[r,a]=v.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return s.jsxs("div",{children:[s.jsx(od,{text:o,className:n}),i&&s.jsx("button",{type:"button",className:"mt-1 text-[11px] font-medium text-primary hover:underline",onClick:()=>a(c=>!c),children:r?"Show less":"Show all"})]})}function vge(e,t){return e.map(n=>{const r=gge(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function gge(e,t){const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:`Regex assertion failed: ${e.value}`,r=t.find(a=>a===n);if(r)return r;if(e.type==="response_contains"||e.type==="response_not_contains")return t.find(a=>a.startsWith("Regex assertion failed:")&&a.includes(e.value))}function yge(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="response_contains"?`Text must match pattern · ${e.value}`:e.type==="response_not_contains"?`Text must not match pattern · ${e.value}`:`${e.type} · ${e.value}`}function EM(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const _M=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"],xge=()=>{const{source:e}=An(),t=jf("snapshots",!1),[n,r]=v.useState([]),[a,i]=v.useState(!1),[o,c]=v.useState(new Set),[d,f]=v.useState("timestamp"),[h,p]=v.useState("desc"),[g,y]=v.useState("all"),[j,w]=v.useState("runs"),[x,S]=v.useState([]),[N,A]=v.useState(""),[P,E]=v.useState(""),[O,k]=v.useState(null),R=async()=>{i(!0);try{r(await e.listResults())}catch(I){Oe({title:"Could not load results",description:I instanceof Error?I.message:String(I),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{let I=!0;return i(!0),e.listResults().then(F=>{I&&r(F)}).catch(F=>{I&&Oe({title:"Could not load results",description:F instanceof Error?F.message:String(F),variant:"destructive"})}).finally(()=>{I&&i(!1)}),()=>{I=!1}},[e]),v.useEffect(()=>{let I=!0;return e.listSnapshots().then(F=>{I&&S(F)}).catch(()=>{I&&S([])}),()=>{I=!1}},[e]);const D=I=>{if(d===I){p(F=>F==="asc"?"desc":"asc");return}f(I),p(I==="timestamp"?"desc":"asc")},U=I=>{c(F=>{const Q=new Set(F);return Q.has(I)?Q.delete(I):Q.add(I),Q})},z=v.useMemo(()=>{const I=new Set;return n.forEach(F=>{F.scenarios.forEach(Q=>{const B=String(Q.scenarioName??"").trim(),$=String(Q.scenarioId??"").trim(),ee=B||$;ee&&I.add(ee)})}),Array.from(I).sort((F,Q)=>F.localeCompare(Q))},[n]),L=v.useMemo(()=>g==="all"?n:n.filter(I=>I.scenarios.some(F=>{const Q=String(F.scenarioName??"").trim(),B=String(F.scenarioId??"").trim();return(Q||B)===g})),[n,g]),G=v.useMemo(()=>[...L].sort((F,Q)=>{let B=0;return d==="id"&&(B=F.id.localeCompare(Q.id)),d==="timestamp"&&(B=new Date(F.timestamp).getTime()-new Date(Q.timestamp).getTime()),d==="passRate"&&(B=F.overallPassRate-Q.overallPassRate),d==="scenarios"&&(B=F.totalScenarios-Q.totalScenarios),h==="asc"?B:-B}),[L,d,h]),q=G.filter(I=>o.has(I.id)),H=I=>d!==I?s.jsx($l,{className:"h-3.5 w-3.5 text-muted-foreground"}):h==="asc"?s.jsx(Fa,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}),X=I=>{const F=Array.from(new Set(I.scenarios.map(ee=>ee.scenarioId).filter(Boolean))),Q=Array.from(new Set(I.scenarios.map(ee=>ee.agentName).filter(Boolean))),B=F.slice(0,2).join(", "),$=F.length>2?` +${F.length-2}`:"";return{scenarioCount:F.length,agentCount:Q.length,scenarioPreview:B?`${B}${$}`:"n/a"}},Z=[...new Set(q.flatMap(I=>I.scenarios.map(F=>F.scenarioId)))];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(CS,{className:"h-6 w-6"}),"Compare Runs"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select 2–5 runs to compare"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[j==="runs"&&s.jsxs(Kt,{value:g,onValueChange:y,children:[s.jsx(Ut,{className:"w-[260px]",children:s.jsx(Gt,{placeholder:"Filter by scenario"})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All scenarios"}),z.map(I=>s.jsx(Je,{value:I,children:I},I))]})]}),s.jsx(ae,{variant:"outline",onClick:()=>{R()},disabled:a,children:a?"Refreshing...":"Refresh"})]})]}),j==="runs"&&s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{className:"w-10"}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("id"),children:["Run ID",H("id")]})}),s.jsx(nt,{children:"Evaluated"}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("timestamp"),children:["Timestamp",H("timestamp")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("passRate"),children:["Pass Rate",H("passRate")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("scenarios"),children:["Scenarios",H("scenarios")]})})]})}),s.jsx(Yr,{children:G.map(I=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsx(ha,{checked:o.has(I.id),onCheckedChange:()=>U(I.id),disabled:!o.has(I.id)&&o.size>=5})}),s.jsx(He,{className:"font-mono text-xs",children:I.id}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const F=X(I);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",F.scenarioCount," scenario",F.scenarioCount===1?"":"s"," · ",F.agentCount," agent",F.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:F.scenarioPreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:new Date(I.timestamp).toLocaleString()}),s.jsx(He,{children:s.jsx(wo,{rate:I.overallPassRate})}),s.jsx(He,{className:"font-mono text-sm",children:I.totalScenarios})]},I.id))})]})})}),j==="runs"&&q.length>=2&&s.jsxs(s.Fragment,{children:[q.length===2&&s.jsx(ze,{children:s.jsx(Ue,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Need a deeper comparison?"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the two selected runs in a dedicated side-by-side full result compare view."})]}),s.jsx(ae,{asChild:!0,size:"sm",children:s.jsx(yt,{to:`/compare/results?left=${encodeURIComponent(q[0].id)}&right=${encodeURIComponent(q[1].id)}&leftConfig=${encodeURIComponent(q[0].configId)}&rightConfig=${encodeURIComponent(q[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Summary Comparison"})}),s.jsx(Ue,{className:"p-0",children:s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Metric"}),q.map((I,F)=>s.jsx(nt,{style:{color:_M[F]},className:"font-mono text-xs",children:I.id},I.id))]})}),s.jsxs(Yr,{children:[s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium",children:"Pass Rate"}),q.map(I=>s.jsx(He,{children:s.jsx(wo,{rate:I.overallPassRate})},I.id))]}),s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium",children:"Total Runs"}),q.map(I=>s.jsx(He,{className:"font-mono",children:I.totalRuns},I.id))]}),s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium",children:"Tool Calls"}),q.map(I=>s.jsx(He,{className:"font-mono",children:I.avgToolCalls.toFixed(1)},I.id))]}),s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium",children:"Avg Latency"}),q.map(I=>s.jsxs(He,{className:"font-mono",children:[I.avgLatency,"ms"]},I.id))]})]})]})})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(Ue,{className:"p-0",children:s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Scenario"}),q.map((I,F)=>s.jsx(nt,{style:{color:_M[F]},className:"font-mono text-xs",children:I.id},I.id))]})}),s.jsx(Yr,{children:Z.map(I=>s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium text-sm",children:I}),q.map(F=>{const Q=F.scenarios.find(B=>B.scenarioId===I);return s.jsx(He,{children:Q?s.jsx(wo,{rate:Q.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},F.id)})]},I))})]})})]})]}),t&&j==="snapshot"&&s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Run vs Snapshot"})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Run"}),s.jsxs(Kt,{value:P,onValueChange:E,children:[s.jsx(Ut,{children:s.jsx(Gt,{placeholder:"Select run"})}),s.jsx(qt,{children:n.map(I=>s.jsx(Je,{value:I.id,children:I.id},I.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),s.jsxs(Kt,{value:N,onValueChange:A,children:[s.jsx(Ut,{children:s.jsx(Gt,{placeholder:"Select snapshot"})}),s.jsx(qt,{children:x.map(I=>s.jsx(Je,{value:I.id,children:I.name},I.id))})]})]})]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",disabled:!P||!N,onClick:()=>{e.compareSnapshot(N,P).then(k)},children:"Compare"}),O&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm font-medium",children:["Overall score: ",O.overall_score]}),s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Scenario"}),s.jsx(nt,{children:"Agents"}),s.jsx(nt,{children:"Score"}),s.jsx(nt,{children:"Status"}),s.jsx(nt,{children:"Reasons"})]})}),s.jsx(Yr,{children:O.scenario_results.map(I=>s.jsxs(zt,{children:[s.jsx(He,{children:I.scenario_id}),s.jsxs(He,{className:"text-xs text-muted-foreground",children:["baseline: ",I.baseline_agents.join(", ")||"—"," · observed: ",I.observed_agents.join(", ")||"—"]}),s.jsx(He,{className:"font-mono text-xs",children:I.score}),s.jsx(He,{children:I.status}),s.jsx(He,{className:"text-xs text-muted-foreground",children:I.reasons.slice(0,2).join("; ")||"—"})]},I.scenario_id))})]})]})]})]})]})},PM=(e,t)=>{const n=new URLSearchParams;return t&&n.set("configId",t),n.set("embed","1"),`/results/${encodeURIComponent(e)}?${n.toString()}`},bge=()=>{const[e]=$c(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),a=e.get("rightConfig");return!t||!n?s.jsxs(ze,{children:[s.jsx(At,{children:s.jsx(Et,{className:"text-base",children:"Full Result Compare"})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select exactly two runs in Compare and use the “Compare full results” action."}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/compare",children:"Back to Compare"})})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Full Result Compare"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Side-by-side Result Detail views for deep inspection."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ae,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(yt,{to:"/compare",children:[s.jsx(_U,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(ae,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:`/results/${encodeURIComponent(t)}${r?`?configId=${encodeURIComponent(r)}`:""}`,target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(oh,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(ae,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:`/results/${encodeURIComponent(n)}${a?`?configId=${encodeURIComponent(a)}`:""}`,target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(oh,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsxs(ze,{className:"overflow-hidden",children:[s.jsx(At,{className:"py-3",children:s.jsx(Et,{className:"text-sm font-mono",children:t})}),s.jsx(Ue,{className:"p-0",children:s.jsx("iframe",{title:`Result ${t}`,src:PM(t,r),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(ze,{className:"overflow-hidden",children:[s.jsx(At,{className:"py-3",children:s.jsx(Et,{className:"text-sm font-mono",children:n})}),s.jsx(Ue,{className:"p-0",children:s.jsx("iframe",{title:`Result ${n}`,src:PM(n,a),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function wge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function jge(){const{source:e}=An(),[t,n]=v.useState([]),[r,a]=v.useState(!0),[i,o]=v.useState(null),[c,d]=v.useState(!1),f=async()=>{a(!0);try{n(await e.listMarkdownReports())}catch(y){Oe({title:"Could not load markdown reports",description:y instanceof Error?y.message:String(y),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t[0],[t]),p=v.useMemo(()=>t.find(y=>y.relativePath===i)??null,[t,i]),g=async()=>{if(i){d(!0);try{await e.deleteMarkdownReport(i),n(y=>y.filter(j=>j.relativePath!==i)),Oe({title:"Markdown report deleted"}),o(null)}catch(y){Oe({title:"Could not delete markdown report",description:y instanceof Error?y.message:String(y),variant:"destructive"})}finally{d(!1)}}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(lh,{className:"h-6 w-6"}),"Markdown Reports"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Browse Markdown files under ",s.jsx("code",{children:"mcplab/reports"}),"."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading markdown reports..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No markdown reports found yet."}):s.jsxs(Kr,{children:[s.jsx(Gr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Report"}),s.jsx(nt,{children:"Folder"}),s.jsx(nt,{children:"Timestamp"}),s.jsx(nt,{children:"Size"}),s.jsx(nt,{className:"w-10"})]})}),s.jsx(Yr,{children:t.map(y=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/markdown-reports/view?path=${encodeURIComponent(y.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:y.name}),s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:y.relativePath})]})}),s.jsx(He,{className:"text-xs text-muted-foreground font-mono",children:y.relativePath.includes("/")?y.relativePath.slice(0,y.relativePath.lastIndexOf("/")):"."}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Pm,{className:"h-3 w-3"}),new Date(y.mtime).toLocaleString()]})}),s.jsx(He,{className:"font-mono text-sm",children:wge(y.sizeBytes)}),s.jsx(He,{children:s.jsxs(Kc,{children:[s.jsx(Gc,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Go,{align:"end",children:[s.jsx(cr,{asChild:!0,children:s.jsx(yt,{to:`/markdown-reports/view?path=${encodeURIComponent(y.relativePath)}`,children:"View"})}),s.jsxs(cr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(y.relativePath)},children:[s.jsx(_r,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},y.path))})]})})}),s.jsx(ws,{open:!!i,onOpenChange:y=>!y&&o(null),children:s.jsxs(Ka,{children:[s.jsxs(Ga,{children:[s.jsx(Xa,{children:"Delete markdown report?"}),s.jsx(Qa,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(Ya,{children:[s.jsx(Za,{disabled:c,children:"Cancel"}),s.jsx(Ja,{onClick:y=>{y.preventDefault(),g()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function Sge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Nge(e){const t=e.relativePath.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i);return t?.[1]?t[1]:(e.content.match(/(?:^|\n)\s*\*\*Run:\*\*\s*`([^`]+)`/i)??e.content.match(/(?:^|\n)\s*Run ID:\s*([^\s]+)/i))?.[1]?.trim()||null}function Cge(){const{source:e}=An(),[t]=$c(),n=(t.get("path")??"").trim(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1);if(v.useEffect(()=>{let g=!0;if(a(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(y=>{g&&a(y)}).catch(y=>{if(!g)return;const j=y instanceof Error?y.message:String(y);if(j.includes("(404)")){d(!0);return}Oe({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{g&&o(!1)}),()=>{g=!1}},[n,e]),!n)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Missing report path."}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(i)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown report..."});if(c||!r)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Report not found."}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=Nge(r);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.name}),s.jsx("p",{className:"truncate text-sm text-muted-foreground",children:r.relativePath}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(r.mtime).toLocaleString()," "," · "," ",Sge(r.sizeBytes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p?s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),s.jsx(ae,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(ae,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"pt-6",children:s.jsx(od,{text:r.content,variant:"assistant"})})}),p?s.jsx(XD,{open:f,onOpenChange:h,children:s.jsxs(YS,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(JD,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(ZD,{className:"text-base",children:["Result ",p]}),s.jsx(ae,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:`/results/${encodeURIComponent(p)}`,target:"_blank",rel:"noreferrer",children:"Open full page"})})]})}),s.jsx("div",{className:"h-[calc(100vh-64px)]",children:s.jsx("iframe",{title:`Result ${p}`,src:`/results/${encodeURIComponent(p)}?embed=1`,className:"h-full w-full border-0"})})]})}):null]})}const Age=()=>{const e=gs();return v.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},Ege=new fV;function _ge(){const{scenarioId:e}=Fo();return s.jsx(yD,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Pge=()=>s.jsx(hV,{client:Ege,children:s.jsx(eD,{children:s.jsx(NG,{children:s.jsx(_G,{children:s.jsxs(EG,{children:[s.jsx(xq,{}),s.jsx(Qq,{}),s.jsx(mH,{children:s.jsxs(iH,{children:[s.jsxs(en,{element:s.jsx(AG,{}),children:[s.jsx(en,{path:"/",element:s.jsx(tfe,{})}),s.jsx(en,{path:"/mcp-evaluations",element:s.jsx(Rpe,{})}),s.jsx(en,{path:"/mcp-evaluations/:id",element:s.jsx(sM,{})}),s.jsx(en,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(sM,{})}),s.jsx(en,{path:"/tool-analysis",element:s.jsx(Jve,{})}),s.jsx(en,{path:"/tool-analysis-results",element:s.jsx(Zve,{})}),s.jsx(en,{path:"/tool-analysis-results/:id",element:s.jsx(ege,{})}),s.jsx(en,{path:"/oauth-debugger",element:s.jsx(sge,{})}),s.jsx(en,{path:"/libraries/servers",element:s.jsx(yme,{})}),s.jsx(en,{path:"/libraries/servers/:serverId",element:s.jsx(bme,{})}),s.jsx(en,{path:"/libraries/agents",element:s.jsx(wme,{})}),s.jsx(en,{path:"/libraries/agents/:agentName",element:s.jsx(Tve,{})}),s.jsx(en,{path:"/libraries/test-cases",element:s.jsx(pM,{})}),s.jsx(en,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(pM,{})}),s.jsx(en,{path:"/libraries/scenarios",element:s.jsx(yD,{to:"/libraries/test-cases",replace:!0})}),s.jsx(en,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(_ge,{})}),s.jsx(en,{path:"/settings",element:s.jsx(Ive,{})}),s.jsx(en,{path:"/run",element:s.jsx(ige,{})}),s.jsx(en,{path:"/results",element:s.jsx(oge,{})}),s.jsx(en,{path:"/results/:id",element:s.jsx(pge,{})}),s.jsx(en,{path:"/markdown-reports",element:s.jsx(jge,{})}),s.jsx(en,{path:"/markdown-reports/view",element:s.jsx(Cge,{})}),s.jsx(en,{path:"/compare",element:s.jsx(xge,{})}),s.jsx(en,{path:"/compare/results",element:s.jsx(bge,{})})]}),s.jsx(en,{path:"*",element:s.jsx(Age,{})})]})})]})})})})});S7.createRoot(document.getElementById("root")).render(s.jsx(Pge,{}));
|