@inspectr/mcplab 0.1.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.
@@ -0,0 +1,249 @@
1
+ function hU(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 Sp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ty={exports:{}},ju={},Iy={exports:{}},At={};var zA;function mU(){if(zA)return At;zA=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 y(F){return F===null||typeof F!="object"?null:(F=p&&F[p]||F["@@iterator"],typeof F=="function"?F:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,b={};function x(F,M,ee){this.props=F,this.context=M,this.refs=b,this.updater=ee||g}x.prototype.isReactComponent={},x.prototype.setState=function(F,M){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,M,"setState")},x.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function j(){}j.prototype=x.prototype;function N(F,M,ee){this.props=F,this.context=M,this.refs=b,this.updater=ee||g}var _=N.prototype=new j;_.constructor=N,S(_,x.prototype),_.isPureReactComponent=!0;var P=Array.isArray,A=Object.prototype.hasOwnProperty,O={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function R(F,M,ee){var W,J={},ye=null,ae=null;if(M!=null)for(W in M.ref!==void 0&&(ae=M.ref),M.key!==void 0&&(ye=""+M.key),M)A.call(M,W)&&!k.hasOwnProperty(W)&&(J[W]=M[W]);var ue=arguments.length-2;if(ue===1)J.children=ee;else if(1<ue){for(var ie=Array(ue),ve=0;ve<ue;ve++)ie[ve]=arguments[ve+2];J.children=ie}if(F&&F.defaultProps)for(W in ue=F.defaultProps,ue)J[W]===void 0&&(J[W]=ue[W]);return{$$typeof:e,type:F,key:ye,ref:ae,props:J,_owner:O.current}}function $(F,M){return{$$typeof:e,type:F.type,key:M,ref:F.ref,props:F.props,_owner:F._owner}}function z(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function B(F){var M={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(ee){return M[ee]})}var D=/\/+/g;function K(F,M){return typeof F=="object"&&F!==null&&F.key!=null?B(""+F.key):M.toString(36)}function U(F,M,ee,W,J){var ye=typeof F;(ye==="undefined"||ye==="boolean")&&(F=null);var ae=!1;if(F===null)ae=!0;else switch(ye){case"string":case"number":ae=!0;break;case"object":switch(F.$$typeof){case e:case t:ae=!0}}if(ae)return ae=F,J=J(ae),F=W===""?"."+K(ae,0):W,P(J)?(ee="",F!=null&&(ee=F.replace(D,"$&/")+"/"),U(J,M,ee,"",function(ve){return ve})):J!=null&&(z(J)&&(J=$(J,ee+(!J.key||ae&&ae.key===J.key?"":(""+J.key).replace(D,"$&/")+"/")+F)),M.push(J)),1;if(ae=0,W=W===""?".":W+":",P(F))for(var ue=0;ue<F.length;ue++){ye=F[ue];var ie=W+K(ye,ue);ae+=U(ye,M,ee,ie,J)}else if(ie=y(F),typeof ie=="function")for(F=ie.call(F),ue=0;!(ye=F.next()).done;)ye=ye.value,ie=W+K(ye,ue++),ae+=U(ye,M,ee,ie,J);else if(ye==="object")throw M=String(F),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.");return ae}function V(F,M,ee){if(F==null)return F;var W=[],J=0;return U(F,W,"","",function(ye){return M.call(ee,ye,J++)}),W}function X(F){if(F._status===-1){var M=F._result;M=M(),M.then(function(ee){(F._status===0||F._status===-1)&&(F._status=1,F._result=ee)},function(ee){(F._status===0||F._status===-1)&&(F._status=2,F._result=ee)}),F._status===-1&&(F._status=0,F._result=M)}if(F._status===1)return F._result.default;throw F._result}var Z={current:null},T={transition:null},L={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:T,ReactCurrentOwner:O};function Q(){throw Error("act(...) is not supported in production builds of React.")}return At.Children={map:V,forEach:function(F,M,ee){V(F,function(){M.apply(this,arguments)},ee)},count:function(F){var M=0;return V(F,function(){M++}),M},toArray:function(F){return V(F,function(M){return M})||[]},only:function(F){if(!z(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},At.Component=x,At.Fragment=n,At.Profiler=a,At.PureComponent=N,At.StrictMode=r,At.Suspense=d,At.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,At.act=Q,At.cloneElement=function(F,M,ee){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var W=S({},F.props),J=F.key,ye=F.ref,ae=F._owner;if(M!=null){if(M.ref!==void 0&&(ye=M.ref,ae=O.current),M.key!==void 0&&(J=""+M.key),F.type&&F.type.defaultProps)var ue=F.type.defaultProps;for(ie in M)A.call(M,ie)&&!k.hasOwnProperty(ie)&&(W[ie]=M[ie]===void 0&&ue!==void 0?ue[ie]:M[ie])}var ie=arguments.length-2;if(ie===1)W.children=ee;else if(1<ie){ue=Array(ie);for(var ve=0;ve<ie;ve++)ue[ve]=arguments[ve+2];W.children=ue}return{$$typeof:e,type:F.type,key:J,ref:ye,props:W,_owner:ae}},At.createContext=function(F){return F={$$typeof:o,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:i,_context:F},F.Consumer=F},At.createElement=R,At.createFactory=function(F){var M=R.bind(null,F);return M.type=F,M},At.createRef=function(){return{current:null}},At.forwardRef=function(F){return{$$typeof:c,render:F}},At.isValidElement=z,At.lazy=function(F){return{$$typeof:h,_payload:{_status:-1,_result:F},_init:X}},At.memo=function(F,M){return{$$typeof:f,type:F,compare:M===void 0?null:M}},At.startTransition=function(F){var M=T.transition;T.transition={};try{F()}finally{T.transition=M}},At.unstable_act=Q,At.useCallback=function(F,M){return Z.current.useCallback(F,M)},At.useContext=function(F){return Z.current.useContext(F)},At.useDebugValue=function(){},At.useDeferredValue=function(F){return Z.current.useDeferredValue(F)},At.useEffect=function(F,M){return Z.current.useEffect(F,M)},At.useId=function(){return Z.current.useId()},At.useImperativeHandle=function(F,M,ee){return Z.current.useImperativeHandle(F,M,ee)},At.useInsertionEffect=function(F,M){return Z.current.useInsertionEffect(F,M)},At.useLayoutEffect=function(F,M){return Z.current.useLayoutEffect(F,M)},At.useMemo=function(F,M){return Z.current.useMemo(F,M)},At.useReducer=function(F,M,ee){return Z.current.useReducer(F,M,ee)},At.useRef=function(F){return Z.current.useRef(F)},At.useState=function(F){return Z.current.useState(F)},At.useSyncExternalStore=function(F,M,ee){return Z.current.useSyncExternalStore(F,M,ee)},At.useTransition=function(){return Z.current.useTransition()},At.version="18.3.1",At}var UA;function vj(){return UA||(UA=1,Iy.exports=mU()),Iy.exports}var qA;function vU(){if(qA)return ju;qA=1;var e=vj(),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={},y=null,g=null;f!==void 0&&(y=""+f),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(g=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:y,ref:g,props:p,_owner:a.current}}return ju.Fragment=n,ju.jsx=o,ju.jsxs=o,ju}var WA;function gU(){return WA||(WA=1,Ty.exports=vU()),Ty.exports}var s=gU(),jp={},My={exports:{}},Rr={},$y={exports:{}},Dy={};var VA;function yU(){return VA||(VA=1,(function(e){function t(T,L){var Q=T.length;T.push(L);e:for(;0<Q;){var F=Q-1>>>1,M=T[F];if(0<a(M,L))T[F]=L,T[Q]=M,Q=F;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var L=T[0],Q=T.pop();if(Q!==L){T[0]=Q;e:for(var F=0,M=T.length,ee=M>>>1;F<ee;){var W=2*(F+1)-1,J=T[W],ye=W+1,ae=T[ye];if(0>a(J,Q))ye<M&&0>a(ae,J)?(T[F]=ae,T[ye]=Q,F=ye):(T[F]=J,T[W]=Q,F=W);else if(ye<M&&0>a(ae,Q))T[F]=ae,T[ye]=Q,F=ye;else break e}}return L}function a(T,L){var Q=T.sortIndex-L.sortIndex;return Q!==0?Q:T.id-L.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,y=3,g=!1,S=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,j=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 _(T){for(var L=n(f);L!==null;){if(L.callback===null)r(f);else if(L.startTime<=T)r(f),L.sortIndex=L.expirationTime,t(d,L);else break;L=n(f)}}function P(T){if(b=!1,_(T),!S)if(n(d)!==null)S=!0,X(A);else{var L=n(f);L!==null&&Z(P,L.startTime-T)}}function A(T,L){S=!1,b&&(b=!1,j(R),R=-1),g=!0;var Q=y;try{for(_(L),p=n(d);p!==null&&(!(p.expirationTime>L)||T&&!B());){var F=p.callback;if(typeof F=="function"){p.callback=null,y=p.priorityLevel;var M=F(p.expirationTime<=L);L=e.unstable_now(),typeof M=="function"?p.callback=M:p===n(d)&&r(d),_(L)}else r(d);p=n(d)}if(p!==null)var ee=!0;else{var W=n(f);W!==null&&Z(P,W.startTime-L),ee=!1}return ee}finally{p=null,y=Q,g=!1}}var O=!1,k=null,R=-1,$=5,z=-1;function B(){return!(e.unstable_now()-z<$)}function D(){if(k!==null){var T=e.unstable_now();z=T;var L=!0;try{L=k(!0,T)}finally{L?K():(O=!1,k=null)}}else O=!1}var K;if(typeof N=="function")K=function(){N(D)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=D,K=function(){V.postMessage(null)}}else K=function(){x(D,0)};function X(T){k=T,O||(O=!0,K())}function Z(T,L){R=x(function(){T(e.unstable_now())},L)}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(T){T.callback=null},e.unstable_continueExecution=function(){S||g||(S=!0,X(A))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(T){switch(y){case 1:case 2:case 3:var L=3;break;default:L=y}var Q=y;y=L;try{return T()}finally{y=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,L){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var Q=y;y=T;try{return L()}finally{y=Q}},e.unstable_scheduleCallback=function(T,L,Q){var F=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?F+Q:F):Q=F,T){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=Q+M,T={id:h++,callback:L,priorityLevel:T,startTime:Q,expirationTime:M,sortIndex:-1},Q>F?(T.sortIndex=Q,t(f,T),n(d)===null&&T===n(f)&&(b?(j(R),R=-1):b=!0,Z(P,Q-F))):(T.sortIndex=M,t(d,T),S||g||(S=!0,X(A))),T},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(T){var L=y;return function(){var Q=y;y=L;try{return T.apply(this,arguments)}finally{y=Q}}}})(Dy)),Dy}var HA;function xU(){return HA||(HA=1,$y.exports=yU()),$y.exports}var KA;function bU(){if(KA)return Rr;KA=1;var e=vj(),t=xU();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 y(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function g(l,u,m,w){if(m!==null&&m.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:m!==null?!m.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function S(l,u,m,w){if(u===null||typeof u>"u"||g(l,u,m,w))return!0;if(w)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 b(l,u,m,w,C,E,I){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=C,this.mustUseProperty=m,this.propertyName=l,this.type=u,this.sanitizeURL=E,this.removeEmptyString=I}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[l]=new b(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 b(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[l]=new b(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 b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var j=/[\-:]([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(j,N);x[u]=new b(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(j,N);x[u]=new b(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(j,N);x[u]=new b(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function _(l,u,m,w){var C=x.hasOwnProperty(u)?x[u]:null;(C!==null?C.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(S(u,m,C,w)&&(m=null),w||C===null?y(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,w=C.attributeNamespace,m===null?l.removeAttribute(u):(C=C.type,m=C===3||C===4&&m===!0?"":""+m,w?l.setAttributeNS(w,u,m):l.setAttribute(u,m))))}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),O=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),B=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),T=Symbol.iterator;function L(l){return l===null||typeof l!="object"?null:(l=T&&l[T]||l["@@iterator"],typeof l=="function"?l:null)}var Q=Object.assign,F;function M(l){if(F===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);F=u&&u[1]||""}return`
2
+ `+F+l}var ee=!1;function W(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(pe){var w=pe}Reflect.construct(l,[],u)}else{try{u.call()}catch(pe){w=pe}l.call(u.prototype)}else{try{throw Error()}catch(pe){w=pe}l()}}catch(pe){if(pe&&w&&typeof pe.stack=="string"){for(var C=pe.stack.split(`
3
+ `),E=w.stack.split(`
4
+ `),I=C.length-1,Y=E.length-1;1<=I&&0<=Y&&C[I]!==E[Y];)Y--;for(;1<=I&&0<=Y;I--,Y--)if(C[I]!==E[Y]){if(I!==1||Y!==1)do if(I--,Y--,0>Y||C[I]!==E[Y]){var te=`
5
+ `+C[I].replace(" at new "," at ");return l.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",l.displayName)),te}while(1<=I&&0<=Y);break}}}finally{ee=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?M(l):""}function J(l){switch(l.tag){case 5:return M(l.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return l=W(l.type,!1),l;case 11:return l=W(l.type.render,!1),l;case 1:return l=W(l.type,!0),l;default:return""}}function ye(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 $:return"Profiler";case R:return"StrictMode";case K:return"Suspense";case U:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case B:return(l.displayName||"Context")+".Consumer";case z:return(l._context.displayName||"Context")+".Provider";case D:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case V:return u=l.displayName||null,u!==null?u:ye(l.type)||"Memo";case X:u=l._payload,l=l._init;try{return ye(l(u))}catch{}}return null}function ae(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 ye(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 ue(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ie(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function ve(l){var u=ie(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),w=""+l[u];if(!l.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var C=m.get,E=m.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return C.call(this)},set:function(I){w=""+I,E.call(this,I)}}),Object.defineProperty(l,u,{enumerable:m.enumerable}),{getValue:function(){return w},setValue:function(I){w=""+I},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function Oe(l){l._valueTracker||(l._valueTracker=ve(l))}function oe(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var m=u.getValue(),w="";return l&&(w=ie(l)?l.checked?"true":"false":l.value),l=w,l!==m?(u.setValue(l),!0):!1}function he(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 xe(l,u){var m=u.checked;return Q({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function Ie(l,u){var m=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;m=ue(u.value!=null?u.value:m),l._wrapperState={initialChecked:w,initialValue:m,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function re(l,u){u=u.checked,u!=null&&_(l,"checked",u,!1)}function me(l,u){re(l,u);var m=ue(u.value),w=u.type;if(m!=null)w==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(w==="submit"||w==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?tt(l,u.type,m):u.hasOwnProperty("defaultValue")&&tt(l,u.type,ue(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 w=u.type;if(!(w!=="submit"&&w!=="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 tt(l,u,m){(u!=="number"||he(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var je=Array.isArray;function et(l,u,m,w){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&&w&&(l[m].defaultSelected=!0)}else{for(m=""+ue(m),u=null,C=0;C<l.length;C++){if(l[C].value===m){l[C].selected=!0,w&&(l[C].defaultSelected=!0);return}u!==null||l[C].disabled||(u=l[C])}u!==null&&(u.selected=!0)}}function dt(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return Q({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Pt(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:ue(m)}}function hn(l,u){var m=ue(u.value),w=ue(u.defaultValue);m!=null&&(m=""+m,m!==l.value&&(l.value=m),u.defaultValue==null&&l.defaultValue!==m&&(l.defaultValue=m)),w!=null&&(l.defaultValue=""+w)}function we(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function Le(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 qe(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?Le(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Rt,$t=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,m,w,C){MSApp.execUnsafeLocalFunction(function(){return l(u,m,w,C)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(Rt=Rt||document.createElement("div"),Rt.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Rt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function Dt(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var mn={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},jn=["Webkit","ms","Moz","O"];Object.keys(mn).forEach(function(l){jn.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),mn[u]=mn[l]})});function or(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||mn.hasOwnProperty(l)&&mn[l]?(""+u).trim():u+"px"}function lr(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var w=m.indexOf("--")===0,C=or(m,u[m],w);m==="float"&&(m="cssFloat"),w?l.setProperty(m,C):l[m]=C}}var Na=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 Dn(l,u){if(u){if(Na[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 Dr(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 Cr=null;function _r(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var kn=null,xn=null,cn=null;function Rn(l){if(l=lu(l)){if(typeof kn!="function")throw Error(n(280));var u=l.stateNode;u&&(u=Df(u),kn(l.stateNode,l.type,u))}}function le(l){xn?cn?cn.push(l):cn=[l]:xn=l}function ke(){if(xn){var l=xn,u=cn;if(cn=xn=null,Rn(l),u)for(l=0;l<u.length;l++)Rn(u[l])}}function it(l,u){return l(u)}function vt(){}var zt=!1;function tn(l,u,m){if(zt)return l(u,m);zt=!0;try{return it(l,u,m)}finally{zt=!1,(xn!==null||cn!==null)&&(vt(),ke())}}function Et(l,u){var m=l.stateNode;if(m===null)return null;var w=Df(m);if(w===null)return null;m=w[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":(w=!w.disabled)||(l=l.type,w=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!w;break e;default:l=!1}if(l)return null;if(m&&typeof m!="function")throw Error(n(231,u,typeof m));return m}var mr=!1;if(c)try{var Vt={};Object.defineProperty(Vt,"passive",{get:function(){mr=!0}}),window.addEventListener("test",Vt,Vt),window.removeEventListener("test",Vt,Vt)}catch{mr=!1}function Ht(l,u,m,w,C,E,I,Y,te){var pe=Array.prototype.slice.call(arguments,3);try{u.apply(m,pe)}catch(_e){this.onError(_e)}}var vr=!1,ei=null,Ca=!1,ti=null,H={onError:function(l){vr=!0,ei=l}};function ge(l,u,m,w,C,E,I,Y,te){vr=!1,ei=null,Ht.apply(H,arguments)}function Ye(l,u,m,w,C,E,I,Y,te){if(ge.apply(this,arguments),vr){if(vr){var pe=ei;vr=!1,ei=null}else throw Error(n(198));Ca||(Ca=!0,ti=pe)}}function Ze(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 jt(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 wt(l){if(Ze(l)!==l)throw Error(n(188))}function Nn(l){var u=l.alternate;if(!u){if(u=Ze(l),u===null)throw Error(n(188));return u!==l?null:l}for(var m=l,w=u;;){var C=m.return;if(C===null)break;var E=C.alternate;if(E===null){if(w=C.return,w!==null){m=w;continue}break}if(C.child===E.child){for(E=C.child;E;){if(E===m)return wt(C),l;if(E===w)return wt(C),u;E=E.sibling}throw Error(n(188))}if(m.return!==w.return)m=C,w=E;else{for(var I=!1,Y=C.child;Y;){if(Y===m){I=!0,m=C,w=E;break}if(Y===w){I=!0,w=C,m=E;break}Y=Y.sibling}if(!I){for(Y=E.child;Y;){if(Y===m){I=!0,m=E,w=C;break}if(Y===w){I=!0,w=E,m=C;break}Y=Y.sibling}if(!I)throw Error(n(189))}}if(m.alternate!==w)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?l:u}function We(l){return l=Nn(l),l!==null?vn(l):null}function vn(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=vn(l);if(u!==null)return u;l=l.sibling}return null}var Ln=t.unstable_scheduleCallback,Gt=t.unstable_cancelCallback,An=t.unstable_shouldYield,G=t.unstable_requestPaint,fe=t.unstable_now,nt=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,Ot=t.unstable_UserBlockingPriority,Nt=t.unstable_NormalPriority,Tn=t.unstable_LowPriority,Ja=t.unstable_IdlePriority,Yt=null,Fn=null;function yf(l){if(Fn&&typeof Fn.onCommitFiberRoot=="function")try{Fn.onCommitFiberRoot(Yt,l,void 0,(l.current.flags&128)===128)}catch{}}var Lr=Math.clz32?Math.clz32:Rz,qc=Math.log,kz=Math.LN2;function Rz(l){return l>>>=0,l===0?32:31-(qc(l)/kz|0)|0}var xf=64,bf=4194304;function Wc(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 wf(l,u){var m=l.pendingLanes;if(m===0)return 0;var w=0,C=l.suspendedLanes,E=l.pingedLanes,I=m&268435455;if(I!==0){var Y=I&~C;Y!==0?w=Wc(Y):(E&=I,E!==0&&(w=Wc(E)))}else I=m&~C,I!==0?w=Wc(I):E!==0&&(w=Wc(E));if(w===0)return 0;if(u!==0&&u!==w&&(u&C)===0&&(C=w&-w,E=u&-u,C>=E||C===16&&(E&4194240)!==0))return u;if((w&4)!==0&&(w|=m&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=w;0<u;)m=31-Lr(u),C=1<<m,w|=l[m],u&=~C;return w}function Tz(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 Iz(l,u){for(var m=l.suspendedLanes,w=l.pingedLanes,C=l.expirationTimes,E=l.pendingLanes;0<E;){var I=31-Lr(E),Y=1<<I,te=C[I];te===-1?((Y&m)===0||(Y&w)!==0)&&(C[I]=Tz(Y,u)):te<=u&&(l.expiredLanes|=Y),E&=~Y}}function eg(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function yC(){var l=xf;return xf<<=1,(xf&4194240)===0&&(xf=64),l}function tg(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Vc(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Lr(u),l[u]=m}function Mz(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 w=l.eventTimes;for(l=l.expirationTimes;0<m;){var C=31-Lr(m),E=1<<C;u[C]=0,w[C]=-1,l[C]=-1,m&=~E}}function ng(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var w=31-Lr(m),C=1<<w;C&u|l[w]&u&&(l[w]|=u),m&=~C}}var Ut=0;function xC(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var bC,rg,wC,SC,jC,ag=!1,Sf=[],ni=null,ri=null,ai=null,Hc=new Map,Kc=new Map,si=[],$z="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 NC(l,u){switch(l){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Hc.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kc.delete(u.pointerId)}}function Gc(l,u,m,w,C,E){return l===null||l.nativeEvent!==E?(l={blockedOn:u,domEventName:m,eventSystemFlags:w,nativeEvent:E,targetContainers:[C]},u!==null&&(u=lu(u),u!==null&&rg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,C!==null&&u.indexOf(C)===-1&&u.push(C),l)}function Dz(l,u,m,w,C){switch(u){case"focusin":return ni=Gc(ni,l,u,m,w,C),!0;case"dragenter":return ri=Gc(ri,l,u,m,w,C),!0;case"mouseover":return ai=Gc(ai,l,u,m,w,C),!0;case"pointerover":var E=C.pointerId;return Hc.set(E,Gc(Hc.get(E)||null,l,u,m,w,C)),!0;case"gotpointercapture":return E=C.pointerId,Kc.set(E,Gc(Kc.get(E)||null,l,u,m,w,C)),!0}return!1}function CC(l){var u=Hi(l.target);if(u!==null){var m=Ze(u);if(m!==null){if(u=m.tag,u===13){if(u=jt(m),u!==null){l.blockedOn=u,jC(l.priority,function(){wC(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 jf(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var m=ig(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(m===null){m=l.nativeEvent;var w=new m.constructor(m.type,m);Cr=w,m.target.dispatchEvent(w),Cr=null}else return u=lu(m),u!==null&&rg(u),l.blockedOn=m,!1;u.shift()}return!0}function _C(l,u,m){jf(l)&&m.delete(u)}function Lz(){ag=!1,ni!==null&&jf(ni)&&(ni=null),ri!==null&&jf(ri)&&(ri=null),ai!==null&&jf(ai)&&(ai=null),Hc.forEach(_C),Kc.forEach(_C)}function Yc(l,u){l.blockedOn===u&&(l.blockedOn=null,ag||(ag=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lz)))}function Xc(l){function u(C){return Yc(C,l)}if(0<Sf.length){Yc(Sf[0],l);for(var m=1;m<Sf.length;m++){var w=Sf[m];w.blockedOn===l&&(w.blockedOn=null)}}for(ni!==null&&Yc(ni,l),ri!==null&&Yc(ri,l),ai!==null&&Yc(ai,l),Hc.forEach(u),Kc.forEach(u),m=0;m<si.length;m++)w=si[m],w.blockedOn===l&&(w.blockedOn=null);for(;0<si.length&&(m=si[0],m.blockedOn===null);)CC(m),m.blockedOn===null&&si.shift()}var Vo=P.ReactCurrentBatchConfig,Nf=!0;function Fz(l,u,m,w){var C=Ut,E=Vo.transition;Vo.transition=null;try{Ut=1,sg(l,u,m,w)}finally{Ut=C,Vo.transition=E}}function Bz(l,u,m,w){var C=Ut,E=Vo.transition;Vo.transition=null;try{Ut=4,sg(l,u,m,w)}finally{Ut=C,Vo.transition=E}}function sg(l,u,m,w){if(Nf){var C=ig(l,u,m,w);if(C===null)jg(l,u,w,Cf,m),NC(l,w);else if(Dz(C,l,u,m,w))w.stopPropagation();else if(NC(l,w),u&4&&-1<$z.indexOf(l)){for(;C!==null;){var E=lu(C);if(E!==null&&bC(E),E=ig(l,u,m,w),E===null&&jg(l,u,w,Cf,m),E===C)break;C=E}C!==null&&w.stopPropagation()}else jg(l,u,w,null,m)}}var Cf=null;function ig(l,u,m,w){if(Cf=null,l=_r(w),l=Hi(l),l!==null)if(u=Ze(l),u===null)l=null;else if(m=u.tag,m===13){if(l=jt(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 Cf=l,null}function AC(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(nt()){case Re:return 1;case Ot:return 4;case Nt:case Tn:return 16;case Ja:return 536870912;default:return 16}default:return 16}}var ii=null,og=null,_f=null;function EC(){if(_f)return _f;var l,u=og,m=u.length,w,C="value"in ii?ii.value:ii.textContent,E=C.length;for(l=0;l<m&&u[l]===C[l];l++);var I=m-l;for(w=1;w<=I&&u[m-w]===C[E-w];w++);return _f=C.slice(l,1<w?1-w:void 0)}function Af(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 Ef(){return!0}function PC(){return!1}function Fr(l){function u(m,w,C,E,I){this._reactName=m,this._targetInst=C,this.type=w,this.nativeEvent=E,this.target=I,this.currentTarget=null;for(var Y in l)l.hasOwnProperty(Y)&&(m=l[Y],this[Y]=m?m(E):E[Y]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Ef:PC,this.isPropagationStopped=PC,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=Ef)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Ef)},persist:function(){},isPersistent:Ef}),u}var Ho={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lg=Fr(Ho),Qc=Q({},Ho,{view:0,detail:0}),zz=Fr(Qc),cg,ug,Jc,Pf=Q({},Qc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fg,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!==Jc&&(Jc&&l.type==="mousemove"?(cg=l.screenX-Jc.screenX,ug=l.screenY-Jc.screenY):ug=cg=0,Jc=l),cg)},movementY:function(l){return"movementY"in l?l.movementY:ug}}),OC=Fr(Pf),Uz=Q({},Pf,{dataTransfer:0}),qz=Fr(Uz),Wz=Q({},Qc,{relatedTarget:0}),dg=Fr(Wz),Vz=Q({},Ho,{animationName:0,elapsedTime:0,pseudoElement:0}),Hz=Fr(Vz),Kz=Q({},Ho,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Gz=Fr(Kz),Yz=Q({},Ho,{data:0}),kC=Fr(Yz),Xz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qz={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"},Jz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zz(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=Jz[l])?!!u[l]:!1}function fg(){return Zz}var e6=Q({},Qc,{key:function(l){if(l.key){var u=Xz[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Af(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Qz[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fg,charCode:function(l){return l.type==="keypress"?Af(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Af(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),t6=Fr(e6),n6=Q({},Pf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),RC=Fr(n6),r6=Q({},Qc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fg}),a6=Fr(r6),s6=Q({},Ho,{propertyName:0,elapsedTime:0,pseudoElement:0}),i6=Fr(s6),o6=Q({},Pf,{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}),l6=Fr(o6),c6=[9,13,27,32],pg=c&&"CompositionEvent"in window,Zc=null;c&&"documentMode"in document&&(Zc=document.documentMode);var u6=c&&"TextEvent"in window&&!Zc,TC=c&&(!pg||Zc&&8<Zc&&11>=Zc),IC=" ",MC=!1;function $C(l,u){switch(l){case"keyup":return c6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function DC(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Ko=!1;function d6(l,u){switch(l){case"compositionend":return DC(u);case"keypress":return u.which!==32?null:(MC=!0,IC);case"textInput":return l=u.data,l===IC&&MC?null:l;default:return null}}function f6(l,u){if(Ko)return l==="compositionend"||!pg&&$C(l,u)?(l=EC(),_f=og=ii=null,Ko=!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 TC&&u.locale!=="ko"?null:u.data;default:return null}}var p6={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 LC(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!p6[l.type]:u==="textarea"}function FC(l,u,m,w){le(w),u=If(u,"onChange"),0<u.length&&(m=new lg("onChange","change",null,m,w),l.push({event:m,listeners:u}))}var eu=null,tu=null;function h6(l){r_(l,0)}function Of(l){var u=Jo(l);if(oe(u))return l}function m6(l,u){if(l==="change")return u}var BC=!1;if(c){var hg;if(c){var mg="oninput"in document;if(!mg){var zC=document.createElement("div");zC.setAttribute("oninput","return;"),mg=typeof zC.oninput=="function"}hg=mg}else hg=!1;BC=hg&&(!document.documentMode||9<document.documentMode)}function UC(){eu&&(eu.detachEvent("onpropertychange",qC),tu=eu=null)}function qC(l){if(l.propertyName==="value"&&Of(tu)){var u=[];FC(u,tu,l,_r(l)),tn(h6,u)}}function v6(l,u,m){l==="focusin"?(UC(),eu=u,tu=m,eu.attachEvent("onpropertychange",qC)):l==="focusout"&&UC()}function g6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Of(tu)}function y6(l,u){if(l==="click")return Of(u)}function x6(l,u){if(l==="input"||l==="change")return Of(u)}function b6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var _a=typeof Object.is=="function"?Object.is:b6;function nu(l,u){if(_a(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var m=Object.keys(l),w=Object.keys(u);if(m.length!==w.length)return!1;for(w=0;w<m.length;w++){var C=m[w];if(!d.call(u,C)||!_a(l[C],u[C]))return!1}return!0}function WC(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function VC(l,u){var m=WC(l);l=0;for(var w;m;){if(m.nodeType===3){if(w=l+m.textContent.length,l<=u&&w>=u)return{node:m,offset:u-l};l=w}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=WC(m)}}function HC(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?HC(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function KC(){for(var l=window,u=he();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=he(l.document)}return u}function vg(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 w6(l){var u=KC(),m=l.focusedElem,w=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&HC(m.ownerDocument.documentElement,m)){if(w!==null&&vg(m)){if(u=w.start,l=w.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,E=Math.min(w.start,C);w=w.end===void 0?E:Math.min(w.end,C),!l.extend&&E>w&&(C=w,w=E,E=C),C=VC(m,E);var I=VC(m,w);C&&I&&(l.rangeCount!==1||l.anchorNode!==C.node||l.anchorOffset!==C.offset||l.focusNode!==I.node||l.focusOffset!==I.offset)&&(u=u.createRange(),u.setStart(C.node,C.offset),l.removeAllRanges(),E>w?(l.addRange(u),l.extend(I.node,I.offset)):(u.setEnd(I.node,I.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,Go=null,gg=null,ru=null,yg=!1;function GC(l,u,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;yg||Go==null||Go!==he(w)||(w=Go,"selectionStart"in w&&vg(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),ru&&nu(ru,w)||(ru=w,w=If(gg,"onSelect"),0<w.length&&(u=new lg("onSelect","select",null,u,m),l.push({event:u,listeners:w}),u.target=Go)))}function kf(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var Yo={animationend:kf("Animation","AnimationEnd"),animationiteration:kf("Animation","AnimationIteration"),animationstart:kf("Animation","AnimationStart"),transitionend:kf("Transition","TransitionEnd")},xg={},YC={};c&&(YC=document.createElement("div").style,"AnimationEvent"in window||(delete Yo.animationend.animation,delete Yo.animationiteration.animation,delete Yo.animationstart.animation),"TransitionEvent"in window||delete Yo.transitionend.transition);function Rf(l){if(xg[l])return xg[l];if(!Yo[l])return l;var u=Yo[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in YC)return xg[l]=u[m];return l}var XC=Rf("animationend"),QC=Rf("animationiteration"),JC=Rf("animationstart"),ZC=Rf("transitionend"),e_=new Map,t_="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 oi(l,u){e_.set(l,u),i(u,[l])}for(var bg=0;bg<t_.length;bg++){var wg=t_[bg],j6=wg.toLowerCase(),N6=wg[0].toUpperCase()+wg.slice(1);oi(j6,"on"+N6)}oi(XC,"onAnimationEnd"),oi(QC,"onAnimationIteration"),oi(JC,"onAnimationStart"),oi("dblclick","onDoubleClick"),oi("focusin","onFocus"),oi("focusout","onBlur"),oi(ZC,"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 au="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(" "),C6=new Set("cancel close invalid load scroll toggle".split(" ").concat(au));function n_(l,u,m){var w=l.type||"unknown-event";l.currentTarget=m,Ye(w,u,void 0,l),l.currentTarget=null}function r_(l,u){u=(u&4)!==0;for(var m=0;m<l.length;m++){var w=l[m],C=w.event;w=w.listeners;e:{var E=void 0;if(u)for(var I=w.length-1;0<=I;I--){var Y=w[I],te=Y.instance,pe=Y.currentTarget;if(Y=Y.listener,te!==E&&C.isPropagationStopped())break e;n_(C,Y,pe),E=te}else for(I=0;I<w.length;I++){if(Y=w[I],te=Y.instance,pe=Y.currentTarget,Y=Y.listener,te!==E&&C.isPropagationStopped())break e;n_(C,Y,pe),E=te}}}if(Ca)throw l=ti,Ca=!1,ti=null,l}function un(l,u){var m=u[Pg];m===void 0&&(m=u[Pg]=new Set);var w=l+"__bubble";m.has(w)||(a_(u,l,2,!1),m.add(w))}function Sg(l,u,m){var w=0;u&&(w|=4),a_(m,l,w,u)}var Tf="_reactListening"+Math.random().toString(36).slice(2);function su(l){if(!l[Tf]){l[Tf]=!0,r.forEach(function(m){m!=="selectionchange"&&(C6.has(m)||Sg(m,!1,l),Sg(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[Tf]||(u[Tf]=!0,Sg("selectionchange",!1,u))}}function a_(l,u,m,w){switch(AC(u)){case 1:var C=Fz;break;case 4:C=Bz;break;default:C=sg}m=C.bind(null,u,m,l),C=void 0,!mr||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(C=!0),w?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 jg(l,u,m,w,C){var E=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var I=w.tag;if(I===3||I===4){var Y=w.stateNode.containerInfo;if(Y===C||Y.nodeType===8&&Y.parentNode===C)break;if(I===4)for(I=w.return;I!==null;){var te=I.tag;if((te===3||te===4)&&(te=I.stateNode.containerInfo,te===C||te.nodeType===8&&te.parentNode===C))return;I=I.return}for(;Y!==null;){if(I=Hi(Y),I===null)return;if(te=I.tag,te===5||te===6){w=E=I;continue e}Y=Y.parentNode}}w=w.return}tn(function(){var pe=E,_e=_r(m),Ee=[];e:{var Ce=e_.get(l);if(Ce!==void 0){var Fe=lg,Ge=l;switch(l){case"keypress":if(Af(m)===0)break e;case"keydown":case"keyup":Fe=t6;break;case"focusin":Ge="focus",Fe=dg;break;case"focusout":Ge="blur",Fe=dg;break;case"beforeblur":case"afterblur":Fe=dg;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":Fe=OC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=qz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=a6;break;case XC:case QC:case JC:Fe=Hz;break;case ZC:Fe=i6;break;case"scroll":Fe=zz;break;case"wheel":Fe=l6;break;case"copy":case"cut":case"paste":Fe=Gz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=RC}var Xe=(u&4)!==0,En=!Xe&&l==="scroll",ce=Xe?Ce!==null?Ce+"Capture":null:Ce;Xe=[];for(var ne=pe,de;ne!==null;){de=ne;var Te=de.stateNode;if(de.tag===5&&Te!==null&&(de=Te,ce!==null&&(Te=Et(ne,ce),Te!=null&&Xe.push(iu(ne,Te,de)))),En)break;ne=ne.return}0<Xe.length&&(Ce=new Fe(Ce,Ge,null,m,_e),Ee.push({event:Ce,listeners:Xe}))}}if((u&7)===0){e:{if(Ce=l==="mouseover"||l==="pointerover",Fe=l==="mouseout"||l==="pointerout",Ce&&m!==Cr&&(Ge=m.relatedTarget||m.fromElement)&&(Hi(Ge)||Ge[ws]))break e;if((Fe||Ce)&&(Ce=_e.window===_e?_e:(Ce=_e.ownerDocument)?Ce.defaultView||Ce.parentWindow:window,Fe?(Ge=m.relatedTarget||m.toElement,Fe=pe,Ge=Ge?Hi(Ge):null,Ge!==null&&(En=Ze(Ge),Ge!==En||Ge.tag!==5&&Ge.tag!==6)&&(Ge=null)):(Fe=null,Ge=pe),Fe!==Ge)){if(Xe=OC,Te="onMouseLeave",ce="onMouseEnter",ne="mouse",(l==="pointerout"||l==="pointerover")&&(Xe=RC,Te="onPointerLeave",ce="onPointerEnter",ne="pointer"),En=Fe==null?Ce:Jo(Fe),de=Ge==null?Ce:Jo(Ge),Ce=new Xe(Te,ne+"leave",Fe,m,_e),Ce.target=En,Ce.relatedTarget=de,Te=null,Hi(_e)===pe&&(Xe=new Xe(ce,ne+"enter",Ge,m,_e),Xe.target=de,Xe.relatedTarget=En,Te=Xe),En=Te,Fe&&Ge)t:{for(Xe=Fe,ce=Ge,ne=0,de=Xe;de;de=Xo(de))ne++;for(de=0,Te=ce;Te;Te=Xo(Te))de++;for(;0<ne-de;)Xe=Xo(Xe),ne--;for(;0<de-ne;)ce=Xo(ce),de--;for(;ne--;){if(Xe===ce||ce!==null&&Xe===ce.alternate)break t;Xe=Xo(Xe),ce=Xo(ce)}Xe=null}else Xe=null;Fe!==null&&s_(Ee,Ce,Fe,Xe,!1),Ge!==null&&En!==null&&s_(Ee,En,Ge,Xe,!0)}}e:{if(Ce=pe?Jo(pe):window,Fe=Ce.nodeName&&Ce.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&Ce.type==="file")var Je=m6;else if(LC(Ce))if(BC)Je=x6;else{Je=g6;var ot=v6}else(Fe=Ce.nodeName)&&Fe.toLowerCase()==="input"&&(Ce.type==="checkbox"||Ce.type==="radio")&&(Je=y6);if(Je&&(Je=Je(l,pe))){FC(Ee,Je,m,_e);break e}ot&&ot(l,Ce,pe),l==="focusout"&&(ot=Ce._wrapperState)&&ot.controlled&&Ce.type==="number"&&tt(Ce,"number",Ce.value)}switch(ot=pe?Jo(pe):window,l){case"focusin":(LC(ot)||ot.contentEditable==="true")&&(Go=ot,gg=pe,ru=null);break;case"focusout":ru=gg=Go=null;break;case"mousedown":yg=!0;break;case"contextmenu":case"mouseup":case"dragend":yg=!1,GC(Ee,m,_e);break;case"selectionchange":if(S6)break;case"keydown":case"keyup":GC(Ee,m,_e)}var lt;if(pg)e:{switch(l){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else Ko?$C(l,m)&&(mt="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(mt="onCompositionStart");mt&&(TC&&m.locale!=="ko"&&(Ko||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&Ko&&(lt=EC()):(ii=_e,og="value"in ii?ii.value:ii.textContent,Ko=!0)),ot=If(pe,mt),0<ot.length&&(mt=new kC(mt,l,null,m,_e),Ee.push({event:mt,listeners:ot}),lt?mt.data=lt:(lt=DC(m),lt!==null&&(mt.data=lt)))),(lt=u6?d6(l,m):f6(l,m))&&(pe=If(pe,"onBeforeInput"),0<pe.length&&(_e=new kC("onBeforeInput","beforeinput",null,m,_e),Ee.push({event:_e,listeners:pe}),_e.data=lt))}r_(Ee,u)})}function iu(l,u,m){return{instance:l,listener:u,currentTarget:m}}function If(l,u){for(var m=u+"Capture",w=[];l!==null;){var C=l,E=C.stateNode;C.tag===5&&E!==null&&(C=E,E=Et(l,m),E!=null&&w.unshift(iu(l,E,C)),E=Et(l,u),E!=null&&w.push(iu(l,E,C))),l=l.return}return w}function Xo(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function s_(l,u,m,w,C){for(var E=u._reactName,I=[];m!==null&&m!==w;){var Y=m,te=Y.alternate,pe=Y.stateNode;if(te!==null&&te===w)break;Y.tag===5&&pe!==null&&(Y=pe,C?(te=Et(m,E),te!=null&&I.unshift(iu(m,te,Y))):C||(te=Et(m,E),te!=null&&I.push(iu(m,te,Y)))),m=m.return}I.length!==0&&l.push({event:u,listeners:I})}var _6=/\r\n?/g,A6=/\u0000|\uFFFD/g;function i_(l){return(typeof l=="string"?l:""+l).replace(_6,`
6
+ `).replace(A6,"")}function Mf(l,u,m){if(u=i_(u),i_(l)!==u&&m)throw Error(n(425))}function $f(){}var Ng=null,Cg=null;function _g(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 Ag=typeof setTimeout=="function"?setTimeout:void 0,E6=typeof clearTimeout=="function"?clearTimeout:void 0,o_=typeof Promise=="function"?Promise:void 0,P6=typeof queueMicrotask=="function"?queueMicrotask:typeof o_<"u"?function(l){return o_.resolve(null).then(l).catch(O6)}:Ag;function O6(l){setTimeout(function(){throw l})}function Eg(l,u){var m=u,w=0;do{var C=m.nextSibling;if(l.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(w===0){l.removeChild(C),Xc(u);return}w--}else m!=="$"&&m!=="$?"&&m!=="$!"||w++;m=C}while(m);Xc(u)}function li(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 l_(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 Qo=Math.random().toString(36).slice(2),Za="__reactFiber$"+Qo,ou="__reactProps$"+Qo,ws="__reactContainer$"+Qo,Pg="__reactEvents$"+Qo,k6="__reactListeners$"+Qo,R6="__reactHandles$"+Qo;function Hi(l){var u=l[Za];if(u)return u;for(var m=l.parentNode;m;){if(u=m[ws]||m[Za]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=l_(l);l!==null;){if(m=l[Za])return m;l=l_(l)}return u}l=m,m=l.parentNode}return null}function lu(l){return l=l[Za]||l[ws],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Jo(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Df(l){return l[ou]||null}var Og=[],Zo=-1;function ci(l){return{current:l}}function dn(l){0>Zo||(l.current=Og[Zo],Og[Zo]=null,Zo--)}function nn(l,u){Zo++,Og[Zo]=l.current,l.current=u}var ui={},cr=ci(ui),Ar=ci(!1),Ki=ui;function el(l,u){var m=l.type.contextTypes;if(!m)return ui;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var C={},E;for(E in m)C[E]=u[E];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=C),C}function Er(l){return l=l.childContextTypes,l!=null}function Lf(){dn(Ar),dn(cr)}function c_(l,u,m){if(cr.current!==ui)throw Error(n(168));nn(cr,u),nn(Ar,m)}function u_(l,u,m){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return m;w=w.getChildContext();for(var C in w)if(!(C in u))throw Error(n(108,ae(l)||"Unknown",C));return Q({},m,w)}function Ff(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ui,Ki=cr.current,nn(cr,l),nn(Ar,Ar.current),!0}function d_(l,u,m){var w=l.stateNode;if(!w)throw Error(n(169));m?(l=u_(l,u,Ki),w.__reactInternalMemoizedMergedChildContext=l,dn(Ar),dn(cr),nn(cr,l)):dn(Ar),nn(Ar,m)}var Ss=null,Bf=!1,kg=!1;function f_(l){Ss===null?Ss=[l]:Ss.push(l)}function T6(l){Bf=!0,f_(l)}function di(){if(!kg&&Ss!==null){kg=!0;var l=0,u=Ut;try{var m=Ss;for(Ut=1;l<m.length;l++){var w=m[l];do w=w(!0);while(w!==null)}Ss=null,Bf=!1}catch(C){throw Ss!==null&&(Ss=Ss.slice(l+1)),Ln(Re,di),C}finally{Ut=u,kg=!1}}return null}var tl=[],nl=0,zf=null,Uf=0,ra=[],aa=0,Gi=null,js=1,Ns="";function Yi(l,u){tl[nl++]=Uf,tl[nl++]=zf,zf=l,Uf=u}function p_(l,u,m){ra[aa++]=js,ra[aa++]=Ns,ra[aa++]=Gi,Gi=l;var w=js;l=Ns;var C=32-Lr(w)-1;w&=~(1<<C),m+=1;var E=32-Lr(u)+C;if(30<E){var I=C-C%5;E=(w&(1<<I)-1).toString(32),w>>=I,C-=I,js=1<<32-Lr(u)+C|m<<C|w,Ns=E+l}else js=1<<E|m<<C|w,Ns=l}function Rg(l){l.return!==null&&(Yi(l,1),p_(l,1,0))}function Tg(l){for(;l===zf;)zf=tl[--nl],tl[nl]=null,Uf=tl[--nl],tl[nl]=null;for(;l===Gi;)Gi=ra[--aa],ra[aa]=null,Ns=ra[--aa],ra[aa]=null,js=ra[--aa],ra[aa]=null}var Br=null,zr=null,gn=!1,Aa=null;function h_(l,u){var m=la(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 m_(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,Br=l,zr=li(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,Br=l,zr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=Gi!==null?{id:js,overflow:Ns}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=la(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,Br=l,zr=null,!0):!1;default:return!1}}function Ig(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Mg(l){if(gn){var u=zr;if(u){var m=u;if(!m_(l,u)){if(Ig(l))throw Error(n(418));u=li(m.nextSibling);var w=Br;u&&m_(l,u)?h_(w,m):(l.flags=l.flags&-4097|2,gn=!1,Br=l)}}else{if(Ig(l))throw Error(n(418));l.flags=l.flags&-4097|2,gn=!1,Br=l}}}function v_(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Br=l}function qf(l){if(l!==Br)return!1;if(!gn)return v_(l),gn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!_g(l.type,l.memoizedProps)),u&&(u=zr)){if(Ig(l))throw g_(),Error(n(418));for(;u;)h_(l,u),u=li(u.nextSibling)}if(v_(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){zr=li(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}zr=null}}else zr=Br?li(l.stateNode.nextSibling):null;return!0}function g_(){for(var l=zr;l;)l=li(l.nextSibling)}function rl(){zr=Br=null,gn=!1}function $g(l){Aa===null?Aa=[l]:Aa.push(l)}var I6=P.ReactCurrentBatchConfig;function cu(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 w=m.stateNode}if(!w)throw Error(n(147,l));var C=w,E=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===E?u.ref:(u=function(I){var Y=C.refs;I===null?delete Y[E]:Y[E]=I},u._stringRef=E,u)}if(typeof l!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,l))}return l}function Wf(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function y_(l){var u=l._init;return u(l._payload)}function x_(l){function u(ce,ne){if(l){var de=ce.deletions;de===null?(ce.deletions=[ne],ce.flags|=16):de.push(ne)}}function m(ce,ne){if(!l)return null;for(;ne!==null;)u(ce,ne),ne=ne.sibling;return null}function w(ce,ne){for(ce=new Map;ne!==null;)ne.key!==null?ce.set(ne.key,ne):ce.set(ne.index,ne),ne=ne.sibling;return ce}function C(ce,ne){return ce=xi(ce,ne),ce.index=0,ce.sibling=null,ce}function E(ce,ne,de){return ce.index=de,l?(de=ce.alternate,de!==null?(de=de.index,de<ne?(ce.flags|=2,ne):de):(ce.flags|=2,ne)):(ce.flags|=1048576,ne)}function I(ce){return l&&ce.alternate===null&&(ce.flags|=2),ce}function Y(ce,ne,de,Te){return ne===null||ne.tag!==6?(ne=Ay(de,ce.mode,Te),ne.return=ce,ne):(ne=C(ne,de),ne.return=ce,ne)}function te(ce,ne,de,Te){var Je=de.type;return Je===k?_e(ce,ne,de.props.children,Te,de.key):ne!==null&&(ne.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===X&&y_(Je)===ne.type)?(Te=C(ne,de.props),Te.ref=cu(ce,ne,de),Te.return=ce,Te):(Te=hp(de.type,de.key,de.props,null,ce.mode,Te),Te.ref=cu(ce,ne,de),Te.return=ce,Te)}function pe(ce,ne,de,Te){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==de.containerInfo||ne.stateNode.implementation!==de.implementation?(ne=Ey(de,ce.mode,Te),ne.return=ce,ne):(ne=C(ne,de.children||[]),ne.return=ce,ne)}function _e(ce,ne,de,Te,Je){return ne===null||ne.tag!==7?(ne=ro(de,ce.mode,Te,Je),ne.return=ce,ne):(ne=C(ne,de),ne.return=ce,ne)}function Ee(ce,ne,de){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=Ay(""+ne,ce.mode,de),ne.return=ce,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case A:return de=hp(ne.type,ne.key,ne.props,null,ce.mode,de),de.ref=cu(ce,null,ne),de.return=ce,de;case O:return ne=Ey(ne,ce.mode,de),ne.return=ce,ne;case X:var Te=ne._init;return Ee(ce,Te(ne._payload),de)}if(je(ne)||L(ne))return ne=ro(ne,ce.mode,de,null),ne.return=ce,ne;Wf(ce,ne)}return null}function Ce(ce,ne,de,Te){var Je=ne!==null?ne.key:null;if(typeof de=="string"&&de!==""||typeof de=="number")return Je!==null?null:Y(ce,ne,""+de,Te);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case A:return de.key===Je?te(ce,ne,de,Te):null;case O:return de.key===Je?pe(ce,ne,de,Te):null;case X:return Je=de._init,Ce(ce,ne,Je(de._payload),Te)}if(je(de)||L(de))return Je!==null?null:_e(ce,ne,de,Te,null);Wf(ce,de)}return null}function Fe(ce,ne,de,Te,Je){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return ce=ce.get(de)||null,Y(ne,ce,""+Te,Je);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case A:return ce=ce.get(Te.key===null?de:Te.key)||null,te(ne,ce,Te,Je);case O:return ce=ce.get(Te.key===null?de:Te.key)||null,pe(ne,ce,Te,Je);case X:var ot=Te._init;return Fe(ce,ne,de,ot(Te._payload),Je)}if(je(Te)||L(Te))return ce=ce.get(de)||null,_e(ne,ce,Te,Je,null);Wf(ne,Te)}return null}function Ge(ce,ne,de,Te){for(var Je=null,ot=null,lt=ne,mt=ne=0,Jn=null;lt!==null&&mt<de.length;mt++){lt.index>mt?(Jn=lt,lt=null):Jn=lt.sibling;var Tt=Ce(ce,lt,de[mt],Te);if(Tt===null){lt===null&&(lt=Jn);break}l&&lt&&Tt.alternate===null&&u(ce,lt),ne=E(Tt,ne,mt),ot===null?Je=Tt:ot.sibling=Tt,ot=Tt,lt=Jn}if(mt===de.length)return m(ce,lt),gn&&Yi(ce,mt),Je;if(lt===null){for(;mt<de.length;mt++)lt=Ee(ce,de[mt],Te),lt!==null&&(ne=E(lt,ne,mt),ot===null?Je=lt:ot.sibling=lt,ot=lt);return gn&&Yi(ce,mt),Je}for(lt=w(ce,lt);mt<de.length;mt++)Jn=Fe(lt,ce,mt,de[mt],Te),Jn!==null&&(l&&Jn.alternate!==null&&lt.delete(Jn.key===null?mt:Jn.key),ne=E(Jn,ne,mt),ot===null?Je=Jn:ot.sibling=Jn,ot=Jn);return l&&lt.forEach(function(bi){return u(ce,bi)}),gn&&Yi(ce,mt),Je}function Xe(ce,ne,de,Te){var Je=L(de);if(typeof Je!="function")throw Error(n(150));if(de=Je.call(de),de==null)throw Error(n(151));for(var ot=Je=null,lt=ne,mt=ne=0,Jn=null,Tt=de.next();lt!==null&&!Tt.done;mt++,Tt=de.next()){lt.index>mt?(Jn=lt,lt=null):Jn=lt.sibling;var bi=Ce(ce,lt,Tt.value,Te);if(bi===null){lt===null&&(lt=Jn);break}l&&lt&&bi.alternate===null&&u(ce,lt),ne=E(bi,ne,mt),ot===null?Je=bi:ot.sibling=bi,ot=bi,lt=Jn}if(Tt.done)return m(ce,lt),gn&&Yi(ce,mt),Je;if(lt===null){for(;!Tt.done;mt++,Tt=de.next())Tt=Ee(ce,Tt.value,Te),Tt!==null&&(ne=E(Tt,ne,mt),ot===null?Je=Tt:ot.sibling=Tt,ot=Tt);return gn&&Yi(ce,mt),Je}for(lt=w(ce,lt);!Tt.done;mt++,Tt=de.next())Tt=Fe(lt,ce,mt,Tt.value,Te),Tt!==null&&(l&&Tt.alternate!==null&&lt.delete(Tt.key===null?mt:Tt.key),ne=E(Tt,ne,mt),ot===null?Je=Tt:ot.sibling=Tt,ot=Tt);return l&&lt.forEach(function(pU){return u(ce,pU)}),gn&&Yi(ce,mt),Je}function En(ce,ne,de,Te){if(typeof de=="object"&&de!==null&&de.type===k&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case A:e:{for(var Je=de.key,ot=ne;ot!==null;){if(ot.key===Je){if(Je=de.type,Je===k){if(ot.tag===7){m(ce,ot.sibling),ne=C(ot,de.props.children),ne.return=ce,ce=ne;break e}}else if(ot.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===X&&y_(Je)===ot.type){m(ce,ot.sibling),ne=C(ot,de.props),ne.ref=cu(ce,ot,de),ne.return=ce,ce=ne;break e}m(ce,ot);break}else u(ce,ot);ot=ot.sibling}de.type===k?(ne=ro(de.props.children,ce.mode,Te,de.key),ne.return=ce,ce=ne):(Te=hp(de.type,de.key,de.props,null,ce.mode,Te),Te.ref=cu(ce,ne,de),Te.return=ce,ce=Te)}return I(ce);case O:e:{for(ot=de.key;ne!==null;){if(ne.key===ot)if(ne.tag===4&&ne.stateNode.containerInfo===de.containerInfo&&ne.stateNode.implementation===de.implementation){m(ce,ne.sibling),ne=C(ne,de.children||[]),ne.return=ce,ce=ne;break e}else{m(ce,ne);break}else u(ce,ne);ne=ne.sibling}ne=Ey(de,ce.mode,Te),ne.return=ce,ce=ne}return I(ce);case X:return ot=de._init,En(ce,ne,ot(de._payload),Te)}if(je(de))return Ge(ce,ne,de,Te);if(L(de))return Xe(ce,ne,de,Te);Wf(ce,de)}return typeof de=="string"&&de!==""||typeof de=="number"?(de=""+de,ne!==null&&ne.tag===6?(m(ce,ne.sibling),ne=C(ne,de),ne.return=ce,ce=ne):(m(ce,ne),ne=Ay(de,ce.mode,Te),ne.return=ce,ce=ne),I(ce)):m(ce,ne)}return En}var al=x_(!0),b_=x_(!1),Vf=ci(null),Hf=null,sl=null,Dg=null;function Lg(){Dg=sl=Hf=null}function Fg(l){var u=Vf.current;dn(Vf),l._currentValue=u}function Bg(l,u,m){for(;l!==null;){var w=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,w!==null&&(w.childLanes|=u)):w!==null&&(w.childLanes&u)!==u&&(w.childLanes|=u),l===m)break;l=l.return}}function il(l,u){Hf=l,Dg=sl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(Pr=!0),l.firstContext=null)}function sa(l){var u=l._currentValue;if(Dg!==l)if(l={context:l,memoizedValue:u,next:null},sl===null){if(Hf===null)throw Error(n(308));sl=l,Hf.dependencies={lanes:0,firstContext:l}}else sl=sl.next=l;return u}var Xi=null;function zg(l){Xi===null?Xi=[l]:Xi.push(l)}function w_(l,u,m,w){var C=u.interleaved;return C===null?(m.next=m,zg(u)):(m.next=C.next,C.next=m),u.interleaved=m,Cs(l,w)}function Cs(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 fi=!1;function Ug(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function S_(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 _s(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function pi(l,u,m){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(kt&2)!==0){var C=w.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),w.pending=u,Cs(l,m)}return C=w.interleaved,C===null?(u.next=u,zg(w)):(u.next=C.next,C.next=u),w.interleaved=u,Cs(l,m)}function Kf(l,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194240)!==0)){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,ng(l,m)}}function j_(l,u){var m=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,m===w)){var C=null,E=null;if(m=m.firstBaseUpdate,m!==null){do{var I={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};E===null?C=E=I:E=E.next=I,m=m.next}while(m!==null);E===null?C=E=u:E=E.next=u}else C=E=u;m={baseState:w.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:w.shared,effects:w.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=u}function Gf(l,u,m,w){var C=l.updateQueue;fi=!1;var E=C.firstBaseUpdate,I=C.lastBaseUpdate,Y=C.shared.pending;if(Y!==null){C.shared.pending=null;var te=Y,pe=te.next;te.next=null,I===null?E=pe:I.next=pe,I=te;var _e=l.alternate;_e!==null&&(_e=_e.updateQueue,Y=_e.lastBaseUpdate,Y!==I&&(Y===null?_e.firstBaseUpdate=pe:Y.next=pe,_e.lastBaseUpdate=te))}if(E!==null){var Ee=C.baseState;I=0,_e=pe=te=null,Y=E;do{var Ce=Y.lane,Fe=Y.eventTime;if((w&Ce)===Ce){_e!==null&&(_e=_e.next={eventTime:Fe,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ge=l,Xe=Y;switch(Ce=u,Fe=m,Xe.tag){case 1:if(Ge=Xe.payload,typeof Ge=="function"){Ee=Ge.call(Fe,Ee,Ce);break e}Ee=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=Xe.payload,Ce=typeof Ge=="function"?Ge.call(Fe,Ee,Ce):Ge,Ce==null)break e;Ee=Q({},Ee,Ce);break e;case 2:fi=!0}}Y.callback!==null&&Y.lane!==0&&(l.flags|=64,Ce=C.effects,Ce===null?C.effects=[Y]:Ce.push(Y))}else Fe={eventTime:Fe,lane:Ce,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},_e===null?(pe=_e=Fe,te=Ee):_e=_e.next=Fe,I|=Ce;if(Y=Y.next,Y===null){if(Y=C.shared.pending,Y===null)break;Ce=Y,Y=Ce.next,Ce.next=null,C.lastBaseUpdate=Ce,C.shared.pending=null}}while(!0);if(_e===null&&(te=Ee),C.baseState=te,C.firstBaseUpdate=pe,C.lastBaseUpdate=_e,u=C.shared.interleaved,u!==null){C=u;do I|=C.lane,C=C.next;while(C!==u)}else E===null&&(C.shared.lanes=0);Zi|=I,l.lanes=I,l.memoizedState=Ee}}function N_(l,u,m){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var w=l[u],C=w.callback;if(C!==null){if(w.callback=null,w=m,typeof C!="function")throw Error(n(191,C));C.call(w)}}}var uu={},es=ci(uu),du=ci(uu),fu=ci(uu);function Qi(l){if(l===uu)throw Error(n(174));return l}function qg(l,u){switch(nn(fu,u),nn(du,l),nn(es,uu),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:qe(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=qe(u,l)}dn(es),nn(es,u)}function ol(){dn(es),dn(du),dn(fu)}function C_(l){Qi(fu.current);var u=Qi(es.current),m=qe(u,l.type);u!==m&&(nn(du,l),nn(es,m))}function Wg(l){du.current===l&&(dn(es),dn(du))}var bn=ci(0);function Yf(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 Vg=[];function Hg(){for(var l=0;l<Vg.length;l++)Vg[l]._workInProgressVersionPrimary=null;Vg.length=0}var Xf=P.ReactCurrentDispatcher,Kg=P.ReactCurrentBatchConfig,Ji=0,wn=null,Bn=null,Xn=null,Qf=!1,pu=!1,hu=0,M6=0;function ur(){throw Error(n(321))}function Gg(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!_a(l[m],u[m]))return!1;return!0}function Yg(l,u,m,w,C,E){if(Ji=E,wn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Xf.current=l===null||l.memoizedState===null?F6:B6,l=m(w,C),pu){E=0;do{if(pu=!1,hu=0,25<=E)throw Error(n(301));E+=1,Xn=Bn=null,u.updateQueue=null,Xf.current=z6,l=m(w,C)}while(pu)}if(Xf.current=ep,u=Bn!==null&&Bn.next!==null,Ji=0,Xn=Bn=wn=null,Qf=!1,u)throw Error(n(300));return l}function Xg(){var l=hu!==0;return hu=0,l}function ts(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xn===null?wn.memoizedState=Xn=l:Xn=Xn.next=l,Xn}function ia(){if(Bn===null){var l=wn.alternate;l=l!==null?l.memoizedState:null}else l=Bn.next;var u=Xn===null?wn.memoizedState:Xn.next;if(u!==null)Xn=u,Bn=l;else{if(l===null)throw Error(n(310));Bn=l,l={memoizedState:Bn.memoizedState,baseState:Bn.baseState,baseQueue:Bn.baseQueue,queue:Bn.queue,next:null},Xn===null?wn.memoizedState=Xn=l:Xn=Xn.next=l}return Xn}function mu(l,u){return typeof u=="function"?u(l):u}function Qg(l){var u=ia(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=Bn,C=w.baseQueue,E=m.pending;if(E!==null){if(C!==null){var I=C.next;C.next=E.next,E.next=I}w.baseQueue=C=E,m.pending=null}if(C!==null){E=C.next,w=w.baseState;var Y=I=null,te=null,pe=E;do{var _e=pe.lane;if((Ji&_e)===_e)te!==null&&(te=te.next={lane:0,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null}),w=pe.hasEagerState?pe.eagerState:l(w,pe.action);else{var Ee={lane:_e,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null};te===null?(Y=te=Ee,I=w):te=te.next=Ee,wn.lanes|=_e,Zi|=_e}pe=pe.next}while(pe!==null&&pe!==E);te===null?I=w:te.next=Y,_a(w,u.memoizedState)||(Pr=!0),u.memoizedState=w,u.baseState=I,u.baseQueue=te,m.lastRenderedState=w}if(l=m.interleaved,l!==null){C=l;do E=C.lane,wn.lanes|=E,Zi|=E,C=C.next;while(C!==l)}else C===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function Jg(l){var u=ia(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=m.dispatch,C=m.pending,E=u.memoizedState;if(C!==null){m.pending=null;var I=C=C.next;do E=l(E,I.action),I=I.next;while(I!==C);_a(E,u.memoizedState)||(Pr=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),m.lastRenderedState=E}return[E,w]}function __(){}function A_(l,u){var m=wn,w=ia(),C=u(),E=!_a(w.memoizedState,C);if(E&&(w.memoizedState=C,Pr=!0),w=w.queue,Zg(O_.bind(null,m,w,l),[l]),w.getSnapshot!==u||E||Xn!==null&&Xn.memoizedState.tag&1){if(m.flags|=2048,vu(9,P_.bind(null,m,w,C,u),void 0,null),Qn===null)throw Error(n(349));(Ji&30)!==0||E_(m,u,C)}return C}function E_(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=wn.updateQueue,u===null?(u={lastEffect:null,stores:null},wn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function P_(l,u,m,w){u.value=m,u.getSnapshot=w,k_(u)&&R_(l)}function O_(l,u,m){return m(function(){k_(u)&&R_(l)})}function k_(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!_a(l,m)}catch{return!0}}function R_(l){var u=Cs(l,1);u!==null&&ka(u,l,1,-1)}function T_(l){var u=ts();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mu,lastRenderedState:l},u.queue=l,l=l.dispatch=L6.bind(null,wn,l),[u.memoizedState,l]}function vu(l,u,m,w){return l={tag:l,create:u,destroy:m,deps:w,next:null},u=wn.updateQueue,u===null?(u={lastEffect:null,stores:null},wn.updateQueue=u,u.lastEffect=l.next=l):(m=u.lastEffect,m===null?u.lastEffect=l.next=l:(w=m.next,m.next=l,l.next=w,u.lastEffect=l)),l}function I_(){return ia().memoizedState}function Jf(l,u,m,w){var C=ts();wn.flags|=l,C.memoizedState=vu(1|u,m,void 0,w===void 0?null:w)}function Zf(l,u,m,w){var C=ia();w=w===void 0?null:w;var E=void 0;if(Bn!==null){var I=Bn.memoizedState;if(E=I.destroy,w!==null&&Gg(w,I.deps)){C.memoizedState=vu(u,m,E,w);return}}wn.flags|=l,C.memoizedState=vu(1|u,m,E,w)}function M_(l,u){return Jf(8390656,8,l,u)}function Zg(l,u){return Zf(2048,8,l,u)}function $_(l,u){return Zf(4,2,l,u)}function D_(l,u){return Zf(4,4,l,u)}function L_(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 F_(l,u,m){return m=m!=null?m.concat([l]):null,Zf(4,4,L_.bind(null,u,l),m)}function ey(){}function B_(l,u){var m=ia();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&Gg(u,w[1])?w[0]:(m.memoizedState=[l,u],l)}function z_(l,u){var m=ia();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&Gg(u,w[1])?w[0]:(l=l(),m.memoizedState=[l,u],l)}function U_(l,u,m){return(Ji&21)===0?(l.baseState&&(l.baseState=!1,Pr=!0),l.memoizedState=m):(_a(m,u)||(m=yC(),wn.lanes|=m,Zi|=m,l.baseState=!0),u)}function $6(l,u){var m=Ut;Ut=m!==0&&4>m?m:4,l(!0);var w=Kg.transition;Kg.transition={};try{l(!1),u()}finally{Ut=m,Kg.transition=w}}function q_(){return ia().memoizedState}function D6(l,u,m){var w=gi(l);if(m={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null},W_(l))V_(u,m);else if(m=w_(l,u,m,w),m!==null){var C=yr();ka(m,l,w,C),H_(m,u,w)}}function L6(l,u,m){var w=gi(l),C={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null};if(W_(l))V_(u,C);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=u.lastRenderedReducer,E!==null))try{var I=u.lastRenderedState,Y=E(I,m);if(C.hasEagerState=!0,C.eagerState=Y,_a(Y,I)){var te=u.interleaved;te===null?(C.next=C,zg(u)):(C.next=te.next,te.next=C),u.interleaved=C;return}}catch{}m=w_(l,u,C,w),m!==null&&(C=yr(),ka(m,l,w,C),H_(m,u,w))}}function W_(l){var u=l.alternate;return l===wn||u!==null&&u===wn}function V_(l,u){pu=Qf=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function H_(l,u,m){if((m&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,ng(l,m)}}var ep={readContext:sa,useCallback:ur,useContext:ur,useEffect:ur,useImperativeHandle:ur,useInsertionEffect:ur,useLayoutEffect:ur,useMemo:ur,useReducer:ur,useRef:ur,useState:ur,useDebugValue:ur,useDeferredValue:ur,useTransition:ur,useMutableSource:ur,useSyncExternalStore:ur,useId:ur,unstable_isNewReconciler:!1},F6={readContext:sa,useCallback:function(l,u){return ts().memoizedState=[l,u===void 0?null:u],l},useContext:sa,useEffect:M_,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,Jf(4194308,4,L_.bind(null,u,l),m)},useLayoutEffect:function(l,u){return Jf(4194308,4,l,u)},useInsertionEffect:function(l,u){return Jf(4,2,l,u)},useMemo:function(l,u){var m=ts();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var w=ts();return u=m!==void 0?m(u):u,w.memoizedState=w.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},w.queue=l,l=l.dispatch=D6.bind(null,wn,l),[w.memoizedState,l]},useRef:function(l){var u=ts();return l={current:l},u.memoizedState=l},useState:T_,useDebugValue:ey,useDeferredValue:function(l){return ts().memoizedState=l},useTransition:function(){var l=T_(!1),u=l[0];return l=$6.bind(null,l[1]),ts().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var w=wn,C=ts();if(gn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Qn===null)throw Error(n(349));(Ji&30)!==0||E_(w,u,m)}C.memoizedState=m;var E={value:m,getSnapshot:u};return C.queue=E,M_(O_.bind(null,w,E,l),[l]),w.flags|=2048,vu(9,P_.bind(null,w,E,m,u),void 0,null),m},useId:function(){var l=ts(),u=Qn.identifierPrefix;if(gn){var m=Ns,w=js;m=(w&~(1<<32-Lr(w)-1)).toString(32)+m,u=":"+u+"R"+m,m=hu++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=M6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},B6={readContext:sa,useCallback:B_,useContext:sa,useEffect:Zg,useImperativeHandle:F_,useInsertionEffect:$_,useLayoutEffect:D_,useMemo:z_,useReducer:Qg,useRef:I_,useState:function(){return Qg(mu)},useDebugValue:ey,useDeferredValue:function(l){var u=ia();return U_(u,Bn.memoizedState,l)},useTransition:function(){var l=Qg(mu)[0],u=ia().memoizedState;return[l,u]},useMutableSource:__,useSyncExternalStore:A_,useId:q_,unstable_isNewReconciler:!1},z6={readContext:sa,useCallback:B_,useContext:sa,useEffect:Zg,useImperativeHandle:F_,useInsertionEffect:$_,useLayoutEffect:D_,useMemo:z_,useReducer:Jg,useRef:I_,useState:function(){return Jg(mu)},useDebugValue:ey,useDeferredValue:function(l){var u=ia();return Bn===null?u.memoizedState=l:U_(u,Bn.memoizedState,l)},useTransition:function(){var l=Jg(mu)[0],u=ia().memoizedState;return[l,u]},useMutableSource:__,useSyncExternalStore:A_,useId:q_,unstable_isNewReconciler:!1};function Ea(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 ty(l,u,m,w){u=l.memoizedState,m=m(w,u),m=m==null?u:Q({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var tp={isMounted:function(l){return(l=l._reactInternals)?Ze(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var w=yr(),C=gi(l),E=_s(w,C);E.payload=u,m!=null&&(E.callback=m),u=pi(l,E,C),u!==null&&(ka(u,l,C,w),Kf(u,l,C))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var w=yr(),C=gi(l),E=_s(w,C);E.tag=1,E.payload=u,m!=null&&(E.callback=m),u=pi(l,E,C),u!==null&&(ka(u,l,C,w),Kf(u,l,C))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=yr(),w=gi(l),C=_s(m,w);C.tag=2,u!=null&&(C.callback=u),u=pi(l,C,w),u!==null&&(ka(u,l,w,m),Kf(u,l,w))}};function K_(l,u,m,w,C,E,I){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,E,I):u.prototype&&u.prototype.isPureReactComponent?!nu(m,w)||!nu(C,E):!0}function G_(l,u,m){var w=!1,C=ui,E=u.contextType;return typeof E=="object"&&E!==null?E=sa(E):(C=Er(u)?Ki:cr.current,w=u.contextTypes,E=(w=w!=null)?el(l,C):ui),u=new u(m,E),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=tp,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=C,l.__reactInternalMemoizedMaskedChildContext=E),u}function Y_(l,u,m,w){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,w),u.state!==l&&tp.enqueueReplaceState(u,u.state,null)}function ny(l,u,m,w){var C=l.stateNode;C.props=m,C.state=l.memoizedState,C.refs={},Ug(l);var E=u.contextType;typeof E=="object"&&E!==null?C.context=sa(E):(E=Er(u)?Ki:cr.current,C.context=el(l,E)),C.state=l.memoizedState,E=u.getDerivedStateFromProps,typeof E=="function"&&(ty(l,u,E,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&&tp.enqueueReplaceState(C,C.state,null),Gf(l,m,C,w),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308)}function ll(l,u){try{var m="",w=u;do m+=J(w),w=w.return;while(w);var C=m}catch(E){C=`
7
+ Error generating stack: `+E.message+`
8
+ `+E.stack}return{value:l,source:u,stack:C,digest:null}}function ry(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function ay(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var U6=typeof WeakMap=="function"?WeakMap:Map;function X_(l,u,m){m=_s(-1,m),m.tag=3,m.payload={element:null};var w=u.value;return m.callback=function(){lp||(lp=!0,xy=w),ay(l,u)},m}function Q_(l,u,m){m=_s(-1,m),m.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var C=u.value;m.payload=function(){return w(C)},m.callback=function(){ay(l,u)}}var E=l.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(m.callback=function(){ay(l,u),typeof w!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var I=u.stack;this.componentDidCatch(u.value,{componentStack:I!==null?I:""})}),m}function J_(l,u,m){var w=l.pingCache;if(w===null){w=l.pingCache=new U6;var C=new Set;w.set(u,C)}else C=w.get(u),C===void 0&&(C=new Set,w.set(u,C));C.has(m)||(C.add(m),l=nU.bind(null,l,u,m),u.then(l,l))}function Z_(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 eA(l,u,m,w,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=_s(-1,1),u.tag=2,pi(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=C,l)}var q6=P.ReactCurrentOwner,Pr=!1;function gr(l,u,m,w){u.child=l===null?b_(u,null,m,w):al(u,l.child,m,w)}function tA(l,u,m,w,C){m=m.render;var E=u.ref;return il(u,C),w=Yg(l,u,m,w,E,C),m=Xg(),l!==null&&!Pr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,As(l,u,C)):(gn&&m&&Rg(u),u.flags|=1,gr(l,u,w,C),u.child)}function nA(l,u,m,w,C){if(l===null){var E=m.type;return typeof E=="function"&&!_y(E)&&E.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=E,rA(l,u,E,w,C)):(l=hp(m.type,null,w,u,u.mode,C),l.ref=u.ref,l.return=u,u.child=l)}if(E=l.child,(l.lanes&C)===0){var I=E.memoizedProps;if(m=m.compare,m=m!==null?m:nu,m(I,w)&&l.ref===u.ref)return As(l,u,C)}return u.flags|=1,l=xi(E,w),l.ref=u.ref,l.return=u,u.child=l}function rA(l,u,m,w,C){if(l!==null){var E=l.memoizedProps;if(nu(E,w)&&l.ref===u.ref)if(Pr=!1,u.pendingProps=w=E,(l.lanes&C)!==0)(l.flags&131072)!==0&&(Pr=!0);else return u.lanes=l.lanes,As(l,u,C)}return sy(l,u,m,w,C)}function aA(l,u,m){var w=u.pendingProps,C=w.children,E=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},nn(ul,Ur),Ur|=m;else{if((m&1073741824)===0)return l=E!==null?E.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,nn(ul,Ur),Ur|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=E!==null?E.baseLanes:m,nn(ul,Ur),Ur|=w}else E!==null?(w=E.baseLanes|m,u.memoizedState=null):w=m,nn(ul,Ur),Ur|=w;return gr(l,u,C,m),u.child}function sA(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function sy(l,u,m,w,C){var E=Er(m)?Ki:cr.current;return E=el(u,E),il(u,C),m=Yg(l,u,m,w,E,C),w=Xg(),l!==null&&!Pr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,As(l,u,C)):(gn&&w&&Rg(u),u.flags|=1,gr(l,u,m,C),u.child)}function iA(l,u,m,w,C){if(Er(m)){var E=!0;Ff(u)}else E=!1;if(il(u,C),u.stateNode===null)rp(l,u),G_(u,m,w),ny(u,m,w,C),w=!0;else if(l===null){var I=u.stateNode,Y=u.memoizedProps;I.props=Y;var te=I.context,pe=m.contextType;typeof pe=="object"&&pe!==null?pe=sa(pe):(pe=Er(m)?Ki:cr.current,pe=el(u,pe));var _e=m.getDerivedStateFromProps,Ee=typeof _e=="function"||typeof I.getSnapshotBeforeUpdate=="function";Ee||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==w||te!==pe)&&Y_(u,I,w,pe),fi=!1;var Ce=u.memoizedState;I.state=Ce,Gf(u,w,I,C),te=u.memoizedState,Y!==w||Ce!==te||Ar.current||fi?(typeof _e=="function"&&(ty(u,m,_e,w),te=u.memoizedState),(Y=fi||K_(u,m,Y,w,Ce,te,pe))?(Ee||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(u.flags|=4194308)):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=te),I.props=w,I.state=te,I.context=pe,w=Y):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{I=u.stateNode,S_(l,u),Y=u.memoizedProps,pe=u.type===u.elementType?Y:Ea(u.type,Y),I.props=pe,Ee=u.pendingProps,Ce=I.context,te=m.contextType,typeof te=="object"&&te!==null?te=sa(te):(te=Er(m)?Ki:cr.current,te=el(u,te));var Fe=m.getDerivedStateFromProps;(_e=typeof Fe=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(Y!==Ee||Ce!==te)&&Y_(u,I,w,te),fi=!1,Ce=u.memoizedState,I.state=Ce,Gf(u,w,I,C);var Ge=u.memoizedState;Y!==Ee||Ce!==Ge||Ar.current||fi?(typeof Fe=="function"&&(ty(u,m,Fe,w),Ge=u.memoizedState),(pe=fi||K_(u,m,pe,w,Ce,Ge,te)||!1)?(_e||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(w,Ge,te),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(w,Ge,te)),typeof I.componentDidUpdate=="function"&&(u.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof I.componentDidUpdate!="function"||Y===l.memoizedProps&&Ce===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&Ce===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=Ge),I.props=w,I.state=Ge,I.context=te,w=pe):(typeof I.componentDidUpdate!="function"||Y===l.memoizedProps&&Ce===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&Ce===l.memoizedState||(u.flags|=1024),w=!1)}return iy(l,u,m,w,E,C)}function iy(l,u,m,w,C,E){sA(l,u);var I=(u.flags&128)!==0;if(!w&&!I)return C&&d_(u,m,!1),As(l,u,E);w=u.stateNode,q6.current=u;var Y=I&&typeof m.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&I?(u.child=al(u,l.child,null,E),u.child=al(u,null,Y,E)):gr(l,u,Y,E),u.memoizedState=w.state,C&&d_(u,m,!0),u.child}function oA(l){var u=l.stateNode;u.pendingContext?c_(l,u.pendingContext,u.pendingContext!==u.context):u.context&&c_(l,u.context,!1),qg(l,u.containerInfo)}function lA(l,u,m,w,C){return rl(),$g(C),u.flags|=256,gr(l,u,m,w),u.child}var oy={dehydrated:null,treeContext:null,retryLane:0};function ly(l){return{baseLanes:l,cachePool:null,transitions:null}}function cA(l,u,m){var w=u.pendingProps,C=bn.current,E=!1,I=(u.flags&128)!==0,Y;if((Y=I)||(Y=l!==null&&l.memoizedState===null?!1:(C&2)!==0),Y?(E=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(C|=1),nn(bn,C&1),l===null)return Mg(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):(I=w.children,l=w.fallback,E?(w=u.mode,E=u.child,I={mode:"hidden",children:I},(w&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=I):E=mp(I,w,0,null),l=ro(l,w,m,null),E.return=u,l.return=u,E.sibling=l,u.child=E,u.child.memoizedState=ly(m),u.memoizedState=oy,l):cy(u,I));if(C=l.memoizedState,C!==null&&(Y=C.dehydrated,Y!==null))return W6(l,u,I,w,Y,C,m);if(E){E=w.fallback,I=u.mode,C=l.child,Y=C.sibling;var te={mode:"hidden",children:w.children};return(I&1)===0&&u.child!==C?(w=u.child,w.childLanes=0,w.pendingProps=te,u.deletions=null):(w=xi(C,te),w.subtreeFlags=C.subtreeFlags&14680064),Y!==null?E=xi(Y,E):(E=ro(E,I,m,null),E.flags|=2),E.return=u,w.return=u,w.sibling=E,u.child=w,w=E,E=u.child,I=l.child.memoizedState,I=I===null?ly(m):{baseLanes:I.baseLanes|m,cachePool:null,transitions:I.transitions},E.memoizedState=I,E.childLanes=l.childLanes&~m,u.memoizedState=oy,w}return E=l.child,l=E.sibling,w=xi(E,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=m),w.return=u,w.sibling=null,l!==null&&(m=u.deletions,m===null?(u.deletions=[l],u.flags|=16):m.push(l)),u.child=w,u.memoizedState=null,w}function cy(l,u){return u=mp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function np(l,u,m,w){return w!==null&&$g(w),al(u,l.child,null,m),l=cy(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function W6(l,u,m,w,C,E,I){if(m)return u.flags&256?(u.flags&=-257,w=ry(Error(n(422))),np(l,u,I,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(E=w.fallback,C=u.mode,w=mp({mode:"visible",children:w.children},C,0,null),E=ro(E,C,I,null),E.flags|=2,w.return=u,E.return=u,w.sibling=E,u.child=w,(u.mode&1)!==0&&al(u,l.child,null,I),u.child.memoizedState=ly(I),u.memoizedState=oy,E);if((u.mode&1)===0)return np(l,u,I,null);if(C.data==="$!"){if(w=C.nextSibling&&C.nextSibling.dataset,w)var Y=w.dgst;return w=Y,E=Error(n(419)),w=ry(E,w,void 0),np(l,u,I,w)}if(Y=(I&l.childLanes)!==0,Pr||Y){if(w=Qn,w!==null){switch(I&-I){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&(w.suspendedLanes|I))!==0?0:C,C!==0&&C!==E.retryLane&&(E.retryLane=C,Cs(l,C),ka(w,l,C,-1))}return Cy(),w=ry(Error(n(421))),np(l,u,I,w)}return C.data==="$?"?(u.flags|=128,u.child=l.child,u=rU.bind(null,l),C._reactRetry=u,null):(l=E.treeContext,zr=li(C.nextSibling),Br=u,gn=!0,Aa=null,l!==null&&(ra[aa++]=js,ra[aa++]=Ns,ra[aa++]=Gi,js=l.id,Ns=l.overflow,Gi=u),u=cy(u,w.children),u.flags|=4096,u)}function uA(l,u,m){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),Bg(l.return,u,m)}function uy(l,u,m,w,C){var E=l.memoizedState;E===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:m,tailMode:C}:(E.isBackwards=u,E.rendering=null,E.renderingStartTime=0,E.last=w,E.tail=m,E.tailMode=C)}function dA(l,u,m){var w=u.pendingProps,C=w.revealOrder,E=w.tail;if(gr(l,u,w.children,m),w=bn.current,(w&2)!==0)w=w&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&&uA(l,m,u);else if(l.tag===19)uA(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}w&=1}if(nn(bn,w),(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&&Yf(l)===null&&(C=m),m=m.sibling;m=C,m===null?(C=u.child,u.child=null):(C=m.sibling,m.sibling=null),uy(u,!1,C,m,E);break;case"backwards":for(m=null,C=u.child,u.child=null;C!==null;){if(l=C.alternate,l!==null&&Yf(l)===null){u.child=C;break}l=C.sibling,C.sibling=m,m=C,C=l}uy(u,!0,m,null,E);break;case"together":uy(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function rp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function As(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),Zi|=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=xi(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=xi(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function V6(l,u,m){switch(u.tag){case 3:oA(u),rl();break;case 5:C_(u);break;case 1:Er(u.type)&&Ff(u);break;case 4:qg(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,C=u.memoizedProps.value;nn(Vf,w._currentValue),w._currentValue=C;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(nn(bn,bn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?cA(l,u,m):(nn(bn,bn.current&1),l=As(l,u,m),l!==null?l.sibling:null);nn(bn,bn.current&1);break;case 19:if(w=(m&u.childLanes)!==0,(l.flags&128)!==0){if(w)return dA(l,u,m);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),nn(bn,bn.current),w)break;return null;case 22:case 23:return u.lanes=0,aA(l,u,m)}return As(l,u,m)}var fA,dy,pA,hA;fA=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}},dy=function(){},pA=function(l,u,m,w){var C=l.memoizedProps;if(C!==w){l=u.stateNode,Qi(es.current);var E=null;switch(m){case"input":C=xe(l,C),w=xe(l,w),E=[];break;case"select":C=Q({},C,{value:void 0}),w=Q({},w,{value:void 0}),E=[];break;case"textarea":C=dt(l,C),w=dt(l,w),E=[];break;default:typeof C.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=$f)}Dn(m,w);var I;m=null;for(pe in C)if(!w.hasOwnProperty(pe)&&C.hasOwnProperty(pe)&&C[pe]!=null)if(pe==="style"){var Y=C[pe];for(I in Y)Y.hasOwnProperty(I)&&(m||(m={}),m[I]="")}else pe!=="dangerouslySetInnerHTML"&&pe!=="children"&&pe!=="suppressContentEditableWarning"&&pe!=="suppressHydrationWarning"&&pe!=="autoFocus"&&(a.hasOwnProperty(pe)?E||(E=[]):(E=E||[]).push(pe,null));for(pe in w){var te=w[pe];if(Y=C?.[pe],w.hasOwnProperty(pe)&&te!==Y&&(te!=null||Y!=null))if(pe==="style")if(Y){for(I in Y)!Y.hasOwnProperty(I)||te&&te.hasOwnProperty(I)||(m||(m={}),m[I]="");for(I in te)te.hasOwnProperty(I)&&Y[I]!==te[I]&&(m||(m={}),m[I]=te[I])}else m||(E||(E=[]),E.push(pe,m)),m=te;else pe==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Y=Y?Y.__html:void 0,te!=null&&Y!==te&&(E=E||[]).push(pe,te)):pe==="children"?typeof te!="string"&&typeof te!="number"||(E=E||[]).push(pe,""+te):pe!=="suppressContentEditableWarning"&&pe!=="suppressHydrationWarning"&&(a.hasOwnProperty(pe)?(te!=null&&pe==="onScroll"&&un("scroll",l),E||Y===te||(E=[])):(E=E||[]).push(pe,te))}m&&(E=E||[]).push("style",m);var pe=E;(u.updateQueue=pe)&&(u.flags|=4)}},hA=function(l,u,m,w){m!==w&&(u.flags|=4)};function gu(l,u){if(!gn)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 w=null;m!==null;)m.alternate!==null&&(w=m),m=m.sibling;w===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function dr(l){var u=l.alternate!==null&&l.alternate.child===l.child,m=0,w=0;if(u)for(var C=l.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags&14680064,w|=C.flags&14680064,C.return=l,C=C.sibling;else for(C=l.child;C!==null;)m|=C.lanes|C.childLanes,w|=C.subtreeFlags,w|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=w,l.childLanes=m,u}function H6(l,u,m){var w=u.pendingProps;switch(Tg(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dr(u),null;case 1:return Er(u.type)&&Lf(),dr(u),null;case 3:return w=u.stateNode,ol(),dn(Ar),dn(cr),Hg(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(qf(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Aa!==null&&(Sy(Aa),Aa=null))),dy(l,u),dr(u),null;case 5:Wg(u);var C=Qi(fu.current);if(m=u.type,l!==null&&u.stateNode!=null)pA(l,u,m,w,C),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return dr(u),null}if(l=Qi(es.current),qf(u)){w=u.stateNode,m=u.type;var E=u.memoizedProps;switch(w[Za]=u,w[ou]=E,l=(u.mode&1)!==0,m){case"dialog":un("cancel",w),un("close",w);break;case"iframe":case"object":case"embed":un("load",w);break;case"video":case"audio":for(C=0;C<au.length;C++)un(au[C],w);break;case"source":un("error",w);break;case"img":case"image":case"link":un("error",w),un("load",w);break;case"details":un("toggle",w);break;case"input":Ie(w,E),un("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!E.multiple},un("invalid",w);break;case"textarea":Pt(w,E),un("invalid",w)}Dn(m,E),C=null;for(var I in E)if(E.hasOwnProperty(I)){var Y=E[I];I==="children"?typeof Y=="string"?w.textContent!==Y&&(E.suppressHydrationWarning!==!0&&Mf(w.textContent,Y,l),C=["children",Y]):typeof Y=="number"&&w.textContent!==""+Y&&(E.suppressHydrationWarning!==!0&&Mf(w.textContent,Y,l),C=["children",""+Y]):a.hasOwnProperty(I)&&Y!=null&&I==="onScroll"&&un("scroll",w)}switch(m){case"input":Oe(w),Ne(w,E,!0);break;case"textarea":Oe(w),we(w);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(w.onclick=$f)}w=C,u.updateQueue=w,w!==null&&(u.flags|=4)}else{I=C.nodeType===9?C:C.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Le(m)),l==="http://www.w3.org/1999/xhtml"?m==="script"?(l=I.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=I.createElement(m,{is:w.is}):(l=I.createElement(m),m==="select"&&(I=l,w.multiple?I.multiple=!0:w.size&&(I.size=w.size))):l=I.createElementNS(l,m),l[Za]=u,l[ou]=w,fA(l,u,!1,!1),u.stateNode=l;e:{switch(I=Dr(m,w),m){case"dialog":un("cancel",l),un("close",l),C=w;break;case"iframe":case"object":case"embed":un("load",l),C=w;break;case"video":case"audio":for(C=0;C<au.length;C++)un(au[C],l);C=w;break;case"source":un("error",l),C=w;break;case"img":case"image":case"link":un("error",l),un("load",l),C=w;break;case"details":un("toggle",l),C=w;break;case"input":Ie(l,w),C=xe(l,w),un("invalid",l);break;case"option":C=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},C=Q({},w,{value:void 0}),un("invalid",l);break;case"textarea":Pt(l,w),C=dt(l,w),un("invalid",l);break;default:C=w}Dn(m,C),Y=C;for(E in Y)if(Y.hasOwnProperty(E)){var te=Y[E];E==="style"?lr(l,te):E==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&$t(l,te)):E==="children"?typeof te=="string"?(m!=="textarea"||te!=="")&&Dt(l,te):typeof te=="number"&&Dt(l,""+te):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(a.hasOwnProperty(E)?te!=null&&E==="onScroll"&&un("scroll",l):te!=null&&_(l,E,te,I))}switch(m){case"input":Oe(l),Ne(l,w,!1);break;case"textarea":Oe(l),we(l);break;case"option":w.value!=null&&l.setAttribute("value",""+ue(w.value));break;case"select":l.multiple=!!w.multiple,E=w.value,E!=null?et(l,!!w.multiple,E,!1):w.defaultValue!=null&&et(l,!!w.multiple,w.defaultValue,!0);break;default:typeof C.onClick=="function"&&(l.onclick=$f)}switch(m){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return dr(u),null;case 6:if(l&&u.stateNode!=null)hA(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(m=Qi(fu.current),Qi(es.current),qf(u)){if(w=u.stateNode,m=u.memoizedProps,w[Za]=u,(E=w.nodeValue!==m)&&(l=Br,l!==null))switch(l.tag){case 3:Mf(w.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Mf(w.nodeValue,m,(l.mode&1)!==0)}E&&(u.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[Za]=u,u.stateNode=w}return dr(u),null;case 13:if(dn(bn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(gn&&zr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)g_(),rl(),u.flags|=98560,E=!1;else if(E=qf(u),w!==null&&w.dehydrated!==null){if(l===null){if(!E)throw Error(n(318));if(E=u.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[Za]=u}else rl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;dr(u),E=!1}else Aa!==null&&(Sy(Aa),Aa=null),E=!0;if(!E)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=m,u):(w=w!==null,w!==(l!==null&&l.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(bn.current&1)!==0?zn===0&&(zn=3):Cy())),u.updateQueue!==null&&(u.flags|=4),dr(u),null);case 4:return ol(),dy(l,u),l===null&&su(u.stateNode.containerInfo),dr(u),null;case 10:return Fg(u.type._context),dr(u),null;case 17:return Er(u.type)&&Lf(),dr(u),null;case 19:if(dn(bn),E=u.memoizedState,E===null)return dr(u),null;if(w=(u.flags&128)!==0,I=E.rendering,I===null)if(w)gu(E,!1);else{if(zn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(I=Yf(l),I!==null){for(u.flags|=128,gu(E,!1),w=I.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=m,m=u.child;m!==null;)E=m,l=w,E.flags&=14680066,I=E.alternate,I===null?(E.childLanes=0,E.lanes=l,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=I.childLanes,E.lanes=I.lanes,E.child=I.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=I.memoizedProps,E.memoizedState=I.memoizedState,E.updateQueue=I.updateQueue,E.type=I.type,l=I.dependencies,E.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),m=m.sibling;return nn(bn,bn.current&1|2),u.child}l=l.sibling}E.tail!==null&&fe()>dl&&(u.flags|=128,w=!0,gu(E,!1),u.lanes=4194304)}else{if(!w)if(l=Yf(I),l!==null){if(u.flags|=128,w=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),gu(E,!0),E.tail===null&&E.tailMode==="hidden"&&!I.alternate&&!gn)return dr(u),null}else 2*fe()-E.renderingStartTime>dl&&m!==1073741824&&(u.flags|=128,w=!0,gu(E,!1),u.lanes=4194304);E.isBackwards?(I.sibling=u.child,u.child=I):(m=E.last,m!==null?m.sibling=I:u.child=I,E.last=I)}return E.tail!==null?(u=E.tail,E.rendering=u,E.tail=u.sibling,E.renderingStartTime=fe(),u.sibling=null,m=bn.current,nn(bn,w?m&1|2:m&1),u):(dr(u),null);case 22:case 23:return Ny(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(Ur&1073741824)!==0&&(dr(u),u.subtreeFlags&6&&(u.flags|=8192)):dr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function K6(l,u){switch(Tg(u),u.tag){case 1:return Er(u.type)&&Lf(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return ol(),dn(Ar),dn(cr),Hg(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return Wg(u),null;case 13:if(dn(bn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));rl()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return dn(bn),null;case 4:return ol(),null;case 10:return Fg(u.type._context),null;case 22:case 23:return Ny(),null;case 24:return null;default:return null}}var ap=!1,fr=!1,G6=typeof WeakSet=="function"?WeakSet:Set,Ve=null;function cl(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){Cn(l,u,w)}else m.current=null}function fy(l,u,m){try{m()}catch(w){Cn(l,u,w)}}var mA=!1;function Y6(l,u){if(Ng=Nf,l=KC(),vg(l)){if("selectionStart"in l)var m={start:l.selectionStart,end:l.selectionEnd};else e:{m=(m=l.ownerDocument)&&m.defaultView||window;var w=m.getSelection&&m.getSelection();if(w&&w.rangeCount!==0){m=w.anchorNode;var C=w.anchorOffset,E=w.focusNode;w=w.focusOffset;try{m.nodeType,E.nodeType}catch{m=null;break e}var I=0,Y=-1,te=-1,pe=0,_e=0,Ee=l,Ce=null;t:for(;;){for(var Fe;Ee!==m||C!==0&&Ee.nodeType!==3||(Y=I+C),Ee!==E||w!==0&&Ee.nodeType!==3||(te=I+w),Ee.nodeType===3&&(I+=Ee.nodeValue.length),(Fe=Ee.firstChild)!==null;)Ce=Ee,Ee=Fe;for(;;){if(Ee===l)break t;if(Ce===m&&++pe===C&&(Y=I),Ce===E&&++_e===w&&(te=I),(Fe=Ee.nextSibling)!==null)break;Ee=Ce,Ce=Ee.parentNode}Ee=Fe}m=Y===-1||te===-1?null:{start:Y,end:te}}else m=null}m=m||{start:0,end:0}}else m=null;for(Cg={focusedElem:l,selectionRange:m},Nf=!1,Ve=u;Ve!==null;)if(u=Ve,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Ve=l;else for(;Ve!==null;){u=Ve;try{var Ge=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Ge!==null){var Xe=Ge.memoizedProps,En=Ge.memoizedState,ce=u.stateNode,ne=ce.getSnapshotBeforeUpdate(u.elementType===u.type?Xe:Ea(u.type,Xe),En);ce.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var de=u.stateNode.containerInfo;de.nodeType===1?de.textContent="":de.nodeType===9&&de.documentElement&&de.removeChild(de.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Te){Cn(u,u.return,Te)}if(l=u.sibling,l!==null){l.return=u.return,Ve=l;break}Ve=u.return}return Ge=mA,mA=!1,Ge}function yu(l,u,m){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var C=w=w.next;do{if((C.tag&l)===l){var E=C.destroy;C.destroy=void 0,E!==void 0&&fy(u,m,E)}C=C.next}while(C!==w)}}function sp(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 w=m.create;m.destroy=w()}m=m.next}while(m!==u)}}function py(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 vA(l){var u=l.alternate;u!==null&&(l.alternate=null,vA(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[Za],delete u[ou],delete u[Pg],delete u[k6],delete u[R6])),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 gA(l){return l.tag===5||l.tag===3||l.tag===4}function yA(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||gA(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 hy(l,u,m){var w=l.tag;if(w===5||w===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=$f));else if(w!==4&&(l=l.child,l!==null))for(hy(l,u,m),l=l.sibling;l!==null;)hy(l,u,m),l=l.sibling}function my(l,u,m){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?m.insertBefore(l,u):m.appendChild(l);else if(w!==4&&(l=l.child,l!==null))for(my(l,u,m),l=l.sibling;l!==null;)my(l,u,m),l=l.sibling}var nr=null,Pa=!1;function hi(l,u,m){for(m=m.child;m!==null;)xA(l,u,m),m=m.sibling}function xA(l,u,m){if(Fn&&typeof Fn.onCommitFiberUnmount=="function")try{Fn.onCommitFiberUnmount(Yt,m)}catch{}switch(m.tag){case 5:fr||cl(m,u);case 6:var w=nr,C=Pa;nr=null,hi(l,u,m),nr=w,Pa=C,nr!==null&&(Pa?(l=nr,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):nr.removeChild(m.stateNode));break;case 18:nr!==null&&(Pa?(l=nr,m=m.stateNode,l.nodeType===8?Eg(l.parentNode,m):l.nodeType===1&&Eg(l,m),Xc(l)):Eg(nr,m.stateNode));break;case 4:w=nr,C=Pa,nr=m.stateNode.containerInfo,Pa=!0,hi(l,u,m),nr=w,Pa=C;break;case 0:case 11:case 14:case 15:if(!fr&&(w=m.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){C=w=w.next;do{var E=C,I=E.destroy;E=E.tag,I!==void 0&&((E&2)!==0||(E&4)!==0)&&fy(m,u,I),C=C.next}while(C!==w)}hi(l,u,m);break;case 1:if(!fr&&(cl(m,u),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(Y){Cn(m,u,Y)}hi(l,u,m);break;case 21:hi(l,u,m);break;case 22:m.mode&1?(fr=(w=fr)||m.memoizedState!==null,hi(l,u,m),fr=w):hi(l,u,m);break;default:hi(l,u,m)}}function bA(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new G6),u.forEach(function(w){var C=aU.bind(null,l,w);m.has(w)||(m.add(w),w.then(C,C))})}}function Oa(l,u){var m=u.deletions;if(m!==null)for(var w=0;w<m.length;w++){var C=m[w];try{var E=l,I=u,Y=I;e:for(;Y!==null;){switch(Y.tag){case 5:nr=Y.stateNode,Pa=!1;break e;case 3:nr=Y.stateNode.containerInfo,Pa=!0;break e;case 4:nr=Y.stateNode.containerInfo,Pa=!0;break e}Y=Y.return}if(nr===null)throw Error(n(160));xA(E,I,C),nr=null,Pa=!1;var te=C.alternate;te!==null&&(te.return=null),C.return=null}catch(pe){Cn(C,u,pe)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)wA(u,l),u=u.sibling}function wA(l,u){var m=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Oa(u,l),ns(l),w&4){try{yu(3,l,l.return),sp(3,l)}catch(Xe){Cn(l,l.return,Xe)}try{yu(5,l,l.return)}catch(Xe){Cn(l,l.return,Xe)}}break;case 1:Oa(u,l),ns(l),w&512&&m!==null&&cl(m,m.return);break;case 5:if(Oa(u,l),ns(l),w&512&&m!==null&&cl(m,m.return),l.flags&32){var C=l.stateNode;try{Dt(C,"")}catch(Xe){Cn(l,l.return,Xe)}}if(w&4&&(C=l.stateNode,C!=null)){var E=l.memoizedProps,I=m!==null?m.memoizedProps:E,Y=l.type,te=l.updateQueue;if(l.updateQueue=null,te!==null)try{Y==="input"&&E.type==="radio"&&E.name!=null&&re(C,E),Dr(Y,I);var pe=Dr(Y,E);for(I=0;I<te.length;I+=2){var _e=te[I],Ee=te[I+1];_e==="style"?lr(C,Ee):_e==="dangerouslySetInnerHTML"?$t(C,Ee):_e==="children"?Dt(C,Ee):_(C,_e,Ee,pe)}switch(Y){case"input":me(C,E);break;case"textarea":hn(C,E);break;case"select":var Ce=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!E.multiple;var Fe=E.value;Fe!=null?et(C,!!E.multiple,Fe,!1):Ce!==!!E.multiple&&(E.defaultValue!=null?et(C,!!E.multiple,E.defaultValue,!0):et(C,!!E.multiple,E.multiple?[]:"",!1))}C[ou]=E}catch(Xe){Cn(l,l.return,Xe)}}break;case 6:if(Oa(u,l),ns(l),w&4){if(l.stateNode===null)throw Error(n(162));C=l.stateNode,E=l.memoizedProps;try{C.nodeValue=E}catch(Xe){Cn(l,l.return,Xe)}}break;case 3:if(Oa(u,l),ns(l),w&4&&m!==null&&m.memoizedState.isDehydrated)try{Xc(u.containerInfo)}catch(Xe){Cn(l,l.return,Xe)}break;case 4:Oa(u,l),ns(l);break;case 13:Oa(u,l),ns(l),C=l.child,C.flags&8192&&(E=C.memoizedState!==null,C.stateNode.isHidden=E,!E||C.alternate!==null&&C.alternate.memoizedState!==null||(yy=fe())),w&4&&bA(l);break;case 22:if(_e=m!==null&&m.memoizedState!==null,l.mode&1?(fr=(pe=fr)||_e,Oa(u,l),fr=pe):Oa(u,l),ns(l),w&8192){if(pe=l.memoizedState!==null,(l.stateNode.isHidden=pe)&&!_e&&(l.mode&1)!==0)for(Ve=l,_e=l.child;_e!==null;){for(Ee=Ve=_e;Ve!==null;){switch(Ce=Ve,Fe=Ce.child,Ce.tag){case 0:case 11:case 14:case 15:yu(4,Ce,Ce.return);break;case 1:cl(Ce,Ce.return);var Ge=Ce.stateNode;if(typeof Ge.componentWillUnmount=="function"){w=Ce,m=Ce.return;try{u=w,Ge.props=u.memoizedProps,Ge.state=u.memoizedState,Ge.componentWillUnmount()}catch(Xe){Cn(w,m,Xe)}}break;case 5:cl(Ce,Ce.return);break;case 22:if(Ce.memoizedState!==null){NA(Ee);continue}}Fe!==null?(Fe.return=Ce,Ve=Fe):NA(Ee)}_e=_e.sibling}e:for(_e=null,Ee=l;;){if(Ee.tag===5){if(_e===null){_e=Ee;try{C=Ee.stateNode,pe?(E=C.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(Y=Ee.stateNode,te=Ee.memoizedProps.style,I=te!=null&&te.hasOwnProperty("display")?te.display:null,Y.style.display=or("display",I))}catch(Xe){Cn(l,l.return,Xe)}}}else if(Ee.tag===6){if(_e===null)try{Ee.stateNode.nodeValue=pe?"":Ee.memoizedProps}catch(Xe){Cn(l,l.return,Xe)}}else if((Ee.tag!==22&&Ee.tag!==23||Ee.memoizedState===null||Ee===l)&&Ee.child!==null){Ee.child.return=Ee,Ee=Ee.child;continue}if(Ee===l)break e;for(;Ee.sibling===null;){if(Ee.return===null||Ee.return===l)break e;_e===Ee&&(_e=null),Ee=Ee.return}_e===Ee&&(_e=null),Ee.sibling.return=Ee.return,Ee=Ee.sibling}}break;case 19:Oa(u,l),ns(l),w&4&&bA(l);break;case 21:break;default:Oa(u,l),ns(l)}}function ns(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(gA(m)){var w=m;break e}m=m.return}throw Error(n(160))}switch(w.tag){case 5:var C=w.stateNode;w.flags&32&&(Dt(C,""),w.flags&=-33);var E=yA(l);my(l,E,C);break;case 3:case 4:var I=w.stateNode.containerInfo,Y=yA(l);hy(l,Y,I);break;default:throw Error(n(161))}}catch(te){Cn(l,l.return,te)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function X6(l,u,m){Ve=l,SA(l)}function SA(l,u,m){for(var w=(l.mode&1)!==0;Ve!==null;){var C=Ve,E=C.child;if(C.tag===22&&w){var I=C.memoizedState!==null||ap;if(!I){var Y=C.alternate,te=Y!==null&&Y.memoizedState!==null||fr;Y=ap;var pe=fr;if(ap=I,(fr=te)&&!pe)for(Ve=C;Ve!==null;)I=Ve,te=I.child,I.tag===22&&I.memoizedState!==null?CA(C):te!==null?(te.return=I,Ve=te):CA(C);for(;E!==null;)Ve=E,SA(E),E=E.sibling;Ve=C,ap=Y,fr=pe}jA(l)}else(C.subtreeFlags&8772)!==0&&E!==null?(E.return=C,Ve=E):jA(l)}}function jA(l){for(;Ve!==null;){var u=Ve;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:fr||sp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!fr)if(m===null)w.componentDidMount();else{var C=u.elementType===u.type?m.memoizedProps:Ea(u.type,m.memoizedProps);w.componentDidUpdate(C,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var E=u.updateQueue;E!==null&&N_(u,E,w);break;case 3:var I=u.updateQueue;if(I!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}N_(u,I,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 pe=u.alternate;if(pe!==null){var _e=pe.memoizedState;if(_e!==null){var Ee=_e.dehydrated;Ee!==null&&Xc(Ee)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}fr||u.flags&512&&py(u)}catch(Ce){Cn(u,u.return,Ce)}}if(u===l){Ve=null;break}if(m=u.sibling,m!==null){m.return=u.return,Ve=m;break}Ve=u.return}}function NA(l){for(;Ve!==null;){var u=Ve;if(u===l){Ve=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Ve=m;break}Ve=u.return}}function CA(l){for(;Ve!==null;){var u=Ve;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{sp(4,u)}catch(te){Cn(u,m,te)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var C=u.return;try{w.componentDidMount()}catch(te){Cn(u,C,te)}}var E=u.return;try{py(u)}catch(te){Cn(u,E,te)}break;case 5:var I=u.return;try{py(u)}catch(te){Cn(u,I,te)}}}catch(te){Cn(u,u.return,te)}if(u===l){Ve=null;break}var Y=u.sibling;if(Y!==null){Y.return=u.return,Ve=Y;break}Ve=u.return}}var Q6=Math.ceil,ip=P.ReactCurrentDispatcher,vy=P.ReactCurrentOwner,oa=P.ReactCurrentBatchConfig,kt=0,Qn=null,In=null,rr=0,Ur=0,ul=ci(0),zn=0,xu=null,Zi=0,op=0,gy=0,bu=null,Or=null,yy=0,dl=1/0,Es=null,lp=!1,xy=null,mi=null,cp=!1,vi=null,up=0,wu=0,by=null,dp=-1,fp=0;function yr(){return(kt&6)!==0?fe():dp!==-1?dp:dp=fe()}function gi(l){return(l.mode&1)===0?1:(kt&2)!==0&&rr!==0?rr&-rr:I6.transition!==null?(fp===0&&(fp=yC()),fp):(l=Ut,l!==0||(l=window.event,l=l===void 0?16:AC(l.type)),l)}function ka(l,u,m,w){if(50<wu)throw wu=0,by=null,Error(n(185));Vc(l,m,w),((kt&2)===0||l!==Qn)&&(l===Qn&&((kt&2)===0&&(op|=m),zn===4&&yi(l,rr)),kr(l,w),m===1&&kt===0&&(u.mode&1)===0&&(dl=fe()+500,Bf&&di()))}function kr(l,u){var m=l.callbackNode;Iz(l,u);var w=wf(l,l===Qn?rr:0);if(w===0)m!==null&&Gt(m),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(m!=null&&Gt(m),u===1)l.tag===0?T6(AA.bind(null,l)):f_(AA.bind(null,l)),P6(function(){(kt&6)===0&&di()}),m=null;else{switch(xC(w)){case 1:m=Re;break;case 4:m=Ot;break;case 16:m=Nt;break;case 536870912:m=Ja;break;default:m=Nt}m=MA(m,_A.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function _A(l,u){if(dp=-1,fp=0,(kt&6)!==0)throw Error(n(327));var m=l.callbackNode;if(fl()&&l.callbackNode!==m)return null;var w=wf(l,l===Qn?rr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=pp(l,w);else{u=w;var C=kt;kt|=2;var E=PA();(Qn!==l||rr!==u)&&(Es=null,dl=fe()+500,to(l,u));do try{eU();break}catch(Y){EA(l,Y)}while(!0);Lg(),ip.current=E,kt=C,In!==null?u=0:(Qn=null,rr=0,u=zn)}if(u!==0){if(u===2&&(C=eg(l),C!==0&&(w=C,u=wy(l,C))),u===1)throw m=xu,to(l,0),yi(l,w),kr(l,fe()),m;if(u===6)yi(l,w);else{if(C=l.current.alternate,(w&30)===0&&!J6(C)&&(u=pp(l,w),u===2&&(E=eg(l),E!==0&&(w=E,u=wy(l,E))),u===1))throw m=xu,to(l,0),yi(l,w),kr(l,fe()),m;switch(l.finishedWork=C,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:no(l,Or,Es);break;case 3:if(yi(l,w),(w&130023424)===w&&(u=yy+500-fe(),10<u)){if(wf(l,0)!==0)break;if(C=l.suspendedLanes,(C&w)!==w){yr(),l.pingedLanes|=l.suspendedLanes&C;break}l.timeoutHandle=Ag(no.bind(null,l,Or,Es),u);break}no(l,Or,Es);break;case 4:if(yi(l,w),(w&4194240)===w)break;for(u=l.eventTimes,C=-1;0<w;){var I=31-Lr(w);E=1<<I,I=u[I],I>C&&(C=I),w&=~E}if(w=C,w=fe()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*Q6(w/1960))-w,10<w){l.timeoutHandle=Ag(no.bind(null,l,Or,Es),w);break}no(l,Or,Es);break;case 5:no(l,Or,Es);break;default:throw Error(n(329))}}}return kr(l,fe()),l.callbackNode===m?_A.bind(null,l):null}function wy(l,u){var m=bu;return l.current.memoizedState.isDehydrated&&(to(l,u).flags|=256),l=pp(l,u),l!==2&&(u=Or,Or=m,u!==null&&Sy(u)),l}function Sy(l){Or===null?Or=l:Or.push.apply(Or,l)}function J6(l){for(var u=l;;){if(u.flags&16384){var m=u.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var w=0;w<m.length;w++){var C=m[w],E=C.getSnapshot;C=C.value;try{if(!_a(E(),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 yi(l,u){for(u&=~gy,u&=~op,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-Lr(u),w=1<<m;l[m]=-1,u&=~w}}function AA(l){if((kt&6)!==0)throw Error(n(327));fl();var u=wf(l,0);if((u&1)===0)return kr(l,fe()),null;var m=pp(l,u);if(l.tag!==0&&m===2){var w=eg(l);w!==0&&(u=w,m=wy(l,w))}if(m===1)throw m=xu,to(l,0),yi(l,u),kr(l,fe()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,no(l,Or,Es),kr(l,fe()),null}function jy(l,u){var m=kt;kt|=1;try{return l(u)}finally{kt=m,kt===0&&(dl=fe()+500,Bf&&di())}}function eo(l){vi!==null&&vi.tag===0&&(kt&6)===0&&fl();var u=kt;kt|=1;var m=oa.transition,w=Ut;try{if(oa.transition=null,Ut=1,l)return l()}finally{Ut=w,oa.transition=m,kt=u,(kt&6)===0&&di()}}function Ny(){Ur=ul.current,dn(ul)}function to(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,E6(m)),In!==null)for(m=In.return;m!==null;){var w=m;switch(Tg(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Lf();break;case 3:ol(),dn(Ar),dn(cr),Hg();break;case 5:Wg(w);break;case 4:ol();break;case 13:dn(bn);break;case 19:dn(bn);break;case 10:Fg(w.type._context);break;case 22:case 23:Ny()}m=m.return}if(Qn=l,In=l=xi(l.current,null),rr=Ur=u,zn=0,xu=null,gy=op=Zi=0,Or=bu=null,Xi!==null){for(u=0;u<Xi.length;u++)if(m=Xi[u],w=m.interleaved,w!==null){m.interleaved=null;var C=w.next,E=m.pending;if(E!==null){var I=E.next;E.next=C,w.next=I}m.pending=w}Xi=null}return l}function EA(l,u){do{var m=In;try{if(Lg(),Xf.current=ep,Qf){for(var w=wn.memoizedState;w!==null;){var C=w.queue;C!==null&&(C.pending=null),w=w.next}Qf=!1}if(Ji=0,Xn=Bn=wn=null,pu=!1,hu=0,vy.current=null,m===null||m.return===null){zn=1,xu=u,In=null;break}e:{var E=l,I=m.return,Y=m,te=u;if(u=rr,Y.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var pe=te,_e=Y,Ee=_e.tag;if((_e.mode&1)===0&&(Ee===0||Ee===11||Ee===15)){var Ce=_e.alternate;Ce?(_e.updateQueue=Ce.updateQueue,_e.memoizedState=Ce.memoizedState,_e.lanes=Ce.lanes):(_e.updateQueue=null,_e.memoizedState=null)}var Fe=Z_(I);if(Fe!==null){Fe.flags&=-257,eA(Fe,I,Y,E,u),Fe.mode&1&&J_(E,pe,u),u=Fe,te=pe;var Ge=u.updateQueue;if(Ge===null){var Xe=new Set;Xe.add(te),u.updateQueue=Xe}else Ge.add(te);break e}else{if((u&1)===0){J_(E,pe,u),Cy();break e}te=Error(n(426))}}else if(gn&&Y.mode&1){var En=Z_(I);if(En!==null){(En.flags&65536)===0&&(En.flags|=256),eA(En,I,Y,E,u),$g(ll(te,Y));break e}}E=te=ll(te,Y),zn!==4&&(zn=2),bu===null?bu=[E]:bu.push(E),E=I;do{switch(E.tag){case 3:E.flags|=65536,u&=-u,E.lanes|=u;var ce=X_(E,te,u);j_(E,ce);break e;case 1:Y=te;var ne=E.type,de=E.stateNode;if((E.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||de!==null&&typeof de.componentDidCatch=="function"&&(mi===null||!mi.has(de)))){E.flags|=65536,u&=-u,E.lanes|=u;var Te=Q_(E,Y,u);j_(E,Te);break e}}E=E.return}while(E!==null)}kA(m)}catch(Je){u=Je,In===m&&m!==null&&(In=m=m.return);continue}break}while(!0)}function PA(){var l=ip.current;return ip.current=ep,l===null?ep:l}function Cy(){(zn===0||zn===3||zn===2)&&(zn=4),Qn===null||(Zi&268435455)===0&&(op&268435455)===0||yi(Qn,rr)}function pp(l,u){var m=kt;kt|=2;var w=PA();(Qn!==l||rr!==u)&&(Es=null,to(l,u));do try{Z6();break}catch(C){EA(l,C)}while(!0);if(Lg(),kt=m,ip.current=w,In!==null)throw Error(n(261));return Qn=null,rr=0,zn}function Z6(){for(;In!==null;)OA(In)}function eU(){for(;In!==null&&!An();)OA(In)}function OA(l){var u=IA(l.alternate,l,Ur);l.memoizedProps=l.pendingProps,u===null?kA(l):In=u,vy.current=null}function kA(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=H6(m,u,Ur),m!==null){In=m;return}}else{if(m=K6(m,u),m!==null){m.flags&=32767,In=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{zn=6,In=null;return}}if(u=u.sibling,u!==null){In=u;return}In=u=l}while(u!==null);zn===0&&(zn=5)}function no(l,u,m){var w=Ut,C=oa.transition;try{oa.transition=null,Ut=1,tU(l,u,m,w)}finally{oa.transition=C,Ut=w}return null}function tU(l,u,m,w){do fl();while(vi!==null);if((kt&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 E=m.lanes|m.childLanes;if(Mz(l,E),l===Qn&&(In=Qn=null,rr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||cp||(cp=!0,MA(Nt,function(){return fl(),null})),E=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||E){E=oa.transition,oa.transition=null;var I=Ut;Ut=1;var Y=kt;kt|=4,vy.current=null,Y6(l,m),wA(m,l),w6(Cg),Nf=!!Ng,Cg=Ng=null,l.current=m,X6(m),G(),kt=Y,Ut=I,oa.transition=E}else l.current=m;if(cp&&(cp=!1,vi=l,up=C),E=l.pendingLanes,E===0&&(mi=null),yf(m.stateNode),kr(l,fe()),u!==null)for(w=l.onRecoverableError,m=0;m<u.length;m++)C=u[m],w(C.value,{componentStack:C.stack,digest:C.digest});if(lp)throw lp=!1,l=xy,xy=null,l;return(up&1)!==0&&l.tag!==0&&fl(),E=l.pendingLanes,(E&1)!==0?l===by?wu++:(wu=0,by=l):wu=0,di(),null}function fl(){if(vi!==null){var l=xC(up),u=oa.transition,m=Ut;try{if(oa.transition=null,Ut=16>l?16:l,vi===null)var w=!1;else{if(l=vi,vi=null,up=0,(kt&6)!==0)throw Error(n(331));var C=kt;for(kt|=4,Ve=l.current;Ve!==null;){var E=Ve,I=E.child;if((Ve.flags&16)!==0){var Y=E.deletions;if(Y!==null){for(var te=0;te<Y.length;te++){var pe=Y[te];for(Ve=pe;Ve!==null;){var _e=Ve;switch(_e.tag){case 0:case 11:case 15:yu(8,_e,E)}var Ee=_e.child;if(Ee!==null)Ee.return=_e,Ve=Ee;else for(;Ve!==null;){_e=Ve;var Ce=_e.sibling,Fe=_e.return;if(vA(_e),_e===pe){Ve=null;break}if(Ce!==null){Ce.return=Fe,Ve=Ce;break}Ve=Fe}}}var Ge=E.alternate;if(Ge!==null){var Xe=Ge.child;if(Xe!==null){Ge.child=null;do{var En=Xe.sibling;Xe.sibling=null,Xe=En}while(Xe!==null)}}Ve=E}}if((E.subtreeFlags&2064)!==0&&I!==null)I.return=E,Ve=I;else e:for(;Ve!==null;){if(E=Ve,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:yu(9,E,E.return)}var ce=E.sibling;if(ce!==null){ce.return=E.return,Ve=ce;break e}Ve=E.return}}var ne=l.current;for(Ve=ne;Ve!==null;){I=Ve;var de=I.child;if((I.subtreeFlags&2064)!==0&&de!==null)de.return=I,Ve=de;else e:for(I=ne;Ve!==null;){if(Y=Ve,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:sp(9,Y)}}catch(Je){Cn(Y,Y.return,Je)}if(Y===I){Ve=null;break e}var Te=Y.sibling;if(Te!==null){Te.return=Y.return,Ve=Te;break e}Ve=Y.return}}if(kt=C,di(),Fn&&typeof Fn.onPostCommitFiberRoot=="function")try{Fn.onPostCommitFiberRoot(Yt,l)}catch{}w=!0}return w}finally{Ut=m,oa.transition=u}}return!1}function RA(l,u,m){u=ll(m,u),u=X_(l,u,1),l=pi(l,u,1),u=yr(),l!==null&&(Vc(l,1,u),kr(l,u))}function Cn(l,u,m){if(l.tag===3)RA(l,l,m);else for(;u!==null;){if(u.tag===3){RA(u,l,m);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(mi===null||!mi.has(w))){l=ll(m,l),l=Q_(u,l,1),u=pi(u,l,1),l=yr(),u!==null&&(Vc(u,1,l),kr(u,l));break}}u=u.return}}function nU(l,u,m){var w=l.pingCache;w!==null&&w.delete(u),u=yr(),l.pingedLanes|=l.suspendedLanes&m,Qn===l&&(rr&m)===m&&(zn===4||zn===3&&(rr&130023424)===rr&&500>fe()-yy?to(l,0):gy|=m),kr(l,u)}function TA(l,u){u===0&&((l.mode&1)===0?u=1:(u=bf,bf<<=1,(bf&130023424)===0&&(bf=4194304)));var m=yr();l=Cs(l,u),l!==null&&(Vc(l,u,m),kr(l,m))}function rU(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),TA(l,m)}function aU(l,u){var m=0;switch(l.tag){case 13:var w=l.stateNode,C=l.memoizedState;C!==null&&(m=C.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),TA(l,m)}var IA;IA=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||Ar.current)Pr=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return Pr=!1,V6(l,u,m);Pr=(l.flags&131072)!==0}else Pr=!1,gn&&(u.flags&1048576)!==0&&p_(u,Uf,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;rp(l,u),l=u.pendingProps;var C=el(u,cr.current);il(u,m),C=Yg(null,u,w,l,C,m);var E=Xg();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,Er(w)?(E=!0,Ff(u)):E=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Ug(u),C.updater=tp,u.stateNode=C,C._reactInternals=u,ny(u,w,l,m),u=iy(null,u,w,!0,E,m)):(u.tag=0,gn&&E&&Rg(u),gr(null,u,C,m),u=u.child),u;case 16:w=u.elementType;e:{switch(rp(l,u),l=u.pendingProps,C=w._init,w=C(w._payload),u.type=w,C=u.tag=iU(w),l=Ea(w,l),C){case 0:u=sy(null,u,w,l,m);break e;case 1:u=iA(null,u,w,l,m);break e;case 11:u=tA(null,u,w,l,m);break e;case 14:u=nA(null,u,w,Ea(w.type,l),m);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ea(w,C),sy(l,u,w,C,m);case 1:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ea(w,C),iA(l,u,w,C,m);case 3:e:{if(oA(u),l===null)throw Error(n(387));w=u.pendingProps,E=u.memoizedState,C=E.element,S_(l,u),Gf(u,w,null,m);var I=u.memoizedState;if(w=I.element,E.isDehydrated)if(E={element:w,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},u.updateQueue.baseState=E,u.memoizedState=E,u.flags&256){C=ll(Error(n(423)),u),u=lA(l,u,w,m,C);break e}else if(w!==C){C=ll(Error(n(424)),u),u=lA(l,u,w,m,C);break e}else for(zr=li(u.stateNode.containerInfo.firstChild),Br=u,gn=!0,Aa=null,m=b_(u,null,w,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(rl(),w===C){u=As(l,u,m);break e}gr(l,u,w,m)}u=u.child}return u;case 5:return C_(u),l===null&&Mg(u),w=u.type,C=u.pendingProps,E=l!==null?l.memoizedProps:null,I=C.children,_g(w,C)?I=null:E!==null&&_g(w,E)&&(u.flags|=32),sA(l,u),gr(l,u,I,m),u.child;case 6:return l===null&&Mg(u),null;case 13:return cA(l,u,m);case 4:return qg(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=al(u,null,w,m):gr(l,u,w,m),u.child;case 11:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ea(w,C),tA(l,u,w,C,m);case 7:return gr(l,u,u.pendingProps,m),u.child;case 8:return gr(l,u,u.pendingProps.children,m),u.child;case 12:return gr(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(w=u.type._context,C=u.pendingProps,E=u.memoizedProps,I=C.value,nn(Vf,w._currentValue),w._currentValue=I,E!==null)if(_a(E.value,I)){if(E.children===C.children&&!Ar.current){u=As(l,u,m);break e}}else for(E=u.child,E!==null&&(E.return=u);E!==null;){var Y=E.dependencies;if(Y!==null){I=E.child;for(var te=Y.firstContext;te!==null;){if(te.context===w){if(E.tag===1){te=_s(-1,m&-m),te.tag=2;var pe=E.updateQueue;if(pe!==null){pe=pe.shared;var _e=pe.pending;_e===null?te.next=te:(te.next=_e.next,_e.next=te),pe.pending=te}}E.lanes|=m,te=E.alternate,te!==null&&(te.lanes|=m),Bg(E.return,m,u),Y.lanes|=m;break}te=te.next}}else if(E.tag===10)I=E.type===u.type?null:E.child;else if(E.tag===18){if(I=E.return,I===null)throw Error(n(341));I.lanes|=m,Y=I.alternate,Y!==null&&(Y.lanes|=m),Bg(I,m,u),I=E.sibling}else I=E.child;if(I!==null)I.return=E;else for(I=E;I!==null;){if(I===u){I=null;break}if(E=I.sibling,E!==null){E.return=I.return,I=E;break}I=I.return}E=I}gr(l,u,C.children,m),u=u.child}return u;case 9:return C=u.type,w=u.pendingProps.children,il(u,m),C=sa(C),w=w(C),u.flags|=1,gr(l,u,w,m),u.child;case 14:return w=u.type,C=Ea(w,u.pendingProps),C=Ea(w.type,C),nA(l,u,w,C,m);case 15:return rA(l,u,u.type,u.pendingProps,m);case 17:return w=u.type,C=u.pendingProps,C=u.elementType===w?C:Ea(w,C),rp(l,u),u.tag=1,Er(w)?(l=!0,Ff(u)):l=!1,il(u,m),G_(u,w,C),ny(u,w,C,m),iy(null,u,w,!0,l,m);case 19:return dA(l,u,m);case 22:return aA(l,u,m)}throw Error(n(156,u.tag))};function MA(l,u){return Ln(l,u)}function sU(l,u,m,w){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=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function la(l,u,m,w){return new sU(l,u,m,w)}function _y(l){return l=l.prototype,!(!l||!l.isReactComponent)}function iU(l){if(typeof l=="function")return _y(l)?1:0;if(l!=null){if(l=l.$$typeof,l===D)return 11;if(l===V)return 14}return 2}function xi(l,u){var m=l.alternate;return m===null?(m=la(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 hp(l,u,m,w,C,E){var I=2;if(w=l,typeof l=="function")_y(l)&&(I=1);else if(typeof l=="string")I=5;else e:switch(l){case k:return ro(m.children,C,E,u);case R:I=8,C|=8;break;case $:return l=la(12,m,u,C|2),l.elementType=$,l.lanes=E,l;case K:return l=la(13,m,u,C),l.elementType=K,l.lanes=E,l;case U:return l=la(19,m,u,C),l.elementType=U,l.lanes=E,l;case Z:return mp(m,C,E,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case z:I=10;break e;case B:I=9;break e;case D:I=11;break e;case V:I=14;break e;case X:I=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=la(I,m,u,C),u.elementType=l,u.type=w,u.lanes=E,u}function ro(l,u,m,w){return l=la(7,l,w,u),l.lanes=m,l}function mp(l,u,m,w){return l=la(22,l,w,u),l.elementType=Z,l.lanes=m,l.stateNode={isHidden:!1},l}function Ay(l,u,m){return l=la(6,l,null,u),l.lanes=m,l}function Ey(l,u,m){return u=la(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function oU(l,u,m,w,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=tg(0),this.expirationTimes=tg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tg(0),this.identifierPrefix=w,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function Py(l,u,m,w,C,E,I,Y,te){return l=new oU(l,u,m,Y,te),u===1?(u=1,E===!0&&(u|=8)):u=0,E=la(3,null,null,u),l.current=E,E.stateNode=l,E.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ug(E),l}function lU(l,u,m){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:w==null?null:""+w,children:l,containerInfo:u,implementation:m}}function $A(l){if(!l)return ui;l=l._reactInternals;e:{if(Ze(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(Er(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(Er(m))return u_(l,m,u)}return u}function DA(l,u,m,w,C,E,I,Y,te){return l=Py(m,w,!0,l,C,E,I,Y,te),l.context=$A(null),m=l.current,w=yr(),C=gi(m),E=_s(w,C),E.callback=u??null,pi(m,E,C),l.current.lanes=C,Vc(l,C,w),kr(l,w),l}function vp(l,u,m,w){var C=u.current,E=yr(),I=gi(C);return m=$A(m),u.context===null?u.context=m:u.pendingContext=m,u=_s(E,I),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=pi(C,u,I),l!==null&&(ka(l,C,I,E),Kf(l,C,I)),I}function gp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function LA(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function Oy(l,u){LA(l,u),(l=l.alternate)&&LA(l,u)}function cU(){return null}var FA=typeof reportError=="function"?reportError:function(l){console.error(l)};function ky(l){this._internalRoot=l}yp.prototype.render=ky.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));vp(l,u,null,null)},yp.prototype.unmount=ky.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;eo(function(){vp(null,l,null,null)}),u[ws]=null}};function yp(l){this._internalRoot=l}yp.prototype.unstable_scheduleHydration=function(l){if(l){var u=SC();l={blockedOn:null,target:l,priority:u};for(var m=0;m<si.length&&u!==0&&u<si[m].priority;m++);si.splice(m,0,l),m===0&&CC(l)}};function Ry(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function xp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function BA(){}function uU(l,u,m,w,C){if(C){if(typeof w=="function"){var E=w;w=function(){var pe=gp(I);E.call(pe)}}var I=DA(u,w,l,0,null,!1,!1,"",BA);return l._reactRootContainer=I,l[ws]=I.current,su(l.nodeType===8?l.parentNode:l),eo(),I}for(;C=l.lastChild;)l.removeChild(C);if(typeof w=="function"){var Y=w;w=function(){var pe=gp(te);Y.call(pe)}}var te=Py(l,0,!1,null,null,!1,!1,"",BA);return l._reactRootContainer=te,l[ws]=te.current,su(l.nodeType===8?l.parentNode:l),eo(function(){vp(u,te,m,w)}),te}function bp(l,u,m,w,C){var E=m._reactRootContainer;if(E){var I=E;if(typeof C=="function"){var Y=C;C=function(){var te=gp(I);Y.call(te)}}vp(u,I,l,C)}else I=uU(m,u,l,C,w);return gp(I)}bC=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=Wc(u.pendingLanes);m!==0&&(ng(u,m|1),kr(u,fe()),(kt&6)===0&&(dl=fe()+500,di()))}break;case 13:eo(function(){var w=Cs(l,1);if(w!==null){var C=yr();ka(w,l,1,C)}}),Oy(l,1)}},rg=function(l){if(l.tag===13){var u=Cs(l,134217728);if(u!==null){var m=yr();ka(u,l,134217728,m)}Oy(l,134217728)}},wC=function(l){if(l.tag===13){var u=gi(l),m=Cs(l,u);if(m!==null){var w=yr();ka(m,l,u,w)}Oy(l,u)}},SC=function(){return Ut},jC=function(l,u){var m=Ut;try{return Ut=l,u()}finally{Ut=m}},kn=function(l,u,m){switch(u){case"input":if(me(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 w=m[u];if(w!==l&&w.form===l.form){var C=Df(w);if(!C)throw Error(n(90));oe(w),me(w,C)}}}break;case"textarea":hn(l,m);break;case"select":u=m.value,u!=null&&et(l,!!m.multiple,u,!1)}},it=jy,vt=eo;var dU={usingClientEntryPoint:!1,Events:[lu,Jo,Df,le,ke,jy]},Su={findFiberByHostInstance:Hi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fU={bundleType:Su.bundleType,version:Su.version,rendererPackageName:Su.rendererPackageName,rendererConfig:Su.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=We(l),l===null?null:l.stateNode},findFiberByHostInstance:Su.findFiberByHostInstance||cU,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 wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wp.isDisabled&&wp.supportsFiber)try{Yt=wp.inject(fU),Fn=wp}catch{}}return Rr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dU,Rr.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ry(u))throw Error(n(200));return lU(l,u,null,m)},Rr.createRoot=function(l,u){if(!Ry(l))throw Error(n(299));var m=!1,w="",C=FA;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),u=Py(l,1,!1,null,null,m,!1,w,C),l[ws]=u.current,su(l.nodeType===8?l.parentNode:l),new ky(u)},Rr.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=We(u),l=l===null?null:l.stateNode,l},Rr.flushSync=function(l){return eo(l)},Rr.hydrate=function(l,u,m){if(!xp(u))throw Error(n(200));return bp(null,l,u,!0,m)},Rr.hydrateRoot=function(l,u,m){if(!Ry(l))throw Error(n(405));var w=m!=null&&m.hydratedSources||null,C=!1,E="",I=FA;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(E=m.identifierPrefix),m.onRecoverableError!==void 0&&(I=m.onRecoverableError)),u=DA(u,null,l,1,m??null,C,!1,E,I),l[ws]=u.current,su(l),w)for(l=0;l<w.length;l++)m=w[l],C=m._getVersion,C=C(m._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[m,C]:u.mutableSourceEagerHydrationData.push(m,C);return new yp(u)},Rr.render=function(l,u,m){if(!xp(u))throw Error(n(200));return bp(null,l,u,!1,m)},Rr.unmountComponentAtNode=function(l){if(!xp(l))throw Error(n(40));return l._reactRootContainer?(eo(function(){bp(null,null,l,!1,function(){l._reactRootContainer=null,l[ws]=null})}),!0):!1},Rr.unstable_batchedUpdates=jy,Rr.unstable_renderSubtreeIntoContainer=function(l,u,m,w){if(!xp(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return bp(l,u,m,!1,w)},Rr.version="18.3.1-next-f1338f8080-20240426",Rr}var GA;function CM(){if(GA)return My.exports;GA=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(),My.exports=bU(),My.exports}var YA;function wU(){if(YA)return jp;YA=1;var e=CM();return jp.createRoot=e.createRoot,jp.hydrateRoot=e.hydrateRoot,jp}var SU=wU(),v=vj();const q=Wt(v),wm=hU({__proto__:null,default:q},[v]),jU=1,NU=1e6;let Ly=0;function CU(){return Ly=(Ly+1)%Number.MAX_SAFE_INTEGER,Ly.toString()}const Fy=new Map,XA=e=>{if(Fy.has(e))return;const t=setTimeout(()=>{Fy.delete(e),Wu({type:"REMOVE_TOAST",toastId:e})},NU);Fy.set(e,t)},_U=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,jU)};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?XA(n):e.toasts.forEach(r=>{XA(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)}}},Gp=[];let Yp={toasts:[]};function Wu(e){Yp=_U(Yp,e),Gp.forEach(t=>{t(Yp)})}function Pe({...e}){const t=CU(),n=a=>Wu({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Wu({type:"DISMISS_TOAST",toastId:t});return Wu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function AU(){const[e,t]=v.useState(Yp);return v.useEffect(()=>(Gp.push(t),()=>{const n=Gp.indexOf(t);n>-1&&Gp.splice(n,1)}),[e]),{...e,toast:Pe,dismiss:n=>Wu({type:"DISMISS_TOAST",toastId:n})}}var wc=CM();const _M=Wt(wc);function Ae(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function QA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=QA(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():QA(e[a],null)}}}}function ut(...e){return v.useCallback(jr(...e),e)}function EU(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 ir(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:y,children:g,...S}=p,b=y?.[e]?.[d]||c,x=v.useMemo(()=>S,Object.values(S));return s.jsx(b.Provider,{value:x,children:g})};f.displayName=i+"Provider";function h(p,y){const g=y?.[e]?.[d]||c,S=v.useContext(g);if(S)return S;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,PU(a,...t)]}function PU(...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 JA(e){const t=OU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(RU);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 OU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=IU(a),c=TU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(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 kU=Symbol("radix.slottable");function RU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kU}function TU(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 IU(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 Hd(e){const t=e+"CollectionProvider",[n,r]=ir(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:x,children:j}=b,N=q.useRef(null),_=q.useRef(new Map).current;return s.jsx(a,{scope:x,itemMap:_,collectionRef:N,children:j})};o.displayName=t;const c=e+"CollectionSlot",d=JA(c),f=q.forwardRef((b,x)=>{const{scope:j,children:N}=b,_=i(c,j),P=ut(x,_.collectionRef);return s.jsx(d,{ref:P,children:N})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",y=JA(h),g=q.forwardRef((b,x)=>{const{scope:j,children:N,..._}=b,P=q.useRef(null),A=ut(x,P),O=i(h,j);return q.useEffect(()=>(O.itemMap.set(P,{ref:P,..._}),()=>{O.itemMap.delete(P)})),s.jsx(y,{[p]:"",ref:A,children:N})});g.displayName=h;function S(b){const x=i(e+"CollectionConsumer",b);return q.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const _=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((O,k)=>_.indexOf(O.ref.current)-_.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:f,ItemSlot:g},S,r]}function MU(e){const t=$U(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(LU);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 $U(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=BU(a),c=FU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(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 DU=Symbol("radix.slottable");function LU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DU}function FU(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 BU(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 zU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],De=zU.reduce((e,t)=>{const n=MU(`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 gj(e,t){e&&wc.flushSync(()=>e.dispatchEvent(t))}function Pn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function UU(e,t=globalThis?.document){const n=Pn(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 qU="DismissableLayer",c1="dismissableLayer.update",WU="dismissableLayer.pointerDownOutside",VU="dismissableLayer.focusOutside",ZA,AM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),To=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(AM),[h,p]=v.useState(null),y=h?.ownerDocument??globalThis?.document,[,g]=v.useState({}),S=ut(t,k=>p(k)),b=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),j=b.indexOf(x),N=h?b.indexOf(h):-1,_=f.layersWithOutsidePointerEventsDisabled.size>0,P=N>=j,A=KU(k=>{const R=k.target,$=[...f.branches].some(z=>z.contains(R));!P||$||(a?.(k),o?.(k),k.defaultPrevented||c?.())},y),O=GU(k=>{const R=k.target;[...f.branches].some(z=>z.contains(R))||(i?.(k),o?.(k),k.defaultPrevented||c?.())},y);return UU(k=>{N===f.layers.size-1&&(r?.(k),!k.defaultPrevented&&c&&(k.preventDefault(),c()))},y),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ZA=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),eE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=ZA)}},[h,y,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),eE())},[h,f]),v.useEffect(()=>{const k=()=>g({});return document.addEventListener(c1,k),()=>document.removeEventListener(c1,k)},[]),s.jsx(De.div,{...d,ref:S,style:{pointerEvents:_?P?"auto":"none":void 0,...e.style},onFocusCapture:Ae(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ae(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ae(e.onPointerDownCapture,A.onPointerDownCapture)})});To.displayName=qU;var HU="DismissableLayerBranch",EM=v.forwardRef((e,t)=>{const n=v.useContext(AM),r=v.useRef(null),a=ut(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(De.div,{...e,ref:a})});EM.displayName=HU;function KU(e,t=globalThis?.document){const n=Pn(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){PM(WU,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 GU(e,t=globalThis?.document){const n=Pn(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&PM(VU,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 eE(){const e=new CustomEvent(c1);document.dispatchEvent(e)}function PM(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?gj(a,i):a.dispatchEvent(i)}var YU=To,XU=EM,Kn=globalThis?.document?v.useLayoutEffect:()=>{},QU="Portal",Sc=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=v.useState(!1);Kn(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?_M.createPortal(s.jsx(De.div,{...r,ref:t}),o):null});Sc.displayName=QU;function JU(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Gn=e=>{const{present:t,children:n}=e,r=ZU(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=ut(r.ref,e7(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};Gn.displayName="Presence";function ZU(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=JU(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Np(r.current);i.current=c==="mounted"?f:"none"},[c]),Kn(()=>{const f=r.current,h=a.current;if(h!==e){const y=i.current,g=Np(f);e?d("MOUNT"):g==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&y!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Kn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=Np(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(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)})}},y=g=>{g.target===t&&(i.current=Np(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",y),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 Np(e){return e?.animationName||"none"}function e7(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 t7=wm[" useInsertionEffect ".trim().toString()]||Kn;function na({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=n7({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=r7(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function n7({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return t7(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function r7(e){return typeof e=="function"}var OM=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"}),a7="VisuallyHidden",Sm=v.forwardRef((e,t)=>s.jsx(De.span,{...e,ref:t,style:{...OM,...e.style}}));Sm.displayName=a7;var s7=Sm,yj="ToastProvider",[xj,i7,o7]=Hd("Toast"),[kM]=ir("Toast",[o7]),[l7,jm]=kM(yj),RM=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),y=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${yj}\`. Expected non-empty \`string\`.`),s.jsx(xj.Provider,{scope:t,children:s.jsx(l7,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:v.useCallback(()=>h(g=>g+1),[]),onToastRemove:v.useCallback(()=>h(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:y,children:o})})};RM.displayName=yj;var TM="ToastViewport",c7=["F8"],u1="toast.viewportPause",d1="toast.viewportResume",IM=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=c7,label:a="Notifications ({hotkey})",...i}=e,o=jm(TM,n),c=i7(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),y=ut(t,p,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),S=o.toastCount>0;v.useEffect(()=>{const x=j=>{r.length!==0&&r.every(_=>j[_]||j.code===_)&&p.current?.focus()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),v.useEffect(()=>{const x=d.current,j=p.current;if(S&&x&&j){const N=()=>{if(!o.isClosePausedRef.current){const O=new CustomEvent(u1);j.dispatchEvent(O),o.isClosePausedRef.current=!0}},_=()=>{if(o.isClosePausedRef.current){const O=new CustomEvent(d1);j.dispatchEvent(O),o.isClosePausedRef.current=!1}},P=O=>{!x.contains(O.relatedTarget)&&_()},A=()=>{x.contains(document.activeElement)||_()};return x.addEventListener("focusin",N),x.addEventListener("focusout",P),x.addEventListener("pointermove",N),x.addEventListener("pointerleave",A),window.addEventListener("blur",N),window.addEventListener("focus",_),()=>{x.removeEventListener("focusin",N),x.removeEventListener("focusout",P),x.removeEventListener("pointermove",N),x.removeEventListener("pointerleave",A),window.removeEventListener("blur",N),window.removeEventListener("focus",_)}}},[S,o.isClosePausedRef]);const b=v.useCallback(({tabbingDirection:x})=>{const N=c().map(_=>{const P=_.ref.current,A=[P,...S7(P)];return x==="forwards"?A:A.reverse()});return(x==="forwards"?N.reverse():N).flat()},[c]);return v.useEffect(()=>{const x=p.current;if(x){const j=N=>{const _=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!_){const A=document.activeElement,O=N.shiftKey;if(N.target===x&&O){f.current?.focus();return}const $=b({tabbingDirection:O?"backwards":"forwards"}),z=$.findIndex(B=>B===A);By($.slice(z+1))?N.preventDefault():O?f.current?.focus():h.current?.focus()}};return x.addEventListener("keydown",j),()=>x.removeEventListener("keydown",j)}},[c,b]),s.jsxs(XU,{ref:d,role:"region","aria-label":a.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:S?void 0:"none"},children:[S&&s.jsx(f1,{ref:f,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"forwards"});By(x)}}),s.jsx(xj.Slot,{scope:n,children:s.jsx(De.ol,{tabIndex:-1,...i,ref:y})}),S&&s.jsx(f1,{ref:h,onFocusFromOutsideViewport:()=>{const x=b({tabbingDirection:"backwards"});By(x)}})]})});IM.displayName=TM;var MM="ToastFocusProxy",f1=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=jm(MM,n);return s.jsx(Sm,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});f1.displayName=MM;var Kd="Toast",u7="toast.swipeStart",d7="toast.swipeMove",f7="toast.swipeCancel",p7="toast.swipeEnd",$M=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=na({prop:r,defaultProp:a??!0,onChange:i,caller:Kd});return s.jsx(Gn,{present:n||c,children:s.jsx(v7,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Pn(e.onPause),onResume:Pn(e.onResume),onSwipeStart:Ae(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ae(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:Ae(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:Ae(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)})})})});$M.displayName=Kd;var[h7,m7]=kM(Kd,{onClose(){}}),v7=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:y,onSwipeEnd:g,...S}=e,b=jm(Kd,n),[x,j]=v.useState(null),N=ut(t,U=>j(U)),_=v.useRef(null),P=v.useRef(null),A=a||b.duration,O=v.useRef(0),k=v.useRef(A),R=v.useRef(0),{onToastAdd:$,onToastRemove:z}=b,B=Pn(()=>{x?.contains(document.activeElement)&&b.viewport?.focus(),o()}),D=v.useCallback(U=>{!U||U===1/0||(window.clearTimeout(R.current),O.current=new Date().getTime(),R.current=window.setTimeout(B,U))},[B]);v.useEffect(()=>{const U=b.viewport;if(U){const V=()=>{D(k.current),f?.()},X=()=>{const Z=new Date().getTime()-O.current;k.current=k.current-Z,window.clearTimeout(R.current),d?.()};return U.addEventListener(u1,X),U.addEventListener(d1,V),()=>{U.removeEventListener(u1,X),U.removeEventListener(d1,V)}}},[b.viewport,A,d,f,D]),v.useEffect(()=>{i&&!b.isClosePausedRef.current&&D(A)},[i,A,b.isClosePausedRef,D]),v.useEffect(()=>($(),()=>z()),[$,z]);const K=v.useMemo(()=>x?qM(x):null,[x]);return b.viewport?s.jsxs(s.Fragment,{children:[K&&s.jsx(g7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:K}),s.jsx(h7,{scope:n,onClose:B,children:wc.createPortal(s.jsx(xj.ItemSlot,{scope:n,children:s.jsx(YU,{asChild:!0,onEscapeKeyDown:Ae(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||B(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(De.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...S,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ae(e.onKeyDown,U=>{U.key==="Escape"&&(c?.(U.nativeEvent),U.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Ae(e.onPointerDown,U=>{U.button===0&&(_.current={x:U.clientX,y:U.clientY})}),onPointerMove:Ae(e.onPointerMove,U=>{if(!_.current)return;const V=U.clientX-_.current.x,X=U.clientY-_.current.y,Z=!!P.current,T=["left","right"].includes(b.swipeDirection),L=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,Q=T?L(0,V):0,F=T?0:L(0,X),M=U.pointerType==="touch"?10:2,ee={x:Q,y:F},W={originalEvent:U,delta:ee};Z?(P.current=ee,Cp(d7,p,W,{discrete:!1})):tE(ee,b.swipeDirection,M)?(P.current=ee,Cp(u7,h,W,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(V)>M||Math.abs(X)>M)&&(_.current=null)}),onPointerUp:Ae(e.onPointerUp,U=>{const V=P.current,X=U.target;if(X.hasPointerCapture(U.pointerId)&&X.releasePointerCapture(U.pointerId),P.current=null,_.current=null,V){const Z=U.currentTarget,T={originalEvent:U,delta:V};tE(V,b.swipeDirection,b.swipeThreshold)?Cp(p7,g,T,{discrete:!0}):Cp(f7,y,T,{discrete:!0}),Z.addEventListener("click",L=>L.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),g7=e=>{const{__scopeToast:t,children:n,...r}=e,a=jm(Kd,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return b7(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Sc,{asChild:!0,children:s.jsx(Sm,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},y7="ToastTitle",DM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(De.div,{...r,ref:t})});DM.displayName=y7;var x7="ToastDescription",LM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(De.div,{...r,ref:t})});LM.displayName=x7;var FM="ToastAction",BM=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(UM,{altText:n,asChild:!0,children:s.jsx(bj,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${FM}\`. Expected non-empty \`string\`.`),null)});BM.displayName=FM;var zM="ToastClose",bj=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=m7(zM,n);return s.jsx(UM,{asChild:!0,children:s.jsx(De.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,a.onClose)})})});bj.displayName=zM;var UM=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(De.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function qM(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),w7(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(...qM(r))}}),t}function Cp(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?gj(a,i):a.dispatchEvent(i)}var tE=(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 b7(e=()=>{}){const t=Pn(e);Kn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function w7(e){return e.nodeType===e.ELEMENT_NODE}function S7(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 By(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var j7=RM,WM=IM,VM=$M,HM=DM,KM=LM,GM=BM,YM=bj;function XM(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=XM(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function bt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=XM(e))&&(r&&(r+=" "),r+=t);return r}const nE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rE=bt,Io=(e,t)=>n=>{var r;if(t?.variants==null)return rE(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 y=nE(h)||nE(p);return a[f][y]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,y]=h;return y===void 0||(f[p]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:y,...g}=h;return Object.entries(g).every(S=>{let[b,x]=S;return Array.isArray(x)?x.includes({...i,...c}[b]):{...i,...c}[b]===x})?[...f,p,y]:f},[]);return rE(e,o,d,n?.class,n?.className)};const N7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),QM=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var C7={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 _7=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,...C7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:QM("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const st=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(_7,{ref:i,iconNode:t,className:QM(`lucide-${N7(e)}`,r),...a}));return n.displayName=`${e}`,n};const JM=st("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 A7=st("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 xo=st("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const ha=st("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 ed=st("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=st("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const qt=st("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const ZM=st("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const is=st("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Pl=st("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const zy=st("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 Ol=st("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const E7=st("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 Xp=st("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 P7=st("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Nm=st("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ri=st("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 e$=st("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 ga=st("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 Cm=st("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 nh=st("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 O7=st("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 t$=st("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 aE=st("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 n$=st("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 wj=st("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 k7=st("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 p1=st("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 r$=st("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 R7=st("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 sr=st("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const a$=st("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 T7=st("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 s$=st("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 rh=st("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 I7=st("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const sE=st("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 iE=st("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 _m=st("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 kl=st("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const us=st("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const i$=st("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 Fa=st("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 M7=st("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 Sj=st("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const o$=st("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 jj=st("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 fa=st("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 h1=st("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const l$=st("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 xa=st("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 Qp=st("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 $7=st("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 Nj=st("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 c$=st("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 Is=st("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 Ti=st("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Cj="-",D7=e=>{const t=F7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(Cj);return c[0]===""&&c.length!==1&&c.shift(),u$(c,t)||L7(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},u$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?u$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Cj);return t.validators.find(({validator:o})=>o(i))?.classGroupId},oE=/^\[(.+)\]$/,L7=e=>{if(oE.test(e)){const t=oE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},F7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return z7(Object.entries(e.classGroups),n).forEach(([i,o])=>{m1(o,r,i,t)}),r},m1=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:lE(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(B7(a)){m1(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{m1(o,lE(t,i),n,r)})})},lE=(e,t)=>{let n=e;return t.split(Cj).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},B7=e=>e.isThemeGetter,z7=(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,U7=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)}}},d$="!",q7=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 j=c[x];if(f===0){if(j===a&&(r||c.slice(x,x+i)===t)){d.push(c.slice(h,x)),h=x+i;continue}if(j==="/"){p=x;continue}}j==="["?f++:j==="]"&&f--}const y=d.length===0?c:c.substring(h),g=y.startsWith(d$),S=g?y.substring(1):y,b=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:g,baseClassName:S,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:o}):o},W7=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},V7=e=>({cache:U7(e.cacheSize),parseClassName:q7(e),...D7(e)}),H7=/\s+/,K7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(H7);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:g}=n(f);let S=!!g,b=r(S?y.substring(0,g):y);if(!b){if(!S){c=f+(c.length>0?" "+c:c);continue}if(b=r(y),!b){c=f+(c.length>0?" "+c:c);continue}S=!1}const x=W7(h).join(":"),j=p?x+d$:x,N=j+b;if(i.includes(N))continue;i.push(N);const _=a(b,S);for(let P=0;P<_.length;++P){const A=_[P];i.push(j+A)}c=f+(c.length>0?" "+c:c)}return c};function G7(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=f$(t))&&(r&&(r+=" "),r+=n);return r}const f$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=f$(e[r]))&&(n&&(n+=" "),n+=t);return n};function Y7(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=V7(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=K7(d,n);return a(d,h),h}return function(){return i(G7.apply(null,arguments))}}const fn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},p$=/^\[(?:([a-z-]+):)?(.+)\]$/i,X7=/^\d+\/\d+$/,Q7=new Set(["px","full","screen"]),J7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Z7=/\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$/,eq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ps=e=>Rl(e)||Q7.has(e)||X7.test(e),wi=e=>jc(e,"length",uq),Rl=e=>!!e&&!Number.isNaN(Number(e)),Uy=e=>jc(e,"number",Rl),Nu=e=>!!e&&Number.isInteger(Number(e)),rq=e=>e.endsWith("%")&&Rl(e.slice(0,-1)),St=e=>p$.test(e),Si=e=>J7.test(e),aq=new Set(["length","size","percentage"]),sq=e=>jc(e,aq,h$),iq=e=>jc(e,"position",h$),oq=new Set(["image","url"]),lq=e=>jc(e,oq,fq),cq=e=>jc(e,"",dq),Cu=()=>!0,jc=(e,t,n)=>{const r=p$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},uq=e=>Z7.test(e)&&!eq.test(e),h$=()=>!1,dq=e=>tq.test(e),fq=e=>nq.test(e),pq=()=>{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"),y=fn("gap"),g=fn("gradientColorStops"),S=fn("gradientColorStopPositions"),b=fn("inset"),x=fn("margin"),j=fn("opacity"),N=fn("padding"),_=fn("saturate"),P=fn("scale"),A=fn("sepia"),O=fn("skew"),k=fn("space"),R=fn("translate"),$=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",St,t],D=()=>[St,t],K=()=>["",Ps,wi],U=()=>["auto",Rl,St],V=()=>["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"],T=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",St],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Rl,St];return{cacheSize:500,separator:":",theme:{colors:[Cu],spacing:[Ps,wi],blur:["none","",Si,St],brightness:F(),borderColor:[e],borderRadius:["none","","full",Si,St],borderSpacing:D(),borderWidth:K(),contrast:F(),grayscale:L(),hueRotate:F(),invert:L(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[rq,wi],inset:B(),margin:B(),opacity:F(),padding:D(),saturate:F(),scale:F(),sepia:L(),skew:F(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",St]}],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:[...V(),St]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Nu,St]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",St]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",Nu,St]}],"grid-cols":[{"grid-cols":[Cu]}],"col-start-end":[{col:["auto",{span:["full",Nu,St]},St]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[Cu]}],"row-start-end":[{row:["auto",{span:[Nu,St]},St]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",St]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",St]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"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",St,t]}],"min-w":[{"min-w":[St,t,"min","max","fit"]}],"max-w":[{"max-w":[St,t,"none","full","min","max","fit","prose",{screen:[Si]},Si]}],h:[{h:[St,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[St,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[St,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[St,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Si,wi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Uy]}],"font-family":[{font:[Cu]}],"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",St]}],"line-clamp":[{"line-clamp":["none",Rl,Uy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ps,St]}],"list-image":[{"list-image":["none",St]}],"list-style-type":[{list:["none","disc","decimal",St]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[j]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ps,wi]}],"underline-offset":[{"underline-offset":["auto",Ps,St]}],"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:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",St]}],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",St]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[j]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),iq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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":[j]}],"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":[j]}],"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":[Ps,St]}],"outline-w":[{outline:[Ps,wi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[j]}],"ring-offset-w":[{"ring-offset":[Ps,wi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Si,cq]}],"shadow-color":[{shadow:[Cu]}],opacity:[{opacity:[j]}],"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,St]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[A]}],"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":[j]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"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",St]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",St]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",St]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[Nu,St]}],"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",St]}],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",St]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",St]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ps,wi,Uy]}],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"]}}},hq=Y7(pq);function Se(...e){return hq(bt(e))}const mq=j7,m$=v.forwardRef(({className:e,...t},n)=>s.jsx(WM,{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}));m$.displayName=WM.displayName;const vq=Io("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"}}),v$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(VM,{ref:r,className:Se(vq({variant:t}),e),...n}));v$.displayName=VM.displayName;const gq=v.forwardRef(({className:e,...t},n)=>s.jsx(GM,{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}));gq.displayName=GM.displayName;const g$=v.forwardRef(({className:e,...t},n)=>s.jsx(YM,{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(Ti,{className:"h-4 w-4"})}));g$.displayName=YM.displayName;const y$=v.forwardRef(({className:e,...t},n)=>s.jsx(HM,{ref:n,className:Se("text-sm font-semibold",e),...t}));y$.displayName=HM.displayName;const x$=v.forwardRef(({className:e,...t},n)=>s.jsx(KM,{ref:n,className:Se("text-sm opacity-90",e),...t}));x$.displayName=KM.displayName;function yq(){const{toasts:e}=AU();return s.jsxs(mq,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(v$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(y$,{children:n}),r&&s.jsx(x$,{children:r})]}),a,s.jsx(g$,{})]},t)}),s.jsx(m$,{})]})}var cE=["light","dark"],xq="(prefers-color-scheme: dark)",bq=v.createContext(void 0),wq={setTheme:e=>{},themes:[]},Sq=()=>{var e;return(e=v.useContext(bq))!=null?e:wq};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(S=>`'${S}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=a?cE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",y=(S,b=!1,x=!0)=>{let j=o?o[S]:S,N=b?S+"|| ''":`'${j}'`,_="";return a&&x&&!b&&cE.includes(S)&&(_+=`d.style.colorScheme = '${S}';`),n==="class"?b||j?_+=`c.add(${N})`:_+="null":j&&(_+=`d[s](n,${N})`),_},g=e?`!function(){${h}${y(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${xq}',m=window.matchMedia(t);if(m.media!==t||m.matches){${y("dark")}}else{${y("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${y(o?"x[e]":"e",!0)}}${f?"":"else{"+y(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${y(o?"x[e]":"e",!0)}}else{${y(i,!1,!1)};}${p}}catch(t){}}();`;return v.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:g}})});var jq=e=>{switch(e){case"success":return _q;case"info":return Eq;case"warning":return Aq;case"error":return Pq;default:return null}},Nq=Array(12).fill(0),Cq=({visible:e,className:t})=>q.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},q.createElement("div",{className:"sonner-spinner"},Nq.map((n,r)=>q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),_q=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Aq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},q.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"})),Eq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Pq=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.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"})),Oq=q.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"},q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),kq=()=>{let[e,t]=q.useState(document.hidden);return q.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},v1=1,Rq=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:v1++,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],q.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Iq(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||v1++;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}},Tr=new Rq,Tq=(e,t)=>{let n=t?.id||v1++;return Tr.addToast({title:e,...t,id:n}),n},Iq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mq=Tq,$q=()=>Tr.toasts,Dq=()=>Tr.getActiveToasts();Object.assign(Mq,{success:Tr.success,info:Tr.info,warning:Tr.warning,error:Tr.error,custom:Tr.custom,message:Tr.message,promise:Tr.promise,dismiss:Tr.dismiss,loading:Tr.loading},{getHistory:$q,getToasts:Dq});function Lq(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))}Lq(`: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 _p(e){return e.label!==void 0}var Fq=3,Bq="32px",zq="16px",uE=4e3,Uq=356,qq=14,Wq=20,Vq=200;function Ra(...e){return e.filter(Boolean).join(" ")}function Hq(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Kq=e=>{var t,n,r,a,i,o,c,d,f,h,p;let{invert:y,toast:g,unstyled:S,interacting:b,setHeights:x,visibleToasts:j,heights:N,index:_,toasts:P,expanded:A,removeToast:O,defaultRichColors:k,closeButton:R,style:$,cancelButtonStyle:z,actionButtonStyle:B,className:D="",descriptionClassName:K="",duration:U,position:V,gap:X,loadingIcon:Z,expandByDefault:T,classNames:L,icons:Q,closeButtonAriaLabel:F="Close toast",pauseWhenPageIsHidden:M}=e,[ee,W]=q.useState(null),[J,ye]=q.useState(null),[ae,ue]=q.useState(!1),[ie,ve]=q.useState(!1),[Oe,oe]=q.useState(!1),[he,xe]=q.useState(!1),[Ie,re]=q.useState(!1),[me,Ne]=q.useState(0),[tt,je]=q.useState(0),et=q.useRef(g.duration||U||uE),dt=q.useRef(null),Pt=q.useRef(null),hn=_===0,we=_+1<=j,Le=g.type,qe=g.dismissible!==!1,Rt=g.className||"",$t=g.descriptionClassName||"",Dt=q.useMemo(()=>N.findIndex(ke=>ke.toastId===g.id)||0,[N,g.id]),mn=q.useMemo(()=>{var ke;return(ke=g.closeButton)!=null?ke:R},[g.closeButton,R]),jn=q.useMemo(()=>g.duration||U||uE,[g.duration,U]),or=q.useRef(0),lr=q.useRef(0),Na=q.useRef(0),Dn=q.useRef(null),[Dr,Cr]=V.split("-"),_r=q.useMemo(()=>N.reduce((ke,it,vt)=>vt>=Dt?ke:ke+it.height,0),[N,Dt]),kn=kq(),xn=g.invert||y,cn=Le==="loading";lr.current=q.useMemo(()=>Dt*X+_r,[Dt,_r]),q.useEffect(()=>{et.current=jn},[jn]),q.useEffect(()=>{ue(!0)},[]),q.useEffect(()=>{let ke=Pt.current;if(ke){let it=ke.getBoundingClientRect().height;return je(it),x(vt=>[{toastId:g.id,height:it,position:g.position},...vt]),()=>x(vt=>vt.filter(zt=>zt.toastId!==g.id))}},[x,g.id]),q.useLayoutEffect(()=>{if(!ae)return;let ke=Pt.current,it=ke.style.height;ke.style.height="auto";let vt=ke.getBoundingClientRect().height;ke.style.height=it,je(vt),x(zt=>zt.find(tn=>tn.toastId===g.id)?zt.map(tn=>tn.toastId===g.id?{...tn,height:vt}:tn):[{toastId:g.id,height:vt,position:g.position},...zt])},[ae,g.title,g.description,x,g.id]);let Rn=q.useCallback(()=>{ve(!0),Ne(lr.current),x(ke=>ke.filter(it=>it.toastId!==g.id)),setTimeout(()=>{O(g)},Vq)},[g,O,x,lr]);q.useEffect(()=>{if(g.promise&&Le==="loading"||g.duration===1/0||g.type==="loading")return;let ke;return A||b||M&&kn?(()=>{if(Na.current<or.current){let it=new Date().getTime()-or.current;et.current=et.current-it}Na.current=new Date().getTime()})():et.current!==1/0&&(or.current=new Date().getTime(),ke=setTimeout(()=>{var it;(it=g.onAutoClose)==null||it.call(g,g),Rn()},et.current)),()=>clearTimeout(ke)},[A,b,g,Le,M,kn,Rn]),q.useEffect(()=>{g.delete&&Rn()},[Rn,g.delete]);function le(){var ke,it,vt;return Q!=null&&Q.loading?q.createElement("div",{className:Ra(L?.loader,(ke=g?.classNames)==null?void 0:ke.loader,"sonner-loader"),"data-visible":Le==="loading"},Q.loading):Z?q.createElement("div",{className:Ra(L?.loader,(it=g?.classNames)==null?void 0:it.loader,"sonner-loader"),"data-visible":Le==="loading"},Z):q.createElement(Cq,{className:Ra(L?.loader,(vt=g?.classNames)==null?void 0:vt.loader),visible:Le==="loading"})}return q.createElement("li",{tabIndex:0,ref:Pt,className:Ra(D,Rt,L?.toast,(t=g?.classNames)==null?void 0:t.toast,L?.default,L?.[Le],(n=g?.classNames)==null?void 0:n[Le]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:k,"data-styled":!(g.jsx||g.unstyled||S),"data-mounted":ae,"data-promise":!!g.promise,"data-swiped":Ie,"data-removed":ie,"data-visible":we,"data-y-position":Dr,"data-x-position":Cr,"data-index":_,"data-front":hn,"data-swiping":Oe,"data-dismissible":qe,"data-type":Le,"data-invert":xn,"data-swipe-out":he,"data-swipe-direction":J,"data-expanded":!!(A||T&&ae),style:{"--index":_,"--toasts-before":_,"--z-index":P.length-_,"--offset":`${ie?me:lr.current}px`,"--initial-height":T?"auto":`${tt}px`,...$,...g.style},onDragEnd:()=>{oe(!1),W(null),Dn.current=null},onPointerDown:ke=>{cn||!qe||(dt.current=new Date,Ne(lr.current),ke.target.setPointerCapture(ke.pointerId),ke.target.tagName!=="BUTTON"&&(oe(!0),Dn.current={x:ke.clientX,y:ke.clientY}))},onPointerUp:()=>{var ke,it,vt,zt;if(he||!qe)return;Dn.current=null;let tn=Number(((ke=Pt.current)==null?void 0:ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Et=Number(((it=Pt.current)==null?void 0:it.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mr=new Date().getTime()-((vt=dt.current)==null?void 0:vt.getTime()),Vt=ee==="x"?tn:Et,Ht=Math.abs(Vt)/mr;if(Math.abs(Vt)>=Wq||Ht>.11){Ne(lr.current),(zt=g.onDismiss)==null||zt.call(g,g),ye(ee==="x"?tn>0?"right":"left":Et>0?"down":"up"),Rn(),xe(!0),re(!1);return}oe(!1),W(null)},onPointerMove:ke=>{var it,vt,zt,tn;if(!Dn.current||!qe||((it=window.getSelection())==null?void 0:it.toString().length)>0)return;let Et=ke.clientY-Dn.current.y,mr=ke.clientX-Dn.current.x,Vt=(vt=e.swipeDirections)!=null?vt:Hq(V);!ee&&(Math.abs(mr)>1||Math.abs(Et)>1)&&W(Math.abs(mr)>Math.abs(Et)?"x":"y");let Ht={x:0,y:0};ee==="y"?(Vt.includes("top")||Vt.includes("bottom"))&&(Vt.includes("top")&&Et<0||Vt.includes("bottom")&&Et>0)&&(Ht.y=Et):ee==="x"&&(Vt.includes("left")||Vt.includes("right"))&&(Vt.includes("left")&&mr<0||Vt.includes("right")&&mr>0)&&(Ht.x=mr),(Math.abs(Ht.x)>0||Math.abs(Ht.y)>0)&&re(!0),(zt=Pt.current)==null||zt.style.setProperty("--swipe-amount-x",`${Ht.x}px`),(tn=Pt.current)==null||tn.style.setProperty("--swipe-amount-y",`${Ht.y}px`)}},mn&&!g.jsx?q.createElement("button",{"aria-label":F,"data-disabled":cn,"data-close-button":!0,onClick:cn||!qe?()=>{}:()=>{var ke;Rn(),(ke=g.onDismiss)==null||ke.call(g,g)},className:Ra(L?.closeButton,(a=g?.classNames)==null?void 0:a.closeButton)},(i=Q?.close)!=null?i:Oq):null,g.jsx||v.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:q.createElement(q.Fragment,null,Le||g.icon||g.promise?q.createElement("div",{"data-icon":"",className:Ra(L?.icon,(o=g?.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||le():null,g.type!=="loading"?g.icon||Q?.[Le]||jq(Le):null):null,q.createElement("div",{"data-content":"",className:Ra(L?.content,(c=g?.classNames)==null?void 0:c.content)},q.createElement("div",{"data-title":"",className:Ra(L?.title,(d=g?.classNames)==null?void 0:d.title)},typeof g.title=="function"?g.title():g.title),g.description?q.createElement("div",{"data-description":"",className:Ra(K,$t,L?.description,(f=g?.classNames)==null?void 0:f.description)},typeof g.description=="function"?g.description():g.description):null),v.isValidElement(g.cancel)?g.cancel:g.cancel&&_p(g.cancel)?q.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||z,onClick:ke=>{var it,vt;_p(g.cancel)&&qe&&((vt=(it=g.cancel).onClick)==null||vt.call(it,ke),Rn())},className:Ra(L?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,v.isValidElement(g.action)?g.action:g.action&&_p(g.action)?q.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||B,onClick:ke=>{var it,vt;_p(g.action)&&((vt=(it=g.action).onClick)==null||vt.call(it,ke),!ke.defaultPrevented&&Rn())},className:Ra(L?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function dE(){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 Gq(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?zq:Bq;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 Yq=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:y,style:g,visibleToasts:S=Fq,toastOptions:b,dir:x=dE(),gap:j=qq,loadingIcon:N,icons:_,containerAriaLabel:P="Notifications",pauseWhenPageIsHidden:A}=e,[O,k]=q.useState([]),R=q.useMemo(()=>Array.from(new Set([r].concat(O.filter(M=>M.position).map(M=>M.position)))),[O,r]),[$,z]=q.useState([]),[B,D]=q.useState(!1),[K,U]=q.useState(!1),[V,X]=q.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=q.useRef(null),T=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=q.useRef(null),Q=q.useRef(!1),F=q.useCallback(M=>{k(ee=>{var W;return(W=ee.find(J=>J.id===M.id))!=null&&W.delete||Tr.dismiss(M.id),ee.filter(({id:J})=>J!==M.id)})},[]);return q.useEffect(()=>Tr.subscribe(M=>{if(M.dismiss){k(ee=>ee.map(W=>W.id===M.id?{...W,delete:!0}:W));return}setTimeout(()=>{_M.flushSync(()=>{k(ee=>{let W=ee.findIndex(J=>J.id===M.id);return W!==-1?[...ee.slice(0,W),{...ee[W],...M},...ee.slice(W+1)]:[M,...ee]})})})}),[]),q.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 M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:ee})=>{X(ee?"dark":"light")})}catch{M.addListener(({matches:W})=>{try{X(W?"dark":"light")}catch(J){console.error(J)}})}},[h]),q.useEffect(()=>{O.length<=1&&D(!1)},[O]),q.useEffect(()=>{let M=ee=>{var W,J;a.every(ye=>ee[ye]||ee.code===ye)&&(D(!0),(W=Z.current)==null||W.focus()),ee.code==="Escape"&&(document.activeElement===Z.current||(J=Z.current)!=null&&J.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[a]),q.useEffect(()=>{if(Z.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Q.current=!1)}},[Z.current]),q.createElement("section",{ref:t,"aria-label":`${P} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((M,ee)=>{var W;let[J,ye]=M.split("-");return O.length?q.createElement("ol",{key:M,dir:x==="auto"?dE():x,tabIndex:-1,ref:Z,className:c,"data-sonner-toaster":!0,"data-theme":V,"data-y-position":J,"data-lifted":B&&O.length>1&&!i,"data-x-position":ye,style:{"--front-toast-height":`${((W=$[0])==null?void 0:W.height)||0}px`,"--width":`${Uq}px`,"--gap":`${j}px`,...g,...Gq(d,f)},onBlur:ae=>{Q.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(Q.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,L.current=ae.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{K||D(!1)},onDragEnd:()=>D(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},O.filter(ae=>!ae.position&&ee===0||ae.position===M).map((ae,ue)=>{var ie,ve;return q.createElement(Kq,{key:ae.id,icons:_,index:ue,toast:ae,defaultRichColors:p,duration:(ie=b?.duration)!=null?ie:y,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:S,closeButton:(ve=b?.closeButton)!=null?ve:o,interacting:K,position:M,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:F,toasts:O.filter(Oe=>Oe.position==ae.position),heights:$.filter(Oe=>Oe.position==ae.position),setHeights:z,expandByDefault:i,gap:j,loadingIcon:N,expanded:B,pauseWhenPageIsHidden:A,swipeDirections:e.swipeDirections})})):null}))});const Xq=({...e})=>{const{theme:t="system"}=Sq();return s.jsx(Yq,{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 Qq=wm[" useId ".trim().toString()]||(()=>{}),Jq=0;function Hn(e){const[t,n]=v.useState(Qq());return Kn(()=>{n(r=>r??String(Jq++))},[e]),e||(t?`radix-${t}`:"")}const Zq=["top","right","bottom","left"],Ii=Math.min,Kr=Math.max,ah=Math.round,Ap=Math.floor,os=e=>({x:e,y:e}),e9={left:"right",right:"left",bottom:"top",top:"bottom"},t9={start:"end",end:"start"};function g1(e,t,n){return Kr(e,Ii(t,n))}function Us(e,t){return typeof e=="function"?e(t):e}function qs(e){return e.split("-")[0]}function Nc(e){return e.split("-")[1]}function _j(e){return e==="x"?"y":"x"}function Aj(e){return e==="y"?"height":"width"}const n9=new Set(["top","bottom"]);function as(e){return n9.has(qs(e))?"y":"x"}function Ej(e){return _j(as(e))}function r9(e,t,n){n===void 0&&(n=!1);const r=Nc(e),a=Ej(e),i=Aj(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=sh(o)),[o,sh(o)]}function a9(e){const t=sh(e);return[y1(e),t,y1(t)]}function y1(e){return e.replace(/start|end/g,t=>t9[t])}const fE=["left","right"],pE=["right","left"],s9=["top","bottom"],i9=["bottom","top"];function o9(e,t,n){switch(e){case"top":case"bottom":return n?t?pE:fE:t?fE:pE;case"left":case"right":return t?s9:i9;default:return[]}}function l9(e,t,n,r){const a=Nc(e);let i=o9(qs(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(y1)))),i}function sh(e){return e.replace(/left|right|bottom|top/g,t=>e9[t])}function c9(e){return{top:0,right:0,bottom:0,left:0,...e}}function b$(e){return typeof e!="number"?c9(e):{top:e,right:e,bottom:e,left:e}}function ih(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 hE(e,t,n){let{reference:r,floating:a}=e;const i=as(t),o=Ej(t),c=Aj(o),d=qs(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,y=r[c]/2-a[c]/2;let g;switch(d){case"top":g={x:h,y:r.y-a.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-a.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Nc(t)){case"start":g[o]-=y*(n&&f?-1:1);break;case"end":g[o]+=y*(n&&f?-1:1);break}return g}async function u9(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:y=!1,padding:g=0}=Us(t,e),S=b$(g),x=c[y?p==="floating"?"reference":"floating":p],j=ih(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,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),P=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},A=ih(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:_,strategy:d}):N);return{top:(j.top-A.top+S.top)/P.y,bottom:(A.bottom-j.bottom+S.bottom)/P.y,left:(j.left-A.left+S.left)/P.x,right:(A.right-j.right+S.right)/P.x}}const d9=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}=hE(f,r,d),y=r,g={},S=0;for(let x=0;x<c.length;x++){var b;const{name:j,fn:N}=c[x],{x:_,y:P,data:A,reset:O}=await N({x:h,y:p,initialPlacement:r,placement:y,strategy:a,middlewareData:g,rects:f,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:u9},elements:{reference:e,floating:t}});h=_??h,p=P??p,g={...g,[j]:{...g[j],...A}},O&&S<=50&&(S++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(f=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):O.rects),{x:h,y:p}=hE(f,y,d)),x=-1)}return{x:h,y:p,placement:y,strategy:a,middlewareData:g}},f9=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}=Us(e,t)||{};if(f==null)return{};const p=b$(h),y={x:n,y:r},g=Ej(a),S=Aj(g),b=await o.getDimensions(f),x=g==="y",j=x?"top":"left",N=x?"bottom":"right",_=x?"clientHeight":"clientWidth",P=i.reference[S]+i.reference[g]-y[g]-i.floating[S],A=y[g]-i.reference[g],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let k=O?O[_]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=c.floating[_]||i.floating[S]);const R=P/2-A/2,$=k/2-b[S]/2-1,z=Ii(p[j],$),B=Ii(p[N],$),D=z,K=k-b[S]-B,U=k/2-b[S]/2+R,V=g1(D,U,K),X=!d.arrow&&Nc(a)!=null&&U!==V&&i.reference[S]/2-(U<D?z:B)-b[S]/2<0,Z=X?U<D?U-D:U-K:0;return{[g]:y[g]+Z,data:{[g]:V,centerOffset:U-V-Z,...X&&{alignmentOffset:Z}},reset:X}}}),p9=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:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...x}=Us(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const j=qs(a),N=as(c),_=qs(c)===c,P=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=y||(_||!b?[sh(c)]:a9(c)),O=S!=="none";!y&&O&&A.push(...l9(c,b,S,P));const k=[c,...A],R=await d.detectOverflow(t,x),$=[];let z=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&$.push(R[j]),p){const U=r9(a,o,P);$.push(R[U[0]],R[U[1]])}if(z=[...z,{placement:a,overflows:$}],!$.every(U=>U<=0)){var B,D;const U=(((B=i.flip)==null?void 0:B.index)||0)+1,V=k[U];if(V&&(!(p==="alignment"?N!==as(V):!1)||z.every(T=>as(T.placement)===N?T.overflows[0]>0:!0)))return{data:{index:U,overflows:z},reset:{placement:V}};let X=(D=z.filter(Z=>Z.overflows[0]<=0).sort((Z,T)=>Z.overflows[1]-T.overflows[1])[0])==null?void 0:D.placement;if(!X)switch(g){case"bestFit":{var K;const Z=(K=z.filter(T=>{if(O){const L=as(T.placement);return L===N||L==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(L=>L>0).reduce((L,Q)=>L+Q,0)]).sort((T,L)=>T[1]-L[1])[0])==null?void 0:K[0];Z&&(X=Z);break}case"initialPlacement":X=c;break}if(a!==X)return{reset:{placement:X}}}return{}}}};function mE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vE(e){return Zq.some(t=>e[t]>=0)}const h9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Us(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=mE(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:vE(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=mE(o,n.floating);return{data:{escapedOffsets:c,escaped:vE(c)}}}default:return{}}}}},w$=new Set(["left","top"]);async function m9(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=qs(n),c=Nc(n),d=as(n)==="y",f=w$.has(o)?-1:1,h=i&&d?-1:1,p=Us(t,e);let{mainAxis:y,crossAxis:g,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof S=="number"&&(g=c==="end"?S*-1:S),d?{x:g*h,y:y*f}:{x:y*f,y:g*h}}const v9=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 m9(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}}}}},g9=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:j=>{let{x:N,y:_}=j;return{x:N,y:_}}},...f}=Us(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),y=as(qs(a)),g=_j(y);let S=h[g],b=h[y];if(o){const j=g==="y"?"top":"left",N=g==="y"?"bottom":"right",_=S+p[j],P=S-p[N];S=g1(_,S,P)}if(c){const j=y==="y"?"top":"left",N=y==="y"?"bottom":"right",_=b+p[j],P=b-p[N];b=g1(_,b,P)}const x=d.fn({...t,[g]:S,[y]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[g]:o,[y]:c}}}}}},y9=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}=Us(e,t),h={x:n,y:r},p=as(a),y=_j(p);let g=h[y],S=h[p];const b=Us(c,t),x=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const _=y==="y"?"height":"width",P=i.reference[y]-i.floating[_]+x.mainAxis,A=i.reference[y]+i.reference[_]-x.mainAxis;g<P?g=P:g>A&&(g=A)}if(f){var j,N;const _=y==="y"?"width":"height",P=w$.has(qs(a)),A=i.reference[p]-i.floating[_]+(P&&((j=o.offset)==null?void 0:j[p])||0)+(P?0:x.crossAxis),O=i.reference[p]+i.reference[_]+(P?0:((N=o.offset)==null?void 0:N[p])||0)-(P?x.crossAxis:0);S<A?S=A:S>O&&(S=O)}return{[y]:g,[p]:S}}}},x9=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}=Us(e,t),h=await o.detectOverflow(t,f),p=qs(a),y=Nc(a),g=as(a)==="y",{width:S,height:b}=i.floating;let x,j;p==="top"||p==="bottom"?(x=p,j=y===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(j=p,x=y==="end"?"top":"bottom");const N=b-h.top-h.bottom,_=S-h.left-h.right,P=Ii(b-h[x],N),A=Ii(S-h[j],_),O=!t.middlewareData.shift;let k=P,R=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=N),O&&!y){const z=Kr(h.left,0),B=Kr(h.right,0),D=Kr(h.top,0),K=Kr(h.bottom,0);g?R=S-2*(z!==0||B!==0?z+B:Kr(h.left,h.right)):k=b-2*(D!==0||K!==0?D+K:Kr(h.top,h.bottom))}await d({...t,availableWidth:R,availableHeight:k});const $=await o.getDimensions(c.floating);return S!==$.width||b!==$.height?{reset:{rects:!0}}:{}}}};function Am(){return typeof window<"u"}function Cc(e){return S$(e)?(e.nodeName||"").toLowerCase():"#document"}function Zr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hs(e){var t;return(t=(S$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function S$(e){return Am()?e instanceof Node||e instanceof Zr(e).Node:!1}function Ba(e){return Am()?e instanceof Element||e instanceof Zr(e).Element:!1}function ds(e){return Am()?e instanceof HTMLElement||e instanceof Zr(e).HTMLElement:!1}function gE(e){return!Am()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zr(e).ShadowRoot}const b9=new Set(["inline","contents"]);function Gd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=za(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!b9.has(a)}const w9=new Set(["table","td","th"]);function S9(e){return w9.has(Cc(e))}const j9=[":popover-open",":modal"];function Em(e){return j9.some(t=>{try{return e.matches(t)}catch{return!1}})}const N9=["transform","translate","scale","rotate","perspective"],C9=["transform","translate","scale","rotate","perspective","filter"],_9=["paint","layout","strict","content"];function Pj(e){const t=Oj(),n=Ba(e)?za(e):e;return N9.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)||C9.some(r=>(n.willChange||"").includes(r))||_9.some(r=>(n.contain||"").includes(r))}function A9(e){let t=Mi(e);for(;ds(t)&&!Wl(t);){if(Pj(t))return t;if(Em(t))return null;t=Mi(t)}return null}function Oj(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const E9=new Set(["html","body","#document"]);function Wl(e){return E9.has(Cc(e))}function za(e){return Zr(e).getComputedStyle(e)}function Pm(e){return Ba(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mi(e){if(Cc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gE(e)&&e.host||hs(e);return gE(t)?t.host:t}function j$(e){const t=Mi(e);return Wl(t)?e.ownerDocument?e.ownerDocument.body:e.body:ds(t)&&Gd(t)?t:j$(t)}function td(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=j$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=Zr(a);if(i){const c=x1(o);return t.concat(o,o.visualViewport||[],Gd(a)?a:[],c&&n?td(c):[])}return t.concat(a,td(a,[],n))}function x1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function N$(e){const t=za(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ds(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=ah(n)!==i||ah(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function kj(e){return Ba(e)?e:e.contextElement}function Tl(e){const t=kj(e);if(!ds(t))return os(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=N$(t);let o=(i?ah(n.width):n.width)/r,c=(i?ah(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const P9=os(0);function C$(e){const t=Zr(e);return!Oj()||!t.visualViewport?P9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function O9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zr(e)?!1:t}function bo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=kj(e);let o=os(1);t&&(r?Ba(r)&&(o=Tl(r)):o=Tl(e));const c=O9(i,n,r)?C$(i):os(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 y=Zr(i),g=r&&Ba(r)?Zr(r):r;let S=y,b=x1(S);for(;b&&r&&g!==S;){const x=Tl(b),j=b.getBoundingClientRect(),N=za(b),_=j.left+(b.clientLeft+parseFloat(N.paddingLeft))*x.x,P=j.top+(b.clientTop+parseFloat(N.paddingTop))*x.y;d*=x.x,f*=x.y,h*=x.x,p*=x.y,d+=_,f+=P,S=Zr(b),b=x1(S)}}return ih({width:h,height:p,x:d,y:f})}function Om(e,t){const n=Pm(e).scrollLeft;return t?t.left+n:bo(hs(e)).left+n}function _$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Om(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function k9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=hs(r),c=t?Em(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=os(1);const h=os(0),p=ds(r);if((p||!p&&!i)&&((Cc(r)!=="body"||Gd(o))&&(d=Pm(r)),ds(r))){const g=bo(r);f=Tl(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const y=o&&!p&&!i?_$(o,d):os(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+y.x,y:n.y*f.y-d.scrollTop*f.y+h.y+y.y}}function R9(e){return Array.from(e.getClientRects())}function T9(e){const t=hs(e),n=Pm(e),r=e.ownerDocument.body,a=Kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Om(e);const c=-n.scrollTop;return za(r).direction==="rtl"&&(o+=Kr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const yE=25;function I9(e,t){const n=Zr(e),r=hs(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=Oj();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Om(r);if(f<=0){const h=r.ownerDocument,p=h.body,y=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(r.clientWidth-p.clientWidth-g);S<=yE&&(i-=S)}else f<=yE&&(i+=f);return{width:i,height:o,x:c,y:d}}const M9=new Set(["absolute","fixed"]);function $9(e,t){const n=bo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=ds(e)?Tl(e):os(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 xE(e,t,n){let r;if(t==="viewport")r=I9(e,n);else if(t==="document")r=T9(hs(e));else if(Ba(t))r=$9(t,n);else{const a=C$(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return ih(r)}function A$(e,t){const n=Mi(e);return n===t||!Ba(n)||Wl(n)?!1:za(n).position==="fixed"||A$(n,t)}function D9(e,t){const n=t.get(e);if(n)return n;let r=td(e,[],!1).filter(c=>Ba(c)&&Cc(c)!=="body"),a=null;const i=za(e).position==="fixed";let o=i?Mi(e):e;for(;Ba(o)&&!Wl(o);){const c=za(o),d=Pj(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&M9.has(a.position)||Gd(o)&&!d&&A$(e,o))?r=r.filter(h=>h!==o):a=c,o=Mi(o)}return t.set(e,r),r}function L9(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Em(t)?[]:D9(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=xE(t,h,a);return f.top=Kr(p.top,f.top),f.right=Ii(p.right,f.right),f.bottom=Ii(p.bottom,f.bottom),f.left=Kr(p.left,f.left),f},xE(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function F9(e){const{width:t,height:n}=N$(e);return{width:t,height:n}}function B9(e,t,n){const r=ds(t),a=hs(t),i=n==="fixed",o=bo(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=os(0);function f(){d.x=Om(a)}if(r||!r&&!i)if((Cc(t)!=="body"||Gd(a))&&(c=Pm(t)),r){const g=bo(t,!0,i,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else a&&f();i&&!r&&a&&f();const h=a&&!r&&!i?_$(a,c):os(0),p=o.left+c.scrollLeft-d.x-h.x,y=o.top+c.scrollTop-d.y-h.y;return{x:p,y,width:o.width,height:o.height}}function qy(e){return za(e).position==="static"}function bE(e,t){if(!ds(e)||za(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return hs(e)===n&&(n=n.ownerDocument.body),n}function E$(e,t){const n=Zr(e);if(Em(e))return n;if(!ds(e)){let a=Mi(e);for(;a&&!Wl(a);){if(Ba(a)&&!qy(a))return a;a=Mi(a)}return n}let r=bE(e,t);for(;r&&S9(r)&&qy(r);)r=bE(r,t);return r&&Wl(r)&&qy(r)&&!Pj(r)?n:r||A9(e)||n}const z9=async function(e){const t=this.getOffsetParent||E$,n=this.getDimensions,r=await n(e.floating);return{reference:B9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function U9(e){return za(e).direction==="rtl"}const q9={convertOffsetParentRelativeRectToViewportRelativeRect:k9,getDocumentElement:hs,getClippingRect:L9,getOffsetParent:E$,getElementRects:z9,getClientRects:R9,getDimensions:F9,getScale:Tl,isElement:Ba,isRTL:U9};function P$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function W9(e,t){let n=null,r;const a=hs(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:y,height:g}=f;if(c||t(),!y||!g)return;const S=Ap(p),b=Ap(a.clientWidth-(h+y)),x=Ap(a.clientHeight-(p+g)),j=Ap(h),_={rootMargin:-S+"px "+-b+"px "+-x+"px "+-j+"px",threshold:Kr(0,Ii(1,d))||1};let P=!0;function A(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&&!P$(f,e.getBoundingClientRect())&&o(),P=!1}try{n=new IntersectionObserver(A,{..._,root:a.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return o(!0),i}function V9(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=kj(e),h=a||i?[...f?td(f):[],...td(t)]:[];h.forEach(j=>{a&&j.addEventListener("scroll",n,{passive:!0}),i&&j.addEventListener("resize",n)});const p=f&&c?W9(f,n):null;let y=-1,g=null;o&&(g=new ResizeObserver(j=>{let[N]=j;N&&N.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var _;(_=g)==null||_.observe(t)})),n()}),f&&!d&&g.observe(f),g.observe(t));let S,b=d?bo(e):null;d&&x();function x(){const j=bo(e);b&&!P$(b,j)&&n(),b=j,S=requestAnimationFrame(x)}return n(),()=>{var j;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p?.(),(j=g)==null||j.disconnect(),g=null,d&&cancelAnimationFrame(S)}}const H9=v9,K9=g9,G9=p9,Y9=x9,X9=h9,wE=f9,Q9=y9,J9=(e,t,n)=>{const r=new Map,a={platform:q9,...n},i={...a.platform,_c:r};return d9(e,t,{...a,platform:i})};var Z9=typeof document<"u",eW=function(){},Jp=Z9?v.useLayoutEffect:eW;function oh(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(!oh(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)&&!oh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function O$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function SE(e,t){const n=O$(e);return Math.round(t*n)/n}function Wy(e){const t=v.useRef(e);return Jp(()=>{t.current=e}),t}function tW(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}),[y,g]=v.useState(r);oh(y,r)||g(r);const[S,b]=v.useState(null),[x,j]=v.useState(null),N=v.useCallback(T=>{T!==O.current&&(O.current=T,b(T))},[]),_=v.useCallback(T=>{T!==k.current&&(k.current=T,j(T))},[]),P=i||S,A=o||x,O=v.useRef(null),k=v.useRef(null),R=v.useRef(h),$=d!=null,z=Wy(d),B=Wy(a),D=Wy(f),K=v.useCallback(()=>{if(!O.current||!k.current)return;const T={placement:t,strategy:n,middleware:y};B.current&&(T.platform=B.current),J9(O.current,k.current,T).then(L=>{const Q={...L,isPositioned:D.current!==!1};U.current&&!oh(R.current,Q)&&(R.current=Q,wc.flushSync(()=>{p(Q)}))})},[y,t,n,B,D]);Jp(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(T=>({...T,isPositioned:!1})))},[f]);const U=v.useRef(!1);Jp(()=>(U.current=!0,()=>{U.current=!1}),[]),Jp(()=>{if(P&&(O.current=P),A&&(k.current=A),P&&A){if(z.current)return z.current(P,A,K);K()}},[P,A,K,z,$]);const V=v.useMemo(()=>({reference:O,floating:k,setReference:N,setFloating:_}),[N,_]),X=v.useMemo(()=>({reference:P,floating:A}),[P,A]),Z=v.useMemo(()=>{const T={position:n,left:0,top:0};if(!X.floating)return T;const L=SE(X.floating,h.x),Q=SE(X.floating,h.y);return c?{...T,transform:"translate("+L+"px, "+Q+"px)",...O$(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:Q}},[n,c,X.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:K,refs:V,elements:X,floatingStyles:Z}),[h,K,V,X,Z])}const nW=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?wE({element:r.current,padding:a}).fn(n):{}:r?wE({element:r,padding:a}).fn(n):{}}}},rW=(e,t)=>({...H9(e),options:[e,t]}),aW=(e,t)=>({...K9(e),options:[e,t]}),sW=(e,t)=>({...Q9(e),options:[e,t]}),iW=(e,t)=>({...G9(e),options:[e,t]}),oW=(e,t)=>({...Y9(e),options:[e,t]}),lW=(e,t)=>({...X9(e),options:[e,t]}),cW=(e,t)=>({...nW(e),options:[e,t]});var uW="Arrow",k$=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(De.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"})})});k$.displayName=uW;var dW=k$;function km(e){const[t,n]=v.useState(void 0);return Kn(()=>{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 Rj="Popper",[R$,Di]=ir(Rj),[fW,T$]=R$(Rj),I$=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(fW,{scope:t,anchor:r,onAnchorChange:a,children:n})};I$.displayName=Rj;var M$="PopperAnchor",$$=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=T$(M$,n),o=v.useRef(null),c=ut(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(De.div,{...a,ref:c})});$$.displayName=M$;var Tj="PopperContent",[pW,hW]=R$(Tj),D$=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:y=!1,updatePositionStrategy:g="optimized",onPlaced:S,...b}=e,x=T$(Tj,n),[j,N]=v.useState(null),_=ut(t,ae=>N(ae)),[P,A]=v.useState(null),O=km(P),k=O?.width??0,R=O?.height??0,$=r+(i!=="center"?"-"+i:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},B=Array.isArray(f)?f:[f],D=B.length>0,K={padding:z,boundary:B.filter(vW),altBoundary:D},{refs:U,floatingStyles:V,placement:X,isPositioned:Z,middlewareData:T}=tW({strategy:"fixed",placement:$,whileElementsMounted:(...ae)=>V9(...ae,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[rW({mainAxis:a+R,alignmentAxis:o}),d&&aW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?sW():void 0,...K}),d&&iW({...K}),oW({...K,apply:({elements:ae,rects:ue,availableWidth:ie,availableHeight:ve})=>{const{width:Oe,height:oe}=ue.reference,he=ae.floating.style;he.setProperty("--radix-popper-available-width",`${ie}px`),he.setProperty("--radix-popper-available-height",`${ve}px`),he.setProperty("--radix-popper-anchor-width",`${Oe}px`),he.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),P&&cW({element:P,padding:c}),gW({arrowWidth:k,arrowHeight:R}),y&&lW({strategy:"referenceHidden",...K})]}),[L,Q]=B$(X),F=Pn(S);Kn(()=>{Z&&F?.()},[Z,F]);const M=T.arrow?.x,ee=T.arrow?.y,W=T.arrow?.centerOffset!==0,[J,ye]=v.useState();return Kn(()=>{j&&ye(window.getComputedStyle(j).zIndex)},[j]),s.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:Z?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(pW,{scope:n,placedSide:L,onArrowChange:A,arrowX:M,arrowY:ee,shouldHideArrow:W,children:s.jsx(De.div,{"data-side":L,"data-align":Q,...b,ref:_,style:{...b.style,animation:Z?void 0:"none"}})})})});D$.displayName=Tj;var L$="PopperArrow",mW={top:"bottom",right:"left",bottom:"top",left:"right"},F$=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=hW(L$,r),o=mW[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(dW,{...a,ref:n,style:{...a.style,display:"block"}})})});F$.displayName=L$;function vW(e){return e!==null}var gW=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]=B$(n),p={start:"0%",center:"50%",end:"100%"}[h],y=(a.arrow?.x??0)+c/2,g=(a.arrow?.y??0)+d/2;let S="",b="";return f==="bottom"?(S=o?p:`${y}px`,b=`${-d}px`):f==="top"?(S=o?p:`${y}px`,b=`${r.floating.height+d}px`):f==="right"?(S=`${-d}px`,b=o?p:`${g}px`):f==="left"&&(S=`${r.floating.width+d}px`,b=o?p:`${g}px`),{data:{x:S,y:b}}}});function B$(e){const[t,n="center"]=e.split("-");return[t,n]}var Rm=I$,Yd=$$,Tm=D$,Im=F$,yW=Symbol("radix.slottable");function xW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yW,t}var[Mm]=ir("Tooltip",[Di]),$m=Di(),z$="TooltipProvider",bW=700,b1="tooltip.open",[wW,Ij]=Mm(z$),U$=e=>{const{__scopeTooltip:t,delayDuration:n=bW,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(wW,{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})};U$.displayName=z$;var nd="Tooltip",[SW,Dm]=Mm(nd),q$=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=Ij(nd,e.__scopeTooltip),f=$m(t),[h,p]=v.useState(null),y=Hn(),g=v.useRef(0),S=o??d.disableHoverableContent,b=c??d.delayDuration,x=v.useRef(!1),[j,N]=na({prop:r,defaultProp:a??!1,onChange:k=>{k?(d.onOpen(),document.dispatchEvent(new CustomEvent(b1))):d.onClose(),i?.(k)},caller:nd}),_=v.useMemo(()=>j?x.current?"delayed-open":"instant-open":"closed",[j]),P=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,N(!0)},[N]),A=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,N(!1)},[N]),O=v.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,N(!0),g.current=0},b)},[b,N]);return v.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),s.jsx(Rm,{...f,children:s.jsx(SW,{scope:t,contentId:y,open:j,stateAttribute:_,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?O():P()},[d.isOpenDelayedRef,O,P]),onTriggerLeave:v.useCallback(()=>{S?A():(window.clearTimeout(g.current),g.current=0)},[A,S]),onOpen:P,onClose:A,disableHoverableContent:S,children:n})})};q$.displayName=nd;var w1="TooltipTrigger",W$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Dm(w1,n),i=Ij(w1,n),o=$m(n),c=v.useRef(null),d=ut(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(Yd,{asChild:!0,...o,children:s.jsx(De.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Ae(e.onPointerMove,y=>{y.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ae(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Ae(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ae(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Ae(e.onBlur,a.onClose),onClick:Ae(e.onClick,a.onClose)})})});W$.displayName=w1;var jW="TooltipPortal",[Age,NW]=Mm(jW,{forceMount:void 0}),Vl="TooltipContent",V$=v.forwardRef((e,t)=>{const n=NW(Vl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Dm(Vl,e.__scopeTooltip);return s.jsx(Gn,{present:r||o.open,children:o.disableHoverableContent?s.jsx(H$,{side:a,...i,ref:t}):s.jsx(CW,{side:a,...i,ref:t})})}),CW=v.forwardRef((e,t)=>{const n=Dm(Vl,e.__scopeTooltip),r=Ij(Vl,e.__scopeTooltip),a=v.useRef(null),i=ut(t,a),[o,c]=v.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,y=v.useCallback(()=>{c(null),p(!1)},[p]),g=v.useCallback((S,b)=>{const x=S.currentTarget,j={x:S.clientX,y:S.clientY},N=OW(j,x.getBoundingClientRect()),_=kW(j,N),P=RW(b.getBoundingClientRect()),A=IW([..._,...P]);c(A),p(!0)},[p]);return v.useEffect(()=>()=>y(),[y]),v.useEffect(()=>{if(d&&h){const S=x=>g(x,h),b=x=>g(x,d);return d.addEventListener("pointerleave",S),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",S),h.removeEventListener("pointerleave",b)}}},[d,h,g,y]),v.useEffect(()=>{if(o){const S=b=>{const x=b.target,j={x:b.clientX,y:b.clientY},N=d?.contains(x)||h?.contains(x),_=!TW(j,o);N?y():_&&(y(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[d,h,o,f,y]),s.jsx(H$,{...e,ref:i})}),[_W,AW]=Mm(nd,{isInside:!1}),EW=xW("TooltipContent"),H$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Dm(Vl,n),f=$m(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(b1,h),()=>document.removeEventListener(b1,h)),[h]),v.useEffect(()=>{if(d.trigger){const p=y=>{y.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(To,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(Tm,{"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(EW,{children:r}),s.jsx(_W,{scope:n,isInside:!0,children:s.jsx(s7,{id:d.contentId,role:"tooltip",children:a||r})})]})})});V$.displayName=Vl;var K$="TooltipArrow",PW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=$m(n);return AW(K$,n).isInside?null:s.jsx(Im,{...a,...r,ref:t})});PW.displayName=K$;function OW(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 kW(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 RW(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 TW(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,y=d.y;h>r!=y>r&&n<(p-f)*(r-h)/(y-h)+f&&(a=!a)}return a}function IW(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),MW(t)}function MW(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 $W=U$,DW=q$,LW=W$,G$=V$;const Y$=$W,X$=DW,Q$=LW,Mj=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(G$,{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}));Mj.displayName=G$.displayName;var Lm=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(){}},FW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},BW=class{#e=FW;#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)}},S1=new BW;function zW(e){setTimeout(e,0)}var Fm=typeof window>"u"||"Deno"in globalThis;function Ma(){}function UW(e,t){return typeof e=="function"?e(t):e}function qW(e){return typeof e=="number"&&e>=0&&e!==1/0}function WW(e,t){return Math.max(e+(t||0)-Date.now(),0)}function j1(e,t){return typeof e=="function"?e(t):e}function VW(e,t){return typeof e=="function"?e(t):e}function jE(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==$j(o,t.options))return!1}else if(!ad(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 NE(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(rd(t.options.mutationKey)!==rd(i))return!1}else if(!ad(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function $j(e,t){return(t?.queryKeyHashFn||rd)(e)}function rd(e){return JSON.stringify(e,(t,n)=>N1(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function ad(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ad(e[n],t[n])):!1}var HW=Object.prototype.hasOwnProperty;function J$(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=CE(e)&&CE(t);if(!r&&!(N1(e)&&N1(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],y=e[p],g=t[p];if(y===g){d[p]=y,(r?h<i:HW.call(e,p))&&f++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){d[p]=g;continue}const S=J$(y,g,n+1);d[p]=S,S===y&&f++}return i===c&&f===i?e:d}function CE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N1(e){if(!_E(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_E(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _E(e){return Object.prototype.toString.call(e)==="[object Object]"}function KW(e){return new Promise(t=>{S1.setTimeout(t,e)})}function GW(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?J$(e,t):t}function YW(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function XW(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Dj=Symbol();function Z$(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Dj?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function QW(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 JW=class extends Lm{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!Fm&&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"}},eD=new JW;function ZW(){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 eV=zW;function tV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=eV;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 xr=tV(),nV=class extends Lm{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!Fm&&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}},lh=new nV;function rV(e){return Math.min(1e3*2**e,3e4)}function tD(e){return(e??"online")==="online"?lh.isOnline():!0}var C1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function nD(e){let t=!1,n=0,r;const a=ZW(),i=()=>a.status!=="pending",o=b=>{if(!i()){const x=new C1(b);y(x),e.onCancel?.(x)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>eD.isFocused()&&(e.networkMode==="always"||lh.isOnline())&&e.canRun(),h=()=>tD(e.networkMode)&&e.canRun(),p=b=>{i()||(r?.(),a.resolve(b))},y=b=>{i()||(r?.(),a.reject(b))},g=()=>new Promise(b=>{r=x=>{(i()||f())&&b(x)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),S=()=>{if(i())return;let b;const x=n===0?e.initialPromise:void 0;try{b=x??e.fn()}catch(j){b=Promise.reject(j)}Promise.resolve(b).then(p).catch(j=>{if(i())return;const N=e.retry??(Fm?0:3),_=e.retryDelay??rV,P=typeof _=="function"?_(n,j):_,A=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,j);if(t||!A){y(j);return}n++,e.onFail?.(n,j),KW(P).then(()=>f()?void 0:g()).then(()=>{t?y(j):S()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?S():g().then(S),a)}}var rD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qW(this.gcTime)&&(this.#e=S1.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(S1.clearTimeout(this.#e),this.#e=void 0)}},aV=class extends rD{#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=EE(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=EE(this.options);t.data!==void 0&&(this.setState(AE(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=GW(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=>VW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dj||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>j1(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:!WW(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=Z$(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=nD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof C1&&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 C1){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,...sV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...AE(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),xr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function sV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function AE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function EE(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 PE(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=S=>{QW(S,()=>t.signal,()=>h=!0)},y=Z$(t.options,t.fetchOptions),g=async(S,b,x)=>{if(h)return Promise.reject();if(b==null&&S.pages.length)return Promise.resolve(S);const N=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:b,direction:x?"backward":"forward",meta:t.options.meta};return p(O),O})(),_=await y(N),{maxPages:P}=t.options,A=x?XW:YW;return{pages:A(S.pages,_,P),pageParams:A(S.pageParams,b,P)}};if(a&&i.length){const S=a==="backward",b=S?iV:OE,x={pages:i,pageParams:o},j=b(r,x);c=await g(x,j,S)}else{const S=e??i.length;do{const b=d===0?o[0]??r.initialPageParam:OE(r,c);if(d>0&&b==null)break;c=await g(c,b),d++}while(d<S)}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 OE(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 iV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var oV=class extends rD{#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||lV(),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=nD({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),xr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function lV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cV=class extends Lm{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 oV({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=Ep(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=Ep(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=Ep(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=Ep(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){xr.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=>NE(t,n))}findAll(e={}){return this.getAll().filter(t=>NE(e,t))}notify(e){xr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return xr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ma))))}};function Ep(e){return e.options.scope?.id}var uV=class extends Lm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??$j(r,t);let i=this.get(a);return i||(i=new aV({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(){xr.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=>jE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>jE(e,n)):t}notify(e){xr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){xr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){xr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new uV,this.#n=e.mutationCache||new cV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=eD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=lh.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(j1(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=UW(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return xr.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;xr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return xr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=xr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Ma).catch(Ma)}invalidateQueries(e,t={}){return xr.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=xr.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(j1(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=PE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ma).catch(Ma)}ensureInfiniteQueryData(e){return e.behavior=PE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return lh.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(rd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{ad(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(rd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{ad(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=$j(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===Dj&&(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()}},fV=v.createContext(void 0),pV=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(fV.Provider,{value:e,children:t}));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)}var Ai;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ai||(Ai={}));const kE="popstate";function hV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return _1("",{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:ch(a)}return vV(t,n,null,e)}function Sn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Lj(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mV(){return Math.random().toString(36).substr(2,8)}function RE(e,t){return{usr:e.state,key:e.key,idx:t}}function _1(e,t,n,r){return n===void 0&&(n=null),sd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?_c(t):t,{state:n,key:t&&t.key||r||mV()})}function ch(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 _c(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 vV(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=Ai.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(sd({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Ai.Pop;let x=h(),j=x==null?null:x-f;f=x,d&&d({action:c,location:b.location,delta:j})}function y(x,j){c=Ai.Push;let N=_1(b.location,x,j);f=h()+1;let _=RE(N,f),P=b.createHref(N);try{o.pushState(_,"",P)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(P)}i&&d&&d({action:c,location:b.location,delta:1})}function g(x,j){c=Ai.Replace;let N=_1(b.location,x,j);f=h();let _=RE(N,f),P=b.createHref(N);o.replaceState(_,"",P),i&&d&&d({action:c,location:b.location,delta:0})}function S(x){let j=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof x=="string"?x:ch(x);return N=N.replace(/ $/,"%20"),Sn(j,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,j)}let b={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(kE,p),d=x,()=>{a.removeEventListener(kE,p),d=null}},createHref(x){return t(a,x)},createURL:S,encodeLocation(x){let j=S(x);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:y,replace:g,go(x){return o.go(x)}};return b}var TE;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(TE||(TE={}));function gV(e,t,n){return n===void 0&&(n="/"),yV(e,t,n)}function yV(e,t,n,r){let a=typeof t=="string"?_c(t):t,i=Hl(a.pathname||"/",n);if(i==null)return null;let o=aD(e);xV(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=OV(i);c=EV(o[d],f)}return c}function aD(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("/")&&(Sn(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=Pi([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(Sn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),aD(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:_V(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 sD(i.path))a(i,o,d)}),t}function sD(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=sD(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 xV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const bV=/^:[\w-]+$/,wV=3,SV=2,jV=1,NV=10,CV=-2,IE=e=>e==="*";function _V(e,t){let n=e.split("/"),r=n.length;return n.some(IE)&&(r+=CV),t&&(r+=SV),n.filter(a=>!IE(a)).reduce((a,i)=>a+(bV.test(i)?wV:i===""?jV:NV),r)}function AV(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 EV(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=Qt({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),y=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:Pi([i,p.pathname]),pathnameBase:MV(Pi([i,p.pathnameBase])),route:y}),p.pathnameBase!=="/"&&(i=Pi([i,p.pathnameBase]))}return o}function Qt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=PV(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:y,isOptional:g}=h;if(y==="*"){let b=c[p]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const S=c[p];return g&&!S?f[y]=void 0:f[y]=(S||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function PV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Lj(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 OV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Lj(!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 Hl(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 kV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RV=e=>kV.test(e);function TV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?_c(e):e,i;if(n)if(RV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Lj(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=ME(n.substring(1),"/"):i=ME(n,t)}else i=t;return{pathname:i,search:$V(r),hash:DV(a)}}function ME(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 Vy(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 IV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Fj(e,t){let n=IV(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Bj(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=_c(e):(a=sd({},e),Sn(!a.pathname||!a.pathname.includes("?"),Vy("?","pathname","search",a)),Sn(!a.pathname||!a.pathname.includes("#"),Vy("#","pathname","hash",a)),Sn(!a.search||!a.search.includes("#"),Vy("#","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 y=o.split("/");for(;y[0]==="..";)y.shift(),p-=1;a.pathname=y.join("/")}c=p>=0?t[p]:"/"}let d=TV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Pi=e=>e.join("/").replace(/\/\/+/g,"/"),MV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$V=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function LV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const iD=["post","put","patch","delete"];new Set(iD);const FV=["get",...iD];new Set(FV);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)}const Bm=v.createContext(null),oD=v.createContext(null),Gs=v.createContext(null),zm=v.createContext(null),ms=v.createContext({outlet:null,matches:[],isDataRoute:!1}),lD=v.createContext(null);function BV(e,t){let{relative:n}=t===void 0?{}:t;Ac()||Sn(!1);let{basename:r,navigator:a}=v.useContext(Gs),{hash:i,pathname:o,search:c}=Um(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Pi([r,o])),a.createHref({pathname:d,search:c,hash:i})}function Ac(){return v.useContext(zm)!=null}function vs(){return Ac()||Sn(!1),v.useContext(zm).location}function cD(e){v.useContext(Gs).static||v.useLayoutEffect(e)}function wa(){let{isDataRoute:e}=v.useContext(ms);return e?tH():zV()}function zV(){Ac()||Sn(!1);let e=v.useContext(Bm),{basename:t,future:n,navigator:r}=v.useContext(Gs),{matches:a}=v.useContext(ms),{pathname:i}=vs(),o=JSON.stringify(Fj(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return cD(()=>{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=Bj(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Pi([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const UV=v.createContext(null);function qV(e){let t=v.useContext(ms).outlet;return t&&v.createElement(UV.Provider,{value:e},t)}function Mo(){let{matches:e}=v.useContext(ms),t=e[e.length-1];return t?t.params:{}}function Um(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Gs),{matches:a}=v.useContext(ms),{pathname:i}=vs(),o=JSON.stringify(Fj(a,r.v7_relativeSplatPath));return v.useMemo(()=>Bj(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function WV(e,t){return VV(e,t)}function VV(e,t,n,r){Ac()||Sn(!1);let{navigator:a}=v.useContext(Gs),{matches:i}=v.useContext(ms),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=vs(),h;if(t){var p;let x=typeof t=="string"?_c(t):t;d==="/"||(p=x.pathname)!=null&&p.startsWith(d)||Sn(!1),h=x}else h=f;let y=h.pathname||"/",g=y;if(d!=="/"){let x=d.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(x.length).join("/")}let S=gV(e,{pathname:g}),b=XV(S&&S.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Pi([d,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:Pi([d,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&b?v.createElement(zm.Provider,{value:{location:id({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Ai.Pop}},b):b}function HV(){let e=eH(),t=LV(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 KV=v.createElement(HV,null);class GV 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(ms.Provider,{value:this.props.routeContext},v.createElement(lD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function YV(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(Bm);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(ms.Provider,{value:t},r)}function XV(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||Sn(!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:y,errors:g}=n,S=p.route.loader&&y[p.route.id]===void 0&&(!g||g[p.route.id]===void 0);if(p.route.lazy||S){d=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,p,y)=>{let g,S=!1,b=null,x=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||KV,d&&(f<0&&y===0?(nH("route-fallback"),S=!0,x=null):f===y&&(S=!0,x=p.route.hydrateFallbackElement||null)));let j=t.concat(o.slice(0,y+1)),N=()=>{let _;return g?_=b:S?_=x:p.route.Component?_=v.createElement(p.route.Component,null):p.route.element?_=p.route.element:_=h,v.createElement(YV,{match:p,routeContext:{outlet:h,matches:j,isDataRoute:n!=null},children:_})};return n&&(p.route.ErrorBoundary||p.route.errorElement||y===0)?v.createElement(GV,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:N(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):N()},null)}var uD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(uD||{}),dD=(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})(dD||{});function QV(e){let t=v.useContext(Bm);return t||Sn(!1),t}function JV(e){let t=v.useContext(oD);return t||Sn(!1),t}function ZV(e){let t=v.useContext(ms);return t||Sn(!1),t}function fD(e){let t=ZV(),n=t.matches[t.matches.length-1];return n.route.id||Sn(!1),n.route.id}function eH(){var e;let t=v.useContext(lD),n=JV(),r=fD();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function tH(){let{router:e}=QV(uD.UseNavigateStable),t=fD(dD.UseNavigateStable),n=v.useRef(!1);return cD(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,id({fromRouteId:t},i)))},[e,t])}const $E={};function nH(e,t,n){$E[e]||($E[e]=!0)}function rH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function pD(e){let{to:t,replace:n,state:r,relative:a}=e;Ac()||Sn(!1);let{future:i,static:o}=v.useContext(Gs),{matches:c}=v.useContext(ms),{pathname:d}=vs(),f=wa(),h=Bj(t,Fj(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 DE(e){return qV(e.context)}function Xt(e){Sn(!1)}function aH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Ai.Pop,navigator:i,static:o=!1,future:c}=e;Ac()&&Sn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:id({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=_c(r));let{pathname:h="/",search:p="",hash:y="",state:g=null,key:S="default"}=r,b=v.useMemo(()=>{let x=Hl(h,d);return x==null?null:{location:{pathname:x,search:p,hash:y,state:g,key:S},navigationType:a}},[d,h,p,y,g,S,a]);return b==null?null:v.createElement(Gs.Provider,{value:f},v.createElement(zm.Provider,{children:n,value:b}))}function sH(e){let{children:t,location:n}=e;return WV(A1(t),n)}new Promise(()=>{});function A1(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,A1(r.props.children,i));return}r.type!==Xt&&Sn(!1),!r.props.index||!r.props.children||Sn(!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=A1(r.props.children,i)),n.push(o)}),n}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 hD(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 iH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oH(e,t){return e.button===0&&(!t||t==="_self")&&!iH(e)}function E1(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 lH(e,t){let n=E1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const cH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],dH="6";try{window.__reactRouterVersion=dH}catch{}const fH=v.createContext({isTransitioning:!1}),pH="startTransition",LE=wm[pH];function hH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=hV({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&&LE?LE(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>rH(r),[r]),v.createElement(aH,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const mH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vH=/^(?:[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,y=hD(t,cH),{basename:g}=v.useContext(Gs),S,b=!1;if(typeof f=="string"&&vH.test(f)&&(S=f,mH))try{let _=new URL(window.location.href),P=f.startsWith("//")?new URL(_.protocol+f):new URL(f),A=Hl(P.pathname,g);P.origin===_.origin&&A!=null?f=A+P.search+P.hash:b=!0}catch{}let x=BV(f,{relative:a}),j=xH(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function N(_){r&&r(_),_.defaultPrevented||j(_)}return v.createElement("a",uh({},y,{href:S||x,onClick:b||i?r:N,ref:n,target:d}))}),gH=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=hD(t,uH),y=Um(d,{relative:p.relative}),g=vs(),S=v.useContext(oD),{navigator:b,basename:x}=v.useContext(Gs),j=S!=null&&bH(y)&&f===!0,N=b.encodeLocation?b.encodeLocation(y).pathname:y.pathname,_=g.pathname,P=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;a||(_=_.toLowerCase(),P=P?P.toLowerCase():null,N=N.toLowerCase()),P&&x&&(P=Hl(P,x)||P);const A=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let O=_===N||!o&&_.startsWith(N)&&_.charAt(A)==="/",k=P!=null&&(P===N||!o&&P.startsWith(N)&&P.charAt(N.length)==="/"),R={isActive:O,isPending:k,isTransitioning:j},$=O?r:void 0,z;typeof i=="function"?z=i(R):z=[i,O?"active":null,k?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let B=typeof c=="function"?c(R):c;return v.createElement(yt,uh({},p,{"aria-current":$,className:z,ref:n,style:B,to:d,viewTransition:f}),typeof h=="function"?h(R):h)});var P1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(P1||(P1={}));var FE;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(FE||(FE={}));function yH(e){let t=v.useContext(Bm);return t||Sn(!1),t}function xH(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=wa(),f=vs(),h=Um(e,{relative:o});return v.useCallback(p=>{if(oH(p,n)){p.preventDefault();let y=r!==void 0?r:ch(f)===ch(h);d(e,{replace:y,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function Ec(e){let t=v.useRef(E1(e)),n=v.useRef(!1),r=vs(),a=v.useMemo(()=>lH(r.search,n.current?null:t.current),[r.search]),i=wa(),o=v.useCallback((c,d)=>{const f=E1(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function bH(e,t){t===void 0&&(t={});let n=v.useContext(fH);n==null&&Sn(!1);let{basename:r}=yH(P1.useViewTransitionState),a=Um(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Hl(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Hl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Qt(a.pathname,o)!=null||Qt(a.pathname,i)!=null}var wH=Symbol.for("react.lazy"),dh=wm[" use ".trim().toString()];function SH(e){return typeof e=="object"&&e!==null&&"then"in e}function mD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===wH&&"_payload"in e&&SH(e._payload)}function qm(e){const t=jH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;mD(i)&&typeof dh=="function"&&(i=dh(i._payload));const c=v.Children.toArray(i),d=c.find(CH);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 Li=qm("Slot");function jH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(mD(a)&&typeof dh=="function"&&(a=dh(a._payload)),v.isValidElement(a)){const o=AH(a),c=_H(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(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 NH=Symbol("radix.slottable");function CH(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NH}function _H(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 AH(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 Hy=768;function EH(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Hy-1}px)`),r=()=>{t(window.innerWidth<Hy)};return n.addEventListener("change",r),t(window.innerWidth<Hy),()=>n.removeEventListener("change",r)},[]),!!e}const zj=Io("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"}}),se=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Li:"button";return s.jsx(o,{className:Se(zj({variant:t,size:n,className:e})),ref:i,...a})});se.displayName="Button";const ht=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}));ht.displayName="Input";var PH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],OH=PH.reduce((e,t)=>{const n=qm(`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}},{}),kH="Separator",BE="horizontal",RH=["horizontal","vertical"],vD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=BE,...a}=e,i=TH(r)?r:BE,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(OH.div,{"data-orientation":i,...c,...a,ref:t})});vD.displayName=kH;function TH(e){return RH.includes(e)}var gD=vD;const yD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(gD,{ref:a,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));yD.displayName=gD.displayName;var Ky="focusScope.autoFocusOnMount",Gy="focusScope.autoFocusOnUnmount",zE={bubbles:!1,cancelable:!0},IH="FocusScope",Xd=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=Pn(a),h=Pn(i),p=v.useRef(null),y=ut(t,b=>d(b)),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let b=function(_){if(g.paused||!c)return;const P=_.target;c.contains(P)?p.current=P:ji(p.current,{select:!0})},x=function(_){if(g.paused||!c)return;const P=_.relatedTarget;P!==null&&(c.contains(P)||ji(p.current,{select:!0}))},j=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&ji(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",x);const N=new MutationObserver(j);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",x),N.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){qE.add(g);const b=document.activeElement;if(!c.contains(b)){const j=new CustomEvent(Ky,zE);c.addEventListener(Ky,f),c.dispatchEvent(j),j.defaultPrevented||(MH(BH(xD(c)),{select:!0}),document.activeElement===b&&ji(c))}return()=>{c.removeEventListener(Ky,f),setTimeout(()=>{const j=new CustomEvent(Gy,zE);c.addEventListener(Gy,h),c.dispatchEvent(j),j.defaultPrevented||ji(b??document.body,{select:!0}),c.removeEventListener(Gy,h),qE.remove(g)},0)}}},[c,f,h,g]);const S=v.useCallback(b=>{if(!n&&!r||g.paused)return;const x=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,j=document.activeElement;if(x&&j){const N=b.currentTarget,[_,P]=$H(N);_&&P?!b.shiftKey&&j===P?(b.preventDefault(),n&&ji(_,{select:!0})):b.shiftKey&&j===_&&(b.preventDefault(),n&&ji(P,{select:!0})):j===N&&b.preventDefault()}},[n,r,g.paused]);return s.jsx(De.div,{tabIndex:-1,...o,ref:y,onKeyDown:S})});Xd.displayName=IH;function MH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ji(r,{select:t}),document.activeElement!==n)return}function $H(e){const t=xD(e),n=UE(t,e),r=UE(t.reverse(),e);return[n,r]}function xD(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 UE(e,t){for(const n of e)if(!DH(n,{upTo:t}))return n}function DH(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 LH(e){return e instanceof HTMLInputElement&&"select"in e}function ji(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LH(e)&&t&&e.select()}}var qE=FH();function FH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=WE(e,t),e.unshift(t)},remove(t){e=WE(e,t),e[0]?.resume()}}}function WE(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function BH(e){return e.filter(t=>t.tagName!=="A")}var Yy=0;function Wm(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??VE()),document.body.insertAdjacentElement("beforeend",e[1]??VE()),Yy++,()=>{Yy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yy--}},[])}function VE(){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 rs=function(){return rs=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},rs.apply(this,arguments)};function bD(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 zH(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 Zp="right-scroll-bar-position",eh="width-before-scroll-bar",UH="with-scroll-bars-hidden",qH="--removed-body-scroll-bar-size";function Xy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function WH(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 VH=typeof window<"u"?v.useLayoutEffect:v.useEffect,HE=new WeakMap;function HH(e,t){var n=WH(null,function(r){return e.forEach(function(a){return Xy(a,r)})});return VH(function(){var r=HE.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||Xy(c,null)}),i.forEach(function(c){a.has(c)||Xy(c,o)})}HE.set(n,e)},[e]),n}function KH(e){return e}function GH(e,t){t===void 0&&(t=KH);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 YH(e){e===void 0&&(e={});var t=GH(null);return t.options=rs({async:!0,ssr:!1},e),t}var wD=function(e){var t=e.sideCar,n=bD(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,rs({},n))};wD.isSideCarExport=!0;function XH(e,t){return e.useMedium(t),wD}var SD=YH(),Qy=function(){},Vm=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Qy,onWheelCapture:Qy,onTouchMoveCapture:Qy}),a=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,y=e.sideCar,g=e.noRelative,S=e.noIsolation,b=e.inert,x=e.allowPinchZoom,j=e.as,N=j===void 0?"div":j,_=e.gapMode,P=bD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=y,O=HH([n,t]),k=rs(rs({},P),a);return v.createElement(v.Fragment,null,h&&v.createElement(A,{sideCar:SD,removeScrollBar:f,shards:p,noRelative:g,noIsolation:S,inert:b,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:_}),o?v.cloneElement(v.Children.only(c),rs(rs({},k),{ref:O})):v.createElement(N,rs({},k,{className:d,ref:O}),c))});Vm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vm.classNames={fullWidth:eh,zeroRight:Zp};var QH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=QH();return t&&e.setAttribute("nonce",t),e}function ZH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=JH())&&(ZH(t,n),eK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nK=function(){var e=tK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},jD=function(){var e=nK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},rK={left:0,top:0,right:0,gap:0},Jy=function(e){return parseInt(e||"",10)||0},aK=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[Jy(n),Jy(r),Jy(a)]},sK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rK;var t=aK(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])}},iK=jD(),Il="data-scroll-locked",oK=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(UH,` {
11
+ overflow: hidden `).concat(r,`;
12
+ padding-right: `).concat(c,"px ").concat(r,`;
13
+ }
14
+ body[`).concat(Il,`] {
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(Zp,` {
28
+ right: `).concat(c,"px ").concat(r,`;
29
+ }
30
+
31
+ .`).concat(eh,` {
32
+ margin-right: `).concat(c,"px ").concat(r,`;
33
+ }
34
+
35
+ .`).concat(Zp," .").concat(Zp,` {
36
+ right: 0 `).concat(r,`;
37
+ }
38
+
39
+ .`).concat(eh," .").concat(eh,` {
40
+ margin-right: 0 `).concat(r,`;
41
+ }
42
+
43
+ body[`).concat(Il,`] {
44
+ `).concat(qH,": ").concat(c,`px;
45
+ }
46
+ `)},KE=function(){var e=parseInt(document.body.getAttribute(Il)||"0",10);return isFinite(e)?e:0},lK=function(){v.useEffect(function(){return document.body.setAttribute(Il,(KE()+1).toString()),function(){var e=KE()-1;e<=0?document.body.removeAttribute(Il):document.body.setAttribute(Il,e.toString())}},[])},cK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;lK();var i=v.useMemo(function(){return sK(a)},[a]);return v.createElement(iK,{styles:oK(i,!t,a,n?"":"!important")})},O1=!1;if(typeof window<"u")try{var Pp=Object.defineProperty({},"passive",{get:function(){return O1=!0,!0}});window.addEventListener("test",Pp,Pp),window.removeEventListener("test",Pp,Pp)}catch{O1=!1}var pl=O1?{passive:!1}:!1,uK=function(e){return e.tagName==="TEXTAREA"},ND=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uK(e)&&n[t]==="visible")},dK=function(e){return ND(e,"overflowY")},fK=function(e){return ND(e,"overflowX")},GE=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=CD(e,r);if(a){var i=_D(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},hK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},CD=function(e,t){return e==="v"?dK(t):fK(t)},_D=function(e,t){return e==="v"?pK(t):hK(t)},mK=function(e,t){return e==="h"&&t==="rtl"?-1:1},vK=function(e,t,n,r,a){var i=mK(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,y=0;do{if(!c)break;var g=_D(e,c),S=g[0],b=g[1],x=g[2],j=b-x-i*S;(S||j)&&CD(e,c)&&(p+=j,y+=S);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(y)<1)&&(f=!0),f},Op=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},YE=function(e){return[e.deltaX,e.deltaY]},XE=function(e){return e&&"current"in e?e.current:e},gK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yK=function(e){return`
47
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
48
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
+ `)},xK=0,hl=[];function bK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(xK++)[0],i=v.useState(jD)[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 b=zH([e.lockRef.current],(e.shards||[]).map(XE),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(b,x){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var j=Op(b),N=n.current,_="deltaX"in b?b.deltaX:N[0]-j[0],P="deltaY"in b?b.deltaY:N[1]-j[1],A,O=b.target,k=Math.abs(_)>Math.abs(P)?"h":"v";if("touches"in b&&k==="h"&&O.type==="range")return!1;var R=window.getSelection(),$=R&&R.anchorNode,z=$?$===O||$.contains(O):!1;if(z)return!1;var B=GE(k,O);if(!B)return!0;if(B?A=k:(A=k==="v"?"h":"v",B=GE(k,O)),!B)return!1;if(!r.current&&"changedTouches"in b&&(_||P)&&(r.current=A),!A)return!0;var D=r.current||A;return vK(D,x,b,D==="h"?_:P)},[]),d=v.useCallback(function(b){var x=b;if(!(!hl.length||hl[hl.length-1]!==i)){var j="deltaY"in x?YE(x):Op(x),N=t.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&gK(A.delta,j)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}if(!N){var _=(o.current.shards||[]).map(XE).filter(Boolean).filter(function(A){return A.contains(x.target)}),P=_.length>0?c(x,_[0]):!o.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),f=v.useCallback(function(b,x,j,N){var _={name:b,delta:x,target:j,should:N,shadowParent:wK(j)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(P){return P!==_})},1)},[]),h=v.useCallback(function(b){n.current=Op(b),r.current=void 0},[]),p=v.useCallback(function(b){f(b.type,YE(b),b.target,c(b,e.lockRef.current))},[]),y=v.useCallback(function(b){f(b.type,Op(b),b.target,c(b,e.lockRef.current))},[]);v.useEffect(function(){return hl.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:y}),document.addEventListener("wheel",d,pl),document.addEventListener("touchmove",d,pl),document.addEventListener("touchstart",h,pl),function(){hl=hl.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,pl),document.removeEventListener("touchmove",d,pl),document.removeEventListener("touchstart",h,pl)}},[]);var g=e.removeScrollBar,S=e.inert;return v.createElement(v.Fragment,null,S?v.createElement(i,{styles:yK(a)}):null,g?v.createElement(cK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SK=XH(SD,bK);var Qd=v.forwardRef(function(e,t){return v.createElement(Vm,rs({},e,{ref:t,sideCar:SK}))});Qd.classNames=Vm.classNames;var jK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ml=new WeakMap,kp=new WeakMap,Rp={},Zy=0,AD=function(e){return e&&(e.host||AD(e.parentNode))},NK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=AD(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})},CK=function(e,t,n,r){var a=NK(t,Array.isArray(e)?e:[e]);Rp[n]||(Rp[n]=new WeakMap);var i=Rp[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(y){if(c.has(y))h(y);else try{var g=y.getAttribute(r),S=g!==null&&g!=="false",b=(ml.get(y)||0)+1,x=(i.get(y)||0)+1;ml.set(y,b),i.set(y,x),o.push(y),b===1&&S&&kp.set(y,!0),x===1&&y.setAttribute(n,"true"),S||y.setAttribute(r,"true")}catch(j){console.error("aria-hidden: cannot operate on ",y,j)}})};return h(t),c.clear(),Zy++,function(){o.forEach(function(p){var y=ml.get(p)-1,g=i.get(p)-1;ml.set(p,y),i.set(p,g),y||(kp.has(p)||p.removeAttribute(r),kp.delete(p)),g||p.removeAttribute(n)}),Zy--,Zy||(ml=new WeakMap,ml=new WeakMap,kp=new WeakMap,Rp={})}},Hm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=jK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),CK(r,a,n,"aria-hidden")):function(){return null}};function _K(e){const t=AK(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(PK);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 AK(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=kK(a),c=OK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(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 EK=Symbol("radix.slottable");function PK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EK}function OK(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 kK(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 Km="Dialog",[ED,PD]=ir(Km),[RK,Ua]=ED(Km),OD=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]=na({prop:r,defaultProp:a??!1,onChange:i,caller:Km});return s.jsx(RK,{scope:t,triggerRef:c,contentRef:d,contentId:Hn(),titleId:Hn(),descriptionId:Hn(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};OD.displayName=Km;var kD="DialogTrigger",RD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ua(kD,n),i=ut(t,a.triggerRef);return s.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Wj(a.open),...r,ref:i,onClick:Ae(e.onClick,a.onOpenToggle)})});RD.displayName=kD;var Uj="DialogPortal",[TK,TD]=ED(Uj,{forceMount:void 0}),ID=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Ua(Uj,t);return s.jsx(TK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(Gn,{present:n||i.open,children:s.jsx(Sc,{asChild:!0,container:a,children:o})}))})};ID.displayName=Uj;var fh="DialogOverlay",MD=v.forwardRef((e,t)=>{const n=TD(fh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ua(fh,e.__scopeDialog);return i.modal?s.jsx(Gn,{present:r||i.open,children:s.jsx(MK,{...a,ref:t})}):null});MD.displayName=fh;var IK=_K("DialogOverlay.RemoveScroll"),MK=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ua(fh,n);return s.jsx(Qd,{as:IK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(De.div,{"data-state":Wj(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),wo="DialogContent",$D=v.forwardRef((e,t)=>{const n=TD(wo,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ua(wo,e.__scopeDialog);return s.jsx(Gn,{present:r||i.open,children:i.modal?s.jsx($K,{...a,ref:t}):s.jsx(DK,{...a,ref:t})})});$D.displayName=wo;var $K=v.forwardRef((e,t)=>{const n=Ua(wo,e.__scopeDialog),r=v.useRef(null),a=ut(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return Hm(i)},[]),s.jsx(DD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ae(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Ae(e.onFocusOutside,i=>i.preventDefault())})}),DK=v.forwardRef((e,t)=>{const n=Ua(wo,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(DD,{...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()}})}),DD=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Ua(wo,n),d=v.useRef(null),f=ut(t,d);return Wm(),s.jsxs(s.Fragment,{children:[s.jsx(Xd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(To,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Wj(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(FK,{titleId:c.titleId}),s.jsx(zK,{contentRef:d,descriptionId:c.descriptionId})]})]})}),qj="DialogTitle",LD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ua(qj,n);return s.jsx(De.h2,{id:a.titleId,...r,ref:t})});LD.displayName=qj;var FD="DialogDescription",BD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ua(FD,n);return s.jsx(De.p,{id:a.descriptionId,...r,ref:t})});BD.displayName=FD;var zD="DialogClose",UD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ua(zD,n);return s.jsx(De.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>a.onOpenChange(!1))})});UD.displayName=zD;function Wj(e){return e?"open":"closed"}var qD="DialogTitleWarning",[LK,WD]=EU(qD,{contentName:wo,titleName:qj,docsSlug:"dialog"}),FK=({titleId:e})=>{const t=WD(qD),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},BK="DialogDescriptionWarning",zK=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${WD(BK).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Gm=OD,UK=RD,Ym=ID,Pc=MD,Oc=$D,Jd=LD,Zd=BD,Xm=UD;const VD=Gm,qK=Ym,HD=v.forwardRef(({className:e,...t},n)=>s.jsx(Pc,{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}));HD.displayName=Pc.displayName;const WK=Io("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"}}),Vj=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(qK,{children:[s.jsx(HD,{}),s.jsxs(Oc,{ref:a,className:Se(WK({side:e}),t),...r,children:[n,s.jsxs(Xm,{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(Ti,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Vj.displayName=Oc.displayName;const KD=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});KD.displayName="SheetHeader";const GD=v.forwardRef(({className:e,...t},n)=>s.jsx(Jd,{ref:n,className:Se("text-lg font-semibold text-foreground",e),...t}));GD.displayName=Jd.displayName;const VK=v.forwardRef(({className:e,...t},n)=>s.jsx(Zd,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));VK.displayName=Zd.displayName;function QE({className:e,...t}){return s.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}const HK="sidebar:state",KK=3600*24*7,GK="16rem",YK="18rem",XK="3rem",QK="b",YD=v.createContext(null);function ef(){const e=v.useContext(YD);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const XD=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=EH(),[f,h]=v.useState(!1),[p,y]=v.useState(e),g=t??p,S=v.useCallback(N=>{const _=typeof N=="function"?N(g):N;n?n(_):y(_),document.cookie=`${HK}=${_}; path=/; max-age=${KK}`},[n,g]),b=v.useCallback(()=>d?h(N=>!N):S(N=>!N),[d,S,h]);v.useEffect(()=>{const N=_=>{_.key===QK&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),b())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[b]);const x=g?"expanded":"collapsed",j=v.useMemo(()=>({state:x,open:g,setOpen:S,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[x,g,S,d,f,h,b]);return s.jsx(YD.Provider,{value:j,children:s.jsx(Y$,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":GK,"--sidebar-width-icon":XK,...a},className:Se("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});XD.displayName="SidebarProvider";const QD=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}=ef();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(VD,{open:f,onOpenChange:h,...i,children:s.jsx(Vj,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":YK},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})})]})});QD.displayName="Sidebar";const JD=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=ef();return s.jsxs(se,{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(I7,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});JD.displayName="SidebarTrigger";const JK=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=ef();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})});JK.displayName="SidebarRail";const ZK=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}));ZK.displayName="SidebarInset";const eG=v.forwardRef(({className:e,...t},n)=>s.jsx(ht,{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}));eG.displayName="SidebarInput";const ZD=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}));ZD.displayName="SidebarHeader";const e3=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}));e3.displayName="SidebarFooter";const k1=v.forwardRef(({className:e,...t},n)=>s.jsx(yD,{ref:n,"data-sidebar":"separator",className:Se("mx-2 w-auto bg-sidebar-border",e),...t}));k1.displayName="SidebarSeparator";const t3=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}));t3.displayName="SidebarContent";const n3=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}));n3.displayName="SidebarGroup";const r3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Li:"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})});r3.displayName="SidebarGroupLabel";const tG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Li:"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})});tG.displayName="SidebarGroupAction";const a3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:Se("w-full text-sm",e),...t}));a3.displayName="SidebarGroupContent";const s3=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}));s3.displayName="SidebarMenu";const i3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Se("group/menu-item relative",e),...t}));i3.displayName="SidebarMenuItem";const nG=Io("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"}}),o3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?Li:"button",{isMobile:f,state:h}=ef(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Se(nG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(X$,{children:[s.jsx(Q$,{asChild:!0,children:p}),s.jsx(Mj,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});o3.displayName="SidebarMenuButton";const rG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Li:"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})});rG.displayName="SidebarMenuAction";const aG=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}));aG.displayName="SidebarMenuBadge";const sG=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(QE,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(QE,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});sG.displayName="SidebarMenuSkeleton";const iG=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}));iG.displayName="SidebarMenuSub";const oG=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));oG.displayName="SidebarMenuSubItem";const lG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Li:"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})});lG.displayName="SidebarMenuSubButton";const l3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(gH,{ref:i,to:r,className:({isActive:o,isPending:c})=>Se(e,o&&t,c&&n),...a}));l3.displayName="NavLink";function cG({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 uG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:r$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:n$},{title:"Analyze MCP",url:"/tool-analysis",icon:a$}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:t$},{title:"Servers",url:"/libraries/servers",icon:e$},{title:"Agents",url:"/libraries/agents",icon:ha}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:kl},{title:"Evaluation Results",url:"/results",icon:ed},{title:"Compare Evaluations",url:"/compare",icon:wj},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:s$},{title:"Custom Reports",url:"/markdown-reports",icon:rh}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:jj}]}];function dG(e={version:null}){const t=e.version??null,{state:n}=ef(),r=n==="collapsed",a=vs(),i=v.useMemo(()=>uG,[]);return s.jsxs(QD,{collapsible:"icon",children:[s.jsx(ZD,{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(cG,{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(t3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(k1,{className:"my-1.5"}),s.jsxs(n3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(r3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(a3,{children:s.jsx(s3,{children:o.items.map(d=>s.jsx(i3,{children:s.jsx(o3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(l3,{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(e3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(k1,{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(k7,{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 c3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));c3.displayName="Breadcrumb";const u3=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}));u3.displayName="BreadcrumbList";const d3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:Se("inline-flex items-center gap-1.5",e),...t}));d3.displayName="BreadcrumbItem";const f3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?Li:"a";return s.jsx(a,{ref:r,className:Se("transition-colors hover:text-foreground",t),...n})});f3.displayName="BreadcrumbLink";const p3=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}));p3.displayName="BreadcrumbPage";const h3=({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(ZM,{})});h3.displayName="BreadcrumbSeparator";function fG(e,t){return`${e}-${t+1}`}function bl(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 y=String(p.id||p.name||"").trim();if(!y)continue;const g=y;a.set(y,g);const S=p.auth?.type==="bearer"?"bearer":p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:g,name:String(p.name||y),transport:"streamable-http",url:p.url,authType:S,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?.type==="oauth_client_credentials"?p.auth.scope:void 0,oauthTokenUrl:p.auth?.type==="oauth_client_credentials"?p.auth.token_url:void 0,oauthClientIdEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_id_env:void 0,oauthClientSecretEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_secret_env:void 0,oauthAudience:p.auth?.type==="oauth_client_credentials"?p.auth.audience:void 0};i.push(b),o.push({kind:"inline",server:b})}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 y=String(p.id||p.name||"").trim();if(!y)continue;const g=y,S=p.provider==="azure_openai"?"azure":p.provider,b={id:g,name:String(p.name||y),provider:S,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,systemPrompt:p.system};c.push(b),d.push({kind:"inline",agent:b})}const f=[],h=[];return e.config.scenarios.forEach((p,y)=>{if("ref"in p){const b=String(p.ref||"").trim();if(!b)return;h.push({kind:"referenced",ref:b});return}const g=[];for(const b of p.eval?.tool_constraints?.required_tools??[])g.push({type:"required_tool",value:b});for(const b of p.eval?.tool_constraints?.forbidden_tools??[])g.push({type:"forbidden_tool",value:b});for(const b of p.eval?.response_assertions??[])b.type==="regex"?g.push({type:"response_contains",value:b.pattern}):g.push({type:"response_contains",value:`${b.path}${b.equals!==void 0?` == ${b.equals}`:""}`});const S={id:p.id||fG("scn",y),name:p.name||p.id||`Scenario ${y+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(x=>a.get(x)??x).filter(Boolean);const b=p.mcp_servers;return Array.isArray(b)?b.flatMap(x=>{if("ref"in x&&x.ref)return[String(x.ref)];if("id"in x&&x.id){const j=String(x.id);if(!a.has(j)){a.set(j,j);const N=x.auth,_=N?.type==="bearer"?"bearer":N?.type==="oauth_client_credentials"?"api-key":N?.type==="oauth_authorization_code"?"oauth2":"none";i.push({id:j,name:String(x.name||j),transport:"streamable-http",url:String(x.url||""),authType:_,authValue:N?.type==="bearer"?String(N.env||""):void 0,oauthClientId:N?.type==="oauth_authorization_code"?String(N.client_id||""):void 0,oauthClientSecret:N?.type==="oauth_authorization_code"?String(N.client_secret||""):void 0,oauthRedirectUrl:N?.type==="oauth_authorization_code"?String(N.redirect_url||""):void 0,oauthScope:(N?.type==="oauth_authorization_code"||N?.type==="oauth_client_credentials")&&String(N.scope||"")||void 0,oauthTokenUrl:N?.type==="oauth_client_credentials"?String(N.token_url||""):void 0,oauthClientIdEnv:N?.type==="oauth_client_credentials"?String(N.client_id_env||""):void 0,oauthClientSecretEnv:N?.type==="oauth_client_credentials"?String(N.client_secret_env||""):void 0,oauthAudience:N?.type==="oauth_client_credentials"&&String(N.audience||"")||void 0}),o.push({kind:"inline",server:i[i.length-1]})}return[j]}return[]}):[]})(),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:g,extractRules:(p.extract??[]).map(b=>({name:b.name,pattern:b.regex}))};f.push(S),h.push({kind:"inline",scenario:S})}),{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 pG(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=bl(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function JE(e){const t=new Map,n=g=>{const S=g.id,b=g.authType==="bearer"?{type:"bearer",env:g.authValue||"MCP_TOKEN"}:g.authType==="api-key"?{type:"oauth_client_credentials",token_url:g.oauthTokenUrl||"",client_id_env:g.oauthClientIdEnv||"",client_secret_env:g.oauthClientSecretEnv||"",...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAudience?{audience:g.oauthAudience}:{}}: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;return{id:S,...g.name&&g.name!==S?{name:g.name}:{},transport:"http",url:g.url||"http://localhost:3000/mcp",...b!==void 0?{auth:b}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(g=>({kind:"inline",server:g}))],a=new Set,i=new Map,o=r.flatMap(g=>{if(g.kind==="referenced"){const b=String(g.ref||"").trim();return!b||a.has(b)?[]:(a.add(b),t.set(b,b),[{ref:b}])}const S=n(g.server);return t.set(g.server.id,S.id),i.set(S.id,S),[S]}),c=g=>{const S=g.id;return{id:S,...g.name&&g.name!==S?{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}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(g=>({kind:"inline",agent:g}))],f=new Set,h=d.flatMap(g=>{if(g.kind==="referenced"){const S=String(g.ref||"").trim();return!S||f.has(S)?[]:(f.add(S),[{ref:S}])}return[c(g.agent)]}),p=g=>{const S=g.evalRules.filter(j=>j.type==="required_tool").map(j=>j.value),b=g.evalRules.filter(j=>j.type==="forbidden_tool").map(j=>j.value),x=g.evalRules.filter(j=>j.type==="response_contains"||j.type==="response_not_contains").map(j=>({type:"regex",pattern:j.value}));return{id:g.id,name:g.name||void 0,mcp_servers:g.serverIds.length>0?g.serverIds.map(j=>{const N=t.get(j)??j;return i.get(N)??{ref:N}}):void 0,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:S,forbidden_tools:b},response_assertions:x},extract:g.extractRules.map(j=>({name:j.name,from:"final_text",regex:j.pattern}))}},y=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(g=>g.kind==="referenced"?{ref:g.ref}:p(g.scenario)):[...e.scenarios.map(g=>p(g))];return{name:e.configName?.trim()||void 0,servers:o,agents:h,scenarios:y,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 hG(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==="api-key"?{type:"oauth_client_credentials",token_url:r.oauthTokenUrl||"",client_id_env:r.oauthClientIdEnv||"",client_secret_env:r.oauthClientSecretEnv||"",...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAudience?{audience:r.oauthAudience}:{}}: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,mcp_servers:r.serverIds.length>0?r.serverIds.map(a=>({ref:a})):void 0,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 mG(e,t){if(e)return`${e}::${t??""}`}function Tp(e){return e.type==="text"}function vG(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 gG(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(Tp);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 y of d.content)y.type==="tool_result"&&(y.tool_use_id?h.set(y.tool_use_id,y):p.push(y));for(const y of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:ZE(y.input??{}),toolName:y.name,timestamp:o.ts});const g=h.get(y.id);if(!g)continue;const S=g.content.filter(Tp).map(b=>b.text).join(`
54
+ `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:S,toolName:g.name,ok:!g.is_error,durationMs:g.duration_ms,timestamp:g.ts_end??d.ts}),h.delete(y.id)}for(const y of[...h.values(),...p]){const g=y.content.filter(Tp).map(S=>S.text).join(`
55
+ `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:g,toolName:y.name,ok:!y.is_error,durationMs:y.duration_ms,timestamp:y.ts_end??d.ts})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:ZE(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(Tp).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 ZE(e){try{return JSON.stringify(e)}catch{return String(e)}}function eP(e,t=[]){const n=new Map;for(const a of t){const i=mG(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 y=o.get(h.run_index)??i[p];return{runIndex:h.run_index,passed:h.pass,toolCalls:vG(h,y),finalAnswer:h.final_text,conversation:gG(y),duration:h.tool_durations_ms.reduce((g,S)=>g+S,0),extractedValues:Object.fromEntries(Object.entries(h.extracted).map(([g,S])=>[g,String(S??"")])),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 yG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Vu=yG();async function ct(e,t){const n=await fetch(`${Vu}${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 xG(e,t){const n=await fetch(`${Vu}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return n.text()}const rt={health:()=>ct("/api/health"),getSettings:()=>ct("/api/settings"),updateSettings:e=>ct("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>ct("/api/evals"),createConfig:(e,t)=>ct("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>ct(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>ct(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>ct("/api/runs"),listMarkdownReports:()=>ct("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>ct(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>ct(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>ct(`/api/runs/${e}`),deleteRun:e=>ct(`/api/runs/${e}`,{method:"DELETE"}),getRunTrace:e=>ct(`/api/runs/${e}/trace`),listSnapshots:()=>ct("/api/snapshots"),createSnapshotFromRun:(e,t)=>ct("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>ct(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>ct(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>ct(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>ct(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>ct("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>ct(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>ct(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>ct(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>ct(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>ct(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>ct("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>ct(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>ct("/api/libraries"),saveLibraries:e=>ct("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>ct("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>ct(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>ct("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>ct(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>ct(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>ct(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>ct(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>ct(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>ct("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>ct("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>ct(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>ct(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${Vu}/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:()=>ct("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>ct(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>ct(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>ct("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>ct(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>ct(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${Vu}/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)=>ct(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>ct(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?ct(`/api/oauth-debugger/sessions/${e}/export?format=json`):xG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),stopRun:e=>ct(`/api/runs/jobs/${e}/stop`,{method:"POST"}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Vu}/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 bG(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 wG(e){return e||`config-${Date.now()}`}const SG={async listConfigs(){return(await rt.listConfigs()).map(bl)},async createConfig(e){const t=await rt.createConfig(bG(e),JE(e));return bl(t)},async updateConfig(e){const t=await rt.updateConfig(e.id,JE(e),wG(e.name));return bl(t)},async deleteConfig(e){await rt.deleteConfig(e)},async listResults(){const t=(await rt.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([rt.getRun(n.runId),rt.getRunTrace(n.runId)]);return eP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([rt.getRun(e),rt.getRunTrace(e)]);return eP(t,n.records)}catch{return}},async deleteResult(e){await rt.deleteRun(e)},async listMarkdownReports(){return rt.listMarkdownReports()},async getMarkdownReport(e){return rt.getMarkdownReport(e)},async deleteMarkdownReport(e){await rt.deleteMarkdownReport(e)},async startRun(e){return rt.startRun(e)},async stopRun(e){await rt.stopRun(e)},subscribeRunJob(e,t){return rt.subscribeRunJob(e,t)},async listSnapshots(){return rt.listSnapshots()},async createSnapshotFromRun(e,t){return rt.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await rt.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return rt.compareSnapshot(e,t)},async askResultAssistant(e,t){return rt.askResultAssistant(e,t)},async applyResultAssistantReport(e){return rt.applyResultAssistantReport(e)},async createResultAssistantSession(e){return rt.createResultAssistantSession(e)},async getResultAssistantSession(e){return rt.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return rt.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return rt.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return rt.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await rt.closeResultAssistantSession(e)},async generateSnapshotEvalBaseline(e,t,n){const r=await rt.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:bl(r.config)}},async updateSnapshotPolicy(e,t){const n=await rt.updateSnapshotPolicy(e,t);return bl(n)},async getLibraries(){const e=await rt.getLibraries();return pG(e)},async saveLibraries(e){await rt.saveLibraries(hG(e))},async listProviderModels(e){return rt.listProviderModels(e)},async getWorkspaceSettings(){return rt.getSettings()},async updateWorkspaceSettings(e){return rt.updateSettings(e)},async createScenarioAssistantSession(e){return rt.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return rt.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return rt.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return rt.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return rt.denyScenarioAssistantToolCall(e,t)},async closeScenarioAssistantSession(e){await rt.closeScenarioAssistantSession(e)},async discoverToolsForAnalysis(e){return rt.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return rt.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return rt.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return rt.getToolAnalysisResult(e)},async stopToolAnalysis(e){return rt.stopToolAnalysis(e)},async listToolAnalysisResults(){return rt.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return rt.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await rt.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return rt.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return rt.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return rt.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return rt.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return rt.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return rt.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return rt.exportOAuthDebuggerSession(e,t)}},m3=v.createContext(null);function jG({children:e}){const t="workspace",[n,r]=v.useState("checking"),[a,i]=v.useState(null);v.useEffect(()=>{r("checking"),rt.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(m3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function On(){const e=v.useContext(m3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const NG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(Qt("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(Qt("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(Qt("/settings",e))return t.push({label:"Settings"}),t;if(Qt("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(Qt("/tool-analysis-results/:id",e)){const n=Qt("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(Qt("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(Qt("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(Qt("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(Qt("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(Qt("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(Qt("/results",e))return t.push({label:"Evaluation Results"}),t;if(Qt("/run",e))return t.push({label:"Run Evaluation"}),t;if(Qt("/libraries/servers/:serverId",e)){const n=Qt("/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(Qt("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(Qt("/libraries/agents/:agentName",e)){const n=Qt("/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(Qt("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(Qt("/libraries/test-cases/:testCaseId",e)){const n=Qt("/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 Qt("/libraries/test-cases",e)?(t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),t):Qt("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(Qt("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function CG(){const e=vs(),t=new URLSearchParams(e.search).get("embed")==="1",n=NG(e.pathname),{connection:r,version:a}=On();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(DE,{})}):s.jsx(XD,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(dG,{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(JD,{}),s.jsx(c3,{children:s.jsx(u3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(d3,{children:i.to&&!c?s.jsx(f3,{asChild:!0,children:s.jsx(yt,{to:i.to,children:i.label})}):s.jsx(p3,{children:i.label})}),!c&&s.jsx(h3,{})]},`${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(DE,{})})]})]})})}const v3=v.createContext(null);function _G({children:e}){const{source:t}=On(),[n,r]=v.useState([]),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const y=await t.listConfigs();r(y)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[o]);const c=v.useCallback(y=>n.find(g=>g.id===y),[n]),d=v.useCallback(async y=>{const g=await t.createConfig(y);return r(S=>[...S,g]),g},[t]),f=v.useCallback(async(y,g)=>{const S=await t.updateConfig({...g,id:y});return r(b=>b.map(x=>x.id===y?S:x)),S},[t]),h=v.useCallback(async y=>{await t.deleteConfig(y),r(g=>g.filter(S=>S.id!==y))},[t]),p=v.useCallback(async y=>{const g=n.find(x=>x.id===y);if(!g)throw new Error("Config not found");const S={...structuredClone(g),id:`cfg-${Date.now()}`,name:`${g.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},b=await t.createConfig(S);return r(x=>[...x,b]),b},[n,t]);return s.jsx(v3.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function tf(){const e=v.useContext(v3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const g3=v.createContext(null);function AG({children:e}){const{source:t}=On(),[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(g3.Provider,{value:d,children:e})}function qa(){const e=v.useContext(g3);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 Ct=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));Ct.displayName="CardHeader";const _t=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));_t.displayName="CardTitle";const Ds=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Ds.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 EG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));EG.displayName="CardFooter";const Xr=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})}));Xr.displayName="Table";const Qr=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Qr.displayName="TableHeader";const Jr=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Jr.displayName="TableBody";const PG=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}));PG.displayName="TableFooter";const Bt=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}));Bt.displayName="TableRow";const Qe=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}));Qe.displayName="TableHead";const Be=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Be.displayName="TableCell";const OG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));OG.displayName="TableCaption";function Ts({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 kG=Io("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?Li:"div";return s.jsx(a,{className:Se(kG({variant:t}),e),...r})}function vo({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 ex,tP;function Mr(){if(tP)return ex;tP=1;var e=Array.isArray;return ex=e,ex}var tx,nP;function y3(){if(nP)return tx;nP=1;var e=typeof Sp=="object"&&Sp&&Sp.Object===Object&&Sp;return tx=e,tx}var nx,rP;function gs(){if(rP)return nx;rP=1;var e=y3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return nx=n,nx}var rx,aP;function nf(){if(aP)return rx;aP=1;var e=gs(),t=e.Symbol;return rx=t,rx}var ax,sP;function RG(){if(sP)return ax;sP=1;var e=nf(),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 ax=i,ax}var sx,iP;function TG(){if(iP)return sx;iP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return sx=n,sx}var ix,oP;function Ys(){if(oP)return ix;oP=1;var e=nf(),t=RG(),n=TG(),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 ix=o,ix}var ox,lP;function Xs(){if(lP)return ox;lP=1;function e(t){return t!=null&&typeof t=="object"}return ox=e,ox}var lx,cP;function kc(){if(cP)return lx;cP=1;var e=Ys(),t=Xs(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return lx=r,lx}var cx,uP;function Hj(){if(uP)return cx;uP=1;var e=Mr(),t=kc(),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 cx=a,cx}var ux,dP;function Fi(){if(dP)return ux;dP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return ux=e,ux}var dx,fP;function Kj(){if(fP)return dx;fP=1;var e=Ys(),t=Fi(),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 dx=o,dx}var fx,pP;function IG(){if(pP)return fx;pP=1;var e=gs(),t=e["__core-js_shared__"];return fx=t,fx}var px,hP;function MG(){if(hP)return px;hP=1;var e=IG(),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 px=n,px}var hx,mP;function x3(){if(mP)return hx;mP=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 hx=n,hx}var mx,vP;function $G(){if(vP)return mx;vP=1;var e=Kj(),t=MG(),n=Fi(),r=x3(),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(y){if(!n(y)||t(y))return!1;var g=e(y)?h:i;return g.test(r(y))}return mx=p,mx}var vx,gP;function DG(){if(gP)return vx;gP=1;function e(t,n){return t?.[n]}return vx=e,vx}var gx,yP;function $o(){if(yP)return gx;yP=1;var e=$G(),t=DG();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return gx=n,gx}var yx,xP;function Qm(){if(xP)return yx;xP=1;var e=$o(),t=e(Object,"create");return yx=t,yx}var xx,bP;function LG(){if(bP)return xx;bP=1;var e=Qm();function t(){this.__data__=e?e(null):{},this.size=0}return xx=t,xx}var bx,wP;function FG(){if(wP)return bx;wP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return bx=e,bx}var wx,SP;function BG(){if(SP)return wx;SP=1;var e=Qm(),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 wx=a,wx}var Sx,jP;function zG(){if(jP)return Sx;jP=1;var e=Qm(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Sx=r,Sx}var jx,NP;function UG(){if(NP)return jx;NP=1;var e=Qm(),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 jx=n,jx}var Nx,CP;function qG(){if(CP)return Nx;CP=1;var e=LG(),t=FG(),n=BG(),r=zG(),a=UG();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,Nx=i,Nx}var Cx,_P;function WG(){if(_P)return Cx;_P=1;function e(){this.__data__=[],this.size=0}return Cx=e,Cx}var _x,AP;function Gj(){if(AP)return _x;AP=1;function e(t,n){return t===n||t!==t&&n!==n}return _x=e,_x}var Ax,EP;function Jm(){if(EP)return Ax;EP=1;var e=Gj();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return Ax=t,Ax}var Ex,PP;function VG(){if(PP)return Ex;PP=1;var e=Jm(),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 Ex=r,Ex}var Px,OP;function HG(){if(OP)return Px;OP=1;var e=Jm();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Px=t,Px}var Ox,kP;function KG(){if(kP)return Ox;kP=1;var e=Jm();function t(n){return e(this.__data__,n)>-1}return Ox=t,Ox}var kx,RP;function GG(){if(RP)return kx;RP=1;var e=Jm();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 kx=t,kx}var Rx,TP;function Zm(){if(TP)return Rx;TP=1;var e=WG(),t=VG(),n=HG(),r=KG(),a=GG();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,Rx=i,Rx}var Tx,IP;function Yj(){if(IP)return Tx;IP=1;var e=$o(),t=gs(),n=e(t,"Map");return Tx=n,Tx}var Ix,MP;function YG(){if(MP)return Ix;MP=1;var e=qG(),t=Zm(),n=Yj();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Ix=r,Ix}var Mx,$P;function XG(){if($P)return Mx;$P=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Mx=e,Mx}var $x,DP;function ev(){if(DP)return $x;DP=1;var e=XG();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return $x=t,$x}var Dx,LP;function QG(){if(LP)return Dx;LP=1;var e=ev();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Dx=t,Dx}var Lx,FP;function JG(){if(FP)return Lx;FP=1;var e=ev();function t(n){return e(this,n).get(n)}return Lx=t,Lx}var Fx,BP;function ZG(){if(BP)return Fx;BP=1;var e=ev();function t(n){return e(this,n).has(n)}return Fx=t,Fx}var Bx,zP;function eY(){if(zP)return Bx;zP=1;var e=ev();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 Bx=t,Bx}var zx,UP;function Xj(){if(UP)return zx;UP=1;var e=YG(),t=QG(),n=JG(),r=ZG(),a=eY();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,zx=i,zx}var Ux,qP;function b3(){if(qP)return Ux;qP=1;var e=Xj(),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,Ux=n,Ux}var qx,WP;function tY(){if(WP)return qx;WP=1;var e=b3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return qx=n,qx}var Wx,VP;function nY(){if(VP)return Wx;VP=1;var e=tY(),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 Wx=r,Wx}var Vx,HP;function Qj(){if(HP)return Vx;HP=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 Vx=e,Vx}var Hx,KP;function rY(){if(KP)return Hx;KP=1;var e=nf(),t=Qj(),n=Mr(),r=kc(),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 Hx=o,Hx}var Kx,GP;function w3(){if(GP)return Kx;GP=1;var e=rY();function t(n){return n==null?"":e(n)}return Kx=t,Kx}var Gx,YP;function S3(){if(YP)return Gx;YP=1;var e=Mr(),t=Hj(),n=nY(),r=w3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return Gx=a,Gx}var Yx,XP;function tv(){if(XP)return Yx;XP=1;var e=kc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Yx=t,Yx}var Xx,QP;function Jj(){if(QP)return Xx;QP=1;var e=S3(),t=tv();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 Xx=n,Xx}var Qx,JP;function j3(){if(JP)return Qx;JP=1;var e=Jj();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return Qx=t,Qx}var aY=j3();const ea=Wt(aY);var Jx,ZP;function sY(){if(ZP)return Jx;ZP=1;function e(t){return t==null}return Jx=e,Jx}var iY=sY();const xt=Wt(iY);var Zx,eO;function oY(){if(eO)return Zx;eO=1;var e=Ys(),t=Mr(),n=Xs(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return Zx=a,Zx}var lY=oY();const So=Wt(lY);var cY=Kj();const gt=Wt(cY);var uY=Fi();const Rc=Wt(uY);var eb={exports:{}},Lt={};var tO;function dY(){if(tO)return Lt;tO=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"),y=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),S;S=Symbol.for("react.module.reference");function b(x){if(typeof x=="object"&&x!==null){var j=x.$$typeof;switch(j){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 y:case p:case i:return x;default:return j}}case t:return j}}}return Lt.ContextConsumer=o,Lt.ContextProvider=i,Lt.Element=e,Lt.ForwardRef=d,Lt.Fragment=n,Lt.Lazy=y,Lt.Memo=p,Lt.Portal=t,Lt.Profiler=a,Lt.StrictMode=r,Lt.Suspense=f,Lt.SuspenseList=h,Lt.isAsyncMode=function(){return!1},Lt.isConcurrentMode=function(){return!1},Lt.isContextConsumer=function(x){return b(x)===o},Lt.isContextProvider=function(x){return b(x)===i},Lt.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Lt.isForwardRef=function(x){return b(x)===d},Lt.isFragment=function(x){return b(x)===n},Lt.isLazy=function(x){return b(x)===y},Lt.isMemo=function(x){return b(x)===p},Lt.isPortal=function(x){return b(x)===t},Lt.isProfiler=function(x){return b(x)===a},Lt.isStrictMode=function(x){return b(x)===r},Lt.isSuspense=function(x){return b(x)===f},Lt.isSuspenseList=function(x){return b(x)===h},Lt.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===a||x===r||x===f||x===h||x===g||typeof x=="object"&&x!==null&&(x.$$typeof===y||x.$$typeof===p||x.$$typeof===i||x.$$typeof===o||x.$$typeof===d||x.$$typeof===S||x.getModuleId!==void 0)},Lt.typeOf=b,Lt}var nO;function fY(){return nO||(nO=1,eb.exports=dY()),eb.exports}var pY=fY(),tb,rO;function N3(){if(rO)return tb;rO=1;var e=Ys(),t=Xs(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return tb=r,tb}var nb,aO;function hY(){if(aO)return nb;aO=1;var e=N3();function t(n){return e(n)&&n!=+n}return nb=t,nb}var mY=hY();const rf=Wt(mY);var vY=N3();const gY=Wt(vY);var br=function(t){return t===0?0:t>0?1:-1},fo=function(t){return So(t)&&t.indexOf("%")===t.length-1},$e=function(t){return gY(t)&&!rf(t)},yY=function(t){return xt(t)},Vn=function(t){return $e(t)||So(t)},xY=0,Tc=function(t){var n=++xY;return"".concat(t||"").concat(n)},wr=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(!$e(t)&&!So(t))return r;var i;if(fo(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return rf(i)&&(i=r),a&&i>n&&(i=n),i},wl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},bY=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},Gr=function(t,n){return $e(t)&&$e(n)?function(r){return t+r*(n-t)}:function(){return n}};function ph(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):ea(r,t))===n})}var wY=function(t,n){return $e(t)&&$e(n)?t-n:So(t)&&So(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Ml(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 R1(e){"@babel/helpers - typeof";return R1=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},R1(e)}var SY=["viewBox","children"],jY=["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"],sO=["points","pathLength"],rb={svg:SY,polygon:sO,polyline:sO},Zj=["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"],hh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!Rc(r))return null;var a={};return Object.keys(r).forEach(function(i){Zj.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},NY=function(t,n,r){return function(a){return t(n,r,a),null}},jo=function(t,n,r){if(!Rc(t)||R1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];Zj.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=NY(o,n,r))}),a},CY=["children"],_Y=["children"];function iO(e,t){if(e==null)return{};var n=AY(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 AY(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 T1(e){"@babel/helpers - typeof";return T1=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},T1(e)}var oO={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"},Ls=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},lO=null,ab=null,eN=function e(t){if(t===lO&&Array.isArray(ab))return ab;var n=[];return v.Children.forEach(t,function(r){xt(r)||(pY.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),ab=n,lO=t,n};function ta(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Ls(a)}):r=[Ls(t)],eN(e).forEach(function(a){var i=ea(a,"type.displayName")||ea(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Vr(e,t){var n=ta(e,t);return n&&n[0]}var cO=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!$e(r)||r<=0||!$e(a)||a<=0)},EY=["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"],PY=function(t){return t&&t.type&&So(t.type)&&EY.indexOf(t.type)>=0},OY=function(t){return t&&T1(t)==="object"&&"clipDot"in t},kY=function(t,n,r,a){var i,o=(i=rb?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!gt(t)&&(a&&o.includes(n)||jY.includes(n))||r&&Zj.includes(n)},ft=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!Rc(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;kY((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},I1=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 uO(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(!uO(i,o))return!1}return!0},uO=function(t,n){if(xt(t)&&xt(n))return!0;if(!xt(t)&&!xt(n)){var r=t.props||{},a=r.children,i=iO(r,CY),o=n.props||{},c=o.children,d=iO(o,_Y);return a&&c?Ml(i,d)&&I1(a,c):!a&&!c?Ml(i,d):!1}return!1},dO=function(t,n){var r=[],a={};return eN(t).forEach(function(i,o){if(PY(i))r.push(i);else if(i){var c=Ls(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},RY=function(t){var n=t&&t.type;return n&&oO[n]?oO[n]:null},TY=function(t,n){return eN(n).indexOf(t)},IY=["children","width","height","viewBox","className","style","title","desc"];function M1(){return M1=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},M1.apply(this,arguments)}function MY(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 $1(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=MY(e,IY),h=a||{width:n,height:r,x:0,y:0},p=bt("recharts-surface",i);return q.createElement("svg",M1({},ft(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),q.createElement("title",null,c),q.createElement("desc",null,d),t)}var DY=["children","className"];function D1(){return D1=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},D1.apply(this,arguments)}function LY(e,t){if(e==null)return{};var n=FY(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 FY(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 It=q.forwardRef(function(e,t){var n=e.children,r=e.className,a=LY(e,DY),i=bt("recharts-layer",r);return q.createElement("g",D1({className:i},ft(a,!0),{ref:t}),n)}),Fs=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]},sb,fO;function BY(){if(fO)return sb;fO=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 sb=e,sb}var ib,pO;function zY(){if(pO)return ib;pO=1;var e=BY();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 ib=t,ib}var ob,hO;function C3(){if(hO)return ob;hO=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 ob=d,ob}var lb,mO;function UY(){if(mO)return lb;mO=1;function e(t){return t.split("")}return lb=e,lb}var cb,vO;function qY(){if(vO)return cb;vO=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}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",S=f+"?",b="["+i+"]?",x="(?:"+g+"(?:"+[h,p,y].join("|")+")"+b+S+")*",j=b+S+x,N="(?:"+[h+c+"?",c,p,y,o].join("|")+")",_=RegExp(d+"(?="+d+")|"+N+j,"g");function P(A){return A.match(_)||[]}return cb=P,cb}var ub,gO;function WY(){if(gO)return ub;gO=1;var e=UY(),t=C3(),n=qY();function r(a){return t(a)?n(a):e(a)}return ub=r,ub}var db,yO;function VY(){if(yO)return db;yO=1;var e=zY(),t=C3(),n=WY(),r=w3();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 db=a,db}var fb,xO;function HY(){if(xO)return fb;xO=1;var e=VY(),t=e("toUpperCase");return fb=t,fb}var KY=HY();const nv=Wt(KY);function an(e){return function(){return e}}const _3=Math.cos,mh=Math.sin,Wa=Math.sqrt,vh=Math.PI,rv=2*vh,L1=Math.PI,F1=2*L1,lo=1e-6,GY=F1-lo;function A3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function YY(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return A3;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 XY{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?A3:YY(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,y=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>lo)if(!(Math.abs(p*d-f*h)>lo)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,S=a-c,b=d*d+f*f,x=g*g+S*S,j=Math.sqrt(b),N=Math.sqrt(y),_=i*Math.tan((L1-Math.acos((b+y-x)/(2*j*N)))/2),P=_/N,A=_/j;Math.abs(P-1)>lo&&this._append`L${t+P*h},${n+P*p}`,this._append`A${i},${i},0,0,${+(p*g>h*S)},${this._x1=t+A*d},${this._y1=n+A*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,y=o?a-i:i-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>lo||Math.abs(this._y1-h)>lo)&&this._append`L${f},${h}`,r&&(y<0&&(y=y%F1+F1),y>GY?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:y>lo&&this._append`A${r},${r},0,${+(y>=L1)},${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 tN(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 XY(t)}function nN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function E3(e){this._context=e}E3.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 av(e){return new E3(e)}function P3(e){return e[0]}function O3(e){return e[1]}function k3(e,t){var n=an(!0),r=null,a=av,i=null,o=tN(c);e=typeof e=="function"?e:e===void 0?P3:an(e),t=typeof t=="function"?t:t===void 0?O3:an(t);function c(d){var f,h=(d=nN(d)).length,p,y=!1,g;for(r==null&&(i=a(g=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===y&&((y=!y)?i.lineStart():i.lineEnd()),y&&i.point(+e(p,f,d),+t(p,f,d));if(g)return i=null,g+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:an(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:an(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:an(!!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 Ip(e,t,n){var r=null,a=an(!0),i=null,o=av,c=null,d=tN(f);e=typeof e=="function"?e:e===void 0?P3:an(+e),t=typeof t=="function"?t:an(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?O3:an(+n);function f(p){var y,g,S,b=(p=nN(p)).length,x,j=!1,N,_=new Array(b),P=new Array(b);for(i==null&&(c=o(N=d())),y=0;y<=b;++y){if(!(y<b&&a(x=p[y],y,p))===j)if(j=!j)g=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),S=y-1;S>=g;--S)c.point(_[S],P[S]);c.lineEnd(),c.areaEnd()}j&&(_[y]=+e(x,y,p),P[y]=+t(x,y,p),c.point(r?+r(x,y,p):_[y],n?+n(x,y,p):P[y]))}if(N)return c=null,N+""||null}function h(){return k3().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:an(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:an(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:an(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:an(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:an(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:an(+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:an(!!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 R3{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 QY(e){return new R3(e,!0)}function JY(e){return new R3(e,!1)}const rN={draw(e,t){const n=Wa(t/vh);e.moveTo(n,0),e.arc(0,0,n,0,rv)}},ZY={draw(e,t){const n=Wa(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()}},T3=Wa(1/3),eX=T3*2,tX={draw(e,t){const n=Wa(t/eX),r=n*T3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},nX={draw(e,t){const n=Wa(t),r=-n/2;e.rect(r,r,n,n)}},rX=.8908130915292852,I3=mh(vh/10)/mh(7*vh/10),aX=mh(rv/10)*I3,sX=-_3(rv/10)*I3,iX={draw(e,t){const n=Wa(t*rX),r=aX*n,a=sX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=rv*i/5,c=_3(o),d=mh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},pb=Wa(3),oX={draw(e,t){const n=-Wa(t/(pb*3));e.moveTo(0,n*2),e.lineTo(-pb*n,-n),e.lineTo(pb*n,-n),e.closePath()}},ca=-.5,ua=Wa(3)/2,B1=1/Wa(12),lX=(B1/2+1)*3,cX={draw(e,t){const n=Wa(t/lX),r=n/2,a=n*B1,i=r,o=n*B1+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(ca*r-ua*a,ua*r+ca*a),e.lineTo(ca*i-ua*o,ua*i+ca*o),e.lineTo(ca*c-ua*d,ua*c+ca*d),e.lineTo(ca*r+ua*a,ca*a-ua*r),e.lineTo(ca*i+ua*o,ca*o-ua*i),e.lineTo(ca*c+ua*d,ca*d-ua*c),e.closePath()}};function uX(e,t){let n=null,r=tN(a);e=typeof e=="function"?e:an(e||rN),t=typeof t=="function"?t:an(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:an(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:an(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function gh(){}function yh(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 M3(e){this._context=e}M3.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:yh(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:yh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dX(e){return new M3(e)}function $3(e){this._context=e}$3.prototype={areaStart:gh,areaEnd:gh,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:yh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fX(e){return new $3(e)}function D3(e){this._context=e}D3.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:yh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pX(e){return new D3(e)}function L3(e){this._context=e}L3.prototype={areaStart:gh,areaEnd:gh,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 hX(e){return new L3(e)}function bO(e){return e<0?-1:1}function wO(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(bO(i)+bO(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function SO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function hb(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 xh(e){this._context=e}xh.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:hb(this,this._t0,SO(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,hb(this,SO(this,n=wO(this,e,t)),n);break;default:hb(this,this._t0,n=wO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function F3(e){this._context=new B3(e)}(F3.prototype=Object.create(xh.prototype)).point=function(e,t){xh.prototype.point.call(this,t,e)};function B3(e){this._context=e}B3.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 mX(e){return new xh(e)}function vX(e){return new F3(e)}function z3(e){this._context=e}z3.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=jO(e),a=jO(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 jO(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 gX(e){return new z3(e)}function sv(e,t){this._context=e,this._t=t}sv.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 yX(e){return new sv(e,.5)}function xX(e){return new sv(e,0)}function bX(e){return new sv(e,1)}function Kl(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 z1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function wX(e,t){return e[t]}function SX(e){const t=[];return t.key=e,t}function jX(){var e=an([]),t=z1,n=Kl,r=wX;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=nN(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:an(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:an(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?z1:typeof i=="function"?i:an(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??Kl,a):n},a}function NX(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}Kl(e,t)}}function CX(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}Kl(e,t)}}function _X(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,y=h[r-1][1]||0,g=(p-y)/2,S=0;S<c;++S){var b=e[t[S]],x=b[r][1]||0,j=b[r-1][1]||0;g+=x-j}d+=p,f+=g*p}a[r-1][1]+=a[r-1][0]=n,d&&(n-=f/d)}a[r-1][1]+=a[r-1][0]=n,Kl(e,t)}}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)}var AX=["type","size","sizeType"];function U1(){return U1=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},U1.apply(this,arguments)}function NO(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?NO(Object(n),!0).forEach(function(r){EX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EX(e,t,n){return t=PX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PX(e){var t=OX(e,"string");return od(t)=="symbol"?t:t+""}function OX(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 kX(e,t){if(e==null)return{};var n=RX(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 RX(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 U3={symbolCircle:rN,symbolCross:ZY,symbolDiamond:tX,symbolSquare:nX,symbolStar:iX,symbolTriangle:oX,symbolWye:cX},TX=Math.PI/180,IX=function(t){var n="symbol".concat(nv(t));return U3[n]||rN},MX=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*TX;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}},$X=function(t,n){U3["symbol".concat(nv(t))]=n},aN=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=kX(t,AX),f=CO(CO({},d),{},{type:r,size:i,sizeType:c}),h=function(){var x=IX(r),j=uX().type(x).size(MX(i,c,r));return j()},p=f.className,y=f.cx,g=f.cy,S=ft(f,!0);return y===+y&&g===+g&&i===+i?q.createElement("path",U1({},S,{className:bt("recharts-symbols",p),transform:"translate(".concat(y,", ").concat(g,")"),d:h()})):null};aN.registerSymbol=$X;function Gl(e){"@babel/helpers - typeof";return Gl=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},Gl(e)}function q1(){return q1=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},q1.apply(this,arguments)}function _O(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 DX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_O(Object(n),!0).forEach(function(r){ld(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_O(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FX(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,W3(r.key),r)}}function BX(e,t,n){return t&&FX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zX(e,t,n){return t=bh(t),UX(e,q3()?Reflect.construct(t,n||[],bh(e).constructor):t.apply(e,n))}function UX(e,t){if(t&&(Gl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qX(e)}function qX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(q3=function(){return!!e})()}function bh(e){return bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},bh(e)}function WX(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&&W1(e,t)}function W1(e,t){return W1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},W1(e,t)}function ld(e,t,n){return t=W3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W3(e){var t=VX(e,"string");return Gl(t)=="symbol"?t:t+""}function VX(e,t){if(Gl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var da=32,sN=(function(e){function t(){return LX(this,t),zX(this,t,arguments)}return WX(t,e),BX(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=da/2,o=da/6,c=da/3,d=r.inactive?a:r.color;if(r.type==="plainline")return q.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:da,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return q.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(da,"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 q.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(da/8,"h").concat(da,"v").concat(da*3/4,"h").concat(-da,"z"),className:"recharts-legend-icon"});if(q.isValidElement(r.legendIcon)){var f=DX({},r);return delete f.legendIcon,q.cloneElement(r.legendIcon,f)}return q.createElement(aN,{fill:d,cx:i,cy:i,size:da,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:da,height:da},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},y={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(g,S){var b=g.formatter||d,x=bt(ld(ld({"recharts-legend-item":!0},"legend-item-".concat(S),!0),"inactive",g.inactive));if(g.type==="none")return null;var j=gt(g.value)?null:g.value;Fs(!gt(g.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=g.inactive?f:g.color;return q.createElement("li",q1({className:x,style:p,key:"legend-item-".concat(S)},jo(r.props,g,S)),q.createElement($1,{width:o,height:o,viewBox:h,style:y},r.renderIcon(g)),q.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},b?b(j,g,S):j))})}},{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 q.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(v.PureComponent);ld(sN,"displayName","Legend");ld(sN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var mb,AO;function HX(){if(AO)return mb;AO=1;var e=Zm();function t(){this.__data__=new e,this.size=0}return mb=t,mb}var vb,EO;function KX(){if(EO)return vb;EO=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return vb=e,vb}var gb,PO;function GX(){if(PO)return gb;PO=1;function e(t){return this.__data__.get(t)}return gb=e,gb}var yb,OO;function YX(){if(OO)return yb;OO=1;function e(t){return this.__data__.has(t)}return yb=e,yb}var xb,kO;function XX(){if(kO)return xb;kO=1;var e=Zm(),t=Yj(),n=Xj(),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 xb=a,xb}var bb,RO;function V3(){if(RO)return bb;RO=1;var e=Zm(),t=HX(),n=KX(),r=GX(),a=YX(),i=XX();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,bb=o,bb}var wb,TO;function QX(){if(TO)return wb;TO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return wb=t,wb}var Sb,IO;function JX(){if(IO)return Sb;IO=1;function e(t){return this.__data__.has(t)}return Sb=e,Sb}var jb,MO;function H3(){if(MO)return jb;MO=1;var e=Xj(),t=QX(),n=JX();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,jb=r,jb}var Nb,$O;function K3(){if($O)return Nb;$O=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 Nb=e,Nb}var Cb,DO;function G3(){if(DO)return Cb;DO=1;function e(t,n){return t.has(n)}return Cb=e,Cb}var _b,LO;function Y3(){if(LO)return _b;LO=1;var e=H3(),t=K3(),n=G3(),r=1,a=2;function i(o,c,d,f,h,p){var y=d&r,g=o.length,S=c.length;if(g!=S&&!(y&&S>g))return!1;var b=p.get(o),x=p.get(c);if(b&&x)return b==c&&x==o;var j=-1,N=!0,_=d&a?new e:void 0;for(p.set(o,c),p.set(c,o);++j<g;){var P=o[j],A=c[j];if(f)var O=y?f(A,P,j,c,o,p):f(P,A,j,o,c,p);if(O!==void 0){if(O)continue;N=!1;break}if(_){if(!t(c,function(k,R){if(!n(_,R)&&(P===k||h(P,k,d,f,p)))return _.push(R)})){N=!1;break}}else if(!(P===A||h(P,A,d,f,p))){N=!1;break}}return p.delete(o),p.delete(c),N}return _b=i,_b}var Ab,FO;function ZX(){if(FO)return Ab;FO=1;var e=gs(),t=e.Uint8Array;return Ab=t,Ab}var Eb,BO;function eQ(){if(BO)return Eb;BO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return Eb=e,Eb}var Pb,zO;function iN(){if(zO)return Pb;zO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return Pb=e,Pb}var Ob,UO;function tQ(){if(UO)return Ob;UO=1;var e=nf(),t=ZX(),n=Gj(),r=Y3(),a=eQ(),i=iN(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",y="[object Number]",g="[object RegExp]",S="[object Set]",b="[object String]",x="[object Symbol]",j="[object ArrayBuffer]",N="[object DataView]",_=e?e.prototype:void 0,P=_?_.valueOf:void 0;function A(O,k,R,$,z,B,D){switch(R){case N:if(O.byteLength!=k.byteLength||O.byteOffset!=k.byteOffset)return!1;O=O.buffer,k=k.buffer;case j:return!(O.byteLength!=k.byteLength||!B(new t(O),new t(k)));case d:case f:case y:return n(+O,+k);case h:return O.name==k.name&&O.message==k.message;case g:case b:return O==k+"";case p:var K=a;case S:var U=$&o;if(K||(K=i),O.size!=k.size&&!U)return!1;var V=D.get(O);if(V)return V==k;$|=c,D.set(O,k);var X=r(K(O),K(k),$,z,B,D);return D.delete(O),X;case x:if(P)return P.call(O)==P.call(k)}return!1}return Ob=A,Ob}var kb,qO;function X3(){if(qO)return kb;qO=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 kb=e,kb}var Rb,WO;function nQ(){if(WO)return Rb;WO=1;var e=X3(),t=Mr();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return Rb=n,Rb}var Tb,VO;function rQ(){if(VO)return Tb;VO=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 Tb=e,Tb}var Ib,HO;function aQ(){if(HO)return Ib;HO=1;function e(){return[]}return Ib=e,Ib}var Mb,KO;function sQ(){if(KO)return Mb;KO=1;var e=rQ(),t=aQ(),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 Mb=i,Mb}var $b,GO;function iQ(){if(GO)return $b;GO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return $b=e,$b}var Db,YO;function oQ(){if(YO)return Db;YO=1;var e=Ys(),t=Xs(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return Db=r,Db}var Lb,XO;function oN(){if(XO)return Lb;XO=1;var e=oQ(),t=Xs(),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 Lb=i,Lb}var Fu={exports:{}},Fb,QO;function lQ(){if(QO)return Fb;QO=1;function e(){return!1}return Fb=e,Fb}Fu.exports;var JO;function Q3(){return JO||(JO=1,(function(e,t){var n=gs(),r=lQ(),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})(Fu,Fu.exports)),Fu.exports}var Bb,ZO;function lN(){if(ZO)return Bb;ZO=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 Bb=n,Bb}var zb,ek;function cN(){if(ek)return zb;ek=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return zb=t,zb}var Ub,tk;function cQ(){if(tk)return Ub;tk=1;var e=Ys(),t=cN(),n=Xs(),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]",y="[object RegExp]",g="[object Set]",S="[object String]",b="[object WeakMap]",x="[object ArrayBuffer]",j="[object DataView]",N="[object Float32Array]",_="[object Float64Array]",P="[object Int8Array]",A="[object Int16Array]",O="[object Int32Array]",k="[object Uint8Array]",R="[object Uint8ClampedArray]",$="[object Uint16Array]",z="[object Uint32Array]",B={};B[N]=B[_]=B[P]=B[A]=B[O]=B[k]=B[R]=B[$]=B[z]=!0,B[r]=B[a]=B[x]=B[i]=B[j]=B[o]=B[c]=B[d]=B[f]=B[h]=B[p]=B[y]=B[g]=B[S]=B[b]=!1;function D(K){return n(K)&&t(K.length)&&!!B[e(K)]}return Ub=D,Ub}var qb,nk;function J3(){if(nk)return qb;nk=1;function e(t){return function(n){return t(n)}}return qb=e,qb}var Bu={exports:{}};Bu.exports;var rk;function uQ(){return rk||(rk=1,(function(e,t){var n=y3(),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})(Bu,Bu.exports)),Bu.exports}var Wb,ak;function Z3(){if(ak)return Wb;ak=1;var e=cQ(),t=J3(),n=uQ(),r=n&&n.isTypedArray,a=r?t(r):e;return Wb=a,Wb}var Vb,sk;function dQ(){if(sk)return Vb;sk=1;var e=iQ(),t=oN(),n=Mr(),r=Q3(),a=lN(),i=Z3(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),y=!p&&t(f),g=!p&&!y&&r(f),S=!p&&!y&&!g&&i(f),b=p||y||g||S,x=b?e(f.length,String):[],j=x.length;for(var N in f)(h||c.call(f,N))&&!(b&&(N=="length"||g&&(N=="offset"||N=="parent")||S&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,j)))&&x.push(N);return x}return Vb=d,Vb}var Hb,ik;function fQ(){if(ik)return Hb;ik=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return Hb=t,Hb}var Kb,ok;function e5(){if(ok)return Kb;ok=1;function e(t,n){return function(r){return t(n(r))}}return Kb=e,Kb}var Gb,lk;function pQ(){if(lk)return Gb;lk=1;var e=e5(),t=e(Object.keys,Object);return Gb=t,Gb}var Yb,ck;function hQ(){if(ck)return Yb;ck=1;var e=fQ(),t=pQ(),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 Yb=a,Yb}var Xb,uk;function af(){if(uk)return Xb;uk=1;var e=Kj(),t=cN();function n(r){return r!=null&&t(r.length)&&!e(r)}return Xb=n,Xb}var Qb,dk;function iv(){if(dk)return Qb;dk=1;var e=dQ(),t=hQ(),n=af();function r(a){return n(a)?e(a):t(a)}return Qb=r,Qb}var Jb,fk;function mQ(){if(fk)return Jb;fk=1;var e=nQ(),t=sQ(),n=iv();function r(a){return e(a,n,t)}return Jb=r,Jb}var Zb,pk;function vQ(){if(pk)return Zb;pk=1;var e=mQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,o,c,d,f,h){var p=c&t,y=e(i),g=y.length,S=e(o),b=S.length;if(g!=b&&!p)return!1;for(var x=g;x--;){var j=y[x];if(!(p?j in o:r.call(o,j)))return!1}var N=h.get(i),_=h.get(o);if(N&&_)return N==o&&_==i;var P=!0;h.set(i,o),h.set(o,i);for(var A=p;++x<g;){j=y[x];var O=i[j],k=o[j];if(d)var R=p?d(k,O,j,o,i,h):d(O,k,j,i,o,h);if(!(R===void 0?O===k||f(O,k,c,d,h):R)){P=!1;break}A||(A=j=="constructor")}if(P&&!A){var $=i.constructor,z=o.constructor;$!=z&&"constructor"in i&&"constructor"in o&&!(typeof $=="function"&&$ instanceof $&&typeof z=="function"&&z instanceof z)&&(P=!1)}return h.delete(i),h.delete(o),P}return Zb=a,Zb}var e0,hk;function gQ(){if(hk)return e0;hk=1;var e=$o(),t=gs(),n=e(t,"DataView");return e0=n,e0}var t0,mk;function yQ(){if(mk)return t0;mk=1;var e=$o(),t=gs(),n=e(t,"Promise");return t0=n,t0}var n0,vk;function t5(){if(vk)return n0;vk=1;var e=$o(),t=gs(),n=e(t,"Set");return n0=n,n0}var r0,gk;function xQ(){if(gk)return r0;gk=1;var e=$o(),t=gs(),n=e(t,"WeakMap");return r0=n,r0}var a0,yk;function bQ(){if(yk)return a0;yk=1;var e=gQ(),t=Yj(),n=yQ(),r=t5(),a=xQ(),i=Ys(),o=x3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",y="[object DataView]",g=o(e),S=o(t),b=o(n),x=o(r),j=o(a),N=i;return(e&&N(new e(new ArrayBuffer(1)))!=y||t&&N(new t)!=c||n&&N(n.resolve())!=f||r&&N(new r)!=h||a&&N(new a)!=p)&&(N=function(_){var P=i(_),A=P==d?_.constructor:void 0,O=A?o(A):"";if(O)switch(O){case g:return y;case S:return c;case b:return f;case x:return h;case j:return p}return P}),a0=N,a0}var s0,xk;function wQ(){if(xk)return s0;xk=1;var e=V3(),t=Y3(),n=tQ(),r=vQ(),a=bQ(),i=Mr(),o=Q3(),c=Z3(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",y=Object.prototype,g=y.hasOwnProperty;function S(b,x,j,N,_,P){var A=i(b),O=i(x),k=A?h:a(b),R=O?h:a(x);k=k==f?p:k,R=R==f?p:R;var $=k==p,z=R==p,B=k==R;if(B&&o(b)){if(!o(x))return!1;A=!0,$=!1}if(B&&!$)return P||(P=new e),A||c(b)?t(b,x,j,N,_,P):n(b,x,k,j,N,_,P);if(!(j&d)){var D=$&&g.call(b,"__wrapped__"),K=z&&g.call(x,"__wrapped__");if(D||K){var U=D?b.value():b,V=K?x.value():x;return P||(P=new e),_(U,V,j,N,P)}}return B?(P||(P=new e),r(b,x,j,N,_,P)):!1}return s0=S,s0}var i0,bk;function uN(){if(bk)return i0;bk=1;var e=wQ(),t=Xs();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 i0=n,i0}var o0,wk;function SQ(){if(wk)return o0;wk=1;var e=V3(),t=uN(),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 y=c[f];if(p&&y[2]?y[1]!==i[y[0]]:!(y[0]in i))return!1}for(;++f<h;){y=c[f];var g=y[0],S=i[g],b=y[1];if(p&&y[2]){if(S===void 0&&!(g in i))return!1}else{var x=new e;if(d)var j=d(S,b,g,i,o,x);if(!(j===void 0?t(b,S,n|r,d,x):j))return!1}}return!0}return o0=a,o0}var l0,Sk;function n5(){if(Sk)return l0;Sk=1;var e=Fi();function t(n){return n===n&&!e(n)}return l0=t,l0}var c0,jk;function jQ(){if(jk)return c0;jk=1;var e=n5(),t=iv();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 c0=n,c0}var u0,Nk;function r5(){if(Nk)return u0;Nk=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return u0=e,u0}var d0,Ck;function NQ(){if(Ck)return d0;Ck=1;var e=SQ(),t=jQ(),n=r5();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 d0=r,d0}var f0,_k;function CQ(){if(_k)return f0;_k=1;function e(t,n){return t!=null&&n in Object(t)}return f0=e,f0}var p0,Ak;function _Q(){if(Ak)return p0;Ak=1;var e=S3(),t=oN(),n=Mr(),r=lN(),a=cN(),i=tv();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,y=!1;++h<p;){var g=i(d[h]);if(!(y=c!=null&&f(c,g)))break;c=c[g]}return y||++h!=p?y:(p=c==null?0:c.length,!!p&&a(p)&&r(g,p)&&(n(c)||t(c)))}return p0=o,p0}var h0,Ek;function AQ(){if(Ek)return h0;Ek=1;var e=CQ(),t=_Q();function n(r,a){return r!=null&&t(r,a,e)}return h0=n,h0}var m0,Pk;function EQ(){if(Pk)return m0;Pk=1;var e=uN(),t=j3(),n=AQ(),r=Hj(),a=n5(),i=r5(),o=tv(),c=1,d=2;function f(h,p){return r(h)&&a(p)?i(o(h),p):function(y){var g=t(y,h);return g===void 0&&g===p?n(y,h):e(p,g,c|d)}}return m0=f,m0}var v0,Ok;function Ic(){if(Ok)return v0;Ok=1;function e(t){return t}return v0=e,v0}var g0,kk;function PQ(){if(kk)return g0;kk=1;function e(t){return function(n){return n?.[t]}}return g0=e,g0}var y0,Rk;function OQ(){if(Rk)return y0;Rk=1;var e=Jj();function t(n){return function(r){return e(r,n)}}return y0=t,y0}var x0,Tk;function kQ(){if(Tk)return x0;Tk=1;var e=PQ(),t=OQ(),n=Hj(),r=tv();function a(i){return n(i)?e(r(i)):t(i)}return x0=a,x0}var b0,Ik;function ys(){if(Ik)return b0;Ik=1;var e=NQ(),t=EQ(),n=Ic(),r=Mr(),a=kQ();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 b0=i,b0}var w0,Mk;function a5(){if(Mk)return w0;Mk=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 w0=e,w0}var S0,$k;function RQ(){if($k)return S0;$k=1;function e(t){return t!==t}return S0=e,S0}var j0,Dk;function TQ(){if(Dk)return j0;Dk=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 j0=e,j0}var N0,Lk;function IQ(){if(Lk)return N0;Lk=1;var e=a5(),t=RQ(),n=TQ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return N0=r,N0}var C0,Fk;function MQ(){if(Fk)return C0;Fk=1;var e=IQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return C0=t,C0}var _0,Bk;function $Q(){if(Bk)return _0;Bk=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 _0=e,_0}var A0,zk;function DQ(){if(zk)return A0;zk=1;function e(){}return A0=e,A0}var E0,Uk;function LQ(){if(Uk)return E0;Uk=1;var e=t5(),t=DQ(),n=iN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return E0=a,E0}var P0,qk;function FQ(){if(qk)return P0;qk=1;var e=H3(),t=MQ(),n=$Q(),r=G3(),a=LQ(),i=iN(),o=200;function c(d,f,h){var p=-1,y=t,g=d.length,S=!0,b=[],x=b;if(h)S=!1,y=n;else if(g>=o){var j=f?null:a(d);if(j)return i(j);S=!1,y=r,x=new e}else x=f?[]:b;e:for(;++p<g;){var N=d[p],_=f?f(N):N;if(N=h||N!==0?N:0,S&&_===_){for(var P=x.length;P--;)if(x[P]===_)continue e;f&&x.push(_),b.push(N)}else y(x,_,h)||(x!==b&&x.push(_),b.push(N))}return b}return P0=c,P0}var O0,Wk;function BQ(){if(Wk)return O0;Wk=1;var e=ys(),t=FQ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return O0=n,O0}var zQ=BQ();const Vk=Wt(zQ);function s5(e,t,n){return t===!0?Vk(e,n):gt(t)?Vk(e,t):e}function Yl(e){"@babel/helpers - typeof";return Yl=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},Yl(e)}var UQ=["ref"];function Hk(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 Os(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hk(Object(n),!0).forEach(function(r){ov(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kk(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,o5(r.key),r)}}function WQ(e,t,n){return t&&Kk(e.prototype,t),n&&Kk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VQ(e,t,n){return t=wh(t),HQ(e,i5()?Reflect.construct(t,n||[],wh(e).constructor):t.apply(e,n))}function HQ(e,t){if(t&&(Yl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KQ(e)}function KQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(i5=function(){return!!e})()}function wh(e){return wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wh(e)}function GQ(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&&V1(e,t)}function V1(e,t){return V1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},V1(e,t)}function ov(e,t,n){return t=o5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o5(e){var t=YQ(e,"string");return Yl(t)=="symbol"?t:t+""}function YQ(e,t){if(Yl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function XQ(e,t){if(e==null)return{};var n=QQ(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 QQ(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 JQ(e){return e.value}function ZQ(e,t){if(q.isValidElement(e))return q.cloneElement(e,t);if(typeof e=="function")return q.createElement(e,t);t.ref;var n=XQ(t,UQ);return q.createElement(sN,n)}var Gk=1,$l=(function(e){function t(){var n;qQ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=VQ(this,t,[].concat(a)),ov(n,"lastBoundingBox",{width:-1,height:-1}),n}return GQ(t,e),WQ(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)>Gk||Math.abs(a.height-this.lastBoundingBox.height)>Gk)&&(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?Os({},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,y;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var g=this.getBBoxSnapshot();p={left:((f||0)-g.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 S=this.getBBoxSnapshot();y={top:((h||0)-S.height)/2}}else y=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Os(Os({},p),y)}},{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=Os(Os({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return q.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){r.wrapperNode=g}},ZQ(i,Os(Os({},this.props),{},{payload:s5(h,f,JQ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=Os(Os({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&$e(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);ov($l,"displayName","Legend");ov($l,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var k0,Yk;function eJ(){if(Yk)return k0;Yk=1;var e=nf(),t=oN(),n=Mr(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return k0=a,k0}var R0,Xk;function l5(){if(Xk)return R0;Xk=1;var e=X3(),t=eJ();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 R0=n,R0}var T0,Qk;function tJ(){if(Qk)return T0;Qk=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 T0=e,T0}var I0,Jk;function nJ(){if(Jk)return I0;Jk=1;var e=tJ(),t=e();return I0=t,I0}var M0,Zk;function c5(){if(Zk)return M0;Zk=1;var e=nJ(),t=iv();function n(r,a){return r&&e(r,a,t)}return M0=n,M0}var $0,eR;function rJ(){if(eR)return $0;eR=1;var e=af();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 $0=t,$0}var D0,tR;function dN(){if(tR)return D0;tR=1;var e=c5(),t=rJ(),n=t(e);return D0=n,D0}var L0,nR;function u5(){if(nR)return L0;nR=1;var e=dN(),t=af();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 L0=n,L0}var F0,rR;function aJ(){if(rR)return F0;rR=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return F0=e,F0}var B0,aR;function sJ(){if(aR)return B0;aR=1;var e=kc();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 B0=t,B0}var z0,sR;function iJ(){if(sR)return z0;sR=1;var e=sJ();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 z0=t,z0}var U0,iR;function oJ(){if(iR)return U0;iR=1;var e=Qj(),t=Jj(),n=ys(),r=u5(),a=aJ(),i=J3(),o=iJ(),c=Ic(),d=Mr();function f(h,p,y){p.length?p=e(p,function(b){return d(b)?function(x){return t(x,b.length===1?b[0]:b)}:b}):p=[c];var g=-1;p=e(p,i(n));var S=r(h,function(b,x,j){var N=e(p,function(_){return _(b)});return{criteria:N,index:++g,value:b}});return a(S,function(b,x){return o(b,x,y)})}return U0=f,U0}var q0,oR;function lJ(){if(oR)return q0;oR=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 q0=e,q0}var W0,lR;function cJ(){if(lR)return W0;lR=1;var e=lJ(),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 W0=n,W0}var V0,cR;function uJ(){if(cR)return V0;cR=1;function e(t){return function(){return t}}return V0=e,V0}var H0,uR;function d5(){if(uR)return H0;uR=1;var e=$o(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return H0=t,H0}var K0,dR;function dJ(){if(dR)return K0;dR=1;var e=uJ(),t=d5(),n=Ic(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return K0=r,K0}var G0,fR;function fJ(){if(fR)return G0;fR=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 G0=r,G0}var Y0,pR;function pJ(){if(pR)return Y0;pR=1;var e=dJ(),t=fJ(),n=t(e);return Y0=n,Y0}var X0,hR;function hJ(){if(hR)return X0;hR=1;var e=Ic(),t=cJ(),n=pJ();function r(a,i){return n(t(a,i,e),a+"")}return X0=r,X0}var Q0,mR;function lv(){if(mR)return Q0;mR=1;var e=Gj(),t=af(),n=lN(),r=Fi();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 Q0=a,Q0}var J0,vR;function mJ(){if(vR)return J0;vR=1;var e=l5(),t=oJ(),n=hJ(),r=lv(),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 J0=a,J0}var vJ=mJ();const fN=Wt(vJ);function cd(e){"@babel/helpers - typeof";return cd=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},cd(e)}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 gJ(e,t){return wJ(e)||bJ(e,t)||xJ(e,t)||yJ()}function yJ(){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 xJ(e,t){if(e){if(typeof e=="string")return gR(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 gR(e,t)}}function gR(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 bJ(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 wJ(e){if(Array.isArray(e))return e}function yR(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 Z0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yR(Object(n),!0).forEach(function(r){SJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SJ(e,t,n){return t=jJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jJ(e){var t=NJ(e,"string");return cd(t)=="symbol"?t:t+""}function NJ(e,t){if(cd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CJ(e){return Array.isArray(e)&&Vn(e[0])&&Vn(e[1])?e.join(" ~ "):e}var _J=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,y=t.itemSorter,g=t.wrapperClassName,S=t.labelClassName,b=t.label,x=t.labelFormatter,j=t.accessibilityLayer,N=j===void 0?!1:j,_=function(){if(h&&h.length){var D={padding:0,margin:0},K=(y?fN(h,y):h).map(function(U,V){if(U.type==="none")return null;var X=Z0({display:"block",paddingTop:4,paddingBottom:4,color:U.color||"#000"},c),Z=U.formatter||p||CJ,T=U.value,L=U.name,Q=T,F=L;if(Z&&Q!=null&&F!=null){var M=Z(T,L,U,V,h);if(Array.isArray(M)){var ee=gJ(M,2);Q=ee[0],F=ee[1]}else Q=M}return q.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(V),style:X},Vn(F)?q.createElement("span",{className:"recharts-tooltip-item-name"},F):null,Vn(F)?q.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,q.createElement("span",{className:"recharts-tooltip-item-value"},Q),q.createElement("span",{className:"recharts-tooltip-item-unit"},U.unit||""))});return q.createElement("ul",{className:"recharts-tooltip-item-list",style:D},K)}return null},P=Z0({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),A=Z0({margin:0},f),O=!xt(b),k=O?b:"",R=bt("recharts-default-tooltip",g),$=bt("recharts-tooltip-label",S);O&&x&&h!==void 0&&h!==null&&(k=x(b,h));var z=N?{role:"status","aria-live":"assertive"}:{};return q.createElement("div",H1({className:R,style:P},z),q.createElement("p",{className:$,style:A},q.isValidElement(k)?k:"".concat(k)),_())};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 Mp(e,t,n){return t=AJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AJ(e){var t=EJ(e,"string");return ud(t)=="symbol"?t:t+""}function EJ(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)}var _u="recharts-tooltip-wrapper",PJ={visibility:"hidden"};function OJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return bt(_u,Mp(Mp(Mp(Mp({},"".concat(_u,"-right"),$e(n)&&t&&$e(t.x)&&n>=t.x),"".concat(_u,"-left"),$e(n)&&t&&$e(t.x)&&n<t.x),"".concat(_u,"-bottom"),$e(r)&&t&&$e(t.y)&&r>=t.y),"".concat(_u,"-top"),$e(r)&&t&&$e(t.y)&&r<t.y))}function xR(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&&$e(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 y=h,g=d[r];return y<g?Math.max(p,d[r]):Math.max(h,d[r])}var S=p+c,b=d[r]+f;return S>b?Math.max(h,d[r]):Math.max(p,d[r])}function kJ(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 RJ(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=xR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=xR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=kJ({translateX:h,translateY:p,useTranslate3d:c})):f=PJ,{cssProperties:f,cssClasses:OJ({translateX:h,translateY:p,coordinate:n})}}function Xl(e){"@babel/helpers - typeof";return Xl=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},Xl(e)}function bR(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 wR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bR(Object(n),!0).forEach(function(r){G1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IJ(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,p5(r.key),r)}}function MJ(e,t,n){return t&&IJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $J(e,t,n){return t=Sh(t),DJ(e,f5()?Reflect.construct(t,n||[],Sh(e).constructor):t.apply(e,n))}function DJ(e,t){if(t&&(Xl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LJ(e)}function LJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f5=function(){return!!e})()}function Sh(e){return Sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sh(e)}function FJ(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&&K1(e,t)}function K1(e,t){return K1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},K1(e,t)}function G1(e,t,n){return t=p5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p5(e){var t=BJ(e,"string");return Xl(t)=="symbol"?t:t+""}function BJ(e,t){if(Xl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var SR=1,zJ=(function(e){function t(){var n;TJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=$J(this,t,[].concat(a)),G1(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),G1(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 FJ(t,e),MJ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>SR||Math.abs(r.height-this.state.lastBoundingBox.height)>SR)&&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,y=a.isAnimationActive,g=a.offset,S=a.position,b=a.reverseDirection,x=a.useTranslate3d,j=a.viewBox,N=a.wrapperStyle,_=RJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:S,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:j}),P=_.cssClasses,A=_.cssProperties,O=wR(wR({transition:y&&i?"transform ".concat(c,"ms ").concat(d):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},N);return q.createElement("div",{tabIndex:-1,className:P,style:O,ref:function(R){r.wrapperNode=R}},f)}}])})(v.PureComponent),UJ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Do={isSsr:UJ()};function Ql(e){"@babel/helpers - typeof";return Ql=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},Ql(e)}function jR(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 NR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jR(Object(n),!0).forEach(function(r){pN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WJ(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,m5(r.key),r)}}function VJ(e,t,n){return t&&WJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HJ(e,t,n){return t=jh(t),KJ(e,h5()?Reflect.construct(t,n||[],jh(e).constructor):t.apply(e,n))}function KJ(e,t){if(t&&(Ql(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GJ(e)}function GJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h5=function(){return!!e})()}function jh(e){return jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jh(e)}function YJ(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 pN(e,t,n){return t=m5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m5(e){var t=XJ(e,"string");return Ql(t)=="symbol"?t:t+""}function XJ(e,t){if(Ql(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ql(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function QJ(e){return e.dataKey}function JJ(e,t){return q.isValidElement(e)?q.cloneElement(e,t):typeof e=="function"?q.createElement(e,t):q.createElement(_J,t)}var Hr=(function(e){function t(){return qJ(this,t),HJ(this,t,arguments)}return YJ(t,e),VJ(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,y=a.isAnimationActive,g=a.offset,S=a.payload,b=a.payloadUniqBy,x=a.position,j=a.reverseDirection,N=a.useTranslate3d,_=a.viewBox,P=a.wrapperStyle,A=S??[];p&&A.length&&(A=s5(S.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),b,QJ));var O=A.length>0;return q.createElement(zJ,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:y,active:i,coordinate:h,hasPayload:O,offset:g,position:x,reverseDirection:j,useTranslate3d:N,viewBox:_,wrapperStyle:P},JJ(f,NR(NR({},this.props),{},{payload:A})))}}])})(v.PureComponent);pN(Hr,"displayName","Tooltip");pN(Hr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Do.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 ew,CR;function ZJ(){if(CR)return ew;CR=1;var e=gs(),t=function(){return e.Date.now()};return ew=t,ew}var tw,_R;function eZ(){if(_R)return tw;_R=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return tw=t,tw}var nw,AR;function tZ(){if(AR)return nw;AR=1;var e=eZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return nw=n,nw}var rw,ER;function v5(){if(ER)return rw;ER=1;var e=tZ(),t=Fi(),n=kc(),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 rw=d,rw}var aw,PR;function nZ(){if(PR)return aw;PR=1;var e=Fi(),t=ZJ(),n=v5(),r="Expected a function",a=Math.max,i=Math.min;function o(c,d,f){var h,p,y,g,S,b,x=0,j=!1,N=!1,_=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(j=!!f.leading,N="maxWait"in f,y=N?a(n(f.maxWait)||0,d):y,_="trailing"in f?!!f.trailing:_);function P(K){var U=h,V=p;return h=p=void 0,x=K,g=c.apply(V,U),g}function A(K){return x=K,S=setTimeout(R,d),j?P(K):g}function O(K){var U=K-b,V=K-x,X=d-U;return N?i(X,y-V):X}function k(K){var U=K-b,V=K-x;return b===void 0||U>=d||U<0||N&&V>=y}function R(){var K=t();if(k(K))return $(K);S=setTimeout(R,O(K))}function $(K){return S=void 0,_&&h?P(K):(h=p=void 0,g)}function z(){S!==void 0&&clearTimeout(S),x=0,h=b=p=S=void 0}function B(){return S===void 0?g:$(t())}function D(){var K=t(),U=k(K);if(h=arguments,p=this,b=K,U){if(S===void 0)return A(b);if(N)return clearTimeout(S),S=setTimeout(R,d),P(b)}return S===void 0&&(S=setTimeout(R,d)),g}return D.cancel=z,D.flush=B,D}return aw=o,aw}var sw,OR;function rZ(){if(OR)return sw;OR=1;var e=nZ(),t=Fi(),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 sw=r,sw}var aZ=rZ();const g5=Wt(aZ);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 kR(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 $p(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){sZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sZ(e,t,n){return t=iZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iZ(e){var t=oZ(e,"string");return dd(t)=="symbol"?t:t+""}function oZ(e,t){if(dd(e)!="object"||!e)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)}function lZ(e,t){return fZ(e)||dZ(e,t)||uZ(e,t)||cZ()}function cZ(){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 uZ(e,t){if(e){if(typeof e=="string")return RR(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 RR(e,t)}}function RR(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 dZ(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 fZ(e){if(Array.isArray(e))return e}var X1=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,y=e.maxHeight,g=e.children,S=e.debounce,b=S===void 0?0:S,x=e.id,j=e.className,N=e.onResize,_=e.style,P=_===void 0?{}:_,A=v.useRef(null),O=v.useRef();O.current=N,v.useImperativeHandle(t,function(){return Object.defineProperty(A.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),A.current},configurable:!0})});var k=v.useState({containerWidth:a.width,containerHeight:a.height}),R=lZ(k,2),$=R[0],z=R[1],B=v.useCallback(function(K,U){z(function(V){var X=Math.round(K),Z=Math.round(U);return V.containerWidth===X&&V.containerHeight===Z?V:{containerWidth:X,containerHeight:Z}})},[]);v.useEffect(function(){var K=function(L){var Q,F=L[0].contentRect,M=F.width,ee=F.height;B(M,ee),(Q=O.current)===null||Q===void 0||Q.call(O,M,ee)};b>0&&(K=g5(K,b,{trailing:!0,leading:!1}));var U=new ResizeObserver(K),V=A.current.getBoundingClientRect(),X=V.width,Z=V.height;return B(X,Z),U.observe(A.current),function(){U.disconnect()}},[B,b]);var D=v.useMemo(function(){var K=$.containerWidth,U=$.containerHeight;if(K<0||U<0)return null;Fs(fo(o)||fo(d),`The width(%s) and height(%s) are both fixed numbers,
62
+ maybe you don't need to use a ResponsiveContainer.`,o,d),Fs(!n||n>0,"The aspect(%s) must be greater than zero.",n);var V=fo(o)?K:o,X=fo(d)?U:d;n&&n>0&&(V?X=V/n:X&&(V=X*n),y&&X>y&&(X=y)),Fs(V>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.`,V,X,o,d,h,p,n);var Z=!Array.isArray(g)&&Ls(g.type).endsWith("Chart");return q.Children.map(g,function(T){return q.isValidElement(T)?v.cloneElement(T,$p({width:V,height:X},Z?{style:$p({height:"100%",width:"100%",maxHeight:X,maxWidth:V},T.props.style)}:{})):T})},[n,g,d,y,p,h,$,o]);return q.createElement("div",{id:x?"".concat(x):void 0,className:bt("recharts-responsive-container",j),style:$p($p({},P),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:y}),ref:A},D)}),cv=function(t){return null};cv.displayName="Cell";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 TR(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 Q1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(n),!0).forEach(function(r){pZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pZ(e,t,n){return t=hZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hZ(e){var t=mZ(e,"string");return fd(t)=="symbol"?t:t+""}function mZ(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 vl={widthCache:{},cacheCount:0},vZ=2e3,gZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},IR="recharts_measurement_span";function yZ(e){var t=Q1({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Hu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Do.isSsr)return{width:0,height:0};var r=yZ(n),a=JSON.stringify({text:t,copyStyle:r});if(vl.widthCache[a])return vl.widthCache[a];try{var i=document.getElementById(IR);i||(i=document.createElement("span"),i.setAttribute("id",IR),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=Q1(Q1({},gZ),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return vl.widthCache[a]=d,++vl.cacheCount>vZ&&(vl.cacheCount=0,vl.widthCache={}),d}catch{return{width:0,height:0}}},xZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 Nh(e,t){return jZ(e)||SZ(e,t)||wZ(e,t)||bZ()}function bZ(){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 wZ(e,t){if(e){if(typeof e=="string")return MR(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 MR(e,t)}}function MR(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 jZ(e){if(Array.isArray(e))return e}function NZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $R(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,_Z(r.key),r)}}function CZ(e,t,n){return t&&$R(e.prototype,t),n&&$R(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _Z(e){var t=AZ(e,"string");return pd(t)=="symbol"?t:t+""}function AZ(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 String(e)}var DR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,LR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,EZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,PZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,y5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},OZ=Object.keys(y5),Nl="NaN";function kZ(e,t){return e*y5[t]}var Dp=(function(){function e(t,n){NZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!EZ.test(n)&&(this.num=NaN,this.unit=""),OZ.includes(n)&&(this.num=kZ(t,n),this.unit="px")}return CZ(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=PZ.exec(n))!==null&&r!==void 0?r:[],i=Nh(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function x5(e){if(e.includes(Nl))return Nl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=DR.exec(t))!==null&&n!==void 0?n:[],a=Nh(r,4),i=a[1],o=a[2],c=a[3],d=Dp.parse(i??""),f=Dp.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return Nl;t=t.replace(DR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,y=(p=LR.exec(t))!==null&&p!==void 0?p:[],g=Nh(y,4),S=g[1],b=g[2],x=g[3],j=Dp.parse(S??""),N=Dp.parse(x??""),_=b==="+"?j.add(N):j.subtract(N);if(_.isNaN())return Nl;t=t.replace(LR,_.toString())}return t}var FR=/\(([^()]*)\)/;function RZ(e){for(var t=e;t.includes("(");){var n=FR.exec(t),r=Nh(n,2),a=r[1];t=t.replace(FR,x5(a))}return t}function TZ(e){var t=e.replace(/\s+/g,"");return t=RZ(t),t=x5(t),t}function IZ(e){try{return TZ(e)}catch{return Nl}}function iw(e){var t=IZ(e.slice(5,-1));return t===Nl?"":t}var MZ=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],$Z=["dx","dy","angle","className","breakAll"];function J1(){return J1=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},J1.apply(this,arguments)}function BR(e,t){if(e==null)return{};var n=DZ(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 DZ(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 zR(e,t){return zZ(e)||BZ(e,t)||FZ(e,t)||LZ()}function LZ(){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 FZ(e,t){if(e){if(typeof e=="string")return UR(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 UR(e,t)}}function UR(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 BZ(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 zZ(e){if(Array.isArray(e))return e}var b5=/[ \f\n\r\t\v\u2028\u2029]+/,w5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];xt(n)||(r?i=n.toString().split(""):i=n.toString().split(b5));var o=i.map(function(d){return{word:d,width:Hu(d,a).width}}),c=r?0:Hu(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},UZ=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=$e(o),p=c,y=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(X,Z){var T=Z.word,L=Z.width,Q=X[X.length-1];if(Q&&(a==null||i||Q.width+L+r<Number(a)))Q.words.push(T),Q.width+=L+r;else{var F={words:[T],width:L};X.push(F)}return X},[])},g=y(n),S=function(V){return V.reduce(function(X,Z){return X.width>Z.width?X:Z})};if(!h)return g;for(var b="…",x=function(V){var X=p.slice(0,V),Z=w5({breakAll:f,style:d,children:X+b}).wordsWithComputedWidth,T=y(Z),L=T.length>o||S(T).width>Number(a);return[L,T]},j=0,N=p.length-1,_=0,P;j<=N&&_<=p.length-1;){var A=Math.floor((j+N)/2),O=A-1,k=x(O),R=zR(k,2),$=R[0],z=R[1],B=x(A),D=zR(B,1),K=D[0];if(!$&&!K&&(j=A+1),$&&K&&(N=A-1),!$&&K){P=z;break}_++}return P||g},qR=function(t){var n=xt(t)?[]:t.toString().split(b5);return[{words:n}]},qZ=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!Do.isSsr){var d,f,h=w5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,y=h.spaceWidth;d=p,f=y}else return qR(a);return UZ({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return qR(a)},WR="#808080",No=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,y=t.textAnchor,g=y===void 0?"start":y,S=t.verticalAnchor,b=S===void 0?"end":S,x=t.fill,j=x===void 0?WR:x,N=BR(t,MZ),_=v.useMemo(function(){return qZ({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,A=N.dy,O=N.angle,k=N.className,R=N.breakAll,$=BR(N,$Z);if(!Vn(r)||!Vn(i))return null;var z=r+($e(P)?P:0),B=i+($e(A)?A:0),D;switch(b){case"start":D=iw("calc(".concat(f,")"));break;case"middle":D=iw("calc(".concat((_.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:D=iw("calc(".concat(_.length-1," * -").concat(c,")"));break}var K=[];if(p){var U=_[0].width,V=N.width;K.push("scale(".concat(($e(V)?V/U:1)/U,")"))}return O&&K.push("rotate(".concat(O,", ").concat(z,", ").concat(B,")")),K.length&&($.transform=K.join(" ")),q.createElement("text",J1({},ft($,!0),{x:z,y:B,className:bt("recharts-text",k),textAnchor:g,fill:j.includes("url")?WR:j}),_.map(function(X,Z){var T=X.words.join(R?"":" ");return q.createElement("tspan",{x:z,dy:Z===0?D:c,key:"".concat(T,"-").concat(Z)},T)}))};function Oi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function WZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function hN(e){let t,n,r;e.length!==2?(t=Oi,n=(c,d)=>Oi(e(c),d),r=(c,d)=>e(c)-d):(t=e===Oi||e===WZ?e:VZ,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 VZ(){return 0}function S5(e){return e===null?NaN:+e}function*HZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const KZ=hN(Oi),sf=KZ.right;hN(S5).center;class VR extends Map{constructor(t,n=XZ){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(HR(this,t))}has(t){return super.has(HR(this,t))}set(t,n){return super.set(GZ(this,t),n)}delete(t){return super.delete(YZ(this,t))}}function HR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function GZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function YZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function XZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QZ(e=Oi){if(e===Oi)return j5;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 j5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const JZ=Math.sqrt(50),ZZ=Math.sqrt(10),eee=Math.sqrt(2);function Ch(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>=JZ?10:i>=ZZ?5:i>=eee?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?Ch(e,t,n*2):[c,d,f]}function Z1(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?Ch(t,e,n):Ch(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 eS(e,t,n){return t=+t,e=+e,n=+n,Ch(e,t,n)[2]}function tS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?eS(t,e,n):eS(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function KR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function GR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function N5(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?j5:QZ(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),y=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),g=Math.max(n,Math.floor(t-f*p/d+y)),S=Math.min(r,Math.floor(t+(d-f)*p/d+y));N5(e,t,g,S,a)}const i=e[t];let o=n,c=r;for(Au(e,n,t),a(e[r],i)>0&&Au(e,n,r);o<c;){for(Au(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Au(e,n,c):(++c,Au(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Au(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function tee(e,t,n){if(e=Float64Array.from(HZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return GR(e);if(t>=1)return KR(e);var r,a=(r-1)*t,i=Math.floor(a),o=KR(N5(e,i).subarray(0,i+1)),c=GR(e.subarray(i+1));return o+(c-o)*(a-i)}}function nee(e,t,n=S5){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 ree(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 Sa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Qs(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 nS=Symbol("implicit");function mN(){var e=new VR,t=[],n=[],r=nS;function a(i){let o=e.get(i);if(o===void 0){if(r!==nS)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 VR;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 mN(t,n).unknown(r)},Sa.apply(a,arguments),a}function hd(){var e=mN().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 y=t().length,g=a<r,S=g?a:r,b=g?r:a;i=(b-S)/Math.max(1,y-d+f*2),c&&(i=Math.floor(i)),S+=(b-S-i*(y-d))*h,o=i*(1-d),c&&(S=Math.round(S),o=Math.round(o));var x=ree(y).map(function(j){return S+i*j});return n(g?x.reverse():x)}return e.domain=function(y){return arguments.length?(t(y),p()):t()},e.range=function(y){return arguments.length?([r,a]=y,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(y){return[r,a]=y,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(y){return arguments.length?(c=!!y,p()):c},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),p()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),p()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,p()):f},e.align=function(y){return arguments.length?(h=Math.max(0,Math.min(1,y)),p()):h},e.copy=function(){return hd(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},Sa.apply(p(),arguments)}function C5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return C5(t())},e}function Ku(){return C5(hd.apply(null,arguments).paddingInner(1))}function vN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function of(){}var md=.7,_h=1/md,Dl="\\s*([+-]?\\d+)\\s*",vd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ls="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aee=/^#([0-9a-f]{3,8})$/,see=new RegExp(`^rgb\\(${Dl},${Dl},${Dl}\\)$`),iee=new RegExp(`^rgb\\(${ls},${ls},${ls}\\)$`),oee=new RegExp(`^rgba\\(${Dl},${Dl},${Dl},${vd}\\)$`),lee=new RegExp(`^rgba\\(${ls},${ls},${ls},${vd}\\)$`),cee=new RegExp(`^hsl\\(${vd},${ls},${ls}\\)$`),uee=new RegExp(`^hsla\\(${vd},${ls},${ls},${vd}\\)$`),YR={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};vN(of,gd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XR,formatHex:XR,formatHex8:dee,formatHsl:fee,formatRgb:QR,toString:QR});function XR(){return this.rgb().formatHex()}function dee(){return this.rgb().formatHex8()}function fee(){return A5(this).formatHsl()}function QR(){return this.rgb().formatRgb()}function gd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=aee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?JR(t):n===3?new Ir(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Lp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Lp(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=see.exec(e))?new Ir(t[1],t[2],t[3],1):(t=iee.exec(e))?new Ir(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=oee.exec(e))?Lp(t[1],t[2],t[3],t[4]):(t=lee.exec(e))?Lp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cee.exec(e))?t2(t[1],t[2]/100,t[3]/100,1):(t=uee.exec(e))?t2(t[1],t[2]/100,t[3]/100,t[4]):YR.hasOwnProperty(e)?JR(YR[e]):e==="transparent"?new Ir(NaN,NaN,NaN,0):null}function JR(e){return new Ir(e>>16&255,e>>8&255,e&255,1)}function Lp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ir(e,t,n,r)}function pee(e){return e instanceof of||(e=gd(e)),e?(e=e.rgb(),new Ir(e.r,e.g,e.b,e.opacity)):new Ir}function rS(e,t,n,r){return arguments.length===1?pee(e):new Ir(e,t,n,r??1)}function Ir(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}vN(Ir,rS,_5(of,{brighter(e){return e=e==null?_h:Math.pow(_h,e),new Ir(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?md:Math.pow(md,e),new Ir(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ir(go(this.r),go(this.g),go(this.b),Ah(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:ZR,formatHex:ZR,formatHex8:hee,formatRgb:e2,toString:e2}));function ZR(){return`#${po(this.r)}${po(this.g)}${po(this.b)}`}function hee(){return`#${po(this.r)}${po(this.g)}${po(this.b)}${po((isNaN(this.opacity)?1:this.opacity)*255)}`}function e2(){const e=Ah(this.opacity);return`${e===1?"rgb(":"rgba("}${go(this.r)}, ${go(this.g)}, ${go(this.b)}${e===1?")":`, ${e})`}`}function Ah(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function go(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function po(e){return e=go(e),(e<16?"0":"")+e.toString(16)}function t2(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 A5(e){if(e instanceof La)return new La(e.h,e.s,e.l,e.opacity);if(e instanceof of||(e=gd(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 mee(e,t,n,r){return arguments.length===1?A5(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}vN(La,mee,_5(of,{brighter(e){return e=e==null?_h:Math.pow(_h,e),new La(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?md:Math.pow(md,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 Ir(ow(e>=240?e-240:e+120,a,r),ow(e,a,r),ow(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new La(n2(this.h),Fp(this.s),Fp(this.l),Ah(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=Ah(this.opacity);return`${e===1?"hsl(":"hsla("}${n2(this.h)}, ${Fp(this.s)*100}%, ${Fp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function n2(e){return e=(e||0)%360,e<0?e+360:e}function Fp(e){return Math.max(0,Math.min(1,e||0))}function ow(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 gN=e=>()=>e;function vee(e,t){return function(n){return e+n*t}}function gee(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 yee(e){return(e=+e)==1?E5:function(t,n){return n-t?gee(t,n,e):gN(isNaN(t)?n:t)}}function E5(e,t){var n=t-e;return n?vee(e,n):gN(isNaN(e)?t:e)}const r2=(function e(t){var n=yee(t);function r(a,i){var o=n((a=rS(a)).r,(i=rS(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=E5(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 xee(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 bee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wee(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]=Mc(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 Eh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function jee(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]=Mc(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var aS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lw=new RegExp(aS.source,"g");function Nee(e){return function(){return e}}function Cee(e){return function(t){return e(t)+""}}function _ee(e,t){var n=aS.lastIndex=lw.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=aS.exec(e))&&(a=lw.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:Eh(r,a)})),n=lw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Cee(d[0].x):Nee(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 Mc(e,t){var n=typeof t,r;return t==null||n==="boolean"?gN(t):(n==="number"?Eh:n==="string"?(r=gd(t))?(t=r,r2):_ee:t instanceof gd?r2:t instanceof Date?See:bee(t)?xee:Array.isArray(t)?wee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?jee:Eh)(e,t)}function yN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Aee(e,t){t===void 0&&(t=e,e=Mc);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 Eee(e){return function(){return e}}function Ph(e){return+e}var a2=[0,1];function Sr(e){return e}function sS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Eee(isNaN(t)?NaN:.5)}function Pee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Oee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=sS(a,r),i=n(o,i)):(r=sS(r,a),i=n(i,o)),function(c){return i(r(c))}}function kee(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]=sS(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=sf(e,c,1,r)-1;return i[d](a[d](c))}}function lf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function uv(){var e=a2,t=a2,n=Mc,r,a,i,o=Sr,c,d,f;function h(){var y=Math.min(e.length,t.length);return o!==Sr&&(o=Pee(e[0],e[y-1])),c=y>2?kee:Oee,d=f=null,p}function p(y){return y==null||isNaN(y=+y)?i:(d||(d=c(e.map(r),t,n)))(r(o(y)))}return p.invert=function(y){return o(a((f||(f=c(t,e.map(r),Eh)))(y)))},p.domain=function(y){return arguments.length?(e=Array.from(y,Ph),h()):e.slice()},p.range=function(y){return arguments.length?(t=Array.from(y),h()):t.slice()},p.rangeRound=function(y){return t=Array.from(y),n=yN,h()},p.clamp=function(y){return arguments.length?(o=y?!0:Sr,h()):o!==Sr},p.interpolate=function(y){return arguments.length?(n=y,h()):n},p.unknown=function(y){return arguments.length?(i=y,p):i},function(y,g){return r=y,a=g,h()}}function xN(){return uv()(Sr,Sr)}function Ree(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Oh(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 Jl(e){return e=Oh(Math.abs(e)),e?e[1]:NaN}function Tee(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 Iee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Mee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yd(e){if(!(t=Mee.exec(e)))throw new Error("invalid format: "+e);var t;return new bN({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]})}yd.prototype=bN.prototype;function bN(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+""}bN.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 $ee(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 kh;function Dee(e,t){var n=Oh(e,t);if(!n)return kh=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(kh=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")+Oh(e,Math.max(0,t+i-1))[0]}function s2(e,t){var n=Oh(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 i2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ree,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)=>s2(e*100,t),r:s2,s:Dee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function o2(e){return e}var l2=Array.prototype.map,c2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lee(e){var t=e.grouping===void 0||e.thousands===void 0?o2:Tee(l2.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?o2:Iee(l2.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,y){p=yd(p);var g=p.fill,S=p.align,b=p.sign,x=p.symbol,j=p.zero,N=p.width,_=p.comma,P=p.precision,A=p.trim,O=p.type;O==="n"?(_=!0,O="g"):i2[O]||(P===void 0&&(P=12),A=!0,O="g"),(j||g==="0"&&S==="=")&&(j=!0,g="0",S="=");var k=(y&&y.prefix!==void 0?y.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),R=(x==="$"?r:/[%p]/.test(O)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),$=i2[O],z=/[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 B(D){var K=k,U=R,V,X,Z;if(O==="c")U=$(D)+U,D="";else{D=+D;var T=D<0||1/D<0;if(D=isNaN(D)?d:$(Math.abs(D),P),A&&(D=$ee(D)),T&&+D==0&&b!=="+"&&(T=!1),K=(T?b==="("?b:c:b==="-"||b==="("?"":b)+K,U=(O==="s"&&!isNaN(D)&&kh!==void 0?c2[8+kh/3]:"")+U+(T&&b==="("?")":""),z){for(V=-1,X=D.length;++V<X;)if(Z=D.charCodeAt(V),48>Z||Z>57){U=(Z===46?a+D.slice(V+1):D.slice(V))+U,D=D.slice(0,V);break}}}_&&!j&&(D=t(D,1/0));var L=K.length+D.length+U.length,Q=L<N?new Array(N-L+1).join(g):"";switch(_&&j&&(D=t(Q+D,Q.length?N-U.length:1/0),Q=""),S){case"<":D=K+D+U+Q;break;case"=":D=K+Q+D+U;break;case"^":D=Q.slice(0,L=Q.length>>1)+K+D+U+Q.slice(L);break;default:D=Q+K+D+U;break}return i(D)}return B.toString=function(){return p+""},B}function h(p,y){var g=Math.max(-8,Math.min(8,Math.floor(Jl(y)/3)))*3,S=Math.pow(10,-g),b=f((p=yd(p),p.type="f",p),{suffix:c2[8+g/3]});return function(x){return b(S*x)}}return{format:f,formatPrefix:h}}var Bp,wN,P5;Fee({thousands:",",grouping:[3],currency:["$",""]});function Fee(e){return Bp=Lee(e),wN=Bp.format,P5=Bp.formatPrefix,Bp}function Bee(e){return Math.max(0,-Jl(Math.abs(e)))}function zee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Jl(t)/3)))*3-Jl(Math.abs(e)))}function Uee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jl(t)-Jl(e))+1}function O5(e,t,n,r){var a=tS(e,t,n),i;switch(r=yd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=zee(a,o))&&(r.precision=i),P5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=Uee(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=Bee(a))&&(r.precision=i-(r.type==="%")*2);break}}return wN(r)}function Bi(e){var t=e.domain;return e.ticks=function(n){var r=t();return Z1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return O5(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=eS(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 Rh(){var e=xN();return e.copy=function(){return lf(e,Rh())},Sa.apply(e,arguments),Bi(e)}function k5(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,Ph),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return k5(e).unknown(t)},e=arguments.length?Array.from(e,Ph):[0,1],Bi(n)}function R5(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 u2(e){return Math.log(e)}function d2(e){return Math.exp(e)}function qee(e){return-Math.log(-e)}function Wee(e){return-Math.exp(-e)}function Vee(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Hee(e){return e===10?Vee:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Kee(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 f2(e){return(t,n)=>-e(-t,n)}function SN(e){const t=e(u2,d2),n=t.domain;let r=10,a,i;function o(){return a=Kee(r),i=Hee(r),n()[0]<0?(a=f2(a),i=f2(i),e(qee,Wee)):e(u2,d2),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 y=a(f),g=a(h),S,b;const x=c==null?10:+c;let j=[];if(!(r%1)&&g-y<x){if(y=Math.floor(y),g=Math.ceil(g),f>0){for(;y<=g;++y)for(S=1;S<r;++S)if(b=y<0?S/i(-y):S*i(y),!(b<f)){if(b>h)break;j.push(b)}}else for(;y<=g;++y)for(S=r-1;S>=1;--S)if(b=y>0?S/i(-y):S*i(y),!(b<f)){if(b>h)break;j.push(b)}j.length*2<x&&(j=Z1(f,h,x))}else j=Z1(y,g,Math.min(g-y,x)).map(i);return p?j.reverse():j},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=yd(d)).precision==null&&(d.trim=!0),d=wN(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(R5(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function T5(){const e=SN(uv()).domain([1,10]);return e.copy=()=>lf(e,T5()).base(e.base()),Sa.apply(e,arguments),e}function p2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function h2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jN(e){var t=1,n=e(p2(t),h2(t));return n.constant=function(r){return arguments.length?e(p2(t=+r),h2(t)):t},Bi(n)}function I5(){var e=jN(uv());return e.copy=function(){return lf(e,I5()).constant(e.constant())},Sa.apply(e,arguments)}function m2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Gee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Yee(e){return e<0?-e*e:e*e}function NN(e){var t=e(Sr,Sr),n=1;function r(){return n===1?e(Sr,Sr):n===.5?e(Gee,Yee):e(m2(n),m2(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Bi(t)}function CN(){var e=NN(uv());return e.copy=function(){return lf(e,CN()).exponent(e.exponent())},Sa.apply(e,arguments),e}function Xee(){return CN.apply(null,arguments).exponent(.5)}function v2(e){return Math.sign(e)*e*e}function Qee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function M5(){var e=xN(),t=[0,1],n=!1,r;function a(i){var o=Qee(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(v2(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,Ph)).map(v2)),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 M5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Sa.apply(a,arguments),Bi(a)}function $5(){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]=nee(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[sf(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(Oi),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 $5().domain(e).range(t).unknown(r)},Sa.apply(i,arguments)}function D5(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[sf(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 D5().domain([e,t]).range(a).unknown(i)},Sa.apply(Bi(o),arguments)}function L5(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[sf(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 L5().domain(e).range(t).unknown(n)},Sa.apply(a,arguments)}const cw=new Date,uw=new Date;function Yn(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=>Yn(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)=>(cw.setTime(+i),uw.setTime(+o),e(cw),e(uw),Math.floor(n(cw,uw))),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 Th=Yn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Th.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Yn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Th);Th.range;const Ms=1e3,ma=Ms*60,$s=ma*60,Ws=$s*24,_N=Ws*7,g2=Ws*30,dw=Ws*365,ho=Yn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ms)},(e,t)=>(t-e)/Ms,e=>e.getUTCSeconds());ho.range;const AN=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ms)},(e,t)=>{e.setTime(+e+t*ma)},(e,t)=>(t-e)/ma,e=>e.getMinutes());AN.range;const EN=Yn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ma)},(e,t)=>(t-e)/ma,e=>e.getUTCMinutes());EN.range;const PN=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ms-e.getMinutes()*ma)},(e,t)=>{e.setTime(+e+t*$s)},(e,t)=>(t-e)/$s,e=>e.getHours());PN.range;const ON=Yn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*$s)},(e,t)=>(t-e)/$s,e=>e.getUTCHours());ON.range;const cf=Yn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ma)/Ws,e=>e.getDate()-1);cf.range;const dv=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ws,e=>e.getUTCDate()-1);dv.range;const F5=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ws,e=>Math.floor(e/Ws));F5.range;function Lo(e){return Yn(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())*ma)/_N)}const fv=Lo(0),Ih=Lo(1),Jee=Lo(2),Zee=Lo(3),Zl=Lo(4),ete=Lo(5),tte=Lo(6);fv.range;Ih.range;Jee.range;Zee.range;Zl.range;ete.range;tte.range;function Fo(e){return Yn(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)/_N)}const pv=Fo(0),Mh=Fo(1),nte=Fo(2),rte=Fo(3),ec=Fo(4),ate=Fo(5),ste=Fo(6);pv.range;Mh.range;nte.range;rte.range;ec.range;ate.range;ste.range;const kN=Yn(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());kN.range;const RN=Yn(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());RN.range;const Vs=Yn(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());Vs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(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)});Vs.range;const Hs=Yn(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());Hs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(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)});Hs.range;function B5(e,t,n,r,a,i){const o=[[ho,1,Ms],[ho,5,5*Ms],[ho,15,15*Ms],[ho,30,30*Ms],[i,1,ma],[i,5,5*ma],[i,15,15*ma],[i,30,30*ma],[a,1,$s],[a,3,3*$s],[a,6,6*$s],[a,12,12*$s],[r,1,Ws],[r,2,2*Ws],[n,1,_N],[t,1,g2],[t,3,3*g2],[e,1,dw]];function c(f,h,p){const y=h<f;y&&([f,h]=[h,f]);const g=p&&typeof p.range=="function"?p:d(f,h,p),S=g?g.range(f,+h+1):[];return y?S.reverse():S}function d(f,h,p){const y=Math.abs(h-f)/p,g=hN(([,,x])=>x).right(o,y);if(g===o.length)return e.every(tS(f/dw,h/dw,p));if(g===0)return Th.every(Math.max(tS(f,h,p),1));const[S,b]=o[y/o[g-1][2]<o[g][2]/y?g-1:g];return S.every(b)}return[c,d]}const[ite,ote]=B5(Hs,RN,pv,F5,ON,EN),[lte,cte]=B5(Vs,kN,fv,cf,PN,AN);function fw(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 pw(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 Eu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ute(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=Pu(a),h=Ou(a),p=Pu(i),y=Ou(i),g=Pu(o),S=Ou(o),b=Pu(c),x=Ou(c),j=Pu(d),N=Ou(d),_={a:Z,A:T,b:L,B:Q,c:null,d:j2,e:j2,f:Tte,g:qte,G:Vte,H:Ote,I:kte,j:Rte,L:z5,m:Ite,M:Mte,p:F,q:M,Q:_2,s:A2,S:$te,u:Dte,U:Lte,V:Fte,w:Bte,W:zte,x:null,X:null,y:Ute,Y:Wte,Z:Hte,"%":C2},P={a:ee,A:W,b:J,B:ye,c:null,d:N2,e:N2,f:Xte,g:ine,G:lne,H:Kte,I:Gte,j:Yte,L:q5,m:Qte,M:Jte,p:ae,q:ue,Q:_2,s:A2,S:Zte,u:ene,U:tne,V:nne,w:rne,W:ane,x:null,X:null,y:sne,Y:one,Z:cne,"%":C2},A={a:z,A:B,b:D,B:K,c:U,d:w2,e:w2,f:_te,g:b2,G:x2,H:S2,I:S2,j:Ste,L:Cte,m:wte,M:jte,p:$,q:bte,Q:Ete,s:Pte,S:Nte,u:mte,U:vte,V:gte,w:hte,W:yte,x:V,X,y:b2,Y:x2,Z:xte,"%":Ate};_.x=O(n,_),_.X=O(r,_),_.c=O(t,_),P.x=O(n,P),P.X=O(r,P),P.c=O(t,P);function O(ie,ve){return function(Oe){var oe=[],he=-1,xe=0,Ie=ie.length,re,me,Ne;for(Oe instanceof Date||(Oe=new Date(+Oe));++he<Ie;)ie.charCodeAt(he)===37&&(oe.push(ie.slice(xe,he)),(me=y2[re=ie.charAt(++he)])!=null?re=ie.charAt(++he):me=re==="e"?" ":"0",(Ne=ve[re])&&(re=Ne(Oe,me)),oe.push(re),xe=he+1);return oe.push(ie.slice(xe,he)),oe.join("")}}function k(ie,ve){return function(Oe){var oe=Eu(1900,void 0,1),he=R(oe,ie,Oe+="",0),xe,Ie;if(he!=Oe.length)return null;if("Q"in oe)return new Date(oe.Q);if("s"in oe)return new Date(oe.s*1e3+("L"in oe?oe.L:0));if(ve&&!("Z"in oe)&&(oe.Z=0),"p"in oe&&(oe.H=oe.H%12+oe.p*12),oe.m===void 0&&(oe.m="q"in oe?oe.q:0),"V"in oe){if(oe.V<1||oe.V>53)return null;"w"in oe||(oe.w=1),"Z"in oe?(xe=pw(Eu(oe.y,0,1)),Ie=xe.getUTCDay(),xe=Ie>4||Ie===0?Mh.ceil(xe):Mh(xe),xe=dv.offset(xe,(oe.V-1)*7),oe.y=xe.getUTCFullYear(),oe.m=xe.getUTCMonth(),oe.d=xe.getUTCDate()+(oe.w+6)%7):(xe=fw(Eu(oe.y,0,1)),Ie=xe.getDay(),xe=Ie>4||Ie===0?Ih.ceil(xe):Ih(xe),xe=cf.offset(xe,(oe.V-1)*7),oe.y=xe.getFullYear(),oe.m=xe.getMonth(),oe.d=xe.getDate()+(oe.w+6)%7)}else("W"in oe||"U"in oe)&&("w"in oe||(oe.w="u"in oe?oe.u%7:"W"in oe?1:0),Ie="Z"in oe?pw(Eu(oe.y,0,1)).getUTCDay():fw(Eu(oe.y,0,1)).getDay(),oe.m=0,oe.d="W"in oe?(oe.w+6)%7+oe.W*7-(Ie+5)%7:oe.w+oe.U*7-(Ie+6)%7);return"Z"in oe?(oe.H+=oe.Z/100|0,oe.M+=oe.Z%100,pw(oe)):fw(oe)}}function R(ie,ve,Oe,oe){for(var he=0,xe=ve.length,Ie=Oe.length,re,me;he<xe;){if(oe>=Ie)return-1;if(re=ve.charCodeAt(he++),re===37){if(re=ve.charAt(he++),me=A[re in y2?ve.charAt(he++):re],!me||(oe=me(ie,Oe,oe))<0)return-1}else if(re!=Oe.charCodeAt(oe++))return-1}return oe}function $(ie,ve,Oe){var oe=f.exec(ve.slice(Oe));return oe?(ie.p=h.get(oe[0].toLowerCase()),Oe+oe[0].length):-1}function z(ie,ve,Oe){var oe=g.exec(ve.slice(Oe));return oe?(ie.w=S.get(oe[0].toLowerCase()),Oe+oe[0].length):-1}function B(ie,ve,Oe){var oe=p.exec(ve.slice(Oe));return oe?(ie.w=y.get(oe[0].toLowerCase()),Oe+oe[0].length):-1}function D(ie,ve,Oe){var oe=j.exec(ve.slice(Oe));return oe?(ie.m=N.get(oe[0].toLowerCase()),Oe+oe[0].length):-1}function K(ie,ve,Oe){var oe=b.exec(ve.slice(Oe));return oe?(ie.m=x.get(oe[0].toLowerCase()),Oe+oe[0].length):-1}function U(ie,ve,Oe){return R(ie,t,ve,Oe)}function V(ie,ve,Oe){return R(ie,n,ve,Oe)}function X(ie,ve,Oe){return R(ie,r,ve,Oe)}function Z(ie){return o[ie.getDay()]}function T(ie){return i[ie.getDay()]}function L(ie){return d[ie.getMonth()]}function Q(ie){return c[ie.getMonth()]}function F(ie){return a[+(ie.getHours()>=12)]}function M(ie){return 1+~~(ie.getMonth()/3)}function ee(ie){return o[ie.getUTCDay()]}function W(ie){return i[ie.getUTCDay()]}function J(ie){return d[ie.getUTCMonth()]}function ye(ie){return c[ie.getUTCMonth()]}function ae(ie){return a[+(ie.getUTCHours()>=12)]}function ue(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var ve=O(ie+="",_);return ve.toString=function(){return ie},ve},parse:function(ie){var ve=k(ie+="",!1);return ve.toString=function(){return ie},ve},utcFormat:function(ie){var ve=O(ie+="",P);return ve.toString=function(){return ie},ve},utcParse:function(ie){var ve=k(ie+="",!0);return ve.toString=function(){return ie},ve}}}var y2={"-":"",_:" ",0:"0"},tr=/^\s*\d+/,dte=/^%/,fte=/[\\^$*+?|[\]().{}]/g;function Mt(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 pte(e){return e.replace(fte,"\\$&")}function Pu(e){return new RegExp("^(?:"+e.map(pte).join("|")+")","i")}function Ou(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function hte(e,t,n){var r=tr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function mte(e,t,n){var r=tr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function vte(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function gte(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function yte(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function x2(e,t,n){var r=tr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function b2(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function xte(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 bte(e,t,n){var r=tr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function wte(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function w2(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Ste(e,t,n){var r=tr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function S2(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function jte(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Nte(e,t,n){var r=tr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Cte(e,t,n){var r=tr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function _te(e,t,n){var r=tr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ate(e,t,n){var r=dte.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ete(e,t,n){var r=tr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Pte(e,t,n){var r=tr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function j2(e,t){return Mt(e.getDate(),t,2)}function Ote(e,t){return Mt(e.getHours(),t,2)}function kte(e,t){return Mt(e.getHours()%12||12,t,2)}function Rte(e,t){return Mt(1+cf.count(Vs(e),e),t,3)}function z5(e,t){return Mt(e.getMilliseconds(),t,3)}function Tte(e,t){return z5(e,t)+"000"}function Ite(e,t){return Mt(e.getMonth()+1,t,2)}function Mte(e,t){return Mt(e.getMinutes(),t,2)}function $te(e,t){return Mt(e.getSeconds(),t,2)}function Dte(e){var t=e.getDay();return t===0?7:t}function Lte(e,t){return Mt(fv.count(Vs(e)-1,e),t,2)}function U5(e){var t=e.getDay();return t>=4||t===0?Zl(e):Zl.ceil(e)}function Fte(e,t){return e=U5(e),Mt(Zl.count(Vs(e),e)+(Vs(e).getDay()===4),t,2)}function Bte(e){return e.getDay()}function zte(e,t){return Mt(Ih.count(Vs(e)-1,e),t,2)}function Ute(e,t){return Mt(e.getFullYear()%100,t,2)}function qte(e,t){return e=U5(e),Mt(e.getFullYear()%100,t,2)}function Wte(e,t){return Mt(e.getFullYear()%1e4,t,4)}function Vte(e,t){var n=e.getDay();return e=n>=4||n===0?Zl(e):Zl.ceil(e),Mt(e.getFullYear()%1e4,t,4)}function Hte(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Mt(t/60|0,"0",2)+Mt(t%60,"0",2)}function N2(e,t){return Mt(e.getUTCDate(),t,2)}function Kte(e,t){return Mt(e.getUTCHours(),t,2)}function Gte(e,t){return Mt(e.getUTCHours()%12||12,t,2)}function Yte(e,t){return Mt(1+dv.count(Hs(e),e),t,3)}function q5(e,t){return Mt(e.getUTCMilliseconds(),t,3)}function Xte(e,t){return q5(e,t)+"000"}function Qte(e,t){return Mt(e.getUTCMonth()+1,t,2)}function Jte(e,t){return Mt(e.getUTCMinutes(),t,2)}function Zte(e,t){return Mt(e.getUTCSeconds(),t,2)}function ene(e){var t=e.getUTCDay();return t===0?7:t}function tne(e,t){return Mt(pv.count(Hs(e)-1,e),t,2)}function W5(e){var t=e.getUTCDay();return t>=4||t===0?ec(e):ec.ceil(e)}function nne(e,t){return e=W5(e),Mt(ec.count(Hs(e),e)+(Hs(e).getUTCDay()===4),t,2)}function rne(e){return e.getUTCDay()}function ane(e,t){return Mt(Mh.count(Hs(e)-1,e),t,2)}function sne(e,t){return Mt(e.getUTCFullYear()%100,t,2)}function ine(e,t){return e=W5(e),Mt(e.getUTCFullYear()%100,t,2)}function one(e,t){return Mt(e.getUTCFullYear()%1e4,t,4)}function lne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ec(e):ec.ceil(e),Mt(e.getUTCFullYear()%1e4,t,4)}function cne(){return"+0000"}function C2(){return"%"}function _2(e){return+e}function A2(e){return Math.floor(+e/1e3)}var gl,V5,H5;une({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 une(e){return gl=ute(e),V5=gl.format,gl.parse,H5=gl.utcFormat,gl.utcParse,gl}function dne(e){return new Date(e)}function fne(e){return e instanceof Date?+e:+new Date(+e)}function TN(e,t,n,r,a,i,o,c,d,f){var h=xN(),p=h.invert,y=h.domain,g=f(".%L"),S=f(":%S"),b=f("%I:%M"),x=f("%I %p"),j=f("%a %d"),N=f("%b %d"),_=f("%B"),P=f("%Y");function A(O){return(d(O)<O?g:c(O)<O?S:o(O)<O?b:i(O)<O?x:r(O)<O?a(O)<O?j:N:n(O)<O?_:P)(O)}return h.invert=function(O){return new Date(p(O))},h.domain=function(O){return arguments.length?y(Array.from(O,fne)):y().map(dne)},h.ticks=function(O){var k=y();return e(k[0],k[k.length-1],O??10)},h.tickFormat=function(O,k){return k==null?A:f(k)},h.nice=function(O){var k=y();return(!O||typeof O.range!="function")&&(O=t(k[0],k[k.length-1],O??10)),O?y(R5(k,O)):h},h.copy=function(){return lf(h,TN(e,t,n,r,a,i,o,c,d,f))},h}function pne(){return Sa.apply(TN(lte,cte,Vs,kN,fv,cf,PN,AN,ho,V5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function hne(){return Sa.apply(TN(ite,ote,Hs,RN,pv,dv,ON,EN,ho,H5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function hv(){var e=0,t=1,n,r,a,i,o=Sr,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(y){var g,S;return arguments.length?([g,S]=y,o=p(g,S),f):[o(0),o(1)]}}return f.range=h(Mc),f.rangeRound=h(yN),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 zi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function K5(){var e=Bi(hv()(Sr));return e.copy=function(){return zi(e,K5())},Qs.apply(e,arguments)}function G5(){var e=SN(hv()).domain([1,10]);return e.copy=function(){return zi(e,G5()).base(e.base())},Qs.apply(e,arguments)}function Y5(){var e=jN(hv());return e.copy=function(){return zi(e,Y5()).constant(e.constant())},Qs.apply(e,arguments)}function IN(){var e=NN(hv());return e.copy=function(){return zi(e,IN()).exponent(e.exponent())},Qs.apply(e,arguments)}function mne(){return IN.apply(null,arguments).exponent(.5)}function X5(){var e=[],t=Sr;function n(r){if(r!=null&&!isNaN(r=+r))return t((sf(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(Oi),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)=>tee(e,i/r))},n.copy=function(){return X5(t).domain(e)},Qs.apply(n,arguments)}function mv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=Sr,h,p=!1,y;function g(b){return isNaN(b=+b)?y:(b=.5+((b=+h(b))-i)*(r*b<r*i?c:d),f(p?Math.max(0,Math.min(1,b)):b))}g.domain=function(b){return arguments.length?([e,t,n]=b,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,g):[e,t,n]},g.clamp=function(b){return arguments.length?(p=!!b,g):p},g.interpolator=function(b){return arguments.length?(f=b,g):f};function S(b){return function(x){var j,N,_;return arguments.length?([j,N,_]=x,f=Aee(b,[j,N,_]),g):[f(0),f(.5),f(1)]}}return g.range=S(Mc),g.rangeRound=S(yN),g.unknown=function(b){return arguments.length?(y=b,g):y},function(b){return h=b,a=b(e),i=b(t),o=b(n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,g}}function Q5(){var e=Bi(mv()(Sr));return e.copy=function(){return zi(e,Q5())},Qs.apply(e,arguments)}function J5(){var e=SN(mv()).domain([.1,1,10]);return e.copy=function(){return zi(e,J5()).base(e.base())},Qs.apply(e,arguments)}function Z5(){var e=jN(mv());return e.copy=function(){return zi(e,Z5()).constant(e.constant())},Qs.apply(e,arguments)}function MN(){var e=NN(mv());return e.copy=function(){return zi(e,MN()).exponent(e.exponent())},Qs.apply(e,arguments)}function vne(){return MN.apply(null,arguments).exponent(.5)}const E2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:hd,scaleDiverging:Q5,scaleDivergingLog:J5,scaleDivergingPow:MN,scaleDivergingSqrt:vne,scaleDivergingSymlog:Z5,scaleIdentity:k5,scaleImplicit:nS,scaleLinear:Rh,scaleLog:T5,scaleOrdinal:mN,scalePoint:Ku,scalePow:CN,scaleQuantile:$5,scaleQuantize:D5,scaleRadial:M5,scaleSequential:K5,scaleSequentialLog:G5,scaleSequentialPow:IN,scaleSequentialQuantile:X5,scaleSequentialSqrt:mne,scaleSequentialSymlog:Y5,scaleSqrt:Xee,scaleSymlog:I5,scaleThreshold:L5,scaleTime:pne,scaleUtc:hne,tickFormat:O5},Symbol.toStringTag,{value:"Module"}));var hw,P2;function vv(){if(P2)return hw;P2=1;var e=kc();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 hw=t,hw}var mw,O2;function eL(){if(O2)return mw;O2=1;function e(t,n){return t>n}return mw=e,mw}var vw,k2;function gne(){if(k2)return vw;k2=1;var e=vv(),t=eL(),n=Ic();function r(a){return a&&a.length?e(a,n,t):void 0}return vw=r,vw}var yne=gne();const gv=Wt(yne);var gw,R2;function tL(){if(R2)return gw;R2=1;function e(t,n){return t<n}return gw=e,gw}var yw,T2;function xne(){if(T2)return yw;T2=1;var e=vv(),t=tL(),n=Ic();function r(a){return a&&a.length?e(a,n,t):void 0}return yw=r,yw}var bne=xne();const yv=Wt(bne);var xw,I2;function wne(){if(I2)return xw;I2=1;var e=Qj(),t=ys(),n=u5(),r=Mr();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return xw=a,xw}var bw,M2;function Sne(){if(M2)return bw;M2=1;var e=l5(),t=wne();function n(r,a){return e(t(r,a),1)}return bw=n,bw}var jne=Sne();const Nne=Wt(jne);var ww,$2;function Cne(){if($2)return ww;$2=1;var e=uN();function t(n,r){return e(n,r)}return ww=t,ww}var _ne=Cne();const uf=Wt(_ne);var $c=1e9,Ane={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},DN,yn=!0,ba="[DecimalError] ",yo=ba+"Invalid argument: ",$N=ba+"Exponent out of range: ",Dc=Math.floor,co=Math.pow,Ene=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Yr,Zn=1e7,pn=7,nL=9007199254740991,$h=Dc(nL/pn),He={};He.absoluteValue=He.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};He.comparedTo=He.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};He.decimalPlaces=He.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};He.dividedBy=He.div=function(e){return Bs(this,new this.constructor(e))};He.dividedToIntegerBy=He.idiv=function(e){var t=this,n=t.constructor;return en(Bs(t,new n(e),0,1),n.precision)};He.equals=He.eq=function(e){return!this.cmp(e)};He.exponent=function(){return $n(this)};He.greaterThan=He.gt=function(e){return this.cmp(e)>0};He.greaterThanOrEqualTo=He.gte=function(e){return this.cmp(e)>=0};He.isInteger=He.isint=function(){return this.e>this.d.length-2};He.isNegative=He.isneg=function(){return this.s<0};He.isPositive=He.ispos=function(){return this.s>0};He.isZero=function(){return this.s===0};He.lessThan=He.lt=function(e){return this.cmp(e)<0};He.lessThanOrEqualTo=He.lte=function(e){return this.cmp(e)<1};He.logarithm=He.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(Yr))throw Error(ba+"NaN");if(n.s<1)throw Error(ba+(n.s?"NaN":"-Infinity"));return n.eq(Yr)?new r(0):(yn=!1,t=Bs(xd(n,i),xd(e,i),i),yn=!0,en(t,a))};He.minus=He.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?sL(t,e):rL(t,(e.s=-e.s,e))};He.modulo=He.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(ba+"NaN");return n.s?(yn=!1,t=Bs(n,e,0,1).times(e),yn=!0,n.minus(t)):en(new r(n),a)};He.naturalExponential=He.exp=function(){return aL(this)};He.naturalLogarithm=He.ln=function(){return xd(this)};He.negated=He.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};He.plus=He.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rL(t,e):sL(t,(e.s=-e.s,e))};He.precision=He.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(yo+e);if(t=$n(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};He.squareRoot=He.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(ba+"NaN")}for(e=$n(c),yn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ss(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Dc((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(Bs(c,i,o+2)).times(.5),ss(i.d).slice(0,o)===(t=ss(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(en(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return yn=!0,en(r,n)};He.times=He.mul=function(e){var t,n,r,a,i,o,c,d,f,h=this,p=h.constructor,y=h.d,g=(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=y.length,f=g.length,d<f&&(i=y,y=g,g=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]+g[r]*y[a-r-1]+t,i[a--]=c%Zn|0,t=c/Zn|0;i[a]=(i[a]+t)%Zn|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,yn?en(e,p.precision):e};He.toDecimalPlaces=He.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(fs(e,0,$c),t===void 0?t=r.rounding:fs(t,0,8),en(n,e+$n(n)+1,t))};He.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Co(r,!0):(fs(e,0,$c),t===void 0?t=a.rounding:fs(t,0,8),r=en(new a(r),e+1,t),n=Co(r,!0,e+1)),n};He.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Co(a):(fs(e,0,$c),t===void 0?t=i.rounding:fs(t,0,8),r=en(new i(a),e+$n(a)+1,t),n=Co(r.abs(),!1,e+$n(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};He.toInteger=He.toint=function(){var e=this,t=e.constructor;return en(new t(e),$n(e)+1,t.rounding)};He.toNumber=function(){return+this};He.toPower=He.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(Yr);if(c=new d(c),!c.s){if(e.s<1)throw Error(ba+"Infinity");return c}if(c.eq(Yr))return c;if(r=d.precision,e.eq(Yr))return en(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=nL){for(a=new d(Yr),t=Math.ceil(r/pn+4),yn=!1;n%2&&(a=a.times(c),L2(a.d,t)),n=Dc(n/2),n!==0;)c=c.times(c),L2(c.d,t);return yn=!0,e.s<0?new d(Yr).div(a):en(a,r)}}else if(i<0)throw Error(ba+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,yn=!1,a=e.times(xd(c,r+f)),yn=!0,a=aL(a),a.s=i,a};He.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=$n(a),r=Co(a,n<=i.toExpNeg||n>=i.toExpPos)):(fs(e,1,$c),t===void 0?t=i.rounding:fs(t,0,8),a=en(new i(a),e,t),n=$n(a),r=Co(a,e<=n||n<=i.toExpNeg,e)),r};He.toSignificantDigits=He.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(fs(e,1,$c),t===void 0?t=r.rounding:fs(t,0,8)),en(new r(n),e,t)};He.toString=He.valueOf=He.val=He.toJSON=He[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=$n(e),n=e.constructor;return Co(e,t<=n.toExpNeg||t>=n.toExpPos)};function rL(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)),yn?en(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)/Zn|0,d[i]%=Zn;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,yn?en(t,p):t}function fs(e,t,n){if(e!==~~e||e<t||e>n)throw Error(yo+e)}function ss(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+=Ni(n)),i+=r;o=e[t],r=o+"",n=pn-r.length,n&&(i+=Ni(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Bs=(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%Zn|0,o=i/Zn|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*Zn+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var c,d,f,h,p,y,g,S,b,x,j,N,_,P,A,O,k,R,$=r.constructor,z=r.s==a.s?1:-1,B=r.d,D=a.d;if(!r.s)return new $(r);if(!a.s)throw Error(ba+"Division by zero");for(d=r.e-a.e,k=D.length,A=B.length,g=new $(z),S=g.d=[],f=0;D[f]==(B[f]||0);)++f;if(D[f]>(B[f]||0)&&--d,i==null?N=i=$.precision:o?N=i+($n(r)-$n(a))+1:N=i,N<0)return new $(0);if(N=N/pn+2|0,f=0,k==1)for(h=0,D=D[0],N++;(f<A||h)&&N--;f++)_=h*Zn+(B[f]||0),S[f]=_/D|0,h=_%D|0;else{for(h=Zn/(D[0]+1)|0,h>1&&(D=e(D,h),B=e(B,h),k=D.length,A=B.length),P=k,b=B.slice(0,k),x=b.length;x<k;)b[x++]=0;R=D.slice(),R.unshift(0),O=D[0],D[1]>=Zn/2&&++O;do h=0,c=t(D,b,k,x),c<0?(j=b[0],k!=x&&(j=j*Zn+(b[1]||0)),h=j/O|0,h>1?(h>=Zn&&(h=Zn-1),p=e(D,h),y=p.length,x=b.length,c=t(p,b,y,x),c==1&&(h--,n(p,k<y?R:D,y))):(h==0&&(c=h=1),p=D.slice()),y=p.length,y<x&&p.unshift(0),n(b,p,x),c==-1&&(x=b.length,c=t(D,b,k,x),c<1&&(h++,n(b,k<x?R:D,x))),x=b.length):c===0&&(h++,b=[0]),S[f++]=h,c&&b[0]?b[x++]=B[P]||0:(b=[B[P]],x=1);while((P++<A||b[0]!==void 0)&&N--)}return S[0]||S.shift(),g.e=d,en(g,o?i+$n(g)+1:i)}})();function aL(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if($n(e)>16)throw Error($N+$n(e));if(!e.s)return new h(Yr);for(yn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(co(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(Yr),h.precision=c;;){if(a=en(a.times(e),c),n=n.times(++d),o=i.plus(Bs(a,n,c)),ss(o.d).slice(0,c)===ss(i.d).slice(0,c)){for(;f--;)i=en(i.times(i),c);return h.precision=p,t==null?(yn=!0,en(i,p)):i}i=o}}function $n(e){for(var t=e.e*pn,n=e.d[0];n>=10;n/=10)t++;return t}function Sw(e,t,n){if(t>e.LN10.sd())throw yn=!0,n&&(e.precision=n),Error(ba+"LN10 precision limit exceeded");return en(new e(e.LN10),t)}function Ni(e){for(var t="";e--;)t+="0";return t}function xd(e,t){var n,r,a,i,o,c,d,f,h,p=1,y=10,g=e,S=g.d,b=g.constructor,x=b.precision;if(g.s<1)throw Error(ba+(g.s?"NaN":"-Infinity"));if(g.eq(Yr))return new b(0);if(t==null?(yn=!1,f=x):f=t,g.eq(10))return t==null&&(yn=!0),Sw(b,f);if(f+=y,b.precision=f,n=ss(S),r=n.charAt(0),i=$n(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=ss(g.d),r=n.charAt(0),p++;i=$n(g),r>1?(g=new b("0."+n),i++):g=new b(r+"."+n.slice(1))}else return d=Sw(b,f+2,x).times(i+""),g=xd(new b(r+"."+n.slice(1)),f-y).plus(d),b.precision=x,t==null?(yn=!0,en(g,x)):g;for(c=o=g=Bs(g.minus(Yr),g.plus(Yr),f),h=en(g.times(g),f),a=3;;){if(o=en(o.times(h),f),d=c.plus(Bs(o,new b(a),f)),ss(d.d).slice(0,f)===ss(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Sw(b,f+2,x).times(i+""))),c=Bs(c,new b(p),f),b.precision=x,t==null?(yn=!0,en(c,x)):c;c=d,a+=2}}function D2(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=Dc(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),yn&&(e.e>$h||e.e<-$h))throw Error($N+n)}else e.s=0,e.e=0,e.d=[0];return e}function en(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=co(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/co(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=$n(e),p.length=1,t=t-i-1,p[0]=co(10,(pn-t%pn)%pn),e.e=Dc(-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=co(10,pn-r),p[h]=a>0?(f/co(10,o-a)%co(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==Zn&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=Zn)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(yn&&(e.e>$h||e.e<-$h))throw Error($N+$n(e));return e}function sL(e,t){var n,r,a,i,o,c,d,f,h,p,y=e.constructor,g=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),yn?en(t,g):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(g/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]=Zn-1;--d[i],d[a]+=Zn}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,yn?en(t,g):t):new y(0)}function Co(e,t,n){var r,a=$n(e),i=ss(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ni(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ni(-a-1)+i,n&&(r=n-o)>0&&(i+=Ni(r))):a>=o?(i+=Ni(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+Ni(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=Ni(r))),e.s<0?"-"+i:i}function L2(e,t){if(e.length>t)return e.length=t,!0}function iL(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(yo+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 D2(o,i.toString())}else if(typeof i!="string")throw Error(yo+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Ene.test(i))D2(o,i);else throw Error(yo+i)}if(a.prototype=He,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=iL,a.config=a.set=Pne,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 Pne(e){if(!e||typeof e!="object")throw Error(ba+"Object expected");var t,n,r,a=["precision",1,$c,"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(Dc(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(yo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(yo+n+": "+r);return this}var DN=iL(Ane);Yr=new DN(1);const Kt=DN;function One(e){return Ine(e)||Tne(e)||Rne(e)||kne()}function kne(){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 Rne(e,t){if(e){if(typeof e=="string")return iS(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 iS(e,t)}}function Tne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Ine(e){if(Array.isArray(e))return iS(e)}function iS(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 Mne=function(t){return t},oL={},lL=function(t){return t===oL},F2=function(t){return function n(){return arguments.length===0||arguments.length===1&&lL(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},$ne=function e(t,n){return t===1?n:F2(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!==oL}).length;return o>=t?n.apply(void 0,a):e(t-o,F2(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 lL(p)?d.shift():p});return n.apply(void 0,One(h).concat(d))}))})},xv=function(t){return $ne(t.length,t)},oS=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Dne=xv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Lne=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Mne;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))}},lS=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},cL=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 Fne(e){var t;return e===0?t=1:t=Math.floor(new Kt(e).abs().log(10).toNumber())+1,t}function Bne(e,t,n){for(var r=new Kt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var zne=xv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),Une=xv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),qne=xv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const bv={rangeStep:Bne,getDigitCount:Fne,interpolateNumber:zne,uninterpolateNumber:Une,uninterpolateTruncation:qne};function cS(e){return Hne(e)||Vne(e)||uL(e)||Wne()}function Wne(){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 Vne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Hne(e){if(Array.isArray(e))return uS(e)}function bd(e,t){return Yne(e)||Gne(e,t)||uL(e,t)||Kne()}function Kne(){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 uL(e,t){if(e){if(typeof e=="string")return uS(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 uS(e,t)}}function uS(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 Gne(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 Yne(e){if(Array.isArray(e))return e}function dL(e){var t=bd(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function fL(e,t,n){if(e.lte(0))return new Kt(0);var r=bv.getDigitCount(e.toNumber()),a=new Kt(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new Kt(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new Kt(Math.ceil(d))}function Xne(e,t,n){var r=1,a=new Kt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Kt(10).pow(bv.getDigitCount(e)-1),a=new Kt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Kt(Math.floor(e)))}else e===0?a=new Kt(Math.floor((t-1)/2)):n||(a=new Kt(Math.floor(e)));var o=Math.floor((t-1)/2),c=Lne(Dne(function(d){return a.add(new Kt(d-o).mul(r)).toNumber()}),oS);return c(0,t)}function pL(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 Kt(0),tickMin:new Kt(0),tickMax:new Kt(0)};var i=fL(new Kt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Kt(0):(o=new Kt(e).add(t).div(2),o=o.sub(new Kt(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new Kt(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?pL(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 Kt(c).mul(i)),tickMax:o.add(new Kt(d).mul(i))})}function Qne(e){var t=bd(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=dL([n,r]),d=bd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(cS(oS(0,a-1).map(function(){return 1/0}))):[].concat(cS(oS(0,a-1).map(function(){return-1/0})),[h]);return n>r?lS(p):p}if(f===h)return Xne(f,a,i);var y=pL(f,h,o,i),g=y.step,S=y.tickMin,b=y.tickMax,x=bv.rangeStep(S,b.add(new Kt(.1).mul(g)),g);return n>r?lS(x):x}function Jne(e,t){var n=bd(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=dL([r,a]),c=bd(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=fL(new Kt(f).sub(d).div(h-1),i,0),y=[].concat(cS(bv.rangeStep(new Kt(d),new Kt(f).sub(new Kt(.99).mul(p)),p)),[f]);return r>a?lS(y):y}var Zne=cL(Qne),ere=cL(Jne),tre="Invariant failed";function _o(e,t){throw new Error(tre)}var nre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function tc(e){"@babel/helpers - typeof";return tc=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},tc(e)}function Dh(){return Dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dh.apply(this,arguments)}function rre(e,t){return ore(e)||ire(e,t)||sre(e,t)||are()}function are(){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 sre(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 ire(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 ore(e){if(Array.isArray(e))return e}function lre(e,t){if(e==null)return{};var n=cre(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 cre(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 ure(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dre(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 fre(e,t,n){return t&&dre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pre(e,t,n){return t=Lh(t),hre(e,hL()?Reflect.construct(t,n||[],Lh(e).constructor):t.apply(e,n))}function hre(e,t){if(t&&(tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mre(e)}function mre(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 Lh(e){return Lh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lh(e)}function vre(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&&dS(e,t)}function dS(e,t){return dS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},dS(e,t)}function mL(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=gre(e,"string");return tc(t)=="symbol"?t:t+""}function gre(e,t){if(tc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var df=(function(e){function t(){return ure(this,t),pre(this,t,arguments)}return vre(t,e),fre(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,y=lre(r,nre),g=ft(y,!1);this.props.direction==="x"&&h.type!=="number"&&_o();var S=d.map(function(b){var x=f(b,c),j=x.x,N=x.y,_=x.value,P=x.errorVal;if(!P)return null;var A=[],O,k;if(Array.isArray(P)){var R=rre(P,2);O=R[0],k=R[1]}else O=k=P;if(i==="vertical"){var $=h.scale,z=N+a,B=z+o,D=z-o,K=$(_-O),U=$(_+k);A.push({x1:U,y1:B,x2:U,y2:D}),A.push({x1:K,y1:z,x2:U,y2:z}),A.push({x1:K,y1:B,x2:K,y2:D})}else if(i==="horizontal"){var V=p.scale,X=j+a,Z=X-o,T=X+o,L=V(_-O),Q=V(_+k);A.push({x1:Z,y1:Q,x2:T,y2:Q}),A.push({x1:X,y1:L,x2:X,y2:Q}),A.push({x1:Z,y1:L,x2:T,y2:L})}return q.createElement(It,Dh({className:"recharts-errorBar",key:"bar-".concat(A.map(function(F){return"".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))},g),A.map(function(F){return q.createElement("line",Dh({},F,{key:"line-".concat(F.x1,"-").concat(F.x2,"-").concat(F.y1,"-").concat(F.y2)}))}))});return q.createElement(It,{className:"recharts-errorBars"},S)}}])})(q.Component);mL(df,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});mL(df,"displayName","ErrorBar");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 z2(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 ao(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z2(Object(n),!0).forEach(function(r){yre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yre(e,t,n){return t=xre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xre(e){var t=bre(e,"string");return wd(t)=="symbol"?t:t+""}function bre(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 gL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Vr(n,$l);if(!o)return null;var c=$l.defaultProps,d=c!==void 0?ao(ao({},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 y=p.item,g=p.props,S=g.sectors||g.data||[];return h.concat(S.map(function(b){return{type:o.props.iconType||y.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,y=p.type.defaultProps,g=y!==void 0?ao(ao({},y),p.props):{},S=g.dataKey,b=g.name,x=g.legendType,j=g.hide;return{inactive:j,dataKey:S,type:d.iconType||x||"square",color:LN(p),value:b||S,payload:g}}),ao(ao(ao({},d),$l.getWithHeight(o,a)),{},{payload:f,item:o})};function Sd(e){"@babel/helpers - typeof";return Sd=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},Sd(e)}function U2(e){return Nre(e)||jre(e)||Sre(e)||wre()}function wre(){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 fS(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 fS(e,t)}}function jre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nre(e){if(Array.isArray(e))return fS(e)}function fS(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 q2(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?q2(Object(n),!0).forEach(function(r){Ll(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ll(e,t,n){return t=Cre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cre(e){var t=_re(e,"string");return Sd(t)=="symbol"?t:t+""}function _re(e,t){if(Sd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wn(e,t,n){return xt(e)||xt(t)?n:Vn(t)?ea(e,t,n):gt(t)?t(e):n}function Gu(e,t,n,r){var a=Nne(e,function(c){return Wn(c,t)});if(n==="number"){var i=a.filter(function(c){return $e(c)||parseFloat(c)});return i.length?[yv(i),gv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!xt(c)}):a;return o.map(function(c){return Vn(c)||c instanceof Date?c:""})}var Are=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,y=f>=c-1?a[0].coordinate:a[f+1].coordinate,g=void 0;if(br(p-h)!==br(y-p)){var S=[];if(br(y-p)===br(d[1]-d[0])){g=y;var b=p+d[1]-d[0];S[0]=Math.min(b,(b+h)/2),S[1]=Math.max(b,(b+h)/2)}else{g=h;var x=y+d[1]-d[0];S[0]=Math.min(p,(x+p)/2),S[1]=Math.max(p,(x+p)/2)}var j=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(t>j[0]&&t<=j[1]||t>=S[0]&&t<=S[1]){o=a[f].index;break}}else{var N=Math.min(h,y),_=Math.max(h,y);if(t>(N+p)/2&&t<=(_+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},LN=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?_n(_n({},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},Ere=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),y=0,g=p.length;y<g;y++){var S=h[p[y]],b=S.items,x=S.cateAxisId,j=b.filter(function(k){return Ls(k.type).indexOf("Bar")>=0});if(j&&j.length){var N=j[0].type.defaultProps,_=N!==void 0?_n(_n({},N),j[0].props):j[0].props,P=_.barSize,A=_[x];o[A]||(o[A]=[]);var O=xt(P)?n:P;o[A].push({item:j[0],stackList:j.slice(1),barSize:xt(O)?void 0:wr(O,r,0)})}}return o},Pre=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=wr(n,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var y=!1,g=a/d,S=o.reduce(function(P,A){return P+A.barSize||0},0);S+=(d-1)*f,S>=a&&(S-=(d-1)*f,f=0),S>=a&&g>0&&(y=!0,g*=.9,S=d*g);var b=(a-S)/2>>0,x={offset:b-f,size:0};h=o.reduce(function(P,A){var O={item:A.item,position:{offset:x.offset+x.size+f,size:y?g:A.barSize}},k=[].concat(U2(P),[O]);return x=k[k.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){k.push({item:R,position:x})}),k},p)}else{var j=wr(r,a,0,!0);a-2*j-(d-1)*f<=0&&(f=0);var N=(a-2*j-(d-1)*f)/d;N>1&&(N>>=0);var _=c===+c?Math.min(N,c):N;h=o.reduce(function(P,A,O){var k=[].concat(U2(P),[{item:A.item,position:{offset:j+(N+f)*O+(N-_)/2,size:_}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){k.push({item:R,position:k[k.length-1].position})}),k},p)}return h},Ore=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=gL({children:i,legendWidth:d});if(f){var h=a||{},p=h.width,y=h.height,g=f.align,S=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&S==="middle")&&g!=="center"&&$e(t[g]))return _n(_n({},t),{},Ll({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&S!=="middle"&&$e(t[S]))return _n(_n({},t),{},Ll({},S,t[S]+(y||0)))}return t},kre=function(t,n,r){return xt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},yL=function(t,n,r,a,i){var o=n.props.children,c=ta(o,df).filter(function(f){return kre(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=Wn(h,r);if(xt(p))return f;var y=Array.isArray(p)?[yv(p),gv(p)]:[p,p],g=d.reduce(function(S,b){var x=Wn(h,b,0),j=y[0]-Math.abs(Array.isArray(x)?x[0]:x),N=y[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(j,S[0]),Math.max(N,S[1])]},[1/0,-1/0]);return[Math.min(g[0],f[0]),Math.max(g[1],f[1])]},[1/0,-1/0])}return null},Rre=function(t,n,r,a,i){var o=n.map(function(c){return yL(t,c,r,i,a)}).filter(function(c){return!xt(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},xL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&yL(t,d,f,a)||Gu(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},[])},bL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},mo=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?br(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var y=i?i.indexOf(p):p;return{coordinate:a(y)+f,value:p,offset:f}});return h.filter(function(p){return!rf(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,y){return{coordinate:a(p)+f,value:p,index:y,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,y){return{coordinate:a(p)+f,value:i?i[p]:p,index:y,offset:f}})},jw=new WeakMap,zp=function(t,n){if(typeof n!="function")return t;jw.has(t)||jw.set(t,new WeakMap);var r=jw.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},wL=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:hd(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:Rh(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Ku(),realScaleType:"point"}:i==="category"?{scale:hd(),realScaleType:"band"}:{scale:Rh(),realScaleType:"linear"};if(So(a)){var d="scale".concat(nv(a));return{scale:(E2[d]||Ku)(),realScaleType:E2[d]?d:"point"}}return gt(a)?{scale:a}:{scale:Ku(),realScaleType:"point"}},W2=1e-4,SL=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])-W2,o=Math.max(a[0],a[1])+W2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},Tre=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},Ire=function(t,n){if(!n||n.length!==2||!$e(n[0])||!$e(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(!$e(t[0])||t[0]<r)&&(i[0]=r),(!$e(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},Mre=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=rf(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])}},$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;o<n;++o){var c=rf(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)}},Dre={sign:Mre,expand:NX,none:Kl,silhouette:CX,wiggle:_X,positive:$re},Lre=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=Dre[r],o=jX().keys(a).value(function(c,d){return+Wn(c,d,0)}).order(z1).offset(i);return o(t)},Fre=function(t,n,r,a,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,y){var g,S=(g=y.type)!==null&&g!==void 0&&g.defaultProps?_n(_n({},y.type.defaultProps),y.props):y.props,b=S.stackId,x=S.hide;if(x)return p;var j=S[r],N=p[j]||{hasStack:!1,stackGroups:{}};if(Vn(b)){var _=N.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};_.items.push(y),N.hasStack=!0,N.stackGroups[b]=_}else N.stackGroups[Tc("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[y]};return _n(_n({},p),{},Ll({},j,N))},d),h={};return Object.keys(f).reduce(function(p,y){var g=f[y];if(g.hasStack){var S={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(b,x){var j=g.stackGroups[x];return _n(_n({},b),{},Ll({},x,{numericAxisId:r,cateAxisId:a,items:j.items,stackedData:Lre(t,j.items,i)}))},S)}return _n(_n({},p),{},Ll({},y,g))},h)},jL=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=Zne(f,i,c);return t.domain([yv(h),gv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),y=ere(p,i,c);return{niceTicks:y}}return null};function V2(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&&!xt(a[t.dataKey])){var c=ph(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=Wn(a,xt(o)?t.dataKey:o);return xt(d)?null:t.scale(d)}var H2=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=Wn(o,n.dataKey,n.domain[c]);return xt(d)?null:n.scale(d)-i/2+a},Bre=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]},zre=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?_n(_n({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Vn(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},Ure=function(t){return t.reduce(function(n,r){return[yv(r.concat([n[0]]).filter($e)),gv(r.concat([n[1]]).filter($e))]},[1/0,-1/0])},NL=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=Ure(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})},K2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,G2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pS=function(t,n,r){if(gt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if($e(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(K2.test(t[0])){var i=+K2.exec(t[0])[1];a[0]=n[0]-i}else gt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if($e(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(G2.test(t[1])){var o=+G2.exec(t[1])[1];a[1]=n[1]+o}else gt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Fh=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=fN(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},Y2=function(t,n,r){return!t||!t.length||uf(t,ea(r,"type.defaultProps.domain"))?n:t},CL=function(t,n){var r=t.type.defaultProps?_n(_n({},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 _n(_n({},ft(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:LN(t),value:Wn(n,a),type:d,payload:n,chartType:f,hide:h})};function jd(e){"@babel/helpers - typeof";return jd=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},jd(e)}function X2(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?X2(Object(n),!0).forEach(function(r){_L(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _L(e,t,n){return t=qre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qre(e){var t=Wre(e,"string");return jd(t)=="symbol"?t:t+""}function Wre(e,t){if(jd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vre(e,t){return Yre(e)||Gre(e,t)||Kre(e,t)||Hre()}function Hre(){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 Kre(e,t){if(e){if(typeof e=="string")return Q2(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 Q2(e,t)}}function Q2(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 Gre(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 Yre(e){if(Array.isArray(e))return e}var Bh=Math.PI/180,Xre=function(t){return t*180/Math.PI},ln=function(t,n,r,a){return{x:t+Math.cos(-Bh*a)*r,y:n+Math.sin(-Bh*a)*r}},AL=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},Qre=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=wr(t.cx,o,o/2),p=wr(t.cy,c,c/2),y=AL(o,c,r),g=wr(t.innerRadius,y,0),S=wr(t.outerRadius,y,y*.8),b=Object.keys(n);return b.reduce(function(x,j){var N=n[j],_=N.domain,P=N.reversed,A;if(xt(N.range))a==="angleAxis"?A=[d,f]:a==="radiusAxis"&&(A=[g,S]),P&&(A=[A[1],A[0]]);else{A=N.range;var O=A,k=Vre(O,2);d=k[0],f=k[1]}var R=wL(N,i),$=R.realScaleType,z=R.scale;z.domain(_).range(A),SL(z);var B=jL(z,ks(ks({},N),{},{realScaleType:$})),D=ks(ks(ks({},N),B),{},{range:A,radius:S,realScaleType:$,scale:z,cx:h,cy:p,innerRadius:g,outerRadius:S,startAngle:d,endAngle:f});return ks(ks({},x),{},_L({},j,D))},{})},Jre=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))},Zre=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=Jre({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:Xre(f),angleInRadian:f}},eae=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}},tae=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},J2=function(t,n){var r=t.x,a=t.y,i=Zre({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=eae(n),p=h.startAngle,y=h.endAngle,g=c,S;if(p<=y){for(;g>y;)g-=360;for(;g<p;)g+=360;S=g>=p&&g<=y}else{for(;g>p;)g-=360;for(;g<y;)g+=360;S=g>=y&&g<=p}return S?ks(ks({},n),{},{radius:o,angle:tae(g,n)}):null},EL=function(t){return!v.isValidElement(t)&&!gt(t)&&typeof t!="boolean"?t.className:""};function Nd(e){"@babel/helpers - typeof";return Nd=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},Nd(e)}var nae=["offset"];function rae(e){return oae(e)||iae(e)||sae(e)||aae()}function aae(){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 sae(e,t){if(e){if(typeof e=="string")return hS(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 hS(e,t)}}function iae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oae(e){if(Array.isArray(e))return hS(e)}function hS(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 lae(e,t){if(e==null)return{};var n=cae(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 cae(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 Z2(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 qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z2(Object(n),!0).forEach(function(r){uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uae(e,t,n){return t=dae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dae(e){var t=fae(e,"string");return Nd(t)=="symbol"?t:t+""}function fae(e,t){if(Nd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cd(){return Cd=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},Cd.apply(this,arguments)}var pae=function(t){var n=t.value,r=t.formatter,a=xt(t.children)?n:t.children;return gt(r)?r(a):a},hae=function(t,n){var r=br(n-t),a=Math.min(Math.abs(n-t),360);return r*a},mae=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,y=d.outerRadius,g=d.startAngle,S=d.endAngle,b=d.clockWise,x=(p+y)/2,j=hae(g,S),N=j>=0?1:-1,_,P;a==="insideStart"?(_=g+N*o,P=b):a==="insideEnd"?(_=S-N*o,P=!b):a==="end"&&(_=S+N*o,P=b),P=j<=0?P:!P;var A=ln(f,h,x,_),O=ln(f,h,x,_+(P?1:-1)*359),k="M".concat(A.x,",").concat(A.y,`
75
+ A`).concat(x,",").concat(x,",0,1,").concat(P?0:1,`,
76
+ `).concat(O.x,",").concat(O.y),R=xt(t.id)?Tc("recharts-radial-line-"):t.id;return q.createElement("text",Cd({},r,{dominantBaseline:"central",className:bt("recharts-radial-bar-label",c)}),q.createElement("defs",null,q.createElement("path",{id:R,d:k})),q.createElement("textPath",{xlinkHref:"#".concat(R)},n))},vae=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,y=(h+p)/2;if(a==="outside"){var g=ln(o,c,f+r,y),S=g.x,b=g.y;return{x:S,y:b,textAnchor:S>=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,j=ln(o,c,x,y),N=j.x,_=j.y;return{x:N,y:_,textAnchor:"middle",verticalAnchor:"middle"}},gae=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,y=p*a,g=p>0?"end":"start",S=p>0?"start":"end",b=f>=0?1:-1,x=b*a,j=b>0?"end":"start",N=b>0?"start":"end";if(i==="top"){var _={x:c+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:g};return qn(qn({},_),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var P={x:c+f/2,y:d+h+y,textAnchor:"middle",verticalAnchor:S};return qn(qn({},P),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var A={x:c-x,y:d+h/2,textAnchor:j,verticalAnchor:"middle"};return qn(qn({},A),r?{width:Math.max(A.x-r.x,0),height:h}:{})}if(i==="right"){var O={x:c+f+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return qn(qn({},O),r?{width:Math.max(r.x+r.width-O.x,0),height:h}:{})}var k=r?{width:f,height:h}:{};return i==="insideLeft"?qn({x:c+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},k):i==="insideRight"?qn({x:c+f-x,y:d+h/2,textAnchor:j,verticalAnchor:"middle"},k):i==="insideTop"?qn({x:c+f/2,y:d+y,textAnchor:"middle",verticalAnchor:S},k):i==="insideBottom"?qn({x:c+f/2,y:d+h-y,textAnchor:"middle",verticalAnchor:g},k):i==="insideTopLeft"?qn({x:c+x,y:d+y,textAnchor:N,verticalAnchor:S},k):i==="insideTopRight"?qn({x:c+f-x,y:d+y,textAnchor:j,verticalAnchor:S},k):i==="insideBottomLeft"?qn({x:c+x,y:d+h-y,textAnchor:N,verticalAnchor:g},k):i==="insideBottomRight"?qn({x:c+f-x,y:d+h-y,textAnchor:j,verticalAnchor:g},k):Rc(i)&&($e(i.x)||fo(i.x))&&($e(i.y)||fo(i.y))?qn({x:c+wr(i.x,f),y:d+wr(i.y,h),textAnchor:"end",verticalAnchor:"end"},k):qn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},k)},yae=function(t){return"cx"in t&&$e(t.cx)};function er(e){var t=e.offset,n=t===void 0?5:t,r=lae(e,nae),a=qn({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,y=a.textBreakAll;if(!i||xt(c)&&xt(d)&&!v.isValidElement(f)&&!gt(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var g;if(gt(f)){if(g=v.createElement(f,a),v.isValidElement(g))return g}else g=pae(a);var S=yae(i),b=ft(a,!0);if(S&&(o==="insideStart"||o==="insideEnd"||o==="end"))return mae(a,g,b);var x=S?vae(a):gae(a);return q.createElement(No,Cd({className:bt("recharts-label",p)},b,x,{breakAll:y}),g)}er.displayName="Label";var PL=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,y=t.y,g=t.top,S=t.left,b=t.width,x=t.height,j=t.clockWise,N=t.labelViewBox;if(N)return N;if($e(b)&&$e(x)){if($e(p)&&$e(y))return{x:p,y,width:b,height:x};if($e(g)&&$e(S))return{x:g,y:S,width:b,height:x}}return $e(p)&&$e(y)?{x:p,y,width:0,height:0}:$e(n)&&$e(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:o||a||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:j}:t.viewBox?t.viewBox:{}},xae=function(t,n){return t?t===!0?q.createElement(er,{key:"label-implicit",viewBox:n}):Vn(t)?q.createElement(er,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===er?v.cloneElement(t,{key:"label-implicit",viewBox:n}):q.createElement(er,{key:"label-implicit",content:t,viewBox:n}):gt(t)?q.createElement(er,{key:"label-implicit",content:t,viewBox:n}):Rc(t)?q.createElement(er,Cd({viewBox:n},t,{key:"label-implicit"})):null:null},bae=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=PL(t),o=ta(a,er).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=xae(t.label,n||i);return[c].concat(rae(o))};er.parseViewBox=PL;er.renderCallByParent=bae;var Nw,eT;function wae(){if(eT)return Nw;eT=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return Nw=e,Nw}var Sae=wae();const jae=Wt(Sae);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)}var Nae=["valueAccessor"],Cae=["data","dataKey","clockWise","id","textBreakAll"];function _ae(e){return Oae(e)||Pae(e)||Eae(e)||Aae()}function Aae(){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 Eae(e,t){if(e){if(typeof e=="string")return mS(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 mS(e,t)}}function Pae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oae(e){if(Array.isArray(e))return mS(e)}function mS(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 zh(){return zh=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},zh.apply(this,arguments)}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 nT(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){kae(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 kae(e,t,n){return t=Rae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rae(e){var t=Tae(e,"string");return _d(t)=="symbol"?t:t+""}function Tae(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)}function rT(e,t){if(e==null)return{};var n=Iae(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 Iae(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 Mae=function(t){return Array.isArray(t.value)?jae(t.value):t.value};function zs(e){var t=e.valueAccessor,n=t===void 0?Mae:t,r=rT(e,Nae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=rT(r,Cae);return!a||!a.length?null:q.createElement(It,{className:"recharts-label-list"},a.map(function(h,p){var y=xt(i)?n(h,p):Wn(h&&h.payload,i),g=xt(c)?{}:{id:"".concat(c,"-").concat(p)};return q.createElement(er,zh({},ft(h,!0),f,g,{parentViewBox:h.parentViewBox,value:y,textBreakAll:d,viewBox:er.parseViewBox(xt(o)?h:nT(nT({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}zs.displayName="LabelList";function $ae(e,t){return e?e===!0?q.createElement(zs,{key:"labelList-implicit",data:t}):q.isValidElement(e)||gt(e)?q.createElement(zs,{key:"labelList-implicit",data:t,content:e}):Rc(e)?q.createElement(zs,zh({data:t},e,{key:"labelList-implicit"})):null:null}function Dae(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=ta(r,zs).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=$ae(e.label,t);return[i].concat(_ae(a))}zs.renderCallByParent=Dae;function Ad(e){"@babel/helpers - typeof";return Ad=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},Ad(e)}function vS(){return vS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vS.apply(this,arguments)}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 sT(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){Lae(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 Lae(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=Bae(e,"string");return Ad(t)=="symbol"?t:t+""}function Bae(e,t){if(Ad(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ad(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zae=function(t,n){var r=br(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},Up=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)/Bh,y=f?i:i+o*p,g=ln(n,r,h,y),S=ln(n,r,a,y),b=f?i-o*p:i,x=ln(n,r,h*Math.cos(p*Bh),b);return{center:g,circleTangency:S,lineTangency:x,theta:p}},OL=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=zae(o,c),f=o+d,h=ln(n,r,i,o),p=ln(n,r,i,f),y="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 g=ln(n,r,a,o),S=ln(n,r,a,f);y+="L ".concat(S.x,",").concat(S.y,`
82
+ A `).concat(a,",").concat(a,`,0,
83
+ `).concat(+(Math.abs(d)>180),",").concat(+(o<=f),`,
84
+ `).concat(g.x,",").concat(g.y," Z")}else y+="L ".concat(n,",").concat(r," Z");return y},Uae=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=br(h-f),y=Up({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),g=y.circleTangency,S=y.lineTangency,b=y.theta,x=Up({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),j=x.circleTangency,N=x.lineTangency,_=x.theta,P=d?Math.abs(f-h):Math.abs(f-h)-b-_;if(P<0)return c?"M ".concat(S.x,",").concat(S.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
+ `):OL({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h});var A="M ".concat(S.x,",").concat(S.y,`
88
+ A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(g.x,",").concat(g.y,`
89
+ A`).concat(i,",").concat(i,",0,").concat(+(P>180),",").concat(+(p<0),",").concat(j.x,",").concat(j.y,`
90
+ A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(N.x,",").concat(N.y,`
91
+ `);if(a>0){var O=Up({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),k=O.circleTangency,R=O.lineTangency,$=O.theta,z=Up({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),B=z.circleTangency,D=z.lineTangency,K=z.theta,U=d?Math.abs(f-h):Math.abs(f-h)-$-K;if(U<0&&o===0)return"".concat(A,"L").concat(n,",").concat(r,"Z");A+="L".concat(D.x,",").concat(D.y,`
92
+ A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(B.x,",").concat(B.y,`
93
+ A`).concat(a,",").concat(a,",0,").concat(+(U>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 A+="L".concat(n,",").concat(r,"Z");return A},qae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},kL=function(t){var n=sT(sT({},qae),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,y=n.className;if(o<i||h===p)return null;var g=bt("recharts-sector",y),S=o-i,b=wr(c,S,0,!0),x;return b>0&&Math.abs(h-p)<360?x=Uae({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,S/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):x=OL({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),q.createElement("path",vS({},ft(n,!0),{className:g,d:x,role:"img"}))};function Ed(e){"@babel/helpers - typeof";return Ed=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},Ed(e)}function gS(){return gS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gS.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){Wae(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 Wae(e,t,n){return t=Vae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vae(e){var t=Hae(e,"string");return Ed(t)=="symbol"?t:t+""}function Hae(e,t){if(Ed(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ed(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lT={curveBasisClosed:fX,curveBasisOpen:pX,curveBasis:dX,curveBumpX:QY,curveBumpY:JY,curveLinearClosed:hX,curveLinear:av,curveMonotoneX:mX,curveMonotoneY:vX,curveNatural:gX,curveStep:yX,curveStepAfter:bX,curveStepBefore:xX},qp=function(t){return t.x===+t.x&&t.y===+t.y},ku=function(t){return t.x},Ru=function(t){return t.y},Kae=function(t,n){if(gt(t))return t;var r="curve".concat(nv(t));return(r==="curveMonotone"||r==="curveBump")&&n?lT["".concat(r).concat(n==="vertical"?"Y":"X")]:lT[r]||av},Gae=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=Kae(r,c),p=f?i.filter(function(b){return qp(b)}):i,y;if(Array.isArray(o)){var g=f?o.filter(function(b){return qp(b)}):o,S=p.map(function(b,x){return oT(oT({},b),{},{base:g[x]})});return c==="vertical"?y=Ip().y(Ru).x1(ku).x0(function(b){return b.base.x}):y=Ip().x(ku).y1(Ru).y0(function(b){return b.base.y}),y.defined(qp).curve(h),y(S)}return c==="vertical"&&$e(o)?y=Ip().y(Ru).x1(ku).x0(o):$e(o)?y=Ip().x(ku).y1(Ru).y0(o):y=k3().x(ku).y(Ru),y.defined(qp).curve(h),y(p)},Uh=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?Gae(t):a;return v.createElement("path",gS({},ft(t,!1),hh(t),{className:bt("recharts-curve",n),d:o,ref:i}))},Cw={exports:{}},_w,cT;function Yae(){if(cT)return _w;cT=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _w=e,_w}var Aw,uT;function Xae(){if(uT)return Aw;uT=1;var e=Yae();function t(){}function n(){}return n.resetWarningCache=t,Aw=function(){function r(o,c,d,f,h,p){if(p!==e){var y=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 y.name="Invariant Violation",y}}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},Aw}var dT;function Qae(){return dT||(dT=1,Cw.exports=Xae()()),Cw.exports}var Jae=Qae();const Ft=Wt(Jae),{getOwnPropertyNames:Zae,getOwnPropertySymbols:ese}=Object,{hasOwnProperty:tse}=Object.prototype;function Ew(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function Wp(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 nse(e){return e?.[Symbol.toStringTag]}function fT(e){return Zae(e).concat(ese(e))}const rse=Object.hasOwn||((e,t)=>tse.call(e,t));function Bo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const ase="__v",sse="__o",ise="_owner",{getOwnPropertyDescriptor:pT,keys:hT}=Object;function ose(e,t){return e.byteLength===t.byteLength&&qh(new Uint8Array(e),new Uint8Array(t))}function lse(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 cse(e,t){return e.byteLength===t.byteLength&&qh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function use(e,t){return Bo(e.getTime(),t.getTime())}function dse(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function fse(e,t){return e===t}function mT(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 y=o.value,g=c.value;if(n.equals(y[0],g[0],d,p,e,t,n)&&n.equals(y[1],g[1],y[0],g[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const pse=Bo;function hse(e,t,n){const r=hT(e);let a=r.length;if(hT(t).length!==a)return!1;for(;a-- >0;)if(!RL(e,t,n,r[a]))return!1;return!0}function Tu(e,t,n){const r=fT(e);let a=r.length;if(fT(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!RL(e,t,n,i)||(o=pT(e,i),c=pT(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function mse(e,t){return Bo(e.valueOf(),t.valueOf())}function vse(e,t){return e.source===t.source&&e.flags===t.flags}function vT(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 qh(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 gse(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 RL(e,t,n,r){return(r===ise||r===sse||r===ase)&&(e.$$typeof||t.$$typeof)?!0:rse(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const yse="[object ArrayBuffer]",xse="[object Arguments]",bse="[object Boolean]",wse="[object DataView]",Sse="[object Date]",jse="[object Error]",Nse="[object Map]",Cse="[object Number]",_se="[object Object]",Ase="[object RegExp]",Ese="[object Set]",Pse="[object String]",Ose={"[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},kse="[object URL]",Rse=Object.prototype.toString;function Tse({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:y,areUrlsEqual:g,unknownTagComparators:S}){return function(x,j,N){if(x===j)return!0;if(x==null||j==null)return!1;const _=typeof x;if(_!==typeof j)return!1;if(_!=="object")return _==="number"?c(x,j,N):_==="function"?i(x,j,N):!1;const P=x.constructor;if(P!==j.constructor)return!1;if(P===Object)return d(x,j,N);if(Array.isArray(x))return t(x,j,N);if(P===Date)return r(x,j,N);if(P===RegExp)return h(x,j,N);if(P===Map)return o(x,j,N);if(P===Set)return p(x,j,N);const A=Rse.call(x);if(A===Sse)return r(x,j,N);if(A===Ase)return h(x,j,N);if(A===Nse)return o(x,j,N);if(A===Ese)return p(x,j,N);if(A===_se)return typeof x.then!="function"&&typeof j.then!="function"&&d(x,j,N);if(A===kse)return g(x,j,N);if(A===jse)return a(x,j,N);if(A===xse)return d(x,j,N);if(Ose[A])return y(x,j,N);if(A===yse)return e(x,j,N);if(A===wse)return n(x,j,N);if(A===bse||A===Cse||A===Pse)return f(x,j,N);if(S){let O=S[A];if(!O){const k=nse(x);k&&(O=S[k])}if(O)return O(x,j,N)}return!1}}function Ise({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ose,areArraysEqual:n?Tu:lse,areDataViewsEqual:cse,areDatesEqual:use,areErrorsEqual:dse,areFunctionsEqual:fse,areMapsEqual:n?Ew(mT,Tu):mT,areNumbersEqual:pse,areObjectsEqual:n?Tu:hse,arePrimitiveWrappersEqual:mse,areRegExpsEqual:vse,areSetsEqual:n?Ew(vT,Tu):vT,areTypedArraysEqual:n?Ew(qh,Tu):qh,areUrlsEqual:gse,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=Wp(r.areArraysEqual),i=Wp(r.areMapsEqual),o=Wp(r.areObjectsEqual),c=Wp(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function Mse(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function $se({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 Dse=Ui();Ui({strict:!0});Ui({circular:!0});Ui({circular:!0,strict:!0});Ui({createInternalComparator:()=>Bo});Ui({strict:!0,createInternalComparator:()=>Bo});Ui({circular:!0,createInternalComparator:()=>Bo});Ui({circular:!0,createInternalComparator:()=>Bo,strict:!0});function Ui(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=Ise(e),o=Tse(i),c=n?n(o):Mse(o);return $se({circular:t,comparator:o,createState:r,equals:c,strict:a})}function Lse(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function gT(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):Lse(a)};requestAnimationFrame(r)}function yS(e){"@babel/helpers - typeof";return yS=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},yS(e)}function Fse(e){return qse(e)||Use(e)||zse(e)||Bse()}function Bse(){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 zse(e,t){if(e){if(typeof e=="string")return yT(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 yT(e,t)}}function yT(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 Use(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qse(e){if(Array.isArray(e))return e}function Wse(){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=Fse(o),d=c[0],f=c.slice(1);if(typeof d=="number"){gT(a.bind(null,f),d);return}a(d),gT(a.bind(null,f));return}yS(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 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 xT(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 bT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xT(Object(n),!0).forEach(function(r){TL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TL(e,t,n){return t=Vse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vse(e){var t=Hse(e,"string");return Pd(t)==="symbol"?t:String(t)}function Hse(e,t){if(Pd(e)!=="object"||e===null)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 Kse=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},Gse=function(t){return t},Yse=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},Yu=function(t,n){return Object.keys(n).reduce(function(r,a){return bT(bT({},r),{},TL({},a,t(a,n[a])))},{})},wT=function(t,n,r){return t.map(function(a){return"".concat(Yse(a)," ").concat(n,"ms ").concat(r)}).join(",")};function Xse(e,t){return Zse(e)||Jse(e,t)||IL(e,t)||Qse()}function Qse(){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 Jse(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 Zse(e){if(Array.isArray(e))return e}function eie(e){return rie(e)||nie(e)||IL(e)||tie()}function tie(){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 IL(e,t){if(e){if(typeof e=="string")return xS(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 xS(e,t)}}function nie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rie(e){if(Array.isArray(e))return xS(e)}function xS(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 Wh=1e-4,ML=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},$L=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},ST=function(t,n){return function(r){var a=ML(t,n);return $L(a,r)}},aie=function(t,n){return function(r){var a=ML(t,n),i=[].concat(eie(a.map(function(o,c){return o*c}).slice(1)),[0]);return $L(i,r)}},jT=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=Xse(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=ST(a,o),y=ST(i,c),g=aie(a,o),S=function(j){return j>1?1:j<0?0:j},b=function(j){for(var N=j>1?1:j,_=N,P=0;P<8;++P){var A=p(_)-N,O=g(_);if(Math.abs(A-N)<Wh||O<Wh)return y(_);_=S(_-A/O)}return y(_)};return b.isStepper=!1,b},sie=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,y){var g=-(h-p)*r,S=y*i,b=y+(g-S)*c/1e3,x=y*c/1e3+h;return Math.abs(x-p)<Wh&&Math.abs(b)<Wh?[p,0]:[x,b]};return d.isStepper=!0,d.dt=c,d},iie=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 jT(a);case"spring":return sie();default:if(a.split("(")[0]==="cubic-bezier")return jT(a)}return typeof a=="function"?a:null};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 NT(e){return cie(e)||lie(e)||DL(e)||oie()}function oie(){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 lie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cie(e){if(Array.isArray(e))return wS(e)}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 ar(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){bS(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 bS(e,t,n){return t=uie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uie(e){var t=die(e,"string");return Od(t)==="symbol"?t:String(t)}function die(e,t){if(Od(e)!=="object"||e===null)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 fie(e,t){return mie(e)||hie(e,t)||DL(e,t)||pie()}function pie(){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 DL(e,t){if(e){if(typeof e=="string")return wS(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 wS(e,t)}}function wS(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 hie(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 mie(e){if(Array.isArray(e))return e}var Vh=function(t,n,r){return t+(n-t)*r},SS=function(t){var n=t.from,r=t.to;return n!==r},vie=function e(t,n,r){var a=Yu(function(i,o){if(SS(o)){var c=t(o.from,o.to,o.velocity),d=fie(c,2),f=d[0],h=d[1];return ar(ar({},o),{},{from:f,velocity:h})}return o},n);return r<1?Yu(function(i,o){return SS(o)?ar(ar({},o),{},{velocity:Vh(o.velocity,a[i].velocity,r),from:Vh(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const gie=(function(e,t,n,r,a){var i=Kse(e,t),o=i.reduce(function(x,j){return ar(ar({},x),{},bS({},j,[e[j],t[j]]))},{}),c=i.reduce(function(x,j){return ar(ar({},x),{},bS({},j,{from:e[j],velocity:0,to:t[j]}))},{}),d=-1,f,h,p=function(){return null},y=function(){return Yu(function(j,N){return N.from},c)},g=function(){return!Object.values(c).filter(SS).length},S=function(j){f||(f=j);var N=j-f,_=N/n.dt;c=vie(n,c,_),a(ar(ar(ar({},e),t),y())),f=j,g()||(d=requestAnimationFrame(p))},b=function(j){h||(h=j);var N=(j-h)/r,_=Yu(function(A,O){return Vh.apply(void 0,NT(O).concat([n(N)]))},o);if(a(ar(ar(ar({},e),t),_)),N<1)d=requestAnimationFrame(p);else{var P=Yu(function(A,O){return Vh.apply(void 0,NT(O).concat([n(1)]))},o);a(ar(ar(ar({},e),t),P))}};return p=n.isStepper?S:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});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)}var yie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function xie(e,t){if(e==null)return{};var n=bie(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 bie(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 Pw(e){return Nie(e)||jie(e)||Sie(e)||wie()}function wie(){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 jS(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 jS(e,t)}}function jie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nie(e){if(Array.isArray(e))return jS(e)}function jS(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 _T(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?_T(Object(n),!0).forEach(function(r){zu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zu(e,t,n){return t=LL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _ie(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,LL(r.key),r)}}function Aie(e,t,n){return t&&_ie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LL(e){var t=Eie(e,"string");return nc(t)==="symbol"?t:String(t)}function Eie(e,t){if(nc(e)!=="object"||e===null)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(t==="string"?String:Number)(e)}function Pie(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&&NS(e,t)}function NS(e,t){return NS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},NS(e,t)}function Oie(e){var t=kie();return function(){var r=Hh(e),a;if(t){var i=Hh(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return CS(this,a)}}function CS(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 _S(e)}function _S(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kie(){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 Hh(e){return Hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hh(e)}var ps=(function(e){Pie(n,e);var t=Oie(n);function n(r,a){var i;Cie(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,y=o.children,g=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(_S(i)),i.changeStyle=i.changeStyle.bind(_S(i)),!c||g<=0)return i.state={style:{}},typeof y=="function"&&(i.state={style:h}),CS(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof y=="function")return i.state={style:f},CS(i);i.state={style:d?zu({},d,f):f}}else i.state={style:{}};return i}return Aie(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,y=this.state.style;if(c){if(!o){var g={style:d?zu({},d,h):h};this.state&&y&&(d&&y[d]!==h||!d&&y!==h)&&this.setState(g);return}if(!(Dse(a.to,h)&&a.canBegin&&a.isActive)){var S=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=S||f?p:a.to;if(this.state&&y){var x={style:d?zu({},d,b):b};(d&&y[d]!==b||!d&&y!==b)&&this.setState(x)}this.runAnimation(Ta(Ta({},this.props),{},{from:b,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,y=a.onAnimationStart,g=gie(o,c,iie(f),d,this.changeStyle),S=function(){i.stopJSAnimation=g()};this.manager.start([y,h,S,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,y=p===void 0?0:p,g=function(b,x,j){if(j===0)return b;var N=x.duration,_=x.easing,P=_===void 0?"ease":_,A=x.style,O=x.properties,k=x.onAnimationEnd,R=j>0?o[j-1]:x,$=O||Object.keys(A);if(typeof P=="function"||P==="spring")return[].concat(Pw(b),[i.runJSAnimation.bind(i,{from:R.style,to:A,duration:N,easing:P}),N]);var z=wT($,N,P),B=Ta(Ta(Ta({},R.style),A),{},{transition:z});return[].concat(Pw(b),[B,N,k]).filter(Gse)};return this.manager.start([d].concat(Pw(o.reduce(g,[h,Math.max(y,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Wse());var i=a.begin,o=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,y=a.steps,g=a.children,S=this.manager;if(this.unSubscribe=S.subscribe(this.handleStyleChange),typeof f=="function"||typeof g=="function"||f==="spring"){this.runJSAnimation(a);return}if(y.length>1){this.runStepAnimation(a);return}var b=c?zu({},c,d):d,x=wT(Object.keys(b),o,f);S.start([h,i,Ta(Ta({},b),{},{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=xie(a,yie),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(g){var S=g.props,b=S.style,x=b===void 0?{}:b,j=S.className,N=v.cloneElement(g,Ta(Ta({},d),{},{style:Ta(Ta({},x),h),className:j}));return N};return f===1?p(v.Children.only(i)):q.createElement("div",null,v.Children.map(i,function(y){return p(y)}))}}]),n})(v.PureComponent);ps.displayName="Animate";ps.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ps.propTypes={from:Ft.oneOfType([Ft.object,Ft.string]),to:Ft.oneOfType([Ft.object,Ft.string]),attributeName:Ft.string,duration:Ft.number,begin:Ft.number,easing:Ft.oneOfType([Ft.string,Ft.func]),steps:Ft.arrayOf(Ft.shape({duration:Ft.number.isRequired,style:Ft.object.isRequired,easing:Ft.oneOfType([Ft.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ft.func]),properties:Ft.arrayOf("string"),onAnimationEnd:Ft.func})),children:Ft.oneOfType([Ft.node,Ft.func]),isActive:Ft.bool,canBegin:Ft.bool,onAnimationEnd:Ft.func,shouldReAnimate:Ft.bool,onAnimationStart:Ft.func,onAnimationReStart:Ft.func};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 Kh(){return Kh=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},Kh.apply(this,arguments)}function Rie(e,t){return $ie(e)||Mie(e,t)||Iie(e,t)||Tie()}function Tie(){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 Iie(e,t){if(e){if(typeof e=="string")return AT(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 AT(e,t)}}function AT(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 $ie(e){if(Array.isArray(e))return e}function ET(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 PT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ET(Object(n),!0).forEach(function(r){Die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ET(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Die(e,t,n){return t=Lie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lie(e){var t=Fie(e,"string");return kd(t)=="symbol"?t:t+""}function Fie(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)}var OT=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],y=0,g=4;y<g;y++)p[y]=i[y]>o?o:i[y];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 S=Math.min(o,i);h="M ".concat(t,",").concat(n+c*S,`
105
+ A `).concat(S,",").concat(S,",0,0,").concat(f,",").concat(t+d*S,",").concat(n,`
106
+ L `).concat(t+r-d*S,",").concat(n,`
107
+ A `).concat(S,",").concat(S,",0,0,").concat(f,",").concat(t+r,",").concat(n+c*S,`
108
+ L `).concat(t+r,",").concat(n+a-c*S,`
109
+ A `).concat(S,",").concat(S,",0,0,").concat(f,",").concat(t+r-d*S,",").concat(n+a,`
110
+ L `).concat(t+d*S,",").concat(n+a,`
111
+ A `).concat(S,",").concat(S,",0,0,").concat(f,",").concat(t,",").concat(n+a-c*S," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return h},Bie=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),y=Math.max(o,o+d);return r>=f&&r<=h&&a>=p&&a<=y}return!1},zie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},FN=function(t){var n=PT(PT({},zie),t),r=v.useRef(),a=v.useState(-1),i=Rie(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,y=n.radius,g=n.className,S=n.animationEasing,b=n.animationDuration,x=n.animationBegin,j=n.isAnimationActive,N=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var _=bt("recharts-rectangle",g);return N?q.createElement(ps,{canBegin:o>0,from:{width:h,height:p,x:d,y:f},to:{width:h,height:p,x:d,y:f},duration:b,animationEasing:S,isActive:N},function(P){var A=P.width,O=P.height,k=P.x,R=P.y;return q.createElement(ps,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,isActive:j,easing:S},q.createElement("path",Kh({},ft(n,!0),{className:_,d:OT(k,R,A,O,y),ref:r})))}):q.createElement("path",Kh({},ft(n,!0),{className:_,d:OT(d,f,h,p,y)}))},Uie=["points","className","baseLinePoints","connectNulls"];function Cl(){return Cl=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},Cl.apply(this,arguments)}function qie(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={};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 kT(e){return Gie(e)||Kie(e)||Hie(e)||Vie()}function Vie(){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 Hie(e,t){if(e){if(typeof e=="string")return AS(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 AS(e,t)}}function Kie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Gie(e){if(Array.isArray(e))return AS(e)}function AS(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 RT=function(t){return t&&t.x===+t.x&&t.y===+t.y},Yie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){RT(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),RT(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Xu=function(t,n){var r=Yie(t);n&&(r=[r.reduce(function(i,o){return[].concat(kT(i),kT(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},Xie=function(t,n,r){var a=Xu(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Xu(n.reverse(),r).slice(1))},Qie=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=qie(t,Uie);if(!n||!n.length)return null;var c=bt("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=Xie(n,a,i);return q.createElement("g",{className:c},q.createElement("path",Cl({},ft(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?q.createElement("path",Cl({},ft(o,!0),{fill:"none",d:Xu(n,i)})):null,d?q.createElement("path",Cl({},ft(o,!0),{fill:"none",d:Xu(a,i)})):null)}var h=Xu(n,i);return q.createElement("path",Cl({},ft(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function ES(){return ES=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},ES.apply(this,arguments)}var wv=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=bt("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",ES({},ft(t,!1),hh(t),{className:o,cx:n,cy:r,r:a})):null};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 Jie=["x","y","top","left","width","height","className"];function PS(){return PS=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},PS.apply(this,arguments)}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 Zie(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){eoe(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 eoe(e,t,n){return t=toe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function toe(e){var t=noe(e,"string");return Rd(t)=="symbol"?t:t+""}function noe(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 roe(e,t){if(e==null)return{};var n=aoe(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 aoe(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 soe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},ioe=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,y=t.height,g=y===void 0?0:y,S=t.className,b=roe(t,Jie),x=Zie({x:r,y:i,top:c,left:f,width:p,height:g},b);return!$e(r)||!$e(i)||!$e(p)||!$e(g)||!$e(c)||!$e(f)?null:q.createElement("path",PS({},ft(x,!0),{className:bt("recharts-cross",S),d:soe(r,i,p,g,c,f)}))},Ow,IT;function ooe(){if(IT)return Ow;IT=1;var e=vv(),t=eL(),n=ys();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return Ow=r,Ow}var loe=ooe();const coe=Wt(loe);var kw,MT;function uoe(){if(MT)return kw;MT=1;var e=vv(),t=ys(),n=tL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return kw=r,kw}var doe=uoe();const foe=Wt(doe);var poe=["cx","cy","angle","ticks","axisLine"],hoe=["ticks","tick","angle","tickFormatter","stroke"];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)}function Qu(){return Qu=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},Qu.apply(this,arguments)}function $T(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 so(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$T(Object(n),!0).forEach(function(r){Sv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DT(e,t){if(e==null)return{};var n=moe(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 moe(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 voe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LT(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,BL(r.key),r)}}function goe(e,t,n){return t&&LT(e.prototype,t),n&&LT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yoe(e,t,n){return t=Gh(t),xoe(e,FL()?Reflect.construct(t,n||[],Gh(e).constructor):t.apply(e,n))}function xoe(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 boe(e)}function boe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FL=function(){return!!e})()}function Gh(e){return Gh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gh(e)}function woe(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&&OS(e,t)}function OS(e,t){return OS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},OS(e,t)}function Sv(e,t,n){return t=BL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BL(e){var t=Soe(e,"string");return rc(t)=="symbol"?t:t+""}function Soe(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(t==="string"?String:Number)(e)}var jv=(function(e){function t(){return voe(this,t),yoe(this,t,arguments)}return woe(t,e),goe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return ln(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=coe(c,function(h){return h.coordinate||0}),f=foe(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=DT(r,poe),h=c.reduce(function(S,b){return[Math.min(S[0],b.coordinate),Math.max(S[1],b.coordinate)]},[1/0,-1/0]),p=ln(a,i,h[0],o),y=ln(a,i,h[1],o),g=so(so(so({},ft(f,!1)),{},{fill:"none"},ft(d,!1)),{},{x1:p.x,y1:p.y,x2:y.x,y2:y.y});return q.createElement("line",Qu({className:"recharts-polar-radius-axis-line"},g))}},{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=DT(a,hoe),p=this.getTickTextAnchor(),y=ft(h,!1),g=ft(o,!1),S=i.map(function(b,x){var j=r.getTickValueCoord(b),N=so(so(so(so({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(j.x,", ").concat(j.y,")")},y),{},{stroke:"none",fill:f},g),{},{index:x},j),{},{payload:b});return q.createElement(It,Qu({className:bt("recharts-polar-radius-axis-tick",EL(o)),key:"tick-".concat(b.coordinate)},jo(r.props,b,x)),t.renderTickItem(o,N,d?d(b.value,x):b.value))});return q.createElement(It,{className:"recharts-polar-radius-axis-ticks"},S)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.axisLine,o=r.tick;return!a||!a.length?null:q.createElement(It,{className:bt("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),er.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return q.isValidElement(r)?o=q.cloneElement(r,a):gt(r)?o=r(a):o=q.createElement(No,Qu({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Sv(jv,"displayName","PolarRadiusAxis");Sv(jv,"axisType","radiusAxis");Sv(jv,"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 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 uo(){return uo=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},uo.apply(this,arguments)}function FT(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 io(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FT(Object(n),!0).forEach(function(r){Nv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function joe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BT(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,UL(r.key),r)}}function Noe(e,t,n){return t&&BT(e.prototype,t),n&&BT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Coe(e,t,n){return t=Yh(t),_oe(e,zL()?Reflect.construct(t,n||[],Yh(e).constructor):t.apply(e,n))}function _oe(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 Aoe(e)}function Aoe(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 Yh(e){return Yh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yh(e)}function Eoe(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&&kS(e,t)}function kS(e,t){return kS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},kS(e,t)}function Nv(e,t,n){return t=UL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UL(e){var t=Poe(e,"string");return ac(t)=="symbol"?t:t+""}function Poe(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(t==="string"?String:Number)(e)}var Ooe=Math.PI/180,zT=1e-5,Cv=(function(e){function t(){return joe(this,t),Coe(this,t,arguments)}return Eoe(t,e),Noe(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=ln(i,o,c,r.coordinate),y=ln(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:y.x,y2:y.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*Ooe),o;return i>zT?o=a==="outer"?"start":"end":i<-zT?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=io(io({},ft(this.props,!1)),{},{fill:"none"},ft(c,!1));if(d==="circle")return q.createElement(wv,uo({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(y){return ln(a,i,o,y.coordinate)});return q.createElement(Qie,uo({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=ft(this.props,!1),p=ft(o,!1),y=io(io({},h),{},{fill:"none"},ft(c,!1)),g=i.map(function(S,b){var x=r.getTickLineCoord(S),j=r.getTickTextAnchor(S),N=io(io(io({textAnchor:j},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:S,x:x.x2,y:x.y2});return q.createElement(It,uo({className:bt("recharts-polar-angle-axis-tick",EL(o)),key:"tick-".concat(S.coordinate)},jo(r.props,S,b)),c&&q.createElement("line",uo({className:"recharts-polar-angle-axis-tick-line"},y,x)),o&&t.renderTickItem(o,N,d?d(S.value,b):S.value))});return q.createElement(It,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:q.createElement(It,{className:bt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return q.isValidElement(r)?o=q.cloneElement(r,a):gt(r)?o=r(a):o=q.createElement(No,uo({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);Nv(Cv,"displayName","PolarAngleAxis");Nv(Cv,"axisType","angleAxis");Nv(Cv,"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 Rw,UT;function koe(){if(UT)return Rw;UT=1;var e=e5(),t=e(Object.getPrototypeOf,Object);return Rw=t,Rw}var Tw,qT;function Roe(){if(qT)return Tw;qT=1;var e=Ys(),t=koe(),n=Xs(),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 y=c.call(p,"constructor")&&p.constructor;return typeof y=="function"&&y instanceof y&&o.call(y)==d}return Tw=f,Tw}var Toe=Roe();const Ioe=Wt(Toe);var Iw,WT;function Moe(){if(WT)return Iw;WT=1;var e=Ys(),t=Xs(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return Iw=r,Iw}var $oe=Moe();const Doe=Wt($oe);function Td(e){"@babel/helpers - typeof";return Td=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},Td(e)}function Xh(){return Xh=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},Xh.apply(this,arguments)}function Loe(e,t){return Uoe(e)||zoe(e,t)||Boe(e,t)||Foe()}function Foe(){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 Boe(e,t){if(e){if(typeof e=="string")return VT(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 VT(e,t)}}function VT(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 zoe(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 Uoe(e){if(Array.isArray(e))return e}function HT(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 KT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HT(Object(n),!0).forEach(function(r){qoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qoe(e,t,n){return t=Woe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Woe(e){var t=Voe(e,"string");return Td(t)=="symbol"?t:t+""}function Voe(e,t){if(Td(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Td(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var GT=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},Hoe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Koe=function(t){var n=KT(KT({},Hoe),t),r=v.useRef(),a=v.useState(-1),i=Loe(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var _=r.current.getTotalLength();_&&c(_)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,y=n.height,g=n.className,S=n.animationEasing,b=n.animationDuration,x=n.animationBegin,j=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||y!==+y||h===0&&p===0||y===0)return null;var N=bt("recharts-trapezoid",g);return j?q.createElement(ps,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:y,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:y,x:d,y:f},duration:b,animationEasing:S,isActive:j},function(_){var P=_.upperWidth,A=_.lowerWidth,O=_.height,k=_.x,R=_.y;return q.createElement(ps,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:b,easing:S},q.createElement("path",Xh({},ft(n,!0),{className:N,d:GT(k,R,P,A,O),ref:r})))}):q.createElement("g",null,q.createElement("path",Xh({},ft(n,!0),{className:N,d:GT(d,f,h,p,y)})))},Goe=["option","shapeType","propTransformer","activeClassName","isActive"];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)}function Yoe(e,t){if(e==null)return{};var n=Xoe(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 Xoe(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 YT(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 Qh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YT(Object(n),!0).forEach(function(r){Qoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qoe(e,t,n){return t=Joe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Joe(e){var t=Zoe(e,"string");return Id(t)=="symbol"?t:t+""}function Zoe(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 ele(e,t){return Qh(Qh({},t),e)}function tle(e,t){return e==="symbols"}function XT(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return q.createElement(FN,n);case"trapezoid":return q.createElement(Koe,n);case"sector":return q.createElement(kL,n);case"symbols":if(tle(t))return q.createElement(aN,n);break;default:return null}}function nle(e){return v.isValidElement(e)?e.props:e}function qL(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?ele:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=Yoe(e,Goe),f;if(v.isValidElement(t))f=v.cloneElement(t,Qh(Qh({},d),nle(t)));else if(gt(t))f=t(d);else if(Ioe(t)&&!Doe(t)){var h=a(t,d);f=q.createElement(XT,{shapeType:n,elementProps:h})}else{var p=d;f=q.createElement(XT,{shapeType:n,elementProps:p})}return c?q.createElement(It,{className:o},f):f}function _v(e,t){return t!=null&&"trapezoids"in e.props}function Av(e,t){return t!=null&&"sectors"in e.props}function Md(e,t){return t!=null&&"points"in e.props}function rle(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 ale(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function sle(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function ile(e,t){var n;return _v(e,t)?n=rle:Av(e,t)?n=ale:Md(e,t)&&(n=sle),n}function ole(e,t){var n;return _v(e,t)?n="trapezoids":Av(e,t)?n="sectors":Md(e,t)&&(n="points"),n}function lle(e,t){if(_v(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(Av(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 Md(e,t)?t.payload:{}}function cle(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=ole(n,t),i=lle(n,t),o=r.filter(function(d,f){var h=uf(i,d),p=n.props[a].filter(function(S){var b=ile(n,t);return b(S,t)}),y=n.props[a].indexOf(p[p.length-1]),g=f===y;return h&&g}),c=r.indexOf(o[o.length-1]);return c}var th;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 _l(){return _l=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},_l.apply(this,arguments)}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 rn(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){pa(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 ule(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JT(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 dle(e,t,n){return t&&JT(e.prototype,t),n&&JT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fle(e,t,n){return t=Jh(t),ple(e,WL()?Reflect.construct(t,n||[],Jh(e).constructor):t.apply(e,n))}function ple(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 hle(e)}function hle(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 Jh(e){return Jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jh(e)}function mle(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&&RS(e,t)}function RS(e,t){return RS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},RS(e,t)}function pa(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=vle(e,"string");return sc(t)=="symbol"?t:t+""}function vle(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)}var Js=(function(e){function t(n){var r;return ule(this,t),r=fle(this,t,[n]),pa(r,"pieRef",null),pa(r,"sectorRefs",[]),pa(r,"id",Tc("recharts-pie-")),pa(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),gt(a)&&a()}),pa(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),gt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return mle(t,e),dle(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=ft(this.props,!1),p=ft(o,!1),y=ft(c,!1),g=o&&o.offsetRadius||20,S=r.map(function(b,x){var j=(b.startAngle+b.endAngle)/2,N=ln(b.cx,b.cy,b.outerRadius+g,j),_=rn(rn(rn(rn({},h),b),{},{stroke:"none"},p),{},{index:x,textAnchor:t.getTextAnchor(N.x,b.cx)},N),P=rn(rn(rn(rn({},h),b),{},{fill:"none",stroke:b.fill},y),{},{index:x,points:[ln(b.cx,b.cy,b.outerRadius,j),N]}),A=d;return xt(d)&&xt(f)?A="value":xt(d)&&(A=f),q.createElement(It,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(x)},c&&t.renderLabelLineItem(c,P,"line"),t.renderLabelItem(o,_,Wn(b,A)))});return q.createElement(It,{className:"recharts-pie-labels"},S)}},{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),y=d&&a.hasActiveIndex()?d:null,g=p?o:y,S=rn(rn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return q.createElement(It,_l({ref:function(x){x&&!a.sectorRefs.includes(x)&&a.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},jo(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),q.createElement(qL,_l({option:g,isActive:p,shapeType:"sector"},S)))})}},{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,y=p.prevSectors,g=p.prevIsAnimationActive;return q.createElement(ps,{begin:c,duration:d,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(g),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(S){var b=S.t,x=[],j=i&&i[0],N=j.startAngle;return i.forEach(function(_,P){var A=y&&y[P],O=P>0?ea(_,"paddingAngle",0):0;if(A){var k=Gr(A.endAngle-A.startAngle,_.endAngle-_.startAngle),R=rn(rn({},_),{},{startAngle:N+O,endAngle:N+k(b)+O});x.push(R),N=R.endAngle}else{var $=_.endAngle,z=_.startAngle,B=Gr(0,$-z),D=B(b),K=rn(rn({},_),{},{startAngle:N+O,endAngle:N+D+O});x.push(K),N=K.endAngle}}),q.createElement(It,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||!uf(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,y=a.outerRadius,g=a.isAnimationActive,S=this.state.isAnimationFinished;if(i||!o||!o.length||!$e(f)||!$e(h)||!$e(p)||!$e(y))return null;var b=bt("recharts-pie",c);return q.createElement(It,{tabIndex:this.props.rootTabIndex,className:b,ref:function(j){r.pieRef=j}},this.renderSectors(),d&&this.renderLabels(o),er.renderCallByParent(this.props,null,!1),(!g||S)&&zs.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(q.isValidElement(r))return q.cloneElement(r,a);if(gt(r))return r(a);var o=bt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return q.createElement(Uh,_l({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(q.isValidElement(r))return q.cloneElement(r,a);var o=i;if(gt(r)&&(o=r(a),q.isValidElement(o)))return o;var c=bt("recharts-pie-label-text",typeof r!="boolean"&&!gt(r)?r.className:"");return q.createElement(No,_l({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);th=Js;pa(Js,"displayName","Pie");pa(Js,"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:!Do.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});pa(Js,"parseDeltaAngle",function(e,t){var n=br(t-e),r=Math.min(Math.abs(t-e),360);return n*r});pa(Js,"getRealPieData",function(e){var t=e.data,n=e.children,r=ft(e,!1),a=ta(n,cv);return t&&t.length?t.map(function(i,o){return rn(rn(rn({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return rn(rn({},r),i.props)}):[]});pa(Js,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=AL(a,i),c=r+wr(e.cx,a,a/2),d=n+wr(e.cy,i,i/2),f=wr(e.innerRadius,o,0),h=wr(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}});pa(Js,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?rn(rn({},t.type.defaultProps),t.props):t.props,a=th.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,y=r.tooltipType,g=Math.abs(r.minAngle),S=th.parseCoordinateOfPie(r,n),b=th.parseDeltaAngle(o,c),x=Math.abs(b),j=f;xt(f)&&xt(p)?(Fs(!1,`Use "dataKey" to specify the value of pie,
114
+ the props "valueKey" will be deprecated in 1.1.0`),j="value"):xt(f)&&(Fs(!1,`Use "dataKey" to specify the value of pie,
115
+ the props "valueKey" will be deprecated in 1.1.0`),j=p);var N=a.filter(function(R){return Wn(R,j,0)!==0}).length,_=(x>=360?N:N-1)*d,P=x-N*g-_,A=a.reduce(function(R,$){var z=Wn($,j,0);return R+($e(z)?z:0)},0),O;if(A>0){var k;O=a.map(function(R,$){var z=Wn(R,j,0),B=Wn(R,h,$),D=($e(z)?z:0)/A,K;$?K=k.endAngle+br(b)*d*(z!==0?1:0):K=o;var U=K+br(b)*((z!==0?g:0)+D*P),V=(K+U)/2,X=(S.innerRadius+S.outerRadius)/2,Z=[{name:B,value:z,payload:R,dataKey:j,type:y}],T=ln(S.cx,S.cy,X,V);return k=rn(rn(rn({percent:D,cornerRadius:i,name:B,tooltipPayload:Z,midAngle:V,middleRadius:X,tooltipPosition:T},R),S),{},{value:Wn(R,j),startAngle:K,endAngle:U,payload:R,paddingAngle:br(b)*d}),k})}return rn(rn({},S),{},{sectors:O,data:a})});var Mw,ZT;function gle(){if(ZT)return Mw;ZT=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 Mw=n,Mw}var $w,eI;function HL(){if(eI)return $w;eI=1;var e=v5(),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 $w=r,$w}var Dw,tI;function yle(){if(tI)return Dw;tI=1;var e=gle(),t=lv(),n=HL();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 Dw=r,Dw}var Lw,nI;function xle(){if(nI)return Lw;nI=1;var e=yle(),t=e();return Lw=t,Lw}var ble=xle();const Zh=Wt(ble);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 rI(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 aI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rI(Object(n),!0).forEach(function(r){KL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KL(e,t,n){return t=wle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wle(e){var t=Sle(e,"string");return $d(t)=="symbol"?t:t+""}function Sle(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 jle=["Webkit","Moz","O","ms"],Nle=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=jle.reduce(function(i,o){return aI(aI({},i),{},KL({},o+r,n))},{});return a[t]=n,a};function ic(e){"@babel/helpers - typeof";return ic=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},ic(e)}function em(){return em=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},em.apply(this,arguments)}function sI(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 Fw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sI(Object(n),!0).forEach(function(r){Wr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iI(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,YL(r.key),r)}}function _le(e,t,n){return t&&iI(e.prototype,t),n&&iI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ale(e,t,n){return t=tm(t),Ele(e,GL()?Reflect.construct(t,n||[],tm(e).constructor):t.apply(e,n))}function Ele(e,t){if(t&&(ic(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ple(e)}function Ple(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GL=function(){return!!e})()}function tm(e){return tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},tm(e)}function Ole(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 Wr(e,t,n){return t=YL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YL(e){var t=kle(e,"string");return ic(t)=="symbol"?t:t+""}function kle(e,t){if(ic(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ic(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rle=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=Ku().domain(Zh(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}},oI=function(t){return t.changedTouches&&!!t.changedTouches.length},oc=(function(e){function t(n){var r;return Cle(this,t),r=Ale(this,t,[n]),Wr(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Wr(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Wr(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()}),Wr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Wr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Wr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Wr(r,"handleSlideDragStart",function(a){var i=oI(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 Ole(t,e),_le(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),y=Math.max(a,i),g=t.getIndexInRange(o,p),S=t.getIndexInRange(o,y);return{startIndex:g-g%d,endIndex:S===h?h:S-S%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,o=a.tickFormatter,c=a.dataKey,d=Wn(i[r],c,r);return gt(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,y=d.startIndex,g=d.endIndex,S=d.onChange,b=r.pageX-i;b>0?b=Math.min(b,f+h-p-c,f+h-p-o):b<0&&(b=Math.max(b,f-o,f-c));var x=this.getIndex({startX:o+b,endX:c+b});(x.startIndex!==y||x.endIndex!==g)&&S&&S(x),this.setState({startX:o+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=oI(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,y=h.width,g=h.travellerWidth,S=h.onChange,b=h.gap,x=h.data,j={startX:this.state.startX,endX:this.state.endX},N=r.pageX-i;N>0?N=Math.min(N,p+y-g-f):N<0&&(N=Math.max(N,p-f)),j[o]=f+N;var _=this.getIndex(j),P=_.startIndex,A=_.endIndex,O=function(){var R=x.length-1;return o==="startX"&&(c>d?P%b===0:A%b===0)||c<d&&A===R||o==="endX"&&(c>d?A%b===0:P%b===0)||c>d&&A===R};this.setState(Wr(Wr({},o,f+N),"brushMoveStartX",r.pageX),function(){S&&O()&&S(_)})}},{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 y=p+r;if(!(y===-1||y>=c.length)){var g=c[y];a==="startX"&&g>=f||a==="endX"&&g<=d||this.setState(Wr({},a,g),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 q.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?q.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,y=d.traveller,g=d.ariaLabel,S=d.data,b=d.startIndex,x=d.endIndex,j=Math.max(r,this.props.x),N=Fw(Fw({},ft(this.props,!1)),{},{x:j,y:f,width:h,height:p}),_=g||"Min value: ".concat((i=S[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=S[x])===null||o===void 0?void 0:o.name);return q.createElement(It,{tabIndex:0,role:"slider","aria-label":_,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),c.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(y,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 q.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,y=h.endX,g=5,S={pointerEvents:"none",fill:f};return q.createElement(It,{className:"recharts-brush-texts"},q.createElement(No,em({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,y)-g,y:o+c/2},S),this.getTextOfTick(a)),q.createElement(No,em({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,y)+d+g,y:o+c/2},S),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,y=this.state,g=y.startX,S=y.endX,b=y.isTextActive,x=y.isSlideMoving,j=y.isTravellerMoving,N=y.isTravellerFocused;if(!a||!a.length||!$e(c)||!$e(d)||!$e(f)||!$e(h)||f<=0||h<=0)return null;var _=bt("recharts-brush",i),P=q.Children.count(o)===1,A=Nle("userSelect","none");return q.createElement(It,{className:_,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),P&&this.renderPanorama(),this.renderSlide(g,S),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(S,"endX"),(b||x||j||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 q.createElement(q.Fragment,null,q.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),q.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),q.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 q.isValidElement(r)?i=q.cloneElement(r,a):gt(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 Fw({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Rle({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 y=a.scale.domain().map(function(g){return a.scale(g)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:y}}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);Wr(oc,"displayName","Brush");Wr(oc,"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 Bw,lI;function Tle(){if(lI)return Bw;lI=1;var e=dN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return Bw=t,Bw}var zw,cI;function Ile(){if(cI)return zw;cI=1;var e=K3(),t=ys(),n=Tle(),r=Mr(),a=lv();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 zw=i,zw}var Mle=Ile();const $le=Wt(Mle);var cs=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},Uw,uI;function Dle(){if(uI)return Uw;uI=1;var e=d5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return Uw=t,Uw}var qw,dI;function Lle(){if(dI)return qw;dI=1;var e=Dle(),t=c5(),n=ys();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 qw=r,qw}var Fle=Lle();const Ble=Wt(Fle);var Ww,fI;function zle(){if(fI)return Ww;fI=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 Ww=e,Ww}var Vw,pI;function Ule(){if(pI)return Vw;pI=1;var e=dN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return Vw=t,Vw}var Hw,hI;function qle(){if(hI)return Hw;hI=1;var e=zle(),t=Ule(),n=ys(),r=Mr(),a=lv();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 Hw=i,Hw}var Wle=qle();const Vle=Wt(Wle);var Hle=["x","y"];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 IS(){return IS=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},IS.apply(this,arguments)}function mI(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 Iu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(n),!0).forEach(function(r){Kle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kle(e,t,n){return t=Gle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gle(e){var t=Yle(e,"string");return Dd(t)=="symbol"?t:t+""}function Yle(e,t){if(Dd(e)!="object"||!e)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)}function Xle(e,t){if(e==null)return{};var n=Qle(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 Qle(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 Jle(e,t){var n=e.x,r=e.y,a=Xle(e,Hle),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),y=parseInt(p,10);return Iu(Iu(Iu(Iu(Iu({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:y,name:t.name,radius:t.radius})}function vI(e){return q.createElement(qL,IS({shapeType:"rectangle",propTransformer:Jle,activeClassName:"recharts-active-bar"},e))}var Zle=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=$e(r)||yY(r);return i?t(r,a):(i||_o(),n)}},ece=["value","background"],XL;function lc(e){"@babel/helpers - typeof";return lc=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},lc(e)}function tce(e,t){if(e==null)return{};var n=nce(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 nce(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 nm(){return nm=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},nm.apply(this,arguments)}function gI(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 Mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gI(Object(n),!0).forEach(function(r){Ei(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yI(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,JL(r.key),r)}}function ace(e,t,n){return t&&yI(e.prototype,t),n&&yI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sce(e,t,n){return t=rm(t),ice(e,QL()?Reflect.construct(t,n||[],rm(e).constructor):t.apply(e,n))}function ice(e,t){if(t&&(lc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oce(e)}function oce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QL=function(){return!!e})()}function rm(e){return rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rm(e)}function lce(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&&MS(e,t)}function MS(e,t){return MS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},MS(e,t)}function Ei(e,t,n){return t=JL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JL(e){var t=cce(e,"string");return lc(t)=="symbol"?t:t+""}function cce(e,t){if(lc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zo=(function(e){function t(){var n;rce(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=sce(this,t,[].concat(a)),Ei(n,"state",{isAnimationFinished:!1}),Ei(n,"id",Tc("recharts-bar-")),Ei(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Ei(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return lce(t,e),ace(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=ft(this.props,!1);return r&&r.map(function(p,y){var g=y===d,S=g?f:o,b=Mn(Mn(Mn({},h),p),{},{isActive:g,option:S,index:y,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return q.createElement(It,nm({className:"recharts-bar-rectangle"},jo(a.props,p,y),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(y)}),q.createElement(vI,b))})}},{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,y=this.state.prevData;return q.createElement(ps,{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(g){var S=g.t,b=i.map(function(x,j){var N=y&&y[j];if(N){var _=Gr(N.x,x.x),P=Gr(N.y,x.y),A=Gr(N.width,x.width),O=Gr(N.height,x.height);return Mn(Mn({},x),{},{x:_(S),y:P(S),width:A(S),height:O(S)})}if(o==="horizontal"){var k=Gr(0,x.height),R=k(S);return Mn(Mn({},x),{},{y:x.y+x.height-R,height:R})}var $=Gr(0,x.width),z=$(S);return Mn(Mn({},x),{},{width:z})});return q.createElement(It,null,r.renderRectanglesStatically(b))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!uf(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=ft(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,y=tce(f,ece);if(!p)return null;var g=Mn(Mn(Mn(Mn(Mn({},y),{},{fill:"#eee"},p),d),jo(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return q.createElement(vI,nm({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},g))})}},{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=ta(h,df);if(!p)return null;var y=f==="vertical"?o[0].height/2:o[0].width/2,g=function(x,j){var N=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:N,errorVal:Wn(x,j)}},S={clipPath:r?"url(#clipPath-".concat(a,")"):null};return q.createElement(It,S,p.map(function(b){return q.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:y,dataPointFormatter:g})}))}},{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,y=r.height,g=r.isAnimationActive,S=r.background,b=r.id;if(a||!i||!i.length)return null;var x=this.state.isAnimationFinished,j=bt("recharts-bar",o),N=c&&c.allowDataOverflow,_=d&&d.allowDataOverflow,P=N||_,A=xt(b)?this.id:b;return q.createElement(It,{className:j},N||_?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(A)},q.createElement("rect",{x:N?f:f-p/2,y:_?h:h-y/2,width:N?p:p*2,height:_?y:y*2}))):null,q.createElement(It,{className:"recharts-bar-rectangles",clipPath:P?"url(#clipPath-".concat(A,")"):null},S?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(P,A),(!g||x)&&zs.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);XL=zo;Ei(zo,"displayName","Bar");Ei(zo,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Do.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ei(zo,"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,y=e.offset,g=Tre(r,n);if(!g)return null;var S=t.layout,b=n.type.defaultProps,x=b!==void 0?Mn(Mn({},b),n.props):n.props,j=x.dataKey,N=x.children,_=x.minPointSize,P=S==="horizontal"?o:i,A=f?P.scale.domain():null,O=Bre({numericAxis:P}),k=ta(N,cv),R=p.map(function($,z){var B,D,K,U,V,X;f?B=Ire(f[h+z],A):(B=Wn($,j),Array.isArray(B)||(B=[O,B]));var Z=Zle(_,XL.defaultProps.minPointSize)(B[1],z);if(S==="horizontal"){var T,L=[o.scale(B[0]),o.scale(B[1])],Q=L[0],F=L[1];D=H2({axis:i,ticks:c,bandSize:a,offset:g.offset,entry:$,index:z}),K=(T=F??Q)!==null&&T!==void 0?T:void 0,U=g.size;var M=Q-F;if(V=Number.isNaN(M)?0:M,X={x:D,y:o.y,width:U,height:o.height},Math.abs(Z)>0&&Math.abs(V)<Math.abs(Z)){var ee=br(V||Z)*(Math.abs(Z)-Math.abs(V));K-=ee,V+=ee}}else{var W=[i.scale(B[0]),i.scale(B[1])],J=W[0],ye=W[1];if(D=J,K=H2({axis:o,ticks:d,bandSize:a,offset:g.offset,entry:$,index:z}),U=ye-J,V=g.size,X={x:i.x,y:K,width:i.width,height:V},Math.abs(Z)>0&&Math.abs(U)<Math.abs(Z)){var ae=br(U||Z)*(Math.abs(Z)-Math.abs(U));U+=ae}}return Mn(Mn(Mn({},$),{},{x:D,y:K,width:U,height:V,value:f?B:B[1],payload:$,background:X},k&&k[z]&&k[z].props),{},{tooltipPayload:[CL(n,$)],tooltipPosition:{x:D+U/2,y:K+V/2}})});return Mn({data:R,layout:S},y)});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 uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(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,ZL(r.key),r)}}function dce(e,t,n){return t&&xI(e.prototype,t),n&&xI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}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 $a(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){Ev(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 Ev(e,t,n){return t=ZL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZL(e){var t=fce(e,"string");return Ld(t)=="symbol"?t:t+""}function fce(e,t){if(Ld(e)!="object"||!e)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)}var e4=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},y=!!Vr(f,zo);return h.reduce(function(g,S){var b=n[S],x=b.orientation,j=b.domain,N=b.padding,_=N===void 0?{}:N,P=b.mirror,A=b.reversed,O="".concat(x).concat(P?"Mirror":""),k,R,$,z,B;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var D=j[1]-j[0],K=1/0,U=b.categoricalDomain.sort(wY);if(U.forEach(function(W,J){J>0&&(K=Math.min((W||0)-(U[J-1]||0),K))}),Number.isFinite(K)){var V=K/D,X=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(k=V*X/2),b.padding==="no-gap"){var Z=wr(t.barCategoryGap,V*X),T=V*X/2;k=T-Z-(T-Z)/X*Z}}}a==="xAxis"?R=[r.left+(_.left||0)+(k||0),r.left+r.width-(_.right||0)-(k||0)]:a==="yAxis"?R=d==="horizontal"?[r.top+r.height-(_.bottom||0),r.top+(_.top||0)]:[r.top+(_.top||0)+(k||0),r.top+r.height-(_.bottom||0)-(k||0)]:R=b.range,A&&(R=[R[1],R[0]]);var L=wL(b,i,y),Q=L.scale,F=L.realScaleType;Q.domain(j).range(R),SL(Q);var M=jL(Q,$a($a({},b),{},{realScaleType:F}));a==="xAxis"?(B=x==="top"&&!P||x==="bottom"&&P,$=r.left,z=p[O]-B*b.height):a==="yAxis"&&(B=x==="left"&&!P||x==="right"&&P,$=p[O]-B*b.width,z=r.top);var ee=$a($a($a({},b),M),{},{realScaleType:F,x:$,y:z,scale:Q,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return ee.bandSize=Fh(ee,M),!b.hide&&a==="xAxis"?p[O]+=(B?-1:1)*ee.height:b.hide||(p[O]+=(B?-1:1)*ee.width),$a($a({},g),{},Ev({},S,ee))},{})},t4=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)}},pce=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return t4({x:n,y:r},{x:a,y:i})},n4=(function(){function e(t){uce(this,e),this.scale=t}return dce(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)}}])})();Ev(n4,"EPS",1e-4);var BN=function(t){var n=Object.keys(t).reduce(function(r,a){return $a($a({},r),{},Ev({},a,n4.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 Ble(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return Vle(a,function(i,o){return n[o].isInRange(i)})}})};function hce(e){return(e%180+180)%180}var mce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=hce(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)},Kw,wI;function vce(){if(wI)return Kw;wI=1;var e=ys(),t=af(),n=iv();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 Kw=r,Kw}var Gw,SI;function gce(){if(SI)return Gw;SI=1;var e=HL();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return Gw=t,Gw}var Yw,jI;function yce(){if(jI)return Yw;jI=1;var e=a5(),t=ys(),n=gce(),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 Yw=a,Yw}var Xw,NI;function xce(){if(NI)return Xw;NI=1;var e=vce(),t=yce(),n=e(t);return Xw=n,Xw}xce();var bce=b3();const wce=Wt(bce);var Sce=wce(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("")}),r4=v.createContext(void 0),a4=v.createContext(void 0),s4=v.createContext(void 0),jce=v.createContext({}),i4=v.createContext(void 0),o4=v.createContext(0),l4=v.createContext(0),CI=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 q.createElement(r4.Provider,{value:r},q.createElement(a4.Provider,{value:a},q.createElement(jce.Provider,{value:i},q.createElement(s4.Provider,{value:h},q.createElement(i4.Provider,{value:o},q.createElement(o4.Provider,{value:f},q.createElement(l4.Provider,{value:d},c)))))))},Nce=function(){return v.useContext(i4)},c4=function(t){var n=v.useContext(r4);n==null&&_o();var r=n[t];return r==null&&_o(),r},u4=function(t){var n=v.useContext(a4);n==null&&_o();var r=n[t];return r==null&&_o(),r},Cce=function(){var t=v.useContext(s4);return t},d4=function(){return v.useContext(l4)},f4=function(){return v.useContext(o4)};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 _ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ace(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,h4(r.key),r)}}function Ece(e,t,n){return t&&Ace(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pce(e,t,n){return t=am(t),Oce(e,p4()?Reflect.construct(t,n||[],am(e).constructor):t.apply(e,n))}function Oce(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 kce(e)}function kce(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 am(e){return am=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},am(e)}function Rce(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&&$S(e,t)}function $S(e,t){return $S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$S(e,t)}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 AI(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){zN(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 zN(e,t,n){return t=h4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h4(e){var t=Tce(e,"string");return cc(t)=="symbol"?t:t+""}function Tce(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)}function Ice(e,t){return Lce(e)||Dce(e,t)||$ce(e,t)||Mce()}function Mce(){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 $ce(e,t){if(e){if(typeof e=="string")return EI(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 EI(e,t)}}function EI(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 Dce(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 Lce(e){if(Array.isArray(e))return e}function DS(){return DS=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},DS.apply(this,arguments)}var Fce=function(t,n){var r;return q.isValidElement(t)?r=q.cloneElement(t,n):gt(t)?r=t(n):r=q.createElement("line",DS({},n,{className:"recharts-reference-line-line"})),r},Bce=function(t,n,r,a,i,o,c,d,f){var h=i.x,p=i.y,y=i.width,g=i.height;if(r){var S=f.y,b=t.y.apply(S,{position:o});if(cs(f,"discard")&&!t.y.isInRange(b))return null;var x=[{x:h+y,y:b},{x:h,y:b}];return d==="left"?x.reverse():x}if(n){var j=f.x,N=t.x.apply(j,{position:o});if(cs(f,"discard")&&!t.x.isInRange(N))return null;var _=[{x:N,y:p+g},{x:N,y:p}];return c==="top"?_.reverse():_}if(a){var P=f.segment,A=P.map(function(O){return t.apply(O,{position:o})});return cs(f,"discard")&&$le(A,function(O){return!t.isInRange(O)})?null:A}return null};function zce(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=Nce(),h=c4(a),p=u4(i),y=Cce();if(!f||!y)return null;Fs(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=BN({x:h.scale,y:p.scale}),S=Vn(t),b=Vn(n),x=r&&r.length===2,j=Bce(g,S,b,x,y,e.position,h.orientation,p.orientation,e);if(!j)return null;var N=Ice(j,2),_=N[0],P=_.x,A=_.y,O=N[1],k=O.x,R=O.y,$=cs(e,"hidden")?"url(#".concat(f,")"):void 0,z=AI(AI({clipPath:$},ft(e,!0)),{},{x1:P,y1:A,x2:k,y2:R});return q.createElement(It,{className:bt("recharts-reference-line",c)},Fce(o,z),er.renderCallByParent(e,pce({x1:P,y1:A,x2:k,y2:R})))}var UN=(function(e){function t(){return _ce(this,t),Pce(this,t,arguments)}return Rce(t,e),Ece(t,[{key:"render",value:function(){return q.createElement(zce,this.props)}}])})(q.Component);zN(UN,"displayName","ReferenceLine");zN(UN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function LS(){return LS=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},LS.apply(this,arguments)}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)}function PI(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 OI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PI(Object(n),!0).forEach(function(r){Pv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qce(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,v4(r.key),r)}}function Wce(e,t,n){return t&&qce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vce(e,t,n){return t=sm(t),Hce(e,m4()?Reflect.construct(t,n||[],sm(e).constructor):t.apply(e,n))}function Hce(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 Kce(e)}function Kce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(m4=function(){return!!e})()}function sm(e){return sm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sm(e)}function Gce(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&&FS(e,t)}function FS(e,t){return FS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},FS(e,t)}function Pv(e,t,n){return t=v4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v4(e){var t=Yce(e,"string");return uc(t)=="symbol"?t:t+""}function Yce(e,t){if(uc(e)!="object"||!e)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 String(e)}var Xce=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=BN({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return cs(t,"discard")&&!o.isInRange(c)?null:c},Ov=(function(e){function t(){return Uce(this,t),Vce(this,t,arguments)}return Gce(t,e),Wce(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=Vn(a),h=Vn(i);if(Fs(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=Xce(this.props);if(!p)return null;var y=p.x,g=p.y,S=this.props,b=S.shape,x=S.className,j=cs(this.props,"hidden")?"url(#".concat(d,")"):void 0,N=OI(OI({clipPath:j},ft(this.props,!0)),{},{cx:y,cy:g});return q.createElement(It,{className:bt("recharts-reference-dot",x)},t.renderDot(b,N),er.renderCallByParent(this.props,{x:y-o,y:g-o,width:2*o,height:2*o}))}}])})(q.Component);Pv(Ov,"displayName","ReferenceDot");Pv(Ov,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Pv(Ov,"renderDot",function(e,t){var n;return q.isValidElement(e)?n=q.cloneElement(e,t):gt(e)?n=e(t):n=q.createElement(wv,LS({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function BS(){return BS=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},BS.apply(this,arguments)}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 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){kv(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 Qce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jce(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,y4(r.key),r)}}function Zce(e,t,n){return t&&Jce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function eue(e,t,n){return t=im(t),tue(e,g4()?Reflect.construct(t,n||[],im(e).constructor):t.apply(e,n))}function tue(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 nue(e)}function nue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g4=function(){return!!e})()}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},im(e)}function rue(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&&zS(e,t)}function zS(e,t){return zS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},zS(e,t)}function kv(e,t,n){return t=y4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y4(e){var t=aue(e,"string");return dc(t)=="symbol"?t:t+""}function aue(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 String(e)}var sue=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 y=BN({x:h.scale,y:p.scale}),g={x:t?y.x.apply(o,{position:"start"}):y.x.rangeMin,y:r?y.y.apply(d,{position:"start"}):y.y.rangeMin},S={x:n?y.x.apply(c,{position:"end"}):y.x.rangeMax,y:a?y.y.apply(f,{position:"end"}):y.y.rangeMax};return cs(i,"discard")&&(!y.isInRange(g)||!y.isInRange(S))?null:t4(g,S)},Rv=(function(e){function t(){return Qce(this,t),eue(this,t,arguments)}return rue(t,e),Zce(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;Fs(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Vn(a),y=Vn(i),g=Vn(o),S=Vn(c),b=this.props.shape;if(!p&&!y&&!g&&!S&&!b)return null;var x=sue(p,y,g,S,this.props);if(!x&&!b)return null;var j=cs(this.props,"hidden")?"url(#".concat(h,")"):void 0;return q.createElement(It,{className:bt("recharts-reference-area",d)},t.renderRect(b,RI(RI({clipPath:j},ft(this.props,!0)),x)),er.renderCallByParent(this.props,x))}}])})(q.Component);kv(Rv,"displayName","ReferenceArea");kv(Rv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});kv(Rv,"renderRect",function(e,t){var n;return q.isValidElement(e)?n=q.cloneElement(e,t):gt(e)?n=e(t):n=q.createElement(FN,BS({},t,{className:"recharts-reference-area-rect"})),n});function x4(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 iue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return mce(r,n)}function oue(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 om(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 lue(e,t){return x4(e,t+1)}function cue(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 S=r?.[d];if(S===void 0)return{v:x4(r,f)};var b=d,x,j=function(){return x===void 0&&(x=n(S,b)),x},N=S.coordinate,_=d===0||om(e,N,j,h,c);_||(d=0,h=o,f+=1),_&&(h=N+e*(j()/2+a),d+=f)},y;f<=i.length;)if(y=p(),y)return y.v;return[]}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 TI(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 pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TI(Object(n),!0).forEach(function(r){uue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uue(e,t,n){return t=due(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function due(e){var t=fue(e,"string");return Fd(t)=="symbol"?t:t+""}function fue(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)}function pue(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(y){var g=i[y],S,b=function(){return S===void 0&&(S=n(g,y)),S};if(y===o-1){var x=e*(g.coordinate+e*b()/2-d);i[y]=g=pr(pr({},g),{},{tickCoord:x>0?g.coordinate-x*e:g.coordinate})}else i[y]=g=pr(pr({},g),{},{tickCoord:g.coordinate});var j=om(e,g.tickCoord,b,c,d);j&&(d=g.tickCoord-e*(b()/2+a),i[y]=pr(pr({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function hue(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),y=e*(h.coordinate+e*p/2-f);o[c-1]=h=pr(pr({},h),{},{tickCoord:y>0?h.coordinate-y*e:h.coordinate});var g=om(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+a),o[c-1]=pr(pr({},h),{},{isShow:!0}))}for(var S=i?c-1:c,b=function(N){var _=o[N],P,A=function(){return P===void 0&&(P=n(_,N)),P};if(N===0){var O=e*(_.coordinate-e*A()/2-d);o[N]=_=pr(pr({},_),{},{tickCoord:O<0?_.coordinate-O*e:_.coordinate})}else o[N]=_=pr(pr({},_),{},{tickCoord:_.coordinate});var k=om(e,_.tickCoord,A,d,f);k&&(d=_.tickCoord+e*(A()/2+a),o[N]=pr(pr({},_),{},{isShow:!0}))},x=0;x<S;x++)b(x);return o}function mue(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($e(d)||Do.isSsr)return lue(a,typeof d=="number"&&$e(d)?d:0);var y=[],g=c==="top"||c==="bottom"?"width":"height",S=h&&g==="width"?Hu(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(_,P){var A=gt(f)?f(_.value,P):_.value;return g==="width"?iue(Hu(A,{fontSize:t,letterSpacing:n}),S,p):Hu(A,{fontSize:t,letterSpacing:n})[g]},x=a.length>=2?br(a[1].coordinate-a[0].coordinate):1,j=oue(i,x,g);return d==="equidistantPreserveStart"?cue(x,j,b,a,o):(d==="preserveStart"||d==="preserveStartEnd"?y=hue(x,j,b,a,o,d==="preserveStartEnd"):y=pue(x,j,b,a,o),y.filter(function(N){return N.isShow}))}var vue=["viewBox"],gue=["viewBox"],yue=["ticks"];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 Al(){return Al=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},Al.apply(this,arguments)}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 Un(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){qN(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 Qw(e,t){if(e==null)return{};var n=xue(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 xue(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 bue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MI(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 wue(e,t,n){return t&&MI(e.prototype,t),n&&MI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sue(e,t,n){return t=lm(t),jue(e,b4()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}function jue(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 Nue(e)}function Nue(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 lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lm(e)}function Cue(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&&US(e,t)}function US(e,t){return US=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},US(e,t)}function qN(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=_ue(e,"string");return fc(t)=="symbol"?t:t+""}function _ue(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 String(e)}var Tv=(function(e){function t(n){var r;return bue(this,t),r=Sue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Cue(t,e),wue(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=Qw(r,vue),c=this.props,d=c.viewBox,f=Qw(c,gue);return!Ml(i,d)||!Ml(o,f)||!Ml(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,y=a.tickMargin,g,S,b,x,j,N,_=p?-1:1,P=r.tickSize||h,A=$e(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":g=S=r.coordinate,x=o+ +!p*d,b=x-_*P,N=b-_*y,j=A;break;case"left":b=x=r.coordinate,S=i+ +!p*c,g=S-_*P,j=g-_*y,N=A;break;case"right":b=x=r.coordinate,S=i+ +p*c,g=S+_*P,j=g+_*y,N=A;break;default:g=S=r.coordinate,x=o+ +p*d,b=x+_*P,N=b+_*y,j=A;break}return{line:{x1:g,y1:b,x2:S,y2:x},tick:{x:j,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=Un(Un(Un({},ft(this.props,!1)),ft(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var y=+(d==="top"&&!f||d==="bottom"&&f);p=Un(Un({},p),{},{x1:a,y1:i+y*c,x2:a+o,y2:i+y*c})}else{var g=+(d==="left"&&!f||d==="right"&&f);p=Un(Un({},p),{},{x1:a+g*o,y1:i,x2:a+g*o,y2:i+c})}return q.createElement("line",Al({},p,{className:bt("recharts-cartesian-axis-line",ea(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,y=c.unit,g=mue(Un(Un({},this.props),{},{ticks:r}),a,i),S=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),x=ft(this.props,!1),j=ft(h,!1),N=Un(Un({},x),{},{fill:"none"},ft(d,!1)),_=g.map(function(P,A){var O=o.getTickLineCoord(P),k=O.line,R=O.tick,$=Un(Un(Un(Un({textAnchor:S,verticalAnchor:b},x),{},{stroke:"none",fill:f},j),R),{},{index:A,payload:P,visibleTicksCount:g.length,tickFormatter:p});return q.createElement(It,Al({className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},jo(o.props,P,A)),d&&q.createElement("line",Al({},N,k,{className:bt("recharts-cartesian-axis-tick-line",ea(d,"className"))})),h&&t.renderTickItem(h,$,"".concat(gt(p)?p(P.value,A):P.value).concat(y||"")))});return q.createElement("g",{className:"recharts-cartesian-axis-ticks"},_)}},{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,y=p.ticks,g=Qw(p,yue),S=y;return gt(d)&&(S=y&&y.length>0?d(this.props):d(g)),o<=0||c<=0||!S||!S.length?null:q.createElement(It,{className:bt("recharts-cartesian-axis",f),ref:function(x){r.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(S,this.state.fontSize,this.state.letterSpacing),er.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=bt(a.className,"recharts-cartesian-axis-tick-value");return q.isValidElement(r)?o=q.cloneElement(r,Un(Un({},a),{},{className:c})):gt(r)?o=r(Un(Un({},a),{},{className:c})):o=q.createElement(No,Al({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);qN(Tv,"displayName","CartesianAxis");qN(Tv,"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 Aue=["type","layout","connectNulls","ref"],Eue=["key"];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 $I(e,t){if(e==null)return{};var n=Pue(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 Pue(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 Ju(){return Ju=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},Ju.apply(this,arguments)}function DI(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 qr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(n),!0).forEach(function(r){Da(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yl(e){return Tue(e)||Rue(e)||kue(e)||Oue()}function Oue(){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 kue(e,t){if(e){if(typeof e=="string")return qS(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 qS(e,t)}}function Rue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tue(e){if(Array.isArray(e))return qS(e)}function qS(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 Iue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LI(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,j4(r.key),r)}}function Mue(e,t,n){return t&&LI(e.prototype,t),n&&LI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $ue(e,t,n){return t=cm(t),Due(e,S4()?Reflect.construct(t,n||[],cm(e).constructor):t.apply(e,n))}function Due(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 Lue(e)}function Lue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(S4=function(){return!!e})()}function cm(e){return cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cm(e)}function Fue(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&&WS(e,t)}function WS(e,t){return WS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},WS(e,t)}function Da(e,t,n){return t=j4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j4(e){var t=Bue(e,"string");return pc(t)=="symbol"?t:t+""}function Bue(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 hc=(function(e){function t(){var n;Iue(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=$ue(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(j,N){return j+N});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,y=c-o,g=[],S=0,b=0;S<d.length;b+=d[S],++S)if(b+d[S]>p){g=[].concat(yl(d.slice(0,S)),[p-b]);break}var x=g.length%2===0?[0,y]:[y];return[].concat(yl(t.repeat(d,h)),yl(g),x).map(function(j){return"".concat(j,"px")}).join(", ")}),Da(n,"id",Tc("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 Fue(t,e),Mue(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=ta(h,df);if(!p)return null;var y=function(b,x){return{x:b.x,y:b.y,value:b.value,errorVal:Wn(b.payload,x)}},g={clipPath:r?"url(#clipPath-".concat(a,")"):null};return q.createElement(It,g,p.map(function(S){return q.cloneElement(S,{key:"bar-".concat(S.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:y})}))}},{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=ft(this.props,!1),y=ft(d,!0),g=f.map(function(b,x){var j=qr(qr(qr({key:"dot-".concat(x),r:3},p),y),{},{index:x,cx:b.x,cy:b.y,value:b.value,dataKey:h,payload:b.payload,points:f});return t.renderDotItem(d,j)}),S={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return q.createElement(It,Ju({className:"recharts-line-dots",key:"dots"},S),g)}},{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=$I(c,Aue),y=qr(qr(qr({},ft(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 q.createElement(Uh,Ju({},y,{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,y=o.animationEasing,g=o.animationId,S=o.animateNewValues,b=o.width,x=o.height,j=this.state,N=j.prevPoints,_=j.totalLength;return q.createElement(ps,{begin:h,duration:p,isActive:f,easing:y,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var A=P.t;if(N){var O=N.length/c.length,k=c.map(function(D,K){var U=Math.floor(K*O);if(N[U]){var V=N[U],X=Gr(V.x,D.x),Z=Gr(V.y,D.y);return qr(qr({},D),{},{x:X(A),y:Z(A)})}if(S){var T=Gr(b*2,D.x),L=Gr(x/2,D.y);return qr(qr({},D),{},{x:T(A),y:L(A)})}return qr(qr({},D),{},{x:D.x,y:D.y})});return i.renderCurveStatically(k,r,a)}var R=Gr(0,_),$=R(A),z;if(d){var B="".concat(d).split(/[,\s]+/gim).map(function(D){return parseFloat(D)});z=i.getStrokeDasharray($,_,B)}else z=i.generateSimpleStrokeDasharray(_,$);return i.renderCurveStatically(c,r,a,{strokeDasharray:z})})}},{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||!uf(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,y=a.left,g=a.width,S=a.height,b=a.isAnimationActive,x=a.id;if(i||!c||!c.length)return null;var j=this.state.isAnimationFinished,N=c.length===1,_=bt("recharts-line",d),P=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,O=P||A,k=xt(x)?this.id:x,R=(r=ft(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},$=R.r,z=$===void 0?3:$,B=R.strokeWidth,D=B===void 0?2:B,K=OY(o)?o:{},U=K.clipDot,V=U===void 0?!0:U,X=z*2+D;return q.createElement(It,{className:_},P||A?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(k)},q.createElement("rect",{x:P?y:y-g/2,y:A?p:p-S/2,width:P?g:g*2,height:A?S:S*2})),!V&&q.createElement("clipPath",{id:"clipPath-dots-".concat(k)},q.createElement("rect",{x:y-X/2,y:p-X/2,width:g+X,height:S+X}))):null,!N&&this.renderCurve(O,k),this.renderErrorBar(O,k),(N||o)&&this.renderDots(O,V,k),(!b||j)&&zs.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(yl(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(yl(o),yl(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(q.isValidElement(r))i=q.cloneElement(r,a);else if(gt(r))i=r(a);else{var o=a.key,c=$I(a,Eue),d=bt("recharts-line-dot",typeof r!="boolean"?r.className:"");i=q.createElement(wv,Ju({key:o},c,{className:d}))}return i}}])})(v.PureComponent);Da(hc,"displayName","Line");Da(hc,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Do.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Da(hc,"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(y,g){var S=Wn(y,o);return h==="horizontal"?{x:V2({axis:n,ticks:a,bandSize:c,entry:y,index:g}),y:xt(S)?null:r.scale(S),value:S,payload:y}:{x:xt(S)?null:n.scale(S),y:V2({axis:r,ticks:i,bandSize:c,entry:y,index:g}),value:S,payload:y}});return qr({points:p,layout:h},f)});function mc(e){"@babel/helpers - typeof";return mc=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},mc(e)}function zue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uue(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 que(e,t,n){return t&&Uue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wue(e,t,n){return t=um(t),Vue(e,N4()?Reflect.construct(t,n||[],um(e).constructor):t.apply(e,n))}function Vue(e,t){if(t&&(mc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hue(e)}function Hue(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 um(e){return um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},um(e)}function Kue(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&&VS(e,t)}function VS(e,t){return VS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},VS(e,t)}function C4(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=Gue(e,"string");return mc(t)=="symbol"?t:t+""}function Gue(e,t){if(mc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function HS(){return HS=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},HS.apply(this,arguments)}function Yue(e){var t=e.xAxisId,n=d4(),r=f4(),a=c4(t);return a==null?null:v.createElement(Tv,HS({},a,{className:bt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return mo(o,!0)}}))}var Ao=(function(e){function t(){return zue(this,t),Wue(this,t,arguments)}return Kue(t,e),que(t,[{key:"render",value:function(){return v.createElement(Yue,this.props)}}])})(v.Component);C4(Ao,"displayName","XAxis");C4(Ao,"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 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 Xue(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,P4(r.key),r)}}function Jue(e,t,n){return t&&Que(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zue(e,t,n){return t=dm(t),ede(e,A4()?Reflect.construct(t,n||[],dm(e).constructor):t.apply(e,n))}function ede(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 tde(e)}function tde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A4=function(){return!!e})()}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dm(e)}function nde(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&&KS(e,t)}function KS(e,t){return KS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},KS(e,t)}function E4(e,t,n){return t=P4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P4(e){var t=rde(e,"string");return vc(t)=="symbol"?t:t+""}function rde(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)}function GS(){return GS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GS.apply(this,arguments)}var ade=function(t){var n=t.yAxisId,r=d4(),a=f4(),i=u4(n);return i==null?null:v.createElement(Tv,GS({},i,{className:bt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return mo(c,!0)}}))},Eo=(function(e){function t(){return Xue(this,t),Zue(this,t,arguments)}return nde(t,e),Jue(t,[{key:"render",value:function(){return v.createElement(ade,this.props)}}])})(v.Component);E4(Eo,"displayName","YAxis");E4(Eo,"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 FI(e){return lde(e)||ode(e)||ide(e)||sde()}function sde(){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 ide(e,t){if(e){if(typeof e=="string")return YS(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 YS(e,t)}}function ode(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lde(e){if(Array.isArray(e))return YS(e)}function YS(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 XS=function(t,n,r,a,i){var o=ta(t,UN),c=ta(t,Ov),d=[].concat(FI(o),FI(c)),f=ta(t,Rv),h="".concat(a,"Id"),p=a[0],y=n;if(d.length&&(y=d.reduce(function(b,x){if(x.props[h]===r&&cs(x.props,"extendDomain")&&$e(x.props[p])){var j=x.props[p];return[Math.min(b[0],j),Math.max(b[1],j)]}return b},y)),f.length){var g="".concat(p,"1"),S="".concat(p,"2");y=f.reduce(function(b,x){if(x.props[h]===r&&cs(x.props,"extendDomain")&&$e(x.props[g])&&$e(x.props[S])){var j=x.props[g],N=x.props[S];return[Math.min(b[0],j,N),Math.max(b[1],j,N)]}return b},y)}return i&&i.length&&(y=i.reduce(function(b,x){return $e(x)?[Math.min(b[0],x),Math.max(b[1],x)]:b},y)),y},Jw={exports:{}},BI;function cde(){return BI||(BI=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,y){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new a(h,p||d,y),S=n?n+f:f;return d._events[S]?d._events[S].fn?d._events[S]=[d._events[S],g]:d._events[S].push(g):(d._events[S]=g,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 y=0,g=p.length,S=new Array(g);y<g;y++)S[y]=p[y].fn;return S},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,y,g,S){var b=n?n+f:f;if(!this._events[b])return!1;var x=this._events[b],j=arguments.length,N,_;if(x.fn){switch(x.once&&this.removeListener(f,x.fn,void 0,!0),j){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,y),!0;case 5:return x.fn.call(x.context,h,p,y,g),!0;case 6:return x.fn.call(x.context,h,p,y,g,S),!0}for(_=1,N=new Array(j-1);_<j;_++)N[_-1]=arguments[_];x.fn.apply(x.context,N)}else{var P=x.length,A;for(_=0;_<P;_++)switch(x[_].once&&this.removeListener(f,x[_].fn,void 0,!0),j){case 1:x[_].fn.call(x[_].context);break;case 2:x[_].fn.call(x[_].context,h);break;case 3:x[_].fn.call(x[_].context,h,p);break;case 4:x[_].fn.call(x[_].context,h,p,y);break;default:if(!N)for(A=1,N=new Array(j-1);A<j;A++)N[A-1]=arguments[A];x[_].fn.apply(x[_].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,y){var g=n?n+f:f;if(!this._events[g])return this;if(!h)return o(this,g),this;var S=this._events[g];if(S.fn)S.fn===h&&(!y||S.once)&&(!p||S.context===p)&&o(this,g);else{for(var b=0,x=[],j=S.length;b<j;b++)(S[b].fn!==h||y&&!S[b].once||p&&S[b].context!==p)&&x.push(S[b]);x.length?this._events[g]=x.length===1?x[0]:x:o(this,g)}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})(Jw)),Jw.exports}var ude=cde();const dde=Wt(ude);var Zw=new dde,e1="recharts.syncMouseEvents";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 fde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pde(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,O4(r.key),r)}}function hde(e,t,n){return t&&pde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function t1(e,t,n){return t=O4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O4(e){var t=mde(e,"string");return Bd(t)=="symbol"?t:t+""}function mde(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 String(e)}var vde=(function(){function e(){fde(this,e),t1(this,"activeIndex",0),t1(this,"coordinateList",[]),t1(this,"layout","horizontal")}return hde(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,y=n.mouseHandlerCallback,g=y===void 0?null:y;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=g??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,y=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:y})}}}])})();function gde(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&$e(r)&&$e(a))return!0}return!1}function yde(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 k4(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=ln(t,n,r,a),c=ln(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function xde(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,y=ln(c,d,f,p),g=ln(c,d,h,p);r=y.x,a=y.y,i=g.x,o=g.y}else return k4(t);return[{x:r,y:a},{x:i,y:o}]}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 zI(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 Vp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zI(Object(n),!0).forEach(function(r){bde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bde(e,t,n){return t=wde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wde(e){var t=Sde(e,"string");return zd(t)=="symbol"?t:t+""}function Sde(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)}function jde(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,y=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!i||!o||y!=="ScatterChart"&&a!=="axis")return null;var S,b=Uh;if(y==="ScatterChart")S=o,b=ioe;else if(y==="BarChart")S=yde(p,o,d,h),b=FN;else if(p==="radial"){var x=k4(o),j=x.cx,N=x.cy,_=x.radius,P=x.startAngle,A=x.endAngle;S={cx:j,cy:N,startAngle:P,endAngle:A,innerRadius:_,outerRadius:_},b=kL}else S={points:xde(p,o,d)},b=Uh;var O=Vp(Vp(Vp(Vp({stroke:"#ccc",pointerEvents:"none"},d),S),ft(g,!1)),{},{payload:c,payloadIndex:f,className:bt("recharts-tooltip-cursor",g.className)});return v.isValidElement(g)?v.cloneElement(g,O):v.createElement(b,O)}var Nde=["item"],Cde=["children","className","width","height","style","compact","title","desc"];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 El(){return El=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},El.apply(this,arguments)}function UI(e,t){return Ede(e)||Ade(e,t)||T4(e,t)||_de()}function _de(){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 Ade(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 Ede(e){if(Array.isArray(e))return e}function qI(e,t){if(e==null)return{};var n=Pde(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 Pde(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 Ode(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kde(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 Rde(e,t,n){return t&&kde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tde(e,t,n){return t=fm(t),Ide(e,R4()?Reflect.construct(t,n||[],fm(e).constructor):t.apply(e,n))}function Ide(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 Mde(e)}function Mde(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 fm(e){return fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fm(e)}function $de(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&&QS(e,t)}function QS(e,t){return QS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},QS(e,t)}function yc(e){return Fde(e)||Lde(e)||T4(e)||Dde()}function Dde(){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 T4(e,t){if(e){if(typeof e=="string")return JS(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 JS(e,t)}}function Lde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fde(e){if(Array.isArray(e))return JS(e)}function JS(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 WI(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 be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WI(Object(n),!0).forEach(function(r){pt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pt(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=Bde(e,"string");return gc(t)=="symbol"?t:t+""}function Bde(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(t==="string"?String:Number)(e)}var zde={xAxis:["bottom","top"],yAxis:["left","right"]},Ude={width:"100%",height:"100%"},M4={x:0,y:0};function Hp(e){return e}var qde=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Wde=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 be(be(be({},a),ln(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return be(be(be({},a),ln(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return M4},Iv=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(yc(c),yc(f)):c},[]);return o.length>0?o:t&&t.length&&$e(a)&&$e(i)?t.slice(a,i+1):[]};function $4(e){return e==="number"?[0,"auto"]:void 0}var ZS=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=Iv(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 y;if(o.dataKey&&!o.allowDuplicatedCategory){var g=p===void 0?c:p;y=ph(g,o.dataKey,a)}else y=p&&p[r]||c[r];return y?[].concat(yc(d),[CL(f,y)]):d},[])},VI=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=qde(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Are(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,y=ZS(t,n,h,p),g=Wde(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:y,activeCoordinate:g}}return null},Vde=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,y=t.stackOffset,g=bL(h,i);return r.reduce(function(S,b){var x,j=b.type.defaultProps!==void 0?be(be({},b.type.defaultProps),b.props):b.props,N=j.type,_=j.dataKey,P=j.allowDataOverflow,A=j.allowDuplicatedCategory,O=j.scale,k=j.ticks,R=j.includeHidden,$=j[o];if(S[$])return S;var z=Iv(t.data,{graphicalItems:a.filter(function(M){var ee,W=o in M.props?M.props[o]:(ee=M.type.defaultProps)===null||ee===void 0?void 0:ee[o];return W===$}),dataStartIndex:d,dataEndIndex:f}),B=z.length,D,K,U;gde(j.domain,P,N)&&(D=pS(j.domain,null,P),g&&(N==="number"||O!=="auto")&&(U=Gu(z,_,"category")));var V=$4(N);if(!D||D.length===0){var X,Z=(X=j.domain)!==null&&X!==void 0?X:V;if(_){if(D=Gu(z,_,N),N==="category"&&g){var T=bY(D);A&&T?(K=D,D=Zh(0,B)):A||(D=Y2(Z,D,b).reduce(function(M,ee){return M.indexOf(ee)>=0?M:[].concat(yc(M),[ee])},[]))}else if(N==="category")A?D=D.filter(function(M){return M!==""&&!xt(M)}):D=Y2(Z,D,b).reduce(function(M,ee){return M.indexOf(ee)>=0||ee===""||xt(ee)?M:[].concat(yc(M),[ee])},[]);else if(N==="number"){var L=Rre(z,a.filter(function(M){var ee,W,J=o in M.props?M.props[o]:(ee=M.type.defaultProps)===null||ee===void 0?void 0:ee[o],ye="hide"in M.props?M.props.hide:(W=M.type.defaultProps)===null||W===void 0?void 0:W.hide;return J===$&&(R||!ye)}),_,i,h);L&&(D=L)}g&&(N==="number"||O!=="auto")&&(U=Gu(z,_,"category"))}else g?D=Zh(0,B):c&&c[$]&&c[$].hasStack&&N==="number"?D=y==="expand"?[0,1]:NL(c[$].stackGroups,d,f):D=xL(z,a.filter(function(M){var ee=o in M.props?M.props[o]:M.type.defaultProps[o],W="hide"in M.props?M.props.hide:M.type.defaultProps.hide;return ee===$&&(R||!W)}),N,h,!0);if(N==="number")D=XS(p,D,$,i,k),Z&&(D=pS(Z,D,P));else if(N==="category"&&Z){var Q=Z,F=D.every(function(M){return Q.indexOf(M)>=0});F&&(D=Q)}}return be(be({},S),{},pt({},$,be(be({},j),{},{axisType:i,domain:D,categoricalDomain:U,duplicateDomain:K,originalDomain:(x=j.domain)!==null&&x!==void 0?x:V,isCategorical:g,layout:h})))},{})},Hde=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,y=Iv(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=y.length,S=bL(h,i),b=-1;return r.reduce(function(x,j){var N=j.type.defaultProps!==void 0?be(be({},j.type.defaultProps),j.props):j.props,_=N[o],P=$4("number");if(!x[_]){b++;var A;return S?A=Zh(0,g):c&&c[_]&&c[_].hasStack?(A=NL(c[_].stackGroups,d,f),A=XS(p,A,_,i)):(A=pS(P,xL(y,r.filter(function(O){var k,R,$=o in O.props?O.props[o]:(k=O.type.defaultProps)===null||k===void 0?void 0:k[o],z="hide"in O.props?O.props.hide:(R=O.type.defaultProps)===null||R===void 0?void 0:R.hide;return $===_&&!z}),"number",h),a.defaultProps.allowDataOverflow),A=XS(p,A,_,i)),be(be({},x),{},pt({},_,be(be({axisType:i},a.defaultProps),{},{hide:!0,orientation:ea(zde,"".concat(i,".").concat(b%2),null),domain:A,originalDomain:P,isCategorical:S,layout:h})))}return x},{})},Kde=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"),y=ta(h,i),g={};return y&&y.length?g=Vde(t,{axes:y,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(g=Hde(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},Gde=function(t){var n=wl(t),r=mo(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:fN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Fh(n,r)}},HI=function(t){var n=t.children,r=t.defaultShowTooltip,a=Vr(n,oc),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}},Yde=function(t){return!t||!t.length?!1:t.some(function(n){var r=Ls(n&&n.type);return r&&r.indexOf("Bar")>=0})},KI=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"}},Xde=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,y=r.margin||{},g=Vr(p,oc),S=Vr(p,$l),b=Object.keys(d).reduce(function(A,O){var k=d[O],R=k.orientation;return!k.mirror&&!k.hide?be(be({},A),{},pt({},R,A[R]+k.width)):A},{left:y.left||0,right:y.right||0}),x=Object.keys(o).reduce(function(A,O){var k=o[O],R=k.orientation;return!k.mirror&&!k.hide?be(be({},A),{},pt({},R,ea(A,"".concat(R))+k.height)):A},{top:y.top||0,bottom:y.bottom||0}),j=be(be({},x),b),N=j.bottom;g&&(j.bottom+=g.props.height||oc.defaultProps.height),S&&n&&(j=Ore(j,a,r,n));var _=f-j.left-j.right,P=h-j.top-j.bottom;return be(be({brushBottom:N},j),{},{width:Math.max(_,0),height:Math.max(P,0)})},Qde=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},WN=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,y=function(j,N){var _=N.graphicalItems,P=N.stackGroups,A=N.offset,O=N.updateId,k=N.dataStartIndex,R=N.dataEndIndex,$=j.barSize,z=j.layout,B=j.barGap,D=j.barCategoryGap,K=j.maxBarSize,U=KI(z),V=U.numericAxisName,X=U.cateAxisName,Z=Yde(_),T=[];return _.forEach(function(L,Q){var F=Iv(j.data,{graphicalItems:[L],dataStartIndex:k,dataEndIndex:R}),M=L.type.defaultProps!==void 0?be(be({},L.type.defaultProps),L.props):L.props,ee=M.dataKey,W=M.maxBarSize,J=M["".concat(V,"Id")],ye=M["".concat(X,"Id")],ae={},ue=d.reduce(function(et,dt){var Pt=N["".concat(dt.axisType,"Map")],hn=M["".concat(dt.axisType,"Id")];Pt&&Pt[hn]||dt.axisType==="zAxis"||_o();var we=Pt[hn];return be(be({},et),{},pt(pt({},dt.axisType,we),"".concat(dt.axisType,"Ticks"),mo(we)))},ae),ie=ue[X],ve=ue["".concat(X,"Ticks")],Oe=P&&P[J]&&P[J].hasStack&&zre(L,P[J].stackGroups),oe=Ls(L.type).indexOf("Bar")>=0,he=Fh(ie,ve),xe=[],Ie=Z&&Ere({barSize:$,stackGroups:P,totalSize:Qde(ue,X)});if(oe){var re,me,Ne=xt(W)?K:W,tt=(re=(me=Fh(ie,ve,!0))!==null&&me!==void 0?me:Ne)!==null&&re!==void 0?re:0;xe=Pre({barGap:B,barCategoryGap:D,bandSize:tt!==he?tt:he,sizeList:Ie[ye],maxBarSize:Ne}),tt!==he&&(xe=xe.map(function(et){return be(be({},et),{},{position:be(be({},et.position),{},{offset:et.position.offset-tt/2})})}))}var je=L&&L.type&&L.type.getComposedData;je&&T.push({props:be(be({},je(be(be({},ue),{},{displayedData:F,props:j,dataKey:ee,item:L,bandSize:he,barPosition:xe,offset:A,stackedData:Oe,layout:z,dataStartIndex:k,dataEndIndex:R}))),{},pt(pt(pt({key:L.key||"item-".concat(Q)},V,ue[V]),X,ue[X]),"animationId",O)),childIndex:TY(L,j.children),item:L})}),T},g=function(j,N){var _=j.props,P=j.dataStartIndex,A=j.dataEndIndex,O=j.updateId;if(!cO({props:_}))return null;var k=_.children,R=_.layout,$=_.stackOffset,z=_.data,B=_.reverseStackOrder,D=KI(R),K=D.numericAxisName,U=D.cateAxisName,V=ta(k,r),X=Fre(z,V,"".concat(K,"Id"),"".concat(U,"Id"),$,B),Z=d.reduce(function(M,ee){var W="".concat(ee.axisType,"Map");return be(be({},M),{},pt({},W,Kde(_,be(be({},ee),{},{graphicalItems:V,stackGroups:ee.axisType===K&&X,dataStartIndex:P,dataEndIndex:A}))))},{}),T=Xde(be(be({},Z),{},{props:_,graphicalItems:V}),N?.legendBBox);Object.keys(Z).forEach(function(M){Z[M]=h(_,Z[M],T,M.replace("Map",""),n)});var L=Z["".concat(U,"Map")],Q=Gde(L),F=y(_,be(be({},Z),{},{dataStartIndex:P,dataEndIndex:A,updateId:O,graphicalItems:V,stackGroups:X,offset:T}));return be(be({formattedGraphicalItems:F,graphicalItems:V,offset:T,stackGroups:X},Q),Z)},S=(function(x){function j(N){var _,P,A;return Ode(this,j),A=Tde(this,j,[N]),pt(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),pt(A,"accessibilityManager",new vde),pt(A,"handleLegendBBoxUpdate",function(O){if(O){var k=A.state,R=k.dataStartIndex,$=k.dataEndIndex,z=k.updateId;A.setState(be({legendBBox:O},g({props:A.props,dataStartIndex:R,dataEndIndex:$,updateId:z},be(be({},A.state),{},{legendBBox:O}))))}}),pt(A,"handleReceiveSyncEvent",function(O,k,R){if(A.props.syncId===O){if(R===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(k)}}),pt(A,"handleBrushChange",function(O){var k=O.startIndex,R=O.endIndex;if(k!==A.state.dataStartIndex||R!==A.state.dataEndIndex){var $=A.state.updateId;A.setState(function(){return be({dataStartIndex:k,dataEndIndex:R},g({props:A.props,dataStartIndex:k,dataEndIndex:R,updateId:$},A.state))}),A.triggerSyncEvent({dataStartIndex:k,dataEndIndex:R})}}),pt(A,"handleMouseEnter",function(O){var k=A.getMouseInfo(O);if(k){var R=be(be({},k),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var $=A.props.onMouseEnter;gt($)&&$(R,O)}}),pt(A,"triggeredAfterMouseMove",function(O){var k=A.getMouseInfo(O),R=k?be(be({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(R),A.triggerSyncEvent(R);var $=A.props.onMouseMove;gt($)&&$(R,O)}),pt(A,"handleItemMouseEnter",function(O){A.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),pt(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),pt(A,"handleMouseMove",function(O){O.persist(),A.throttleTriggeredAfterMouseMove(O)}),pt(A,"handleMouseLeave",function(O){A.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};A.setState(k),A.triggerSyncEvent(k);var R=A.props.onMouseLeave;gt(R)&&R(k,O)}),pt(A,"handleOuterEvent",function(O){var k=RY(O),R=ea(A.props,"".concat(k));if(k&&gt(R)){var $,z;/.*touch.*/i.test(k)?z=A.getMouseInfo(O.changedTouches[0]):z=A.getMouseInfo(O),R(($=z)!==null&&$!==void 0?$:{},O)}}),pt(A,"handleClick",function(O){var k=A.getMouseInfo(O);if(k){var R=be(be({},k),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var $=A.props.onClick;gt($)&&$(R,O)}}),pt(A,"handleMouseDown",function(O){var k=A.props.onMouseDown;if(gt(k)){var R=A.getMouseInfo(O);k(R,O)}}),pt(A,"handleMouseUp",function(O){var k=A.props.onMouseUp;if(gt(k)){var R=A.getMouseInfo(O);k(R,O)}}),pt(A,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),pt(A,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseDown(O.changedTouches[0])}),pt(A,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&A.handleMouseUp(O.changedTouches[0])}),pt(A,"handleDoubleClick",function(O){var k=A.props.onDoubleClick;if(gt(k)){var R=A.getMouseInfo(O);k(R,O)}}),pt(A,"handleContextMenu",function(O){var k=A.props.onContextMenu;if(gt(k)){var R=A.getMouseInfo(O);k(R,O)}}),pt(A,"triggerSyncEvent",function(O){A.props.syncId!==void 0&&Zw.emit(e1,A.props.syncId,O,A.eventEmitterSymbol)}),pt(A,"applySyncEvent",function(O){var k=A.props,R=k.layout,$=k.syncMethod,z=A.state.updateId,B=O.dataStartIndex,D=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)A.setState(be({dataStartIndex:B,dataEndIndex:D},g({props:A.props,dataStartIndex:B,dataEndIndex:D,updateId:z},A.state)));else if(O.activeTooltipIndex!==void 0){var K=O.chartX,U=O.chartY,V=O.activeTooltipIndex,X=A.state,Z=X.offset,T=X.tooltipTicks;if(!Z)return;if(typeof $=="function")V=$(T,O);else if($==="value"){V=-1;for(var L=0;L<T.length;L++)if(T[L].value===O.activeLabel){V=L;break}}var Q=be(be({},Z),{},{x:Z.left,y:Z.top}),F=Math.min(K,Q.x+Q.width),M=Math.min(U,Q.y+Q.height),ee=T[V]&&T[V].value,W=ZS(A.state,A.props.data,V),J=T[V]?{x:R==="horizontal"?T[V].coordinate:F,y:R==="horizontal"?M:T[V].coordinate}:M4;A.setState(be(be({},O),{},{activeLabel:ee,activeCoordinate:J,activePayload:W,activeTooltipIndex:V}))}else A.setState(O)}),pt(A,"renderCursor",function(O){var k,R=A.state,$=R.isTooltipActive,z=R.activeCoordinate,B=R.activePayload,D=R.offset,K=R.activeTooltipIndex,U=R.tooltipAxisBandSize,V=A.getTooltipEventType(),X=(k=O.props.active)!==null&&k!==void 0?k:$,Z=A.props.layout,T=O.key||"_recharts-cursor";return q.createElement(jde,{key:T,activeCoordinate:z,activePayload:B,activeTooltipIndex:K,chartName:n,element:O,isActive:X,layout:Z,offset:D,tooltipAxisBandSize:U,tooltipEventType:V})}),pt(A,"renderPolarAxis",function(O,k,R){var $=ea(O,"type.axisType"),z=ea(A.state,"".concat($,"Map")),B=O.type.defaultProps,D=B!==void 0?be(be({},B),O.props):O.props,K=z&&z[D["".concat($,"Id")]];return v.cloneElement(O,be(be({},K),{},{className:bt($,K.className),key:O.key||"".concat(k,"-").concat(R),ticks:mo(K,!0)}))}),pt(A,"renderPolarGrid",function(O){var k=O.props,R=k.radialLines,$=k.polarAngles,z=k.polarRadius,B=A.state,D=B.radiusAxisMap,K=B.angleAxisMap,U=wl(D),V=wl(K),X=V.cx,Z=V.cy,T=V.innerRadius,L=V.outerRadius;return v.cloneElement(O,{polarAngles:Array.isArray($)?$:mo(V,!0).map(function(Q){return Q.coordinate}),polarRadius:Array.isArray(z)?z:mo(U,!0).map(function(Q){return Q.coordinate}),cx:X,cy:Z,innerRadius:T,outerRadius:L,key:O.key||"polar-grid",radialLines:R})}),pt(A,"renderLegend",function(){var O=A.state.formattedGraphicalItems,k=A.props,R=k.children,$=k.width,z=k.height,B=A.props.margin||{},D=$-(B.left||0)-(B.right||0),K=gL({children:R,formattedGraphicalItems:O,legendWidth:D,legendContent:f});if(!K)return null;var U=K.item,V=qI(K,Nde);return v.cloneElement(U,be(be({},V),{},{chartWidth:$,chartHeight:z,margin:B,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),pt(A,"renderTooltip",function(){var O,k=A.props,R=k.children,$=k.accessibilityLayer,z=Vr(R,Hr);if(!z)return null;var B=A.state,D=B.isTooltipActive,K=B.activeCoordinate,U=B.activePayload,V=B.activeLabel,X=B.offset,Z=(O=z.props.active)!==null&&O!==void 0?O:D;return v.cloneElement(z,{viewBox:be(be({},X),{},{x:X.left,y:X.top}),active:Z,label:V,payload:Z?U:[],coordinate:K,accessibilityLayer:$})}),pt(A,"renderBrush",function(O){var k=A.props,R=k.margin,$=k.data,z=A.state,B=z.offset,D=z.dataStartIndex,K=z.dataEndIndex,U=z.updateId;return v.cloneElement(O,{key:O.key||"_recharts-brush",onChange:zp(A.handleBrushChange,O.props.onChange),data:$,x:$e(O.props.x)?O.props.x:B.left,y:$e(O.props.y)?O.props.y:B.top+B.height+B.brushBottom-(R.bottom||0),width:$e(O.props.width)?O.props.width:B.width,startIndex:D,endIndex:K,updateId:"brush-".concat(U)})}),pt(A,"renderReferenceElement",function(O,k,R){if(!O)return null;var $=A,z=$.clipPathId,B=A.state,D=B.xAxisMap,K=B.yAxisMap,U=B.offset,V=O.type.defaultProps||{},X=O.props,Z=X.xAxisId,T=Z===void 0?V.xAxisId:Z,L=X.yAxisId,Q=L===void 0?V.yAxisId:L;return v.cloneElement(O,{key:O.key||"".concat(k,"-").concat(R),xAxis:D[T],yAxis:K[Q],viewBox:{x:U.left,y:U.top,width:U.width,height:U.height},clipPathId:z})}),pt(A,"renderActivePoints",function(O){var k=O.item,R=O.activePoint,$=O.basePoint,z=O.childIndex,B=O.isRange,D=[],K=k.props.key,U=k.item.type.defaultProps!==void 0?be(be({},k.item.type.defaultProps),k.item.props):k.item.props,V=U.activeDot,X=U.dataKey,Z=be(be({index:z,dataKey:X,cx:R.x,cy:R.y,r:4,fill:LN(k.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},ft(V,!1)),hh(V));return D.push(j.renderActiveDot(V,Z,"".concat(K,"-activePoint-").concat(z))),$?D.push(j.renderActiveDot(V,be(be({},Z),{},{cx:$.x,cy:$.y}),"".concat(K,"-basePoint-").concat(z))):B&&D.push(null),D}),pt(A,"renderGraphicChild",function(O,k,R){var $=A.filterFormatItem(O,k,R);if(!$)return null;var z=A.getTooltipEventType(),B=A.state,D=B.isTooltipActive,K=B.tooltipAxis,U=B.activeTooltipIndex,V=B.activeLabel,X=A.props.children,Z=Vr(X,Hr),T=$.props,L=T.points,Q=T.isRange,F=T.baseLine,M=$.item.type.defaultProps!==void 0?be(be({},$.item.type.defaultProps),$.item.props):$.item.props,ee=M.activeDot,W=M.hide,J=M.activeBar,ye=M.activeShape,ae=!!(!W&&D&&Z&&(ee||J||ye)),ue={};z!=="axis"&&Z&&Z.props.trigger==="click"?ue={onClick:zp(A.handleItemMouseEnter,O.props.onClick)}:z!=="axis"&&(ue={onMouseLeave:zp(A.handleItemMouseLeave,O.props.onMouseLeave),onMouseEnter:zp(A.handleItemMouseEnter,O.props.onMouseEnter)});var ie=v.cloneElement(O,be(be({},$.props),ue));function ve(dt){return typeof K.dataKey=="function"?K.dataKey(dt.payload):null}if(ae)if(U>=0){var Oe,oe;if(K.dataKey&&!K.allowDuplicatedCategory){var he=typeof K.dataKey=="function"?ve:"payload.".concat(K.dataKey.toString());Oe=ph(L,he,V),oe=Q&&F&&ph(F,he,V)}else Oe=L?.[U],oe=Q&&F&&F[U];if(ye||J){var xe=O.props.activeIndex!==void 0?O.props.activeIndex:U;return[v.cloneElement(O,be(be(be({},$.props),ue),{},{activeIndex:xe})),null,null]}if(!xt(Oe))return[ie].concat(yc(A.renderActivePoints({item:$,activePoint:Oe,basePoint:oe,childIndex:U,isRange:Q})))}else{var Ie,re=(Ie=A.getItemByXY(A.state.activeCoordinate))!==null&&Ie!==void 0?Ie:{graphicalItem:ie},me=re.graphicalItem,Ne=me.item,tt=Ne===void 0?O:Ne,je=me.childIndex,et=be(be(be({},$.props),ue),{},{activeIndex:je});return[v.cloneElement(tt,et),null,null]}return Q?[ie,null,null]:[ie,null]}),pt(A,"renderCustomized",function(O,k,R){return v.cloneElement(O,be(be({key:"recharts-customized-".concat(R)},A.props),A.state))}),pt(A,"renderMap",{CartesianGrid:{handler:Hp,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Hp},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Hp},YAxis:{handler:Hp},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((_=N.id)!==null&&_!==void 0?_:Tc("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=g5(A.triggeredAfterMouseMove,(P=N.throttleDelay)!==null&&P!==void 0?P:1e3/60),A.state={},A}return $de(j,x),Rde(j,[{key:"componentDidMount",value:function(){var _,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_: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 _=this.props,P=_.children,A=_.data,O=_.height,k=_.layout,R=Vr(P,Hr);if(R){var $=R.props.defaultIndex;if(!(typeof $!="number"||$<0||$>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[$]&&this.state.tooltipTicks[$].value,B=ZS(this.state,A,$,z),D=this.state.tooltipTicks[$].coordinate,K=(this.state.offset.top+O)/2,U=k==="horizontal",V=U?{x:D,y:K}:{y:D,x:K},X=this.state.formattedGraphicalItems.find(function(T){var L=T.item;return L.type.name==="Scatter"});X&&(V=be(be({},V),X.props.points[$].tooltipPosition),B=X.props.points[$].tooltipPayload);var Z={activeTooltipIndex:$,isTooltipActive:!0,activeLabel:z,activePayload:B,activeCoordinate:V};this.setState(Z),this.renderCursor(R),this.accessibilityManager.setIndex($)}}}},{key:"getSnapshotBeforeUpdate",value:function(_,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==_.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==_.margin){var A,O;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(_){I1([Vr(_.children,Hr)],[Vr(this.props.children,Hr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var _=Vr(this.props.children,Hr);if(_&&typeof _.props.shared=="boolean"){var P=_.props.shared?"axis":"item";return c.indexOf(P)>=0?P:i}return i}},{key:"getMouseInfo",value:function(_){if(!this.container)return null;var P=this.container,A=P.getBoundingClientRect(),O=xZ(A),k={chartX:Math.round(_.pageX-O.left),chartY:Math.round(_.pageY-O.top)},R=A.width/P.offsetWidth||1,$=this.inRange(k.chartX,k.chartY,R);if(!$)return null;var z=this.state,B=z.xAxisMap,D=z.yAxisMap,K=this.getTooltipEventType(),U=VI(this.state,this.props.data,this.props.layout,$);if(K!=="axis"&&B&&D){var V=wl(B).scale,X=wl(D).scale,Z=V&&V.invert?V.invert(k.chartX):null,T=X&&X.invert?X.invert(k.chartY):null;return be(be({},k),{},{xValue:Z,yValue:T},U)}return U?be(be({},k),U):null}},{key:"inRange",value:function(_,P){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,k=_/A,R=P/A;if(O==="horizontal"||O==="vertical"){var $=this.state.offset,z=k>=$.left&&k<=$.left+$.width&&R>=$.top&&R<=$.top+$.height;return z?{x:k,y:R}:null}var B=this.state,D=B.angleAxisMap,K=B.radiusAxisMap;if(D&&K){var U=wl(D);return J2({x:k,y:R},U)}return null}},{key:"parseEventsOfWrapper",value:function(){var _=this.props.children,P=this.getTooltipEventType(),A=Vr(_,Hr),O={};A&&P==="axis"&&(A.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=hh(this.props,this.handleOuterEvent);return be(be({},k),O)}},{key:"addListener",value:function(){Zw.on(e1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Zw.removeListener(e1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(_,P,A){for(var O=this.state.formattedGraphicalItems,k=0,R=O.length;k<R;k++){var $=O[k];if($.item===_||$.props.key===_.key||P===Ls($.item.type)&&A===$.childIndex)return $}return null}},{key:"renderClipPath",value:function(){var _=this.clipPathId,P=this.state.offset,A=P.left,O=P.top,k=P.height,R=P.width;return q.createElement("defs",null,q.createElement("clipPath",{id:_},q.createElement("rect",{x:A,y:O,height:k,width:R})))}},{key:"getXScales",value:function(){var _=this.state.xAxisMap;return _?Object.entries(_).reduce(function(P,A){var O=UI(A,2),k=O[0],R=O[1];return be(be({},P),{},pt({},k,R.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(P,A){var O=UI(A,2),k=O[0],R=O[1];return be(be({},P),{},pt({},k,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(_){var P;return(P=this.state.xAxisMap)===null||P===void 0||(P=P[_])===null||P===void 0?void 0:P.scale}},{key:"getYScaleByAxisId",value:function(_){var P;return(P=this.state.yAxisMap)===null||P===void 0||(P=P[_])===null||P===void 0?void 0:P.scale}},{key:"getItemByXY",value:function(_){var P=this.state,A=P.formattedGraphicalItems,O=P.activeItem;if(A&&A.length)for(var k=0,R=A.length;k<R;k++){var $=A[k],z=$.props,B=$.item,D=B.type.defaultProps!==void 0?be(be({},B.type.defaultProps),B.props):B.props,K=Ls(B.type);if(K==="Bar"){var U=(z.data||[]).find(function(T){return Bie(_,T)});if(U)return{graphicalItem:$,payload:U}}else if(K==="RadialBar"){var V=(z.data||[]).find(function(T){return J2(_,T)});if(V)return{graphicalItem:$,payload:V}}else if(_v($,O)||Av($,O)||Md($,O)){var X=cle({graphicalItem:$,activeTooltipItem:O,itemData:D.data}),Z=D.activeIndex===void 0?X:D.activeIndex;return{graphicalItem:be(be({},$),{},{childIndex:Z}),payload:Md($,O)?D.data[X]:$.props.data[X]}}}return null}},{key:"render",value:function(){var _=this;if(!cO(this))return null;var P=this.props,A=P.children,O=P.className,k=P.width,R=P.height,$=P.style,z=P.compact,B=P.title,D=P.desc,K=qI(P,Cde),U=ft(K,!1);if(z)return q.createElement(CI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement($1,El({},U,{width:k,height:R,title:B,desc:D}),this.renderClipPath(),dO(A,this.renderMap)));if(this.props.accessibilityLayer){var V,X;U.tabIndex=(V=this.props.tabIndex)!==null&&V!==void 0?V:0,U.role=(X=this.props.role)!==null&&X!==void 0?X:"application",U.onKeyDown=function(T){_.accessibilityManager.keyboardEvent(T)},U.onFocus=function(){_.accessibilityManager.focus()}}var Z=this.parseEventsOfWrapper();return q.createElement(CI,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},q.createElement("div",El({className:bt("recharts-wrapper",O),style:be({position:"relative",cursor:"default",width:k,height:R},$)},Z,{ref:function(L){_.container=L}}),q.createElement($1,El({},U,{width:k,height:R,title:B,desc:D,style:Ude}),this.renderClipPath(),dO(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);pt(S,"displayName",n),pt(S,"defaultProps",be({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),pt(S,"getDerivedStateFromProps",function(x,j){var N=x.dataKey,_=x.data,P=x.children,A=x.width,O=x.height,k=x.layout,R=x.stackOffset,$=x.margin,z=j.dataStartIndex,B=j.dataEndIndex;if(j.updateId===void 0){var D=HI(x);return be(be(be({},D),{},{updateId:0},g(be(be({props:x},D),{},{updateId:0}),j)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:O,prevLayout:k,prevStackOffset:R,prevMargin:$,prevChildren:P})}if(N!==j.prevDataKey||_!==j.prevData||A!==j.prevWidth||O!==j.prevHeight||k!==j.prevLayout||R!==j.prevStackOffset||!Ml($,j.prevMargin)){var K=HI(x),U={chartX:j.chartX,chartY:j.chartY,isTooltipActive:j.isTooltipActive},V=be(be({},VI(j,_,k)),{},{updateId:j.updateId+1}),X=be(be(be({},K),U),V);return be(be(be({},X),g(be({props:x},X),j)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:O,prevLayout:k,prevStackOffset:R,prevMargin:$,prevChildren:P})}if(!I1(P,j.prevChildren)){var Z,T,L,Q,F=Vr(P,oc),M=F&&(Z=(T=F.props)===null||T===void 0?void 0:T.startIndex)!==null&&Z!==void 0?Z:z,ee=F&&(L=(Q=F.props)===null||Q===void 0?void 0:Q.endIndex)!==null&&L!==void 0?L:B,W=M!==z||ee!==B,J=!xt(_),ye=J&&!W?j.updateId:j.updateId+1;return be(be({updateId:ye},g(be(be({props:x},j),{},{updateId:ye,dataStartIndex:M,dataEndIndex:ee}),j)),{},{prevChildren:P,dataStartIndex:M,dataEndIndex:ee})}return null}),pt(S,"renderActiveDot",function(x,j,N){var _;return v.isValidElement(x)?_=v.cloneElement(x,j):gt(x)?_=x(j):_=q.createElement(wv,j),q.createElement(It,{className:"recharts-active-dot",key:N},_)});var b=v.forwardRef(function(j,N){return q.createElement(S,El({},j,{ref:N}))});return b.displayName=S.displayName,b},GI=WN({chartName:"LineChart",GraphicalChild:hc,axisComponents:[{axisType:"xAxis",AxisComp:Ao},{axisType:"yAxis",AxisComp:Eo}],formatAxisMap:e4}),Jde=WN({chartName:"BarChart",GraphicalChild:zo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ao},{axisType:"yAxis",AxisComp:Eo}],formatAxisMap:e4}),Zde=WN({chartName:"PieChart",GraphicalChild:Js,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Cv},{axisType:"radiusAxis",AxisComp:jv}],formatAxisMap:Qre,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const efe=()=>{const{configs:e}=tf(),{source:t}=On(),[n,r]=v.useState([]),[a,i]=v.useState("timestamp"),[o,c]=v.useState("desc"),d=x=>{if(a===x){c(j=>j==="asc"?"desc":"asc");return}i(x),c("desc")};v.useEffect(()=>{let x=!0;return t.listResults().then(j=>{x&&r(j)}),()=>{x=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((x,j)=>x+j.overallPassRate,0)/h,y=h===0?0:Math.round(n.reduce((x,j)=>x+j.avgLatency,0)/h),g=v.useMemo(()=>[...n].sort((j,N)=>{let _=0;return a==="timestamp"&&(_=new Date(j.timestamp).getTime()-new Date(N.timestamp).getTime()),a==="passRate"&&(_=j.overallPassRate-N.overallPassRate),a==="latency"&&(_=j.avgLatency-N.avgLatency),a==="scenarios"&&(_=j.totalScenarios-N.totalScenarios),o==="asc"?_:-_}),[n,a,o]),S=[...g].reverse().map(x=>({date:new Date(x.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(x.overallPassRate*100),latency:x.avgLatency})),b=x=>{const j=Array.from(new Set(x.scenarios.map(A=>A.scenarioId).filter(Boolean))),N=Array.from(new Set(x.scenarios.map(A=>A.agentName).filter(Boolean))),_=j.slice(0,2).join(", "),P=j.length>2?` +${j.length-2}`:"";return{scenarioCount:j.length,agentCount:N.length,scenarioPreview:_?`${_}${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(r$,{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(se,{asChild:!0,children:s.jsxs(yt,{to:"/mcp-evaluations/new",children:[s.jsx(jj,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(se,{variant:"outline",asChild:!0,children:s.jsxs(yt,{to:"/run",children:[s.jsx(kl,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(se,{variant:"outline",asChild:!0,children:s.jsxs(yt,{to:"/results",children:[s.jsx(ed,{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(Ts,{title:"MCP Evaluations",value:f,icon:p1,subtitle:`${f} active`}),s.jsx(Ts,{title:"Total Runs",value:h,icon:JM,subtitle:"Last 30 days"}),s.jsx(Ts,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:ed,subtitle:"+5% from last week",trend:"up"}),s.jsx(Ts,{title:"Avg Latency",value:`${y}ms`,icon:l$,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(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(Ue,{children:s.jsx(X1,{width:"100%",height:200,children:s.jsxs(GI,{data:S,children:[s.jsx(Ao,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Eo,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:x=>`${x}%`}),s.jsx(Hr,{formatter:x=>[`${x}%`,"Pass Rate"]}),s.jsx(hc,{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(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(Ue,{children:s.jsx(X1,{width:"100%",height:200,children:s.jsxs(GI,{data:S,children:[s.jsx(Ao,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Eo,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Hr,{formatter:x=>[`${x}ms`,"Latency"]}),s.jsx(hc,{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(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Recent Runs"})}),s.jsx(Ue,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{children:"Run ID"}),s.jsx(Qe,{children:"Evaluated"}),s.jsx(Qe,{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(is,{className:"h-3.5 w-3.5"}):s.jsx(qt,{className:"h-3.5 w-3.5"}):s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(Qe,{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(is,{className:"h-3.5 w-3.5"}):s.jsx(qt,{className:"h-3.5 w-3.5"}):s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(Qe,{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(is,{className:"h-3.5 w-3.5"}):s.jsx(qt,{className:"h-3.5 w-3.5"}):s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(Jr,{children:g.map(x=>s.jsxs(Bt,{className:"cursor-pointer",children:[s.jsx(Be,{children:s.jsx(yt,{to:`/results/${x.id}`,className:"font-mono text-xs text-primary hover:underline",children:x.id})}),s.jsx(Be,{className:"text-[11px] text-muted-foreground",children:(()=>{const j=b(x);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",j.scenarioCount," scenario",j.scenarioCount===1?"":"s"," · ",j.agentCount," agent",j.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:j.scenarioPreview})]})})()}),s.jsx(Be,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Nm,{className:"h-3 w-3"}),new Date(x.timestamp).toLocaleString()]})}),s.jsx(Be,{children:s.jsx(vo,{rate:x.overallPassRate})}),s.jsx(Be,{className:"text-right font-mono text-sm",children:x.totalScenarios})]},x.id))})]})})]})})]})};var tfe=v.createContext(void 0);function Lc(e){const t=v.useContext(tfe);return e||t||"ltr"}var n1="rovingFocusGroup.onEntryFocus",nfe={bubbles:!1,cancelable:!0},ff="RovingFocusGroup",[ej,D4,rfe]=Hd(ff),[afe,Mv]=ir(ff,[rfe]),[sfe,ife]=afe(ff),L4=v.forwardRef((e,t)=>s.jsx(ej.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(ej.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(ofe,{...e,ref:t})})}));L4.displayName=ff;var ofe=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,y=v.useRef(null),g=ut(t,y),S=Lc(i),[b,x]=na({prop:o,defaultProp:c??null,onChange:d,caller:ff}),[j,N]=v.useState(!1),_=Pn(f),P=D4(n),A=v.useRef(!1),[O,k]=v.useState(0);return v.useEffect(()=>{const R=y.current;if(R)return R.addEventListener(n1,_),()=>R.removeEventListener(n1,_)},[_]),s.jsx(sfe,{scope:n,orientation:r,dir:S,loop:a,currentTabStopId:b,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(De.div,{tabIndex:j||O===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Ae(e.onMouseDown,()=>{A.current=!0}),onFocus:Ae(e.onFocus,R=>{const $=!A.current;if(R.target===R.currentTarget&&$&&!j){const z=new CustomEvent(n1,nfe);if(R.currentTarget.dispatchEvent(z),!z.defaultPrevented){const B=P().filter(X=>X.focusable),D=B.find(X=>X.active),K=B.find(X=>X.id===b),V=[D,K,...B].filter(Boolean).map(X=>X.ref.current);z4(V,h)}}A.current=!1}),onBlur:Ae(e.onBlur,()=>N(!1))})})}),F4="RovingFocusGroupItem",B4=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=Hn(),f=i||d,h=ife(F4,n),p=h.currentTabStopId===f,y=D4(n),{onFocusableItemAdd:g,onFocusableItemRemove:S,currentTabStopId:b}=h;return v.useEffect(()=>{if(r)return g(),()=>S()},[r,g,S]),s.jsx(ej.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(De.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Ae(e.onMouseDown,x=>{r?h.onItemFocus(f):x.preventDefault()}),onFocus:Ae(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Ae(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){h.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const j=ufe(x,h.orientation,h.dir);if(j!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let _=y().filter(P=>P.focusable).map(P=>P.ref.current);if(j==="last")_.reverse();else if(j==="prev"||j==="next"){j==="prev"&&_.reverse();const P=_.indexOf(x.currentTarget);_=h.loop?dfe(_,P+1):_.slice(P+1)}setTimeout(()=>z4(_))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});B4.displayName=F4;var lfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ufe(e,t,n){const r=cfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lfe[r]}function z4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var U4=L4,q4=B4;function ffe(e){const t=pfe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(mfe);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 pfe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=gfe(a),c=vfe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(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 hfe=Symbol("radix.slottable");function mfe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hfe}function vfe(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 gfe(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 tj=["Enter"," "],yfe=["ArrowDown","PageUp","Home"],W4=["ArrowUp","PageDown","End"],xfe=[...yfe,...W4],bfe={ltr:[...tj,"ArrowRight"],rtl:[...tj,"ArrowLeft"]},wfe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},pf="Menu",[Ud,Sfe,jfe]=Hd(pf),[Uo,V4]=ir(pf,[jfe,Di,Mv]),$v=Di(),H4=Mv(),[Nfe,qo]=Uo(pf),[Cfe,hf]=Uo(pf),K4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=$v(t),[d,f]=v.useState(null),h=v.useRef(!1),p=Pn(i),y=Lc(a);return v.useEffect(()=>{const g=()=>{h.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>h.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),s.jsx(Rm,{...c,children:s.jsx(Nfe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Cfe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:y,modal:o,children:r})})})};K4.displayName=pf;var _fe="MenuAnchor",VN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=$v(n);return s.jsx(Yd,{...a,...r,ref:t})});VN.displayName=_fe;var HN="MenuPortal",[Afe,G4]=Uo(HN,{forceMount:void 0}),Y4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=qo(HN,t);return s.jsx(Afe,{scope:t,forceMount:n,children:s.jsx(Gn,{present:n||i.open,children:s.jsx(Sc,{asChild:!0,container:a,children:r})})})};Y4.displayName=HN;var ya="MenuContent",[Efe,KN]=Uo(ya),X4=v.forwardRef((e,t)=>{const n=G4(ya,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=qo(ya,e.__scopeMenu),o=hf(ya,e.__scopeMenu);return s.jsx(Ud.Provider,{scope:e.__scopeMenu,children:s.jsx(Gn,{present:r||i.open,children:s.jsx(Ud.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Pfe,{...a,ref:t}):s.jsx(Ofe,{...a,ref:t})})})})}),Pfe=v.forwardRef((e,t)=>{const n=qo(ya,e.__scopeMenu),r=v.useRef(null),a=ut(t,r);return v.useEffect(()=>{const i=r.current;if(i)return Hm(i)},[]),s.jsx(GN,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ae(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ofe=v.forwardRef((e,t)=>{const n=qo(ya,e.__scopeMenu);return s.jsx(GN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),kfe=ffe("MenuContent.ScrollLock"),GN=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:y,onDismiss:g,disableOutsideScroll:S,...b}=e,x=qo(ya,n),j=hf(ya,n),N=$v(n),_=H4(n),P=Sfe(n),[A,O]=v.useState(null),k=v.useRef(null),R=ut(t,k,x.onContentChange),$=v.useRef(0),z=v.useRef(""),B=v.useRef(0),D=v.useRef(null),K=v.useRef("right"),U=v.useRef(0),V=S?Qd:v.Fragment,X=S?{as:kfe,allowPinchZoom:!0}:void 0,Z=L=>{const Q=z.current+L,F=P().filter(ae=>!ae.disabled),M=document.activeElement,ee=F.find(ae=>ae.ref.current===M)?.textValue,W=F.map(ae=>ae.textValue),J=qfe(W,Q,ee),ye=F.find(ae=>ae.textValue===J)?.ref.current;(function ae(ue){z.current=ue,window.clearTimeout($.current),ue!==""&&($.current=window.setTimeout(()=>ae(""),1e3))})(Q),ye&&setTimeout(()=>ye.focus())};v.useEffect(()=>()=>window.clearTimeout($.current),[]),Wm();const T=v.useCallback(L=>K.current===D.current?.side&&Vfe(L,D.current?.area),[]);return s.jsx(Efe,{scope:n,searchRef:z,onItemEnter:v.useCallback(L=>{T(L)&&L.preventDefault()},[T]),onItemLeave:v.useCallback(L=>{T(L)||(k.current?.focus(),O(null))},[T]),onTriggerLeave:v.useCallback(L=>{T(L)&&L.preventDefault()},[T]),pointerGraceTimerRef:B,onPointerGraceIntentChange:v.useCallback(L=>{D.current=L},[]),children:s.jsx(V,{...X,children:s.jsx(Xd,{asChild:!0,trapped:a,onMountAutoFocus:Ae(i,L=>{L.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(To,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,onDismiss:g,children:s.jsx(U4,{asChild:!0,..._,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:O,onEntryFocus:Ae(d,L=>{j.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Tm,{role:"menu","aria-orientation":"vertical","data-state":fF(x.open),"data-radix-menu-content":"",dir:j.dir,...N,...b,ref:R,style:{outline:"none",...b.style},onKeyDown:Ae(b.onKeyDown,L=>{const F=L.target.closest("[data-radix-menu-content]")===L.currentTarget,M=L.ctrlKey||L.altKey||L.metaKey,ee=L.key.length===1;F&&(L.key==="Tab"&&L.preventDefault(),!M&&ee&&Z(L.key));const W=k.current;if(L.target!==W||!xfe.includes(L.key))return;L.preventDefault();const ye=P().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);W4.includes(L.key)&&ye.reverse(),zfe(ye)}),onBlur:Ae(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout($.current),z.current="")}),onPointerMove:Ae(e.onPointerMove,qd(L=>{const Q=L.target,F=U.current!==L.clientX;if(L.currentTarget.contains(Q)&&F){const M=L.clientX>U.current?"right":"left";K.current=M,U.current=L.clientX}}))})})})})})})});X4.displayName=ya;var Rfe="MenuGroup",YN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(De.div,{role:"group",...r,ref:t})});YN.displayName=Rfe;var Tfe="MenuLabel",Q4=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(De.div,{...r,ref:t})});Q4.displayName=Tfe;var pm="MenuItem",YI="menu.itemSelect",Dv=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=hf(pm,e.__scopeMenu),c=KN(pm,e.__scopeMenu),d=ut(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const y=new CustomEvent(YI,{bubbles:!0,cancelable:!0});p.addEventListener(YI,g=>r?.(g),{once:!0}),gj(p,y),y.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(J4,{...a,ref:d,disabled:n,onClick:Ae(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Ae(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Ae(e.onKeyDown,p=>{const y=c.searchRef.current!=="";n||y&&p.key===" "||tj.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Dv.displayName=pm;var J4=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=KN(pm,n),c=H4(n),d=v.useRef(null),f=ut(t,d),[h,p]=v.useState(!1),[y,g]=v.useState("");return v.useEffect(()=>{const S=d.current;S&&g((S.textContent??"").trim())},[i.children]),s.jsx(Ud.ItemSlot,{scope:n,disabled:r,textValue:a??y,children:s.jsx(q4,{asChild:!0,...c,focusable:!r,children:s.jsx(De.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Ae(e.onPointerMove,qd(S=>{r?o.onItemLeave(S):(o.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ae(e.onPointerLeave,qd(S=>o.onItemLeave(S))),onFocus:Ae(e.onFocus,()=>p(!0)),onBlur:Ae(e.onBlur,()=>p(!1))})})})}),Ife="MenuCheckboxItem",Z4=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(aF,{scope:e.__scopeMenu,checked:n,children:s.jsx(Dv,{role:"menuitemcheckbox","aria-checked":hm(n)?"mixed":n,...a,ref:t,"data-state":QN(n),onSelect:Ae(a.onSelect,()=>r?.(hm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Z4.displayName=Ife;var eF="MenuRadioGroup",[Mfe,$fe]=Uo(eF,{value:void 0,onValueChange:()=>{}}),tF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Pn(r);return s.jsx(Mfe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(YN,{...a,ref:t})})});tF.displayName=eF;var nF="MenuRadioItem",rF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=$fe(nF,e.__scopeMenu),i=n===a.value;return s.jsx(aF,{scope:e.__scopeMenu,checked:i,children:s.jsx(Dv,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":QN(i),onSelect:Ae(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});rF.displayName=nF;var XN="MenuItemIndicator",[aF,Dfe]=Uo(XN,{checked:!1}),sF=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=Dfe(XN,n);return s.jsx(Gn,{present:r||hm(i.checked)||i.checked===!0,children:s.jsx(De.span,{...a,ref:t,"data-state":QN(i.checked)})})});sF.displayName=XN;var Lfe="MenuSeparator",iF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(De.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});iF.displayName=Lfe;var Ffe="MenuArrow",oF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=$v(n);return s.jsx(Im,{...a,...r,ref:t})});oF.displayName=Ffe;var Bfe="MenuSub",[Ege,lF]=Uo(Bfe),Uu="MenuSubTrigger",cF=v.forwardRef((e,t)=>{const n=qo(Uu,e.__scopeMenu),r=hf(Uu,e.__scopeMenu),a=lF(Uu,e.__scopeMenu),i=KN(Uu,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(VN,{asChild:!0,...f,children:s.jsx(J4,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":fF(n.open),...e,ref:jr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ae(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:Ae(e.onPointerLeave,qd(p=>{h();const y=n.content?.getBoundingClientRect();if(y){const g=n.content?.dataset.side,S=g==="right",b=S?-5:5,x=y[S?"left":"right"],j=y[S?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x,y:y.top},{x:j,y:y.top},{x:j,y:y.bottom},{x,y:y.bottom}],side:g}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ae(e.onKeyDown,p=>{const y=i.searchRef.current!=="";e.disabled||y&&p.key===" "||bfe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});cF.displayName=Uu;var uF="MenuSubContent",dF=v.forwardRef((e,t)=>{const n=G4(ya,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=qo(ya,e.__scopeMenu),o=hf(ya,e.__scopeMenu),c=lF(uF,e.__scopeMenu),d=v.useRef(null),f=ut(t,d);return s.jsx(Ud.Provider,{scope:e.__scopeMenu,children:s.jsx(Gn,{present:r||i.open,children:s.jsx(Ud.Slot,{scope:e.__scopeMenu,children:s.jsx(GN,{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:Ae(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ae(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Ae(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),y=wfe[o.dir].includes(h.key);p&&y&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});dF.displayName=uF;function fF(e){return e?"open":"closed"}function hm(e){return e==="indeterminate"}function QN(e){return hm(e)?"indeterminate":e?"checked":"unchecked"}function zfe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ufe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function qfe(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=Ufe(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 Wfe(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,y=d.y;h>r!=y>r&&n<(p-f)*(r-h)/(y-h)+f&&(a=!a)}return a}function Vfe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Wfe(n,t)}function qd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Hfe=K4,Kfe=VN,Gfe=Y4,Yfe=X4,Xfe=YN,Qfe=Q4,Jfe=Dv,Zfe=Z4,epe=tF,tpe=rF,npe=sF,rpe=iF,ape=oF,spe=cF,ipe=dF,Lv="DropdownMenu",[ope]=ir(Lv,[V4]),Nr=V4(),[lpe,pF]=ope(Lv),hF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Nr(t),f=v.useRef(null),[h,p]=na({prop:a,defaultProp:i??!1,onChange:o,caller:Lv});return s.jsx(lpe,{scope:t,triggerId:Hn(),triggerRef:f,contentId:Hn(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(y=>!y),[p]),modal:c,children:s.jsx(Hfe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};hF.displayName=Lv;var mF="DropdownMenuTrigger",vF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=pF(mF,n),o=Nr(n);return s.jsx(Kfe,{asChild:!0,...o,children:s.jsx(De.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:jr(t,i.triggerRef),onPointerDown:Ae(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Ae(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});vF.displayName=mF;var cpe="DropdownMenuPortal",gF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Nr(t);return s.jsx(Gfe,{...r,...n})};gF.displayName=cpe;var yF="DropdownMenuContent",xF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=pF(yF,n),i=Nr(n),o=v.useRef(!1);return s.jsx(Yfe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ae(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Ae(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)"}})});xF.displayName=yF;var upe="DropdownMenuGroup",dpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(Xfe,{...a,...r,ref:t})});dpe.displayName=upe;var fpe="DropdownMenuLabel",bF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(Qfe,{...a,...r,ref:t})});bF.displayName=fpe;var ppe="DropdownMenuItem",wF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(Jfe,{...a,...r,ref:t})});wF.displayName=ppe;var hpe="DropdownMenuCheckboxItem",SF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(Zfe,{...a,...r,ref:t})});SF.displayName=hpe;var mpe="DropdownMenuRadioGroup",vpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(epe,{...a,...r,ref:t})});vpe.displayName=mpe;var gpe="DropdownMenuRadioItem",jF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(tpe,{...a,...r,ref:t})});jF.displayName=gpe;var ype="DropdownMenuItemIndicator",NF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(npe,{...a,...r,ref:t})});NF.displayName=ype;var xpe="DropdownMenuSeparator",CF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(rpe,{...a,...r,ref:t})});CF.displayName=xpe;var bpe="DropdownMenuArrow",wpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(ape,{...a,...r,ref:t})});wpe.displayName=bpe;var Spe="DropdownMenuSubTrigger",_F=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(spe,{...a,...r,ref:t})});_F.displayName=Spe;var jpe="DropdownMenuSubContent",AF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Nr(n);return s.jsx(ipe,{...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)"}})});AF.displayName=jpe;var Npe=hF,Cpe=vF,_pe=gF,EF=xF,PF=bF,OF=wF,kF=SF,RF=jF,TF=NF,IF=CF,MF=_F,$F=AF;const Fc=Npe,Bc=Cpe,Ape=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(MF,{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(ZM,{className:"ml-auto h-4 w-4"})]}));Ape.displayName=MF.displayName;const Epe=v.forwardRef(({className:e,...t},n)=>s.jsx($F,{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}));Epe.displayName=$F.displayName;const Wo=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(_pe,{children:s.jsx(EF,{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})}));Wo.displayName=EF.displayName;const hr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(OF,{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}));hr.displayName=OF.displayName;const Ppe=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(kF,{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(TF,{children:s.jsx(ql,{className:"h-4 w-4"})})}),t]}));Ppe.displayName=kF.displayName;const Ope=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(RF,{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(TF,{children:s.jsx(P7,{className:"h-2 w-2 fill-current"})})}),t]}));Ope.displayName=RF.displayName;const JN=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(PF,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));JN.displayName=PF.displayName;const ZN=v.forwardRef(({className:e,...t},n)=>s.jsx(IF,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));ZN.displayName=IF.displayName;const Mu=e=>e.configName?.trim()||e.name,kpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=tf(),i=wa(),[o,c]=v.useState("name"),[d,f]=v.useState("asc"),h=j=>{if(o===j){f(N=>N==="asc"?"desc":"asc");return}c(j),f(j==="updatedAt"?"desc":"asc")};v.useEffect(()=>{a();const j=()=>{a()};return window.addEventListener("focus",j),()=>{window.removeEventListener("focus",j)}},[a]);const p=async(j,N)=>{await t(j),Pe({title:"Deleted",description:`"${N}" has been removed.`})},y=async j=>{const N=await n(j);Pe({title:"Cloned",description:`Created "${Mu(N)}".`}),i(`/mcp-evaluations/${N.id}`)},g=j=>j.agentEntries?.length??j.agents?.length??0,S=j=>j.scenarioEntries?.length??j.scenarios?.length??0,b=v.useMemo(()=>[...e].sort((N,_)=>{let P=0;return o==="name"&&(P=Mu(N).localeCompare(Mu(_))),o==="scenarios"&&(P=S(N)-S(_)),o==="agents"&&(P=g(N)-g(_)),o==="updatedAt"&&(P=new Date(N.updatedAt).getTime()-new Date(_.updatedAt).getTime()),d==="asc"?P:-P}),[e,o,d]),x=j=>o!==j?s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(is,{className:"h-3.5 w-3.5"}):s.jsx(qt,{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(n$,{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(se,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{variant:"outline",size:"sm",children:[s.jsx($7,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(se,{size:"sm",asChild:!0,children:s.jsxs(yt,{to:"/mcp-evaluations/new",children:[s.jsx(us,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{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(Qe,{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(Qe,{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(Qe,{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(Qe,{className:"w-10"})]})}),s.jsxs(Jr,{children:[b.map(j=>s.jsxs(Bt,{children:[s.jsx(Be,{children:s.jsxs("div",{children:[s.jsx(yt,{to:`/mcp-evaluations/${j.id}`,className:"font-medium text-sm hover:text-primary",children:Mu(j)}),j.loadError&&s.jsxs(Ke,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(Qp,{className:"mr-1 h-3 w-3"}),"Broken"]}),j.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:j.description}),j.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:j.loadError})]})}),s.jsx(Be,{className:"text-right font-mono text-sm",children:S(j)}),s.jsx(Be,{className:"text-right font-mono text-sm",children:g(j)}),s.jsx(Be,{className:"text-right text-xs text-muted-foreground",children:new Date(j.updatedAt).toLocaleDateString()}),s.jsx(Be,{children:s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Cm,{className:"h-4 w-4"})})}),s.jsxs(Wo,{align:"end",children:[s.jsxs(hr,{onClick:()=>i(`/mcp-evaluations/${j.id}`),children:[s.jsx(_m,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(hr,{onClick:()=>{y(j.id)},children:[s.jsx(Ri,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(hr,{children:[s.jsx(ga,{className:"mr-2 h-3.5 w-3.5"}),"Download YAML"]}),s.jsxs(hr,{className:"text-destructive",onClick:()=>{p(j.id,Mu(j))},children:[s.jsx(xa,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},j.id)),!r&&e.length===0&&s.jsx(Bt,{children:s.jsx(Be,{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(Bt,{children:s.jsx(Be,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Rpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tpe=Rpe.reduce((e,t)=>{const n=qm(`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}},{}),Ipe="Label",DF=v.forwardRef((e,t)=>s.jsx(Tpe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));DF.displayName=Ipe;var LF=DF;const Mpe=Io("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Me=v.forwardRef(({className:e,...t},n)=>s.jsx(LF,{ref:n,className:Se(Mpe(),e),...t}));Me.displayName=LF.displayName;const Ks=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}));Ks.displayName="Textarea";function Fv(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 Bv="Switch",[$pe]=ir(Bv),[Dpe,Lpe]=$pe(Bv),FF=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,[y,g]=v.useState(null),S=ut(t,_=>g(_)),b=v.useRef(!1),x=y?h||!!y.closest("form"):!0,[j,N]=na({prop:a,defaultProp:i??!1,onChange:f,caller:Bv});return s.jsxs(Dpe,{scope:n,checked:j,disabled:c,children:[s.jsx(De.button,{type:"button",role:"switch","aria-checked":j,"aria-required":o,"data-state":qF(j),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:S,onClick:Ae(e.onClick,_=>{N(P=>!P),x&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),x&&s.jsx(UF,{control:y,bubbles:!b.current,name:r,value:d,checked:j,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});FF.displayName=Bv;var BF="SwitchThumb",zF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Lpe(BF,n);return s.jsx(De.span,{"data-state":qF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});zF.displayName=BF;var Fpe="SwitchBubbleInput",UF=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=ut(o,i),d=Fv(n),f=km(t);return v.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&g){const S=new Event("click",{bubbles:r});g.call(h,n),h.dispatchEvent(S)}},[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}})});UF.displayName=Fpe;function qF(e){return e?"checked":"unchecked"}var WF=FF,Bpe=zF;const mm=v.forwardRef(({className:e,...t},n)=>s.jsx(WF,{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(Bpe,{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")})}));mm.displayName=WF.displayName;var zv="Tabs",[zpe]=ir(zv,[Mv]),VF=Mv(),[Upe,eC]=zpe(zv),HF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=Lc(c),[p,y]=na({prop:r,onChange:a,defaultProp:i??"",caller:zv});return s.jsx(Upe,{scope:n,baseId:Hn(),value:p,onValueChange:y,orientation:o,dir:h,activationMode:d,children:s.jsx(De.div,{dir:h,"data-orientation":o,...f,ref:t})})});HF.displayName=zv;var KF="TabsList",GF=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=eC(KF,n),o=VF(n);return s.jsx(U4,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(De.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});GF.displayName=KF;var YF="TabsTrigger",XF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=eC(YF,n),c=VF(n),d=ZF(o.baseId,r),f=eB(o.baseId,r),h=r===o.value;return s.jsx(q4,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(De.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:Ae(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Ae(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Ae(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});XF.displayName=YF;var QF="TabsContent",JF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=eC(QF,n),d=ZF(c.baseId,r),f=eB(c.baseId,r),h=r===c.value,p=v.useRef(h);return v.useEffect(()=>{const y=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(y)},[]),s.jsx(Gn,{present:a||h,children:({present:y})=>s.jsx(De.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!y,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:y&&i})})});JF.displayName=QF;function ZF(e,t){return`${e}-trigger-${t}`}function eB(e,t){return`${e}-content-${t}`}var qpe=HF,tB=GF,nB=XF,rB=JF;const tC=qpe,Uv=v.forwardRef(({className:e,...t},n)=>s.jsx(tB,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Uv.displayName=tB.displayName;const Po=v.forwardRef(({className:e,...t},n)=>s.jsx(nB,{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}));Po.displayName=nB.displayName;const Wd=v.forwardRef(({className:e,...t},n)=>s.jsx(rB,{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}));Wd.displayName=rB.displayName;const XI={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 aB({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${XI[e]??XI.custom}`,children:e})}function Vd(e,[t,n]){return Math.min(n,Math.max(t,e))}function Wpe(e){const t=Vpe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Kpe);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 Vpe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Ype(a),c=Gpe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(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 Hpe=Symbol("radix.slottable");function Kpe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hpe}function Gpe(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 Ype(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 Xpe=[" ","Enter","ArrowUp","ArrowDown"],Qpe=[" ","Enter"],Oo="Select",[qv,Wv,Jpe]=Hd(Oo),[zc]=ir(Oo,[Jpe,Di]),Vv=Di(),[Zpe,qi]=zc(Oo),[ehe,the]=zc(Oo),sB=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:y,required:g,form:S}=e,b=Vv(t),[x,j]=v.useState(null),[N,_]=v.useState(null),[P,A]=v.useState(!1),O=Lc(f),[k,R]=na({prop:r,defaultProp:a??!1,onChange:i,caller:Oo}),[$,z]=na({prop:o,defaultProp:c,onChange:d,caller:Oo}),B=v.useRef(null),D=x?S||!!x.closest("form"):!0,[K,U]=v.useState(new Set),V=Array.from(K).map(X=>X.props.value).join(";");return s.jsx(Rm,{...b,children:s.jsxs(Zpe,{required:g,scope:t,trigger:x,onTriggerChange:j,valueNode:N,onValueNodeChange:_,valueNodeHasChildren:P,onValueNodeHasChildrenChange:A,contentId:Hn(),value:$,onValueChange:z,open:k,onOpenChange:R,dir:O,triggerPointerDownPosRef:B,disabled:y,children:[s.jsx(qv.Provider,{scope:t,children:s.jsx(ehe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(X=>{U(Z=>new Set(Z).add(X))},[]),onNativeOptionRemove:v.useCallback(X=>{U(Z=>{const T=new Set(Z);return T.delete(X),T})},[]),children:n})}),D?s.jsxs(PB,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:$,onChange:X=>z(X.target.value),disabled:y,form:S,children:[$===void 0?s.jsx("option",{value:""}):null,Array.from(K)]},V):null]})})};sB.displayName=Oo;var iB="SelectTrigger",oB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Vv(n),o=qi(iB,n),c=o.disabled||r,d=ut(t,o.onTriggerChange),f=Wv(n),h=v.useRef("touch"),[p,y,g]=kB(b=>{const x=f().filter(_=>!_.disabled),j=x.find(_=>_.value===o.value),N=RB(x,b,j);N!==void 0&&o.onValueChange(N.value)}),S=b=>{c||(o.onOpenChange(!0),g()),b&&(o.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return s.jsx(Yd,{asChild:!0,...i,children:s.jsx(De.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":OB(o.value)?"":void 0,...a,ref:d,onClick:Ae(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&S(b)}),onPointerDown:Ae(a.onPointerDown,b=>{h.current=b.pointerType;const x=b.target;x.hasPointerCapture(b.pointerId)&&x.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(S(b),b.preventDefault())}),onKeyDown:Ae(a.onKeyDown,b=>{const x=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&y(b.key),!(x&&b.key===" ")&&Xpe.includes(b.key)&&(S(),b.preventDefault())})})})});oB.displayName=iB;var lB="SelectValue",cB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=qi(lB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=ut(t,d.onValueNodeChange);return Kn(()=>{f(h)},[f,h]),s.jsx(De.span,{...c,ref:p,style:{pointerEvents:"none"},children:OB(d.value)?s.jsx(s.Fragment,{children:o}):i})});cB.displayName=lB;var nhe="SelectIcon",uB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(De.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});uB.displayName=nhe;var rhe="SelectPortal",dB=e=>s.jsx(Sc,{asChild:!0,...e});dB.displayName=rhe;var ko="SelectContent",fB=v.forwardRef((e,t)=>{const n=qi(ko,e.__scopeSelect),[r,a]=v.useState();if(Kn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?wc.createPortal(s.jsx(pB,{scope:e.__scopeSelect,children:s.jsx(qv.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(hB,{...e,ref:t})});fB.displayName=ko;var Ia=10,[pB,Wi]=zc(ko),ahe="SelectContentImpl",she=Wpe("SelectContent.RemoveScroll"),hB=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:y,collisionPadding:g,sticky:S,hideWhenDetached:b,avoidCollisions:x,...j}=e,N=qi(ko,n),[_,P]=v.useState(null),[A,O]=v.useState(null),k=ut(t,ae=>P(ae)),[R,$]=v.useState(null),[z,B]=v.useState(null),D=Wv(n),[K,U]=v.useState(!1),V=v.useRef(!1);v.useEffect(()=>{if(_)return Hm(_)},[_]),Wm();const X=v.useCallback(ae=>{const[ue,...ie]=D().map(oe=>oe.ref.current),[ve]=ie.slice(-1),Oe=document.activeElement;for(const oe of ae)if(oe===Oe||(oe?.scrollIntoView({block:"nearest"}),oe===ue&&A&&(A.scrollTop=0),oe===ve&&A&&(A.scrollTop=A.scrollHeight),oe?.focus(),document.activeElement!==Oe))return},[D,A]),Z=v.useCallback(()=>X([R,_]),[X,R,_]);v.useEffect(()=>{K&&Z()},[K,Z]);const{onOpenChange:T,triggerPointerDownPosRef:L}=N;v.useEffect(()=>{if(_){let ae={x:0,y:0};const ue=ve=>{ae={x:Math.abs(Math.round(ve.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(ve.pageY)-(L.current?.y??0))}},ie=ve=>{ae.x<=10&&ae.y<=10?ve.preventDefault():_.contains(ve.target)||T(!1),document.removeEventListener("pointermove",ue),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",ie,{capture:!0})}}},[_,T,L]),v.useEffect(()=>{const ae=()=>T(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[T]);const[Q,F]=kB(ae=>{const ue=D().filter(Oe=>!Oe.disabled),ie=ue.find(Oe=>Oe.ref.current===document.activeElement),ve=RB(ue,ae,ie);ve&&setTimeout(()=>ve.ref.current.focus())}),M=v.useCallback((ae,ue,ie)=>{const ve=!V.current&&!ie;(N.value!==void 0&&N.value===ue||ve)&&($(ae),ve&&(V.current=!0))},[N.value]),ee=v.useCallback(()=>_?.focus(),[_]),W=v.useCallback((ae,ue,ie)=>{const ve=!V.current&&!ie;(N.value!==void 0&&N.value===ue||ve)&&B(ae)},[N.value]),J=r==="popper"?nj:mB,ye=J===nj?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:y,collisionPadding:g,sticky:S,hideWhenDetached:b,avoidCollisions:x}:{};return s.jsx(pB,{scope:n,content:_,viewport:A,onViewportChange:O,itemRefCallback:M,selectedItem:R,onItemLeave:ee,itemTextRefCallback:W,focusSelectedItem:Z,selectedItemText:z,position:r,isPositioned:K,searchRef:Q,children:s.jsx(Qd,{as:she,allowPinchZoom:!0,children:s.jsx(Xd,{asChild:!0,trapped:N.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Ae(a,ae=>{N.trigger?.focus({preventScroll:!0}),ae.preventDefault()}),children:s.jsx(To,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(J,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ae=>ae.preventDefault(),...j,...ye,onPlaced:()=>U(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ae(j.onKeyDown,ae=>{const ue=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!ue&&ae.key.length===1&&F(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let ve=D().filter(Oe=>!Oe.disabled).map(Oe=>Oe.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Oe=ae.target,oe=ve.indexOf(Oe);ve=ve.slice(oe+1)}setTimeout(()=>X(ve)),ae.preventDefault()}})})})})})})});hB.displayName=ahe;var ihe="SelectItemAlignedPosition",mB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=qi(ko,n),o=Wi(ko,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=ut(t,k=>h(k)),y=Wv(n),g=v.useRef(!1),S=v.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:j,focusSelectedItem:N}=o,_=v.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&b&&x&&j){const k=i.trigger.getBoundingClientRect(),R=f.getBoundingClientRect(),$=i.valueNode.getBoundingClientRect(),z=j.getBoundingClientRect();if(i.dir!=="rtl"){const Oe=z.left-R.left,oe=$.left-Oe,he=k.left-oe,xe=k.width+he,Ie=Math.max(xe,R.width),re=window.innerWidth-Ia,me=Vd(oe,[Ia,Math.max(Ia,re-Ie)]);c.style.minWidth=xe+"px",c.style.left=me+"px"}else{const Oe=R.right-z.right,oe=window.innerWidth-$.right-Oe,he=window.innerWidth-k.right-oe,xe=k.width+he,Ie=Math.max(xe,R.width),re=window.innerWidth-Ia,me=Vd(oe,[Ia,Math.max(Ia,re-Ie)]);c.style.minWidth=xe+"px",c.style.right=me+"px"}const B=y(),D=window.innerHeight-Ia*2,K=b.scrollHeight,U=window.getComputedStyle(f),V=parseInt(U.borderTopWidth,10),X=parseInt(U.paddingTop,10),Z=parseInt(U.borderBottomWidth,10),T=parseInt(U.paddingBottom,10),L=V+X+K+T+Z,Q=Math.min(x.offsetHeight*5,L),F=window.getComputedStyle(b),M=parseInt(F.paddingTop,10),ee=parseInt(F.paddingBottom,10),W=k.top+k.height/2-Ia,J=D-W,ye=x.offsetHeight/2,ae=x.offsetTop+ye,ue=V+X+ae,ie=L-ue;if(ue<=W){const Oe=B.length>0&&x===B[B.length-1].ref.current;c.style.bottom="0px";const oe=f.clientHeight-b.offsetTop-b.offsetHeight,he=Math.max(J,ye+(Oe?ee:0)+oe+Z),xe=ue+he;c.style.height=xe+"px"}else{const Oe=B.length>0&&x===B[0].ref.current;c.style.top="0px";const he=Math.max(W,V+b.offsetTop+(Oe?M:0)+ye)+ie;c.style.height=he+"px",b.scrollTop=ue-W+b.offsetTop}c.style.margin=`${Ia}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=D+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[y,i.trigger,i.valueNode,c,f,b,x,j,i.dir,r]);Kn(()=>_(),[_]);const[P,A]=v.useState();Kn(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const O=v.useCallback(k=>{k&&S.current===!0&&(_(),N?.(),S.current=!1)},[_,N]);return s.jsx(lhe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:O,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:s.jsx(De.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});mB.displayName=ihe;var ohe="SelectPopperPosition",nj=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Ia,...i}=e,o=Vv(n);return s.jsx(Tm,{...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)"}})});nj.displayName=ohe;var[lhe,nC]=zc(ko,{}),rj="SelectViewport",vB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Wi(rj,n),o=nC(rj,n),c=ut(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(qv.Slot,{scope:n,children:s.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ae(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:y}=o;if(y?.current&&p){const g=Math.abs(d.current-h.scrollTop);if(g>0){const S=window.innerHeight-Ia*2,b=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),j=Math.max(b,x);if(j<S){const N=j+g,_=Math.min(S,N),P=N-_;p.style.height=_+"px",p.style.bottom==="0px"&&(h.scrollTop=P>0?P:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});vB.displayName=rj;var gB="SelectGroup",[che,uhe]=zc(gB),dhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Hn();return s.jsx(che,{scope:n,id:a,children:s.jsx(De.div,{role:"group","aria-labelledby":a,...r,ref:t})})});dhe.displayName=gB;var yB="SelectLabel",xB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=uhe(yB,n);return s.jsx(De.div,{id:a.id,...r,ref:t})});xB.displayName=yB;var vm="SelectItem",[fhe,bB]=zc(vm),wB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=qi(vm,n),d=Wi(vm,n),f=c.value===r,[h,p]=v.useState(i??""),[y,g]=v.useState(!1),S=ut(t,N=>d.itemRefCallback?.(N,r,a)),b=Hn(),x=v.useRef("touch"),j=()=>{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(fhe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:v.useCallback(N=>{p(_=>_||(N?.textContent??"").trim())},[]),children:s.jsx(qv.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(De.div,{role:"option","aria-labelledby":b,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:S,onFocus:Ae(o.onFocus,()=>g(!0)),onBlur:Ae(o.onBlur,()=>g(!1)),onClick:Ae(o.onClick,()=>{x.current!=="mouse"&&j()}),onPointerUp:Ae(o.onPointerUp,()=>{x.current==="mouse"&&j()}),onPointerDown:Ae(o.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:Ae(o.onPointerMove,N=>{x.current=N.pointerType,a?d.onItemLeave?.():x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ae(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(Qpe.includes(N.key)&&j(),N.key===" "&&N.preventDefault())})})})})});wB.displayName=vm;var qu="SelectItemText",SB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=qi(qu,n),c=Wi(qu,n),d=bB(qu,n),f=the(qu,n),[h,p]=v.useState(null),y=ut(t,j=>p(j),d.onItemTextChange,j=>c.itemTextRefCallback?.(j,d.value,d.disabled)),g=h?.textContent,S=v.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=f;return Kn(()=>(b(S),()=>x(S)),[b,x,S]),s.jsxs(s.Fragment,{children:[s.jsx(De.span,{id:d.textId,...i,ref:y}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?wc.createPortal(i.children,o.valueNode):null]})});SB.displayName=qu;var jB="SelectItemIndicator",NB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return bB(jB,n).isSelected?s.jsx(De.span,{"aria-hidden":!0,...r,ref:t}):null});NB.displayName=jB;var aj="SelectScrollUpButton",CB=v.forwardRef((e,t)=>{const n=Wi(aj,e.__scopeSelect),r=nC(aj,e.__scopeSelect),[a,i]=v.useState(!1),o=ut(t,r.onScrollButtonChange);return Kn(()=>{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(AB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});CB.displayName=aj;var sj="SelectScrollDownButton",_B=v.forwardRef((e,t)=>{const n=Wi(sj,e.__scopeSelect),r=nC(sj,e.__scopeSelect),[a,i]=v.useState(!1),o=ut(t,r.onScrollButtonChange);return Kn(()=>{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(AB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});_B.displayName=sj;var AB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Wi("SelectScrollButton",n),o=v.useRef(null),c=Wv(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),Kn(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(De.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ae(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ae(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ae(a.onPointerLeave,()=>{d()})})}),phe="SelectSeparator",EB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(De.div,{"aria-hidden":!0,...r,ref:t})});EB.displayName=phe;var ij="SelectArrow",hhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Vv(n),i=qi(ij,n),o=Wi(ij,n);return i.open&&o.position==="popper"?s.jsx(Im,{...a,...r,ref:t}):null});hhe.displayName=ij;var mhe="SelectBubbleInput",PB=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=ut(r,a),o=Fv(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(De.select,{...n,style:{...OM,...n.style},ref:i,defaultValue:t})});PB.displayName=mhe;function OB(e){return e===""||e===void 0}function kB(e){const t=Pn(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 RB(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=vhe(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 vhe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ghe=sB,TB=oB,yhe=cB,xhe=uB,bhe=dB,IB=fB,whe=vB,MB=xB,$B=wB,She=SB,jhe=NB,DB=CB,LB=_B,FB=EB;const sn=ghe,on=yhe,Jt=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(TB,{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(xhe,{asChild:!0,children:s.jsx(qt,{className:"h-4 w-4 opacity-50"})})]}));Jt.displayName=TB.displayName;const BB=v.forwardRef(({className:e,...t},n)=>s.jsx(DB,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(is,{className:"h-4 w-4"})}));BB.displayName=DB.displayName;const zB=v.forwardRef(({className:e,...t},n)=>s.jsx(LB,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(qt,{className:"h-4 w-4"})}));zB.displayName=LB.displayName;const Zt=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(bhe,{children:s.jsxs(IB,{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(BB,{}),s.jsx(whe,{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(zB,{})]})}));Zt.displayName=IB.displayName;const Nhe=v.forwardRef(({className:e,...t},n)=>s.jsx(MB,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Nhe.displayName=MB.displayName;const at=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs($B,{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(jhe,{children:s.jsx(ql,{className:"h-4 w-4"})})}),s.jsx(She,{children:t})]}));at.displayName=$B.displayName;const Che=v.forwardRef(({className:e,...t},n)=>s.jsx(FB,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));Che.displayName=FB.displayName;var Hv="Collapsible",[_he]=ir(Hv),[Ahe,rC]=_he(Hv),UB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=na({prop:r,defaultProp:a??!1,onChange:o,caller:Hv});return s.jsx(Ahe,{scope:n,disabled:i,contentId:Hn(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(De.div,{"data-state":sC(d),"data-disabled":i?"":void 0,...c,ref:t})})});UB.displayName=Hv;var qB="CollapsibleTrigger",WB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=rC(qB,n);return s.jsx(De.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":sC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Ae(e.onClick,a.onOpenToggle)})});WB.displayName=qB;var aC="CollapsibleContent",VB=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=rC(aC,e.__scopeCollapsible);return s.jsx(Gn,{present:n||a.open,children:({present:i})=>s.jsx(Ehe,{...r,ref:t,present:i})})});VB.displayName=aC;var Ehe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=rC(aC,n),[c,d]=v.useState(r),f=v.useRef(null),h=ut(t,f),p=v.useRef(0),y=p.current,g=v.useRef(0),S=g.current,b=o.open||c,x=v.useRef(b),j=v.useRef(void 0);return v.useEffect(()=>{const N=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(N)},[]),Kn(()=>{const N=f.current;if(N){j.current=j.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const _=N.getBoundingClientRect();p.current=_.height,g.current=_.width,x.current||(N.style.transitionDuration=j.current.transitionDuration,N.style.animationName=j.current.animationName),d(r)}},[o.open,r]),s.jsx(De.div,{"data-state":sC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...i,ref:h,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":S?`${S}px`:void 0,...e.style},children:b&&a})});function sC(e){return e?"open":"closed"}var Phe=UB;const Ci=Phe,Rs=WB,_i=VB,Ohe=Gm,khe=Ym,HB=v.forwardRef(({className:e,...t},n)=>s.jsx(Pc,{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}));HB.displayName=Pc.displayName;const KB=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(khe,{children:[s.jsx(HB,{}),s.jsxs(Oc,{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(Xm,{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(Ti,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));KB.displayName=Oc.displayName;const GB=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});GB.displayName="DialogHeader";const YB=v.forwardRef(({className:e,...t},n)=>s.jsx(Jd,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));YB.displayName=Jd.displayName;const XB=v.forwardRef(({className:e,...t},n)=>s.jsx(Zd,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));XB.displayName=Zd.displayName;function Rhe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var iC="ScrollArea",[QB]=ir(iC),[The,ja]=QB(iC),JB=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,y]=v.useState(null),[g,S]=v.useState(null),[b,x]=v.useState(null),[j,N]=v.useState(0),[_,P]=v.useState(0),[A,O]=v.useState(!1),[k,R]=v.useState(!1),$=ut(t,B=>d(B)),z=Lc(a);return s.jsx(The,{scope:n,type:r,dir:z,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:y,scrollbarX:g,onScrollbarXChange:S,scrollbarXEnabled:A,onScrollbarXEnabledChange:O,scrollbarY:b,onScrollbarYChange:x,scrollbarYEnabled:k,onScrollbarYEnabledChange:R,onCornerWidthChange:N,onCornerHeightChange:P,children:s.jsx(De.div,{dir:z,...o,ref:$,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});JB.displayName=iC;var ZB="ScrollAreaViewport",e8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=ja(ZB,n),c=v.useRef(null),d=ut(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(De.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})})]})});e8.displayName=ZB;var xs="ScrollAreaScrollbar",oC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ja(xs,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(Ihe,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Mhe,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(t8,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(lC,{...r,ref:t}):null});oC.displayName=xs;var Ihe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ja(xs,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(Gn,{present:n||i,children:s.jsx(t8,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Mhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ja(xs,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Gv(()=>d("SCROLL_END"),100),[c,d]=Rhe("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 y=()=>{const g=f[h];p!==g&&(d("SCROLL"),o()),p=g};return f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[a.viewport,i,d,o]),s.jsx(Gn,{present:n||c!=="hidden",children:s.jsx(lC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ae(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ae(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),t8=v.forwardRef((e,t)=>{const n=ja(xs,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=Gv(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return xc(n.viewport,d),xc(n.content,d),s.jsx(Gn,{present:r||i,children:s.jsx(lC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),lC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=ja(xs,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=i8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:y=>i.current=y,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:y=>o.current=y};function p(y,g){return zhe(y,o.current,c,g)}return n==="horizontal"?s.jsx($he,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollLeft,g=QI(y,c,a.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:y=>{a.viewport&&(a.viewport.scrollLeft=y)},onDragScroll:y=>{a.viewport&&(a.viewport.scrollLeft=p(y,a.dir))}}):n==="vertical"?s.jsx(Dhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const y=a.viewport.scrollTop,g=QI(y,c);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:y=>{a.viewport&&(a.viewport.scrollTop=y)},onDragScroll:y=>{a.viewport&&(a.viewport.scrollTop=p(y))}}):null}),$he=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=ja(xs,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=ut(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(r8,{"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":Kv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(y),l8(y,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:ym(o.paddingLeft),paddingEnd:ym(o.paddingRight)}})}})}),Dhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=ja(xs,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=ut(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(r8,{"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":Kv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const y=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(y),l8(y,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:ym(o.paddingTop),paddingEnd:ym(o.paddingBottom)}})}})}),[Lhe,n8]=QB(xs),r8=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,...y}=e,g=ja(xs,n),[S,b]=v.useState(null),x=ut(t,$=>b($)),j=v.useRef(null),N=v.useRef(""),_=g.viewport,P=r.content-r.viewport,A=Pn(h),O=Pn(d),k=Gv(p,10);function R($){if(j.current){const z=$.clientX-j.current.left,B=$.clientY-j.current.top;f({x:z,y:B})}}return v.useEffect(()=>{const $=z=>{const B=z.target;S?.contains(B)&&A(z,P)};return document.addEventListener("wheel",$,{passive:!1}),()=>document.removeEventListener("wheel",$,{passive:!1})},[_,S,P,A]),v.useEffect(O,[r,O]),xc(S,k),xc(g.content,k),s.jsx(Lhe,{scope:n,scrollbar:S,hasThumb:a,onThumbChange:Pn(i),onThumbPointerUp:Pn(o),onThumbPositionChange:O,onThumbPointerDown:Pn(c),children:s.jsx(De.div,{...y,ref:x,style:{position:"absolute",...y.style},onPointerDown:Ae(e.onPointerDown,$=>{$.button===0&&($.target.setPointerCapture($.pointerId),j.current=S.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R($))}),onPointerMove:Ae(e.onPointerMove,R),onPointerUp:Ae(e.onPointerUp,$=>{const z=$.target;z.hasPointerCapture($.pointerId)&&z.releasePointerCapture($.pointerId),document.body.style.webkitUserSelect=N.current,g.viewport&&(g.viewport.style.scrollBehavior=""),j.current=null})})})}),gm="ScrollAreaThumb",a8=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=n8(gm,e.__scopeScrollArea);return s.jsx(Gn,{present:n||a.hasThumb,children:s.jsx(Fhe,{ref:t,...r})})}),Fhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=ja(gm,n),o=n8(gm,n),{onThumbPositionChange:c}=o,d=ut(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=Gv(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=i.viewport;if(p){const y=()=>{if(h(),!f.current){const g=Uhe(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[i.viewport,h,c]),s.jsx(De.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:Ae(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),S=p.clientX-g.left,b=p.clientY-g.top;o.onThumbPointerDown({x:S,y:b})}),onPointerUp:Ae(e.onPointerUp,o.onThumbPointerUp)})});a8.displayName=gm;var cC="ScrollAreaCorner",s8=v.forwardRef((e,t)=>{const n=ja(cC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(Bhe,{...e,ref:t}):null});s8.displayName=cC;var Bhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=ja(cC,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return xc(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),xc(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(De.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 ym(e){return e?parseInt(e,10):0}function i8(e,t){const n=e/t;return isNaN(n)?0:n}function Kv(e){const t=i8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function zhe(e,t,n,r="ltr"){const a=Kv(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 o8([d,f],p)(e)}function QI(e,t,n="ltr"){const r=Kv(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=Vd(e,d);return o8([0,o],[0,c])(f)}function o8(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 l8(e,t){return e>0&&e<t}var Uhe=(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 Gv(e,t){const n=Pn(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 xc(e,t){const n=Pn(t);Kn(()=>{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 c8=JB,qhe=e8,Whe=s8;const xm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(c8,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[s.jsx(qhe,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(u8,{}),s.jsx(Whe,{})]}));xm.displayName=c8.displayName;const u8=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(oC,{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(a8,{className:"relative flex-1 rounded-full bg-border"})}));u8.displayName=oC.displayName;const Vhe=[{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 Hhe({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}=On(),[y,g]=v.useState(null),[S,b]=v.useState(null),[x,j]=v.useState(""),[N,_]=v.useState(!1),[P,A]=v.useState(new Set),O=v.useRef(null),k=v.useRef(null),R=v.useRef(null),[$,z]=v.useState(!1),B=v.useRef(!1),D=d||i[0]?.name||i[0]?.id||"";v.useEffect(()=>{if(!e||!D||y)return;let W=!1;return _(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:D,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(ye=>ye.id===J)?.name||o.find(ye=>ye.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=>{W||(g(J.sessionId),b(J.session))}).catch(J=>{W||Pe({title:"Could not start Scenario Assistant",description:J instanceof Error?J.message:String(J),variant:"destructive"})}).finally(()=>{W||_(!1)}),()=>{W=!0}},[e,p,y,n,r,a,c,i,o,D]);const K=()=>{g(null),b(null),j(""),A(new Set),R.current=null},U=W=>{K(),p.closeScenarioAssistantSession(W).catch(()=>{})};v.useEffect(()=>{e||y&&(B.current||$||U(y))},[e,y,p,$]),v.useEffect(()=>()=>{y&&p.closeScenarioAssistantSession(y).catch(()=>{})},[y,p]),v.useEffect(()=>{if(!e)return;$&&z(!1),B.current&&(B.current=!1);const W=window.setTimeout(()=>{O.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(W)},[e,N,S?.messages.length,S?.pendingToolCalls.length,S?.warnings.length]),v.useEffect(()=>{const W=k.current;if(!W)return;W.style.height="0px";const J=Math.min(W.scrollHeight,160);W.style.height=`${Math.max(40,J)}px`},[x,e]);const V=i.length>0&&a.serverIds.length>0&&!!D,X=async W=>{if(!y)return;const J=W.trim();if(!J)return;const ye=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ae={id:ye,role:"user",text:J,createdAt:new Date().toISOString()};b(ue=>ue&&{...ue,messages:[...ue.messages,ae]}),j(""),_(!0);try{const ue=await p.sendScenarioAssistantMessage(y,J);b(ue.session)}catch(ue){b(ie=>ie&&{...ie,messages:ie.messages.filter(ve=>ve.id!==ye)}),j(ie=>ie.trim()?ie:J),Pe({title:"Scenario Assistant error",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{_(!1)}},Z=W=>{j(W),requestAnimationFrame(()=>k.current?.focus())};v.useEffect(()=>{if(!e||!y||!S||!V||N)return;const W=String(f??"").trim();W&&R.current!==W&&(R.current=W,X(W))},[e,y,S,V,N,f]);const T=async W=>{if(y){_(!0);try{const J=await p.approveScenarioAssistantToolCall(y,W);b(J.session)}catch(J){Pe({title:"Tool call failed",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{_(!1)}}},L=async W=>{if(y){_(!0);try{const J=await p.denyScenarioAssistantToolCall(y,W);b(J.session)}catch(J){Pe({title:"Could not deny tool call",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{_(!1)}}},Q=(W,J,ye)=>{if(!J)return;if(ye==="prompt"&&J.prompt&&h({prompt:J.prompt.replacement}),ye==="evalRules"&&J.evalRules&&h({evalRules:J.evalRules.replacement}),ye==="extractRules"&&J.extractRules&&h({extractRules:J.extractRules.replacement}),ye==="snapshotEval"&&J.snapshotEval&&h({snapshotEval:{enabled:J.snapshotEval.patch.enabled,baselineSnapshotId:J.snapshotEval.patch.baselineSnapshotId}}),W){const ue=`${W}:${ye}`;A(ie=>new Set([...ie,ue]))}Pe({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[ye]}`})},F=W=>{W||(z(!1),B.current=!1),t(W)},M=()=>{B.current=!0,z(!0),t(!1)},ee=()=>{B.current=!1,z(!1),y&&U(y)};return s.jsxs(s.Fragment,{children:[!e&&y&&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}),S?` · ${S.messages.length} messages`:""]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(fa,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(se,{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(Ti,{className:"h-4 w-4"})})]})]}),s.jsx(Ohe,{open:e,onOpenChange:F,children:s.jsxs(KB,{className:"max-w-6xl h-[85vh] flex flex-col",children:[y&&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:M,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(T7,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(GB,{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(YB,{className:"flex items-center gap-2",children:[s.jsx(fa,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(XB,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),V?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(Me,{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(Is,{className:"h-3.5 w-3.5"}),S?`Loaded ${S.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(xm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[S?.warnings?.map((W,J)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:W},`${W}-${J}`)),S?.messages.map(W=>s.jsxs(v.Fragment,{children:[(()=>{const J=W.pendingToolCallId?(S?.pendingToolCalls??[]).find(Oe=>Oe.id===W.pendingToolCallId):void 0;if(!(W.role==="assistant"&&!!W.pendingToolCallId))return s.jsx("div",{className:"space-y-2",children:s.jsx(Khe,{message:W})});const ae=W.text.match(/I need to call ['"]([^'"]+)['"]/i)?.[1]?.replace(/^.*__/,"")??void 0,ue=J?.tool??W.toolRequestName??ae,ie=J?.publicToolName??W.toolRequestPublicName,ve=ue??ie??"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(ha,{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(Is,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"truncate text-sm font-medium",children:`Tool call ${ve}`}),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(qt,{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(oj,{text:W.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(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{L(J.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{T(J.id)},children:"Approve"})]})]})]})]})]})})(),W.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(fa,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),W.suggestions.prompt&&s.jsx(Kp,{title:"Prompt",rationale:W.suggestions.prompt.rationale,preview:W.suggestions.prompt.replacement,applied:P.has(`${W.id}:prompt`),onApply:()=>Q(W.id,W.suggestions,"prompt")}),W.suggestions.evalRules&&s.jsx(Kp,{title:"Checks",rationale:W.suggestions.evalRules.rationale,preview:JSON.stringify(W.suggestions.evalRules.replacement,null,2),applied:P.has(`${W.id}:evalRules`),onApply:()=>Q(W.id,W.suggestions,"evalRules")}),W.suggestions.extractRules&&s.jsx(Kp,{title:"Value Capture Rules",rationale:W.suggestions.extractRules.rationale,preview:JSON.stringify(W.suggestions.extractRules.replacement,null,2),applied:P.has(`${W.id}:extractRules`),onApply:()=>Q(W.id,W.suggestions,"extractRules")}),W.suggestions.snapshotEval&&s.jsx(Kp,{title:"Snapshot Settings",rationale:W.suggestions.snapshotEval.rationale,preview:JSON.stringify(W.suggestions.snapshotEval.patch,null,2),applied:P.has(`${W.id}:snapshotEval`),onApply:()=>Q(W.id,W.suggestions,"snapshotEval")}),(()=>{const J=W.suggestions?.notes,ye=Array.isArray(J)?J:typeof J=="string"?[J]:[];return ye.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:ye.map((ae,ue)=>s.jsx("li",{children:ae},`${W.id}-note-${ue}`))})]})})()]})]},W.id)),(S?.pendingToolCalls??[]).filter(W=>!(S?.messages??[]).some(J=>J.pendingToolCallId===W.id)).map(W=>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(Is,{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:W.publicToolName||W.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(qt,{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(W.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{L(W.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{T(W.id)},children:"Approve"})]})]})]},W.id)),!S&&N&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(sr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),S&&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(ha,{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(sr,{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(Ks,{ref:k,value:x,onChange:W=>j(W.target.value),placeholder:"Get assistance with creating or refining this scenario ...",disabled:!y||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:W=>{W.key==="Enter"&&!W.shiftKey&&(W.preventDefault(),X(x))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsxs(se,{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:!y||N,children:[s.jsx(us,{className:"h-3 w-3"}),"Snippets",s.jsx(qt,{className:"h-3 w-3"})]})}),s.jsxs(Wo,{align:"start",className:"w-[320px]",children:[s.jsx(JN,{children:"Scenario Assistant Snippets"}),s.jsx(ZN,{}),Vhe.map(W=>s.jsx(hr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>Z(W.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:W.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:W.description})]})},W.label))]})]}),s.jsx(se,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>{X(x)},disabled:!y||N||!x.trim(),"aria-label":"Send message",title:"Send message",children:N?s.jsx(sr,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(o$,{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 Kp({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(se,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(Ol,{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 Khe({message:e}){const t=async o=>{try{await navigator.clipboard.writeText(o),Pe({title:"Copied"})}catch(c){Pe({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(Is,{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(i$,{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(oj,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?Nj:ha,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(oj,{text:e.text,variant:"assistant"})]}),i&&s.jsx(se,{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(Ri,{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 oj({text:e,variant:t="assistant"}){const n=Ghe(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:Yhe(r,a,t)},`md-${a}`))})}function Ghe(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 y=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!i(t[r]);)g.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:y,code:g.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(JI(t,r)){const y=ZI(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(ZI(t[r])),r+=1;n.push({type:"table",headers:y,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const y=!!f,g=[];for(;r<t.length;){const S=t[r].trim();if(y?/^\d+\.\s+/.test(S):/^[-*+]\s+/.test(S)){g.push(S.replace(y?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:y,items:g});continue}const p=[o];for(r+=1;r<t.length;){const y=t[r],g=y.trim();if(a(y)||i(y)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||JI(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(y),r+=1}n.push({type:"paragraph",text:p.join(`
124
+ `)})}return n}function JI(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 ZI(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Yhe(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:$u(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:$u(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:$u(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:$u(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:$u(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function $u(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 Xhe="mcplab.feature.";function mf(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${Xhe}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const Qhe=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function lj({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:y=!p,allowStructureEdits:g=!p}){const S=(N,_)=>{const P=e.map((A,O)=>O===N?{...A,..._}:A);h(P)},b=N=>h(e.filter((_,P)=>P!==N)),x=()=>h([...e,Qhe()]),j=(N,_)=>{const P=N+_;if(P<0||P>=e.length)return;const A=[...e],[O]=A.splice(N,1);A.splice(P,0,O),h(A)};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"}),y&&g&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:x,children:[s.jsx(us,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((N,_)=>s.jsx(Jhe,{scenario:N,scenarioOrigin:t?.[_],index:_,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=>S(_,P),onMoveUp:()=>j(_,-1),onMoveDown:()=>j(_,1),onRemove:()=>b(_),readOnly:p,allowStructureEdits:g},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 Jhe({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:y,onMoveUp:g,onMoveDown:S,onRemove:b,readOnly:x,allowStructureEdits:j}){const{source:N}=On(),_=mf("snapshots",!1),[P,A]=v.useState("required_tool"),[O,k]=v.useState(""),[R,$]=v.useState(""),[z,B]=v.useState(null),[D,K]=v.useState(!1),[U,V]=v.useState(null),[X,Z]=v.useState(""),[T,L]=v.useState(""),[Q,F]=v.useState(!1),[M,ee]=v.useState(!x),W=()=>{O.trim()&&(y({evalRules:[...e.evalRules,{type:P,value:O.trim()}]}),k(""),$(""))},J=je=>{y({evalRules:e.evalRules.filter((et,dt)=>dt!==je)})},ye=()=>{!X.trim()||!T.trim()||(y({extractRules:[...e.extractRules,{name:X.trim(),pattern:T.trim()}]}),Z(""),L(""))},ae=je=>{y({extractRules:e.extractRules.filter((et,dt)=>dt!==je)})},ue=je=>{const et=e.serverIds.includes(je)?e.serverIds.filter(dt=>dt!==je):[...e.serverIds,je];y({serverIds:et})},ie={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains"},ve={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"},Oe=P==="required_tool"||P==="forbidden_tool",oe=e.serverIds.map(je=>i.find(et=>et.id===je)?.name).filter(je=>!!je),he=oe.length>0,xe=e.snapshotEval?.baselineSnapshotId!==void 0,[Ie,re]=v.useState(""),[me,Ne]=v.useState(0);v.useEffect(()=>{const je=(f??"").trim();je&&Ie!==je&&(F(!0),re(je))},[f,Ie]),v.useEffect(()=>{h&&h!==me&&(F(!0),Ne(h))},[h,me]),v.useEffect(()=>{B(null),V(null),$("")},[e.serverIds.join("|")]),v.useEffect(()=>{$("")},[P]);const tt=async()=>{if(!(!he||x)){K(!0),V(null);try{const je=new Set;for(const et of oe){const dt=await N.discoverToolsForAnalysis({serverNames:[et]});for(const Pt of dt.servers)for(const hn of Pt.tools)je.add(hn.name)}B(Array.from(je).sort((et,dt)=>et.localeCompare(dt)))}catch(je){V(je instanceof Error?je.message:"Failed to load tools")}finally{K(!1)}}};return s.jsx(Ci,{open:M,onOpenChange:ee,children:s.jsxs(ze,{className:x?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(Ct,{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(Rs,{asChild:!0,children:s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(qt,{className:`h-3.5 w-3.5 transition-transform ${M?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(_t,{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(Rs,{asChild:!0,children:s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":M?"Collapse scenario details":"Expand scenario details",children:s.jsx(qt,{className:`h-4 w-4 transition-transform ${M?"rotate-180":""}`})})})]}):j&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>F(!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(fa,{className:"h-3.5 w-3.5"}),"Ask Assistant"]}),s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:g,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(is,{className:"h-3.5 w-3.5"})}),s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,disabled:n===r-1,"aria-label":"Move scenario down",children:s.jsx(qt,{className:"h-3.5 w-3.5"})}),s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,children:s.jsx(xa,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(_i,{children:s.jsxs(Ue,{className:"space-y-3",children:[s.jsx(Hhe,{open:Q,onOpenChange:F,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:je=>y({...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(Me,{className:"text-xs",children:"Name"}),s.jsx(ht,{value:e.name,onChange:je=>y({name:je.target.value}),disabled:x,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{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&&ue(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(Ct,{className:"pb-2",children:[s.jsx(_t,{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(Ks,{value:e.prompt,onChange:je=>y({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(Ct,{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(_t,{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(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>F(!0),title:"Ask for help improving checks",children:[s.jsx(fa,{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(Me,{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,et)=>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 ${ve[je.type]}`,children:ie[je.type]}),s.jsx("span",{className:"font-mono break-all",children:je.value})]})}),!x&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>J(et),"aria-label":`Remove check ${et+1}`,children:s.jsx(Ti,{className:"h-3.5 w-3.5"})})]},et))}),!x&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(sn,{value:P,onValueChange:je=>A(je),children:[s.jsx(Jt,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"required_tool",children:"Required Tool"}),s.jsx(at,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(at,{value:"response_contains",children:"Text matches pattern"}),s.jsx(at,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(ht,{value:O,onChange:je=>k(je.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:je=>je.key==="Enter"&&(je.preventDefault(),W())}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:W,children:"Add"})]}),Oe&&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(Me,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(sn,{value:R,onValueChange:je=>{$(je),k(je)},disabled:D||!z||z.length===0,children:[s.jsx(Jt,{className:"h-8 text-xs",children:s.jsx(on,{placeholder:D?"Loading tools...":z&&z.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(Zt,{children:(z??[]).map(je=>s.jsx(at,{value:je,children:je},je))})]})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:tt,disabled:!he||D,children:D?"Loading...":z?"Refresh tools":"Load tools"})]}),!he&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),U&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",U]})]})]})]})})]}),s.jsxs(ze,{className:"border bg-muted/10",children:[s.jsx(Ct,{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(_t,{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(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>F(!0),title:"Ask for help improving value capture rules",children:[s.jsx(fa,{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(Me,{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,et)=>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(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>ae(et),"aria-label":`Remove value capture rule ${et+1}`,children:s.jsx(Ti,{className:"h-3.5 w-3.5"})})]},et))}),!x&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(ht,{value:X,onChange:je=>Z(je.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(ht,{value:T,onChange:je=>L(je.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:je=>je.key==="Enter"&&(je.preventDefault(),ye())}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ye,children:"Add"})]})]})})]})]}),_&&s.jsxs(ze,{className:"border bg-amber-50/40",children:[s.jsxs(Ct,{className:"pb-2",children:[s.jsx(_t,{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(mm,{checked:e.snapshotEval?.enabled!==!1,disabled:x,onCheckedChange:je=>y({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(mm,{checked:!xe,disabled:x,onCheckedChange:je=>{if(je){y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}y({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),xe&&s.jsx(ht,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:je=>y({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 Zhe=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),eM=()=>{const{id:e,tab:t}=Mo(),n=wa(),[r,a]=Ec(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=tf(),{source:f}=On(),h=mf("snapshots",!1),{servers:p,agents:y,scenarios:g}=qa(),S=e==="new",b=!S&&!!e,x=b?i(e):void 0,[j,N]=v.useState(S),[_,P]=v.useState(()=>x?structuredClone(x):Zhe()),[A,O]=v.useState([]),[k,R]=v.useState(""),[$,z]=v.useState(""),[B,D]=v.useState(""),[K,U]=v.useState(null),[V,X]=v.useState(!1),[Z,T]=v.useState(!1),[L,Q]=v.useState(""),[F,M]=v.useState(""),[ee,W]=v.useState({}),[J,ye]=v.useState({}),[ae,ue]=v.useState({}),ie=v.useMemo(()=>{const H=t||r.get("tab");return H==="agents"||H==="scenarios"?H:"scenarios"},[t,r]);v.useEffect(()=>{x&&!j&&P(structuredClone(x))},[x,j]),v.useEffect(()=>{let H=!0;return f.listSnapshots().then(ge=>{H&&O(ge)}).catch(()=>{H&&O([])}),()=>{H=!1}},[f]),v.useEffect(()=>{if(!k.trim()){U(null);return}let H=!0;return f.getResult(k.trim()).then(ge=>{if(!H)return;if(!ge){U(!1);return}const Ye=ge.overallPassRate===1&&ge.scenarios.every(Ze=>Ze.runs.every(jt=>jt.passed));U(Ye)}).catch(()=>{H&&U(!1)}),()=>{H=!1}},[k,f]);const ve=H=>P(ge=>({...ge,...H})),Oe=v.useMemo(()=>_.serverEntries&&_.serverEntries.length>0?_.serverEntries:(_.servers??[]).map(H=>({kind:"inline",server:H})),[_.serverEntries,_.servers]),oe=v.useMemo(()=>_.scenarioEntries&&_.scenarioEntries.length>0?_.scenarioEntries:_.scenarios.map(H=>({kind:"inline",scenario:H})),[_.scenarioEntries,_.scenarios]),he=H=>{ve({scenarioEntries:H,scenarios:H.filter(ge=>ge.kind==="inline").map(ge=>ge.scenario)})},xe=v.useMemo(()=>_.agentEntries&&_.agentEntries.length>0?_.agentEntries:_.agents.map(H=>({kind:"inline",agent:H})),[_.agentEntries,_.agents]),Ie=H=>{ve({agentEntries:H,agents:H.filter(ge=>ge.kind==="inline").map(ge=>ge.agent)})},re=!j,me=_.runDefaults?.selectedAgentNames??[],Ne=async H=>{if(!_.id||re===!1){ve({snapshotEval:{enabled:H.enabled,mode:H.mode,baselineSnapshotId:H.baselineSnapshotId,baselineSourceRunId:H.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}X(!0);try{const ge=await f.updateSnapshotPolicy(_.id,H);P(ge),Pe({title:"Snapshot policy updated"})}catch(ge){Pe({title:"Could not update snapshot policy",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}finally{X(!1)}},tt=async()=>{if(!(!_.id||!k.trim())){T(!0);try{const H=await f.generateSnapshotEvalBaseline(k.trim(),_.id,$.trim()||void 0);P(H.config),D(H.snapshot.id),O(ge=>[H.snapshot,...ge.filter(Ye=>Ye.id!==H.snapshot.id)]),Pe({title:"Snapshot baseline generated",description:`${H.snapshot.name} (${H.snapshot.id})`})}catch(H){Pe({title:"Could not generate baseline",description:H instanceof Error?H.message:String(H),variant:"destructive"})}finally{T(!1)}}},je=async()=>{if(!_.name.trim()){Pe({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const H=Oe.map(We=>We.kind==="referenced"?{kind:"referenced",ref:p.find(Ln=>Ln.id===We.ref)?.id||We.ref}:We),ge=xe.map(We=>We.kind==="referenced"?{kind:"referenced",ref:y.find(Ln=>Ln.id===We.ref)?.id||We.ref}:We),Ye=oe.map(We=>We.kind==="referenced"?{kind:"referenced",ref:g.find(Ln=>Ln.id===We.ref)?.id||We.ref}:We);if(Ye.filter(We=>We.kind==="inline").some(We=>!We.scenario.name?.trim())){Pe({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const jt=new Set(ge.map(We=>We.kind==="inline"?We.agent.id:We.ref)),wt=(_.runDefaults?.selectedAgentNames??[]).filter(We=>jt.has(We)),Nn={..._,serverEntries:H,servers:H.filter(We=>We.kind==="inline").map(We=>We.server),agentEntries:ge,agents:ge.filter(We=>We.kind==="inline").map(We=>We.agent),scenarioEntries:Ye,scenarios:Ye.filter(We=>We.kind==="inline").map(We=>We.scenario),runDefaults:wt.length>0?{..._.runDefaults??{},selectedAgentNames:wt}:void 0,updatedAt:new Date().toISOString()};if(S){const We=await o(Nn);P(We);const vn=We.configName?.trim()||We.name;Pe({title:"MCP Evaluation Created",description:`"${vn}" has been saved.`}),n(`/mcp-evaluations/${We.id}`)}else{const We=await c(_.id,Nn);P(We);const vn=We.configName?.trim()||We.name;Pe({title:"MCP Evaluation Updated",description:`"${vn}" has been updated.`}),N(!1),We.id!==e&&n(`/mcp-evaluations/${We.id}`,{replace:!0})}},et=_.configName?.trim()||_.name,dt=S?"New MCP Evaluation":j?`Editing: ${et}`:et,Pt=S?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(_.id||e||"")}`,hn=!!x?.loadError,we=v.useMemo(()=>y.map(H=>({id:H.id,ref:H.id,label:H.name||H.id,model:H.model})).sort((H,ge)=>H.label.localeCompare(ge.label)),[y]),Le=(H,ge)=>{const Ye=ge?Array.from(new Set([...me,H])):me.filter(Ze=>Ze!==H);ve({runDefaults:{..._.runDefaults??{},selectedAgentNames:Ye}})},qe=H=>{const ge=new Set([...xe.filter(wt=>wt.kind==="inline").map(wt=>wt.agent.name||wt.agent.id),...y.map(wt=>wt.name||wt.id)]),Ye=`${H}-custom`;let Ze=Ye,jt=2;for(;ge.has(Ze);)Ze=`${Ye}-${jt}`,jt+=1;return Ze},Rt=()=>{const ge={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Ie([{kind:"inline",agent:ge},...xe]),W(Ye=>({...Ye,[ge.id]:!0}))},$t=()=>{const H=y.find(Ze=>Ze.id===F);if(!H)return;const ge=H.id;new Set(xe.filter(Ze=>Ze.kind==="referenced").map(Ze=>Ze.ref)).has(ge)||Ie([...xe,{kind:"referenced",ref:ge}]),M("")},Dt=()=>{const H=y.find(jt=>jt.id===F);if(!H)return;const ge=H.name||H.id,Ye=qe(ge),Ze={...structuredClone(H),id:`agt-${Date.now()}`,name:Ye};Ie([...xe,{kind:"inline",agent:Ze}]),W(jt=>({...jt,[Ze.id]:!0})),M(""),Pe({title:"Imported agent as inline",description:Ye})},mn=H=>{const ge=xe[H];if(!ge)return;const Ye=ge.kind==="inline"?ge.agent.id:ge.ref,Ze=me.filter(jt=>jt!==Ye);ve({runDefaults:{..._.runDefaults??{},selectedAgentNames:Ze}}),ge.kind==="inline"&&W(jt=>{const wt={...jt};return delete wt[ge.agent.id],wt}),Ie(xe.filter((jt,wt)=>wt!==H))},jn=(H,ge)=>{const Ye=H+ge;if(Ye<0||Ye>=xe.length)return;const Ze=[...xe],[jt]=Ze.splice(H,1);Ze.splice(Ye,0,jt),Ie(Ze)},or=H=>{const ge=xe[H];if(!ge||ge.kind!=="referenced")return;const Ye=xn(ge.ref);if(!Ye){Pe({title:"Referenced agent not found",variant:"destructive"});return}const Ze=Ye.name||Ye.id,jt=qe(Ze),wt={...structuredClone(Ye),id:`agt-${Date.now()}`,name:jt},Nn=[...xe];if(Nn[H]={kind:"inline",agent:wt},Ie(Nn),me.includes(ge.ref)){const We=me.map(vn=>vn===ge.ref?wt.id:vn);ve({runDefaults:{..._.runDefaults??{},selectedAgentNames:Array.from(new Set(We))}})}W(We=>({...We,[wt.id]:!0})),Pe({title:"Referenced agent converted to inline",description:jt})},lr=()=>{const H=g.find(Ye=>Ye.id===L);if(!H)return;const ge={...structuredClone(H),id:`scn-${Date.now()}`,serverIds:[...H.serverIds]};he([...oe,{kind:"inline",scenario:ge}]),ue(Ye=>({...Ye,[ge.id]:!0})),Q("")},Na=()=>{const ge={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};he([{kind:"inline",scenario:ge},...oe]),ue(Ye=>({...Ye,[ge.id]:!0}))},Dn=()=>{const H=g.find(Ze=>Ze.id===L);if(!H)return;const ge=H.id;new Set(oe.filter(Ze=>Ze.kind==="referenced").map(Ze=>Ze.ref)).has(ge)||he([...oe,{kind:"referenced",ref:ge}]),Q("")},Dr=H=>{const ge=oe[H];ge?.kind==="inline"&&ue(Ye=>{const Ze={...Ye};return delete Ze[ge.scenario.id],Ze}),he(oe.filter((Ye,Ze)=>Ze!==H))},Cr=(H,ge)=>{const Ye=H+ge;if(Ye<0||Ye>=oe.length)return;const Ze=[...oe],[jt]=Ze.splice(H,1);Ze.splice(Ye,0,jt),he(Ze)},_r=H=>{const ge=oe[H];if(!ge||ge.kind!=="referenced")return;const Ye=cn(ge.ref);if(!Ye){Pe({title:"Referenced scenario not found",variant:"destructive"});return}const Ze=new Set(oe.filter(Gt=>Gt.kind==="inline").map(Gt=>Gt.scenario.name?.trim().toLowerCase()).filter(Boolean)),jt=`${(Ye.name||Ye.id).trim()}-custom`;let wt=jt,Nn=2;for(;Ze.has(wt.toLowerCase());)wt=`${jt}-${Nn}`,Nn+=1;const We=Date.now(),vn={...structuredClone(Ye),id:`scn-${We}`,name:wt,serverIds:[...Ye.serverIds]},Ln=[...oe];Ln[H]={kind:"inline",scenario:vn},he(Ln),ue(Gt=>({...Gt,[vn.id]:!0})),Pe({title:"Referenced scenario converted to inline",description:wt})},kn=H=>p.find(ge=>ge.id===H),xn=H=>y.find(ge=>ge.id===H),cn=H=>g.find(ge=>ge.id===H),Rn=Oe.filter(H=>H.kind==="referenced").map(H=>H.ref),le=Rn.map(kn).filter(H=>!!H),ke=xe.filter(H=>H.kind==="referenced").map(H=>H.ref),it=ke.map(xn).filter(H=>!!H);xe.filter(H=>H.kind==="inline");const vt=xe.flatMap(H=>{if(H.kind==="referenced"){const ge=xn(H.ref);return ge?[{agent:ge,origin:"referenced",ref:H.ref}]:[]}return[{agent:H.agent,origin:"inline",ref:void 0}]}),zt=oe.filter(H=>H.kind==="referenced").map(H=>H.ref),tn=oe.flatMap(H=>{if(H.kind==="referenced"){const ge=cn(H.ref);return ge?[{scenario:ge,origin:"referenced"}]:[]}return[{scenario:H.scenario,origin:"inline"}]}),Et=Array.from(new Map([...y,..._.agents,...it].map(H=>[H.name||H.id,H])).values()),mr=Array.from(new Map([...p,..._.servers??[],...le].map(H=>[H.name||H.id,H])).values()),Vt=Rn.filter(H=>!kn(H)),Ht=ke.filter(H=>!xn(H)),vr=zt.filter(H=>!cn(H));new Set(Vt);const ei=new Set(vr),Ca=xe.length,ti=oe.length;return v.useEffect(()=>{if(!F)return;y.some(ge=>ge.id===F)||M("")},[y,F]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(se,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(yt,{to:"/mcp-evaluations",children:s.jsx(xo,{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:S?"Create a new MCP evaluation":d?"Loading configuration...":x?x.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(_.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!j&&s.jsx(se,{size:"sm",onClick:()=>N(!0),children:"Edit"}),b&&!j&&x&&!hn&&s.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(yt,{to:`/run?configId=${encodeURIComponent(x.id)}`,children:[s.jsx(kl,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!j&&hn&&s.jsxs(Ke,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(Qp,{className:"mr-1 h-3 w-3"}),"Broken config"]}),j&&s.jsxs(s.Fragment,{children:[!S&&s.jsx(se,{variant:"outline",size:"sm",onClick:()=>{P(structuredClone(x)),N(!1)},children:"Cancel"}),s.jsxs(se,{size:"sm",onClick:()=>{je()},children:[s.jsx(M7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),hn&&!j&&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(Qp,{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})]}),(Vt.length>0||Ht.length>0||vr.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"}),Vt.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:Vt.join(", ")})]}),Ht.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:Ht.join(", ")})]}),vr.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:vr.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!hn&&(_.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(Qp,{className:"h-4 w-4"}),"Migration warnings"]}),_.loadWarnings?.map((H,ge)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:H},`${H}-${ge}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Ke,{variant:ie==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${Pt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(aE,{className:"h-3 w-3"}),ti," scenario",ti!==1?"s":""]})}),s.jsx(Ke,{variant:ie==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${Pt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(ha,{className:"h-3 w-3"}),Ca," agent",Ca!==1?"s":""]})})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${re||!S?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!re&&S&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Config ID"}),s.jsx(ht,{value:_.name,onChange:H=>ve({name:H.target.value}),disabled:re,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Name (optional)"}),s.jsx(ht,{value:_.configName||"",onChange:H=>ve({configName:H.target.value}),disabled:re,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Description"}),s.jsx(ht,{value:_.description||"",onChange:H=>ve({description:H.target.value}),disabled:re,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(Me,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(mm,{checked:_.snapshotEval?.enabled??!1,disabled:V,onCheckedChange:H=>{const ge=_.snapshotEval;Ne({enabled:H,mode:ge?.mode??"warn",baselineSnapshotId:ge?.baselineSnapshotId,baselineSourceRunId:ge?.baselineSourceRunId})}})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Drift mode"}),s.jsxs(sn,{value:_.snapshotEval?.mode??"warn",onValueChange:H=>{const ge=_.snapshotEval;Ne({enabled:ge?.enabled??!1,mode:H,baselineSnapshotId:ge?.baselineSnapshotId,baselineSourceRunId:ge?.baselineSourceRunId})},children:[s.jsx(Jt,{className:"h-8",children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"warn",children:"Warn"}),s.jsx(at,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{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:_.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),_.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(Me,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(ht,{value:k,onChange:H=>R(H.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),K===!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(Me,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(ht,{value:$,onChange:H=>z(H.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Switch baseline"}),s.jsxs(sn,{value:B||_.snapshotEval?.baselineSnapshotId||"",onValueChange:H=>{D(H),Ne({enabled:_.snapshotEval?.enabled??!0,mode:_.snapshotEval?.mode??"warn",baselineSnapshotId:H||void 0,baselineSourceRunId:_.snapshotEval?.baselineSourceRunId})},children:[s.jsx(Jt,{className:"h-8",children:s.jsx(on,{placeholder:"Select snapshot"})}),s.jsx(Zt,{children:A.map(H=>s.jsx(at,{value:H.id,children:H.name},H.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{tt()},disabled:Z||!k.trim()||K!==!0,children:Z?"Generating...":"Generate Baseline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Ne({enabled:_.snapshotEval?.enabled??!1,mode:_.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:V,children:"Clear Baseline"})]})]})]})}),s.jsxs(tC,{value:ie,onValueChange:H=>{if(H!=="servers"&&H!=="agents"&&H!=="scenarios")return;const ge=new URLSearchParams(r);if(ge.delete("tab"),a(ge,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${H}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${H}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(Uv,{children:[s.jsxs(Po,{value:"scenarios",className:"gap-1.5",children:[s.jsx(aE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(Po,{value:"agents",className:"gap-1.5",children:[s.jsx(ha,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(Wd,{value:"agents",children:[!re&&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(sn,{value:F,onValueChange:M,children:[s.jsx(Jt,{className:"h-8",children:s.jsx(on,{placeholder:"Select agent from library"})}),s.jsx(Zt,{children:we.map(H=>s.jsx(at,{value:H.id,children:H.label},H.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:$t,children:"Add Ref"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:Dt,children:"Import Inline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Rt,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[xe.map((H,ge)=>{const Ye=H.kind==="referenced"?xn(H.ref):null,Ze=H.kind==="inline"?H.agent.name?.trim()||H.agent.id:Ye?.name||H.ref,jt=H.kind==="inline"?H.agent.model:Ye?.model||"unknown",wt=H.kind==="inline"?H.agent.id:H.ref,Nn=H.kind==="referenced"&&!Ye,We=H.kind==="inline"?H.agent.id:H.ref,vn=me.includes(We),Ln=H.kind==="inline"&&!!ee[H.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(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>jn(ge,-1),disabled:ge===0,"aria-label":"Move agent up",children:s.jsx(is,{className:"h-3 w-3"})}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>jn(ge,1),disabled:ge===xe.length-1,"aria-label":"Move agent down",children:s.jsx(qt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:Ze}),s.jsx(Ke,{variant:H.kind==="inline"?"secondary":"outline",children:H.kind==="inline"?"Inline":"Referenced"}),s.jsx(Ke,{variant:"outline",className:"font-mono text-[10px]",children:jt}),vn&&s.jsx(Ke,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Nn&&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:vn,onChange:Gt=>Le(We,Gt.target.checked)}),s.jsx("span",{children:"Default"})]}),H.kind==="inline"&&s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>W(Gt=>({...Gt,[H.agent.id]:!Gt[H.agent.id]})),children:Ln?"Collapse":"Expand"}),H.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>or(ge),disabled:Nn,children:"Convert to inline"})}),s.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>mn(ge),"aria-label":"Remove agent entry",children:s.jsx(xa,{className:"h-3.5 w-3.5"})})]})]}),H.kind==="inline"&&Ln&&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(Me,{className:"text-xs",children:"Name"}),s.jsx(ht,{value:H.agent.name,onChange:Gt=>{const An=[...xe];An[ge]={kind:"inline",agent:{...H.agent,name:Gt.target.value}},Ie(An)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Provider"}),s.jsxs(sn,{value:H.agent.provider,onValueChange:Gt=>{const An=[...xe];An[ge]={kind:"inline",agent:{...H.agent,provider:Gt}},Ie(An)},children:[s.jsx(Jt,{children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"openai",children:"OpenAI"}),s.jsx(at,{value:"anthropic",children:"Anthropic"}),s.jsx(at,{value:"azure",children:"Azure OpenAI"}),s.jsx(at,{value:"google",children:"Google"}),s.jsx(at,{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(Me,{className:"text-xs",children:"Model"}),s.jsx(ht,{value:H.agent.model,onChange:Gt=>{const An=[...xe];An[ge]={kind:"inline",agent:{...H.agent,model:Gt.target.value}},Ie(An)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Max Tokens"}),s.jsx(ht,{type:"number",min:1,max:128e3,value:H.agent.maxTokens,onChange:Gt=>{const An=[...xe];An[ge]={kind:"inline",agent:{...H.agent,maxTokens:parseInt(Gt.target.value)||0}},Ie(An)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Temperature"}),s.jsx(ht,{type:"number",min:0,max:2,step:.01,value:H.agent.temperature,onChange:Gt=>{const An=[...xe];An[ge]={kind:"inline",agent:{...H.agent,temperature:Number(Gt.target.value)||0}},Ie(An)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"System Prompt"}),s.jsx(Ks,{value:H.agent.systemPrompt||"",onChange:Gt=>{const An=[...xe];An[ge]={kind:"inline",agent:{...H.agent,systemPrompt:Gt.target.value}},Ie(An)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ge}-${wt}`)}),xe.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),Ht.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",Ht.join(", ")]})]})}),re?s.jsx(ze,{children:s.jsx(Ue,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[vt.map((H,ge)=>{const Ye=H.agent.name||H.agent.id,Ze=me.includes(H.origin==="inline"?H.agent.id:H.ref||H.agent.id),jt=H.ref??H.agent.id,wt=!!J[jt];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:[ge+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:Ye})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[Ze&&s.jsx(Ke,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Ke,{variant:H.origin==="inline"?"secondary":"outline",children:H.origin==="inline"?"Inline":"Referenced"}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>ye(Nn=>({...Nn,[jt]:!Nn[jt]})),"aria-label":wt?"Collapse agent details":"Expand agent details",children:s.jsx(qt,{className:`h-4 w-4 transition-transform ${wt?"rotate-180":""}`})})]})]}),wt&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(aB,{provider:H.agent.provider}),s.jsx(Ke,{variant:"outline",className:"text-xs font-mono",children:H.agent.model}),s.jsxs(Ke,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",H.agent.maxTokens]}),s.jsxs(Ke,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",H.agent.temperature]})]})]},`agent-view-${ge}-${H.ref??H.agent.id}`)}),vt.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(Wd,{value:"scenarios",children:[!re&&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(sn,{value:L,onValueChange:Q,children:[s.jsx(Jt,{className:"h-8",children:s.jsx(on,{placeholder:"Select scenario from library"})}),s.jsx(Zt,{children:g.map(H=>s.jsx(at,{value:H.id,children:H.name||H.id},H.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!L,onClick:Dn,children:"Add Ref"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!L,onClick:lr,children:"Import Inline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Na,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[oe.map((H,ge)=>{const Ye=H.kind==="referenced"?cn(H.ref):null,Ze=H.kind==="inline"?H.scenario.name?.trim()||H.scenario.id:Ye?.name||H.ref,jt=H.kind==="inline"&&!H.scenario.name?.trim(),wt=H.kind==="referenced"&&ei.has(H.ref),Nn=H.kind==="inline"&&!!ae[H.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(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Cr(ge,-1),disabled:ge===0,"aria-label":"Move scenario up",children:s.jsx(is,{className:"h-3 w-3"})}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Cr(ge,1),disabled:ge===oe.length-1,"aria-label":"Move scenario down",children:s.jsx(qt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ge+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:Ze}),s.jsx(Ke,{variant:H.kind==="inline"?"secondary":"outline",children:H.kind==="inline"?"Inline":"Referenced"}),jt&&s.jsx(Ke,{variant:"destructive",children:"Name required"}),wt&&s.jsx(Ke,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[H.kind==="inline"&&s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>ue(We=>({...We,[H.scenario.id]:!We[H.scenario.id]})),"aria-label":Nn?"Collapse scenario details":"Expand scenario details",children:s.jsx(qt,{className:`h-3.5 w-3.5 transition-transform ${Nn?"rotate-180":""}`})}),H.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>_r(ge),disabled:wt,children:"Convert to inline"})}),s.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Dr(ge),"aria-label":"Remove scenario entry",children:s.jsx(xa,{className:"h-3.5 w-3.5"})})]})]}),H.kind==="inline"&&Nn&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(lj,{scenarios:[H.scenario],scenarioOrigins:["inline"],agents:[..._.agents,...it],servers:[..._.servers??[],...le],configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],snapshotEval:_.snapshotEval,onChange:We=>{const vn=We[0];if(!vn)return;const Ln=[...oe];Ln[ge]={kind:"inline",scenario:vn},he(Ln)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${ge}-${H.kind==="inline"?H.scenario.id:H.ref}`)}),oe.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),vr.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",vr.join(", ")]})]})}),re?s.jsx(ze,{children:s.jsx(Ue,{className:"pt-4",children:s.jsx(lj,{scenarios:tn.map(H=>H.scenario),scenarioOrigins:tn.map(H=>H.origin),agents:Et,servers:mr,configId:_.id,configPath:_.sourcePath,defaultAssistantAgentName:_.runDefaults?.selectedAgentNames?.[0],snapshotEval:_.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var eme=Symbol("radix.slottable");function tme(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=eme,t}var d8="AlertDialog",[nme]=ir(d8,[PD]),Zs=PD(),f8=e=>{const{__scopeAlertDialog:t,...n}=e,r=Zs(t);return s.jsx(Gm,{...r,...n,modal:!0})};f8.displayName=d8;var rme="AlertDialogTrigger",ame=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Zs(n);return s.jsx(UK,{...a,...r,ref:t})});ame.displayName=rme;var sme="AlertDialogPortal",p8=e=>{const{__scopeAlertDialog:t,...n}=e,r=Zs(t);return s.jsx(Ym,{...r,...n})};p8.displayName=sme;var ime="AlertDialogOverlay",h8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Zs(n);return s.jsx(Pc,{...a,...r,ref:t})});h8.displayName=ime;var Fl="AlertDialogContent",[ome,lme]=nme(Fl),cme=tme("AlertDialogContent"),m8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=Zs(n),o=v.useRef(null),c=ut(t,o),d=v.useRef(null);return s.jsx(LK,{contentName:Fl,titleName:v8,docsSlug:"alert-dialog",children:s.jsx(ome,{scope:n,cancelRef:d,children:s.jsxs(Oc,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Ae(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(cme,{children:r}),s.jsx(dme,{contentRef:o})]})})})});m8.displayName=Fl;var v8="AlertDialogTitle",g8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Zs(n);return s.jsx(Jd,{...a,...r,ref:t})});g8.displayName=v8;var y8="AlertDialogDescription",x8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Zs(n);return s.jsx(Zd,{...a,...r,ref:t})});x8.displayName=y8;var ume="AlertDialogAction",b8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Zs(n);return s.jsx(Xm,{...a,...r,ref:t})});b8.displayName=ume;var w8="AlertDialogCancel",S8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=lme(w8,n),i=Zs(n),o=ut(t,a);return s.jsx(Xm,{...i,...r,ref:o})});S8.displayName=w8;var dme=({contentRef:e})=>{const t=`\`${Fl}\` requires a description for the component to be accessible for screen reader users.
125
+
126
+ You can add a description to the \`${Fl}\` by passing a \`${y8}\` 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 \`${Fl}\`. 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},fme=f8,pme=p8,j8=h8,N8=m8,C8=b8,_8=S8,A8=g8,E8=x8;const bs=fme,hme=pme,P8=v.forwardRef(({className:e,...t},n)=>s.jsx(j8,{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}));P8.displayName=j8.displayName;const Va=v.forwardRef(({className:e,...t},n)=>s.jsxs(hme,{children:[s.jsx(P8,{}),s.jsx(N8,{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})]}));Va.displayName=N8.displayName;const Ha=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});Ha.displayName="AlertDialogHeader";const Ka=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ka.displayName="AlertDialogFooter";const Ga=v.forwardRef(({className:e,...t},n)=>s.jsx(A8,{ref:n,className:Se("text-lg font-semibold",e),...t}));Ga.displayName=A8.displayName;const Ya=v.forwardRef(({className:e,...t},n)=>s.jsx(E8,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Ya.displayName=E8.displayName;const Xa=v.forwardRef(({className:e,...t},n)=>s.jsx(C8,{ref:n,className:Se(zj(),e),...t}));Xa.displayName=C8.displayName;const Qa=v.forwardRef(({className:e,...t},n)=>s.jsx(_8,{ref:n,className:Se(zj({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Qa.displayName=_8.displayName;const mme=()=>{const{servers:e,setServers:t,reload:n,loading:r}=qa(),a=wa(),[i,o]=v.useState(null),c=p=>p.name?.trim()||p.id,d=async p=>{const y=`${c(p)}-copy`;let g=y,S=1;for(;e.some(x=>(x.name?.trim()||x.id)===g);)g=`${y}-${S}`,S+=1;const b={...structuredClone(p),id:`srv-${Date.now()}`,name:g};await t([...e,b]),Pe({title:"Server duplicated",description:`Created ${g}.`})},f=async p=>{await t(e.filter(y=>y.id!==p.id)),Pe({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(e$,{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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(us,{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(se,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(us,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{children:"Name"}),s.jsx(Qe,{children:"Transport"}),s.jsx(Qe,{children:"Endpoint"}),s.jsx(Qe,{children:"Auth"}),s.jsx(Qe,{className:"text-right",children:"Actions"})]})}),s.jsx(Jr,{children:e.map(p=>s.jsxs(Bt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(Be,{className:"font-medium",children:c(p)}),s.jsx(Be,{children:s.jsx(Ke,{variant:"secondary",className:"font-mono text-xs",children:p.transport})}),s.jsx(Be,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h(p)})}),s.jsx(Be,{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(Be,{className:"text-right",onClick:y=>y.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(p),children:[s.jsx(xa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{d(p)},children:[s.jsx(Ri,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(_m,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},p.id))})]})})}),s.jsx(bs,{open:!!i,onOpenChange:p=>!p&&o(null),children:s.jsxs(Va,{children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:"Delete server?"}),s.jsxs(Ya,{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(Ka,{children:[s.jsx(Qa,{children:"Cancel"}),s.jsx(Xa,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&f(i)},children:"Delete Server"})]})]})})]})},tM={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"},vme=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"}),gme=()=>{const{serverId:e}=Mo(),t=wa(),{servers:n,setServers:r}=qa(),{source:a}=On(),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??vme()),[p,y]=v.useState(!1),[g,S]=v.useState(!1),[b,x]=v.useState({status:"idle"}),[j,N]=v.useState(!1);v.useEffect(()=>{c&&h(c)},[c]);const _=R=>{h($=>({...$,authType:R,...R!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:$.oauthRedirectUrl||"http://localhost:6274/oauth/"}}))},P=async()=>{N(!0),x({status:"loading"});try{const $=(await a.discoverToolsForAnalysis({serverNames:[d(f)]})).servers[0];$&&$.warnings.length===0?x({status:"success",toolNames:$.tools.map(z=>z.name),toolCount:$.tools.length,testedAt:new Date().toISOString()}):x({status:"error",message:$?.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()})}},A=async()=>{if(!f.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}S(!0);try{if(i)await r([...n,f]),Pe({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(f.id)}`);else{const R=n.map($=>$.id===c?.id?f:$);await r(R),Pe({title:"Server saved"}),f.id!==o&&t(`/libraries/servers/${encodeURIComponent(f.id)}`,{replace:!0})}}finally{S(!1)}},O=async()=>{const R=n.filter($=>$.id!==c?.id);await r(R),Pe({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(xo,{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(xo,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(se,{type:"button",onClick:()=>{P()},children:[s.jsx(c$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),j&&s.jsxs(ze,{children:[s.jsxs(Ct,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(_t,{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(Ti,{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()})]})]}),b.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(sr,{className:"h-4 w-4 animate-spin"}),"Connecting to MCP server…"]}),b.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 ",b.toolCount," tool",b.toolCount!==1?"s":""]}),b.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:b.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(b.testedAt).toLocaleString()]})]}),b.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"})," — ",b.message]}),tM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",tM[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),s.jsxs(ze,{children:[s.jsx(Ct,{children:s.jsx(_t,{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(Me,{children:"Name"}),s.jsx(ht,{value:f.name,onChange:R=>h($=>({...$,name:R.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"Transport"}),s.jsxs(sn,{value:f.transport,onValueChange:R=>h($=>({...$,transport:R})),children:[s.jsx(Jt,{children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"stdio",children:"stdio"}),s.jsx(at,{value:"sse",children:"SSE"}),s.jsx(at,{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(Me,{children:"Command"}),s.jsx(ht,{value:f.command||"",onChange:R=>h($=>({...$,command:R.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"Args (comma-separated)"}),s.jsx(ht,{value:(f.args||[]).join(", "),onChange:R=>h($=>({...$,args:R.target.value.split(",").map(z=>z.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"URL"}),s.jsx(ht,{value:f.url||"",onChange:R=>h($=>({...$,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(Me,{children:"Auth Type"}),s.jsxs(sn,{value:f.authType||"none",onValueChange:R=>_(R),children:[s.jsx(Jt,{children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"none",children:"None"}),s.jsx(at,{value:"bearer",children:"Bearer Token"}),s.jsx(at,{value:"api-key",children:"API Key"}),s.jsx(at,{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(Me,{children:f.authType==="bearer"?"Token":"API Key"}),s.jsx(ht,{type:"password",value:f.authValue||"",onChange:R=>h($=>({...$,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(Me,{className:"text-xs",children:"Client ID"}),s.jsx(ht,{value:f.oauthClientId||"",onChange:R=>h($=>({...$,oauthClientId:R.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(ht,{type:"password",value:f.oauthClientSecret||"",onChange:R=>h($=>({...$,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(Me,{className:"text-xs",children:"Redirect URL"}),s.jsx(ht,{value:f.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:R=>h($=>({...$,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(Me,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(ht,{value:f.oauthScope||"",onChange:R=>h($=>({...$,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(se,{type:"button",variant:"destructive",size:"sm",onClick:()=>y(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>{A()},disabled:g,children:[g&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(bs,{open:p,onOpenChange:y,children:s.jsxs(Va,{children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:"Delete server?"}),s.jsxs(Ya,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(Ka,{children:[s.jsx(Qa,{children:"Cancel"}),s.jsx(Xa,{onClick:()=>{O()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},yme=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=qa(),a=wa(),[i,o]=v.useState(null),c=async f=>{const h=`${f.name}-copy`;let p=h,y=1;for(;e.some(S=>S.name===p);)p=`${h}-${y}`,y+=1;const g={...structuredClone(f),id:`agt-${Date.now()}`,name:p};await t([...e,g]),Pe({title:"Agent duplicated",description:`Created ${p}.`})},d=async f=>{await t(e.filter(h=>h.id!==f.id)),Pe({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(ha,{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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(us,{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(se,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(us,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{children:"Name"}),s.jsx(Qe,{children:"Provider"}),s.jsx(Qe,{children:"Model"}),s.jsx(Qe,{children:"Max Tokens"}),s.jsx(Qe,{children:"Temperature"}),s.jsx(Qe,{className:"text-right",children:"Actions"})]})}),s.jsx(Jr,{children:e.map(f=>s.jsxs(Bt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(Be,{className:"font-medium",children:f.name}),s.jsx(Be,{children:s.jsx(aB,{provider:f.provider})}),s.jsx(Be,{children:s.jsx("span",{className:"font-mono text-xs",children:f.model})}),s.jsx(Be,{className:"font-mono text-xs",children:f.maxTokens}),s.jsx(Be,{className:"font-mono text-xs",children:f.temperature.toFixed(2)}),s.jsx(Be,{className:"text-right",onClick:h=>h.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(f),children:[s.jsx(xa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{c(f)},children:[s.jsx(Ri,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(_m,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},f.id))})]})})}),s.jsx(bs,{open:!!i,onOpenChange:f=>!f&&o(null),children:s.jsxs(Va,{children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:"Delete agent?"}),s.jsxs(Ya,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(Ka,{children:[s.jsx(Qa,{children:"Cancel"}),s.jsx(Xa,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&d(i)},children:"Delete Agent"})]})]})})]})};var O8=["PageUp","PageDown"],k8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],R8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Uc="Slider",[cj,xme,bme]=Hd(Uc),[T8]=ir(Uc,[bme]),[wme,Yv]=T8(Uc),I8=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:y=()=>{},inverted:g=!1,form:S,...b}=e,x=v.useRef(new Set),j=v.useRef(0),_=o==="horizontal"?Sme:jme,[P=[],A]=na({prop:h,defaultProp:f,onChange:B=>{[...x.current][j.current]?.focus(),p(B)}}),O=v.useRef(P);function k(B){const D=Eme(P,B);z(B,D)}function R(B){z(B,j.current)}function $(){const B=O.current[j.current];P[j.current]!==B&&y(P)}function z(B,D,{commit:K}={commit:!1}){const U=Rme(i),V=Tme(Math.round((B-r)/i)*i+r,U),X=Vd(V,[r,a]);A((Z=[])=>{const T=_me(Z,X,D);if(kme(T,d*i)){j.current=T.indexOf(X);const L=String(T)!==String(Z);return L&&K&&y(T),L?T:Z}else return Z})}return s.jsx(wme,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:j,thumbs:x.current,values:P,orientation:o,form:S,children:s.jsx(cj.Provider,{scope:e.__scopeSlider,children:s.jsx(cj.Slot,{scope:e.__scopeSlider,children:s.jsx(_,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Ae(b.onPointerDown,()=>{c||(O.current=P)}),min:r,max:a,inverted:g,onSlideStart:c?void 0:k,onSlideMove:c?void 0:R,onSlideEnd:c?void 0:$,onHomeKeyDown:()=>!c&&z(r,0,{commit:!0}),onEndKeyDown:()=>!c&&z(a,P.length-1,{commit:!0}),onStepKeyDown:({event:B,direction:D})=>{if(!c){const V=O8.includes(B.key)||B.shiftKey&&k8.includes(B.key)?10:1,X=j.current,Z=P[X],T=i*V*D;z(Z+T,X,{commit:!0})}}})})})})});I8.displayName=Uc;var[M8,$8]=T8(Uc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Sme=v.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,y]=v.useState(null),g=ut(t,_=>y(_)),S=v.useRef(void 0),b=Lc(a),x=b==="ltr",j=x&&!i||!x&&i;function N(_){const P=S.current||p.getBoundingClientRect(),A=[0,P.width],k=uC(A,j?[n,r]:[r,n]);return S.current=P,k(_-P.left)}return s.jsx(M8,{scope:e.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:s.jsx(D8,{dir:b,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:_=>{const P=N(_.clientX);o?.(P)},onSlideMove:_=>{const P=N(_.clientX);c?.(P)},onSlideEnd:()=>{S.current=void 0,d?.()},onStepKeyDown:_=>{const A=R8[j?"from-left":"from-right"].includes(_.key);f?.({event:_,direction:A?-1:1})}})})}),jme=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=ut(t,h),y=v.useRef(void 0),g=!a;function S(b){const x=y.current||h.current.getBoundingClientRect(),j=[0,x.height],_=uC(j,g?[r,n]:[n,r]);return y.current=x,_(b-x.top)}return s.jsx(M8,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:s.jsx(D8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const x=S(b.clientY);i?.(x)},onSlideMove:b=>{const x=S(b.clientY);o?.(x)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:b=>{const j=R8[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:j?-1:1})}})})}),D8=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=Yv(Uc,n);return s.jsx(De.span,{...f,ref:t,onKeyDown:Ae(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):O8.concat(k8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Ae(e.onPointerDown,p=>{const y=p.target;y.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(y)?y.focus():r(p)}),onPointerMove:Ae(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Ae(e.onPointerUp,p=>{const y=p.target;y.hasPointerCapture(p.pointerId)&&(y.releasePointerCapture(p.pointerId),i(p))})})}),L8="SliderTrack",F8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Yv(L8,n);return s.jsx(De.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});F8.displayName=L8;var uj="SliderRange",B8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=Yv(uj,n),i=$8(uj,n),o=v.useRef(null),c=ut(t,o),d=a.values.length,f=a.values.map(y=>q8(y,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(De.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});B8.displayName=uj;var dj="SliderThumb",z8=v.forwardRef((e,t)=>{const n=xme(e.__scopeSlider),[r,a]=v.useState(null),i=ut(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Nme,{...e,ref:i,index:o})}),Nme=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=Yv(dj,n),c=$8(dj,n),[d,f]=v.useState(null),h=ut(t,N=>f(N)),p=d?o.form||!!d.closest("form"):!0,y=km(d),g=o.values[r],S=g===void 0?0:q8(g,o.min,o.max),b=Ame(r,o.values.length),x=y?.[c.size],j=x?Pme(x,S,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(${S}% + ${j}px)`},children:[s.jsx(cj.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(De.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":o.min,"aria-valuenow":g,"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:g===void 0?{display:"none"}:e.style,onFocus:Ae(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(U8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});z8.displayName=dj;var Cme="RadioBubbleInput",U8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=ut(a,r),o=Fv(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(De.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});U8.displayName=Cme;function _me(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function q8(e,t,n){const i=100/(n-t)*(e-t);return Vd(i,[0,100])}function Ame(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Eme(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 Pme(e,t,n){const r=e/2,i=uC([0,50],[0,r]);return(r-i(t)*n)*n}function Ome(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function kme(e,t){if(t>0){const n=Ome(e);return Math.min(...n)>=t}return!0}function uC(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 Rme(e){return(String(e).split(".")[1]||"").length}function Tme(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var W8=I8,Ime=F8,Mme=B8,$me=z8;const V8=v.forwardRef(({className:e,...t},n)=>s.jsxs(W8,{ref:n,className:Se("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Ime,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Mme,{className:"absolute h-full bg-primary"})}),s.jsx($me,{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"})]}));V8.displayName=W8.displayName;function Dme(e){const t=Lme(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Bme);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 Lme(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Ume(a),c=zme(i,a.props);return a.type!==v.Fragment&&(c.ref=r?jr(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 Fme=Symbol("radix.slottable");function Bme(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fme}function zme(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 Ume(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 Xv="Popover",[H8]=ir(Xv,[Di]),vf=Di(),[qme,Vi]=H8(Xv),K8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=vf(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,y]=na({prop:r,defaultProp:a??!1,onChange:i,caller:Xv});return s.jsx(Rm,{...c,children:s.jsx(qme,{scope:t,contentId:Hn(),triggerRef:d,open:p,onOpenChange:y,onOpenToggle:v.useCallback(()=>y(g=>!g),[y]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:o,children:n})})};K8.displayName=Xv;var G8="PopoverAnchor",Wme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Vi(G8,n),i=vf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(Yd,{...i,...r,ref:t})});Wme.displayName=G8;var Y8="PopoverTrigger",X8=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Vi(Y8,n),i=vf(n),o=ut(t,a.triggerRef),c=s.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":tz(a.open),...r,ref:o,onClick:Ae(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(Yd,{asChild:!0,...i,children:c})});X8.displayName=Y8;var dC="PopoverPortal",[Vme,Hme]=H8(dC,{forceMount:void 0}),Q8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Vi(dC,t);return s.jsx(Vme,{scope:t,forceMount:n,children:s.jsx(Gn,{present:n||i.open,children:s.jsx(Sc,{asChild:!0,container:a,children:r})})})};Q8.displayName=dC;var bc="PopoverContent",J8=v.forwardRef((e,t)=>{const n=Hme(bc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Vi(bc,e.__scopePopover);return s.jsx(Gn,{present:r||i.open,children:i.modal?s.jsx(Gme,{...a,ref:t}):s.jsx(Yme,{...a,ref:t})})});J8.displayName=bc;var Kme=Dme("PopoverContent.RemoveScroll"),Gme=v.forwardRef((e,t)=>{const n=Vi(bc,e.__scopePopover),r=v.useRef(null),a=ut(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return Hm(o)},[]),s.jsx(Qd,{as:Kme,allowPinchZoom:!0,children:s.jsx(Z8,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ae(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:Ae(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Yme=v.forwardRef((e,t)=>{const n=Vi(bc,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(Z8,{...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()}})}),Z8=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,y=Vi(bc,n),g=vf(n);return Wm(),s.jsx(Xd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(To,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>y.onOpenChange(!1),children:s.jsx(Tm,{"data-state":tz(y.open),role:"dialog",id:y.contentId,...g,...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)"}})})})}),ez="PopoverClose",Xme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Vi(ez,n);return s.jsx(De.button,{type:"button",...r,ref:t,onClick:Ae(e.onClick,()=>a.onOpenChange(!1))})});Xme.displayName=ez;var Qme="PopoverArrow",Jme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=vf(n);return s.jsx(Im,{...a,...r,ref:t})});Jme.displayName=Qme;function tz(e){return e?"open":"closed"}var Zme=K8,eve=X8,tve=Q8,nz=J8;const nve=Zme,rve=eve,rz=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(tve,{children:s.jsx(nz,{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})}));rz.displayName=nz.displayName;var nM=1,ave=.9,sve=.8,ive=.17,r1=.1,a1=.999,ove=.9999,lve=.99,cve=/[\\\/_+.#"@\[\(\{&]/,uve=/[\\\/_+.#"@\[\(\{&]/g,dve=/[\s-]/,az=/[\s-]/g;function fj(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?nM:lve;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,y,g,S;f>=0;)p=fj(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=nM:cve.test(e.charAt(f-1))?(p*=sve,g=e.slice(a,f-1).match(uve),g&&a>0&&(p*=Math.pow(a1,g.length))):dve.test(e.charAt(f-1))?(p*=ave,S=e.slice(a,f-1).match(az),S&&a>0&&(p*=Math.pow(a1,S.length))):(p*=ive,a>0&&(p*=Math.pow(a1,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=ove)),(p<r1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(y=fj(e,t,n,r,f+1,i+2,o),y*r1>p&&(p=y*r1)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function rM(e){return e.toLowerCase().replace(az," ")}function fve(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,fj(e,t,rM(e),rM(t),0,0,{})}var Du='[cmdk-group=""]',s1='[cmdk-group-items=""]',pve='[cmdk-group-heading=""]',sz='[cmdk-item=""]',aM=`${sz}:not([aria-disabled="true"])`,pj="cmdk-item-select",Sl="data-value",hve=(e,t,n)=>fve(e,t,n),iz=v.createContext(void 0),gf=()=>v.useContext(iz),oz=v.createContext(void 0),fC=()=>v.useContext(oz),lz=v.createContext(void 0),cz=v.forwardRef((e,t)=>{let n=jl(()=>{var M,ee;return{search:"",value:(ee=(M=e.value)!=null?M:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=jl(()=>new Set),a=jl(()=>new Map),i=jl(()=>new Map),o=jl(()=>new Set),c=uz(e),{label:d,children:f,value:h,onValueChange:p,filter:y,shouldFilter:g,loop:S,disablePointerSelection:b=!1,vimBindings:x=!0,...j}=e,N=Hn(),_=Hn(),P=Hn(),A=v.useRef(null),O=Cve();Ro(()=>{if(h!==void 0){let M=h.trim();n.current.value=M,k.emit()}},[h]),Ro(()=>{O(6,K)},[]);let k=v.useMemo(()=>({subscribe:M=>(o.current.add(M),()=>o.current.delete(M)),snapshot:()=>n.current,setState:(M,ee,W)=>{var J,ye,ae,ue;if(!Object.is(n.current[M],ee)){if(n.current[M]=ee,M==="search")D(),z(),O(1,B);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ie=document.getElementById(P);ie?ie.focus():(J=document.getElementById(N))==null||J.focus()}if(O(7,()=>{var ie;n.current.selectedItemId=(ie=U())==null?void 0:ie.id,k.emit()}),W||O(5,K),((ye=c.current)==null?void 0:ye.value)!==void 0){let ie=ee??"";(ue=(ae=c.current).onValueChange)==null||ue.call(ae,ie);return}}k.emit()}},emit:()=>{o.current.forEach(M=>M())}}),[]),R=v.useMemo(()=>({value:(M,ee,W)=>{var J;ee!==((J=i.current.get(M))==null?void 0:J.value)&&(i.current.set(M,{value:ee,keywords:W}),n.current.filtered.items.set(M,$(ee,W)),O(2,()=>{z(),k.emit()}))},item:(M,ee)=>(r.current.add(M),ee&&(a.current.has(ee)?a.current.get(ee).add(M):a.current.set(ee,new Set([M]))),O(3,()=>{D(),z(),n.current.value||B(),k.emit()}),()=>{i.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let W=U();O(4,()=>{D(),W?.getAttribute("id")===M&&B(),k.emit()})}),group:M=>(a.current.has(M)||a.current.set(M,new Set),()=>{i.current.delete(M),a.current.delete(M)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:P,labelId:_,listInnerRef:A}),[]);function $(M,ee){var W,J;let ye=(J=(W=c.current)==null?void 0:W.filter)!=null?J:hve;return M?ye(M,n.current.search,ee):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let M=n.current.filtered.items,ee=[];n.current.filtered.groups.forEach(J=>{let ye=a.current.get(J),ae=0;ye.forEach(ue=>{let ie=M.get(ue);ae=Math.max(ie,ae)}),ee.push([J,ae])});let W=A.current;V().sort((J,ye)=>{var ae,ue;let ie=J.getAttribute("id"),ve=ye.getAttribute("id");return((ae=M.get(ve))!=null?ae:0)-((ue=M.get(ie))!=null?ue:0)}).forEach(J=>{let ye=J.closest(s1);ye?ye.appendChild(J.parentElement===ye?J:J.closest(`${s1} > *`)):W.appendChild(J.parentElement===W?J:J.closest(`${s1} > *`))}),ee.sort((J,ye)=>ye[1]-J[1]).forEach(J=>{var ye;let ae=(ye=A.current)==null?void 0:ye.querySelector(`${Du}[${Sl}="${encodeURIComponent(J[0])}"]`);ae?.parentElement.appendChild(ae)})}function B(){let M=V().find(W=>W.getAttribute("aria-disabled")!=="true"),ee=M?.getAttribute(Sl);k.setState("value",ee||void 0)}function D(){var M,ee,W,J;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ye=0;for(let ae of r.current){let ue=(ee=(M=i.current.get(ae))==null?void 0:M.value)!=null?ee:"",ie=(J=(W=i.current.get(ae))==null?void 0:W.keywords)!=null?J:[],ve=$(ue,ie);n.current.filtered.items.set(ae,ve),ve>0&&ye++}for(let[ae,ue]of a.current)for(let ie of ue)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ye}function K(){var M,ee,W;let J=U();J&&(((M=J.parentElement)==null?void 0:M.firstChild)===J&&((W=(ee=J.closest(Du))==null?void 0:ee.querySelector(pve))==null||W.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function U(){var M;return(M=A.current)==null?void 0:M.querySelector(`${sz}[aria-selected="true"]`)}function V(){var M;return Array.from(((M=A.current)==null?void 0:M.querySelectorAll(aM))||[])}function X(M){let ee=V()[M];ee&&k.setState("value",ee.getAttribute(Sl))}function Z(M){var ee;let W=U(),J=V(),ye=J.findIndex(ue=>ue===W),ae=J[ye+M];(ee=c.current)!=null&&ee.loop&&(ae=ye+M<0?J[J.length-1]:ye+M===J.length?J[0]:J[ye+M]),ae&&k.setState("value",ae.getAttribute(Sl))}function T(M){let ee=U(),W=ee?.closest(Du),J;for(;W&&!J;)W=M>0?jve(W,Du):Nve(W,Du),J=W?.querySelector(aM);J?k.setState("value",J.getAttribute(Sl)):Z(M)}let L=()=>X(V().length-1),Q=M=>{M.preventDefault(),M.metaKey?L():M.altKey?T(1):Z(1)},F=M=>{M.preventDefault(),M.metaKey?X(0):M.altKey?T(-1):Z(-1)};return v.createElement(De.div,{ref:t,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:M=>{var ee;(ee=j.onKeyDown)==null||ee.call(j,M);let W=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||W))switch(M.key){case"n":case"j":{x&&M.ctrlKey&&Q(M);break}case"ArrowDown":{Q(M);break}case"p":case"k":{x&&M.ctrlKey&&F(M);break}case"ArrowUp":{F(M);break}case"Home":{M.preventDefault(),X(0);break}case"End":{M.preventDefault(),L();break}case"Enter":{M.preventDefault();let J=U();if(J){let ye=new Event(pj);J.dispatchEvent(ye)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Ave},d),Qv(e,M=>v.createElement(oz.Provider,{value:k},v.createElement(iz.Provider,{value:R},M))))}),mve=v.forwardRef((e,t)=>{var n,r;let a=Hn(),i=v.useRef(null),o=v.useContext(lz),c=gf(),d=uz(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Ro(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=dz(a,i,[e.value,e.children,i],e.keywords),p=fC(),y=$i(O=>O.value&&O.value===h.current),g=$i(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(pj,S),()=>O.removeEventListener(pj,S)},[g,e.onSelect,e.disabled]);function S(){var O,k;b(),(k=(O=d.current).onSelect)==null||k.call(O,h.current)}function b(){p.setState("value",h.current,!0)}if(!g)return null;let{disabled:x,value:j,onSelect:N,forceMount:_,keywords:P,...A}=e;return v.createElement(De.div,{ref:jr(i,t),...A,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!y,"data-disabled":!!x,"data-selected":!!y,onPointerMove:x||c.getDisablePointerSelection()?void 0:b,onClick:x?void 0:S},e.children)}),vve=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=Hn(),c=v.useRef(null),d=v.useRef(null),f=Hn(),h=gf(),p=$i(g=>a||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);Ro(()=>h.group(o),[]),dz(o,c,[e.value,e.heading,d]);let y=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(De.div,{ref:jr(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),Qv(e,g=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(lz.Provider,{value:y},g))))}),gve=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=$i(o=>!o.search);return!n&&!i?null:v.createElement(De.div,{ref:jr(a,t),...r,"cmdk-separator":"",role:"separator"})}),yve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=fC(),o=$i(f=>f.search),c=$i(f=>f.selectedItemId),d=gf();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.createElement(De.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)}})}),xve=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=$i(f=>f.selectedItemId),d=gf();return v.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let g=f.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return y.observe(f),()=>{cancelAnimationFrame(p),y.unobserve(f)}}},[]),v.createElement(De.div,{ref:jr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Qv(e,f=>v.createElement("div",{ref:jr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),bve=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(Gm,{open:n,onOpenChange:r},v.createElement(Ym,{container:o},v.createElement(Pc,{"cmdk-overlay":"",className:a}),v.createElement(Oc,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement(cz,{ref:t,...c}))))}),wve=v.forwardRef((e,t)=>$i(n=>n.filtered.count===0)?v.createElement(De.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Sve=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(De.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Qv(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),$r=Object.assign(cz,{List:xve,Item:mve,Input:yve,Group:vve,Separator:gve,Dialog:bve,Empty:wve,Loading:Sve});function jve(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nve(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function uz(e){let t=v.useRef(e);return Ro(()=>{t.current=e}),t}var Ro=typeof window>"u"?v.useEffect:v.useLayoutEffect;function jl(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function $i(e){let t=fC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function dz(e,t,n,r=[]){let a=v.useRef(),i=gf();return Ro(()=>{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(Sl,c),a.current=c}),a}var Cve=()=>{let[e,t]=v.useState(),n=jl(()=>new Map);return Ro(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function _ve(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Qv({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(_ve(t),{ref:t.ref},n(t.props.children)):n(t)}var Ave={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const fz=v.forwardRef(({className:e,...t},n)=>s.jsx($r,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));fz.displayName=$r.displayName;const pz=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(Sj,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx($r.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})]}));pz.displayName=$r.Input.displayName;const hz=v.forwardRef(({className:e,...t},n)=>s.jsx($r.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));hz.displayName=$r.List.displayName;const mz=v.forwardRef((e,t)=>s.jsx($r.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));mz.displayName=$r.Empty.displayName;const vz=v.forwardRef(({className:e,...t},n)=>s.jsx($r.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}));vz.displayName=$r.Group.displayName;const Eve=v.forwardRef(({className:e,...t},n)=>s.jsx($r.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",e),...t}));Eve.displayName=$r.Separator.displayName;const hj=v.forwardRef(({className:e,...t},n)=>s.jsx($r.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}));hj.displayName=$r.Item.displayName;const sM={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:[]},iM={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"},Pve=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Ove=()=>{const{agentName:e}=Mo(),t=wa(),{agents:n,setAgents:r}=qa(),{source:a}=On(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(T=>T.id===o)??n.find(T=>T.name===o),[d,f]=v.useState(()=>c??Pve()),[h,p]=v.useState(!1),[y,g]=v.useState(!1),[S,b]=v.useState({status:"idle"}),[x,j]=v.useState(!1),[N,_]=v.useState([]),[P,A]=v.useState(!1),[O,k]=v.useState(!1),[R,$]=v.useState(!1);v.useEffect(()=>{c&&f(c)},[c]);const z=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",B=Array.from(new Set([...sM[d.provider]||[],...N])),D=B.includes(d.model),K=R||!!d.model&&!D,U=async()=>{if(j(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const T=await a.listProviderModels(d.provider);b({status:"success",items:T.items,source:T.source,kind:T.kind,testedAt:new Date().toISOString()})}catch(T){b({status:"error",message:T instanceof Error?T.message:String(T),testedAt:new Date().toISOString()})}},V=async()=>{if(!z){Pe({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}A(!0);try{const T=await a.listProviderModels(d.provider);_(T.items),Pe({title:T.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${T.items.length} ${T.kind} from ${T.source}`})}catch(T){Pe({title:"Could not load provider models",description:String(T instanceof Error?T.message:T),variant:"destructive"})}finally{A(!1)}},X=async()=>{if(!d.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}g(!0);try{if(i)await r([...n,d]),Pe({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const T=n.map(L=>L.id===c?.id?d:L);await r(T),Pe({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},Z=async()=>{const T=n.filter(L=>L.id!==c?.id);await r(T),Pe({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(xo,{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(xo,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(se,{type:"button",onClick:()=>{U()},children:[s.jsx(c$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),x&&s.jsxs(ze,{children:[s.jsxs(Ct,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(_t,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>j(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Ti,{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]})]}),S.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(sr,{className:"h-4 w-4 animate-spin"}),"Testing connection..."]}),S.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 ",S.items.length," ",S.kind," from"," ",S.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 ",S.kind,":"]}),s.jsx("ul",{className:"space-y-0.5",children:S.items.slice(0,5).map(T=>s.jsx("li",{className:"font-mono text-xs",children:T},T))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(S.testedAt).toLocaleString()]})]}),S.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"})," —"," ",S.message]}),iM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",iM[d.provider]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(S.testedAt).toLocaleString()]})]}),S.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(Ct,{children:s.jsx(_t,{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(Me,{children:"Name"}),s.jsx(ht,{value:d.name,onChange:T=>f(L=>({...L,name:T.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"Provider"}),s.jsxs(sn,{value:d.provider,onValueChange:T=>f(L=>({...L,provider:T,model:sM[T]?.[0]||""})),children:[s.jsx(Jt,{children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"openai",children:"OpenAI"}),s.jsx(at,{value:"anthropic",children:"Anthropic"}),s.jsx(at,{value:"azure",children:"Azure OpenAI"}),s.jsx(at,{value:"google",children:"Google"}),s.jsx(at,{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(Me,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(nve,{open:O,onOpenChange:k,children:[s.jsx(rve,{asChild:!0,children:s.jsxs(se,{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(qt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(rz,{className:"w-[420px] p-0",align:"start",children:s.jsxs(fz,{children:[s.jsx(pz,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(hz,{children:[s.jsxs(mz,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(vz,{heading:d.provider==="azure"?"Deployments":"Models",children:[B.map(T=>s.jsxs(hj,{value:T,onSelect:L=>{f(Q=>({...Q,model:L})),$(!1),k(!1)},children:[s.jsx(ql,{className:Se("mr-2 h-4 w-4",d.model===T?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:T})]},T)),s.jsx(hj,{value:"__custom_model_id__",onSelect:()=>{$(!0),k(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),z&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{V()},disabled:P,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[P?s.jsx(sr,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(Fa,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),K&&s.jsx(ht,{value:d.model,onChange:T=>f(L=>({...L,model:T.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(Me,{children:"Max Tokens"}),s.jsx(ht,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:T=>f(L=>({...L,maxTokens:parseInt(T.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(Me,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(V8,{value:[d.temperature],onValueChange:([T])=>f(L=>({...L,temperature:T})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{children:"System Prompt"}),s.jsx(Ks,{value:d.systemPrompt||"",onChange:T=>f(L=>({...L,systemPrompt:T.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(se,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>{X()},disabled:y,children:[y&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(bs,{open:h,onOpenChange:p,children:s.jsxs(Va,{children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:"Delete agent?"}),s.jsxs(Ya,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(Ka,{children:[s.jsx(Qa,{children:"Cancel"}),s.jsx(Xa,{onClick:()=>{Z()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},oM="mcplab.resultAssistantScenarioHandoff",lM=()=>{const{testCaseId:e}=Mo(),[t,n]=Ec(),r=wa(),{source:a}=On(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=qa(),[p,y]=v.useState(""),[g,S]=v.useState("all"),[b,x]=v.useState("name"),[j,N]=v.useState("asc"),[_,P]=v.useState(""),[A,O]=v.useState(null),[k,R]=v.useState("idle"),[$,z]=v.useState(""),[B,D]=v.useState(""),[K,U]=v.useState(0),[V,X]=v.useState(null),Z=v.useRef(null),T=v.useRef(!1),L=v.useRef(!1),Q=v.useRef(null),F=v.useRef(0),M=e?decodeURIComponent(e):void 0,ee=M?i.findIndex(re=>re.id===M):-1,W=ee>=0?i[ee]:void 0,J=async re=>{if(!W||ee<0||!re)return;const me=[...i];me[ee]=re,await o(me)},ye=async()=>{const re=Q.current;if(!re||!W)return;if(T.current){L.current=!0;return}T.current=!0,L.current=!1;const me=++F.current;R("saving"),z("");try{await J(re),me===F.current&&R("saved")}catch(Ne){const tt=Ne instanceof Error?Ne.message:String(Ne);me===F.current&&(R("error"),z(tt)),Pe({title:"Could not save scenario",description:tt,variant:"destructive"})}finally{T.current=!1,L.current&&(L.current=!1,ye())}},ae=re=>{Q.current=re,R("dirty"),z(""),Z.current&&window.clearTimeout(Z.current),Z.current=window.setTimeout(()=>{Z.current=null,ye()},700)},ue=async()=>{const re=`scn-${Date.now()}`;let me=re,Ne=1;for(;i.some(je=>je.id===me);)me=`${re}-${Ne}`,Ne+=1;const tt={id:me,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,tt]),r(`/libraries/test-cases/${encodeURIComponent(me)}`),Pe({title:"Test case created",description:`Opened ${me} for editing.`})},ie=re=>{const me=(re||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let Ne=me,tt=1;for(;i.some(je=>je.id===Ne);)Ne=`${me}-${tt}`,tt+=1;return Ne},ve=async(re,me=!1)=>{const Ne=ie(`${re.id}-copy`),tt={...structuredClone(re),id:Ne,name:re.name?`${re.name} (Copy)`:""};await o([...i,tt]),Pe({title:"Test case duplicated",description:`Created ${tt.id}.`}),me&&r(`/libraries/test-cases/${encodeURIComponent(tt.id)}`)},Oe=async re=>{Z.current&&(window.clearTimeout(Z.current),Z.current=null);const me=i.filter(Ne=>Ne.id!==re.id);await o(me),Pe({title:"Test case deleted",description:`${re.id} was removed.`}),W?.id===re.id&&(O(null),Q.current=null,R("idle"),z(""),r("/libraries/test-cases"))},oe=re=>re.map(me=>d.find(Ne=>Ne.id===me)).filter(Boolean).map(me=>me?.name||me?.id).filter(Boolean),he=v.useMemo(()=>{const re=new Set;for(const me of i)for(const Ne of oe(me.serverIds))re.add(Ne);return Array.from(re).sort((me,Ne)=>me.localeCompare(Ne))},[i,d]),xe=v.useMemo(()=>{const re=p.trim().toLowerCase(),me=i.filter(Ne=>{const tt=(Ne.name||"").toLowerCase(),je=Ne.id.toLowerCase(),et=(Ne.prompt||"").toLowerCase(),dt=oe(Ne.serverIds);return g!=="all"&&!dt.includes(g)?!1:re?tt.includes(re)||je.includes(re)||et.includes(re)||dt.some(Pt=>Pt.toLowerCase().includes(re)):!0});return me.sort((Ne,tt)=>{const je=oe(Ne.serverIds),et=oe(tt.serverIds);let dt=0;switch(b){case"id":dt=Ne.id.localeCompare(tt.id);break;case"servers":dt=je.length-et.length;break;case"evalRules":dt=Ne.evalRules.length-tt.evalRules.length;break;case"extractRules":dt=Ne.extractRules.length-tt.extractRules.length;break;default:dt=(Ne.name||Ne.id).localeCompare(tt.name||tt.id);break}return dt===0&&(dt=Ne.id.localeCompare(tt.id)),j==="asc"?dt:-dt}),me},[i,p,g,b,j,d]);v.useEffect(()=>{let re=!0;return a.getWorkspaceSettings().then(me=>{!re||!me||P(me.scenarioAssistantAgentName??"")}).catch(()=>{re&&P("")}),()=>{re=!1}},[a]),v.useEffect(()=>{if(M&&t.get("assistantHandoff")==="1")try{const re=window.sessionStorage.getItem(oM);if(!re)return;const me=JSON.parse(re);if(!me||me.scenarioId!==M||!me.prompt)return;D(String(me.prompt)),U(Date.now()),window.sessionStorage.removeItem(oM);const Ne=new URLSearchParams(t);Ne.delete("assistantHandoff"),n(Ne,{replace:!0}),Pe({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[M,t,n]),v.useEffect(()=>{W?(O(structuredClone(W)),Q.current=structuredClone(W),R("idle"),z("")):(O(null),Q.current=null,R("idle"),z("")),Z.current&&(window.clearTimeout(Z.current),Z.current=null),T.current=!1,L.current=!1},[W]),v.useEffect(()=>()=>{Z.current&&window.clearTimeout(Z.current)},[]);const Ie=_||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(t$,{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:[W&&s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(xo,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!W&&s.jsxs(se,{type:"button",size:"sm",onClick:()=>{ue()},children:[s.jsx(us,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!W&&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(Me,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(Sj,{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(ht,{value:p,onChange:re=>y(re.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(Me,{className:"text-xs",children:"Server Filter"}),s.jsxs(sn,{value:g,onValueChange:S,children:[s.jsx(Jt,{className:"h-8 text-xs",children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"all",children:"All servers"}),he.map(re=>s.jsx(at,{value:re,children:re},re))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Sort By"}),s.jsxs(sn,{value:b,onValueChange:re=>x(re),children:[s.jsx(Jt,{className:"h-8 text-xs",children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"name",children:"Name"}),s.jsx(at,{value:"id",children:"ID"}),s.jsx(at,{value:"servers",children:"# Servers"}),s.jsx(at,{value:"evalRules",children:"# Eval Rules"}),s.jsx(at,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Me,{className:"text-xs",children:"Direction"}),s.jsxs(sn,{value:j,onValueChange:re=>N(re),children:[s.jsx(Jt,{className:"h-8 w-28 text-xs",children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"asc",children:"Ascending"}),s.jsx(at,{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 ",xe.length," of ",i.length," test case",i.length!==1?"s":"","."]}),M&&!W&&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:M})," was not found."]}),i.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):xe.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:xe.map(re=>{const me=M===re.id,Ne=`/libraries/test-cases/${encodeURIComponent(re.id)}`,tt=oe(re.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${me?"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:re.name||re.id}),s.jsx(Ke,{variant:"outline",className:"font-mono text-[10px]",children:re.id}),me&&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:[tt.length," server",tt.length!==1?"s":""]}),s.jsxs("span",{children:[re.evalRules.length," eval rule",re.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[re.extractRules.length," extract rule",re.extractRules.length!==1?"s":""]})]}),tt.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:tt.map(je=>s.jsx(Ke,{variant:"secondary",className:"text-[10px]",children:je},`${re.id}-${je}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>X(re),children:[s.jsx(xa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve(re)},children:[s.jsx(Ri,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(se,{type:"button",size:"sm",variant:me?"default":"outline",asChild:!0,children:s.jsxs(yt,{to:Ne,children:[s.jsx(_m,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},re.id)})})]})})]}),W&&A?s.jsxs(ze,{children:[s.jsxs(Ct,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("div",{children:s.jsx(_t,{className:"text-base",children:"Edit Test Case"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ve(A,!0)},children:[s.jsx(Ri,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>X(A),children:[s.jsx(xa,{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:W.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"&&$&&s.jsx("span",{className:"text-[11px] text-destructive",children:$})]})})]}),s.jsx(Ue,{className:"pt-3",children:s.jsx(lj,{scenarios:[A],agents:c,servers:d,defaultAssistantAgentName:Ie,assistantInitialPromptByScenarioId:B&&A?.id?{[A.id]:B}:void 0,assistantAutoOpenNonceByScenarioId:A?.id&&K?{[A.id]:K}:void 0,onChange:re=>{const me=re[0];me&&(O(me),ae(me))},allowAdd:!1})})]}):null,s.jsx(bs,{open:!!V,onOpenChange:re=>!re&&X(null),children:s.jsxs(Va,{children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:"Delete test case?"}),s.jsxs(Ya,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:V?.name||V?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(Ka,{children:[s.jsx(Qa,{children:"Cancel"}),s.jsx(Xa,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{V&&(Oe(V),X(null))},children:"Delete Test Case"})]})]})})]})},kve=()=>{const{source:e}=On(),{agents:t,reload:n,loading:r}=qa(),[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 S=await e.getWorkspaceSettings();f(S?.scenarioAssistantAgentName??"")}catch(S){f(""),Pe({title:"Could not load settings",description:S instanceof Error?S.message:String(S),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{p()},[e]);const y=async S=>{f(S),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:S||void 0}),Pe({title:"Settings updated",description:S?`Scenario Assistant Agent set to ${S}.`:"Scenario Assistant Agent cleared (will use first available agent by default)."})}catch(b){Pe({title:"Could not save settings",description:b instanceof Error?b.message:String(b),variant:"destructive"})}finally{c(!1)}},g=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(jj,{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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{g()},disabled:r||a,children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(ze,{children:[s.jsxs(Ct,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Scenario Assistant"}),s.jsx(Ds,{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(Me,{className:"text-xs",children:"Assistant Agent"}),s.jsxs(sn,{value:h||"__none__",onValueChange:S=>{y(S==="__none__"?"":S)},disabled:o,children:[s.jsx(Jt,{className:"h-9 text-sm",children:s.jsx(on,{placeholder:"Select assistant agent"})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"__none__",children:"None (use first agent)"}),t.map(S=>s.jsxs(at,{value:S.name||S.id,children:[S.name||S.id," · ",S.model]},S.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 Jv="Checkbox",[Rve]=ir(Jv),[Tve,pC]=Rve(Jv);function Ive(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,[y,g]=na({prop:n,defaultProp:a??!1,onChange:d,caller:Jv}),[S,b]=v.useState(null),[x,j]=v.useState(null),N=v.useRef(!1),_=S?!!o||!!S.closest("form"):!0,P={checked:y,disabled:i,setChecked:g,control:S,setControl:b,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:ki(a)?!1:a,isFormControl:_,bubbleInput:x,setBubbleInput:j};return s.jsx(Tve,{scope:t,...P,children:Mve(p)?p(P):r})}var gz="CheckboxTrigger",yz=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:y,isFormControl:g,bubbleInput:S}=pC(gz,e),b=ut(a,h),x=v.useRef(d);return v.useEffect(()=>{const j=i?.form;if(j){const N=()=>p(x.current);return j.addEventListener("reset",N),()=>j.removeEventListener("reset",N)}},[i,p]),s.jsx(De.button,{type:"button",role:"checkbox","aria-checked":ki(d)?"mixed":d,"aria-required":f,"data-state":jz(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:Ae(t,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ae(n,j=>{p(N=>ki(N)?!0:!N),S&&g&&(y.current=j.isPropagationStopped(),y.current||j.stopPropagation())})})});yz.displayName=gz;var hC=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(Ive,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:y})=>s.jsxs(s.Fragment,{children:[s.jsx(yz,{...p,ref:t,__scopeCheckbox:n}),y&&s.jsx(Sz,{__scopeCheckbox:n})]})})});hC.displayName=Jv;var xz="CheckboxIndicator",bz=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=pC(xz,n);return s.jsx(Gn,{present:r||ki(i.checked)||i.checked===!0,children:s.jsx(De.span,{"data-state":jz(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});bz.displayName=xz;var wz="CheckboxBubbleInput",Sz=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:y,setBubbleInput:g}=pC(wz,e),S=ut(n,g),b=Fv(i),x=km(r);v.useEffect(()=>{const N=y;if(!N)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,O=!a.current;if(b!==i&&A){const k=new Event("click",{bubbles:O});N.indeterminate=ki(i),A.call(N,ki(i)?!1:i),N.dispatchEvent(k)}},[y,b,i,a]);const j=v.useRef(ki(i)?!1:i);return s.jsx(De.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??j.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:S,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Sz.displayName=wz;function Mve(e){return typeof e=="function"}function ki(e){return e==="indeterminate"}function jz(e){return ki(e)?"indeterminate":e?"checked":"unchecked"}const va=v.forwardRef(({className:e,...t},n)=>s.jsx(hC,{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(bz,{className:Se("flex items-center justify-center text-current"),children:s.jsx(ql,{className:"h-4 w-4"})})}));va.displayName=hC.displayName;const $ve=Io("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"}}),Bl=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:Se($ve({variant:t}),e),...n}));Bl.displayName="Alert";const zl=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Se("mb-1 font-medium leading-none tracking-tight",e),...t}));zl.displayName="AlertTitle";const Ul=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("text-sm [&_p]:leading-relaxed",e),...t}));Ul.displayName="AlertDescription";function Dve(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:y,children:g,...S}=p,b=y?.[e]?.[d]||c,x=v.useMemo(()=>S,Object.values(S));return s.jsx(b.Provider,{value:x,children:g})};f.displayName=i+"Provider";function h(p,y){const g=y?.[e]?.[d]||c,S=v.useContext(g);if(S)return S;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,Lve(a,...t)]}function Lve(...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 Fve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nz=Fve.reduce((e,t)=>{const n=qm(`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}},{}),mC="Progress",vC=100,[Bve]=Dve(mC),[zve,Uve]=Bve(mC),Cz=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=qve,...o}=e;(a||a===0)&&!cM(a)&&console.error(Wve(`${a}`,"Progress"));const c=cM(a)?a:vC;r!==null&&!uM(r,c)&&console.error(Vve(`${r}`,"Progress"));const d=uM(r,c)?r:null,f=bm(d)?i(d,c):void 0;return s.jsx(zve,{scope:n,value:d,max:c,children:s.jsx(Nz.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":bm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":Ez(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});Cz.displayName=mC;var _z="ProgressIndicator",Az=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Uve(_z,n);return s.jsx(Nz.div,{"data-state":Ez(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});Az.displayName=_z;function qve(e,t){return`${Math.round(e/t*100)}%`}function Ez(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function bm(e){return typeof e=="number"}function cM(e){return bm(e)&&!isNaN(e)&&e>0}function uM(e,t){return bm(e)&&!isNaN(e)&&e<=t&&e>=0}function Wve(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${vC}\`.`}function Vve(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 ${vC} if no \`max\` prop is set)
133
+ - \`null\` or \`undefined\` if the progress is indeterminate.
134
+
135
+ Defaulting to \`null\`.`}var Pz=Cz,Hve=Az;const Zv=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(Pz,{ref:r,className:Se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(Hve,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Zv.displayName=Pz.displayName;const Lu=["critical","high","medium","low","info"];function i1(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 Kve(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 dM({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(R7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function gC(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 Oz({report:e}){const[t,n]=v.useState([...Lu]),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?[...Lu]: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(Ct,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Analysis Overview"}),s.jsx(Ds,{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:[Lu.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?i1(i):Kve(i)} ${o?"ring-1 ring-current":"opacity-70"}`,children:[i,": ",e.summary.issueCounts[i]]})},i)}),s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>n([...Lu]),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===Lu.length:d.some(f=>r.has(f.severity))});return o.length===0?null:s.jsxs(ze,{children:[s.jsxs(Ct,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:i.serverName}),s.jsxs(Ds,{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(Bl,{children:[s.jsx(zl,{children:"Warnings"}),s.jsx(Ul,{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(qt,{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] ${i1(d.severity)}`,children:d.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",d.detail]}),d.suggestion&&s.jsx(dM,{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] ${i1(f.severity)}`,children:f.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",f.detail]}),f.suggestion&&s.jsx(dM,{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 o1="mcplab.toolAnalysis.activeJobId";function fM(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 pM({text:e}){return s.jsxs(X$,{children:[s.jsx(Q$,{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(E7,{className:"h-3.5 w-3.5"})})}),s.jsx(Mj,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function Gve(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 Yve=()=>{const{source:e}=On(),{servers:t,agents:n,loading:r,reload:a}=qa(),[i,o]=v.useState(""),[c,d]=v.useState([]),[f,h]=v.useState(!1),[p,y]=v.useState([]),[g,S]=v.useState({}),[b,x]=v.useState(""),[j,N]=v.useState(!0),[_,P]=v.useState(!1),[A,O]=v.useState(2),[k,R]=v.useState(1),[$,z]=v.useState(1e4),[B,D]=v.useState(null),[K,U]=v.useState([]),[V,X]=v.useState(null),[Z,T]=v.useState(null),[L,Q]=v.useState(!1),[F,M]=v.useState("configure"),[ee,W]=v.useState("idle"),J=v.useRef(null),ye=i||n[0]?.name||"",ae=v.useMemo(()=>{let we=0;const Le=new Set,qe=new Set;for(const $t of K){const Dt=typeof $t.payload?.message=="string"?$t.payload.message:"";if(!Dt)continue;const mn=Dt.match(/\((\d+)\s+tools?\)/i);mn&&(we=Math.max(we,Number(mn[1])||0));const jn=Dt.match(/^Started\s+(.+)$/);jn&&Le.add(jn[1]);const or=Dt.match(/^Finished\s+(.+)$/);or&&qe.add(or[1])}const Rt=we>0?Math.max(0,Math.min(100,Math.round(qe.size/we*100))):0;return{totalTools:we,startedTools:Le.size,finishedTools:qe.size,percent:Rt}},[K]);v.useEffect(()=>{let we=!0;return e.getWorkspaceSettings().then(Le=>{!we||!Le||o(Le.scenarioAssistantAgentName??"")}).catch(()=>{we&&o("")}),()=>{we=!1}},[e]),v.useEffect(()=>()=>{J.current?.()},[]);const ue=()=>{try{sessionStorage.removeItem(o1)}catch{}},ie=we=>{try{sessionStorage.setItem(o1,we)}catch{}},ve=we=>{J.current?.(),J.current=e.subscribeToolAnalysisJob(we,Le=>{if(U(qe=>[...qe,Le]),Le.type==="completed")e.getToolAnalysisResult(we).then(qe=>{X(qe.report),T(qe.savedReportId??null)}).catch(qe=>Pe({title:"Could not load analysis report",description:qe instanceof Error?qe.message:String(qe),variant:"destructive"})).finally(()=>{ue(),D(null),Q(!1),W("idle"),M("run")});else if(Le.type==="error"){const qe=String(Le.payload?.message??"");ue(),W(qe.toLowerCase().includes("abort")?"stopped":"error"),D(null),Q(!1)}})};v.useEffect(()=>{if(B||V)return;let we="";try{we=sessionStorage.getItem(o1)??""}catch{we=""}if(we)return M("run"),W("running"),Q(!0),D(we),U([]),ve(we),()=>{}},[e,B,V]);const Oe=async()=>{if(c.length===0){y([]),S({});return}h(!0);try{const we=await e.discoverToolsForAnalysis({serverNames:c});y(we.servers),S(Le=>{const qe={};for(const Rt of we.servers){const $t=Le[Rt.serverName]??[],Dt=Rt.tools.map(jn=>jn.name),mn=$t.filter(jn=>Dt.includes(jn));qe[Rt.serverName]=mn.length>0?mn:Dt}return qe})}catch(we){Pe({title:"Could not discover MCP tools",description:we instanceof Error?we.message:String(we),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{Oe()},[c.join("|")]);const oe=v.useMemo(()=>{const we=b.trim().toLowerCase();return we?p.map(Le=>({...Le,tools:Le.tools.filter(qe=>qe.name.toLowerCase().includes(we)||(qe.description||"").toLowerCase().includes(we))})).filter(Le=>Le.tools.length>0):p},[p,b]),he=v.useMemo(()=>Object.values(g).reduce((we,Le)=>we+Le.length,0),[g]),xe=c[0]??"",Ie=async()=>{if(!j&&!_){Pe({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Pe({title:"Select exactly one server",variant:"destructive"});return}if(he===0){Pe({title:"Select at least one tool",variant:"destructive"});return}Q(!0),U([]),X(null),T(null),M("run"),W("running");try{const{jobId:we}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:g,maxParallelTools:A,modes:{metadataReview:j,deeperAnalysis:_},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:k,toolCallTimeoutMs:$}});D(we),ie(we),ve(we)}catch(we){Q(!1),W("error"),M("run"),Pe({title:"Could not start tool analysis",description:we instanceof Error?we.message:String(we),variant:"destructive"})}},re=async()=>{if(!B)return;const we=B;try{const Le=await e.stopToolAnalysis(we);if(Le.status==="completed"){J.current?.(),J.current=null;const qe=await e.getToolAnalysisResult(we);X(qe.report),T(qe.savedReportId??null),ue(),D(null),Q(!1),W("idle"),M("run"),Pe({title:"Analysis already finished",description:"Showing the result overview."});return}if(Le.status==="stopped"){J.current?.(),J.current=null,ue(),D(null),Q(!1),W("stopped"),Pe({title:"Analysis stopped"});return}if(Le.status==="error"){J.current?.(),J.current=null,ue(),D(null),Q(!1),W("error"),Pe({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Pe({title:"Stopping analysis..."})}catch(Le){Pe({title:"Could not stop analysis",description:Le instanceof Error?Le.message:String(Le),variant:"destructive"})}},me=()=>{M("configure"),W("idle"),D(null)},Ne=(we,Le)=>{d(qe=>Le?[we]:qe.filter(Rt=>Rt!==we))},tt=(we,Le,qe)=>{S(Rt=>{const $t=new Set(Rt[we]??[]);return qe?$t.add(Le):$t.delete(Le),{...Rt,[we]:Array.from($t)}})},je=(we,Le)=>{S(qe=>({...qe,[we]:Le}))},et=!0,dt=B!==null||K.length>0||ee==="stopped"||ee==="error",Pt=!!V,hn=we=>{if(we==="configure"&&et){M("configure");return}if(we==="run"&&dt){M("run");return}we==="report"&&Pt&&M("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(a$,{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:()=>hn("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Ke,{variant:F==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>hn("run"),disabled:!dt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Ke,{variant:F==="run"?"default":"outline",className:dt?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>hn("report"),disabled:!Pt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Ke,{variant:F==="report"?"default":"outline",className:Pt?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),F==="configure"&&s.jsxs(ze,{children:[s.jsxs(Ct,{children:[s.jsx(_t,{className:"text-base",children:"Run MCP analysis"}),s.jsx(Ds,{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:[!ye&&s.jsxs(Bl,{children:[s.jsx(zl,{children:"No assistant agent available"}),s.jsxs(Ul,{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(Me,{className:"text-xs",children:"Servers"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r,children:[s.jsx(Fa,{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(we=>{const Le=we.name||we.id,qe=c.includes(Le);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(va,{checked:qe,onCheckedChange:Rt=>Ne(Le,!!Rt)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:Le}),we.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:we.url})]})]},we.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(Me,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(Sj,{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(ht,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:we=>x(we.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(Me,{className:"text-xs",children:xe?`Tools for ${xe}`:"Tools"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Oe()},disabled:f||c.length===0,children:[f&&s.jsx(sr,{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..."}):oe.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):oe.map(we=>{const Le=new Set(g[we.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:we.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>je(we.serverName,we.tools.map(qe=>qe.name)),children:"Select all"}),s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>je(we.serverName,[]),children:"Clear"})]})]}),we.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:we.warnings.map(qe=>s.jsx("div",{className:"text-xs text-amber-700",children:Gve(we.serverName,qe)},`${we.serverName}-${qe}`))}),s.jsx("div",{className:"grid gap-2",children:we.tools.map(qe=>s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(va,{checked:Le.has(qe.name),onCheckedChange:Rt=>tt(we.serverName,qe.name,!!Rt)}),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:qe.name}),s.jsx(Ke,{variant:qe.safetyClassification==="read_like"?"secondary":"outline",className:"text-[10px]",children:qe.safetyClassification==="read_like"?"read-like":"unsafe/unknown"})]}),qe.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:qe.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:qe.classificationReason})]})]},`${we.serverName}-${qe.name}`))})]},we.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",he]})]}),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(va,{checked:j,onCheckedChange:we=>N(!!we)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(pM,{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(va,{checked:_,onCheckedChange:we=>P(!!we)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(pM,{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(Me,{className:"text-xs",children:"Max parallel tools"}),s.jsx(ht,{type:"number",min:1,max:8,value:A,onChange:we=>O(Math.max(1,Math.min(8,Number(we.target.value)||2))),className:"h-8"})]}),_?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{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(Me,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(ht,{type:"number",min:1,max:5,value:k,onChange:we=>R(Math.max(1,Math.min(5,Number(we.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(ht,{type:"number",min:1e3,max:6e4,step:500,value:$,onChange:we=>z(Math.max(1e3,Math.min(6e4,Number(we.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(se,{type:"button",onClick:()=>{Ie()},disabled:L||!!B,children:[(L||!!B)&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),F==="run"&&s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(_t,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(Ds,{children:B?"Live tool-analysis job events:":V?"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."})]}),B?s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{re()},children:"Stop Analysis"}):s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:me,children:"Back to Configure Analysis"})]})}),s.jsxs(Ue,{className:"space-y-2",children:[B&&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(sr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(ae.totalTools>0||B)&&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:ae.totalTools>0?`${ae.finishedTools}/${ae.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:ae.totalTools>0?`${ae.percent}%`:"0%"})]}),s.jsx(Zv,{value:ae.totalTools>0?ae.percent:0,className:"h-2"})]}),K.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:B?"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:K.map((we,Le)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(we.ts).toLocaleTimeString()}),s.jsx(Ke,{variant:"outline",className:"mr-2 text-[10px]",children:we.type}),s.jsx("span",{className:"break-all",children:typeof we.payload.message=="string"?we.payload.message:JSON.stringify(we.payload)})]},`${we.ts}-${Le}`))}),!B&&V&&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:[V.summary.toolsAnalyzed," tools analyzed, ",V.summary.toolsSkipped," skipped, across"," ",V.summary.serversAnalyzed," server",V.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Z&&s.jsx(se,{asChild:!0,size:"sm",children:s.jsx(yt,{to:`/tool-analysis-results/${Z}`,children:"Open result details"})}),s.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>hn("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[V.summary.issueCounts.critical>0&&s.jsxs(Ke,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",V.summary.issueCounts.critical]}),V.summary.issueCounts.high>0&&s.jsxs(Ke,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",V.summary.issueCounts.high]}),V.summary.issueCounts.medium>0&&s.jsxs(Ke,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",V.summary.issueCounts.medium]}),V.summary.issueCounts.low>0&&s.jsxs(Ke,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",V.summary.issueCounts.low]}),V.summary.issueCounts.info>0&&s.jsxs(Ke,{variant:"outline",children:["Info: ",V.summary.issueCounts.info]}),Object.values(V.summary.issueCounts).every(we=>we===0)&&s.jsx(Ke,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),F==="report"&&V&&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:[V.summary.toolsAnalyzed," tools analyzed across ",V.summary.serversAnalyzed," server",V.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:me,children:"Back to Configure Analysis"}),Z&&s.jsxs(s.Fragment,{children:[s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(yt,{to:`/tool-analysis-results/${Z}`,children:"Open saved report"})}),s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>fM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(V,null,2)}
138
+ `,"application/json"),children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>fM(`tool-analysis-${Date.now()}.md`,gC(V),"text/markdown"),children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(Oz,{report:V})]})]})};function hM(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 Xve(){const{source:e}=On(),[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(g){Pe({title:"Could not load tool analysis results",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t.find(g=>g.reportId===i)??null,[t,i]),p=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(g=>g.filter(S=>S.reportId!==i)),Pe({title:"Tool analysis report deleted"}),o(null)}catch(g){Pe({title:"Could not delete report",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{d(!1)}}},y=async(g,S)=>{try{const b=await e.getToolAnalysisSavedResult(g);S==="json"?hM(`${g}.json`,`${JSON.stringify(b,null,2)}
139
+ `,"application/json"):hM(`${g}.md`,gC(b.report),"text/markdown")}catch(b){Pe({title:"Could not export saved report",description:b instanceof Error?b.message:String(b),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(s$,{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(se,{variant:"outline",onClick:()=>{f()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(se,{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(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{children:"Report ID"}),s.jsx(Qe,{children:"Evaluated"}),s.jsx(Qe,{children:"Timestamp"}),s.jsx(Qe,{children:"Issues"}),s.jsx(Qe,{children:"Modes"}),s.jsx(Qe,{className:"w-10"})]})}),s.jsx(Jr,{children:t.map(g=>s.jsxs(Bt,{children:[s.jsx(Be,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/tool-analysis-results/${g.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:g.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[g.assistantAgentName," · ",g.assistantAgentModel]})]})}),s.jsx(Be,{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:g.serverNames.length})," · Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:g.summary.toolsAnalyzed})," · ","Skipped: ",s.jsx("span",{className:"font-medium text-foreground",children:g.summary.toolsSkipped})]}),s.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[g.serverNames.slice(0,2).join(", "),g.serverNames.length>2?` +${g.serverNames.length-2}`:""]})]})}),s.jsx(Be,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Nm,{className:"h-3 w-3"}),new Date(g.createdAt).toLocaleString()]})}),s.jsx(Be,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(S=>g.summary.issueCounts[S]>0?s.jsxs(Ke,{variant:"outline",className:"capitalize",children:[S,": ",g.summary.issueCounts[S]]},`${g.reportId}-${S}`):null),Object.values(g.summary.issueCounts).every(S=>S===0)&&s.jsx(Ke,{variant:"outline",children:"No issues"})]})}),s.jsx(Be,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[g.modes.metadataReview&&s.jsx(Ke,{variant:"outline",children:"metadata"}),g.modes.deeperAnalysis&&s.jsx(Ke,{variant:"outline",children:"deeper"})]})}),s.jsx(Be,{children:s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Cm,{className:"h-4 w-4"})})}),s.jsxs(Wo,{align:"end",children:[s.jsx(hr,{asChild:!0,children:s.jsx(yt,{to:`/tool-analysis-results/${g.reportId}`,children:"View"})}),s.jsxs(hr,{onSelect:()=>{y(g.reportId,"json")},children:[s.jsx(ga,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(hr,{onSelect:()=>{y(g.reportId,"markdown")},children:[s.jsx(ga,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(hr,{className:"text-destructive",onSelect:S=>{S.preventDefault(),o(g.reportId)},children:[s.jsx(xa,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.reportId))})]})})}),s.jsx(bs,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Va,{children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:"Delete tool analysis report?"}),s.jsx(Ya,{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(Ka,{children:[s.jsx(Qa,{disabled:c,children:"Cancel"}),s.jsx(Xa,{onClick:g=>{g.preventDefault(),p()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function mM(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 Qve(){const{id:e=""}=Mo(),t=wa(),{source:n}=On(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1),[p,y]=v.useState(!1);v.useEffect(()=>{let S=!0;return o(!0),d(!1),n.getToolAnalysisSavedResult(e).then(b=>{S&&a(b)}).catch(b=>{if(!S)return;const x=b instanceof Error?b.message:String(b);if(x.includes("(404)")){d(!0),a(null);return}Pe({title:"Could not load saved tool analysis report",description:x,variant:"destructive"})}).finally(()=>{S&&o(!1)}),()=>{S=!1}},[e,n]);const g=async()=>{y(!0);try{await n.deleteToolAnalysisSavedResult(e),Pe({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(S){Pe({title:"Could not delete report",description:S instanceof Error?S.message:String(S),variant:"destructive"})}finally{y(!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(se,{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(se,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>mM(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
140
+ `,"application/json"),children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>mM(`${r.reportId}.md`,gC(r.report),"text/markdown"),children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(xa,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(Oz,{report:r.report}),s.jsx(bs,{open:f,onOpenChange:h,children:s.jsxs(Va,{children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:"Delete tool analysis report?"}),s.jsxs(Ya,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(Ka,{children:[s.jsx(Qa,{disabled:p,children:"Cancel"}),s.jsx(Xa,{onClick:S=>{S.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const Jve=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function Zve(e){return navigator.clipboard.writeText(e)}function ege(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function tge(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 nge(){const{source:e}=On(),{servers:t,reload:n,loading:r}=qa(),[a,i]=v.useState("configure"),[o,c]=v.useState(""),[d,f]=v.useState("pre_registered"),[h,p]=v.useState("local_callback"),[y,g]=v.useState(!0),[S,b]=v.useState(!0),[x,j]=v.useState(""),[N,_]=v.useState(""),[P,A]=v.useState(""),[O,k]=v.useState(""),[R,$]=v.useState("client_secret_basic"),[z,B]=v.useState("{}"),[D,K]=v.useState(""),[U,V]=v.useState(""),[X,Z]=v.useState(""),[T,L]=v.useState(""),[Q,F]=v.useState(""),[M,ee]=v.useState(""),[W,J]=v.useState(""),[ye,ae]=v.useState(""),[ue,ie]=v.useState(null),[ve,Oe]=v.useState(null),[oe,he]=v.useState([]),[xe,Ie]=v.useState(!1),[re,me]=v.useState(!1),[Ne,tt]=v.useState(!1),[je,et]=v.useState("all"),[dt,Pt]=v.useState("all"),[hn,we]=v.useState("inspector"),Le=v.useRef(null),qe=v.useRef(null);v.useEffect(()=>()=>{Le.current?.(),Le.current=null},[]),v.useEffect(()=>{qe.current?.scrollIntoView({behavior:"smooth",block:"end"})},[oe.length]);const Rt=v.useMemo(()=>t.filter(le=>le.authType==="oauth2"),[t]),$t=Rt.find(le=>le.id===o);v.useEffect(()=>{o&&(Rt.some(le=>le.id===o)||c(""))},[Rt,o]);const Dt=v.useMemo(()=>{const le=ue?.stepStates.length??0,ke=ue?.stepStates.filter(zt=>zt.status==="completed"||zt.status==="skipped").length??0,it=ue?.stepStates.filter(zt=>zt.status==="failed").length??0,vt=le>0?Math.round((ke+it)/le*100):0;return{total:le,completed:ke,failed:it,percent:vt}},[ue]),mn=v.useMemo(()=>(ue?.network??[]).filter(ke=>!(je!=="all"&&ke.stepId!==je||dt==="error"&&!(ke.phase==="response"&&(ke.status??0)>=400)||dt==="ok"&&!(ke.phase==="response"&&(ke.status??0)<400))),[ue?.network,je,dt]),jn=!!ve,or=!!(ue&&(ue.status==="completed"||ue.status==="error"||ue.status==="stopped")),lr=le=>{if(le==="configure"||le==="run"&&jn||le==="report"&&or)return i(le)},Na=()=>{let le;if(d==="dcr"&&z.trim())try{le=JSON.parse(z)}catch{throw new Error("DCR metadata JSON is invalid")}if(!$t)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:$t.name||$t.id,overrides:{authorizationServerMetadataUrl:X||void 0,authorizationEndpoint:T||void 0,tokenEndpoint:Q||void 0,registrationEndpoint:M||void 0,cimdUrl:D||void 0,resourceBaseUrl:W||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:le,tokenEndpointAuthMethod:R||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:D||void 0,expectedClientId:U||void 0}:void 0},runtime:{redirectMode:h,scopes:x.split(/[,\s]+/).map(ke=>ke.trim()).filter(Boolean),resource:N.trim()||void 0,usePkce:S,codeChallengeMethod:"S256"},display:{showSensitiveValues:y}}},Dn=le=>{Le.current?.(),Le.current=e.subscribeOAuthDebuggerSession(le,ke=>{he(vt=>[...vt,ke]),(ke.type==="completed"||ke.type==="error"||ke.type==="stopped")&&Ie(!1),e.getOAuthDebuggerSession(le).then(vt=>{ie(vt.session),vt.session.status==="completed"&&i("report")}).catch(()=>{})})},Dr=async()=>{me(!0);try{const le=Na(),ke=await e.createOAuthDebuggerSession(le);Oe(ke.sessionId),ie(ke.session),he([]),i("run"),Dn(ke.sessionId);const it=await e.startOAuthDebuggerSession(ke.sessionId);ie(it.session),Ie(!0),(it.session.status==="waiting_for_user"||it.session.status==="waiting_for_browser_callback")&&Ie(!1)}catch(le){Pe({title:"Could not start OAuth Debugger session",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{me(!1)}},Cr=async()=>{if(ve)try{me(!0);const le=await e.submitOAuthDebuggerManualCallback(ve,{redirectUrl:ye.trim()||void 0});ie(le.session),ae(""),Ie(!0)}catch(le){Pe({title:"Could not submit callback",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{me(!1)}},_r=async()=>{if(ve){tt(!0);try{const le=await e.stopOAuthDebuggerSession(ve);if(Ie(!1),le.status!=="running"){const ke=await e.getOAuthDebuggerSession(ve);ie(ke.session),ke.session.status==="completed"?i("report"):i("run")}}catch(le){Pe({title:"Could not stop session",description:le instanceof Error?le.message:String(le),variant:"destructive"})}finally{tt(!1)}}},kn=async()=>{Le.current?.(),Le.current=null,ie(null),Oe(null),he([]),Ie(!1),tt(!1),me(!1),ae(""),et("all"),Pt("all"),we("inspector"),i("run"),await Dr()},xn=async le=>{if(!(!ve||!ue))try{const ke=await e.exportOAuthDebuggerSession(ve,le);let it="";const vt=le==="json"?"json":le==="raw"?"txt":"md";typeof ke=="string"?it=ke:it=`${JSON.stringify(ke,null,2)}
143
+ `;const zt=new Blob([it],{type:"text/plain;charset=utf-8"}),tn=URL.createObjectURL(zt),Et=document.createElement("a");Et.href=tn,Et.download=`oauth-debugger-${ve}.${vt}`,Et.click(),URL.revokeObjectURL(tn)}catch(ke){if(le==="markdown"){const it=tge(ue,oe),vt=new Blob([it],{type:"text/markdown;charset=utf-8"}),zt=URL.createObjectURL(vt),tn=document.createElement("a");tn.href=zt,tn.download=`oauth-debugger-${ue.id}.md`,tn.click(),URL.revokeObjectURL(zt);return}Pe({title:"Export failed",description:ke instanceof Error?ke.message:String(ke),variant:"destructive"})}},cn=ve?`${ege()}/api/oauth-debugger/sessions/${ve}/authorize`:void 0,Rn=le=>le==="error"?"destructive":le==="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:Jve.map(le=>{const ke=a===le.id,it=le.id==="configure"||le.id==="run"&&jn||le.id==="report"&&or;return s.jsx("button",{type:"button",onClick:()=>it&&lr(le.id),disabled:!it,className:"rounded-full",children:s.jsx(Ke,{variant:ke?"default":"outline",className:it?"":"opacity-50",children:le.label})},le.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(_t,{className:"text-base",children:"Target MCP Server"}),s.jsx(Ds,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(Fa,{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(Me,{children:"MCP Server"}),s.jsxs(sn,{value:o,onValueChange:c,children:[s.jsx(Jt,{children:s.jsx(on,{placeholder:"Select an MCP server"})}),s.jsx(Zt,{children:Rt.map(le=>s.jsx(at,{value:le.id,children:le.name||le.id},le.id))})]}),Rt.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"}),"."]}),$t&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[$t.transport," · ",$t.url||$t.command||"No URL/command"]})]})})]}),s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{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(le=>s.jsx("button",{type:"button",onClick:()=>f(le.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===le.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:le.label})]})},le.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(Me,{className:"text-xs",children:"Redirect mode"}),s.jsxs(sn,{value:h,onValueChange:le=>p(le),children:[s.jsx(Jt,{children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(at,{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(Me,{className:"text-xs",children:"client_id"}),s.jsx(ht,{value:P,onChange:le=>A(le.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"client_secret (optional)"}),s.jsx(ht,{value:O,onChange:le=>k(le.target.value),type:"password"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"CIMD URL"}),s.jsx(ht,{value:D,onChange:le=>K(le.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{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(Me,{className:"text-xs",children:"Scopes (space or comma separated)"}),s.jsx(ht,{value:x,onChange:le=>j(le.target.value),placeholder:"openid profile mcp"})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(va,{checked:S,onCheckedChange:le=>b(!!le)}),s.jsx(Me,{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(Me,{className:"text-xs",children:"Token endpoint auth method"}),s.jsx(ht,{value:R,onChange:le=>$(le.target.value),placeholder:"client_secret_basic / none / client_secret_post"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Resource / audience (optional)"}),s.jsx(ht,{value:N,onChange:le=>_(le.target.value),placeholder:"https://resource.example.com"})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"DCR metadata JSON (optional overrides)"}),s.jsx(Ks,{value:z,onChange:le=>B(le.target.value),className:"min-h-32 font-mono text-xs"})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Expected client_id (optional)"}),s.jsx(ht,{value:U,onChange:le=>V(le.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(Me,{className:"text-xs",children:"Authorization server metadata URL"}),s.jsx(ht,{value:X,onChange:le=>Z(le.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Resource server base URL"}),s.jsx(ht,{value:W,onChange:le=>J(le.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Authorization endpoint"}),s.jsx(ht,{value:T,onChange:le=>L(le.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Token endpoint"}),s.jsx(ht,{value:Q,onChange:le=>F(le.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Registration endpoint (DCR)"}),s.jsx(ht,{value:M,onChange:le=>ee(le.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"CIMD URL override"}),s.jsx(ht,{value:D,onChange:le=>K(le.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Bl,{children:[s.jsx(zy,{className:"h-4 w-4"}),s.jsx(zl,{children:"Secrets display"}),s.jsxs(Ul,{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(va,{checked:!y,onCheckedChange:le=>g(le===!1)}),s.jsx(Me,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(se,{type:"button",onClick:()=>{Dr()},disabled:re,children:[re&&s.jsx(sr,{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(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(_t,{className:"text-base",children:"Progress"}),s.jsx(Ds,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ue?.uiHints.authorizationUrl&&cn&&s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:cn,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(nh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{kn()},disabled:re,children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Restart"]}),ve&&s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{_r()},disabled:Ne||!ve,children:[(Ne||xe)&&Ne&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(h1,{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:[Dt.completed+Dt.failed,"/",Dt.total," steps"]}),s.jsxs("span",{children:[Dt.percent,"%"]})]}),s.jsx(Zv,{value:Dt.percent,className:"h-2"})]}),ue?.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(Ks,{value:ye,onChange:le=>ae(le.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(se,{type:"button",size:"sm",onClick:()=>{Cr()},disabled:re||!ye.trim(),children:[re&&s.jsx(sr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),ue.uiHints.authorizationUrl&&cn&&s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:cn,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),ue?.status==="waiting_for_browser_callback"&&s.jsxs(Bl,{children:[s.jsx(zy,{className:"h-4 w-4"}),s.jsx(zl,{children:"Waiting for browser callback"}),s.jsxs(Ul,{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:ue.uiHints.callbackUrl}),ue.uiHints.authorizationUrl&&cn&&s.jsx("div",{className:"pt-2",children:s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:cn,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(nh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:ue?.stepStates.map(le=>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:le.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:le.description})]}),s.jsx(Ke,{variant:le.status==="failed"?"destructive":le.status==="completed"?"outline":le.status==="active"?"secondary":"outline",className:le.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:le.status})]}),le.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:le.outcomeSummary})]},le.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(Ct,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Inspect"}),s.jsx(Ds,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(Ue,{className:"space-y-3",children:s.jsxs(tC,{value:hn,onValueChange:le=>we(le),children:[s.jsxs(Uv,{className:"grid grid-cols-2",children:[s.jsx(Po,{value:"inspector",children:"Network Inspector"}),s.jsx(Po,{value:"events",children:"Live Debug"})]}),s.jsx(Wd,{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:[oe.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):oe.map((le,ke)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(le.ts).toLocaleTimeString()}),s.jsx(Ke,{variant:"outline",className:"mr-2 text-[10px]",children:le.type}),typeof le.payload.message=="string"?le.payload.message:JSON.stringify(le.payload)]},`${le.ts}-${ke}`)),s.jsx("div",{ref:qe})]})}),s.jsxs(Wd,{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(Me,{className:"text-xs",children:"Filter by step"}),s.jsxs(sn,{value:je,onValueChange:et,children:[s.jsx(Jt,{className:"h-8",children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"all",children:"All steps"}),(ue?.stepStates??[]).map(le=>s.jsx(at,{value:le.id,children:le.title},le.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Filter by status"}),s.jsxs(sn,{value:dt,onValueChange:Pt,children:[s.jsx(Jt,{className:"h-8",children:s.jsx(on,{})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"all",children:"All"}),s.jsx(at,{value:"ok",children:"Successful responses"}),s.jsx(at,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:mn.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):mn.map(le=>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:le.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[le.method?`${le.method} `:"",le.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{variant:"outline",children:le.phase}),typeof le.status=="number"&&s.jsx(Ke,{variant:le.status>=400?"destructive":"secondary",children:le.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(le.headers,null,2)})]}),le.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:le.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Zve(JSON.stringify(le,null,2))},children:[s.jsx(Ri,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},le.id))})]})]})})]})})]})}),a==="report"&&ue&&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(se,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{xn("json")},children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{xn("markdown")},children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{xn("raw")},children:[s.jsx(ga,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(Bl,{children:[s.jsx(zy,{className:"h-4 w-4"}),s.jsx(zl,{children:"Secrets display mode"}),s.jsx(Ul,{children:y?"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:ue.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:ue.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:ue.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:ue.validations.length})]})})]}),s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Key values"})}),s.jsxs(Ue,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:ue.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:ue.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:ue.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:ue.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:ue.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx(Me,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(ue.summary?.grantedScopes??[]).join(", ")||"-"})]})]})]}),s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Validation findings"})}),s.jsx(Ue,{className:"space-y-2",children:ue.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):ue.validations.map((le,ke)=>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:ke+1}),s.jsx("span",{className:"font-bold",children:le.title})]}),s.jsx(Ke,{variant:Rn(le.severity),children:le.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",le.detail]}),le.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:le.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",le.stepId,le.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:le.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},le.id))})]})]})]})}const l1="mcplab.runEvaluation.activeJobId",rge=()=>{const[e]=Ec(),[t,n]=v.useState(""),[r,a]=v.useState("1"),[i,o]=v.useState(!1),[c,d]=v.useState(0),[f,h]=v.useState([]),[p,y]=v.useState(!1),[g,S]=v.useState(!1),[b,x]=v.useState(""),[j,N]=v.useState(null),[_,P]=v.useState([]),[A,O]=v.useState([]),[k,R]=v.useState(!0),[$,z]=v.useState(""),[B,D]=v.useState(!1),K=v.useRef(null),U=v.useRef(null),V=v.useRef(null),{configs:X,reload:Z}=tf(),{source:T}=On(),L=mf("snapshots",!1),{agents:Q,scenarios:F}=qa(),M=X.find(he=>he.id===t),ee=e.get("configId"),W=v.useMemo(()=>{if(!M)return[];const he=new Map,xe=M.agentEntries&&M.agentEntries.length>0?M.agentEntries:M.agents.map(Ie=>({kind:"inline",agent:Ie}));for(const Ie of xe){if(Ie.kind==="inline"){const me=Ie.agent.id;he.has(me)||he.set(me,Ie.agent);continue}const re=Q.find(me=>me.id===Ie.ref);re&&!he.has(re.id)&&he.set(re.id,re)}return Array.from(he.values())},[M,Q]),J=v.useMemo(()=>{if(!M)return[];const he=new Map,xe=M.scenarioEntries&&M.scenarioEntries.length>0?M.scenarioEntries:M.scenarios.map(Ie=>({kind:"inline",scenario:Ie}));for(const Ie of xe){if(Ie.kind==="inline"){he.has(Ie.scenario.id)||he.set(Ie.scenario.id,Ie.scenario);continue}const re=F.find(me=>me.id===Ie.ref);re&&!he.has(re.id)&&he.set(re.id,re)}return Array.from(he.values())},[M,F]);v.useEffect(()=>{ee&&X.some(he=>he.id===ee)&&n(ee)},[ee,X]),v.useEffect(()=>{if(!M){P([]),O([]);return}const he=W.filter(xe=>(M.runDefaults?.selectedAgentNames??[]).includes(xe.id)).map(xe=>xe.id);P(he.length>0?he:W.map(xe=>xe.id)),O(J.map(xe=>xe.id)),R(!0)},[M?.id,M?.sourcePath,W,J]);const ye=async()=>{if(!M?.sourcePath){h(re=>[...re,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const he=W.filter(re=>_.includes(re.id));if(he.length===0){h(re=>[...re,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const xe=J.filter(re=>A.includes(re.id));if(xe.length===0){h(re=>[...re,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}o(!0),y(!1),S(!1),x("");const Ie=(M.serverEntries??[]).some(re=>re.kind==="referenced")||(M.agentEntries??[]).some(re=>re.kind==="referenced")||(M.scenarioEntries??[]).some(re=>re.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${M.name} mode=${Ie} agents=${he.map(re=>re.name||re.id).join(", ")} tests=${xe.map(re=>re.id).join(", ")} runs=${Number(r)} snapshotEval=${L&&k?"on":"off"}`]),d(10);try{const{jobId:re}=await T.startRun({configPath:M.sourcePath,runsPerScenario:Number(r),agents:he.map(me=>me.id),scenarioIds:xe.map(me=>me.id),applySnapshotEval:L?k:!1});N(re),Oe(re),oe(re)}catch(re){const me=re instanceof Error?re.message:String(re),Ne=me.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(tt=>[...tt,`[${new Date().toLocaleTimeString()}] Error: ${me}${Ne}`]),o(!1),d(0),N(null)}},ae=()=>{ye()},ue=()=>{U.current&&clearInterval(U.current),j&&T.stopRun(j),V.current?.(),V.current=null,ve(),N(null),o(!1),y(!1),S(!0),h(he=>[...he,`[${new Date().toLocaleTimeString()}] Run aborted by user.`])},ie=async()=>{if(b){D(!0);try{const he=await T.createSnapshotFromRun(b,$.trim()||void 0);Pe({title:"Snapshot saved",description:`Created ${he.name} (${he.id})`}),$.trim()||z(he.name)}catch(he){Pe({title:"Could not save snapshot",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{D(!1)}}};v.useEffect(()=>{K.current&&(K.current.scrollTop=K.current.scrollHeight)},[f]),v.useEffect(()=>()=>{U.current&&clearInterval(U.current),V.current?.()},[]),v.useEffect(()=>{if(j||p)return;let he="";try{he=sessionStorage.getItem(l1)??""}catch{he=""}if(he)return N(he),o(!0),y(!1),S(!1),h(xe=>xe.length>0?xe:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),oe(he),()=>{}},[j,p]),v.useEffect(()=>{Z();const he=()=>{Z()};return window.addEventListener("focus",he),()=>{window.removeEventListener("focus",he)}},[Z]);const ve=()=>{try{sessionStorage.removeItem(l1)}catch{}},Oe=he=>{try{sessionStorage.setItem(l1,he)}catch{}},oe=he=>{V.current?.(),V.current=T.subscribeRunJob(he,xe=>{const Ie=new Date(xe.ts).toLocaleTimeString();if(xe.type==="started"&&(h(re=>{const me=`[${Ie}] Run started.`;return re.includes(me)?re:[...re,me]}),d(re=>Math.max(re,30)),S(!1)),xe.type==="log"){const re=String(xe.payload.message??"").trim();re&&(h(me=>{const Ne=`[${Ie}] ${re}`;return me.includes(Ne)?me:[...me,Ne]}),d(me=>{const Ne=re.toLowerCase();return Ne.startsWith("loading mcp evaluation config")?Math.max(me,15):Ne.startsWith("loaded config")?Math.max(me,20):Ne.startsWith("selected ")?Math.max(me,30):Ne.startsWith("using requested agents")||Ne.startsWith("using resolved default agents")?Math.max(me,35):Ne.startsWith("expanded to ")?Math.max(me,45):Ne.startsWith("running evaluation")?Math.max(me,55):Ne.startsWith("evaluation execution finished")?Math.max(me,75):Ne.startsWith("applying snapshot evaluation policy")?Math.max(me,82):Ne.includes("snapshot evaluation applied")||Ne.includes("snapshot evaluation enabled")?Math.max(me,88):Ne.startsWith("writing results to ")?Math.max(me,94):Ne.startsWith("run finished:")?Math.max(me,98):me}))}if(xe.type==="completed"){const re=String(xe.payload.runId??"");if(h(me=>{const Ne=`[${Ie}] Run completed.`;return me.includes(Ne)?me:[...me,Ne]}),xe.payload.snapshotEval&&typeof xe.payload.snapshotEval=="object"){const me=xe.payload.snapshotEval;h(Ne=>{const tt=`[${Ie}] Snapshot eval (${me.mode??"warn"}) baseline=${me.baseline_snapshot_id??"-"} score=${me.overall_score??"-"} status=${me.status??"-"}`;return Ne.includes(tt)?Ne:[...Ne,tt]})}d(100),o(!1),y(!0),S(!1),x(re),ve(),N(null),V.current?.(),V.current=null}if(xe.type==="error"){const re=String(xe.payload.message??"Unknown error"),me=re.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,`[${Ie}] Error: ${re}${me}`]),o(!1),y(!1),S(!1),d(0),ve(),N(null),V.current?.(),V.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(kl,{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(Me,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(sn,{value:t,onValueChange:n,children:[s.jsx(Jt,{children:s.jsx(on,{placeholder:"Select a config"})}),s.jsx(Zt,{children:X.map(he=>s.jsx(at,{value:he.id,children:he.name},he.id))})]}),s.jsx(se,{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(Fa,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Me,{children:"Variance Runs"}),s.jsx(ht,{type:"number",min:"1",max:"10",value:r,onChange:he=>a(he.target.value)})]})]}),M&&s.jsxs("div",{className:"space-y-2",children:[L&&M.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 (",M.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:M.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Me,{children:"Agents"}),s.jsx("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>P(W.map(he=>he.id)),children:"Select all"})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:W.map(he=>{const xe=_.includes(he.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(va,{checked:xe,onCheckedChange:Ie=>{const re=Ie===!0;P(me=>re?[...me,he.id]:me.filter(Ne=>Ne!==he.id))}}),s.jsx("span",{children:he.name||he.id})]},he.id)})}),W.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available in this config. Add inline agents or agent references."})]}),M&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Me,{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(he=>he.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:[A.length," of ",J.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:J.map(he=>{const xe=A.includes(he.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(va,{checked:xe,onCheckedChange:Ie=>{const re=Ie===!0;O(me=>re?[...me,he.id]:me.filter(Ne=>Ne!==he.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:he.name||he.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:he.id})]})]},he.id)})})]}),L&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(va,{checked:k,onCheckedChange:he=>R(he===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(se,{onClick:ae,disabled:i||!t||W.length>0&&_.length===0||J.length>0&&A.length===0,children:[s.jsx(kl,{className:"mr-2 h-4 w-4"}),"Run"]}),i&&s.jsxs(se,{variant:"destructive",onClick:ue,children:[s.jsx(h1,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(_t,{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(Zv,{value:c,className:"h-2"}),s.jsx("div",{ref:K,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((he,xe)=>s.jsx("div",{className:he.includes("✓")?"text-success":he.includes("aborted")?"text-destructive":"text-foreground",children:he},xe))})]})]}),g&&!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(h1,{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(se,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),S(!1)},children:"Clear Progress"}),s.jsxs(se,{type:"button",onClick:ae,disabled:!t,children:[s.jsx(kl,{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(Ol,{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(se,{asChild:!0,className:"ml-auto",children:s.jsx(yt,{to:`/results/${b||"run-a1b2c3"}${t?`?configId=${encodeURIComponent(t)}`:""}`,children:"View Results"})})]}),L&&b&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Me,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(ht,{value:$,onChange:he=>z(he.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{ie()},disabled:B,children:B?"Saving...":"Save Snapshot"})]})]})})]})},age=()=>{const{source:e}=On(),[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,y]=v.useState("desc"),[g,S]=v.useState("all"),b=k=>{if(f===k){y(R=>R==="asc"?"desc":"asc");return}h(k),y(k==="timestamp"?"desc":"asc")},x=async()=>{a(!0);try{n(await e.listResults())}catch(k){Pe({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&&Pe({title:"Could not load results",description:R instanceof Error?R.message:String(R),variant:"destructive"})}).finally(()=>{k&&a(!1)}),()=>{k=!1}},[e]);const j=v.useMemo(()=>{const k=new Set;return t.forEach(R=>{R.scenarios.forEach($=>{const z=String($.scenarioName??"").trim(),B=String($.scenarioId??"").trim(),D=z||B;D&&k.add(D)})}),Array.from(k).sort((R,$)=>R.localeCompare($))},[t]),N=v.useMemo(()=>g==="all"?t:t.filter(k=>k.scenarios.some(R=>{const $=String(R.scenarioName??"").trim(),z=String(R.scenarioId??"").trim();return($||z)===g})),[t,g]),_=v.useMemo(()=>[...N].sort((R,$)=>{let z=0;return f==="id"&&(z=R.id.localeCompare($.id)),f==="timestamp"&&(z=new Date(R.timestamp).getTime()-new Date($.timestamp).getTime()),f==="passRate"&&(z=R.overallPassRate-$.overallPassRate),f==="scenarios"&&(z=R.totalScenarios-$.totalScenarios),f==="avgToolCalls"&&(z=R.avgToolCalls-$.avgToolCalls),p==="asc"?z:-z}),[N,f,p]),P=k=>f!==k?s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(is,{className:"h-3.5 w-3.5"}):s.jsx(qt,{className:"h-3.5 w-3.5"}),A=k=>{const R=Array.from(new Map(k.scenarios.map(D=>{const K=String(D.scenarioId??"").trim(),U=String(D.scenarioName??"").trim();return!K&&!U?null:[K||U,U||K]}).filter(D=>!!D)).values()),$=Array.from(new Set(k.scenarios.map(D=>D.agentName).filter(Boolean))),z=R.slice(0,2).join(", "),B=R.length>2?` +${R.length-2}`:"";return{scenarioCount:R.length,agentCount:$.length,scenarioPreview:z?`${z}${B}`:"n/a"}},O=async k=>{d(!0);try{await e.deleteResult(k),n(R=>R.filter($=>$.id!==k)),Pe({title:"Run deleted",description:k}),o(null)}catch(R){Pe({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(bs,{open:i!==null,onOpenChange:k=>{!k&&!c&&o(null)},children:s.jsxs(Va,{children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:"Delete run?"}),s.jsxs(Ya,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(Ka,{children:[s.jsx(Qa,{disabled:c,children:"Cancel"}),s.jsx(Xa,{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(ed,{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(sn,{value:g,onValueChange:S,children:[s.jsx(Jt,{className:"w-[260px]",children:s.jsx(on,{placeholder:"Filter by scenario"})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"all",children:"All scenarios"}),j.map(k=>s.jsx(at,{value:k,children:k},k))]})]}),s.jsx(se,{variant:"outline",onClick:()=>{x()},disabled:r,children:r?"Refreshing...":"Refresh"})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("id"),children:["Run ID",P("id")]})}),s.jsx(Qe,{children:"Evaluated"}),s.jsx(Qe,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("timestamp"),children:["Timestamp",P("timestamp")]})}),s.jsx(Qe,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("passRate"),children:["Pass Rate",P("passRate")]})}),s.jsx(Qe,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("scenarios"),children:["Scenarios",P("scenarios")]})}),s.jsx(Qe,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>b("avgToolCalls"),children:["Tool Calls",P("avgToolCalls")]})}),s.jsx(Qe,{className:"w-10"})]})}),s.jsx(Jr,{children:_.map(k=>s.jsxs(Bt,{children:[s.jsx(Be,{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(Be,{className:"text-[11px] text-muted-foreground",children:(()=>{const R=A(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(Be,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Nm,{className:"h-3 w-3"}),new Date(k.timestamp).toLocaleString()]})}),s.jsx(Be,{children:s.jsx(vo,{rate:k.overallPassRate})}),s.jsx(Be,{className:"font-mono text-sm",children:k.totalScenarios}),s.jsx(Be,{className:"font-mono text-sm",children:k.avgToolCalls.toFixed(0)}),s.jsx(Be,{children:s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Cm,{className:"h-4 w-4"})})}),s.jsxs(Wo,{align:"end",children:[s.jsx(hr,{asChild:!0,children:s.jsxs(yt,{to:`/results/${k.id}`,children:[s.jsx(O7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(hr,{children:[s.jsx(ga,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(hr,{className:"text-destructive",onSelect:R=>{R.preventDefault(),o(k.id)},children:[s.jsx(xa,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},k.id))})]})})})]})};function Zu({text:e,variant:t="assistant",className:n}){const r=sge(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:ige(a,i,t)},`md-${i}`))})}function sge(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 y=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!i(t[r]);)g.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:y,code:g.join(`
146
+ `)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const y=[];for(;r<t.length&&t[r].trim().startsWith(">");)y.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:y.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(vM(t,r)){const y=gM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(gM(t[r])),r+=1;n.push({type:"table",headers:y,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const y=!!f,g=[];for(;r<t.length;){const S=t[r].trim();if(y?/^\d+\.\s+/.test(S):/^[-*+]\s+/.test(S)){g.push(S.replace(y?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:y,items:g});continue}const p=[o];for(r+=1;r<t.length;){const y=t[r],g=y.trim();if(a(y)||i(y)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||g.startsWith(">")||vM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(y),r+=1}n.push({type:"paragraph",text:p.join(`
148
+ `)})}return n}function vM(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 gM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function ige(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:xl(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:xl(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:xl(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:xl(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:xl(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:xl(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function xl(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 oge(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">${oo(c.scenarioName)}</span>
153
+ <span class="scenario-agent">${oo(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">${oo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
166
+ </div>
167
+ ${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>oo(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 — ${oo(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">${oo(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">${oo(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 oo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const lge="mcplab.resultAssistantScenarioHandoff",cge=[{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 yM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function xM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const uge=()=>{const{id:e}=Mo(),t=wa(),[n]=Ec(),{source:r}=On(),a=mf("snapshots",!1),{configs:i}=tf(),{scenarios:o}=qa(),[c,d]=v.useState(void 0),[f,h]=v.useState(!0),[p,y]=v.useState(new Set),[g,S]=v.useState(new Set),[b,x]=v.useState([]),[j,N]=v.useState(""),[_,P]=v.useState(null),[A,O]=v.useState(!1),[k,R]=v.useState(""),[$,z]=v.useState(""),[B,D]=v.useState(!1),[K,U]=v.useState(!1),[V,X]=v.useState(null),[Z,T]=v.useState([]),[L,Q]=v.useState([]),[F,M]=v.useState(""),[ee,W]=v.useState(!1),[J,ye]=v.useState(!1),[ae,ue]=v.useState("assistant"),[ie,ve]=v.useState(null),[Oe,oe]=v.useState(null),[he,xe]=v.useState(!1),[Ie,re]=v.useState(""),[me,Ne]=v.useState(""),[tt,je]=v.useState(!1),[et,dt]=v.useState(!1),[Pt,hn]=v.useState(!1),[we,Le]=v.useState([]),[qe,Rt]=v.useState(!1),[$t,Dt]=v.useState(""),[mn,jn]=v.useState(null),[or,lr]=v.useState(!1),[Na,Dn]=v.useState(null),Dr=v.useRef(null),Cr=v.useRef(null),_r=v.useCallback(async(G,fe)=>{Rt(!0);try{const Re=(await r.listMarkdownReports()).filter(Ot=>{const Nt=String(Ot.relativePath??""),Tn=String(Ot.name??"");return Nt.includes(G)||Tn.includes(G)});if(Le(Re),fe&&Re.length>0){const Ot=Re.find(Nt=>Nt.relativePath===fe||Nt.path===fe||Nt.relativePath.endsWith(fe)||Nt.path.endsWith(fe));Ot&&Dt(Ot.relativePath)}return Re}catch{return Le([]),[]}finally{Rt(!1)}},[r]);v.useEffect(()=>{if(!e)return;let G=!0;const fe=V;return fe&&(r.closeResultAssistantSession(fe).catch(()=>{}),X(null),T([]),Q([]),oe(null)),h(!0),r.getResult(e).then(nt=>{G&&(d(nt),h(!1))}),()=>{G=!1}},[e,r]),v.useEffect(()=>{let G=!0;return r.listSnapshots().then(fe=>{G&&x(fe)}).catch(()=>{G&&x([])}),()=>{G=!1}},[r]),v.useEffect(()=>{if(!c?.id){Le([]);return}let G=!0;return(async()=>{const fe=await _r(c.id)})(),()=>{G=!1}},[c?.id,_r]),v.useEffect(()=>{if(we.length===0){Dt(""),jn(null),Dn(null);return}(!$t||!we.some(G=>G.relativePath===$t))&&Dt(we[0].relativePath)},[we,$t]),v.useEffect(()=>{if(!K||ae!=="reports")return;if(!$t){jn(null),Dn(null);return}let G=!0;return lr(!0),Dn(null),r.getMarkdownReport($t).then(fe=>{G&&jn(fe)}).catch(fe=>{G&&(jn(null),Dn(fe instanceof Error?fe.message:String(fe)))}).finally(()=>{G&&lr(!1)}),()=>{G=!1}},[K,ae,$t,r]);const kn=n.get("configId")??"",xn=v.useMemo(()=>{const G=kn?i.find(fe=>fe.id===kn):void 0;return G||(c?i.find(fe=>fe.id===c.configId):void 0)},[i,kn,c]),cn=v.useMemo(()=>{const G=new Map;if(xn){for(const fe of xn.scenarios)G.set(fe.id,fe),fe.name&&!G.has(fe.name)&&G.set(fe.name,fe);for(const fe of xn.scenarioEntries??[]){if(fe.kind!=="referenced")continue;const nt=o.find(Re=>Re.id===fe.ref);nt&&(G.set(nt.id,nt),nt.name&&G.set(nt.name,nt),G.has(fe.ref)||G.set(fe.ref,nt))}}for(const fe of o)G.has(fe.id)||G.set(fe.id,fe),fe.name&&!G.has(fe.name)&&G.set(fe.name,fe);return G},[xn,o]),Rn=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const G=i.filter(fe=>fe.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return G.length===1?G[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);if(v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&N(G=>G||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if(kn&&i.some(G=>G.id===kn)){R(kn);return}Rn&&R(G=>G||Rn)},[kn,i,Rn]),v.useEffect(()=>{if(!K)return;const G=window.setTimeout(()=>{Dr.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(G)},[K,Z.length,ee]),v.useEffect(()=>()=>{V&&r.closeResultAssistantSession(V).catch(()=>{})},[V,r]),v.useEffect(()=>{const G=Cr.current;if(!G)return;G.style.height="0px";const fe=Math.min(G.scrollHeight,160);G.style.height=`${Math.max(40,fe)}px`},[F,K]),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 le=c.scenarios.reduce((G,fe)=>G+fe.runs.filter(nt=>nt.passed).length,0),ke=c.totalRuns-le,it=[{name:"Pass",value:le,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:ke,color:"hsl(0, 72%, 51%)"}],vt={};c.scenarios.forEach(G=>G.runs.forEach(fe=>fe.toolCalls.forEach(nt=>{vt[nt.name]=(vt[nt.name]||0)+1})));const zt=Object.entries(vt).map(([G,fe])=>({name:G,count:fe})).sort((G,fe)=>fe.count-G.count),tn=G=>{y(fe=>{const nt=new Set(fe);return nt.has(G)?nt.delete(G):nt.add(G),nt})},Et=(G,fe,nt,Re)=>`${G}:${fe}:${nt}:${Re}`,mr=(G,fe)=>`${G}::${fe}`,Vt=G=>{S(fe=>{const nt=new Set(fe);return nt.has(G)?nt.delete(G):nt.add(G),nt})},Ht=G=>{const fe=!G.endsWith(":conversation");return g.has(G)?!fe:fe},vr=new Map((_?.scenario_results??[]).map(G=>[G.scenario_id,G])),ei=async()=>{if(!(!c||!j)){O(!0);try{const G=await r.compareSnapshot(j,c.id);P(G)}finally{O(!1)}}},Ca=async G=>{const fe=G||c.snapshotEval?.baselineSnapshotId;if(fe){N(fe),O(!0);try{const nt=await r.compareSnapshot(fe,c.id);P(nt)}catch(nt){Pe({title:"Could not review drift",description:nt instanceof Error?nt.message:String(nt),variant:"destructive"})}finally{O(!1)}}},ti=async()=>{if(!k){Pe({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}D(!0);try{const G=await r.generateSnapshotEvalBaseline(c.id,k,$.trim()||void 0);x(fe=>[G.snapshot,...fe.filter(nt=>nt.id!==G.snapshot.id)]),N(G.snapshot.id),Pe({title:"Baseline updated",description:`${G.snapshot.name} is now linked to the selected config.`}),$.trim()||z(G.snapshot.name),c.snapshotEval?.applied&&Ca(G.snapshot.id)}catch(G){Pe({title:"Could not accept new baseline",description:G instanceof Error?G.message:String(G),variant:"destructive"})}finally{D(!1)}},H=async()=>{const G=F.trim();if(!G||!c)return;const fe=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,nt={id:fe,role:"user",text:G,createdAt:new Date().toISOString()};M(""),T(Re=>[...Re,nt]),W(!0);try{let Re=V;if(!Re){const Nt=await r.createResultAssistantSession(c.id);Re=Nt.sessionId,X(Nt.session.id),Q(Nt.session.pendingToolCalls),oe({assistantAgentName:Nt.session.selectedAssistantAgentName,provider:Nt.session.provider,model:Nt.session.model}),T(Tn=>{const Ja=Tn.some(Fn=>Fn.id===fe),Yt=Nt.session.messages;return Ja?[...Yt,nt]:Yt})}const Ot=await r.sendResultAssistantMessage(Re,G);Ye(Ot.session)}catch(Re){T(Ot=>Ot.filter(Nt=>Nt.id!==fe)),Pe({title:"MCP Labs Assistant error",description:Re instanceof Error?Re.message:String(Re),variant:"destructive"})}finally{W(!1)}},ge=G=>{M(G),requestAnimationFrame(()=>Cr.current?.focus())},Ye=G=>{X(G.id),T(G.messages),Q(G.pendingToolCalls),oe({assistantAgentName:G.selectedAssistantAgentName,provider:G.provider,model:G.model})},Ze=async G=>{if(V){W(!0);try{const fe=await r.approveResultAssistantToolCall(V,G);Ye(fe.session)}catch(fe){Pe({title:"Could not approve assistant action",description:fe instanceof Error?fe.message:String(fe),variant:"destructive"})}finally{W(!1)}}},jt=async G=>{if(V){W(!0);try{const fe=await r.denyResultAssistantToolCall(V,G);Ye(fe.session)}catch(fe){Pe({title:"Could not deny assistant action",description:fe instanceof Error?fe.message:String(fe),variant:"destructive"})}finally{W(!1)}}},wt=(G,fe)=>{ue("assistant"),U(!0),ve(fe?.scenarioId??null),Z.length===0&&T([{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()}]),G&&M(G)},Nn=G=>{ue("reports"),U(!0)},We=G=>{if(!c)return;if(!ie){Pe({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const fe=o.find(Re=>Re.id===ie)??o.find(Re=>Re.name===ie);if(!fe){Pe({title:"Scenario not found in library",description:`Could not find library scenario '${ie}' to open in Scenario Assistant.`,variant:"destructive"});return}const nt=[`I am sending a suggestion from the Result Assistant for scenario '${ie}' 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:",G].join(`
249
+ `);try{window.sessionStorage.setItem(lge,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:kn||c.configId||"",scenarioId:fe.id,prompt:nt,sourceReply:G})),t(`/libraries/test-cases/${encodeURIComponent(fe.id)}?assistantHandoff=1`)}catch(Re){Pe({title:"Could not create handoff",description:Re instanceof Error?Re.message:String(Re),variant:"destructive"})}},vn=G=>{c&&(hn(!1),re(G),Ne(yM(c.id)),je(!1),xe(!0))},Ln=()=>{c&&(hn(!0),re(""),Ne(yM(c.id)),je(!1),xe(!0))},Gt=async()=>{if(!c)return;if(!Ie.trim()){Pe({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}dt(!0);try{const fe=await r.applyResultAssistantReport({runId:c.id,markdown:Ie,outputPath:me.trim()||void 0,overwrite:tt});Pe({title:"Markdown report written",description:typeof fe.path=="string"&&fe.path?fe.path:fe.outputPath}),await _r(c.id,typeof fe.path=="string"&&fe.path||fe.outputPath||void 0),K&&ue("reports"),xe(!1)}catch(fe){Pe({title:"Could not write markdown report",description:fe instanceof Error?fe.message:String(fe),variant:"destructive"})}finally{dt(!1)}},An=async G=>{try{await navigator.clipboard.writeText(G),Pe({title:"Copied"})}catch(fe){Pe({title:"Could not copy",description:fe instanceof Error?fe.message:String(fe),variant:"destructive"})}};return s.jsxs("div",{className:`${K?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${K?"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(se,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(yt,{to:"/results",children:s.jsx(xo,{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(vo,{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(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{Ca()},disabled:A,children:[s.jsx(wj,{className:"h-3.5 w-3.5"}),A?"Reviewing drift...":"Review Drift"]}),s.jsxs(se,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const G=oge(c),fe=new Blob([G],{type:"text/html"}),nt=URL.createObjectURL(fe),Re=document.createElement("a");Re.href=nt,Re.download=`mcplab-report-${c.id}.html`,Re.click(),URL.revokeObjectURL(nt)},children:[s.jsx(ga,{className:"h-3.5 w-3.5"}),"Download Report"]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Nn(),disabled:qe,children:[s.jsx(rh,{className:"h-3.5 w-3.5"}),qe?"Reference Reports...":`Reference Reports${we.length?` (${we.length})`:""}`]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>wt(),children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${K?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 ${K?"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(Ct,{className:"pb-3",children:s.jsx(_t,{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(sn,{value:k,onValueChange:R,children:[s.jsx(Jt,{className:"h-8",children:s.jsx(on,{placeholder:"Select config to update"})}),s.jsx(Zt,{children:i.map(G=>s.jsx(at,{value:G.id,children:G.name},G.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:$,onChange:G=>z(G.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(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{Ca()},disabled:A,children:[s.jsx(Fa,{className:`h-3.5 w-3.5 ${A?"animate-spin":""}`}),"Review Drift"]}),s.jsx(se,{type:"button",size:"sm",className:"h-8",onClick:()=>{ti()},disabled:B||c.overallPassRate!==1,children:B?"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(Ts,{title:"Scenarios",value:c.totalScenarios,icon:p1}),s.jsx(Ts,{title:"Total Runs",value:c.totalRuns,icon:JM}),s.jsx(Ts,{title:"Pass Rate",value:`${Math.round(c.overallPassRate*100)}%`,icon:ed}),s.jsx(Ts,{title:"Avg Tool Calls",value:xM(c.avgToolCalls),icon:Ol}),s.jsx(Ts,{title:"Avg Latency",value:`${c.avgLatency}ms`,icon:l$})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-2",children:s.jsx(_t,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(Ue,{className:"flex items-center justify-center",children:[s.jsxs(Zde,{width:180,height:180,children:[s.jsx(Js,{data:it,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:it.map((G,fe)=>s.jsx(cv,{fill:G.color},fe))}),s.jsx(Hr,{})]}),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"}),le," 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"}),ke," failed"]})]})]})]}),s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-2",children:s.jsx(_t,{className:"text-base",children:"Tool Usage"})}),s.jsx(Ue,{children:s.jsx(X1,{width:"100%",height:180,children:s.jsxs(Jde,{data:zt,layout:"vertical",children:[s.jsx(Ao,{type:"number",tick:{fontSize:11}}),s.jsx(Eo,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Hr,{}),s.jsx(zo,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(_t,{className:"text-base",children:"Scenarios"}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>wt("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(fa,{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(sn,{value:j,onValueChange:N,children:[s.jsx(Jt,{className:"h-8",children:s.jsx(on,{placeholder:"Select snapshot"})}),s.jsx(Zt,{children:b.map(G=>s.jsx(at,{value:G.id,children:G.name},G.id))})]})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",disabled:!j||A,onClick:()=>{ei()},children:A?"Comparing...":"Compare Snapshot"}),_&&s.jsxs(Ke,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",_.overall_score]})]}),s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{className:"w-8"}),s.jsx(Qe,{children:"Scenario"}),s.jsx(Qe,{children:"Agent"}),s.jsx(Qe,{children:"Runs"}),s.jsx(Qe,{children:"Pass Rate"}),s.jsx(Qe,{children:"Tool Calls"}),s.jsx(Qe,{children:"Snapshot"})]})}),s.jsx(Jr,{children:c.scenarios.map(G=>{const fe=mr(G.scenarioId,G.agentName),nt=G.scenarioName||G.scenarioId;return s.jsx(Ci,{open:p.has(fe),onOpenChange:()=>tn(fe),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Rs,{asChild:!0,children:s.jsxs(Bt,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(Be,{children:s.jsx(qt,{className:`h-4 w-4 transition-transform ${p.has(fe)?"rotate-180":""}`})}),s.jsx(Be,{className:"font-medium text-sm",children:G.scenarioName}),s.jsx(Be,{className:"text-sm",children:G.agentName}),s.jsx(Be,{className:"font-mono text-sm",children:G.runs.length}),s.jsx(Be,{children:s.jsx(vo,{rate:G.passRate})}),s.jsx(Be,{className:"font-mono text-sm",children:xM(G.avgToolCalls)}),s.jsx(Be,{children:(()=>{const Re=vr.get(G.scenarioId);if(!Re)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const Ot=Re.status==="Match"?"bg-success/15 text-success":Re.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Ke,{variant:"outline",className:`text-xs ${Ot}`,children:[Re.status," · ",Re.score]})})()})]})}),s.jsx(_i,{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:[nt," · ",G.agentName," · ",Math.round(G.passRate*100),"% pass rate"]})]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>wt(`Explain why scenario '${nt}' failed (agent: ${G.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:G.scenarioId}),children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const Re=vr.get(G.scenarioId);return!Re||Re.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: ",Re.baseline_agents.join(", ")||"—"," · observed agents: ",Re.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Re.reasons.map((Ot,Nt)=>s.jsxs("li",{children:["• ",Ot]},Nt))})]})})(),G.runs.map(Re=>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:Re.passed?s.jsx(Ol,{className:"h-4 w-4 text-success"}):s.jsx(Xp,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const Ot=cn.get(G.scenarioId),Nt=Ot?pge(Ot.evalRules,Re.failureReasons):[],Tn=Nt.filter(Yt=>Yt.status==="failed"),Ja=Nt.filter(Yt=>Yt.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 #",Re.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Re.duration,"ms"]}),!Re.passed&&s.jsx(Ke,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Re.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(Xp,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Re.failureReasons.map((Yt,Fn)=>s.jsxs("li",{children:["• ",SM(Yt)]},Fn))})]}),Nt.length>0&&s.jsx(Ci,{open:Ht(Et(G.scenarioId,G.agentName,Re.runIndex,"checks")),onOpenChange:()=>Vt(Et(G.scenarioId,G.agentName,Re.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Rs,{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(qt,{className:`h-3.5 w-3.5 transition-transform ${Ht(Et(G.scenarioId,G.agentName,Re.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:[Ja.length," passed"]}),s.jsxs(Ke,{variant:"outline",className:`h-5 text-[10px] ${Tn.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[Tn.length," failed"]})]})}),s.jsx(_i,{children:s.jsx("div",{className:"space-y-1",children:Nt.map((Yt,Fn)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Yt.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:[Yt.status==="failed"?s.jsx(Xp,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(Ol,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:mge(Yt.rule)})]}),Yt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:SM(Yt.failureReason)})]}),s.jsx(Ke,{variant:"outline",className:`shrink-0 text-[10px] ${Yt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Yt.status})]},`${Yt.rule.type}-${Yt.rule.value}-${Fn}`))})})]})})]})})(),s.jsx(Ci,{open:Ht(Et(G.scenarioId,G.agentName,Re.runIndex,"extracts")),onOpenChange:()=>Vt(Et(G.scenarioId,G.agentName,Re.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(Rs,{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(qt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Ht(Et(G.scenarioId,G.agentName,Re.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(p1,{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(Re.extractedValues??{}).length," total"]})]})}),s.jsx(_i,{children:Object.keys(Re.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(Re.extractedValues??{}).map(([Ot,Nt])=>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:Ot}),s.jsx("div",{className:"font-mono break-all text-foreground",children:Nt===null?"null":String(Nt)})]},Ot))})})]})}),s.jsx(Ci,{open:Ht(Et(G.scenarioId,G.agentName,Re.runIndex,"tools")),onOpenChange:()=>Vt(Et(G.scenarioId,G.agentName,Re.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(Rs,{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(qt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Ht(Et(G.scenarioId,G.agentName,Re.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(Is,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Ke,{variant:"outline",className:"h-5 text-[10px]",children:[Re.toolCalls.length," total"]})]})}),s.jsx(_i,{children:Re.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:Re.toolCalls.map((Ot,Nt)=>s.jsxs(Ke,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",Nt+1]}),Ot.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[Ot.duration,"ms"]})]},Nt))})})]})}),s.jsx(Ci,{open:Ht(Et(G.scenarioId,G.agentName,Re.runIndex,"final")),onOpenChange:()=>Vt(Et(G.scenarioId,G.agentName,Re.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Rs,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(qt,{className:`h-3.5 w-3.5 transition-transform ${Ht(Et(G.scenarioId,G.agentName,Re.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(ha,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(_i,{children:s.jsx(mj,{text:Re.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Ci,{open:Ht(Et(G.scenarioId,G.agentName,Re.runIndex,"conversation")),onOpenChange:()=>Vt(Et(G.scenarioId,G.agentName,Re.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(Rs,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(qt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Ht(Et(G.scenarioId,G.agentName,Re.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(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>wt(`Explain Run #${Re.runIndex+1} for scenario '${nt}'. It ${Re.passed?"passed":"failed"} in ${Re.duration}ms. Focus on the tool sequence and ${Re.passed?"why it passed":"what caused the failure"}.`,{scenarioId:G.scenarioId}),children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})})]}),s.jsx(_i,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:Re.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Re.conversation.map(Ot=>s.jsx(dge,{item:Ot,fallbackUserPrompt:cn.get(G.scenarioId)?.prompt},Ot.id))})}),!Ht(Et(G.scenarioId,G.agentName,Re.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Re.runIndex))]})})})})]})},fe)})})]})]})]})]}),K&&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(tC,{value:ae,onValueChange:G=>ue(G),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(Uv,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(Po,{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(Po,{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"})]})}),ae==="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(Ct,{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(_t,{className:"flex items-center gap-2 text-base",children:[s.jsx(fa,{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(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ye(G=>!G),children:[J?s.jsx(sE,{className:"h-3.5 w-3.5"}):s.jsx(iE,{className:"h-3.5 w-3.5"}),J?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>U(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Ask questions about this run result, failures, tool usage, and snapshot drift."})]})}),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(xm,{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((G,fe)=>{const nt=G.role==="user",Re=G.role==="assistant",Ot=G.role==="system",Nt=G.role==="tool",Tn=G.pendingToolCallId?L.find(qc=>qc.id===G.pendingToolCallId):void 0,Ja=Re&&!!G.pendingToolCallId;if(Nt&&/^(Approved|Denied) tool call\b/i.test(String(G.text??"").trim()))return null;Tn?.server??G.toolRequestServer;const Yt=Tn?.tool??G.toolRequestName,Fn=Tn?.publicToolName??G.toolRequestPublicName,yf=Re&&!Ja&&fge(G.text,!!ie);if(Ja){const qc=Yt??Fn??"unknown_tool";return Yt&&Yt.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(ha,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!Tn,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(Is,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"truncate text-sm font-medium",children:`Tool call ${qc}`}),s.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold ${Tn?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:Tn?"Needs approval":"Completed"})]})}),s.jsx(qt,{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(Zu,{text:G.text,className:"text-sm"}),Tn&&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(Tn.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{jt(Tn.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Ze(Tn.id)},children:"Approve"})]})]})]})]})]},`${G.id??`${G.role}-${fe}`}:${Tn?"pending":"completed"}`)}const Lr=nt||Re&&!Nt&&!Ot;return s.jsxs("div",{className:`flex items-start gap-2 ${nt?"justify-end":"justify-start"}`,children:[!nt&&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:Ot?s.jsx(i$,{className:"h-3 w-3"}):s.jsx(ha,{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 ${nt?"border-primary/20 bg-primary/10":Ot?"border-amber-400/30 bg-amber-50/70":Nt?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(nt||Ot)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${nt?"text-right":""}`,children:Nt?"Tool":"Assistant"}),s.jsx(Zu,{text:G.text,className:"text-sm"}),yf&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>We(G.text),children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Send to Scenario Assistant"]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>vn(G.text),children:[s.jsx(Is,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!yf&&Re&&!Ja&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>vn(G.text),children:[s.jsx(Is,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),Lr&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{An(G.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Ri,{className:"h-3.5 w-3.5"})})]}),nt&&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(Nj,{className:"h-3 w-3"})})]},G.id??`${G.role}-${fe}`)}),L.filter(G=>!Z.some(fe=>fe.pendingToolCallId===G.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)"}),L.filter(G=>!Z.some(fe=>fe.pendingToolCallId===G.id)).map(G=>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:G.publicToolName}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[G.server,"::",G.tool]})]}),s.jsx(qt,{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(G.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{jt(G.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Ze(G.id)},children:"Approve"})]})]})]},G.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(ha,{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(sr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:Dr})]})}),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(Ks,{ref:Cr,value:F,onChange:G=>M(G.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:G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),ee||H())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsxs(se,{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(us,{className:"h-3 w-3"}),"Snippets",s.jsx(qt,{className:"h-3 w-3"})]})}),s.jsxs(Wo,{align:"start",className:"w-[360px]",children:[s.jsx(JN,{children:"Result Assistant Snippets"}),s.jsx(ZN,{}),cge.map(G=>s.jsx(hr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>ge(G.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:G.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:G.description})]})},G.label))]})]}),s.jsx(se,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:()=>{H()},disabled:ee||!F.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:ee?s.jsx(sr,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(o$,{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(Ct,{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(_t,{className:"flex items-center gap-2 text-base",children:[s.jsx(rh,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ye(G=>!G),children:[J?s.jsx(sE,{className:"h-3.5 w-3.5"}):s.jsx(iE,{className:"h-3.5 w-3.5"}),J?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>U(!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:[(qe||we.length===0||we.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:qe?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):we.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(se,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>Ln(),children:[s.jsx(us,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:we.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(sn,{value:$t,onValueChange:Dt,children:[s.jsx(Jt,{className:"h-8",children:s.jsx(on,{placeholder:"Select a report"})}),s.jsx(Zt,{children:we.map(G=>s.jsx(at,{value:G.relativePath,children:G.name},G.path))})]})]}):null})}),s.jsx(xm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:we.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):or?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(sr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Na?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Na]}):mn?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:mn.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:mn.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(mn.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(Zu,{text:mn.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]})]}),s.jsx(bs,{open:he,onOpenChange:G=>!et&&xe(G),children:s.jsxs(Va,{className:"max-w-2xl",children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:Pt?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(Ya,{children:Pt?"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:[!Pt&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(ht,{value:me,onChange:G=>Ne(G.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:et})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(va,{checked:tt,onCheckedChange:G=>je(G===!0),disabled:et}),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:Pt?"Markdown content":"Markdown preview (to be written)"}),s.jsx(Ks,{value:Ie,onChange:G=>re(G.target.value),rows:10,className:"font-mono text-xs",disabled:et})]})]}),s.jsxs(Ka,{children:[s.jsx(Qa,{disabled:et,children:"Cancel"}),s.jsx(Xa,{onClick:G=>{G.preventDefault(),Gt()},disabled:et,children:et?"Writing...":Pt?"Save Report":"Approve & Write"})]})]})})]})]})};function dge({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call")return s.jsx(wM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}`,text:e.text});if(e.kind==="tool_result"){const d=e.ok?s.jsx(Ol,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(Xp,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(wM,{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=bM(e.text,e.kind),a=t?bM(t,"user_prompt"):"",i=n&&a.length>r.length?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?Nj:ha;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(mj,{text:i,maxLength:280,className:"text-xs"}):s.jsx(mj,{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 bM(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 fge(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 wM({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(Ci,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Rs,{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(Is,{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(_i,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function mj({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(Zu,{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 pge(e,t){return e.map(n=>{const r=hge(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function hge(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 mge(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 SM(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const jM=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"],vge=()=>{const{source:e}=On(),t=mf("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"),[y,g]=v.useState("all"),[S,b]=v.useState("runs"),[x,j]=v.useState([]),[N,_]=v.useState(""),[P,A]=v.useState(""),[O,k]=v.useState(null),R=async()=>{i(!0);try{r(await e.listResults())}catch(T){Pe({title:"Could not load results",description:T instanceof Error?T.message:String(T),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{let T=!0;return i(!0),e.listResults().then(L=>{T&&r(L)}).catch(L=>{T&&Pe({title:"Could not load results",description:L instanceof Error?L.message:String(L),variant:"destructive"})}).finally(()=>{T&&i(!1)}),()=>{T=!1}},[e]),v.useEffect(()=>{let T=!0;return e.listSnapshots().then(L=>{T&&j(L)}).catch(()=>{T&&j([])}),()=>{T=!1}},[e]);const $=T=>{if(d===T){p(L=>L==="asc"?"desc":"asc");return}f(T),p(T==="timestamp"?"desc":"asc")},z=T=>{c(L=>{const Q=new Set(L);return Q.has(T)?Q.delete(T):Q.add(T),Q})},B=v.useMemo(()=>{const T=new Set;return n.forEach(L=>{L.scenarios.forEach(Q=>{const F=String(Q.scenarioName??"").trim(),M=String(Q.scenarioId??"").trim(),ee=F||M;ee&&T.add(ee)})}),Array.from(T).sort((L,Q)=>L.localeCompare(Q))},[n]),D=v.useMemo(()=>y==="all"?n:n.filter(T=>T.scenarios.some(L=>{const Q=String(L.scenarioName??"").trim(),F=String(L.scenarioId??"").trim();return(Q||F)===y})),[n,y]),K=v.useMemo(()=>[...D].sort((L,Q)=>{let F=0;return d==="id"&&(F=L.id.localeCompare(Q.id)),d==="timestamp"&&(F=new Date(L.timestamp).getTime()-new Date(Q.timestamp).getTime()),d==="passRate"&&(F=L.overallPassRate-Q.overallPassRate),d==="scenarios"&&(F=L.totalScenarios-Q.totalScenarios),h==="asc"?F:-F}),[D,d,h]),U=K.filter(T=>o.has(T.id)),V=T=>d!==T?s.jsx(Pl,{className:"h-3.5 w-3.5 text-muted-foreground"}):h==="asc"?s.jsx(is,{className:"h-3.5 w-3.5"}):s.jsx(qt,{className:"h-3.5 w-3.5"}),X=T=>{const L=Array.from(new Set(T.scenarios.map(ee=>ee.scenarioId).filter(Boolean))),Q=Array.from(new Set(T.scenarios.map(ee=>ee.agentName).filter(Boolean))),F=L.slice(0,2).join(", "),M=L.length>2?` +${L.length-2}`:"";return{scenarioCount:L.length,agentCount:Q.length,scenarioPreview:F?`${F}${M}`:"n/a"}},Z=[...new Set(U.flatMap(T=>T.scenarios.map(L=>L.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(wj,{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:[S==="runs"&&s.jsxs(sn,{value:y,onValueChange:g,children:[s.jsx(Jt,{className:"w-[260px]",children:s.jsx(on,{placeholder:"Filter by scenario"})}),s.jsxs(Zt,{children:[s.jsx(at,{value:"all",children:"All scenarios"}),B.map(T=>s.jsx(at,{value:T,children:T},T))]})]}),s.jsx(se,{variant:"outline",onClick:()=>{R()},disabled:a,children:a?"Refreshing...":"Refresh"})]})]}),S==="runs"&&s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{className:"w-10"}),s.jsx(Qe,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>$("id"),children:["Run ID",V("id")]})}),s.jsx(Qe,{children:"Evaluated"}),s.jsx(Qe,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>$("timestamp"),children:["Timestamp",V("timestamp")]})}),s.jsx(Qe,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>$("passRate"),children:["Pass Rate",V("passRate")]})}),s.jsx(Qe,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>$("scenarios"),children:["Scenarios",V("scenarios")]})})]})}),s.jsx(Jr,{children:K.map(T=>s.jsxs(Bt,{children:[s.jsx(Be,{children:s.jsx(va,{checked:o.has(T.id),onCheckedChange:()=>z(T.id),disabled:!o.has(T.id)&&o.size>=5})}),s.jsx(Be,{className:"font-mono text-xs",children:T.id}),s.jsx(Be,{className:"text-[11px] text-muted-foreground",children:(()=>{const L=X(T);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",L.scenarioCount," scenario",L.scenarioCount===1?"":"s"," · ",L.agentCount," agent",L.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:L.scenarioPreview})]})})()}),s.jsx(Be,{className:"text-xs text-muted-foreground",children:new Date(T.timestamp).toLocaleString()}),s.jsx(Be,{children:s.jsx(vo,{rate:T.overallPassRate})}),s.jsx(Be,{className:"font-mono text-sm",children:T.totalScenarios})]},T.id))})]})})}),S==="runs"&&U.length>=2&&s.jsxs(s.Fragment,{children:[U.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(se,{asChild:!0,size:"sm",children:s.jsx(yt,{to:`/compare/results?left=${encodeURIComponent(U[0].id)}&right=${encodeURIComponent(U[1].id)}&leftConfig=${encodeURIComponent(U[0].configId)}&rightConfig=${encodeURIComponent(U[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Summary Comparison"})}),s.jsx(Ue,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{children:"Metric"}),U.map((T,L)=>s.jsx(Qe,{style:{color:jM[L]},className:"font-mono text-xs",children:T.id},T.id))]})}),s.jsxs(Jr,{children:[s.jsxs(Bt,{children:[s.jsx(Be,{className:"font-medium",children:"Pass Rate"}),U.map(T=>s.jsx(Be,{children:s.jsx(vo,{rate:T.overallPassRate})},T.id))]}),s.jsxs(Bt,{children:[s.jsx(Be,{className:"font-medium",children:"Total Runs"}),U.map(T=>s.jsx(Be,{className:"font-mono",children:T.totalRuns},T.id))]}),s.jsxs(Bt,{children:[s.jsx(Be,{className:"font-medium",children:"Tool Calls"}),U.map(T=>s.jsx(Be,{className:"font-mono",children:T.avgToolCalls.toFixed(1)},T.id))]}),s.jsxs(Bt,{children:[s.jsx(Be,{className:"font-medium",children:"Avg Latency"}),U.map(T=>s.jsxs(Be,{className:"font-mono",children:[T.avgLatency,"ms"]},T.id))]})]})]})})]}),s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(Ue,{className:"p-0",children:s.jsxs(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{children:"Scenario"}),U.map((T,L)=>s.jsx(Qe,{style:{color:jM[L]},className:"font-mono text-xs",children:T.id},T.id))]})}),s.jsx(Jr,{children:Z.map(T=>s.jsxs(Bt,{children:[s.jsx(Be,{className:"font-medium text-sm",children:T}),U.map(L=>{const Q=L.scenarios.find(F=>F.scenarioId===T);return s.jsx(Be,{children:Q?s.jsx(vo,{rate:Q.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},L.id)})]},T))})]})})]})]}),t&&S==="snapshot"&&s.jsxs(ze,{children:[s.jsx(Ct,{className:"pb-3",children:s.jsx(_t,{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(sn,{value:P,onValueChange:A,children:[s.jsx(Jt,{children:s.jsx(on,{placeholder:"Select run"})}),s.jsx(Zt,{children:n.map(T=>s.jsx(at,{value:T.id,children:T.id},T.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),s.jsxs(sn,{value:N,onValueChange:_,children:[s.jsx(Jt,{children:s.jsx(on,{placeholder:"Select snapshot"})}),s.jsx(Zt,{children:x.map(T=>s.jsx(at,{value:T.id,children:T.name},T.id))})]})]})]}),s.jsx(se,{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(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{children:"Scenario"}),s.jsx(Qe,{children:"Agents"}),s.jsx(Qe,{children:"Score"}),s.jsx(Qe,{children:"Status"}),s.jsx(Qe,{children:"Reasons"})]})}),s.jsx(Jr,{children:O.scenario_results.map(T=>s.jsxs(Bt,{children:[s.jsx(Be,{children:T.scenario_id}),s.jsxs(Be,{className:"text-xs text-muted-foreground",children:["baseline: ",T.baseline_agents.join(", ")||"—"," · observed: ",T.observed_agents.join(", ")||"—"]}),s.jsx(Be,{className:"font-mono text-xs",children:T.score}),s.jsx(Be,{children:T.status}),s.jsx(Be,{className:"text-xs text-muted-foreground",children:T.reasons.slice(0,2).join("; ")||"—"})]},T.scenario_id))})]})]})]})]})]})},NM=(e,t)=>{const n=new URLSearchParams;return t&&n.set("configId",t),n.set("embed","1"),`/results/${encodeURIComponent(e)}?${n.toString()}`},gge=()=>{const[e]=Ec(),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(Ct,{children:s.jsx(_t,{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(se,{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(se,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(yt,{to:"/compare",children:[s.jsx(A7,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(se,{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(nh,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(se,{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(nh,{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(Ct,{className:"py-3",children:s.jsx(_t,{className:"text-sm font-mono",children:t})}),s.jsx(Ue,{className:"p-0",children:s.jsx("iframe",{title:`Result ${t}`,src:NM(t,r),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(ze,{className:"overflow-hidden",children:[s.jsx(Ct,{className:"py-3",children:s.jsx(_t,{className:"text-sm font-mono",children:n})}),s.jsx(Ue,{className:"p-0",children:s.jsx("iframe",{title:`Result ${n}`,src:NM(n,a),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function yge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function xge(){const{source:e}=On(),[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(g){Pe({title:"Could not load markdown reports",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t[0],[t]),p=v.useMemo(()=>t.find(g=>g.relativePath===i)??null,[t,i]),y=async()=>{if(i){d(!0);try{await e.deleteMarkdownReport(i),n(g=>g.filter(S=>S.relativePath!==i)),Pe({title:"Markdown report deleted"}),o(null)}catch(g){Pe({title:"Could not delete markdown report",description:g instanceof Error?g.message:String(g),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(rh,{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(se,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?s.jsx(se,{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(Xr,{children:[s.jsx(Qr,{children:s.jsxs(Bt,{children:[s.jsx(Qe,{children:"Report"}),s.jsx(Qe,{children:"Folder"}),s.jsx(Qe,{children:"Timestamp"}),s.jsx(Qe,{children:"Size"}),s.jsx(Qe,{className:"w-10"})]})}),s.jsx(Jr,{children:t.map(g=>s.jsxs(Bt,{children:[s.jsx(Be,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:g.name}),s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:g.relativePath})]})}),s.jsx(Be,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),s.jsx(Be,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Nm,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),s.jsx(Be,{className:"font-mono text-sm",children:yge(g.sizeBytes)}),s.jsx(Be,{children:s.jsxs(Fc,{children:[s.jsx(Bc,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Cm,{className:"h-4 w-4"})})}),s.jsxs(Wo,{align:"end",children:[s.jsx(hr,{asChild:!0,children:s.jsx(yt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),s.jsxs(hr,{className:"text-destructive",onSelect:S=>{S.preventDefault(),o(g.relativePath)},children:[s.jsx(xa,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),s.jsx(bs,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Va,{children:[s.jsxs(Ha,{children:[s.jsx(Ga,{children:"Delete markdown report?"}),s.jsx(Ya,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(Ka,{children:[s.jsx(Qa,{disabled:c,children:"Cancel"}),s.jsx(Xa,{onClick:g=>{g.preventDefault(),y()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function bge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function wge(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 Sge(){const{source:e}=On(),[t]=Ec(),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 y=!0;if(a(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(g=>{y&&a(g)}).catch(g=>{if(!y)return;const S=g instanceof Error?g.message:String(g);if(S.includes("(404)")){d(!0);return}Pe({title:"Could not load markdown report",description:S,variant:"destructive"})}).finally(()=>{y&&o(!1)}),()=>{y=!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(se,{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(se,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=wge(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()," "," · "," ",bge(r.sizeBytes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p?s.jsxs(s.Fragment,{children:[s.jsx(se,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),s.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(se,{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(Zu,{text:r.content,variant:"assistant"})})}),p?s.jsx(VD,{open:f,onOpenChange:h,children:s.jsxs(Vj,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(KD,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(GD,{className:"text-base",children:["Result ",p]}),s.jsx(se,{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 jge=()=>{const e=vs();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"})]})})},Nge=new dV;function Cge(){const{scenarioId:e}=Mo();return s.jsx(pD,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const _ge=()=>s.jsx(pV,{client:Nge,children:s.jsx(Y$,{children:s.jsx(jG,{children:s.jsx(AG,{children:s.jsxs(_G,{children:[s.jsx(yq,{}),s.jsx(Xq,{}),s.jsx(hH,{children:s.jsxs(sH,{children:[s.jsxs(Xt,{element:s.jsx(CG,{}),children:[s.jsx(Xt,{path:"/",element:s.jsx(efe,{})}),s.jsx(Xt,{path:"/mcp-evaluations",element:s.jsx(kpe,{})}),s.jsx(Xt,{path:"/mcp-evaluations/:id",element:s.jsx(eM,{})}),s.jsx(Xt,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(eM,{})}),s.jsx(Xt,{path:"/tool-analysis",element:s.jsx(Yve,{})}),s.jsx(Xt,{path:"/tool-analysis-results",element:s.jsx(Xve,{})}),s.jsx(Xt,{path:"/tool-analysis-results/:id",element:s.jsx(Qve,{})}),s.jsx(Xt,{path:"/oauth-debugger",element:s.jsx(nge,{})}),s.jsx(Xt,{path:"/libraries/servers",element:s.jsx(mme,{})}),s.jsx(Xt,{path:"/libraries/servers/:serverId",element:s.jsx(gme,{})}),s.jsx(Xt,{path:"/libraries/agents",element:s.jsx(yme,{})}),s.jsx(Xt,{path:"/libraries/agents/:agentName",element:s.jsx(Ove,{})}),s.jsx(Xt,{path:"/libraries/test-cases",element:s.jsx(lM,{})}),s.jsx(Xt,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(lM,{})}),s.jsx(Xt,{path:"/libraries/scenarios",element:s.jsx(pD,{to:"/libraries/test-cases",replace:!0})}),s.jsx(Xt,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Cge,{})}),s.jsx(Xt,{path:"/settings",element:s.jsx(kve,{})}),s.jsx(Xt,{path:"/run",element:s.jsx(rge,{})}),s.jsx(Xt,{path:"/results",element:s.jsx(age,{})}),s.jsx(Xt,{path:"/results/:id",element:s.jsx(uge,{})}),s.jsx(Xt,{path:"/markdown-reports",element:s.jsx(xge,{})}),s.jsx(Xt,{path:"/markdown-reports/view",element:s.jsx(Sge,{})}),s.jsx(Xt,{path:"/compare",element:s.jsx(vge,{})}),s.jsx(Xt,{path:"/compare/results",element:s.jsx(gge,{})})]}),s.jsx(Xt,{path:"*",element:s.jsx(jge,{})})]})})]})})})})});SU.createRoot(document.getElementById("root")).render(s.jsx(_ge,{}));