@inspectr/mcplab 1.10.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/index-cqsnfkao.css +1 -0
- package/dist/app/assets/index-ida8heao.js +249 -0
- package/dist/app/index.html +2 -2
- package/dist/app-server/app-context.d.ts +1 -0
- package/dist/app-server/app-context.d.ts.map +1 -1
- package/dist/app-server/oauth-session-manager.d.ts +4 -0
- package/dist/app-server/oauth-session-manager.d.ts.map +1 -1
- package/dist/app-server/oauth-session-manager.js +12 -0
- package/dist/app-server/oauth-session-manager.js.map +1 -1
- package/dist/app-server/router.js +1 -1
- package/dist/app-server/router.js.map +1 -1
- package/dist/app-server/runs-routes.d.ts +54 -27
- package/dist/app-server/runs-routes.d.ts.map +1 -1
- package/dist/app-server/runs-routes.js +107 -46
- package/dist/app-server/runs-routes.js.map +1 -1
- package/dist/cli.js +33 -1
- package/dist/cli.js.map +1 -1
- package/package.json +4 -4
- package/dist/app/assets/index-DBtCqMnx.js +0 -249
- package/dist/app/assets/index-DodUXbIC.css +0 -1
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
function uq(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 o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{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 o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();var Qp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dy={exports:{}},rd={},fy={exports:{}},Ut={};var EE;function dq(){if(EE)return Ut;EE=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"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g(H){return H===null||typeof H!="object"?null:(H=p&&H[p]||H["@@iterator"],typeof H=="function"?H:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function y(H,I,te){this.props=H,this.context=I,this.refs=b,this.updater=te||x}y.prototype.isReactComponent={},y.prototype.setState=function(H,I){if(typeof H!="object"&&typeof H!="function"&&H!=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,H,I,"setState")},y.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function S(){}S.prototype=y.prototype;function C(H,I,te){this.props=H,this.context=I,this.refs=b,this.updater=te||x}var N=C.prototype=new S;N.constructor=C,j(N,y.prototype),N.isPureReactComponent=!0;var E=Array.isArray,A=Object.prototype.hasOwnProperty,k={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function O(H,I,te){var de,fe={},me=null,U=null;if(I!=null)for(de in I.ref!==void 0&&(U=I.ref),I.key!==void 0&&(me=""+I.key),I)A.call(I,de)&&!T.hasOwnProperty(de)&&(fe[de]=I[de]);var oe=arguments.length-2;if(oe===1)fe.children=te;else if(1<oe){for(var re=Array(oe),ne=0;ne<oe;ne++)re[ne]=arguments[ne+2];fe.children=re}if(H&&H.defaultProps)for(de in oe=H.defaultProps,oe)fe[de]===void 0&&(fe[de]=oe[de]);return{$$typeof:e,type:H,key:me,ref:U,props:fe,_owner:k.current}}function L(H,I){return{$$typeof:e,type:H.type,key:I,ref:H.ref,props:H.props,_owner:H._owner}}function z(H){return typeof H=="object"&&H!==null&&H.$$typeof===e}function q(H){var I={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(te){return I[te]})}var F=/\/+/g;function G(H,I){return typeof H=="object"&&H!==null&&H.key!=null?q(""+H.key):I.toString(36)}function W(H,I,te,de,fe){var me=typeof H;(me==="undefined"||me==="boolean")&&(H=null);var U=!1;if(H===null)U=!0;else switch(me){case"string":case"number":U=!0;break;case"object":switch(H.$$typeof){case e:case t:U=!0}}if(U)return U=H,fe=fe(U),H=de===""?"."+G(U,0):de,E(fe)?(te="",H!=null&&(te=H.replace(F,"$&/")+"/"),W(fe,I,te,"",function(ne){return ne})):fe!=null&&(z(fe)&&(fe=L(fe,te+(!fe.key||U&&U.key===fe.key?"":(""+fe.key).replace(F,"$&/")+"/")+H)),I.push(fe)),1;if(U=0,de=de===""?".":de+":",E(H))for(var oe=0;oe<H.length;oe++){me=H[oe];var re=de+G(me,oe);U+=W(me,I,te,re,fe)}else if(re=g(H),typeof re=="function")for(H=re.call(H),oe=0;!(me=H.next()).done;)me=me.value,re=de+G(me,oe++),U+=W(me,I,te,re,fe);else if(me==="object")throw I=String(H),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.");return U}function R(H,I,te){if(H==null)return H;var de=[],fe=0;return W(H,de,"","",function(me){return I.call(te,me,fe++)}),de}function M(H){if(H._status===-1){var I=H._result;I=I(),I.then(function(te){(H._status===0||H._status===-1)&&(H._status=1,H._result=te)},function(te){(H._status===0||H._status===-1)&&(H._status=2,H._result=te)}),H._status===-1&&(H._status=0,H._result=I)}if(H._status===1)return H._result.default;throw H._result}var K={current:null},V={transition:null},D={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:V,ReactCurrentOwner:k};function J(){throw Error("act(...) is not supported in production builds of React.")}return Ut.Children={map:R,forEach:function(H,I,te){R(H,function(){I.apply(this,arguments)},te)},count:function(H){var I=0;return R(H,function(){I++}),I},toArray:function(H){return R(H,function(I){return I})||[]},only:function(H){if(!z(H))throw Error("React.Children.only expected to receive a single React element child.");return H}},Ut.Component=y,Ut.Fragment=n,Ut.Profiler=a,Ut.PureComponent=C,Ut.StrictMode=r,Ut.Suspense=d,Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,Ut.act=J,Ut.cloneElement=function(H,I,te){if(H==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+H+".");var de=j({},H.props),fe=H.key,me=H.ref,U=H._owner;if(I!=null){if(I.ref!==void 0&&(me=I.ref,U=k.current),I.key!==void 0&&(fe=""+I.key),H.type&&H.type.defaultProps)var oe=H.type.defaultProps;for(re in I)A.call(I,re)&&!T.hasOwnProperty(re)&&(de[re]=I[re]===void 0&&oe!==void 0?oe[re]:I[re])}var re=arguments.length-2;if(re===1)de.children=te;else if(1<re){oe=Array(re);for(var ne=0;ne<re;ne++)oe[ne]=arguments[ne+2];de.children=oe}return{$$typeof:e,type:H.type,key:fe,ref:me,props:de,_owner:U}},Ut.createContext=function(H){return H={$$typeof:i,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},H.Provider={$$typeof:o,_context:H},H.Consumer=H},Ut.createElement=O,Ut.createFactory=function(H){var I=O.bind(null,H);return I.type=H,I},Ut.createRef=function(){return{current:null}},Ut.forwardRef=function(H){return{$$typeof:c,render:H}},Ut.isValidElement=z,Ut.lazy=function(H){return{$$typeof:h,_payload:{_status:-1,_result:H},_init:M}},Ut.memo=function(H,I){return{$$typeof:f,type:H,compare:I===void 0?null:I}},Ut.startTransition=function(H){var I=V.transition;V.transition={};try{H()}finally{V.transition=I}},Ut.unstable_act=J,Ut.useCallback=function(H,I){return K.current.useCallback(H,I)},Ut.useContext=function(H){return K.current.useContext(H)},Ut.useDebugValue=function(){},Ut.useDeferredValue=function(H){return K.current.useDeferredValue(H)},Ut.useEffect=function(H,I){return K.current.useEffect(H,I)},Ut.useId=function(){return K.current.useId()},Ut.useImperativeHandle=function(H,I,te){return K.current.useImperativeHandle(H,I,te)},Ut.useInsertionEffect=function(H,I){return K.current.useInsertionEffect(H,I)},Ut.useLayoutEffect=function(H,I){return K.current.useLayoutEffect(H,I)},Ut.useMemo=function(H,I){return K.current.useMemo(H,I)},Ut.useReducer=function(H,I,te){return K.current.useReducer(H,I,te)},Ut.useRef=function(H){return K.current.useRef(H)},Ut.useState=function(H){return K.current.useState(H)},Ut.useSyncExternalStore=function(H,I,te){return K.current.useSyncExternalStore(H,I,te)},Ut.useTransition=function(){return K.current.useTransition()},Ut.version="18.3.1",Ut}var PE;function rN(){return PE||(PE=1,fy.exports=dq()),fy.exports}var kE;function fq(){if(kE)return rd;kE=1;var e=rN(),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,o={key:!0,ref:!0,__self:!0,__source:!0};function i(c,d,f){var h,p={},g=null,x=null;f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)r.call(d,h)&&!o.hasOwnProperty(h)&&(p[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:c,key:g,ref:x,props:p,_owner:a.current}}return rd.Fragment=n,rd.jsx=i,rd.jsxs=i,rd}var TE;function pq(){return TE||(TE=1,dy.exports=fq()),dy.exports}var s=pq(),Zp={},py={exports:{}},Lr={},hy={exports:{}},my={};var OE;function hq(){return OE||(OE=1,(function(e){function t(V,D){var J=V.length;V.push(D);e:for(;0<J;){var H=J-1>>>1,I=V[H];if(0<a(I,D))V[H]=D,V[J]=I,J=H;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var D=V[0],J=V.pop();if(J!==D){V[0]=J;e:for(var H=0,I=V.length,te=I>>>1;H<te;){var de=2*(H+1)-1,fe=V[de],me=de+1,U=V[me];if(0>a(fe,J))me<I&&0>a(U,fe)?(V[H]=U,V[me]=J,H=me):(V[H]=fe,V[de]=J,H=de);else if(me<I&&0>a(U,J))V[H]=U,V[me]=J,H=me;else break e}}return D}function a(V,D){var J=V.sortIndex-D.sortIndex;return J!==0?J:V.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,c=i.now();e.unstable_now=function(){return i.now()-c}}var d=[],f=[],h=1,p=null,g=3,x=!1,j=!1,b=!1,y=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(V){for(var D=n(f);D!==null;){if(D.callback===null)r(f);else if(D.startTime<=V)r(f),D.sortIndex=D.expirationTime,t(d,D);else break;D=n(f)}}function E(V){if(b=!1,N(V),!j)if(n(d)!==null)j=!0,M(A);else{var D=n(f);D!==null&&K(E,D.startTime-V)}}function A(V,D){j=!1,b&&(b=!1,S(O),O=-1),x=!0;var J=g;try{for(N(D),p=n(d);p!==null&&(!(p.expirationTime>D)||V&&!q());){var H=p.callback;if(typeof H=="function"){p.callback=null,g=p.priorityLevel;var I=H(p.expirationTime<=D);D=e.unstable_now(),typeof I=="function"?p.callback=I:p===n(d)&&r(d),N(D)}else r(d);p=n(d)}if(p!==null)var te=!0;else{var de=n(f);de!==null&&K(E,de.startTime-D),te=!1}return te}finally{p=null,g=J,x=!1}}var k=!1,T=null,O=-1,L=5,z=-1;function q(){return!(e.unstable_now()-z<L)}function F(){if(T!==null){var V=e.unstable_now();z=V;var D=!0;try{D=T(!0,V)}finally{D?G():(k=!1,T=null)}}else k=!1}var G;if(typeof C=="function")G=function(){C(F)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,R=W.port2;W.port1.onmessage=F,G=function(){R.postMessage(null)}}else G=function(){y(F,0)};function M(V){T=V,k||(k=!0,G())}function K(V,D){O=y(function(){V(e.unstable_now())},D)}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(V){V.callback=null},e.unstable_continueExecution=function(){j||x||(j=!0,M(A))},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(V){switch(g){case 1:case 2:case 3:var D=3;break;default:D=g}var J=g;g=D;try{return V()}finally{g=J}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(V,D){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var J=g;g=V;try{return D()}finally{g=J}},e.unstable_scheduleCallback=function(V,D,J){var H=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?H+J:H):J=H,V){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=J+I,V={id:h++,callback:D,priorityLevel:V,startTime:J,expirationTime:I,sortIndex:-1},J>H?(V.sortIndex=J,t(f,V),n(d)===null&&V===n(f)&&(b?(S(O),O=-1):b=!0,K(E,J-H))):(V.sortIndex=I,t(d,V),j||x||(j=!0,M(A))),V},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(V){var D=g;return function(){var J=g;g=D;try{return V.apply(this,arguments)}finally{g=J}}}})(my)),my}var RE;function mq(){return RE||(RE=1,hy.exports=hq()),hy.exports}var IE;function vq(){if(IE)return Lr;IE=1;var e=rN(),t=mq();function n(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,v=1;v<arguments.length;v++)u+="&args[]="+encodeURIComponent(arguments[v]);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 o(l,u){i(l,u),i(l+"Capture",u)}function i(l,u){for(a[l]=u,l=0;l<u.length;l++)r.add(u[l])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function g(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function x(l,u,v,w){if(v!==null&&v.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:v!==null?!v.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,v,w){if(u===null||typeof u>"u"||x(l,u,v,w))return!0;if(w)return!1;if(v!==null)switch(v.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,v,w,_,P,$){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=_,this.mustUseProperty=v,this.propertyName=l,this.type=u,this.sanitizeURL=P,this.removeEmptyString=$}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){y[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];y[u]=new b(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){y[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){y[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){y[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){y[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){y[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){y[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){y[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function C(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var u=l.replace(S,C);y[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(S,C);y[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(S,C);y[u]=new b(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),y.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function N(l,u,v,w){var _=y.hasOwnProperty(u)?y[u]:null;(_!==null?_.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,v,_,w)&&(v=null),w||_===null?g(u)&&(v===null?l.removeAttribute(u):l.setAttribute(u,""+v)):_.mustUseProperty?l[_.propertyName]=v===null?_.type===3?!1:"":v:(u=_.attributeName,w=_.attributeNamespace,v===null?l.removeAttribute(u):(_=_.type,v=_===3||_===4&&v===!0?"":""+v,w?l.setAttributeNS(w,u,v):l.setAttribute(u,v))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),k=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),q=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),V=Symbol.iterator;function D(l){return l===null||typeof l!="object"?null:(l=V&&l[V]||l["@@iterator"],typeof l=="function"?l:null)}var J=Object.assign,H;function I(l){if(H===void 0)try{throw Error()}catch(v){var u=v.stack.trim().match(/\n( *(at )?)/);H=u&&u[1]||""}return`
|
|
2
|
-
`+H+l}var te=!1;function de(l,u){if(!l||te)return"";te=!0;var v=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(ye){var w=ye}Reflect.construct(l,[],u)}else{try{u.call()}catch(ye){w=ye}l.call(u.prototype)}else{try{throw Error()}catch(ye){w=ye}l()}}catch(ye){if(ye&&w&&typeof ye.stack=="string"){for(var _=ye.stack.split(`
|
|
3
|
-
`),P=w.stack.split(`
|
|
4
|
-
`),$=_.length-1,Q=P.length-1;1<=$&&0<=Q&&_[$]!==P[Q];)Q--;for(;1<=$&&0<=Q;$--,Q--)if(_[$]!==P[Q]){if($!==1||Q!==1)do if($--,Q--,0>Q||_[$]!==P[Q]){var ae=`
|
|
5
|
-
`+_[$].replace(" at new "," at ");return l.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",l.displayName)),ae}while(1<=$&&0<=Q);break}}}finally{te=!1,Error.prepareStackTrace=v}return(l=l?l.displayName||l.name:"")?I(l):""}function fe(l){switch(l.tag){case 5:return I(l.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return l=de(l.type,!1),l;case 11:return l=de(l.type.render,!1),l;case 1:return l=de(l.type,!0),l;default:return""}}function me(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 T:return"Fragment";case k:return"Portal";case L:return"Profiler";case O:return"StrictMode";case G:return"Suspense";case W:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case q:return(l.displayName||"Context")+".Consumer";case z:return(l._context.displayName||"Context")+".Provider";case F:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case R:return u=l.displayName||null,u!==null?u:me(l.type)||"Memo";case M:u=l._payload,l=l._init;try{return me(l(u))}catch{}}return null}function U(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 me(u);case 8:return u===O?"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 oe(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function re(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function ne(l){var u=re(l)?"checked":"value",v=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),w=""+l[u];if(!l.hasOwnProperty(u)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var _=v.get,P=v.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return _.call(this)},set:function($){w=""+$,P.call(this,$)}}),Object.defineProperty(l,u,{enumerable:v.enumerable}),{getValue:function(){return w},setValue:function($){w=""+$},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function ve(l){l._valueTracker||(l._valueTracker=ne(l))}function le(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var v=u.getValue(),w="";return l&&(w=re(l)?l.checked?"true":"false":l.value),l=w,l!==v?(u.setValue(l),!0):!1}function Ae(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 be(l,u){var v=u.checked;return J({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??l._wrapperState.initialChecked})}function We(l,u){var v=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;v=oe(u.value!=null?u.value:v),l._wrapperState={initialChecked:w,initialValue:v,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function B(l,u){u=u.checked,u!=null&&N(l,"checked",u,!1)}function ie(l,u){B(l,u);var v=oe(u.value),w=u.type;if(v!=null)w==="number"?(v===0&&l.value===""||l.value!=v)&&(l.value=""+v):l.value!==""+v&&(l.value=""+v);else if(w==="submit"||w==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?Te(l,u.type,v):u.hasOwnProperty("defaultValue")&&Te(l,u.type,oe(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function he(l,u,v){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,v||u===l.value||(l.value=u),l.defaultValue=u}v=l.name,v!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,v!==""&&(l.name=v)}function Te(l,u,v){(u!=="number"||Ae(l.ownerDocument)!==l)&&(v==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+v&&(l.defaultValue=""+v))}var Ye=Array.isArray;function ut(l,u,v,w){if(l=l.options,u){u={};for(var _=0;_<v.length;_++)u["$"+v[_]]=!0;for(v=0;v<l.length;v++)_=u.hasOwnProperty("$"+l[v].value),l[v].selected!==_&&(l[v].selected=_),_&&w&&(l[v].defaultSelected=!0)}else{for(v=""+oe(v),u=null,_=0;_<l.length;_++){if(l[_].value===v){l[_].selected=!0,w&&(l[_].defaultSelected=!0);return}u!==null||l[_].disabled||(u=l[_])}u!==null&&(u.selected=!0)}}function dt(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return J({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function ht(l,u){var v=u.value;if(v==null){if(v=u.children,u=u.defaultValue,v!=null){if(u!=null)throw Error(n(92));if(Ye(v)){if(1<v.length)throw Error(n(93));v=v[0]}u=v}u==null&&(u=""),v=u}l._wrapperState={initialValue:oe(v)}}function jt(l,u){var v=oe(u.value),w=oe(u.defaultValue);v!=null&&(v=""+v,v!==l.value&&(l.value=v),u.defaultValue==null&&l.defaultValue!==v&&(l.defaultValue=v)),w!=null&&(l.defaultValue=""+w)}function It(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function Dt(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 qt(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?Dt(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var ee,Ee=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,v,w,_){MSApp.execUnsafeLocalFunction(function(){return l(u,v,w,_)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(ee=ee||document.createElement("div"),ee.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=ee.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function Ne(l,u){if(u){var v=l.firstChild;if(v&&v===l.lastChild&&v.nodeType===3){v.nodeValue=u;return}}l.textContent=u}var Ge={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},_e=["Webkit","ms","Moz","O"];Object.keys(Ge).forEach(function(l){_e.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Ge[u]=Ge[l]})});function Le(l,u,v){return u==null||typeof u=="boolean"||u===""?"":v||typeof u!="number"||u===0||Ge.hasOwnProperty(l)&&Ge[l]?(""+u).trim():u+"px"}function Lt(l,u){l=l.style;for(var v in u)if(u.hasOwnProperty(v)){var w=v.indexOf("--")===0,_=Le(v,u[v],w);v==="float"&&(v="cssFloat"),w?l.setProperty(v,_):l[v]=_}}var cn=J({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 Sn(l,u){if(u){if(cn[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 Or(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 we=null;function _t(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var $t=null,Wt=null,tn=null;function Gt(l){if(l=Uu(l)){if(typeof $t!="function")throw Error(n(280));var u=l.stateNode;u&&(u=pp(u),$t(l.stateNode,l.type,u))}}function hr(l){Wt?tn?tn.push(l):tn=[l]:Wt=l}function ft(){if(Wt){var l=Wt,u=tn;if(tn=Wt=null,Gt(l),u)for(l=0;l<u.length;l++)Gt(u[l])}}function Pt(l,u){return l(u)}function Rt(){}var nn=!1;function Fn(l,u,v){if(nn)return l(u,v);nn=!0;try{return Pt(l,u,v)}finally{nn=!1,(Wt!==null||tn!==null)&&(Rt(),ft())}}function ue(l,u){var v=l.stateNode;if(v===null)return null;var w=pp(v);if(w===null)return null;v=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(v&&typeof v!="function")throw Error(n(231,u,typeof v));return v}var nt=!1;if(c)try{var bt={};Object.defineProperty(bt,"passive",{get:function(){nt=!0}}),window.addEventListener("test",bt,bt),window.removeEventListener("test",bt,bt)}catch{nt=!1}function Jt(l,u,v,w,_,P,$,Q,ae){var ye=Array.prototype.slice.call(arguments,3);try{u.apply(v,ye)}catch(Oe){this.onError(Oe)}}var mt=!1,kn=null,cr=!1,ma=null,xo={onError:function(l){mt=!0,kn=l}};function X(l,u,v,w,_,P,$,Q,ae){mt=!1,kn=null,Jt.apply(xo,arguments)}function xe(l,u,v,w,_,P,$,Q,ae){if(X.apply(this,arguments),mt){if(mt){var ye=kn;mt=!1,kn=null}else throw Error(n(198));cr||(cr=!0,ma=ye)}}function Ve(l){var u=l,v=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(v=u.return),l=u.return;while(l)}return u.tag===3?v:null}function ct(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 Ft(l){if(Ve(l)!==l)throw Error(n(188))}function Ht(l){var u=l.alternate;if(!u){if(u=Ve(l),u===null)throw Error(n(188));return u!==l?null:l}for(var v=l,w=u;;){var _=v.return;if(_===null)break;var P=_.alternate;if(P===null){if(w=_.return,w!==null){v=w;continue}break}if(_.child===P.child){for(P=_.child;P;){if(P===v)return Ft(_),l;if(P===w)return Ft(_),u;P=P.sibling}throw Error(n(188))}if(v.return!==w.return)v=_,w=P;else{for(var $=!1,Q=_.child;Q;){if(Q===v){$=!0,v=_,w=P;break}if(Q===w){$=!0,w=_,v=P;break}Q=Q.sibling}if(!$){for(Q=P.child;Q;){if(Q===v){$=!0,v=P,w=_;break}if(Q===w){$=!0,w=P,v=_;break}Q=Q.sibling}if(!$)throw Error(n(189))}}if(v.alternate!==w)throw Error(n(190))}if(v.tag!==3)throw Error(n(188));return v.stateNode.current===v?l:u}function Bt(l){return l=Ht(l),l!==null?Bn(l):null}function Bn(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=Bn(l);if(u!==null)return u;l=l.sibling}return null}var He=t.unstable_scheduleCallback,rn=t.unstable_cancelCallback,Yt=t.unstable_shouldYield,zn=t.unstable_requestPaint,Nn=t.unstable_now,Tg=t.unstable_getCurrentPriorityLevel,yo=t.unstable_ImmediatePriority,Su=t.unstable_UserBlockingPriority,Sl=t.unstable_NormalPriority,Og=t.unstable_LowPriority,Jf=t.unstable_IdlePriority,di=null,va=null;function Rg(l){if(va&&typeof va.onCommitFiberRoot=="function")try{va.onCommitFiberRoot(di,l,void 0,(l.current.flags&128)===128)}catch{}}var Jr=Math.clz32?Math.clz32:Ce,Ig=Math.log,Z=Math.LN2;function Ce(l){return l>>>=0,l===0?32:31-(Ig(l)/Z|0)|0}var it=64,Me=4194304;function zt(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 At(l,u){var v=l.pendingLanes;if(v===0)return 0;var w=0,_=l.suspendedLanes,P=l.pingedLanes,$=v&268435455;if($!==0){var Q=$&~_;Q!==0?w=zt(Q):(P&=$,P!==0&&(w=zt(P)))}else $=v&~_,$!==0?w=zt($):P!==0&&(w=zt(P));if(w===0)return 0;if(u!==0&&u!==w&&(u&_)===0&&(_=w&-w,P=u&-u,_>=P||_===16&&(P&4194240)!==0))return u;if((w&4)!==0&&(w|=v&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=w;0<u;)v=31-Jr(u),_=1<<v,w|=l[v],u&=~_;return w}function Cn(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 mr(l,u){for(var v=l.suspendedLanes,w=l.pingedLanes,_=l.expirationTimes,P=l.pendingLanes;0<P;){var $=31-Jr(P),Q=1<<$,ae=_[$];ae===-1?((Q&v)===0||(Q&w)!==0)&&(_[$]=Cn(Q,u)):ae<=u&&(l.expiredLanes|=Q),P&=~Q}}function un(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function bo(){var l=it;return it<<=1,(it&4194240)===0&&(it=64),l}function Nl(l){for(var u=[],v=0;31>v;v++)u.push(l);return u}function fi(l,u,v){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Jr(u),l[u]=v}function Nu(l,u){var v=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<v;){var _=31-Jr(v),P=1<<_;u[_]=0,w[_]=-1,l[_]=-1,v&=~P}}function Cu(l,u){var v=l.entangledLanes|=u;for(l=l.entanglements;v;){var w=31-Jr(v),_=1<<w;_&u|l[w]&u&&(l[w]|=u),v&=~_}}var on=0;function o_(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var i_,Mg,l_,c_,u_,$g=!1,Qf=[],wo=null,jo=null,So=null,_u=new Map,Au=new Map,No=[],O6="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 d_(l,u){switch(l){case"focusin":case"focusout":wo=null;break;case"dragenter":case"dragleave":jo=null;break;case"mouseover":case"mouseout":So=null;break;case"pointerover":case"pointerout":_u.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Au.delete(u.pointerId)}}function Eu(l,u,v,w,_,P){return l===null||l.nativeEvent!==P?(l={blockedOn:u,domEventName:v,eventSystemFlags:w,nativeEvent:P,targetContainers:[_]},u!==null&&(u=Uu(u),u!==null&&Mg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,_!==null&&u.indexOf(_)===-1&&u.push(_),l)}function R6(l,u,v,w,_){switch(u){case"focusin":return wo=Eu(wo,l,u,v,w,_),!0;case"dragenter":return jo=Eu(jo,l,u,v,w,_),!0;case"mouseover":return So=Eu(So,l,u,v,w,_),!0;case"pointerover":var P=_.pointerId;return _u.set(P,Eu(_u.get(P)||null,l,u,v,w,_)),!0;case"gotpointercapture":return P=_.pointerId,Au.set(P,Eu(Au.get(P)||null,l,u,v,w,_)),!0}return!1}function f_(l){var u=pi(l.target);if(u!==null){var v=Ve(u);if(v!==null){if(u=v.tag,u===13){if(u=ct(v),u!==null){l.blockedOn=u,u_(l.priority,function(){l_(v)});return}}else if(u===3&&v.stateNode.current.memoizedState.isDehydrated){l.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}l.blockedOn=null}function Zf(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var v=Lg(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(v===null){v=l.nativeEvent;var w=new v.constructor(v.type,v);we=w,v.target.dispatchEvent(w),we=null}else return u=Uu(v),u!==null&&Mg(u),l.blockedOn=v,!1;u.shift()}return!0}function p_(l,u,v){Zf(l)&&v.delete(u)}function I6(){$g=!1,wo!==null&&Zf(wo)&&(wo=null),jo!==null&&Zf(jo)&&(jo=null),So!==null&&Zf(So)&&(So=null),_u.forEach(p_),Au.forEach(p_)}function Pu(l,u){l.blockedOn===u&&(l.blockedOn=null,$g||($g=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,I6)))}function ku(l){function u(_){return Pu(_,l)}if(0<Qf.length){Pu(Qf[0],l);for(var v=1;v<Qf.length;v++){var w=Qf[v];w.blockedOn===l&&(w.blockedOn=null)}}for(wo!==null&&Pu(wo,l),jo!==null&&Pu(jo,l),So!==null&&Pu(So,l),_u.forEach(u),Au.forEach(u),v=0;v<No.length;v++)w=No[v],w.blockedOn===l&&(w.blockedOn=null);for(;0<No.length&&(v=No[0],v.blockedOn===null);)f_(v),v.blockedOn===null&&No.shift()}var Cl=E.ReactCurrentBatchConfig,ep=!0;function M6(l,u,v,w){var _=on,P=Cl.transition;Cl.transition=null;try{on=1,Dg(l,u,v,w)}finally{on=_,Cl.transition=P}}function $6(l,u,v,w){var _=on,P=Cl.transition;Cl.transition=null;try{on=4,Dg(l,u,v,w)}finally{on=_,Cl.transition=P}}function Dg(l,u,v,w){if(ep){var _=Lg(l,u,v,w);if(_===null)tx(l,u,w,tp,v),d_(l,w);else if(R6(_,l,u,v,w))w.stopPropagation();else if(d_(l,w),u&4&&-1<O6.indexOf(l)){for(;_!==null;){var P=Uu(_);if(P!==null&&i_(P),P=Lg(l,u,v,w),P===null&&tx(l,u,w,tp,v),P===_)break;_=P}_!==null&&w.stopPropagation()}else tx(l,u,w,null,v)}}var tp=null;function Lg(l,u,v,w){if(tp=null,l=_t(w),l=pi(l),l!==null)if(u=Ve(l),u===null)l=null;else if(v=u.tag,v===13){if(l=ct(u),l!==null)return l;l=null}else if(v===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null);return tp=l,null}function h_(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(Tg()){case yo:return 1;case Su:return 4;case Sl:case Og:return 16;case Jf:return 536870912;default:return 16}default:return 16}}var Co=null,Fg=null,np=null;function m_(){if(np)return np;var l,u=Fg,v=u.length,w,_="value"in Co?Co.value:Co.textContent,P=_.length;for(l=0;l<v&&u[l]===_[l];l++);var $=v-l;for(w=1;w<=$&&u[v-w]===_[P-w];w++);return np=_.slice(l,1<w?1-w:void 0)}function rp(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 ap(){return!0}function v_(){return!1}function Qr(l){function u(v,w,_,P,$){this._reactName=v,this._targetInst=_,this.type=w,this.nativeEvent=P,this.target=$,this.currentTarget=null;for(var Q in l)l.hasOwnProperty(Q)&&(v=l[Q],this[Q]=v?v(P):P[Q]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?ap:v_,this.isPropagationStopped=v_,this}return J(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=ap)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=ap)},persist:function(){},isPersistent:ap}),u}var _l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bg=Qr(_l),Tu=J({},_l,{view:0,detail:0}),D6=Qr(Tu),zg,Ug,Ou,sp=J({},Tu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wg,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!==Ou&&(Ou&&l.type==="mousemove"?(zg=l.screenX-Ou.screenX,Ug=l.screenY-Ou.screenY):Ug=zg=0,Ou=l),zg)},movementY:function(l){return"movementY"in l?l.movementY:Ug}}),g_=Qr(sp),L6=J({},sp,{dataTransfer:0}),F6=Qr(L6),B6=J({},Tu,{relatedTarget:0}),qg=Qr(B6),z6=J({},_l,{animationName:0,elapsedTime:0,pseudoElement:0}),U6=Qr(z6),q6=J({},_l,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),W6=Qr(q6),V6=J({},_l,{data:0}),x_=Qr(V6),H6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K6={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"},G6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Y6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=G6[l])?!!u[l]:!1}function Wg(){return Y6}var X6=J({},Tu,{key:function(l){if(l.key){var u=H6[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=rp(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?K6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wg,charCode:function(l){return l.type==="keypress"?rp(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?rp(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),J6=Qr(X6),Q6=J({},sp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),y_=Qr(Q6),Z6=J({},Tu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wg}),eU=Qr(Z6),tU=J({},_l,{propertyName:0,elapsedTime:0,pseudoElement:0}),nU=Qr(tU),rU=J({},sp,{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}),aU=Qr(rU),sU=[9,13,27,32],Vg=c&&"CompositionEvent"in window,Ru=null;c&&"documentMode"in document&&(Ru=document.documentMode);var oU=c&&"TextEvent"in window&&!Ru,b_=c&&(!Vg||Ru&&8<Ru&&11>=Ru),w_=" ",j_=!1;function S_(l,u){switch(l){case"keyup":return sU.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N_(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Al=!1;function iU(l,u){switch(l){case"compositionend":return N_(u);case"keypress":return u.which!==32?null:(j_=!0,w_);case"textInput":return l=u.data,l===w_&&j_?null:l;default:return null}}function lU(l,u){if(Al)return l==="compositionend"||!Vg&&S_(l,u)?(l=m_(),np=Fg=Co=null,Al=!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 b_&&u.locale!=="ko"?null:u.data;default:return null}}var cU={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 C_(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!cU[l.type]:u==="textarea"}function __(l,u,v,w){hr(w),u=up(u,"onChange"),0<u.length&&(v=new Bg("onChange","change",null,v,w),l.push({event:v,listeners:u}))}var Iu=null,Mu=null;function uU(l){W_(l,0)}function op(l){var u=Ol(l);if(le(u))return l}function dU(l,u){if(l==="change")return u}var A_=!1;if(c){var Hg;if(c){var Kg="oninput"in document;if(!Kg){var E_=document.createElement("div");E_.setAttribute("oninput","return;"),Kg=typeof E_.oninput=="function"}Hg=Kg}else Hg=!1;A_=Hg&&(!document.documentMode||9<document.documentMode)}function P_(){Iu&&(Iu.detachEvent("onpropertychange",k_),Mu=Iu=null)}function k_(l){if(l.propertyName==="value"&&op(Mu)){var u=[];__(u,Mu,l,_t(l)),Fn(uU,u)}}function fU(l,u,v){l==="focusin"?(P_(),Iu=u,Mu=v,Iu.attachEvent("onpropertychange",k_)):l==="focusout"&&P_()}function pU(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return op(Mu)}function hU(l,u){if(l==="click")return op(u)}function mU(l,u){if(l==="input"||l==="change")return op(u)}function vU(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Da=typeof Object.is=="function"?Object.is:vU;function $u(l,u){if(Da(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var v=Object.keys(l),w=Object.keys(u);if(v.length!==w.length)return!1;for(w=0;w<v.length;w++){var _=v[w];if(!d.call(u,_)||!Da(l[_],u[_]))return!1}return!0}function T_(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function O_(l,u){var v=T_(l);l=0;for(var w;v;){if(v.nodeType===3){if(w=l+v.textContent.length,l<=u&&w>=u)return{node:v,offset:u-l};l=w}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=T_(v)}}function R_(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?R_(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function I_(){for(var l=window,u=Ae();u instanceof l.HTMLIFrameElement;){try{var v=typeof u.contentWindow.location.href=="string"}catch{v=!1}if(v)l=u.contentWindow;else break;u=Ae(l.document)}return u}function Gg(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 gU(l){var u=I_(),v=l.focusedElem,w=l.selectionRange;if(u!==v&&v&&v.ownerDocument&&R_(v.ownerDocument.documentElement,v)){if(w!==null&&Gg(v)){if(u=w.start,l=w.end,l===void 0&&(l=u),"selectionStart"in v)v.selectionStart=u,v.selectionEnd=Math.min(l,v.value.length);else if(l=(u=v.ownerDocument||document)&&u.defaultView||window,l.getSelection){l=l.getSelection();var _=v.textContent.length,P=Math.min(w.start,_);w=w.end===void 0?P:Math.min(w.end,_),!l.extend&&P>w&&(_=w,w=P,P=_),_=O_(v,P);var $=O_(v,w);_&&$&&(l.rangeCount!==1||l.anchorNode!==_.node||l.anchorOffset!==_.offset||l.focusNode!==$.node||l.focusOffset!==$.offset)&&(u=u.createRange(),u.setStart(_.node,_.offset),l.removeAllRanges(),P>w?(l.addRange(u),l.extend($.node,$.offset)):(u.setEnd($.node,$.offset),l.addRange(u)))}}for(u=[],l=v;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<u.length;v++)l=u[v],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var xU=c&&"documentMode"in document&&11>=document.documentMode,El=null,Yg=null,Du=null,Xg=!1;function M_(l,u,v){var w=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Xg||El==null||El!==Ae(w)||(w=El,"selectionStart"in w&&Gg(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}),Du&&$u(Du,w)||(Du=w,w=up(Yg,"onSelect"),0<w.length&&(u=new Bg("onSelect","select",null,u,v),l.push({event:u,listeners:w}),u.target=El)))}function ip(l,u){var v={};return v[l.toLowerCase()]=u.toLowerCase(),v["Webkit"+l]="webkit"+u,v["Moz"+l]="moz"+u,v}var Pl={animationend:ip("Animation","AnimationEnd"),animationiteration:ip("Animation","AnimationIteration"),animationstart:ip("Animation","AnimationStart"),transitionend:ip("Transition","TransitionEnd")},Jg={},$_={};c&&($_=document.createElement("div").style,"AnimationEvent"in window||(delete Pl.animationend.animation,delete Pl.animationiteration.animation,delete Pl.animationstart.animation),"TransitionEvent"in window||delete Pl.transitionend.transition);function lp(l){if(Jg[l])return Jg[l];if(!Pl[l])return l;var u=Pl[l],v;for(v in u)if(u.hasOwnProperty(v)&&v in $_)return Jg[l]=u[v];return l}var D_=lp("animationend"),L_=lp("animationiteration"),F_=lp("animationstart"),B_=lp("transitionend"),z_=new Map,U_="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 _o(l,u){z_.set(l,u),o(u,[l])}for(var Qg=0;Qg<U_.length;Qg++){var Zg=U_[Qg],yU=Zg.toLowerCase(),bU=Zg[0].toUpperCase()+Zg.slice(1);_o(yU,"on"+bU)}_o(D_,"onAnimationEnd"),_o(L_,"onAnimationIteration"),_o(F_,"onAnimationStart"),_o("dblclick","onDoubleClick"),_o("focusin","onFocus"),_o("focusout","onBlur"),_o(B_,"onTransitionEnd"),i("onMouseEnter",["mouseout","mouseover"]),i("onMouseLeave",["mouseout","mouseover"]),i("onPointerEnter",["pointerout","pointerover"]),i("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lu="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(" "),wU=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lu));function q_(l,u,v){var w=l.type||"unknown-event";l.currentTarget=v,xe(w,u,void 0,l),l.currentTarget=null}function W_(l,u){u=(u&4)!==0;for(var v=0;v<l.length;v++){var w=l[v],_=w.event;w=w.listeners;e:{var P=void 0;if(u)for(var $=w.length-1;0<=$;$--){var Q=w[$],ae=Q.instance,ye=Q.currentTarget;if(Q=Q.listener,ae!==P&&_.isPropagationStopped())break e;q_(_,Q,ye),P=ae}else for($=0;$<w.length;$++){if(Q=w[$],ae=Q.instance,ye=Q.currentTarget,Q=Q.listener,ae!==P&&_.isPropagationStopped())break e;q_(_,Q,ye),P=ae}}}if(cr)throw l=ma,cr=!1,ma=null,l}function _n(l,u){var v=u[ix];v===void 0&&(v=u[ix]=new Set);var w=l+"__bubble";v.has(w)||(V_(u,l,2,!1),v.add(w))}function ex(l,u,v){var w=0;u&&(w|=4),V_(v,l,w,u)}var cp="_reactListening"+Math.random().toString(36).slice(2);function Fu(l){if(!l[cp]){l[cp]=!0,r.forEach(function(v){v!=="selectionchange"&&(wU.has(v)||ex(v,!1,l),ex(v,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[cp]||(u[cp]=!0,ex("selectionchange",!1,u))}}function V_(l,u,v,w){switch(h_(u)){case 1:var _=M6;break;case 4:_=$6;break;default:_=Dg}v=_.bind(null,u,v,l),_=void 0,!nt||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(_=!0),w?_!==void 0?l.addEventListener(u,v,{capture:!0,passive:_}):l.addEventListener(u,v,!0):_!==void 0?l.addEventListener(u,v,{passive:_}):l.addEventListener(u,v,!1)}function tx(l,u,v,w,_){var P=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var $=w.tag;if($===3||$===4){var Q=w.stateNode.containerInfo;if(Q===_||Q.nodeType===8&&Q.parentNode===_)break;if($===4)for($=w.return;$!==null;){var ae=$.tag;if((ae===3||ae===4)&&(ae=$.stateNode.containerInfo,ae===_||ae.nodeType===8&&ae.parentNode===_))return;$=$.return}for(;Q!==null;){if($=pi(Q),$===null)return;if(ae=$.tag,ae===5||ae===6){w=P=$;continue e}Q=Q.parentNode}}w=w.return}Fn(function(){var ye=P,Oe=_t(v),Ie=[];e:{var ke=z_.get(l);if(ke!==void 0){var Xe=Bg,rt=l;switch(l){case"keypress":if(rp(v)===0)break e;case"keydown":case"keyup":Xe=J6;break;case"focusin":rt="focus",Xe=qg;break;case"focusout":rt="blur",Xe=qg;break;case"beforeblur":case"afterblur":Xe=qg;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Xe=g_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Xe=F6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Xe=eU;break;case D_:case L_:case F_:Xe=U6;break;case B_:Xe=nU;break;case"scroll":Xe=D6;break;case"wheel":Xe=aU;break;case"copy":case"cut":case"paste":Xe=W6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Xe=y_}var st=(u&4)!==0,Un=!st&&l==="scroll",pe=st?ke!==null?ke+"Capture":null:ke;st=[];for(var ce=ye,ge;ce!==null;){ge=ce;var De=ge.stateNode;if(ge.tag===5&&De!==null&&(ge=De,pe!==null&&(De=ue(ce,pe),De!=null&&st.push(Bu(ce,De,ge)))),Un)break;ce=ce.return}0<st.length&&(ke=new Xe(ke,rt,null,v,Oe),Ie.push({event:ke,listeners:st}))}}if((u&7)===0){e:{if(ke=l==="mouseover"||l==="pointerover",Xe=l==="mouseout"||l==="pointerout",ke&&v!==we&&(rt=v.relatedTarget||v.fromElement)&&(pi(rt)||rt[Ls]))break e;if((Xe||ke)&&(ke=Oe.window===Oe?Oe:(ke=Oe.ownerDocument)?ke.defaultView||ke.parentWindow:window,Xe?(rt=v.relatedTarget||v.toElement,Xe=ye,rt=rt?pi(rt):null,rt!==null&&(Un=Ve(rt),rt!==Un||rt.tag!==5&&rt.tag!==6)&&(rt=null)):(Xe=null,rt=ye),Xe!==rt)){if(st=g_,De="onMouseLeave",pe="onMouseEnter",ce="mouse",(l==="pointerout"||l==="pointerover")&&(st=y_,De="onPointerLeave",pe="onPointerEnter",ce="pointer"),Un=Xe==null?ke:Ol(Xe),ge=rt==null?ke:Ol(rt),ke=new st(De,ce+"leave",Xe,v,Oe),ke.target=Un,ke.relatedTarget=ge,De=null,pi(Oe)===ye&&(st=new st(pe,ce+"enter",rt,v,Oe),st.target=ge,st.relatedTarget=Un,De=st),Un=De,Xe&&rt)t:{for(st=Xe,pe=rt,ce=0,ge=st;ge;ge=kl(ge))ce++;for(ge=0,De=pe;De;De=kl(De))ge++;for(;0<ce-ge;)st=kl(st),ce--;for(;0<ge-ce;)pe=kl(pe),ge--;for(;ce--;){if(st===pe||pe!==null&&st===pe.alternate)break t;st=kl(st),pe=kl(pe)}st=null}else st=null;Xe!==null&&H_(Ie,ke,Xe,st,!1),rt!==null&&Un!==null&&H_(Ie,Un,rt,st,!0)}}e:{if(ke=ye?Ol(ye):window,Xe=ke.nodeName&&ke.nodeName.toLowerCase(),Xe==="select"||Xe==="input"&&ke.type==="file")var lt=dU;else if(C_(ke))if(A_)lt=mU;else{lt=pU;var vt=fU}else(Xe=ke.nodeName)&&Xe.toLowerCase()==="input"&&(ke.type==="checkbox"||ke.type==="radio")&&(lt=hU);if(lt&&(lt=lt(l,ye))){__(Ie,lt,v,Oe);break e}vt&&vt(l,ke,ye),l==="focusout"&&(vt=ke._wrapperState)&&vt.controlled&&ke.type==="number"&&Te(ke,"number",ke.value)}switch(vt=ye?Ol(ye):window,l){case"focusin":(C_(vt)||vt.contentEditable==="true")&&(El=vt,Yg=ye,Du=null);break;case"focusout":Du=Yg=El=null;break;case"mousedown":Xg=!0;break;case"contextmenu":case"mouseup":case"dragend":Xg=!1,M_(Ie,v,Oe);break;case"selectionchange":if(xU)break;case"keydown":case"keyup":M_(Ie,v,Oe)}var gt;if(Vg)e:{switch(l){case"compositionstart":var Et="onCompositionStart";break e;case"compositionend":Et="onCompositionEnd";break e;case"compositionupdate":Et="onCompositionUpdate";break e}Et=void 0}else Al?S_(l,v)&&(Et="onCompositionEnd"):l==="keydown"&&v.keyCode===229&&(Et="onCompositionStart");Et&&(b_&&v.locale!=="ko"&&(Al||Et!=="onCompositionStart"?Et==="onCompositionEnd"&&Al&&(gt=m_()):(Co=Oe,Fg="value"in Co?Co.value:Co.textContent,Al=!0)),vt=up(ye,Et),0<vt.length&&(Et=new x_(Et,l,null,v,Oe),Ie.push({event:Et,listeners:vt}),gt?Et.data=gt:(gt=N_(v),gt!==null&&(Et.data=gt)))),(gt=oU?iU(l,v):lU(l,v))&&(ye=up(ye,"onBeforeInput"),0<ye.length&&(Oe=new x_("onBeforeInput","beforeinput",null,v,Oe),Ie.push({event:Oe,listeners:ye}),Oe.data=gt))}W_(Ie,u)})}function Bu(l,u,v){return{instance:l,listener:u,currentTarget:v}}function up(l,u){for(var v=u+"Capture",w=[];l!==null;){var _=l,P=_.stateNode;_.tag===5&&P!==null&&(_=P,P=ue(l,v),P!=null&&w.unshift(Bu(l,P,_)),P=ue(l,u),P!=null&&w.push(Bu(l,P,_))),l=l.return}return w}function kl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function H_(l,u,v,w,_){for(var P=u._reactName,$=[];v!==null&&v!==w;){var Q=v,ae=Q.alternate,ye=Q.stateNode;if(ae!==null&&ae===w)break;Q.tag===5&&ye!==null&&(Q=ye,_?(ae=ue(v,P),ae!=null&&$.unshift(Bu(v,ae,Q))):_||(ae=ue(v,P),ae!=null&&$.push(Bu(v,ae,Q)))),v=v.return}$.length!==0&&l.push({event:u,listeners:$})}var jU=/\r\n?/g,SU=/\u0000|\uFFFD/g;function K_(l){return(typeof l=="string"?l:""+l).replace(jU,`
|
|
6
|
-
`).replace(SU,"")}function dp(l,u,v){if(u=K_(u),K_(l)!==u&&v)throw Error(n(425))}function fp(){}var nx=null,rx=null;function ax(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 sx=typeof setTimeout=="function"?setTimeout:void 0,NU=typeof clearTimeout=="function"?clearTimeout:void 0,G_=typeof Promise=="function"?Promise:void 0,CU=typeof queueMicrotask=="function"?queueMicrotask:typeof G_<"u"?function(l){return G_.resolve(null).then(l).catch(_U)}:sx;function _U(l){setTimeout(function(){throw l})}function ox(l,u){var v=u,w=0;do{var _=v.nextSibling;if(l.removeChild(v),_&&_.nodeType===8)if(v=_.data,v==="/$"){if(w===0){l.removeChild(_),ku(u);return}w--}else v!=="$"&&v!=="$?"&&v!=="$!"||w++;v=_}while(v);ku(u)}function Ao(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 Y_(l){l=l.previousSibling;for(var u=0;l;){if(l.nodeType===8){var v=l.data;if(v==="$"||v==="$!"||v==="$?"){if(u===0)return l;u--}else v==="/$"&&u++}l=l.previousSibling}return null}var Tl=Math.random().toString(36).slice(2),ds="__reactFiber$"+Tl,zu="__reactProps$"+Tl,Ls="__reactContainer$"+Tl,ix="__reactEvents$"+Tl,AU="__reactListeners$"+Tl,EU="__reactHandles$"+Tl;function pi(l){var u=l[ds];if(u)return u;for(var v=l.parentNode;v;){if(u=v[Ls]||v[ds]){if(v=u.alternate,u.child!==null||v!==null&&v.child!==null)for(l=Y_(l);l!==null;){if(v=l[ds])return v;l=Y_(l)}return u}l=v,v=l.parentNode}return null}function Uu(l){return l=l[ds]||l[Ls],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Ol(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function pp(l){return l[zu]||null}var lx=[],Rl=-1;function Eo(l){return{current:l}}function An(l){0>Rl||(l.current=lx[Rl],lx[Rl]=null,Rl--)}function gn(l,u){Rl++,lx[Rl]=l.current,l.current=u}var Po={},vr=Eo(Po),Rr=Eo(!1),hi=Po;function Il(l,u){var v=l.type.contextTypes;if(!v)return Po;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var _={},P;for(P in v)_[P]=u[P];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=_),_}function Ir(l){return l=l.childContextTypes,l!=null}function hp(){An(Rr),An(vr)}function X_(l,u,v){if(vr.current!==Po)throw Error(n(168));gn(vr,u),gn(Rr,v)}function J_(l,u,v){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return v;w=w.getChildContext();for(var _ in w)if(!(_ in u))throw Error(n(108,U(l)||"Unknown",_));return J({},v,w)}function mp(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Po,hi=vr.current,gn(vr,l),gn(Rr,Rr.current),!0}function Q_(l,u,v){var w=l.stateNode;if(!w)throw Error(n(169));v?(l=J_(l,u,hi),w.__reactInternalMemoizedMergedChildContext=l,An(Rr),An(vr),gn(vr,l)):An(Rr),gn(Rr,v)}var Fs=null,vp=!1,cx=!1;function Z_(l){Fs===null?Fs=[l]:Fs.push(l)}function PU(l){vp=!0,Z_(l)}function ko(){if(!cx&&Fs!==null){cx=!0;var l=0,u=on;try{var v=Fs;for(on=1;l<v.length;l++){var w=v[l];do w=w(!0);while(w!==null)}Fs=null,vp=!1}catch(_){throw Fs!==null&&(Fs=Fs.slice(l+1)),He(yo,ko),_}finally{on=u,cx=!1}}return null}var Ml=[],$l=0,gp=null,xp=0,ga=[],xa=0,mi=null,Bs=1,zs="";function vi(l,u){Ml[$l++]=xp,Ml[$l++]=gp,gp=l,xp=u}function eA(l,u,v){ga[xa++]=Bs,ga[xa++]=zs,ga[xa++]=mi,mi=l;var w=Bs;l=zs;var _=32-Jr(w)-1;w&=~(1<<_),v+=1;var P=32-Jr(u)+_;if(30<P){var $=_-_%5;P=(w&(1<<$)-1).toString(32),w>>=$,_-=$,Bs=1<<32-Jr(u)+_|v<<_|w,zs=P+l}else Bs=1<<P|v<<_|w,zs=l}function ux(l){l.return!==null&&(vi(l,1),eA(l,1,0))}function dx(l){for(;l===gp;)gp=Ml[--$l],Ml[$l]=null,xp=Ml[--$l],Ml[$l]=null;for(;l===mi;)mi=ga[--xa],ga[xa]=null,zs=ga[--xa],ga[xa]=null,Bs=ga[--xa],ga[xa]=null}var Zr=null,ea=null,Tn=!1,La=null;function tA(l,u){var v=ja(5,null,null,0);v.elementType="DELETED",v.stateNode=u,v.return=l,u=l.deletions,u===null?(l.deletions=[v],l.flags|=16):u.push(v)}function nA(l,u){switch(l.tag){case 5:var v=l.type;return u=u.nodeType!==1||v.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(l.stateNode=u,Zr=l,ea=Ao(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,Zr=l,ea=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(v=mi!==null?{id:Bs,overflow:zs}:null,l.memoizedState={dehydrated:u,treeContext:v,retryLane:1073741824},v=ja(18,null,null,0),v.stateNode=u,v.return=l,l.child=v,Zr=l,ea=null,!0):!1;default:return!1}}function fx(l){return(l.mode&1)!==0&&(l.flags&128)===0}function px(l){if(Tn){var u=ea;if(u){var v=u;if(!nA(l,u)){if(fx(l))throw Error(n(418));u=Ao(v.nextSibling);var w=Zr;u&&nA(l,u)?tA(w,v):(l.flags=l.flags&-4097|2,Tn=!1,Zr=l)}}else{if(fx(l))throw Error(n(418));l.flags=l.flags&-4097|2,Tn=!1,Zr=l}}}function rA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Zr=l}function yp(l){if(l!==Zr)return!1;if(!Tn)return rA(l),Tn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!ax(l.type,l.memoizedProps)),u&&(u=ea)){if(fx(l))throw aA(),Error(n(418));for(;u;)tA(l,u),u=Ao(u.nextSibling)}if(rA(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 v=l.data;if(v==="/$"){if(u===0){ea=Ao(l.nextSibling);break e}u--}else v!=="$"&&v!=="$!"&&v!=="$?"||u++}l=l.nextSibling}ea=null}}else ea=Zr?Ao(l.stateNode.nextSibling):null;return!0}function aA(){for(var l=ea;l;)l=Ao(l.nextSibling)}function Dl(){ea=Zr=null,Tn=!1}function hx(l){La===null?La=[l]:La.push(l)}var kU=E.ReactCurrentBatchConfig;function qu(l,u,v){if(l=v.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(v._owner){if(v=v._owner,v){if(v.tag!==1)throw Error(n(309));var w=v.stateNode}if(!w)throw Error(n(147,l));var _=w,P=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===P?u.ref:(u=function($){var Q=_.refs;$===null?delete Q[P]:Q[P]=$},u._stringRef=P,u)}if(typeof l!="string")throw Error(n(284));if(!v._owner)throw Error(n(290,l))}return l}function bp(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function sA(l){var u=l._init;return u(l._payload)}function oA(l){function u(pe,ce){if(l){var ge=pe.deletions;ge===null?(pe.deletions=[ce],pe.flags|=16):ge.push(ce)}}function v(pe,ce){if(!l)return null;for(;ce!==null;)u(pe,ce),ce=ce.sibling;return null}function w(pe,ce){for(pe=new Map;ce!==null;)ce.key!==null?pe.set(ce.key,ce):pe.set(ce.index,ce),ce=ce.sibling;return pe}function _(pe,ce){return pe=Lo(pe,ce),pe.index=0,pe.sibling=null,pe}function P(pe,ce,ge){return pe.index=ge,l?(ge=pe.alternate,ge!==null?(ge=ge.index,ge<ce?(pe.flags|=2,ce):ge):(pe.flags|=2,ce)):(pe.flags|=1048576,ce)}function $(pe){return l&&pe.alternate===null&&(pe.flags|=2),pe}function Q(pe,ce,ge,De){return ce===null||ce.tag!==6?(ce=sy(ge,pe.mode,De),ce.return=pe,ce):(ce=_(ce,ge),ce.return=pe,ce)}function ae(pe,ce,ge,De){var lt=ge.type;return lt===T?Oe(pe,ce,ge.props.children,De,ge.key):ce!==null&&(ce.elementType===lt||typeof lt=="object"&<!==null&<.$$typeof===M&&sA(lt)===ce.type)?(De=_(ce,ge.props),De.ref=qu(pe,ce,ge),De.return=pe,De):(De=Wp(ge.type,ge.key,ge.props,null,pe.mode,De),De.ref=qu(pe,ce,ge),De.return=pe,De)}function ye(pe,ce,ge,De){return ce===null||ce.tag!==4||ce.stateNode.containerInfo!==ge.containerInfo||ce.stateNode.implementation!==ge.implementation?(ce=oy(ge,pe.mode,De),ce.return=pe,ce):(ce=_(ce,ge.children||[]),ce.return=pe,ce)}function Oe(pe,ce,ge,De,lt){return ce===null||ce.tag!==7?(ce=Ni(ge,pe.mode,De,lt),ce.return=pe,ce):(ce=_(ce,ge),ce.return=pe,ce)}function Ie(pe,ce,ge){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return ce=sy(""+ce,pe.mode,ge),ce.return=pe,ce;if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case A:return ge=Wp(ce.type,ce.key,ce.props,null,pe.mode,ge),ge.ref=qu(pe,null,ce),ge.return=pe,ge;case k:return ce=oy(ce,pe.mode,ge),ce.return=pe,ce;case M:var De=ce._init;return Ie(pe,De(ce._payload),ge)}if(Ye(ce)||D(ce))return ce=Ni(ce,pe.mode,ge,null),ce.return=pe,ce;bp(pe,ce)}return null}function ke(pe,ce,ge,De){var lt=ce!==null?ce.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return lt!==null?null:Q(pe,ce,""+ge,De);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case A:return ge.key===lt?ae(pe,ce,ge,De):null;case k:return ge.key===lt?ye(pe,ce,ge,De):null;case M:return lt=ge._init,ke(pe,ce,lt(ge._payload),De)}if(Ye(ge)||D(ge))return lt!==null?null:Oe(pe,ce,ge,De,null);bp(pe,ge)}return null}function Xe(pe,ce,ge,De,lt){if(typeof De=="string"&&De!==""||typeof De=="number")return pe=pe.get(ge)||null,Q(ce,pe,""+De,lt);if(typeof De=="object"&&De!==null){switch(De.$$typeof){case A:return pe=pe.get(De.key===null?ge:De.key)||null,ae(ce,pe,De,lt);case k:return pe=pe.get(De.key===null?ge:De.key)||null,ye(ce,pe,De,lt);case M:var vt=De._init;return Xe(pe,ce,ge,vt(De._payload),lt)}if(Ye(De)||D(De))return pe=pe.get(ge)||null,Oe(ce,pe,De,lt,null);bp(ce,De)}return null}function rt(pe,ce,ge,De){for(var lt=null,vt=null,gt=ce,Et=ce=0,sr=null;gt!==null&&Et<ge.length;Et++){gt.index>Et?(sr=gt,gt=null):sr=gt.sibling;var Qt=ke(pe,gt,ge[Et],De);if(Qt===null){gt===null&&(gt=sr);break}l&>&&Qt.alternate===null&&u(pe,gt),ce=P(Qt,ce,Et),vt===null?lt=Qt:vt.sibling=Qt,vt=Qt,gt=sr}if(Et===ge.length)return v(pe,gt),Tn&&vi(pe,Et),lt;if(gt===null){for(;Et<ge.length;Et++)gt=Ie(pe,ge[Et],De),gt!==null&&(ce=P(gt,ce,Et),vt===null?lt=gt:vt.sibling=gt,vt=gt);return Tn&&vi(pe,Et),lt}for(gt=w(pe,gt);Et<ge.length;Et++)sr=Xe(gt,pe,Et,ge[Et],De),sr!==null&&(l&&sr.alternate!==null&>.delete(sr.key===null?Et:sr.key),ce=P(sr,ce,Et),vt===null?lt=sr:vt.sibling=sr,vt=sr);return l&>.forEach(function(Fo){return u(pe,Fo)}),Tn&&vi(pe,Et),lt}function st(pe,ce,ge,De){var lt=D(ge);if(typeof lt!="function")throw Error(n(150));if(ge=lt.call(ge),ge==null)throw Error(n(151));for(var vt=lt=null,gt=ce,Et=ce=0,sr=null,Qt=ge.next();gt!==null&&!Qt.done;Et++,Qt=ge.next()){gt.index>Et?(sr=gt,gt=null):sr=gt.sibling;var Fo=ke(pe,gt,Qt.value,De);if(Fo===null){gt===null&&(gt=sr);break}l&>&&Fo.alternate===null&&u(pe,gt),ce=P(Fo,ce,Et),vt===null?lt=Fo:vt.sibling=Fo,vt=Fo,gt=sr}if(Qt.done)return v(pe,gt),Tn&&vi(pe,Et),lt;if(gt===null){for(;!Qt.done;Et++,Qt=ge.next())Qt=Ie(pe,Qt.value,De),Qt!==null&&(ce=P(Qt,ce,Et),vt===null?lt=Qt:vt.sibling=Qt,vt=Qt);return Tn&&vi(pe,Et),lt}for(gt=w(pe,gt);!Qt.done;Et++,Qt=ge.next())Qt=Xe(gt,pe,Et,Qt.value,De),Qt!==null&&(l&&Qt.alternate!==null&>.delete(Qt.key===null?Et:Qt.key),ce=P(Qt,ce,Et),vt===null?lt=Qt:vt.sibling=Qt,vt=Qt);return l&>.forEach(function(cq){return u(pe,cq)}),Tn&&vi(pe,Et),lt}function Un(pe,ce,ge,De){if(typeof ge=="object"&&ge!==null&&ge.type===T&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case A:e:{for(var lt=ge.key,vt=ce;vt!==null;){if(vt.key===lt){if(lt=ge.type,lt===T){if(vt.tag===7){v(pe,vt.sibling),ce=_(vt,ge.props.children),ce.return=pe,pe=ce;break e}}else if(vt.elementType===lt||typeof lt=="object"&<!==null&<.$$typeof===M&&sA(lt)===vt.type){v(pe,vt.sibling),ce=_(vt,ge.props),ce.ref=qu(pe,vt,ge),ce.return=pe,pe=ce;break e}v(pe,vt);break}else u(pe,vt);vt=vt.sibling}ge.type===T?(ce=Ni(ge.props.children,pe.mode,De,ge.key),ce.return=pe,pe=ce):(De=Wp(ge.type,ge.key,ge.props,null,pe.mode,De),De.ref=qu(pe,ce,ge),De.return=pe,pe=De)}return $(pe);case k:e:{for(vt=ge.key;ce!==null;){if(ce.key===vt)if(ce.tag===4&&ce.stateNode.containerInfo===ge.containerInfo&&ce.stateNode.implementation===ge.implementation){v(pe,ce.sibling),ce=_(ce,ge.children||[]),ce.return=pe,pe=ce;break e}else{v(pe,ce);break}else u(pe,ce);ce=ce.sibling}ce=oy(ge,pe.mode,De),ce.return=pe,pe=ce}return $(pe);case M:return vt=ge._init,Un(pe,ce,vt(ge._payload),De)}if(Ye(ge))return rt(pe,ce,ge,De);if(D(ge))return st(pe,ce,ge,De);bp(pe,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,ce!==null&&ce.tag===6?(v(pe,ce.sibling),ce=_(ce,ge),ce.return=pe,pe=ce):(v(pe,ce),ce=sy(ge,pe.mode,De),ce.return=pe,pe=ce),$(pe)):v(pe,ce)}return Un}var Ll=oA(!0),iA=oA(!1),wp=Eo(null),jp=null,Fl=null,mx=null;function vx(){mx=Fl=jp=null}function gx(l){var u=wp.current;An(wp),l._currentValue=u}function xx(l,u,v){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===v)break;l=l.return}}function Bl(l,u){jp=l,mx=Fl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(Mr=!0),l.firstContext=null)}function ya(l){var u=l._currentValue;if(mx!==l)if(l={context:l,memoizedValue:u,next:null},Fl===null){if(jp===null)throw Error(n(308));Fl=l,jp.dependencies={lanes:0,firstContext:l}}else Fl=Fl.next=l;return u}var gi=null;function yx(l){gi===null?gi=[l]:gi.push(l)}function lA(l,u,v,w){var _=u.interleaved;return _===null?(v.next=v,yx(u)):(v.next=_.next,_.next=v),u.interleaved=v,Us(l,w)}function Us(l,u){l.lanes|=u;var v=l.alternate;for(v!==null&&(v.lanes|=u),v=l,l=l.return;l!==null;)l.childLanes|=u,v=l.alternate,v!==null&&(v.childLanes|=u),v=l,l=l.return;return v.tag===3?v.stateNode:null}var To=!1;function bx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cA(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 qs(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function Oo(l,u,v){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(Xt&2)!==0){var _=w.pending;return _===null?u.next=u:(u.next=_.next,_.next=u),w.pending=u,Us(l,v)}return _=w.interleaved,_===null?(u.next=u,yx(w)):(u.next=_.next,_.next=u),w.interleaved=u,Us(l,v)}function Sp(l,u,v){if(u=u.updateQueue,u!==null&&(u=u.shared,(v&4194240)!==0)){var w=u.lanes;w&=l.pendingLanes,v|=w,u.lanes=v,Cu(l,v)}}function uA(l,u){var v=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,v===w)){var _=null,P=null;if(v=v.firstBaseUpdate,v!==null){do{var $={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?_=P=$:P=P.next=$,v=v.next}while(v!==null);P===null?_=P=u:P=P.next=u}else _=P=u;v={baseState:w.baseState,firstBaseUpdate:_,lastBaseUpdate:P,shared:w.shared,effects:w.effects},l.updateQueue=v;return}l=v.lastBaseUpdate,l===null?v.firstBaseUpdate=u:l.next=u,v.lastBaseUpdate=u}function Np(l,u,v,w){var _=l.updateQueue;To=!1;var P=_.firstBaseUpdate,$=_.lastBaseUpdate,Q=_.shared.pending;if(Q!==null){_.shared.pending=null;var ae=Q,ye=ae.next;ae.next=null,$===null?P=ye:$.next=ye,$=ae;var Oe=l.alternate;Oe!==null&&(Oe=Oe.updateQueue,Q=Oe.lastBaseUpdate,Q!==$&&(Q===null?Oe.firstBaseUpdate=ye:Q.next=ye,Oe.lastBaseUpdate=ae))}if(P!==null){var Ie=_.baseState;$=0,Oe=ye=ae=null,Q=P;do{var ke=Q.lane,Xe=Q.eventTime;if((w&ke)===ke){Oe!==null&&(Oe=Oe.next={eventTime:Xe,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var rt=l,st=Q;switch(ke=u,Xe=v,st.tag){case 1:if(rt=st.payload,typeof rt=="function"){Ie=rt.call(Xe,Ie,ke);break e}Ie=rt;break e;case 3:rt.flags=rt.flags&-65537|128;case 0:if(rt=st.payload,ke=typeof rt=="function"?rt.call(Xe,Ie,ke):rt,ke==null)break e;Ie=J({},Ie,ke);break e;case 2:To=!0}}Q.callback!==null&&Q.lane!==0&&(l.flags|=64,ke=_.effects,ke===null?_.effects=[Q]:ke.push(Q))}else Xe={eventTime:Xe,lane:ke,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},Oe===null?(ye=Oe=Xe,ae=Ie):Oe=Oe.next=Xe,$|=ke;if(Q=Q.next,Q===null){if(Q=_.shared.pending,Q===null)break;ke=Q,Q=ke.next,ke.next=null,_.lastBaseUpdate=ke,_.shared.pending=null}}while(!0);if(Oe===null&&(ae=Ie),_.baseState=ae,_.firstBaseUpdate=ye,_.lastBaseUpdate=Oe,u=_.shared.interleaved,u!==null){_=u;do $|=_.lane,_=_.next;while(_!==u)}else P===null&&(_.shared.lanes=0);bi|=$,l.lanes=$,l.memoizedState=Ie}}function dA(l,u,v){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var w=l[u],_=w.callback;if(_!==null){if(w.callback=null,w=v,typeof _!="function")throw Error(n(191,_));_.call(w)}}}var Wu={},fs=Eo(Wu),Vu=Eo(Wu),Hu=Eo(Wu);function xi(l){if(l===Wu)throw Error(n(174));return l}function wx(l,u){switch(gn(Hu,u),gn(Vu,l),gn(fs,Wu),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:qt(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=qt(u,l)}An(fs),gn(fs,u)}function zl(){An(fs),An(Vu),An(Hu)}function fA(l){xi(Hu.current);var u=xi(fs.current),v=qt(u,l.type);u!==v&&(gn(Vu,l),gn(fs,v))}function jx(l){Vu.current===l&&(An(fs),An(Vu))}var Rn=Eo(0);function Cp(l){for(var u=l;u!==null;){if(u.tag===13){var v=u.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||v.data==="$?"||v.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 Sx=[];function Nx(){for(var l=0;l<Sx.length;l++)Sx[l]._workInProgressVersionPrimary=null;Sx.length=0}var _p=E.ReactCurrentDispatcher,Cx=E.ReactCurrentBatchConfig,yi=0,In=null,Gn=null,rr=null,Ap=!1,Ku=!1,Gu=0,TU=0;function gr(){throw Error(n(321))}function _x(l,u){if(u===null)return!1;for(var v=0;v<u.length&&v<l.length;v++)if(!Da(l[v],u[v]))return!1;return!0}function Ax(l,u,v,w,_,P){if(yi=P,In=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,_p.current=l===null||l.memoizedState===null?MU:$U,l=v(w,_),Ku){P=0;do{if(Ku=!1,Gu=0,25<=P)throw Error(n(301));P+=1,rr=Gn=null,u.updateQueue=null,_p.current=DU,l=v(w,_)}while(Ku)}if(_p.current=kp,u=Gn!==null&&Gn.next!==null,yi=0,rr=Gn=In=null,Ap=!1,u)throw Error(n(300));return l}function Ex(){var l=Gu!==0;return Gu=0,l}function ps(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rr===null?In.memoizedState=rr=l:rr=rr.next=l,rr}function ba(){if(Gn===null){var l=In.alternate;l=l!==null?l.memoizedState:null}else l=Gn.next;var u=rr===null?In.memoizedState:rr.next;if(u!==null)rr=u,Gn=l;else{if(l===null)throw Error(n(310));Gn=l,l={memoizedState:Gn.memoizedState,baseState:Gn.baseState,baseQueue:Gn.baseQueue,queue:Gn.queue,next:null},rr===null?In.memoizedState=rr=l:rr=rr.next=l}return rr}function Yu(l,u){return typeof u=="function"?u(l):u}function Px(l){var u=ba(),v=u.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var w=Gn,_=w.baseQueue,P=v.pending;if(P!==null){if(_!==null){var $=_.next;_.next=P.next,P.next=$}w.baseQueue=_=P,v.pending=null}if(_!==null){P=_.next,w=w.baseState;var Q=$=null,ae=null,ye=P;do{var Oe=ye.lane;if((yi&Oe)===Oe)ae!==null&&(ae=ae.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),w=ye.hasEagerState?ye.eagerState:l(w,ye.action);else{var Ie={lane:Oe,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};ae===null?(Q=ae=Ie,$=w):ae=ae.next=Ie,In.lanes|=Oe,bi|=Oe}ye=ye.next}while(ye!==null&&ye!==P);ae===null?$=w:ae.next=Q,Da(w,u.memoizedState)||(Mr=!0),u.memoizedState=w,u.baseState=$,u.baseQueue=ae,v.lastRenderedState=w}if(l=v.interleaved,l!==null){_=l;do P=_.lane,In.lanes|=P,bi|=P,_=_.next;while(_!==l)}else _===null&&(v.lanes=0);return[u.memoizedState,v.dispatch]}function kx(l){var u=ba(),v=u.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=l;var w=v.dispatch,_=v.pending,P=u.memoizedState;if(_!==null){v.pending=null;var $=_=_.next;do P=l(P,$.action),$=$.next;while($!==_);Da(P,u.memoizedState)||(Mr=!0),u.memoizedState=P,u.baseQueue===null&&(u.baseState=P),v.lastRenderedState=P}return[P,w]}function pA(){}function hA(l,u){var v=In,w=ba(),_=u(),P=!Da(w.memoizedState,_);if(P&&(w.memoizedState=_,Mr=!0),w=w.queue,Tx(gA.bind(null,v,w,l),[l]),w.getSnapshot!==u||P||rr!==null&&rr.memoizedState.tag&1){if(v.flags|=2048,Xu(9,vA.bind(null,v,w,_,u),void 0,null),ar===null)throw Error(n(349));(yi&30)!==0||mA(v,u,_)}return _}function mA(l,u,v){l.flags|=16384,l={getSnapshot:u,value:v},u=In.updateQueue,u===null?(u={lastEffect:null,stores:null},In.updateQueue=u,u.stores=[l]):(v=u.stores,v===null?u.stores=[l]:v.push(l))}function vA(l,u,v,w){u.value=v,u.getSnapshot=w,xA(u)&&yA(l)}function gA(l,u,v){return v(function(){xA(u)&&yA(l)})}function xA(l){var u=l.getSnapshot;l=l.value;try{var v=u();return!Da(l,v)}catch{return!0}}function yA(l){var u=Us(l,1);u!==null&&Ua(u,l,1,-1)}function bA(l){var u=ps();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yu,lastRenderedState:l},u.queue=l,l=l.dispatch=IU.bind(null,In,l),[u.memoizedState,l]}function Xu(l,u,v,w){return l={tag:l,create:u,destroy:v,deps:w,next:null},u=In.updateQueue,u===null?(u={lastEffect:null,stores:null},In.updateQueue=u,u.lastEffect=l.next=l):(v=u.lastEffect,v===null?u.lastEffect=l.next=l:(w=v.next,v.next=l,l.next=w,u.lastEffect=l)),l}function wA(){return ba().memoizedState}function Ep(l,u,v,w){var _=ps();In.flags|=l,_.memoizedState=Xu(1|u,v,void 0,w===void 0?null:w)}function Pp(l,u,v,w){var _=ba();w=w===void 0?null:w;var P=void 0;if(Gn!==null){var $=Gn.memoizedState;if(P=$.destroy,w!==null&&_x(w,$.deps)){_.memoizedState=Xu(u,v,P,w);return}}In.flags|=l,_.memoizedState=Xu(1|u,v,P,w)}function jA(l,u){return Ep(8390656,8,l,u)}function Tx(l,u){return Pp(2048,8,l,u)}function SA(l,u){return Pp(4,2,l,u)}function NA(l,u){return Pp(4,4,l,u)}function CA(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 _A(l,u,v){return v=v!=null?v.concat([l]):null,Pp(4,4,CA.bind(null,u,l),v)}function Ox(){}function AA(l,u){var v=ba();u=u===void 0?null:u;var w=v.memoizedState;return w!==null&&u!==null&&_x(u,w[1])?w[0]:(v.memoizedState=[l,u],l)}function EA(l,u){var v=ba();u=u===void 0?null:u;var w=v.memoizedState;return w!==null&&u!==null&&_x(u,w[1])?w[0]:(l=l(),v.memoizedState=[l,u],l)}function PA(l,u,v){return(yi&21)===0?(l.baseState&&(l.baseState=!1,Mr=!0),l.memoizedState=v):(Da(v,u)||(v=bo(),In.lanes|=v,bi|=v,l.baseState=!0),u)}function OU(l,u){var v=on;on=v!==0&&4>v?v:4,l(!0);var w=Cx.transition;Cx.transition={};try{l(!1),u()}finally{on=v,Cx.transition=w}}function kA(){return ba().memoizedState}function RU(l,u,v){var w=$o(l);if(v={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null},TA(l))OA(u,v);else if(v=lA(l,u,v,w),v!==null){var _=Sr();Ua(v,l,w,_),RA(v,u,w)}}function IU(l,u,v){var w=$o(l),_={lane:w,action:v,hasEagerState:!1,eagerState:null,next:null};if(TA(l))OA(u,_);else{var P=l.alternate;if(l.lanes===0&&(P===null||P.lanes===0)&&(P=u.lastRenderedReducer,P!==null))try{var $=u.lastRenderedState,Q=P($,v);if(_.hasEagerState=!0,_.eagerState=Q,Da(Q,$)){var ae=u.interleaved;ae===null?(_.next=_,yx(u)):(_.next=ae.next,ae.next=_),u.interleaved=_;return}}catch{}v=lA(l,u,_,w),v!==null&&(_=Sr(),Ua(v,l,w,_),RA(v,u,w))}}function TA(l){var u=l.alternate;return l===In||u!==null&&u===In}function OA(l,u){Ku=Ap=!0;var v=l.pending;v===null?u.next=u:(u.next=v.next,v.next=u),l.pending=u}function RA(l,u,v){if((v&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,v|=w,u.lanes=v,Cu(l,v)}}var kp={readContext:ya,useCallback:gr,useContext:gr,useEffect:gr,useImperativeHandle:gr,useInsertionEffect:gr,useLayoutEffect:gr,useMemo:gr,useReducer:gr,useRef:gr,useState:gr,useDebugValue:gr,useDeferredValue:gr,useTransition:gr,useMutableSource:gr,useSyncExternalStore:gr,useId:gr,unstable_isNewReconciler:!1},MU={readContext:ya,useCallback:function(l,u){return ps().memoizedState=[l,u===void 0?null:u],l},useContext:ya,useEffect:jA,useImperativeHandle:function(l,u,v){return v=v!=null?v.concat([l]):null,Ep(4194308,4,CA.bind(null,u,l),v)},useLayoutEffect:function(l,u){return Ep(4194308,4,l,u)},useInsertionEffect:function(l,u){return Ep(4,2,l,u)},useMemo:function(l,u){var v=ps();return u=u===void 0?null:u,l=l(),v.memoizedState=[l,u],l},useReducer:function(l,u,v){var w=ps();return u=v!==void 0?v(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=RU.bind(null,In,l),[w.memoizedState,l]},useRef:function(l){var u=ps();return l={current:l},u.memoizedState=l},useState:bA,useDebugValue:Ox,useDeferredValue:function(l){return ps().memoizedState=l},useTransition:function(){var l=bA(!1),u=l[0];return l=OU.bind(null,l[1]),ps().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,v){var w=In,_=ps();if(Tn){if(v===void 0)throw Error(n(407));v=v()}else{if(v=u(),ar===null)throw Error(n(349));(yi&30)!==0||mA(w,u,v)}_.memoizedState=v;var P={value:v,getSnapshot:u};return _.queue=P,jA(gA.bind(null,w,P,l),[l]),w.flags|=2048,Xu(9,vA.bind(null,w,P,v,u),void 0,null),v},useId:function(){var l=ps(),u=ar.identifierPrefix;if(Tn){var v=zs,w=Bs;v=(w&~(1<<32-Jr(w)-1)).toString(32)+v,u=":"+u+"R"+v,v=Gu++,0<v&&(u+="H"+v.toString(32)),u+=":"}else v=TU++,u=":"+u+"r"+v.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},$U={readContext:ya,useCallback:AA,useContext:ya,useEffect:Tx,useImperativeHandle:_A,useInsertionEffect:SA,useLayoutEffect:NA,useMemo:EA,useReducer:Px,useRef:wA,useState:function(){return Px(Yu)},useDebugValue:Ox,useDeferredValue:function(l){var u=ba();return PA(u,Gn.memoizedState,l)},useTransition:function(){var l=Px(Yu)[0],u=ba().memoizedState;return[l,u]},useMutableSource:pA,useSyncExternalStore:hA,useId:kA,unstable_isNewReconciler:!1},DU={readContext:ya,useCallback:AA,useContext:ya,useEffect:Tx,useImperativeHandle:_A,useInsertionEffect:SA,useLayoutEffect:NA,useMemo:EA,useReducer:kx,useRef:wA,useState:function(){return kx(Yu)},useDebugValue:Ox,useDeferredValue:function(l){var u=ba();return Gn===null?u.memoizedState=l:PA(u,Gn.memoizedState,l)},useTransition:function(){var l=kx(Yu)[0],u=ba().memoizedState;return[l,u]},useMutableSource:pA,useSyncExternalStore:hA,useId:kA,unstable_isNewReconciler:!1};function Fa(l,u){if(l&&l.defaultProps){u=J({},u),l=l.defaultProps;for(var v in l)u[v]===void 0&&(u[v]=l[v]);return u}return u}function Rx(l,u,v,w){u=l.memoizedState,v=v(w,u),v=v==null?u:J({},u,v),l.memoizedState=v,l.lanes===0&&(l.updateQueue.baseState=v)}var Tp={isMounted:function(l){return(l=l._reactInternals)?Ve(l)===l:!1},enqueueSetState:function(l,u,v){l=l._reactInternals;var w=Sr(),_=$o(l),P=qs(w,_);P.payload=u,v!=null&&(P.callback=v),u=Oo(l,P,_),u!==null&&(Ua(u,l,_,w),Sp(u,l,_))},enqueueReplaceState:function(l,u,v){l=l._reactInternals;var w=Sr(),_=$o(l),P=qs(w,_);P.tag=1,P.payload=u,v!=null&&(P.callback=v),u=Oo(l,P,_),u!==null&&(Ua(u,l,_,w),Sp(u,l,_))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var v=Sr(),w=$o(l),_=qs(v,w);_.tag=2,u!=null&&(_.callback=u),u=Oo(l,_,w),u!==null&&(Ua(u,l,w,v),Sp(u,l,w))}};function IA(l,u,v,w,_,P,$){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,P,$):u.prototype&&u.prototype.isPureReactComponent?!$u(v,w)||!$u(_,P):!0}function MA(l,u,v){var w=!1,_=Po,P=u.contextType;return typeof P=="object"&&P!==null?P=ya(P):(_=Ir(u)?hi:vr.current,w=u.contextTypes,P=(w=w!=null)?Il(l,_):Po),u=new u(v,P),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=_,l.__reactInternalMemoizedMaskedChildContext=P),u}function $A(l,u,v,w){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(v,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(v,w),u.state!==l&&Tp.enqueueReplaceState(u,u.state,null)}function Ix(l,u,v,w){var _=l.stateNode;_.props=v,_.state=l.memoizedState,_.refs={},bx(l);var P=u.contextType;typeof P=="object"&&P!==null?_.context=ya(P):(P=Ir(u)?hi:vr.current,_.context=Il(l,P)),_.state=l.memoizedState,P=u.getDerivedStateFromProps,typeof P=="function"&&(Rx(l,u,P,v),_.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(u=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),u!==_.state&&Tp.enqueueReplaceState(_,_.state,null),Np(l,v,_,w),_.state=l.memoizedState),typeof _.componentDidMount=="function"&&(l.flags|=4194308)}function Ul(l,u){try{var v="",w=u;do v+=fe(w),w=w.return;while(w);var _=v}catch(P){_=`
|
|
7
|
-
Error generating stack: `+P.message+`
|
|
8
|
-
`+P.stack}return{value:l,source:u,stack:_,digest:null}}function Mx(l,u,v){return{value:l,source:null,stack:v??null,digest:u??null}}function $x(l,u){try{console.error(u.value)}catch(v){setTimeout(function(){throw v})}}var LU=typeof WeakMap=="function"?WeakMap:Map;function DA(l,u,v){v=qs(-1,v),v.tag=3,v.payload={element:null};var w=u.value;return v.callback=function(){Lp||(Lp=!0,Jx=w),$x(l,u)},v}function LA(l,u,v){v=qs(-1,v),v.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var _=u.value;v.payload=function(){return w(_)},v.callback=function(){$x(l,u)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(v.callback=function(){$x(l,u),typeof w!="function"&&(Io===null?Io=new Set([this]):Io.add(this));var $=u.stack;this.componentDidCatch(u.value,{componentStack:$!==null?$:""})}),v}function FA(l,u,v){var w=l.pingCache;if(w===null){w=l.pingCache=new LU;var _=new Set;w.set(u,_)}else _=w.get(u),_===void 0&&(_=new Set,w.set(u,_));_.has(v)||(_.add(v),l=QU.bind(null,l,u,v),u.then(l,l))}function BA(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 zA(l,u,v,w,_){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,v.flags|=131072,v.flags&=-52805,v.tag===1&&(v.alternate===null?v.tag=17:(u=qs(-1,1),u.tag=2,Oo(v,u,1))),v.lanes|=1),l):(l.flags|=65536,l.lanes=_,l)}var FU=E.ReactCurrentOwner,Mr=!1;function jr(l,u,v,w){u.child=l===null?iA(u,null,v,w):Ll(u,l.child,v,w)}function UA(l,u,v,w,_){v=v.render;var P=u.ref;return Bl(u,_),w=Ax(l,u,v,w,P,_),v=Ex(),l!==null&&!Mr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Ws(l,u,_)):(Tn&&v&&ux(u),u.flags|=1,jr(l,u,w,_),u.child)}function qA(l,u,v,w,_){if(l===null){var P=v.type;return typeof P=="function"&&!ay(P)&&P.defaultProps===void 0&&v.compare===null&&v.defaultProps===void 0?(u.tag=15,u.type=P,WA(l,u,P,w,_)):(l=Wp(v.type,null,w,u,u.mode,_),l.ref=u.ref,l.return=u,u.child=l)}if(P=l.child,(l.lanes&_)===0){var $=P.memoizedProps;if(v=v.compare,v=v!==null?v:$u,v($,w)&&l.ref===u.ref)return Ws(l,u,_)}return u.flags|=1,l=Lo(P,w),l.ref=u.ref,l.return=u,u.child=l}function WA(l,u,v,w,_){if(l!==null){var P=l.memoizedProps;if($u(P,w)&&l.ref===u.ref)if(Mr=!1,u.pendingProps=w=P,(l.lanes&_)!==0)(l.flags&131072)!==0&&(Mr=!0);else return u.lanes=l.lanes,Ws(l,u,_)}return Dx(l,u,v,w,_)}function VA(l,u,v){var w=u.pendingProps,_=w.children,P=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},gn(Wl,ta),ta|=v;else{if((v&1073741824)===0)return l=P!==null?P.baseLanes|v:v,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,gn(Wl,ta),ta|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=P!==null?P.baseLanes:v,gn(Wl,ta),ta|=w}else P!==null?(w=P.baseLanes|v,u.memoizedState=null):w=v,gn(Wl,ta),ta|=w;return jr(l,u,_,v),u.child}function HA(l,u){var v=u.ref;(l===null&&v!==null||l!==null&&l.ref!==v)&&(u.flags|=512,u.flags|=2097152)}function Dx(l,u,v,w,_){var P=Ir(v)?hi:vr.current;return P=Il(u,P),Bl(u,_),v=Ax(l,u,v,w,P,_),w=Ex(),l!==null&&!Mr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~_,Ws(l,u,_)):(Tn&&w&&ux(u),u.flags|=1,jr(l,u,v,_),u.child)}function KA(l,u,v,w,_){if(Ir(v)){var P=!0;mp(u)}else P=!1;if(Bl(u,_),u.stateNode===null)Rp(l,u),MA(u,v,w),Ix(u,v,w,_),w=!0;else if(l===null){var $=u.stateNode,Q=u.memoizedProps;$.props=Q;var ae=$.context,ye=v.contextType;typeof ye=="object"&&ye!==null?ye=ya(ye):(ye=Ir(v)?hi:vr.current,ye=Il(u,ye));var Oe=v.getDerivedStateFromProps,Ie=typeof Oe=="function"||typeof $.getSnapshotBeforeUpdate=="function";Ie||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Q!==w||ae!==ye)&&$A(u,$,w,ye),To=!1;var ke=u.memoizedState;$.state=ke,Np(u,w,$,_),ae=u.memoizedState,Q!==w||ke!==ae||Rr.current||To?(typeof Oe=="function"&&(Rx(u,v,Oe,w),ae=u.memoizedState),(Q=To||IA(u,v,Q,w,ke,ae,ye))?(Ie||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(u.flags|=4194308)):(typeof $.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ae),$.props=w,$.state=ae,$.context=ye,w=Q):(typeof $.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{$=u.stateNode,cA(l,u),Q=u.memoizedProps,ye=u.type===u.elementType?Q:Fa(u.type,Q),$.props=ye,Ie=u.pendingProps,ke=$.context,ae=v.contextType,typeof ae=="object"&&ae!==null?ae=ya(ae):(ae=Ir(v)?hi:vr.current,ae=Il(u,ae));var Xe=v.getDerivedStateFromProps;(Oe=typeof Xe=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Q!==Ie||ke!==ae)&&$A(u,$,w,ae),To=!1,ke=u.memoizedState,$.state=ke,Np(u,w,$,_);var rt=u.memoizedState;Q!==Ie||ke!==rt||Rr.current||To?(typeof Xe=="function"&&(Rx(u,v,Xe,w),rt=u.memoizedState),(ye=To||IA(u,v,ye,w,ke,rt,ae)||!1)?(Oe||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(w,rt,ae),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(w,rt,ae)),typeof $.componentDidUpdate=="function"&&(u.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof $.componentDidUpdate!="function"||Q===l.memoizedProps&&ke===l.memoizedState||(u.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&ke===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=rt),$.props=w,$.state=rt,$.context=ae,w=ye):(typeof $.componentDidUpdate!="function"||Q===l.memoizedProps&&ke===l.memoizedState||(u.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&ke===l.memoizedState||(u.flags|=1024),w=!1)}return Lx(l,u,v,w,P,_)}function Lx(l,u,v,w,_,P){HA(l,u);var $=(u.flags&128)!==0;if(!w&&!$)return _&&Q_(u,v,!1),Ws(l,u,P);w=u.stateNode,FU.current=u;var Q=$&&typeof v.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&$?(u.child=Ll(u,l.child,null,P),u.child=Ll(u,null,Q,P)):jr(l,u,Q,P),u.memoizedState=w.state,_&&Q_(u,v,!0),u.child}function GA(l){var u=l.stateNode;u.pendingContext?X_(l,u.pendingContext,u.pendingContext!==u.context):u.context&&X_(l,u.context,!1),wx(l,u.containerInfo)}function YA(l,u,v,w,_){return Dl(),hx(_),u.flags|=256,jr(l,u,v,w),u.child}var Fx={dehydrated:null,treeContext:null,retryLane:0};function Bx(l){return{baseLanes:l,cachePool:null,transitions:null}}function XA(l,u,v){var w=u.pendingProps,_=Rn.current,P=!1,$=(u.flags&128)!==0,Q;if((Q=$)||(Q=l!==null&&l.memoizedState===null?!1:(_&2)!==0),Q?(P=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(_|=1),gn(Rn,_&1),l===null)return px(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):($=w.children,l=w.fallback,P?(w=u.mode,P=u.child,$={mode:"hidden",children:$},(w&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=$):P=Vp($,w,0,null),l=Ni(l,w,v,null),P.return=u,l.return=u,P.sibling=l,u.child=P,u.child.memoizedState=Bx(v),u.memoizedState=Fx,l):zx(u,$));if(_=l.memoizedState,_!==null&&(Q=_.dehydrated,Q!==null))return BU(l,u,$,w,Q,_,v);if(P){P=w.fallback,$=u.mode,_=l.child,Q=_.sibling;var ae={mode:"hidden",children:w.children};return($&1)===0&&u.child!==_?(w=u.child,w.childLanes=0,w.pendingProps=ae,u.deletions=null):(w=Lo(_,ae),w.subtreeFlags=_.subtreeFlags&14680064),Q!==null?P=Lo(Q,P):(P=Ni(P,$,v,null),P.flags|=2),P.return=u,w.return=u,w.sibling=P,u.child=w,w=P,P=u.child,$=l.child.memoizedState,$=$===null?Bx(v):{baseLanes:$.baseLanes|v,cachePool:null,transitions:$.transitions},P.memoizedState=$,P.childLanes=l.childLanes&~v,u.memoizedState=Fx,w}return P=l.child,l=P.sibling,w=Lo(P,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=v),w.return=u,w.sibling=null,l!==null&&(v=u.deletions,v===null?(u.deletions=[l],u.flags|=16):v.push(l)),u.child=w,u.memoizedState=null,w}function zx(l,u){return u=Vp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Op(l,u,v,w){return w!==null&&hx(w),Ll(u,l.child,null,v),l=zx(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function BU(l,u,v,w,_,P,$){if(v)return u.flags&256?(u.flags&=-257,w=Mx(Error(n(422))),Op(l,u,$,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(P=w.fallback,_=u.mode,w=Vp({mode:"visible",children:w.children},_,0,null),P=Ni(P,_,$,null),P.flags|=2,w.return=u,P.return=u,w.sibling=P,u.child=w,(u.mode&1)!==0&&Ll(u,l.child,null,$),u.child.memoizedState=Bx($),u.memoizedState=Fx,P);if((u.mode&1)===0)return Op(l,u,$,null);if(_.data==="$!"){if(w=_.nextSibling&&_.nextSibling.dataset,w)var Q=w.dgst;return w=Q,P=Error(n(419)),w=Mx(P,w,void 0),Op(l,u,$,w)}if(Q=($&l.childLanes)!==0,Mr||Q){if(w=ar,w!==null){switch($&-$){case 4:_=2;break;case 16:_=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:_=32;break;case 536870912:_=268435456;break;default:_=0}_=(_&(w.suspendedLanes|$))!==0?0:_,_!==0&&_!==P.retryLane&&(P.retryLane=_,Us(l,_),Ua(w,l,_,-1))}return ry(),w=Mx(Error(n(421))),Op(l,u,$,w)}return _.data==="$?"?(u.flags|=128,u.child=l.child,u=ZU.bind(null,l),_._reactRetry=u,null):(l=P.treeContext,ea=Ao(_.nextSibling),Zr=u,Tn=!0,La=null,l!==null&&(ga[xa++]=Bs,ga[xa++]=zs,ga[xa++]=mi,Bs=l.id,zs=l.overflow,mi=u),u=zx(u,w.children),u.flags|=4096,u)}function JA(l,u,v){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),xx(l.return,u,v)}function Ux(l,u,v,w,_){var P=l.memoizedState;P===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:v,tailMode:_}:(P.isBackwards=u,P.rendering=null,P.renderingStartTime=0,P.last=w,P.tail=v,P.tailMode=_)}function QA(l,u,v){var w=u.pendingProps,_=w.revealOrder,P=w.tail;if(jr(l,u,w.children,v),w=Rn.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&&JA(l,v,u);else if(l.tag===19)JA(l,v,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(gn(Rn,w),(u.mode&1)===0)u.memoizedState=null;else switch(_){case"forwards":for(v=u.child,_=null;v!==null;)l=v.alternate,l!==null&&Cp(l)===null&&(_=v),v=v.sibling;v=_,v===null?(_=u.child,u.child=null):(_=v.sibling,v.sibling=null),Ux(u,!1,_,v,P);break;case"backwards":for(v=null,_=u.child,u.child=null;_!==null;){if(l=_.alternate,l!==null&&Cp(l)===null){u.child=_;break}l=_.sibling,_.sibling=v,v=_,_=l}Ux(u,!0,v,null,P);break;case"together":Ux(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 Ws(l,u,v){if(l!==null&&(u.dependencies=l.dependencies),bi|=u.lanes,(v&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(n(153));if(u.child!==null){for(l=u.child,v=Lo(l,l.pendingProps),u.child=v,v.return=u;l.sibling!==null;)l=l.sibling,v=v.sibling=Lo(l,l.pendingProps),v.return=u;v.sibling=null}return u.child}function zU(l,u,v){switch(u.tag){case 3:GA(u),Dl();break;case 5:fA(u);break;case 1:Ir(u.type)&&mp(u);break;case 4:wx(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,_=u.memoizedProps.value;gn(wp,w._currentValue),w._currentValue=_;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(gn(Rn,Rn.current&1),u.flags|=128,null):(v&u.child.childLanes)!==0?XA(l,u,v):(gn(Rn,Rn.current&1),l=Ws(l,u,v),l!==null?l.sibling:null);gn(Rn,Rn.current&1);break;case 19:if(w=(v&u.childLanes)!==0,(l.flags&128)!==0){if(w)return QA(l,u,v);u.flags|=128}if(_=u.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),gn(Rn,Rn.current),w)break;return null;case 22:case 23:return u.lanes=0,VA(l,u,v)}return Ws(l,u,v)}var ZA,qx,eE,tE;ZA=function(l,u){for(var v=u.child;v!==null;){if(v.tag===5||v.tag===6)l.appendChild(v.stateNode);else if(v.tag!==4&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===u)break;for(;v.sibling===null;){if(v.return===null||v.return===u)return;v=v.return}v.sibling.return=v.return,v=v.sibling}},qx=function(){},eE=function(l,u,v,w){var _=l.memoizedProps;if(_!==w){l=u.stateNode,xi(fs.current);var P=null;switch(v){case"input":_=be(l,_),w=be(l,w),P=[];break;case"select":_=J({},_,{value:void 0}),w=J({},w,{value:void 0}),P=[];break;case"textarea":_=dt(l,_),w=dt(l,w),P=[];break;default:typeof _.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=fp)}Sn(v,w);var $;v=null;for(ye in _)if(!w.hasOwnProperty(ye)&&_.hasOwnProperty(ye)&&_[ye]!=null)if(ye==="style"){var Q=_[ye];for($ in Q)Q.hasOwnProperty($)&&(v||(v={}),v[$]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(a.hasOwnProperty(ye)?P||(P=[]):(P=P||[]).push(ye,null));for(ye in w){var ae=w[ye];if(Q=_?.[ye],w.hasOwnProperty(ye)&&ae!==Q&&(ae!=null||Q!=null))if(ye==="style")if(Q){for($ in Q)!Q.hasOwnProperty($)||ae&&ae.hasOwnProperty($)||(v||(v={}),v[$]="");for($ in ae)ae.hasOwnProperty($)&&Q[$]!==ae[$]&&(v||(v={}),v[$]=ae[$])}else v||(P||(P=[]),P.push(ye,v)),v=ae;else ye==="dangerouslySetInnerHTML"?(ae=ae?ae.__html:void 0,Q=Q?Q.__html:void 0,ae!=null&&Q!==ae&&(P=P||[]).push(ye,ae)):ye==="children"?typeof ae!="string"&&typeof ae!="number"||(P=P||[]).push(ye,""+ae):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(a.hasOwnProperty(ye)?(ae!=null&&ye==="onScroll"&&_n("scroll",l),P||Q===ae||(P=[])):(P=P||[]).push(ye,ae))}v&&(P=P||[]).push("style",v);var ye=P;(u.updateQueue=ye)&&(u.flags|=4)}},tE=function(l,u,v,w){v!==w&&(u.flags|=4)};function Ju(l,u){if(!Tn)switch(l.tailMode){case"hidden":u=l.tail;for(var v=null;u!==null;)u.alternate!==null&&(v=u),u=u.sibling;v===null?l.tail=null:v.sibling=null;break;case"collapsed":v=l.tail;for(var w=null;v!==null;)v.alternate!==null&&(w=v),v=v.sibling;w===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function xr(l){var u=l.alternate!==null&&l.alternate.child===l.child,v=0,w=0;if(u)for(var _=l.child;_!==null;)v|=_.lanes|_.childLanes,w|=_.subtreeFlags&14680064,w|=_.flags&14680064,_.return=l,_=_.sibling;else for(_=l.child;_!==null;)v|=_.lanes|_.childLanes,w|=_.subtreeFlags,w|=_.flags,_.return=l,_=_.sibling;return l.subtreeFlags|=w,l.childLanes=v,u}function UU(l,u,v){var w=u.pendingProps;switch(dx(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(u),null;case 1:return Ir(u.type)&&hp(),xr(u),null;case 3:return w=u.stateNode,zl(),An(Rr),An(vr),Nx(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(yp(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,La!==null&&(ey(La),La=null))),qx(l,u),xr(u),null;case 5:jx(u);var _=xi(Hu.current);if(v=u.type,l!==null&&u.stateNode!=null)eE(l,u,v,w,_),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return xr(u),null}if(l=xi(fs.current),yp(u)){w=u.stateNode,v=u.type;var P=u.memoizedProps;switch(w[ds]=u,w[zu]=P,l=(u.mode&1)!==0,v){case"dialog":_n("cancel",w),_n("close",w);break;case"iframe":case"object":case"embed":_n("load",w);break;case"video":case"audio":for(_=0;_<Lu.length;_++)_n(Lu[_],w);break;case"source":_n("error",w);break;case"img":case"image":case"link":_n("error",w),_n("load",w);break;case"details":_n("toggle",w);break;case"input":We(w,P),_n("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!P.multiple},_n("invalid",w);break;case"textarea":ht(w,P),_n("invalid",w)}Sn(v,P),_=null;for(var $ in P)if(P.hasOwnProperty($)){var Q=P[$];$==="children"?typeof Q=="string"?w.textContent!==Q&&(P.suppressHydrationWarning!==!0&&dp(w.textContent,Q,l),_=["children",Q]):typeof Q=="number"&&w.textContent!==""+Q&&(P.suppressHydrationWarning!==!0&&dp(w.textContent,Q,l),_=["children",""+Q]):a.hasOwnProperty($)&&Q!=null&&$==="onScroll"&&_n("scroll",w)}switch(v){case"input":ve(w),he(w,P,!0);break;case"textarea":ve(w),It(w);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(w.onclick=fp)}w=_,u.updateQueue=w,w!==null&&(u.flags|=4)}else{$=_.nodeType===9?_:_.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Dt(v)),l==="http://www.w3.org/1999/xhtml"?v==="script"?(l=$.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=$.createElement(v,{is:w.is}):(l=$.createElement(v),v==="select"&&($=l,w.multiple?$.multiple=!0:w.size&&($.size=w.size))):l=$.createElementNS(l,v),l[ds]=u,l[zu]=w,ZA(l,u,!1,!1),u.stateNode=l;e:{switch($=Or(v,w),v){case"dialog":_n("cancel",l),_n("close",l),_=w;break;case"iframe":case"object":case"embed":_n("load",l),_=w;break;case"video":case"audio":for(_=0;_<Lu.length;_++)_n(Lu[_],l);_=w;break;case"source":_n("error",l),_=w;break;case"img":case"image":case"link":_n("error",l),_n("load",l),_=w;break;case"details":_n("toggle",l),_=w;break;case"input":We(l,w),_=be(l,w),_n("invalid",l);break;case"option":_=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},_=J({},w,{value:void 0}),_n("invalid",l);break;case"textarea":ht(l,w),_=dt(l,w),_n("invalid",l);break;default:_=w}Sn(v,_),Q=_;for(P in Q)if(Q.hasOwnProperty(P)){var ae=Q[P];P==="style"?Lt(l,ae):P==="dangerouslySetInnerHTML"?(ae=ae?ae.__html:void 0,ae!=null&&Ee(l,ae)):P==="children"?typeof ae=="string"?(v!=="textarea"||ae!=="")&&Ne(l,ae):typeof ae=="number"&&Ne(l,""+ae):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(a.hasOwnProperty(P)?ae!=null&&P==="onScroll"&&_n("scroll",l):ae!=null&&N(l,P,ae,$))}switch(v){case"input":ve(l),he(l,w,!1);break;case"textarea":ve(l),It(l);break;case"option":w.value!=null&&l.setAttribute("value",""+oe(w.value));break;case"select":l.multiple=!!w.multiple,P=w.value,P!=null?ut(l,!!w.multiple,P,!1):w.defaultValue!=null&&ut(l,!!w.multiple,w.defaultValue,!0);break;default:typeof _.onClick=="function"&&(l.onclick=fp)}switch(v){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 xr(u),null;case 6:if(l&&u.stateNode!=null)tE(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(v=xi(Hu.current),xi(fs.current),yp(u)){if(w=u.stateNode,v=u.memoizedProps,w[ds]=u,(P=w.nodeValue!==v)&&(l=Zr,l!==null))switch(l.tag){case 3:dp(w.nodeValue,v,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&dp(w.nodeValue,v,(l.mode&1)!==0)}P&&(u.flags|=4)}else w=(v.nodeType===9?v:v.ownerDocument).createTextNode(w),w[ds]=u,u.stateNode=w}return xr(u),null;case 13:if(An(Rn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Tn&&ea!==null&&(u.mode&1)!==0&&(u.flags&128)===0)aA(),Dl(),u.flags|=98560,P=!1;else if(P=yp(u),w!==null&&w.dehydrated!==null){if(l===null){if(!P)throw Error(n(318));if(P=u.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(n(317));P[ds]=u}else Dl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;xr(u),P=!1}else La!==null&&(ey(La),La=null),P=!0;if(!P)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=v,u):(w=w!==null,w!==(l!==null&&l.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(Rn.current&1)!==0?Yn===0&&(Yn=3):ry())),u.updateQueue!==null&&(u.flags|=4),xr(u),null);case 4:return zl(),qx(l,u),l===null&&Fu(u.stateNode.containerInfo),xr(u),null;case 10:return gx(u.type._context),xr(u),null;case 17:return Ir(u.type)&&hp(),xr(u),null;case 19:if(An(Rn),P=u.memoizedState,P===null)return xr(u),null;if(w=(u.flags&128)!==0,$=P.rendering,$===null)if(w)Ju(P,!1);else{if(Yn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if($=Cp(l),$!==null){for(u.flags|=128,Ju(P,!1),w=$.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=v,v=u.child;v!==null;)P=v,l=w,P.flags&=14680066,$=P.alternate,$===null?(P.childLanes=0,P.lanes=l,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=$.childLanes,P.lanes=$.lanes,P.child=$.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=$.memoizedProps,P.memoizedState=$.memoizedState,P.updateQueue=$.updateQueue,P.type=$.type,l=$.dependencies,P.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),v=v.sibling;return gn(Rn,Rn.current&1|2),u.child}l=l.sibling}P.tail!==null&&Nn()>Vl&&(u.flags|=128,w=!0,Ju(P,!1),u.lanes=4194304)}else{if(!w)if(l=Cp($),l!==null){if(u.flags|=128,w=!0,v=l.updateQueue,v!==null&&(u.updateQueue=v,u.flags|=4),Ju(P,!0),P.tail===null&&P.tailMode==="hidden"&&!$.alternate&&!Tn)return xr(u),null}else 2*Nn()-P.renderingStartTime>Vl&&v!==1073741824&&(u.flags|=128,w=!0,Ju(P,!1),u.lanes=4194304);P.isBackwards?($.sibling=u.child,u.child=$):(v=P.last,v!==null?v.sibling=$:u.child=$,P.last=$)}return P.tail!==null?(u=P.tail,P.rendering=u,P.tail=u.sibling,P.renderingStartTime=Nn(),u.sibling=null,v=Rn.current,gn(Rn,w?v&1|2:v&1),u):(xr(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?(ta&1073741824)!==0&&(xr(u),u.subtreeFlags&6&&(u.flags|=8192)):xr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function qU(l,u){switch(dx(u),u.tag){case 1:return Ir(u.type)&&hp(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return zl(),An(Rr),An(vr),Nx(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return jx(u),null;case 13:if(An(Rn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));Dl()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return An(Rn),null;case 4:return zl(),null;case 10:return gx(u.type._context),null;case 22:case 23:return ny(),null;case 24:return null;default:return null}}var Ip=!1,yr=!1,WU=typeof WeakSet=="function"?WeakSet:Set,Ze=null;function ql(l,u){var v=l.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(w){Dn(l,u,w)}else v.current=null}function Wx(l,u,v){try{v()}catch(w){Dn(l,u,w)}}var nE=!1;function VU(l,u){if(nx=ep,l=I_(),Gg(l)){if("selectionStart"in l)var v={start:l.selectionStart,end:l.selectionEnd};else e:{v=(v=l.ownerDocument)&&v.defaultView||window;var w=v.getSelection&&v.getSelection();if(w&&w.rangeCount!==0){v=w.anchorNode;var _=w.anchorOffset,P=w.focusNode;w=w.focusOffset;try{v.nodeType,P.nodeType}catch{v=null;break e}var $=0,Q=-1,ae=-1,ye=0,Oe=0,Ie=l,ke=null;t:for(;;){for(var Xe;Ie!==v||_!==0&&Ie.nodeType!==3||(Q=$+_),Ie!==P||w!==0&&Ie.nodeType!==3||(ae=$+w),Ie.nodeType===3&&($+=Ie.nodeValue.length),(Xe=Ie.firstChild)!==null;)ke=Ie,Ie=Xe;for(;;){if(Ie===l)break t;if(ke===v&&++ye===_&&(Q=$),ke===P&&++Oe===w&&(ae=$),(Xe=Ie.nextSibling)!==null)break;Ie=ke,ke=Ie.parentNode}Ie=Xe}v=Q===-1||ae===-1?null:{start:Q,end:ae}}else v=null}v=v||{start:0,end:0}}else v=null;for(rx={focusedElem:l,selectionRange:v},ep=!1,Ze=u;Ze!==null;)if(u=Ze,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Ze=l;else for(;Ze!==null;){u=Ze;try{var rt=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(rt!==null){var st=rt.memoizedProps,Un=rt.memoizedState,pe=u.stateNode,ce=pe.getSnapshotBeforeUpdate(u.elementType===u.type?st:Fa(u.type,st),Un);pe.__reactInternalSnapshotBeforeUpdate=ce}break;case 3:var ge=u.stateNode.containerInfo;ge.nodeType===1?ge.textContent="":ge.nodeType===9&&ge.documentElement&&ge.removeChild(ge.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(De){Dn(u,u.return,De)}if(l=u.sibling,l!==null){l.return=u.return,Ze=l;break}Ze=u.return}return rt=nE,nE=!1,rt}function Qu(l,u,v){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var _=w=w.next;do{if((_.tag&l)===l){var P=_.destroy;_.destroy=void 0,P!==void 0&&Wx(u,v,P)}_=_.next}while(_!==w)}}function Mp(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var v=u=u.next;do{if((v.tag&l)===l){var w=v.create;v.destroy=w()}v=v.next}while(v!==u)}}function Vx(l){var u=l.ref;if(u!==null){var v=l.stateNode;l.tag,l=v,typeof u=="function"?u(l):u.current=l}}function rE(l){var u=l.alternate;u!==null&&(l.alternate=null,rE(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[ds],delete u[zu],delete u[ix],delete u[AU],delete u[EU])),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 aE(l){return l.tag===5||l.tag===3||l.tag===4}function sE(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||aE(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 Hx(l,u,v){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?v.nodeType===8?v.parentNode.insertBefore(l,u):v.insertBefore(l,u):(v.nodeType===8?(u=v.parentNode,u.insertBefore(l,v)):(u=v,u.appendChild(l)),v=v._reactRootContainer,v!=null||u.onclick!==null||(u.onclick=fp));else if(w!==4&&(l=l.child,l!==null))for(Hx(l,u,v),l=l.sibling;l!==null;)Hx(l,u,v),l=l.sibling}function Kx(l,u,v){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?v.insertBefore(l,u):v.appendChild(l);else if(w!==4&&(l=l.child,l!==null))for(Kx(l,u,v),l=l.sibling;l!==null;)Kx(l,u,v),l=l.sibling}var ur=null,Ba=!1;function Ro(l,u,v){for(v=v.child;v!==null;)oE(l,u,v),v=v.sibling}function oE(l,u,v){if(va&&typeof va.onCommitFiberUnmount=="function")try{va.onCommitFiberUnmount(di,v)}catch{}switch(v.tag){case 5:yr||ql(v,u);case 6:var w=ur,_=Ba;ur=null,Ro(l,u,v),ur=w,Ba=_,ur!==null&&(Ba?(l=ur,v=v.stateNode,l.nodeType===8?l.parentNode.removeChild(v):l.removeChild(v)):ur.removeChild(v.stateNode));break;case 18:ur!==null&&(Ba?(l=ur,v=v.stateNode,l.nodeType===8?ox(l.parentNode,v):l.nodeType===1&&ox(l,v),ku(l)):ox(ur,v.stateNode));break;case 4:w=ur,_=Ba,ur=v.stateNode.containerInfo,Ba=!0,Ro(l,u,v),ur=w,Ba=_;break;case 0:case 11:case 14:case 15:if(!yr&&(w=v.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){_=w=w.next;do{var P=_,$=P.destroy;P=P.tag,$!==void 0&&((P&2)!==0||(P&4)!==0)&&Wx(v,u,$),_=_.next}while(_!==w)}Ro(l,u,v);break;case 1:if(!yr&&(ql(v,u),w=v.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=v.memoizedProps,w.state=v.memoizedState,w.componentWillUnmount()}catch(Q){Dn(v,u,Q)}Ro(l,u,v);break;case 21:Ro(l,u,v);break;case 22:v.mode&1?(yr=(w=yr)||v.memoizedState!==null,Ro(l,u,v),yr=w):Ro(l,u,v);break;default:Ro(l,u,v)}}function iE(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var v=l.stateNode;v===null&&(v=l.stateNode=new WU),u.forEach(function(w){var _=eq.bind(null,l,w);v.has(w)||(v.add(w),w.then(_,_))})}}function za(l,u){var v=u.deletions;if(v!==null)for(var w=0;w<v.length;w++){var _=v[w];try{var P=l,$=u,Q=$;e:for(;Q!==null;){switch(Q.tag){case 5:ur=Q.stateNode,Ba=!1;break e;case 3:ur=Q.stateNode.containerInfo,Ba=!0;break e;case 4:ur=Q.stateNode.containerInfo,Ba=!0;break e}Q=Q.return}if(ur===null)throw Error(n(160));oE(P,$,_),ur=null,Ba=!1;var ae=_.alternate;ae!==null&&(ae.return=null),_.return=null}catch(ye){Dn(_,u,ye)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)lE(u,l),u=u.sibling}function lE(l,u){var v=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(za(u,l),hs(l),w&4){try{Qu(3,l,l.return),Mp(3,l)}catch(st){Dn(l,l.return,st)}try{Qu(5,l,l.return)}catch(st){Dn(l,l.return,st)}}break;case 1:za(u,l),hs(l),w&512&&v!==null&&ql(v,v.return);break;case 5:if(za(u,l),hs(l),w&512&&v!==null&&ql(v,v.return),l.flags&32){var _=l.stateNode;try{Ne(_,"")}catch(st){Dn(l,l.return,st)}}if(w&4&&(_=l.stateNode,_!=null)){var P=l.memoizedProps,$=v!==null?v.memoizedProps:P,Q=l.type,ae=l.updateQueue;if(l.updateQueue=null,ae!==null)try{Q==="input"&&P.type==="radio"&&P.name!=null&&B(_,P),Or(Q,$);var ye=Or(Q,P);for($=0;$<ae.length;$+=2){var Oe=ae[$],Ie=ae[$+1];Oe==="style"?Lt(_,Ie):Oe==="dangerouslySetInnerHTML"?Ee(_,Ie):Oe==="children"?Ne(_,Ie):N(_,Oe,Ie,ye)}switch(Q){case"input":ie(_,P);break;case"textarea":jt(_,P);break;case"select":var ke=_._wrapperState.wasMultiple;_._wrapperState.wasMultiple=!!P.multiple;var Xe=P.value;Xe!=null?ut(_,!!P.multiple,Xe,!1):ke!==!!P.multiple&&(P.defaultValue!=null?ut(_,!!P.multiple,P.defaultValue,!0):ut(_,!!P.multiple,P.multiple?[]:"",!1))}_[zu]=P}catch(st){Dn(l,l.return,st)}}break;case 6:if(za(u,l),hs(l),w&4){if(l.stateNode===null)throw Error(n(162));_=l.stateNode,P=l.memoizedProps;try{_.nodeValue=P}catch(st){Dn(l,l.return,st)}}break;case 3:if(za(u,l),hs(l),w&4&&v!==null&&v.memoizedState.isDehydrated)try{ku(u.containerInfo)}catch(st){Dn(l,l.return,st)}break;case 4:za(u,l),hs(l);break;case 13:za(u,l),hs(l),_=l.child,_.flags&8192&&(P=_.memoizedState!==null,_.stateNode.isHidden=P,!P||_.alternate!==null&&_.alternate.memoizedState!==null||(Xx=Nn())),w&4&&iE(l);break;case 22:if(Oe=v!==null&&v.memoizedState!==null,l.mode&1?(yr=(ye=yr)||Oe,za(u,l),yr=ye):za(u,l),hs(l),w&8192){if(ye=l.memoizedState!==null,(l.stateNode.isHidden=ye)&&!Oe&&(l.mode&1)!==0)for(Ze=l,Oe=l.child;Oe!==null;){for(Ie=Ze=Oe;Ze!==null;){switch(ke=Ze,Xe=ke.child,ke.tag){case 0:case 11:case 14:case 15:Qu(4,ke,ke.return);break;case 1:ql(ke,ke.return);var rt=ke.stateNode;if(typeof rt.componentWillUnmount=="function"){w=ke,v=ke.return;try{u=w,rt.props=u.memoizedProps,rt.state=u.memoizedState,rt.componentWillUnmount()}catch(st){Dn(w,v,st)}}break;case 5:ql(ke,ke.return);break;case 22:if(ke.memoizedState!==null){dE(Ie);continue}}Xe!==null?(Xe.return=ke,Ze=Xe):dE(Ie)}Oe=Oe.sibling}e:for(Oe=null,Ie=l;;){if(Ie.tag===5){if(Oe===null){Oe=Ie;try{_=Ie.stateNode,ye?(P=_.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(Q=Ie.stateNode,ae=Ie.memoizedProps.style,$=ae!=null&&ae.hasOwnProperty("display")?ae.display:null,Q.style.display=Le("display",$))}catch(st){Dn(l,l.return,st)}}}else if(Ie.tag===6){if(Oe===null)try{Ie.stateNode.nodeValue=ye?"":Ie.memoizedProps}catch(st){Dn(l,l.return,st)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===l)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===l)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===l)break e;Oe===Ie&&(Oe=null),Ie=Ie.return}Oe===Ie&&(Oe=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:za(u,l),hs(l),w&4&&iE(l);break;case 21:break;default:za(u,l),hs(l)}}function hs(l){var u=l.flags;if(u&2){try{e:{for(var v=l.return;v!==null;){if(aE(v)){var w=v;break e}v=v.return}throw Error(n(160))}switch(w.tag){case 5:var _=w.stateNode;w.flags&32&&(Ne(_,""),w.flags&=-33);var P=sE(l);Kx(l,P,_);break;case 3:case 4:var $=w.stateNode.containerInfo,Q=sE(l);Hx(l,Q,$);break;default:throw Error(n(161))}}catch(ae){Dn(l,l.return,ae)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function HU(l,u,v){Ze=l,cE(l)}function cE(l,u,v){for(var w=(l.mode&1)!==0;Ze!==null;){var _=Ze,P=_.child;if(_.tag===22&&w){var $=_.memoizedState!==null||Ip;if(!$){var Q=_.alternate,ae=Q!==null&&Q.memoizedState!==null||yr;Q=Ip;var ye=yr;if(Ip=$,(yr=ae)&&!ye)for(Ze=_;Ze!==null;)$=Ze,ae=$.child,$.tag===22&&$.memoizedState!==null?fE(_):ae!==null?(ae.return=$,Ze=ae):fE(_);for(;P!==null;)Ze=P,cE(P),P=P.sibling;Ze=_,Ip=Q,yr=ye}uE(l)}else(_.subtreeFlags&8772)!==0&&P!==null?(P.return=_,Ze=P):uE(l)}}function uE(l){for(;Ze!==null;){var u=Ze;if((u.flags&8772)!==0){var v=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:yr||Mp(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!yr)if(v===null)w.componentDidMount();else{var _=u.elementType===u.type?v.memoizedProps:Fa(u.type,v.memoizedProps);w.componentDidUpdate(_,v.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var P=u.updateQueue;P!==null&&dA(u,P,w);break;case 3:var $=u.updateQueue;if($!==null){if(v=null,u.child!==null)switch(u.child.tag){case 5:v=u.child.stateNode;break;case 1:v=u.child.stateNode}dA(u,$,v)}break;case 5:var Q=u.stateNode;if(v===null&&u.flags&4){v=Q;var ae=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ae.autoFocus&&v.focus();break;case"img":ae.src&&(v.src=ae.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var ye=u.alternate;if(ye!==null){var Oe=ye.memoizedState;if(Oe!==null){var Ie=Oe.dehydrated;Ie!==null&&ku(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yr||u.flags&512&&Vx(u)}catch(ke){Dn(u,u.return,ke)}}if(u===l){Ze=null;break}if(v=u.sibling,v!==null){v.return=u.return,Ze=v;break}Ze=u.return}}function dE(l){for(;Ze!==null;){var u=Ze;if(u===l){Ze=null;break}var v=u.sibling;if(v!==null){v.return=u.return,Ze=v;break}Ze=u.return}}function fE(l){for(;Ze!==null;){var u=Ze;try{switch(u.tag){case 0:case 11:case 15:var v=u.return;try{Mp(4,u)}catch(ae){Dn(u,v,ae)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var _=u.return;try{w.componentDidMount()}catch(ae){Dn(u,_,ae)}}var P=u.return;try{Vx(u)}catch(ae){Dn(u,P,ae)}break;case 5:var $=u.return;try{Vx(u)}catch(ae){Dn(u,$,ae)}}}catch(ae){Dn(u,u.return,ae)}if(u===l){Ze=null;break}var Q=u.sibling;if(Q!==null){Q.return=u.return,Ze=Q;break}Ze=u.return}}var KU=Math.ceil,$p=E.ReactCurrentDispatcher,Gx=E.ReactCurrentOwner,wa=E.ReactCurrentBatchConfig,Xt=0,ar=null,Wn=null,dr=0,ta=0,Wl=Eo(0),Yn=0,Zu=null,bi=0,Dp=0,Yx=0,ed=null,$r=null,Xx=0,Vl=1/0,Vs=null,Lp=!1,Jx=null,Io=null,Fp=!1,Mo=null,Bp=0,td=0,Qx=null,zp=-1,Up=0;function Sr(){return(Xt&6)!==0?Nn():zp!==-1?zp:zp=Nn()}function $o(l){return(l.mode&1)===0?1:(Xt&2)!==0&&dr!==0?dr&-dr:kU.transition!==null?(Up===0&&(Up=bo()),Up):(l=on,l!==0||(l=window.event,l=l===void 0?16:h_(l.type)),l)}function Ua(l,u,v,w){if(50<td)throw td=0,Qx=null,Error(n(185));fi(l,v,w),((Xt&2)===0||l!==ar)&&(l===ar&&((Xt&2)===0&&(Dp|=v),Yn===4&&Do(l,dr)),Dr(l,w),v===1&&Xt===0&&(u.mode&1)===0&&(Vl=Nn()+500,vp&&ko()))}function Dr(l,u){var v=l.callbackNode;mr(l,u);var w=At(l,l===ar?dr:0);if(w===0)v!==null&&rn(v),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(v!=null&&rn(v),u===1)l.tag===0?PU(hE.bind(null,l)):Z_(hE.bind(null,l)),CU(function(){(Xt&6)===0&&ko()}),v=null;else{switch(o_(w)){case 1:v=yo;break;case 4:v=Su;break;case 16:v=Sl;break;case 536870912:v=Jf;break;default:v=Sl}v=jE(v,pE.bind(null,l))}l.callbackPriority=u,l.callbackNode=v}}function pE(l,u){if(zp=-1,Up=0,(Xt&6)!==0)throw Error(n(327));var v=l.callbackNode;if(Hl()&&l.callbackNode!==v)return null;var w=At(l,l===ar?dr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=qp(l,w);else{u=w;var _=Xt;Xt|=2;var P=vE();(ar!==l||dr!==u)&&(Vs=null,Vl=Nn()+500,ji(l,u));do try{XU();break}catch(Q){mE(l,Q)}while(!0);vx(),$p.current=P,Xt=_,Wn!==null?u=0:(ar=null,dr=0,u=Yn)}if(u!==0){if(u===2&&(_=un(l),_!==0&&(w=_,u=Zx(l,_))),u===1)throw v=Zu,ji(l,0),Do(l,w),Dr(l,Nn()),v;if(u===6)Do(l,w);else{if(_=l.current.alternate,(w&30)===0&&!GU(_)&&(u=qp(l,w),u===2&&(P=un(l),P!==0&&(w=P,u=Zx(l,P))),u===1))throw v=Zu,ji(l,0),Do(l,w),Dr(l,Nn()),v;switch(l.finishedWork=_,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:Si(l,$r,Vs);break;case 3:if(Do(l,w),(w&130023424)===w&&(u=Xx+500-Nn(),10<u)){if(At(l,0)!==0)break;if(_=l.suspendedLanes,(_&w)!==w){Sr(),l.pingedLanes|=l.suspendedLanes&_;break}l.timeoutHandle=sx(Si.bind(null,l,$r,Vs),u);break}Si(l,$r,Vs);break;case 4:if(Do(l,w),(w&4194240)===w)break;for(u=l.eventTimes,_=-1;0<w;){var $=31-Jr(w);P=1<<$,$=u[$],$>_&&(_=$),w&=~P}if(w=_,w=Nn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*KU(w/1960))-w,10<w){l.timeoutHandle=sx(Si.bind(null,l,$r,Vs),w);break}Si(l,$r,Vs);break;case 5:Si(l,$r,Vs);break;default:throw Error(n(329))}}}return Dr(l,Nn()),l.callbackNode===v?pE.bind(null,l):null}function Zx(l,u){var v=ed;return l.current.memoizedState.isDehydrated&&(ji(l,u).flags|=256),l=qp(l,u),l!==2&&(u=$r,$r=v,u!==null&&ey(u)),l}function ey(l){$r===null?$r=l:$r.push.apply($r,l)}function GU(l){for(var u=l;;){if(u.flags&16384){var v=u.updateQueue;if(v!==null&&(v=v.stores,v!==null))for(var w=0;w<v.length;w++){var _=v[w],P=_.getSnapshot;_=_.value;try{if(!Da(P(),_))return!1}catch{return!1}}}if(v=u.child,u.subtreeFlags&16384&&v!==null)v.return=u,u=v;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 Do(l,u){for(u&=~Yx,u&=~Dp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var v=31-Jr(u),w=1<<v;l[v]=-1,u&=~w}}function hE(l){if((Xt&6)!==0)throw Error(n(327));Hl();var u=At(l,0);if((u&1)===0)return Dr(l,Nn()),null;var v=qp(l,u);if(l.tag!==0&&v===2){var w=un(l);w!==0&&(u=w,v=Zx(l,w))}if(v===1)throw v=Zu,ji(l,0),Do(l,u),Dr(l,Nn()),v;if(v===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,Si(l,$r,Vs),Dr(l,Nn()),null}function ty(l,u){var v=Xt;Xt|=1;try{return l(u)}finally{Xt=v,Xt===0&&(Vl=Nn()+500,vp&&ko())}}function wi(l){Mo!==null&&Mo.tag===0&&(Xt&6)===0&&Hl();var u=Xt;Xt|=1;var v=wa.transition,w=on;try{if(wa.transition=null,on=1,l)return l()}finally{on=w,wa.transition=v,Xt=u,(Xt&6)===0&&ko()}}function ny(){ta=Wl.current,An(Wl)}function ji(l,u){l.finishedWork=null,l.finishedLanes=0;var v=l.timeoutHandle;if(v!==-1&&(l.timeoutHandle=-1,NU(v)),Wn!==null)for(v=Wn.return;v!==null;){var w=v;switch(dx(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&hp();break;case 3:zl(),An(Rr),An(vr),Nx();break;case 5:jx(w);break;case 4:zl();break;case 13:An(Rn);break;case 19:An(Rn);break;case 10:gx(w.type._context);break;case 22:case 23:ny()}v=v.return}if(ar=l,Wn=l=Lo(l.current,null),dr=ta=u,Yn=0,Zu=null,Yx=Dp=bi=0,$r=ed=null,gi!==null){for(u=0;u<gi.length;u++)if(v=gi[u],w=v.interleaved,w!==null){v.interleaved=null;var _=w.next,P=v.pending;if(P!==null){var $=P.next;P.next=_,w.next=$}v.pending=w}gi=null}return l}function mE(l,u){do{var v=Wn;try{if(vx(),_p.current=kp,Ap){for(var w=In.memoizedState;w!==null;){var _=w.queue;_!==null&&(_.pending=null),w=w.next}Ap=!1}if(yi=0,rr=Gn=In=null,Ku=!1,Gu=0,Gx.current=null,v===null||v.return===null){Yn=1,Zu=u,Wn=null;break}e:{var P=l,$=v.return,Q=v,ae=u;if(u=dr,Q.flags|=32768,ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var ye=ae,Oe=Q,Ie=Oe.tag;if((Oe.mode&1)===0&&(Ie===0||Ie===11||Ie===15)){var ke=Oe.alternate;ke?(Oe.updateQueue=ke.updateQueue,Oe.memoizedState=ke.memoizedState,Oe.lanes=ke.lanes):(Oe.updateQueue=null,Oe.memoizedState=null)}var Xe=BA($);if(Xe!==null){Xe.flags&=-257,zA(Xe,$,Q,P,u),Xe.mode&1&&FA(P,ye,u),u=Xe,ae=ye;var rt=u.updateQueue;if(rt===null){var st=new Set;st.add(ae),u.updateQueue=st}else rt.add(ae);break e}else{if((u&1)===0){FA(P,ye,u),ry();break e}ae=Error(n(426))}}else if(Tn&&Q.mode&1){var Un=BA($);if(Un!==null){(Un.flags&65536)===0&&(Un.flags|=256),zA(Un,$,Q,P,u),hx(Ul(ae,Q));break e}}P=ae=Ul(ae,Q),Yn!==4&&(Yn=2),ed===null?ed=[P]:ed.push(P),P=$;do{switch(P.tag){case 3:P.flags|=65536,u&=-u,P.lanes|=u;var pe=DA(P,ae,u);uA(P,pe);break e;case 1:Q=ae;var ce=P.type,ge=P.stateNode;if((P.flags&128)===0&&(typeof ce.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(Io===null||!Io.has(ge)))){P.flags|=65536,u&=-u,P.lanes|=u;var De=LA(P,Q,u);uA(P,De);break e}}P=P.return}while(P!==null)}xE(v)}catch(lt){u=lt,Wn===v&&v!==null&&(Wn=v=v.return);continue}break}while(!0)}function vE(){var l=$p.current;return $p.current=kp,l===null?kp:l}function ry(){(Yn===0||Yn===3||Yn===2)&&(Yn=4),ar===null||(bi&268435455)===0&&(Dp&268435455)===0||Do(ar,dr)}function qp(l,u){var v=Xt;Xt|=2;var w=vE();(ar!==l||dr!==u)&&(Vs=null,ji(l,u));do try{YU();break}catch(_){mE(l,_)}while(!0);if(vx(),Xt=v,$p.current=w,Wn!==null)throw Error(n(261));return ar=null,dr=0,Yn}function YU(){for(;Wn!==null;)gE(Wn)}function XU(){for(;Wn!==null&&!Yt();)gE(Wn)}function gE(l){var u=wE(l.alternate,l,ta);l.memoizedProps=l.pendingProps,u===null?xE(l):Wn=u,Gx.current=null}function xE(l){var u=l;do{var v=u.alternate;if(l=u.return,(u.flags&32768)===0){if(v=UU(v,u,ta),v!==null){Wn=v;return}}else{if(v=qU(v,u),v!==null){v.flags&=32767,Wn=v;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Yn=6,Wn=null;return}}if(u=u.sibling,u!==null){Wn=u;return}Wn=u=l}while(u!==null);Yn===0&&(Yn=5)}function Si(l,u,v){var w=on,_=wa.transition;try{wa.transition=null,on=1,JU(l,u,v,w)}finally{wa.transition=_,on=w}return null}function JU(l,u,v,w){do Hl();while(Mo!==null);if((Xt&6)!==0)throw Error(n(327));v=l.finishedWork;var _=l.finishedLanes;if(v===null)return null;if(l.finishedWork=null,l.finishedLanes=0,v===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var P=v.lanes|v.childLanes;if(Nu(l,P),l===ar&&(Wn=ar=null,dr=0),(v.subtreeFlags&2064)===0&&(v.flags&2064)===0||Fp||(Fp=!0,jE(Sl,function(){return Hl(),null})),P=(v.flags&15990)!==0,(v.subtreeFlags&15990)!==0||P){P=wa.transition,wa.transition=null;var $=on;on=1;var Q=Xt;Xt|=4,Gx.current=null,VU(l,v),lE(v,l),gU(rx),ep=!!nx,rx=nx=null,l.current=v,HU(v),zn(),Xt=Q,on=$,wa.transition=P}else l.current=v;if(Fp&&(Fp=!1,Mo=l,Bp=_),P=l.pendingLanes,P===0&&(Io=null),Rg(v.stateNode),Dr(l,Nn()),u!==null)for(w=l.onRecoverableError,v=0;v<u.length;v++)_=u[v],w(_.value,{componentStack:_.stack,digest:_.digest});if(Lp)throw Lp=!1,l=Jx,Jx=null,l;return(Bp&1)!==0&&l.tag!==0&&Hl(),P=l.pendingLanes,(P&1)!==0?l===Qx?td++:(td=0,Qx=l):td=0,ko(),null}function Hl(){if(Mo!==null){var l=o_(Bp),u=wa.transition,v=on;try{if(wa.transition=null,on=16>l?16:l,Mo===null)var w=!1;else{if(l=Mo,Mo=null,Bp=0,(Xt&6)!==0)throw Error(n(331));var _=Xt;for(Xt|=4,Ze=l.current;Ze!==null;){var P=Ze,$=P.child;if((Ze.flags&16)!==0){var Q=P.deletions;if(Q!==null){for(var ae=0;ae<Q.length;ae++){var ye=Q[ae];for(Ze=ye;Ze!==null;){var Oe=Ze;switch(Oe.tag){case 0:case 11:case 15:Qu(8,Oe,P)}var Ie=Oe.child;if(Ie!==null)Ie.return=Oe,Ze=Ie;else for(;Ze!==null;){Oe=Ze;var ke=Oe.sibling,Xe=Oe.return;if(rE(Oe),Oe===ye){Ze=null;break}if(ke!==null){ke.return=Xe,Ze=ke;break}Ze=Xe}}}var rt=P.alternate;if(rt!==null){var st=rt.child;if(st!==null){rt.child=null;do{var Un=st.sibling;st.sibling=null,st=Un}while(st!==null)}}Ze=P}}if((P.subtreeFlags&2064)!==0&&$!==null)$.return=P,Ze=$;else e:for(;Ze!==null;){if(P=Ze,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:Qu(9,P,P.return)}var pe=P.sibling;if(pe!==null){pe.return=P.return,Ze=pe;break e}Ze=P.return}}var ce=l.current;for(Ze=ce;Ze!==null;){$=Ze;var ge=$.child;if(($.subtreeFlags&2064)!==0&&ge!==null)ge.return=$,Ze=ge;else e:for($=ce;Ze!==null;){if(Q=Ze,(Q.flags&2048)!==0)try{switch(Q.tag){case 0:case 11:case 15:Mp(9,Q)}}catch(lt){Dn(Q,Q.return,lt)}if(Q===$){Ze=null;break e}var De=Q.sibling;if(De!==null){De.return=Q.return,Ze=De;break e}Ze=Q.return}}if(Xt=_,ko(),va&&typeof va.onPostCommitFiberRoot=="function")try{va.onPostCommitFiberRoot(di,l)}catch{}w=!0}return w}finally{on=v,wa.transition=u}}return!1}function yE(l,u,v){u=Ul(v,u),u=DA(l,u,1),l=Oo(l,u,1),u=Sr(),l!==null&&(fi(l,1,u),Dr(l,u))}function Dn(l,u,v){if(l.tag===3)yE(l,l,v);else for(;u!==null;){if(u.tag===3){yE(u,l,v);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(Io===null||!Io.has(w))){l=Ul(v,l),l=LA(u,l,1),u=Oo(u,l,1),l=Sr(),u!==null&&(fi(u,1,l),Dr(u,l));break}}u=u.return}}function QU(l,u,v){var w=l.pingCache;w!==null&&w.delete(u),u=Sr(),l.pingedLanes|=l.suspendedLanes&v,ar===l&&(dr&v)===v&&(Yn===4||Yn===3&&(dr&130023424)===dr&&500>Nn()-Xx?ji(l,0):Yx|=v),Dr(l,u)}function bE(l,u){u===0&&((l.mode&1)===0?u=1:(u=Me,Me<<=1,(Me&130023424)===0&&(Me=4194304)));var v=Sr();l=Us(l,u),l!==null&&(fi(l,u,v),Dr(l,v))}function ZU(l){var u=l.memoizedState,v=0;u!==null&&(v=u.retryLane),bE(l,v)}function eq(l,u){var v=0;switch(l.tag){case 13:var w=l.stateNode,_=l.memoizedState;_!==null&&(v=_.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),bE(l,v)}var wE;wE=function(l,u,v){if(l!==null)if(l.memoizedProps!==u.pendingProps||Rr.current)Mr=!0;else{if((l.lanes&v)===0&&(u.flags&128)===0)return Mr=!1,zU(l,u,v);Mr=(l.flags&131072)!==0}else Mr=!1,Tn&&(u.flags&1048576)!==0&&eA(u,xp,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;Rp(l,u),l=u.pendingProps;var _=Il(u,vr.current);Bl(u,v),_=Ax(null,u,w,l,_,v);var P=Ex();return u.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Ir(w)?(P=!0,mp(u)):P=!1,u.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,bx(u),_.updater=Tp,u.stateNode=_,_._reactInternals=u,Ix(u,w,l,v),u=Lx(null,u,w,!0,P,v)):(u.tag=0,Tn&&P&&ux(u),jr(null,u,_,v),u=u.child),u;case 16:w=u.elementType;e:{switch(Rp(l,u),l=u.pendingProps,_=w._init,w=_(w._payload),u.type=w,_=u.tag=nq(w),l=Fa(w,l),_){case 0:u=Dx(null,u,w,l,v);break e;case 1:u=KA(null,u,w,l,v);break e;case 11:u=UA(null,u,w,l,v);break e;case 14:u=qA(null,u,w,Fa(w.type,l),v);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Fa(w,_),Dx(l,u,w,_,v);case 1:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Fa(w,_),KA(l,u,w,_,v);case 3:e:{if(GA(u),l===null)throw Error(n(387));w=u.pendingProps,P=u.memoizedState,_=P.element,cA(l,u),Np(u,w,null,v);var $=u.memoizedState;if(w=$.element,P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:$.cache,pendingSuspenseBoundaries:$.pendingSuspenseBoundaries,transitions:$.transitions},u.updateQueue.baseState=P,u.memoizedState=P,u.flags&256){_=Ul(Error(n(423)),u),u=YA(l,u,w,v,_);break e}else if(w!==_){_=Ul(Error(n(424)),u),u=YA(l,u,w,v,_);break e}else for(ea=Ao(u.stateNode.containerInfo.firstChild),Zr=u,Tn=!0,La=null,v=iA(u,null,w,v),u.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Dl(),w===_){u=Ws(l,u,v);break e}jr(l,u,w,v)}u=u.child}return u;case 5:return fA(u),l===null&&px(u),w=u.type,_=u.pendingProps,P=l!==null?l.memoizedProps:null,$=_.children,ax(w,_)?$=null:P!==null&&ax(w,P)&&(u.flags|=32),HA(l,u),jr(l,u,$,v),u.child;case 6:return l===null&&px(u),null;case 13:return XA(l,u,v);case 4:return wx(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=Ll(u,null,w,v):jr(l,u,w,v),u.child;case 11:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Fa(w,_),UA(l,u,w,_,v);case 7:return jr(l,u,u.pendingProps,v),u.child;case 8:return jr(l,u,u.pendingProps.children,v),u.child;case 12:return jr(l,u,u.pendingProps.children,v),u.child;case 10:e:{if(w=u.type._context,_=u.pendingProps,P=u.memoizedProps,$=_.value,gn(wp,w._currentValue),w._currentValue=$,P!==null)if(Da(P.value,$)){if(P.children===_.children&&!Rr.current){u=Ws(l,u,v);break e}}else for(P=u.child,P!==null&&(P.return=u);P!==null;){var Q=P.dependencies;if(Q!==null){$=P.child;for(var ae=Q.firstContext;ae!==null;){if(ae.context===w){if(P.tag===1){ae=qs(-1,v&-v),ae.tag=2;var ye=P.updateQueue;if(ye!==null){ye=ye.shared;var Oe=ye.pending;Oe===null?ae.next=ae:(ae.next=Oe.next,Oe.next=ae),ye.pending=ae}}P.lanes|=v,ae=P.alternate,ae!==null&&(ae.lanes|=v),xx(P.return,v,u),Q.lanes|=v;break}ae=ae.next}}else if(P.tag===10)$=P.type===u.type?null:P.child;else if(P.tag===18){if($=P.return,$===null)throw Error(n(341));$.lanes|=v,Q=$.alternate,Q!==null&&(Q.lanes|=v),xx($,v,u),$=P.sibling}else $=P.child;if($!==null)$.return=P;else for($=P;$!==null;){if($===u){$=null;break}if(P=$.sibling,P!==null){P.return=$.return,$=P;break}$=$.return}P=$}jr(l,u,_.children,v),u=u.child}return u;case 9:return _=u.type,w=u.pendingProps.children,Bl(u,v),_=ya(_),w=w(_),u.flags|=1,jr(l,u,w,v),u.child;case 14:return w=u.type,_=Fa(w,u.pendingProps),_=Fa(w.type,_),qA(l,u,w,_,v);case 15:return WA(l,u,u.type,u.pendingProps,v);case 17:return w=u.type,_=u.pendingProps,_=u.elementType===w?_:Fa(w,_),Rp(l,u),u.tag=1,Ir(w)?(l=!0,mp(u)):l=!1,Bl(u,v),MA(u,w,_),Ix(u,w,_,v),Lx(null,u,w,!0,l,v);case 19:return QA(l,u,v);case 22:return VA(l,u,v)}throw Error(n(156,u.tag))};function jE(l,u){return He(l,u)}function tq(l,u,v,w){this.tag=l,this.key=v,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 ja(l,u,v,w){return new tq(l,u,v,w)}function ay(l){return l=l.prototype,!(!l||!l.isReactComponent)}function nq(l){if(typeof l=="function")return ay(l)?1:0;if(l!=null){if(l=l.$$typeof,l===F)return 11;if(l===R)return 14}return 2}function Lo(l,u){var v=l.alternate;return v===null?(v=ja(l.tag,u,l.key,l.mode),v.elementType=l.elementType,v.type=l.type,v.stateNode=l.stateNode,v.alternate=l,l.alternate=v):(v.pendingProps=u,v.type=l.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=l.flags&14680064,v.childLanes=l.childLanes,v.lanes=l.lanes,v.child=l.child,v.memoizedProps=l.memoizedProps,v.memoizedState=l.memoizedState,v.updateQueue=l.updateQueue,u=l.dependencies,v.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},v.sibling=l.sibling,v.index=l.index,v.ref=l.ref,v}function Wp(l,u,v,w,_,P){var $=2;if(w=l,typeof l=="function")ay(l)&&($=1);else if(typeof l=="string")$=5;else e:switch(l){case T:return Ni(v.children,_,P,u);case O:$=8,_|=8;break;case L:return l=ja(12,v,u,_|2),l.elementType=L,l.lanes=P,l;case G:return l=ja(13,v,u,_),l.elementType=G,l.lanes=P,l;case W:return l=ja(19,v,u,_),l.elementType=W,l.lanes=P,l;case K:return Vp(v,_,P,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case z:$=10;break e;case q:$=9;break e;case F:$=11;break e;case R:$=14;break e;case M:$=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=ja($,v,u,_),u.elementType=l,u.type=w,u.lanes=P,u}function Ni(l,u,v,w){return l=ja(7,l,w,u),l.lanes=v,l}function Vp(l,u,v,w){return l=ja(22,l,w,u),l.elementType=K,l.lanes=v,l.stateNode={isHidden:!1},l}function sy(l,u,v){return l=ja(6,l,null,u),l.lanes=v,l}function oy(l,u,v){return u=ja(4,l.children!==null?l.children:[],l.key,u),u.lanes=v,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function rq(l,u,v,w,_){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=Nl(0),this.expirationTimes=Nl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nl(0),this.identifierPrefix=w,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function iy(l,u,v,w,_,P,$,Q,ae){return l=new rq(l,u,v,Q,ae),u===1?(u=1,P===!0&&(u|=8)):u=0,P=ja(3,null,null,u),l.current=P,P.stateNode=l,P.memoizedState={element:w,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},bx(P),l}function aq(l,u,v){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:w==null?null:""+w,children:l,containerInfo:u,implementation:v}}function SE(l){if(!l)return Po;l=l._reactInternals;e:{if(Ve(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(Ir(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(l.tag===1){var v=l.type;if(Ir(v))return J_(l,v,u)}return u}function NE(l,u,v,w,_,P,$,Q,ae){return l=iy(v,w,!0,l,_,P,$,Q,ae),l.context=SE(null),v=l.current,w=Sr(),_=$o(v),P=qs(w,_),P.callback=u??null,Oo(v,P,_),l.current.lanes=_,fi(l,_,w),Dr(l,w),l}function Hp(l,u,v,w){var _=u.current,P=Sr(),$=$o(_);return v=SE(v),u.context===null?u.context=v:u.pendingContext=v,u=qs(P,$),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=Oo(_,u,$),l!==null&&(Ua(l,_,$,P),Sp(l,_,$)),$}function Kp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function CE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var v=l.retryLane;l.retryLane=v!==0&&v<u?v:u}}function ly(l,u){CE(l,u),(l=l.alternate)&&CE(l,u)}function sq(){return null}var _E=typeof reportError=="function"?reportError:function(l){console.error(l)};function cy(l){this._internalRoot=l}Gp.prototype.render=cy.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));Hp(l,u,null,null)},Gp.prototype.unmount=cy.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;wi(function(){Hp(null,l,null,null)}),u[Ls]=null}};function Gp(l){this._internalRoot=l}Gp.prototype.unstable_scheduleHydration=function(l){if(l){var u=c_();l={blockedOn:null,target:l,priority:u};for(var v=0;v<No.length&&u!==0&&u<No[v].priority;v++);No.splice(v,0,l),v===0&&f_(l)}};function uy(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Yp(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function AE(){}function oq(l,u,v,w,_){if(_){if(typeof w=="function"){var P=w;w=function(){var ye=Kp($);P.call(ye)}}var $=NE(u,w,l,0,null,!1,!1,"",AE);return l._reactRootContainer=$,l[Ls]=$.current,Fu(l.nodeType===8?l.parentNode:l),wi(),$}for(;_=l.lastChild;)l.removeChild(_);if(typeof w=="function"){var Q=w;w=function(){var ye=Kp(ae);Q.call(ye)}}var ae=iy(l,0,!1,null,null,!1,!1,"",AE);return l._reactRootContainer=ae,l[Ls]=ae.current,Fu(l.nodeType===8?l.parentNode:l),wi(function(){Hp(u,ae,v,w)}),ae}function Xp(l,u,v,w,_){var P=v._reactRootContainer;if(P){var $=P;if(typeof _=="function"){var Q=_;_=function(){var ae=Kp($);Q.call(ae)}}Hp(u,$,l,_)}else $=oq(v,u,l,_,w);return Kp($)}i_=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var v=zt(u.pendingLanes);v!==0&&(Cu(u,v|1),Dr(u,Nn()),(Xt&6)===0&&(Vl=Nn()+500,ko()))}break;case 13:wi(function(){var w=Us(l,1);if(w!==null){var _=Sr();Ua(w,l,1,_)}}),ly(l,1)}},Mg=function(l){if(l.tag===13){var u=Us(l,134217728);if(u!==null){var v=Sr();Ua(u,l,134217728,v)}ly(l,134217728)}},l_=function(l){if(l.tag===13){var u=$o(l),v=Us(l,u);if(v!==null){var w=Sr();Ua(v,l,u,w)}ly(l,u)}},c_=function(){return on},u_=function(l,u){var v=on;try{return on=l,u()}finally{on=v}},$t=function(l,u,v){switch(u){case"input":if(ie(l,v),u=v.name,v.type==="radio"&&u!=null){for(v=l;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<v.length;u++){var w=v[u];if(w!==l&&w.form===l.form){var _=pp(w);if(!_)throw Error(n(90));le(w),ie(w,_)}}}break;case"textarea":jt(l,v);break;case"select":u=v.value,u!=null&&ut(l,!!v.multiple,u,!1)}},Pt=ty,Rt=wi;var iq={usingClientEntryPoint:!1,Events:[Uu,Ol,pp,hr,ft,ty]},nd={findFiberByHostInstance:pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},lq={bundleType:nd.bundleType,version:nd.version,rendererPackageName:nd.rendererPackageName,rendererConfig:nd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Bt(l),l===null?null:l.stateNode},findFiberByHostInstance:nd.findFiberByHostInstance||sq,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 Jp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jp.isDisabled&&Jp.supportsFiber)try{di=Jp.inject(lq),va=Jp}catch{}}return Lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iq,Lr.createPortal=function(l,u){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uy(u))throw Error(n(200));return aq(l,u,null,v)},Lr.createRoot=function(l,u){if(!uy(l))throw Error(n(299));var v=!1,w="",_=_E;return u!=null&&(u.unstable_strictMode===!0&&(v=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(_=u.onRecoverableError)),u=iy(l,1,!1,null,null,v,!1,w,_),l[Ls]=u.current,Fu(l.nodeType===8?l.parentNode:l),new cy(u)},Lr.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=Bt(u),l=l===null?null:l.stateNode,l},Lr.flushSync=function(l){return wi(l)},Lr.hydrate=function(l,u,v){if(!Yp(u))throw Error(n(200));return Xp(null,l,u,!0,v)},Lr.hydrateRoot=function(l,u,v){if(!uy(l))throw Error(n(405));var w=v!=null&&v.hydratedSources||null,_=!1,P="",$=_E;if(v!=null&&(v.unstable_strictMode===!0&&(_=!0),v.identifierPrefix!==void 0&&(P=v.identifierPrefix),v.onRecoverableError!==void 0&&($=v.onRecoverableError)),u=NE(u,null,l,1,v??null,_,!1,P,$),l[Ls]=u.current,Fu(l),w)for(l=0;l<w.length;l++)v=w[l],_=v._getVersion,_=_(v._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[v,_]:u.mutableSourceEagerHydrationData.push(v,_);return new Gp(u)},Lr.render=function(l,u,v){if(!Yp(u))throw Error(n(200));return Xp(null,l,u,!1,v)},Lr.unmountComponentAtNode=function(l){if(!Yp(l))throw Error(n(40));return l._reactRootContainer?(wi(function(){Xp(null,null,l,!1,function(){l._reactRootContainer=null,l[Ls]=null})}),!0):!1},Lr.unstable_batchedUpdates=ty,Lr.unstable_renderSubtreeIntoContainer=function(l,u,v,w){if(!Yp(v))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Xp(l,u,v,!1,w)},Lr.version="18.3.1-next-f1338f8080-20240426",Lr}var ME;function w$(){if(ME)return py.exports;ME=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(),py.exports=vq(),py.exports}var $E;function gq(){if($E)return Zp;$E=1;var e=w$();return Zp.createRoot=e.createRoot,Zp.hydrateRoot=e.hydrateRoot,Zp}var xq=gq(),m=rN();const Y=ln(m),Zm=uq({__proto__:null,default:Y},[m]),yq=1,bq=1e6;let vy=0;function wq(){return vy=(vy+1)%Number.MAX_SAFE_INTEGER,vy.toString()}const gy=new Map,DE=e=>{if(gy.has(e))return;const t=setTimeout(()=>{gy.delete(e),jd({type:"REMOVE_TOAST",toastId:e})},bq);gy.set(e,t)},jq=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,yq)};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?DE(n):e.toasts.forEach(r=>{DE(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)}}},Ch=[];let _h={toasts:[]};function jd(e){_h=jq(_h,e),Ch.forEach(t=>{t(_h)})}function Pe({...e}){const t=wq(),n=a=>jd({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>jd({type:"DISMISS_TOAST",toastId:t});return jd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function Sq(){const[e,t]=m.useState(_h);return m.useEffect(()=>(Ch.push(t),()=>{const n=Ch.indexOf(t);n>-1&&Ch.splice(n,1)}),[e]),{...e,toast:Pe,dismiss:n=>jd({type:"DISMISS_TOAST",toastId:n})}}var tu=w$();const j$=ln(tu);function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function LE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kr(...e){return t=>{let n=!1;const r=e.map(a=>{const o=LE(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a<r.length;a++){const o=r[a];typeof o=="function"?o():LE(e[a],null)}}}}function xt(...e){return m.useCallback(kr(...e),e)}function Nq(e,t){const n=m.createContext(t),r=o=>{const{children:i,...c}=o,d=m.useMemo(()=>c,Object.values(c));return s.jsx(n.Provider,{value:d,children:i})};r.displayName=e+"Provider";function a(o){const i=m.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function pr(e,t=[]){let n=[];function r(o,i){const c=m.createContext(i),d=n.length;n=[...n,i];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:y,children:x})};f.displayName=o+"Provider";function h(p,g){const x=g?.[e]?.[d]||c,j=m.useContext(x);if(j)return j;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,h]}const a=()=>{const o=n.map(i=>m.createContext(i));return function(c){const d=c?.[e]||o;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,Cq(a,...t)]}function Cq(...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(o){const i=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(o)[`__scope${f}`];return{...c,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function FE(e){const t=_q(e),n=m.forwardRef((r,a)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(Eq);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...i,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function _q(e){const t=m.forwardRef((n,r)=>{const{children:a,...o}=n;if(m.isValidElement(a)){const i=kq(a),c=Pq(o,a.props);return a.type!==m.Fragment&&(c.ref=r?kr(r,i):i),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Aq=Symbol("radix.slottable");function Eq(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Aq}function Pq(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...c)=>{const d=o(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function kq(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 Sf(e){const t=e+"CollectionProvider",[n,r]=pr(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=b=>{const{scope:y,children:S}=b,C=Y.useRef(null),N=Y.useRef(new Map).current;return s.jsx(a,{scope:y,itemMap:N,collectionRef:C,children:S})};i.displayName=t;const c=e+"CollectionSlot",d=FE(c),f=Y.forwardRef((b,y)=>{const{scope:S,children:C}=b,N=o(c,S),E=xt(y,N.collectionRef);return s.jsx(d,{ref:E,children:C})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=FE(h),x=Y.forwardRef((b,y)=>{const{scope:S,children:C,...N}=b,E=Y.useRef(null),A=xt(y,E),k=o(h,S);return Y.useEffect(()=>(k.itemMap.set(E,{ref:E,...N}),()=>{k.itemMap.delete(E)})),s.jsx(g,{[p]:"",ref:A,children:C})});x.displayName=h;function j(b){const y=o(e+"CollectionConsumer",b);return Y.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((k,T)=>N.indexOf(k.ref.current)-N.indexOf(T.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:f,ItemSlot:x},j,r]}function Tq(e){const t=Oq(e),n=m.forwardRef((r,a)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(Iq);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...i,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function Oq(e){const t=m.forwardRef((n,r)=>{const{children:a,...o}=n;if(m.isValidElement(a)){const i=$q(a),c=Mq(o,a.props);return a.type!==m.Fragment&&(c.ref=r?kr(r,i):i),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Rq=Symbol("radix.slottable");function Iq(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rq}function Mq(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...c)=>{const d=o(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function $q(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 Dq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=Dq.reduce((e,t)=>{const n=Tq(`Primitive.${t}`),r=m.forwardRef((a,o)=>{const{asChild:i,...c}=a,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function aN(e,t){e&&tu.flushSync(()=>e.dispatchEvent(t))}function qn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>t.current?.(...n),[])}function Lq(e,t=globalThis?.document){const n=qn(e);m.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 Fq="DismissableLayer",Kj="dismissableLayer.update",Bq="dismissableLayer.pointerDownOutside",zq="dismissableLayer.focusOutside",BE,S$=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ul=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:c,...d}=e,f=m.useContext(S$),[h,p]=m.useState(null),g=h?.ownerDocument??globalThis?.document,[,x]=m.useState({}),j=xt(t,T=>p(T)),b=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(y),C=h?b.indexOf(h):-1,N=f.layersWithOutsidePointerEventsDisabled.size>0,E=C>=S,A=qq(T=>{const O=T.target,L=[...f.branches].some(z=>z.contains(O));!E||L||(a?.(T),i?.(T),T.defaultPrevented||c?.())},g),k=Wq(T=>{const O=T.target;[...f.branches].some(z=>z.contains(O))||(o?.(T),i?.(T),T.defaultPrevented||c?.())},g);return Lq(T=>{C===f.layers.size-1&&(r?.(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},g),m.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(BE=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),zE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=BE)}},[h,g,n,f]),m.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),zE())},[h,f]),m.useEffect(()=>{const T=()=>x({});return document.addEventListener(Kj,T),()=>document.removeEventListener(Kj,T)},[]),s.jsx(Ke.div,{...d,ref:j,style:{pointerEvents:N?E?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,A.onPointerDownCapture)})});ul.displayName=Fq;var Uq="DismissableLayerBranch",N$=m.forwardRef((e,t)=>{const n=m.useContext(S$),r=m.useRef(null),a=xt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),s.jsx(Ke.div,{...e,ref:a})});N$.displayName=Uq;function qq(e,t=globalThis?.document){const n=qn(e),r=m.useRef(!1),a=m.useRef(()=>{});return m.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){C$(Bq,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},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Wq(e,t=globalThis?.document){const n=qn(e),r=m.useRef(!1);return m.useEffect(()=>{const a=o=>{o.target&&!r.current&&C$(zq,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zE(){const e=new CustomEvent(Kj);document.dispatchEvent(e)}function C$(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?aN(a,o):a.dispatchEvent(o)}var Vq=ul,Hq=N$,tr=globalThis?.document?m.useLayoutEffect:()=>{},Kq="Portal",dl=m.forwardRef((e,t)=>{const{container:n,...r}=e,[a,o]=m.useState(!1);tr(()=>o(!0),[]);const i=n||a&&globalThis?.document?.body;return i?j$.createPortal(s.jsx(Ke.div,{...r,ref:t}),i):null});dl.displayName=Kq;function Gq(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=Yq(t),a=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=xt(r.ref,Xq(a));return typeof n=="function"||r.isPresent?m.cloneElement(a,{ref:o}):null};Kn.displayName="Presence";function Yq(e){const[t,n]=m.useState(),r=m.useRef(null),a=m.useRef(e),o=m.useRef("none"),i=e?"mounted":"unmounted",[c,d]=Gq(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const f=eh(r.current);o.current=c==="mounted"?f:"none"},[c]),tr(()=>{const f=r.current,h=a.current;if(h!==e){const g=o.current,x=eh(f);e?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&g!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),tr(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=x=>{const b=eh(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&b&&(d("ANIMATION_END"),!a.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},g=x=>{x.target===t&&(o.current=eh(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:m.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function eh(e){return e?.animationName||"none"}function Xq(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 Jq=Zm[" useInsertionEffect ".trim().toString()]||tr;function pa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,o,i]=Qq({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:a;{const h=m.useRef(e!==void 0);m.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=m.useCallback(h=>{if(c){const p=Zq(h)?h(e):h;p!==e&&i.current?.(p)}else o(h)},[c,e,o,i]);return[d,f]}function Qq({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),a=m.useRef(n),o=m.useRef(t);return Jq(()=>{o.current=t},[t]),m.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function Zq(e){return typeof e=="function"}var _$=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"}),e7="VisuallyHidden",ev=m.forwardRef((e,t)=>s.jsx(Ke.span,{...e,ref:t,style:{..._$,...e.style}}));ev.displayName=e7;var t7=ev,sN="ToastProvider",[oN,n7,r7]=Sf("Toast"),[A$]=pr("Toast",[r7]),[a7,tv]=A$(sN),E$=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:o=50,children:i}=e,[c,d]=m.useState(null),[f,h]=m.useState(0),p=m.useRef(!1),g=m.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${sN}\`. Expected non-empty \`string\`.`),s.jsx(oN.Provider,{scope:t,children:s.jsx(a7,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:o,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:m.useCallback(()=>h(x=>x+1),[]),onToastRemove:m.useCallback(()=>h(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:i})})};E$.displayName=sN;var P$="ToastViewport",s7=["F8"],Gj="toast.viewportPause",Yj="toast.viewportResume",k$=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=s7,label:a="Notifications ({hotkey})",...o}=e,i=tv(P$,n),c=n7(n),d=m.useRef(null),f=m.useRef(null),h=m.useRef(null),p=m.useRef(null),g=xt(t,p,i.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=i.toastCount>0;m.useEffect(()=>{const y=S=>{r.length!==0&&r.every(N=>S[N]||S.code===N)&&p.current?.focus()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),m.useEffect(()=>{const y=d.current,S=p.current;if(j&&y&&S){const C=()=>{if(!i.isClosePausedRef.current){const k=new CustomEvent(Gj);S.dispatchEvent(k),i.isClosePausedRef.current=!0}},N=()=>{if(i.isClosePausedRef.current){const k=new CustomEvent(Yj);S.dispatchEvent(k),i.isClosePausedRef.current=!1}},E=k=>{!y.contains(k.relatedTarget)&&N()},A=()=>{y.contains(document.activeElement)||N()};return y.addEventListener("focusin",C),y.addEventListener("focusout",E),y.addEventListener("pointermove",C),y.addEventListener("pointerleave",A),window.addEventListener("blur",C),window.addEventListener("focus",N),()=>{y.removeEventListener("focusin",C),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",C),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",C),window.removeEventListener("focus",N)}}},[j,i.isClosePausedRef]);const b=m.useCallback(({tabbingDirection:y})=>{const C=c().map(N=>{const E=N.ref.current,A=[E,...x7(E)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?C.reverse():C).flat()},[c]);return m.useEffect(()=>{const y=p.current;if(y){const S=C=>{const N=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!N){const A=document.activeElement,k=C.shiftKey;if(C.target===y&&k){f.current?.focus();return}const L=b({tabbingDirection:k?"backwards":"forwards"}),z=L.findIndex(q=>q===A);xy(L.slice(z+1))?C.preventDefault():k?f.current?.focus():h.current?.focus()}};return y.addEventListener("keydown",S),()=>y.removeEventListener("keydown",S)}},[c,b]),s.jsxs(Hq,{ref:d,role:"region","aria-label":a.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(Xj,{ref:f,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"forwards"});xy(y)}}),s.jsx(oN.Slot,{scope:n,children:s.jsx(Ke.ol,{tabIndex:-1,...o,ref:g})}),j&&s.jsx(Xj,{ref:h,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"backwards"});xy(y)}})]})});k$.displayName=P$;var T$="ToastFocusProxy",Xj=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,o=tv(T$,n);return s.jsx(ev,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:i=>{const c=i.relatedTarget;!o.viewport?.contains(c)&&r()}})});Xj.displayName=T$;var Nf="Toast",o7="toast.swipeStart",i7="toast.swipeMove",l7="toast.swipeCancel",c7="toast.swipeEnd",O$=m.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:o,...i}=e,[c,d]=pa({prop:r,defaultProp:a??!0,onChange:o,caller:Nf});return s.jsx(Kn,{present:n||c,children:s.jsx(f7,{open:c,...i,ref:t,onClose:()=>d(!1),onPause:qn(e.onPause),onResume:qn(e.onResume),onSwipeStart:Re(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Re(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:Re(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:Re(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)})})})});O$.displayName=Nf;var[u7,d7]=A$(Nf,{onClose(){}}),f7=m.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:o,onClose:i,onEscapeKeyDown:c,onPause:d,onResume:f,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:x,...j}=e,b=tv(Nf,n),[y,S]=m.useState(null),C=xt(t,W=>S(W)),N=m.useRef(null),E=m.useRef(null),A=a||b.duration,k=m.useRef(0),T=m.useRef(A),O=m.useRef(0),{onToastAdd:L,onToastRemove:z}=b,q=qn(()=>{y?.contains(document.activeElement)&&b.viewport?.focus(),i()}),F=m.useCallback(W=>{!W||W===1/0||(window.clearTimeout(O.current),k.current=new Date().getTime(),O.current=window.setTimeout(q,W))},[q]);m.useEffect(()=>{const W=b.viewport;if(W){const R=()=>{F(T.current),f?.()},M=()=>{const K=new Date().getTime()-k.current;T.current=T.current-K,window.clearTimeout(O.current),d?.()};return W.addEventListener(Gj,M),W.addEventListener(Yj,R),()=>{W.removeEventListener(Gj,M),W.removeEventListener(Yj,R)}}},[b.viewport,A,d,f,F]),m.useEffect(()=>{o&&!b.isClosePausedRef.current&&F(A)},[o,A,b.isClosePausedRef,F]),m.useEffect(()=>(L(),()=>z()),[L,z]);const G=m.useMemo(()=>y?F$(y):null,[y]);return b.viewport?s.jsxs(s.Fragment,{children:[G&&s.jsx(p7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:G}),s.jsx(u7,{scope:n,onClose:q,children:tu.createPortal(s.jsx(oN.ItemSlot,{scope:n,children:s.jsx(Vq,{asChild:!0,onEscapeKeyDown:Re(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||q(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Ke.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Re(e.onKeyDown,W=>{W.key==="Escape"&&(c?.(W.nativeEvent),W.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:Re(e.onPointerDown,W=>{W.button===0&&(N.current={x:W.clientX,y:W.clientY})}),onPointerMove:Re(e.onPointerMove,W=>{if(!N.current)return;const R=W.clientX-N.current.x,M=W.clientY-N.current.y,K=!!E.current,V=["left","right"].includes(b.swipeDirection),D=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,J=V?D(0,R):0,H=V?0:D(0,M),I=W.pointerType==="touch"?10:2,te={x:J,y:H},de={originalEvent:W,delta:te};K?(E.current=te,th(i7,p,de,{discrete:!1})):UE(te,b.swipeDirection,I)?(E.current=te,th(o7,h,de,{discrete:!1}),W.target.setPointerCapture(W.pointerId)):(Math.abs(R)>I||Math.abs(M)>I)&&(N.current=null)}),onPointerUp:Re(e.onPointerUp,W=>{const R=E.current,M=W.target;if(M.hasPointerCapture(W.pointerId)&&M.releasePointerCapture(W.pointerId),E.current=null,N.current=null,R){const K=W.currentTarget,V={originalEvent:W,delta:R};UE(R,b.swipeDirection,b.swipeThreshold)?th(c7,x,V,{discrete:!0}):th(l7,g,V,{discrete:!0}),K.addEventListener("click",D=>D.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),p7=e=>{const{__scopeToast:t,children:n,...r}=e,a=tv(Nf,t),[o,i]=m.useState(!1),[c,d]=m.useState(!1);return v7(()=>i(!0)),m.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(dl,{asChild:!0,children:s.jsx(ev,{...r,children:o&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},h7="ToastTitle",R$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ke.div,{...r,ref:t})});R$.displayName=h7;var m7="ToastDescription",I$=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ke.div,{...r,ref:t})});I$.displayName=m7;var M$="ToastAction",$$=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(L$,{altText:n,asChild:!0,children:s.jsx(iN,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${M$}\`. Expected non-empty \`string\`.`),null)});$$.displayName=M$;var D$="ToastClose",iN=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=d7(D$,n);return s.jsx(L$,{asChild:!0,children:s.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,a.onClose)})})});iN.displayName=D$;var L$=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(Ke.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function F$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),g7(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!a)if(o){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...F$(r))}}),t}function th(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?aN(a,o):a.dispatchEvent(o)}var UE=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),o=r>a;return t==="left"||t==="right"?o&&r>n:!o&&a>n};function v7(e=()=>{}){const t=qn(e);tr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function g7(e){return e.nodeType===e.ELEMENT_NODE}function x7(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 xy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var y7=E$,B$=k$,z$=O$,U$=R$,q$=I$,W$=$$,V$=iN;function H$(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=H$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ot(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=H$(e))&&(r&&(r+=" "),r+=t);return r}const qE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,WE=Ot,fl=(e,t)=>n=>{var r;if(t?.variants==null)return WE(e,n?.class,n?.className);const{variants:a,defaultVariants:o}=t,i=Object.keys(a).map(f=>{const h=n?.[f],p=o?.[f];if(h===null)return null;const g=qE(h)||qE(p);return a[f][g]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,g]=h;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:g,...x}=h;return Object.entries(x).every(j=>{let[b,y]=j;return Array.isArray(y)?y.includes({...o,...c}[b]):{...o,...c}[b]===y})?[...f,p,g]:f},[]);return WE(e,i,d,n?.class,n?.className)};const b7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),K$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var w7={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 j7=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...c},d)=>m.createElement("svg",{ref:d,...w7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:K$("lucide",a),...c},[...i.map(([f,h])=>m.createElement(f,h)),...Array.isArray(o)?o:[o]]));const at=(e,t)=>{const n=m.forwardRef(({className:r,...a},o)=>m.createElement(j7,{ref:o,iconNode:t,className:K$(`lucide-${b7(e)}`,r),...a}));return n.displayName=`${e}`,n};const G$=at("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 Y$=at("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 Vi=at("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Pr=at("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 kd=at("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 wc=at("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Kt=at("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const lN=at("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const bs=at("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const fc=at("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const yy=at("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 Ho=at("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const S7=at("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 pc=at("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 N7=at("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const C7=at("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);const uo=at("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Cs=at("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 X$=at("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 Ea=at("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 nv=at("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 Ih=at("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 _7=at("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 J$=at("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 VE=at("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 Q$=at("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 A7=at("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const cN=at("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 E7=at("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 P7=at("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);const k7=at("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const Jj=at("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 Z$=at("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 T7=at("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 Qj=at("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const wr=at("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const eD=at("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 O7=at("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 tD=at("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 oc=at("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 R7=at("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const Zj=at("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 eS=at("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 rv=at("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 Zs=at("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const ao=at("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const uN=at("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 ha=at("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 I7=at("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 dN=at("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const M7=at("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 fN=at("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 $7=at("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const zr=at("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 Ah=at("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const nD=at("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 Oa=at("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 Eh=at("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 D7=at("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 jc=at("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 rD=at("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 Ja=at("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 _s=at("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pN="-",L7=e=>{const t=B7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const c=i.split(pN);return c[0]===""&&c.length!==1&&c.shift(),aD(c,t)||F7(i)},getConflictingClassGroupIds:(i,c)=>{const d=n[i]||[];return c&&r[i]?[...d,...r[i]]:d}}},aD=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?aD(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const o=e.join(pN);return t.validators.find(({validator:i})=>i(o))?.classGroupId},HE=/^\[(.+)\]$/,F7=e=>{if(HE.test(e)){const t=HE.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},B7=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return U7(Object.entries(e.classGroups),n).forEach(([o,i])=>{tS(i,r,o,t)}),r},tS=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const o=a===""?t:KE(t,a);o.classGroupId=n;return}if(typeof a=="function"){if(z7(a)){tS(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([o,i])=>{tS(i,KE(t,o),n,r)})})},KE=(e,t)=>{let n=e;return t.split(pN).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},z7=e=>e.isThemeGetter,U7=(e,t)=>t?e.map(([n,r])=>{const a=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,c])=>[t+i,c])):o);return[n,a]}):e,q7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return a(o,i),i},set(o,i){n.has(o)?n.set(o,i):a(o,i)}}},sD="!",W7=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],o=t.length,i=c=>{const d=[];let f=0,h=0,p;for(let y=0;y<c.length;y++){let S=c[y];if(f===0){if(S===a&&(r||c.slice(y,y+o)===t)){d.push(c.slice(h,y)),h=y+o;continue}if(S==="/"){p=y;continue}}S==="["?f++:S==="]"&&f--}const g=d.length===0?c:c.substring(h),x=g.startsWith(sD),j=x?g.substring(1):g,b=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:i}):i},V7=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},H7=e=>({cache:q7(e.cacheSize),parseClassName:W7(e),...L7(e)}),K7=/\s+/,G7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,o=[],i=e.trim().split(K7);let c="";for(let d=i.length-1;d>=0;d-=1){const f=i[d],{modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:x}=n(f);let j=!!x,b=r(j?g.substring(0,x):g);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(g),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const y=V7(h).join(":"),S=p?y+sD:y,C=S+b;if(o.includes(C))continue;o.push(C);const N=a(b,j);for(let E=0;E<N.length;++E){const A=N[E];o.push(S+A)}c=f+(c.length>0?" "+c:c)}return c};function Y7(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=oD(t))&&(r&&(r+=" "),r+=n);return r}const oD=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=oD(e[r]))&&(n&&(n+=" "),n+=t);return n};function X7(e,...t){let n,r,a,o=i;function i(d){const f=t.reduce((h,p)=>p(h),e());return n=H7(f),r=n.cache.get,a=n.cache.set,o=c,c(d)}function c(d){const f=r(d);if(f)return f;const h=G7(d,n);return a(d,h),h}return function(){return o(Y7.apply(null,arguments))}}const En=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},iD=/^\[(?:([a-z-]+):)?(.+)\]$/i,J7=/^\d+\/\d+$/,Q7=new Set(["px","full","screen"]),Z7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,e9=/\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$/,t9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,n9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,r9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hs=e=>hc(e)||Q7.has(e)||J7.test(e),Bo=e=>nu(e,"length",d9),hc=e=>!!e&&!Number.isNaN(Number(e)),by=e=>nu(e,"number",hc),ad=e=>!!e&&Number.isInteger(Number(e)),a9=e=>e.endsWith("%")&&hc(e.slice(0,-1)),Mt=e=>iD.test(e),zo=e=>Z7.test(e),s9=new Set(["length","size","percentage"]),o9=e=>nu(e,s9,lD),i9=e=>nu(e,"position",lD),l9=new Set(["image","url"]),c9=e=>nu(e,l9,p9),u9=e=>nu(e,"",f9),sd=()=>!0,nu=(e,t,n)=>{const r=iD.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},d9=e=>e9.test(e)&&!t9.test(e),lD=()=>!1,f9=e=>n9.test(e),p9=e=>r9.test(e),h9=()=>{const e=En("colors"),t=En("spacing"),n=En("blur"),r=En("brightness"),a=En("borderColor"),o=En("borderRadius"),i=En("borderSpacing"),c=En("borderWidth"),d=En("contrast"),f=En("grayscale"),h=En("hueRotate"),p=En("invert"),g=En("gap"),x=En("gradientColorStops"),j=En("gradientColorStopPositions"),b=En("inset"),y=En("margin"),S=En("opacity"),C=En("padding"),N=En("saturate"),E=En("scale"),A=En("sepia"),k=En("skew"),T=En("space"),O=En("translate"),L=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Mt,t],F=()=>[Mt,t],G=()=>["",Hs,Bo],W=()=>["auto",hc,Mt],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],D=()=>["","0",Mt],J=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[hc,Mt];return{cacheSize:500,separator:":",theme:{colors:[sd],spacing:[Hs,Bo],blur:["none","",zo,Mt],brightness:H(),borderColor:[e],borderRadius:["none","","full",zo,Mt],borderSpacing:F(),borderWidth:G(),contrast:H(),grayscale:D(),hueRotate:H(),invert:D(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[a9,Bo],inset:q(),margin:q(),opacity:H(),padding:F(),saturate:H(),scale:H(),sepia:D(),skew:H(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Mt]}],container:["container"],columns:[{columns:[zo]}],"break-after":[{"break-after":J()}],"break-before":[{"break-before":J()}],"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:[...R(),Mt]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],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",ad,Mt]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Mt]}],grow:[{grow:D()}],shrink:[{shrink:D()}],order:[{order:["first","last","none",ad,Mt]}],"grid-cols":[{"grid-cols":[sd]}],"col-start-end":[{col:["auto",{span:["full",ad,Mt]},Mt]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[sd]}],"row-start-end":[{row:["auto",{span:[ad,Mt]},Mt]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Mt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Mt]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Mt,t]}],"min-w":[{"min-w":[Mt,t,"min","max","fit"]}],"max-w":[{"max-w":[Mt,t,"none","full","min","max","fit","prose",{screen:[zo]},zo]}],h:[{h:[Mt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Mt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Mt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Mt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",zo,Bo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",by]}],"font-family":[{font:[sd]}],"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",Mt]}],"line-clamp":[{"line-clamp":["none",hc,by]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Hs,Mt]}],"list-image":[{"list-image":["none",Mt]}],"list-style-type":[{list:["none","disc","decimal",Mt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Hs,Bo]}],"underline-offset":[{"underline-offset":["auto",Hs,Mt]}],"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:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Mt]}],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",Mt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),i9]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",o9]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},c9]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:M()}],"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:["",...M()]}],"outline-offset":[{"outline-offset":[Hs,Mt]}],"outline-w":[{outline:[Hs,Bo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Hs,Bo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",zo,u9]}],"shadow-color":[{shadow:[sd]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",zo,Mt]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],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":[S]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Mt]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Mt]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Mt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[ad,Mt]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Mt]}],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",Mt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Mt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Hs,Bo,by]}],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"]}}},m9=X7(h9);function Se(...e){return m9(Ot(e))}const v9=y7,cD=m.forwardRef(({className:e,...t},n)=>s.jsx(B$,{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}));cD.displayName=B$.displayName;const g9=fl("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"}}),uD=m.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(z$,{ref:r,className:Se(g9({variant:t}),e),...n}));uD.displayName=z$.displayName;const x9=m.forwardRef(({className:e,...t},n)=>s.jsx(W$,{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}));x9.displayName=W$.displayName;const dD=m.forwardRef(({className:e,...t},n)=>s.jsx(V$,{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(_s,{className:"h-4 w-4"})}));dD.displayName=V$.displayName;const fD=m.forwardRef(({className:e,...t},n)=>s.jsx(U$,{ref:n,className:Se("text-sm font-semibold",e),...t}));fD.displayName=U$.displayName;const pD=m.forwardRef(({className:e,...t},n)=>s.jsx(q$,{ref:n,className:Se("text-sm opacity-90",e),...t}));pD.displayName=q$.displayName;function y9(){const{toasts:e}=Sq();return s.jsxs(v9,{children:[e.map(function({id:t,title:n,description:r,action:a,...o}){return s.jsxs(uD,{...o,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(fD,{children:n}),r&&s.jsx(pD,{children:r})]}),a,s.jsx(dD,{})]},t)}),s.jsx(cD,{})]})}var GE=["light","dark"],b9="(prefers-color-scheme: dark)",w9=m.createContext(void 0),j9={setTheme:e=>{},themes:[]},S9=()=>{var e;return(e=m.useContext(w9))!=null?e:j9};m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:o,value:i,attrs:c,nonce:d})=>{let f=o==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(j=>`'${j}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=a?GE.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",g=(j,b=!1,y=!0)=>{let S=i?i[j]:j,C=b?j+"|| ''":`'${S}'`,N="";return a&&y&&!b&&GE.includes(j)&&(N+=`d.style.colorScheme = '${j}';`),n==="class"?b||S?N+=`c.add(${C})`:N+="null":S&&(N+=`d[s](n,${C})`),N},x=e?`!function(){${h}${g(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${b9}',m=window.matchMedia(t);if(m.media!==t||m.matches){${g("dark")}}else{${g("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${g(i?"x[e]":"e",!0)}}${f?"":"else{"+g(o,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${g(i?"x[e]":"e",!0)}}else{${g(o,!1,!1)};}${p}}catch(t){}}();`;return m.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:x}})});var N9=e=>{switch(e){case"success":return A9;case"info":return P9;case"warning":return E9;case"error":return k9;default:return null}},C9=Array(12).fill(0),_9=({visible:e,className:t})=>Y.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Y.createElement("div",{className:"sonner-spinner"},C9.map((n,r)=>Y.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),A9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),E9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Y.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"})),P9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),k9=Y.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Y.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"})),T9=Y.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"},Y.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Y.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),O9=()=>{let[e,t]=Y.useState(document.hidden);return Y.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},nS=1,R9=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:nS++,o=this.toasts.find(c=>c.id===a),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:i,title:n}):c):this.addToast({title:n,...r,dismissible:i,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,o,i=r.then(async d=>{if(o=["resolve",d],Y.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(M9(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(o=["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)=>i.then(()=>o[0]==="reject"?f(o[1]):d(o[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||nS++;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}},Fr=new R9,I9=(e,t)=>{let n=t?.id||nS++;return Fr.addToast({title:e,...t,id:n}),n},M9=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",$9=I9,D9=()=>Fr.toasts,L9=()=>Fr.getActiveToasts();Object.assign($9,{success:Fr.success,info:Fr.info,warning:Fr.warning,error:Fr.error,custom:Fr.custom,message:Fr.message,promise:Fr.promise,dismiss:Fr.dismiss,loading:Fr.loading},{getHistory:D9,getToasts:L9});function F9(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))}F9(`: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 nh(e){return e.label!==void 0}var B9=3,z9="32px",U9="16px",YE=4e3,q9=356,W9=14,V9=20,H9=200;function qa(...e){return e.filter(Boolean).join(" ")}function K9(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var G9=e=>{var t,n,r,a,o,i,c,d,f,h,p;let{invert:g,toast:x,unstyled:j,interacting:b,setHeights:y,visibleToasts:S,heights:C,index:N,toasts:E,expanded:A,removeToast:k,defaultRichColors:T,closeButton:O,style:L,cancelButtonStyle:z,actionButtonStyle:q,className:F="",descriptionClassName:G="",duration:W,position:R,gap:M,loadingIcon:K,expandByDefault:V,classNames:D,icons:J,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:I}=e,[te,de]=Y.useState(null),[fe,me]=Y.useState(null),[U,oe]=Y.useState(!1),[re,ne]=Y.useState(!1),[ve,le]=Y.useState(!1),[Ae,be]=Y.useState(!1),[We,B]=Y.useState(!1),[ie,he]=Y.useState(0),[Te,Ye]=Y.useState(0),ut=Y.useRef(x.duration||W||YE),dt=Y.useRef(null),ht=Y.useRef(null),jt=N===0,It=N+1<=S,Dt=x.type,qt=x.dismissible!==!1,ee=x.className||"",Ee=x.descriptionClassName||"",Ne=Y.useMemo(()=>C.findIndex(ft=>ft.toastId===x.id)||0,[C,x.id]),Ge=Y.useMemo(()=>{var ft;return(ft=x.closeButton)!=null?ft:O},[x.closeButton,O]),_e=Y.useMemo(()=>x.duration||W||YE,[x.duration,W]),Le=Y.useRef(0),Lt=Y.useRef(0),cn=Y.useRef(0),Sn=Y.useRef(null),[Or,we]=R.split("-"),_t=Y.useMemo(()=>C.reduce((ft,Pt,Rt)=>Rt>=Ne?ft:ft+Pt.height,0),[C,Ne]),$t=O9(),Wt=x.invert||g,tn=Dt==="loading";Lt.current=Y.useMemo(()=>Ne*M+_t,[Ne,_t]),Y.useEffect(()=>{ut.current=_e},[_e]),Y.useEffect(()=>{oe(!0)},[]),Y.useEffect(()=>{let ft=ht.current;if(ft){let Pt=ft.getBoundingClientRect().height;return Ye(Pt),y(Rt=>[{toastId:x.id,height:Pt,position:x.position},...Rt]),()=>y(Rt=>Rt.filter(nn=>nn.toastId!==x.id))}},[y,x.id]),Y.useLayoutEffect(()=>{if(!U)return;let ft=ht.current,Pt=ft.style.height;ft.style.height="auto";let Rt=ft.getBoundingClientRect().height;ft.style.height=Pt,Ye(Rt),y(nn=>nn.find(Fn=>Fn.toastId===x.id)?nn.map(Fn=>Fn.toastId===x.id?{...Fn,height:Rt}:Fn):[{toastId:x.id,height:Rt,position:x.position},...nn])},[U,x.title,x.description,y,x.id]);let Gt=Y.useCallback(()=>{ne(!0),he(Lt.current),y(ft=>ft.filter(Pt=>Pt.toastId!==x.id)),setTimeout(()=>{k(x)},H9)},[x,k,y,Lt]);Y.useEffect(()=>{if(x.promise&&Dt==="loading"||x.duration===1/0||x.type==="loading")return;let ft;return A||b||I&&$t?(()=>{if(cn.current<Le.current){let Pt=new Date().getTime()-Le.current;ut.current=ut.current-Pt}cn.current=new Date().getTime()})():ut.current!==1/0&&(Le.current=new Date().getTime(),ft=setTimeout(()=>{var Pt;(Pt=x.onAutoClose)==null||Pt.call(x,x),Gt()},ut.current)),()=>clearTimeout(ft)},[A,b,x,Dt,I,$t,Gt]),Y.useEffect(()=>{x.delete&&Gt()},[Gt,x.delete]);function hr(){var ft,Pt,Rt;return J!=null&&J.loading?Y.createElement("div",{className:qa(D?.loader,(ft=x?.classNames)==null?void 0:ft.loader,"sonner-loader"),"data-visible":Dt==="loading"},J.loading):K?Y.createElement("div",{className:qa(D?.loader,(Pt=x?.classNames)==null?void 0:Pt.loader,"sonner-loader"),"data-visible":Dt==="loading"},K):Y.createElement(_9,{className:qa(D?.loader,(Rt=x?.classNames)==null?void 0:Rt.loader),visible:Dt==="loading"})}return Y.createElement("li",{tabIndex:0,ref:ht,className:qa(F,ee,D?.toast,(t=x?.classNames)==null?void 0:t.toast,D?.default,D?.[Dt],(n=x?.classNames)==null?void 0:n[Dt]),"data-sonner-toast":"","data-rich-colors":(r=x.richColors)!=null?r:T,"data-styled":!(x.jsx||x.unstyled||j),"data-mounted":U,"data-promise":!!x.promise,"data-swiped":We,"data-removed":re,"data-visible":It,"data-y-position":Or,"data-x-position":we,"data-index":N,"data-front":jt,"data-swiping":ve,"data-dismissible":qt,"data-type":Dt,"data-invert":Wt,"data-swipe-out":Ae,"data-swipe-direction":fe,"data-expanded":!!(A||V&&U),style:{"--index":N,"--toasts-before":N,"--z-index":E.length-N,"--offset":`${re?ie:Lt.current}px`,"--initial-height":V?"auto":`${Te}px`,...L,...x.style},onDragEnd:()=>{le(!1),de(null),Sn.current=null},onPointerDown:ft=>{tn||!qt||(dt.current=new Date,he(Lt.current),ft.target.setPointerCapture(ft.pointerId),ft.target.tagName!=="BUTTON"&&(le(!0),Sn.current={x:ft.clientX,y:ft.clientY}))},onPointerUp:()=>{var ft,Pt,Rt,nn;if(Ae||!qt)return;Sn.current=null;let Fn=Number(((ft=ht.current)==null?void 0:ft.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ue=Number(((Pt=ht.current)==null?void 0:Pt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nt=new Date().getTime()-((Rt=dt.current)==null?void 0:Rt.getTime()),bt=te==="x"?Fn:ue,Jt=Math.abs(bt)/nt;if(Math.abs(bt)>=V9||Jt>.11){he(Lt.current),(nn=x.onDismiss)==null||nn.call(x,x),me(te==="x"?Fn>0?"right":"left":ue>0?"down":"up"),Gt(),be(!0),B(!1);return}le(!1),de(null)},onPointerMove:ft=>{var Pt,Rt,nn,Fn;if(!Sn.current||!qt||((Pt=window.getSelection())==null?void 0:Pt.toString().length)>0)return;let ue=ft.clientY-Sn.current.y,nt=ft.clientX-Sn.current.x,bt=(Rt=e.swipeDirections)!=null?Rt:K9(R);!te&&(Math.abs(nt)>1||Math.abs(ue)>1)&&de(Math.abs(nt)>Math.abs(ue)?"x":"y");let Jt={x:0,y:0};te==="y"?(bt.includes("top")||bt.includes("bottom"))&&(bt.includes("top")&&ue<0||bt.includes("bottom")&&ue>0)&&(Jt.y=ue):te==="x"&&(bt.includes("left")||bt.includes("right"))&&(bt.includes("left")&&nt<0||bt.includes("right")&&nt>0)&&(Jt.x=nt),(Math.abs(Jt.x)>0||Math.abs(Jt.y)>0)&&B(!0),(nn=ht.current)==null||nn.style.setProperty("--swipe-amount-x",`${Jt.x}px`),(Fn=ht.current)==null||Fn.style.setProperty("--swipe-amount-y",`${Jt.y}px`)}},Ge&&!x.jsx?Y.createElement("button",{"aria-label":H,"data-disabled":tn,"data-close-button":!0,onClick:tn||!qt?()=>{}:()=>{var ft;Gt(),(ft=x.onDismiss)==null||ft.call(x,x)},className:qa(D?.closeButton,(a=x?.classNames)==null?void 0:a.closeButton)},(o=J?.close)!=null?o:T9):null,x.jsx||m.isValidElement(x.title)?x.jsx?x.jsx:typeof x.title=="function"?x.title():x.title:Y.createElement(Y.Fragment,null,Dt||x.icon||x.promise?Y.createElement("div",{"data-icon":"",className:qa(D?.icon,(i=x?.classNames)==null?void 0:i.icon)},x.promise||x.type==="loading"&&!x.icon?x.icon||hr():null,x.type!=="loading"?x.icon||J?.[Dt]||N9(Dt):null):null,Y.createElement("div",{"data-content":"",className:qa(D?.content,(c=x?.classNames)==null?void 0:c.content)},Y.createElement("div",{"data-title":"",className:qa(D?.title,(d=x?.classNames)==null?void 0:d.title)},typeof x.title=="function"?x.title():x.title),x.description?Y.createElement("div",{"data-description":"",className:qa(G,Ee,D?.description,(f=x?.classNames)==null?void 0:f.description)},typeof x.description=="function"?x.description():x.description):null),m.isValidElement(x.cancel)?x.cancel:x.cancel&&nh(x.cancel)?Y.createElement("button",{"data-button":!0,"data-cancel":!0,style:x.cancelButtonStyle||z,onClick:ft=>{var Pt,Rt;nh(x.cancel)&&qt&&((Rt=(Pt=x.cancel).onClick)==null||Rt.call(Pt,ft),Gt())},className:qa(D?.cancelButton,(h=x?.classNames)==null?void 0:h.cancelButton)},x.cancel.label):null,m.isValidElement(x.action)?x.action:x.action&&nh(x.action)?Y.createElement("button",{"data-button":!0,"data-action":!0,style:x.actionButtonStyle||q,onClick:ft=>{var Pt,Rt;nh(x.action)&&((Rt=(Pt=x.action).onClick)==null||Rt.call(Pt,ft),!ft.defaultPrevented&&Gt())},className:qa(D?.actionButton,(p=x?.classNames)==null?void 0:p.actionButton)},x.action.label):null))};function XE(){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 Y9(e,t){let n={};return[e,t].forEach((r,a)=>{let o=a===1,i=o?"--mobile-offset":"--offset",c=o?U9:z9;function d(f){["top","right","bottom","left"].forEach(h=>{n[`${i}-${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[`${i}-${f}`]=c:n[`${i}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}var X9=m.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:i,className:c,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:g,style:x,visibleToasts:j=B9,toastOptions:b,dir:y=XE(),gap:S=W9,loadingIcon:C,icons:N,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:A}=e,[k,T]=Y.useState([]),O=Y.useMemo(()=>Array.from(new Set([r].concat(k.filter(I=>I.position).map(I=>I.position)))),[k,r]),[L,z]=Y.useState([]),[q,F]=Y.useState(!1),[G,W]=Y.useState(!1),[R,M]=Y.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=Y.useRef(null),V=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),D=Y.useRef(null),J=Y.useRef(!1),H=Y.useCallback(I=>{T(te=>{var de;return(de=te.find(fe=>fe.id===I.id))!=null&&de.delete||Fr.dismiss(I.id),te.filter(({id:fe})=>fe!==I.id)})},[]);return Y.useEffect(()=>Fr.subscribe(I=>{if(I.dismiss){T(te=>te.map(de=>de.id===I.id?{...de,delete:!0}:de));return}setTimeout(()=>{j$.flushSync(()=>{T(te=>{let de=te.findIndex(fe=>fe.id===I.id);return de!==-1?[...te.slice(0,de),{...te[de],...I},...te.slice(de+1)]:[I,...te]})})})}),[]),Y.useEffect(()=>{if(h!=="system"){M(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window>"u")return;let I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:te})=>{M(te?"dark":"light")})}catch{I.addListener(({matches:de})=>{try{M(de?"dark":"light")}catch(fe){console.error(fe)}})}},[h]),Y.useEffect(()=>{k.length<=1&&F(!1)},[k]),Y.useEffect(()=>{let I=te=>{var de,fe;a.every(me=>te[me]||te.code===me)&&(F(!0),(de=K.current)==null||de.focus()),te.code==="Escape"&&(document.activeElement===K.current||(fe=K.current)!=null&&fe.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[a]),Y.useEffect(()=>{if(K.current)return()=>{D.current&&(D.current.focus({preventScroll:!0}),D.current=null,J.current=!1)}},[K.current]),Y.createElement("section",{ref:t,"aria-label":`${E} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((I,te)=>{var de;let[fe,me]=I.split("-");return k.length?Y.createElement("ol",{key:I,dir:y==="auto"?XE():y,tabIndex:-1,ref:K,className:c,"data-sonner-toaster":!0,"data-theme":R,"data-y-position":fe,"data-lifted":q&&k.length>1&&!o,"data-x-position":me,style:{"--front-toast-height":`${((de=L[0])==null?void 0:de.height)||0}px`,"--width":`${q9}px`,"--gap":`${S}px`,...x,...Y9(d,f)},onBlur:U=>{J.current&&!U.currentTarget.contains(U.relatedTarget)&&(J.current=!1,D.current&&(D.current.focus({preventScroll:!0}),D.current=null))},onFocus:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||J.current||(J.current=!0,D.current=U.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{G||F(!1)},onDragEnd:()=>F(!1),onPointerDown:U=>{U.target instanceof HTMLElement&&U.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},k.filter(U=>!U.position&&te===0||U.position===I).map((U,oe)=>{var re,ne;return Y.createElement(G9,{key:U.id,icons:N,index:oe,toast:U,defaultRichColors:p,duration:(re=b?.duration)!=null?re:g,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(ne=b?.closeButton)!=null?ne:i,interacting:G,position:I,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:H,toasts:k.filter(ve=>ve.position==U.position),heights:L.filter(ve=>ve.position==U.position),setHeights:z,expandByDefault:o,gap:S,loadingIcon:C,expanded:q,pauseWhenPageIsHidden:A,swipeDirections:e.swipeDirections})})):null}))});const J9=({...e})=>{const{theme:t="system"}=S9();return s.jsx(X9,{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 Q9=Zm[" useId ".trim().toString()]||(()=>{}),Z9=0;function er(e){const[t,n]=m.useState(Q9());return tr(()=>{n(r=>r??String(Z9++))},[e]),e||(t?`radix-${t}`:"")}const eW=["top","right","bottom","left"],Xo=Math.min,oa=Math.max,Mh=Math.round,rh=Math.floor,ws=e=>({x:e,y:e}),tW={left:"right",right:"left",bottom:"top",top:"bottom"},nW={start:"end",end:"start"};function rS(e,t,n){return oa(e,Xo(t,n))}function so(e,t){return typeof e=="function"?e(t):e}function oo(e){return e.split("-")[0]}function ru(e){return e.split("-")[1]}function hN(e){return e==="x"?"y":"x"}function mN(e){return e==="y"?"height":"width"}const rW=new Set(["top","bottom"]);function xs(e){return rW.has(oo(e))?"y":"x"}function vN(e){return hN(xs(e))}function aW(e,t,n){n===void 0&&(n=!1);const r=ru(e),a=vN(e),o=mN(a);let i=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=$h(i)),[i,$h(i)]}function sW(e){const t=$h(e);return[aS(e),t,aS(t)]}function aS(e){return e.replace(/start|end/g,t=>nW[t])}const JE=["left","right"],QE=["right","left"],oW=["top","bottom"],iW=["bottom","top"];function lW(e,t,n){switch(e){case"top":case"bottom":return n?t?QE:JE:t?JE:QE;case"left":case"right":return t?oW:iW;default:return[]}}function cW(e,t,n,r){const a=ru(e);let o=lW(oo(e),n==="start",r);return a&&(o=o.map(i=>i+"-"+a),t&&(o=o.concat(o.map(aS)))),o}function $h(e){return e.replace(/left|right|bottom|top/g,t=>tW[t])}function uW(e){return{top:0,right:0,bottom:0,left:0,...e}}function hD(e){return typeof e!="number"?uW(e):{top:e,right:e,bottom:e,left:e}}function Dh(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function ZE(e,t,n){let{reference:r,floating:a}=e;const o=xs(t),i=vN(t),c=mN(i),d=oo(t),f=o==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,g=r[c]/2-a[c]/2;let x;switch(d){case"top":x={x:h,y:r.y-a.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-a.width,y:p};break;default:x={x:r.x,y:r.y}}switch(ru(t)){case"start":x[i]-=g*(n&&f?-1:1);break;case"end":x[i]+=g*(n&&f?-1:1);break}return x}async function dW(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:i,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:x=0}=so(t,e),j=hD(x),y=c[g?p==="floating"?"reference":"floating":p],S=Dh(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),C=p==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,N=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),E=await(o.isElement==null?void 0:o.isElement(N))?await(o.getScale==null?void 0:o.getScale(N))||{x:1,y:1}:{x:1,y:1},A=Dh(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:N,strategy:d}):C);return{top:(S.top-A.top+j.top)/E.y,bottom:(A.bottom-S.bottom+j.bottom)/E.y,left:(S.left-A.left+j.left)/E.x,right:(A.right-S.right+j.right)/E.x}}const fW=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,c=o.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=ZE(f,r,d),g=r,x={},j=0;for(let y=0;y<c.length;y++){var b;const{name:S,fn:C}=c[y],{x:N,y:E,data:A,reset:k}=await C({x:h,y:p,initialPlacement:r,placement:g,strategy:a,middlewareData:x,rects:f,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:dW},elements:{reference:e,floating:t}});h=N??h,p=E??p,x={...x,[S]:{...x[S],...A}},k&&j<=50&&(j++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(f=k.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:h,y:p}=ZE(f,g,d)),y=-1)}return{x:h,y:p,placement:g,strategy:a,middlewareData:x}},pW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:i,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=so(e,t)||{};if(f==null)return{};const p=hD(h),g={x:n,y:r},x=vN(a),j=mN(x),b=await i.getDimensions(f),y=x==="y",S=y?"top":"left",C=y?"bottom":"right",N=y?"clientHeight":"clientWidth",E=o.reference[j]+o.reference[x]-g[x]-o.floating[j],A=g[x]-o.reference[x],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let T=k?k[N]:0;(!T||!await(i.isElement==null?void 0:i.isElement(k)))&&(T=c.floating[N]||o.floating[j]);const O=E/2-A/2,L=T/2-b[j]/2-1,z=Xo(p[S],L),q=Xo(p[C],L),F=z,G=T-b[j]-q,W=T/2-b[j]/2+O,R=rS(F,W,G),M=!d.arrow&&ru(a)!=null&&W!==R&&o.reference[j]/2-(W<F?z:q)-b[j]/2<0,K=M?W<F?W-F:W-G:0;return{[x]:g[x]+K,data:{[x]:R,centerOffset:W-R-K,...M&&{alignmentOffset:K}},reset:M}}}),hW=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...y}=so(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=oo(a),C=xs(c),N=oo(c)===c,E=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=g||(N||!b?[$h(c)]:sW(c)),k=j!=="none";!g&&k&&A.push(...cW(c,b,j,E));const T=[c,...A],O=await d.detectOverflow(t,y),L=[];let z=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&L.push(O[S]),p){const W=aW(a,i,E);L.push(O[W[0]],O[W[1]])}if(z=[...z,{placement:a,overflows:L}],!L.every(W=>W<=0)){var q,F;const W=(((q=o.flip)==null?void 0:q.index)||0)+1,R=T[W];if(R&&(!(p==="alignment"?C!==xs(R):!1)||z.every(V=>xs(V.placement)===C?V.overflows[0]>0:!0)))return{data:{index:W,overflows:z},reset:{placement:R}};let M=(F=z.filter(K=>K.overflows[0]<=0).sort((K,V)=>K.overflows[1]-V.overflows[1])[0])==null?void 0:F.placement;if(!M)switch(x){case"bestFit":{var G;const K=(G=z.filter(V=>{if(k){const D=xs(V.placement);return D===C||D==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(D=>D>0).reduce((D,J)=>D+J,0)]).sort((V,D)=>V[1]-D[1])[0])==null?void 0:G[0];K&&(M=K);break}case"initialPlacement":M=c;break}if(a!==M)return{reset:{placement:M}}}return{}}}};function eP(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function tP(e){return eW.some(t=>e[t]>=0)}const mW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...o}=so(e,t);switch(a){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),c=eP(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:tP(c)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),c=eP(i,n.floating);return{data:{escapedOffsets:c,escaped:tP(c)}}}default:return{}}}}},mD=new Set(["left","top"]);async function vW(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=oo(n),c=ru(n),d=xs(n)==="y",f=mD.has(i)?-1:1,h=o&&d?-1:1,p=so(t,e);let{mainAxis:g,crossAxis:x,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(x=c==="end"?j*-1:j),d?{x:x*h,y:g*f}:{x:g*f,y:x*h}}const gW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:i,middlewareData:c}=t,d=await vW(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:o+d.y,data:{...d,placement:i}}}}},xW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:o}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:C,y:N}=S;return{x:C,y:N}}},...f}=so(e,t),h={x:n,y:r},p=await o.detectOverflow(t,f),g=xs(oo(a)),x=hN(g);let j=h[x],b=h[g];if(i){const S=x==="y"?"top":"left",C=x==="y"?"bottom":"right",N=j+p[S],E=j-p[C];j=rS(N,j,E)}if(c){const S=g==="y"?"top":"left",C=g==="y"?"bottom":"right",N=b+p[S],E=b-p[C];b=rS(N,b,E)}const y=d.fn({...t,[x]:j,[g]:b});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[x]:i,[g]:c}}}}}},yW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:i}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=so(e,t),h={x:n,y:r},p=xs(a),g=hN(p);let x=h[g],j=h[p];const b=so(c,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const N=g==="y"?"height":"width",E=o.reference[g]-o.floating[N]+y.mainAxis,A=o.reference[g]+o.reference[N]-y.mainAxis;x<E?x=E:x>A&&(x=A)}if(f){var S,C;const N=g==="y"?"width":"height",E=mD.has(oo(a)),A=o.reference[p]-o.floating[N]+(E&&((S=i.offset)==null?void 0:S[p])||0)+(E?0:y.crossAxis),k=o.reference[p]+o.reference[N]+(E?0:((C=i.offset)==null?void 0:C[p])||0)-(E?y.crossAxis:0);j<A?j=A:j>k&&(j=k)}return{[g]:x,[p]:j}}}},bW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:i,elements:c}=t,{apply:d=()=>{},...f}=so(e,t),h=await i.detectOverflow(t,f),p=oo(a),g=ru(a),x=xs(a)==="y",{width:j,height:b}=o.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=g===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,y=g==="end"?"top":"bottom");const C=b-h.top-h.bottom,N=j-h.left-h.right,E=Xo(b-h[y],C),A=Xo(j-h[S],N),k=!t.middlewareData.shift;let T=E,O=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),k&&!g){const z=oa(h.left,0),q=oa(h.right,0),F=oa(h.top,0),G=oa(h.bottom,0);x?O=j-2*(z!==0||q!==0?z+q:oa(h.left,h.right)):T=b-2*(F!==0||G!==0?F+G:oa(h.top,h.bottom))}await d({...t,availableWidth:O,availableHeight:T});const L=await i.getDimensions(c.floating);return j!==L.width||b!==L.height?{reset:{rects:!0}}:{}}}};function av(){return typeof window<"u"}function au(e){return vD(e)?(e.nodeName||"").toLowerCase():"#document"}function ua(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ts(e){var t;return(t=(vD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vD(e){return av()?e instanceof Node||e instanceof ua(e).Node:!1}function Za(e){return av()?e instanceof Element||e instanceof ua(e).Element:!1}function As(e){return av()?e instanceof HTMLElement||e instanceof ua(e).HTMLElement:!1}function nP(e){return!av()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ua(e).ShadowRoot}const wW=new Set(["inline","contents"]);function Cf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=es(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!wW.has(a)}const jW=new Set(["table","td","th"]);function SW(e){return jW.has(au(e))}const NW=[":popover-open",":modal"];function sv(e){return NW.some(t=>{try{return e.matches(t)}catch{return!1}})}const CW=["transform","translate","scale","rotate","perspective"],_W=["transform","translate","scale","rotate","perspective","filter"],AW=["paint","layout","strict","content"];function gN(e){const t=xN(),n=Za(e)?es(e):e;return CW.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)||_W.some(r=>(n.willChange||"").includes(r))||AW.some(r=>(n.contain||"").includes(r))}function EW(e){let t=Jo(e);for(;As(t)&&!Sc(t);){if(gN(t))return t;if(sv(t))return null;t=Jo(t)}return null}function xN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const PW=new Set(["html","body","#document"]);function Sc(e){return PW.has(au(e))}function es(e){return ua(e).getComputedStyle(e)}function ov(e){return Za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jo(e){if(au(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nP(e)&&e.host||Ts(e);return nP(t)?t.host:t}function gD(e){const t=Jo(e);return Sc(t)?e.ownerDocument?e.ownerDocument.body:e.body:As(t)&&Cf(t)?t:gD(t)}function Td(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=gD(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),i=ua(a);if(o){const c=sS(i);return t.concat(i,i.visualViewport||[],Cf(a)?a:[],c&&n?Td(c):[])}return t.concat(a,Td(a,[],n))}function sS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xD(e){const t=es(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=As(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,c=Mh(n)!==o||Mh(r)!==i;return c&&(n=o,r=i),{width:n,height:r,$:c}}function yN(e){return Za(e)?e:e.contextElement}function mc(e){const t=yN(e);if(!As(t))return ws(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=xD(t);let i=(o?Mh(n.width):n.width)/r,c=(o?Mh(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const kW=ws(0);function yD(e){const t=ua(e);return!xN()||!t.visualViewport?kW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ua(e)?!1:t}function Hi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=yN(e);let i=ws(1);t&&(r?Za(r)&&(i=mc(r)):i=mc(e));const c=TW(o,n,r)?yD(o):ws(0);let d=(a.left+c.x)/i.x,f=(a.top+c.y)/i.y,h=a.width/i.x,p=a.height/i.y;if(o){const g=ua(o),x=r&&Za(r)?ua(r):r;let j=g,b=sS(j);for(;b&&r&&x!==j;){const y=mc(b),S=b.getBoundingClientRect(),C=es(b),N=S.left+(b.clientLeft+parseFloat(C.paddingLeft))*y.x,E=S.top+(b.clientTop+parseFloat(C.paddingTop))*y.y;d*=y.x,f*=y.y,h*=y.x,p*=y.y,d+=N,f+=E,j=ua(b),b=sS(j)}}return Dh({width:h,height:p,x:d,y:f})}function iv(e,t){const n=ov(e).scrollLeft;return t?t.left+n:Hi(Ts(e)).left+n}function bD(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-iv(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function OW(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",i=Ts(r),c=t?sv(t.floating):!1;if(r===i||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ws(1);const h=ws(0),p=As(r);if((p||!p&&!o)&&((au(r)!=="body"||Cf(i))&&(d=ov(r)),As(r))){const x=Hi(r);f=mc(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const g=i&&!p&&!o?bD(i,d):ws(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-d.scrollTop*f.y+h.y+g.y}}function RW(e){return Array.from(e.getClientRects())}function IW(e){const t=Ts(e),n=ov(e),r=e.ownerDocument.body,a=oa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=oa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+iv(e);const c=-n.scrollTop;return es(r).direction==="rtl"&&(i+=oa(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:c}}const rP=25;function MW(e,t){const n=ua(e),r=Ts(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,c=0,d=0;if(a){o=a.width,i=a.height;const h=xN();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=iv(r);if(f<=0){const h=r.ownerDocument,p=h.body,g=getComputedStyle(p),x=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-x);j<=rP&&(o-=j)}else f<=rP&&(o+=f);return{width:o,height:i,x:c,y:d}}const $W=new Set(["absolute","fixed"]);function DW(e,t){const n=Hi(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=As(e)?mc(e):ws(1),i=e.clientWidth*o.x,c=e.clientHeight*o.y,d=a*o.x,f=r*o.y;return{width:i,height:c,x:d,y:f}}function aP(e,t,n){let r;if(t==="viewport")r=MW(e,n);else if(t==="document")r=IW(Ts(e));else if(Za(t))r=DW(t,n);else{const a=yD(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Dh(r)}function wD(e,t){const n=Jo(e);return n===t||!Za(n)||Sc(n)?!1:es(n).position==="fixed"||wD(n,t)}function LW(e,t){const n=t.get(e);if(n)return n;let r=Td(e,[],!1).filter(c=>Za(c)&&au(c)!=="body"),a=null;const o=es(e).position==="fixed";let i=o?Jo(e):e;for(;Za(i)&&!Sc(i);){const c=es(i),d=gN(i);!d&&c.position==="fixed"&&(a=null),(o?!d&&!a:!d&&c.position==="static"&&!!a&&$W.has(a.position)||Cf(i)&&!d&&wD(e,i))?r=r.filter(h=>h!==i):a=c,i=Jo(i)}return t.set(e,r),r}function FW(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const i=[...n==="clippingAncestors"?sv(t)?[]:LW(t,this._c):[].concat(n),r],c=i[0],d=i.reduce((f,h)=>{const p=aP(t,h,a);return f.top=oa(p.top,f.top),f.right=Xo(p.right,f.right),f.bottom=Xo(p.bottom,f.bottom),f.left=oa(p.left,f.left),f},aP(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function BW(e){const{width:t,height:n}=xD(e);return{width:t,height:n}}function zW(e,t,n){const r=As(t),a=Ts(t),o=n==="fixed",i=Hi(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=ws(0);function f(){d.x=iv(a)}if(r||!r&&!o)if((au(t)!=="body"||Cf(a))&&(c=ov(t)),r){const x=Hi(t,!0,o,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else a&&f();o&&!r&&a&&f();const h=a&&!r&&!o?bD(a,c):ws(0),p=i.left+c.scrollLeft-d.x-h.x,g=i.top+c.scrollTop-d.y-h.y;return{x:p,y:g,width:i.width,height:i.height}}function wy(e){return es(e).position==="static"}function sP(e,t){if(!As(e)||es(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ts(e)===n&&(n=n.ownerDocument.body),n}function jD(e,t){const n=ua(e);if(sv(e))return n;if(!As(e)){let a=Jo(e);for(;a&&!Sc(a);){if(Za(a)&&!wy(a))return a;a=Jo(a)}return n}let r=sP(e,t);for(;r&&SW(r)&&wy(r);)r=sP(r,t);return r&&Sc(r)&&wy(r)&&!gN(r)?n:r||EW(e)||n}const UW=async function(e){const t=this.getOffsetParent||jD,n=this.getDimensions,r=await n(e.floating);return{reference:zW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qW(e){return es(e).direction==="rtl"}const WW={convertOffsetParentRelativeRectToViewportRelativeRect:OW,getDocumentElement:Ts,getClippingRect:FW,getOffsetParent:jD,getElementRects:UW,getClientRects:RW,getDimensions:BW,getScale:mc,isElement:Za,isRTL:qW};function SD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function VW(e,t){let n=null,r;const a=Ts(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:h,top:p,width:g,height:x}=f;if(c||t(),!g||!x)return;const j=rh(p),b=rh(a.clientWidth-(h+g)),y=rh(a.clientHeight-(p+x)),S=rh(h),N={rootMargin:-j+"px "+-b+"px "+-y+"px "+-S+"px",threshold:oa(0,Xo(1,d))||1};let E=!0;function A(k){const T=k[0].intersectionRatio;if(T!==d){if(!E)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!SD(f,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(A,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(A,N)}n.observe(e)}return i(!0),o}function HW(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=yN(e),h=a||o?[...f?Td(f):[],...Td(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const p=f&&c?VW(f,n):null;let g=-1,x=null;i&&(x=new ResizeObserver(S=>{let[C]=S;C&&C.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),n()}),f&&!d&&x.observe(f),x.observe(t));let j,b=d?Hi(e):null;d&&y();function y(){const S=Hi(e);b&&!SD(b,S)&&n(),b=S,j=requestAnimationFrame(y)}return n(),()=>{var S;h.forEach(C=>{a&&C.removeEventListener("scroll",n),o&&C.removeEventListener("resize",n)}),p?.(),(S=x)==null||S.disconnect(),x=null,d&&cancelAnimationFrame(j)}}const KW=gW,GW=xW,YW=hW,XW=bW,JW=mW,oP=pW,QW=yW,ZW=(e,t,n)=>{const r=new Map,a={platform:WW,...n},o={...a.platform,_c:r};return fW(e,t,{...a,platform:o})};var eV=typeof document<"u",tV=function(){},Ph=eV?m.useLayoutEffect:tV;function Lh(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(!Lh(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 o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Lh(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ND(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function iP(e,t){const n=ND(e);return Math.round(t*n)/n}function jy(e){const t=m.useRef(e);return Ph(()=>{t.current=e}),t}function nV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:i}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[h,p]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,x]=m.useState(r);Lh(g,r)||x(r);const[j,b]=m.useState(null),[y,S]=m.useState(null),C=m.useCallback(V=>{V!==k.current&&(k.current=V,b(V))},[]),N=m.useCallback(V=>{V!==T.current&&(T.current=V,S(V))},[]),E=o||j,A=i||y,k=m.useRef(null),T=m.useRef(null),O=m.useRef(h),L=d!=null,z=jy(d),q=jy(a),F=jy(f),G=m.useCallback(()=>{if(!k.current||!T.current)return;const V={placement:t,strategy:n,middleware:g};q.current&&(V.platform=q.current),ZW(k.current,T.current,V).then(D=>{const J={...D,isPositioned:F.current!==!1};W.current&&!Lh(O.current,J)&&(O.current=J,tu.flushSync(()=>{p(J)}))})},[g,t,n,q,F]);Ph(()=>{f===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[f]);const W=m.useRef(!1);Ph(()=>(W.current=!0,()=>{W.current=!1}),[]),Ph(()=>{if(E&&(k.current=E),A&&(T.current=A),E&&A){if(z.current)return z.current(E,A,G);G()}},[E,A,G,z,L]);const R=m.useMemo(()=>({reference:k,floating:T,setReference:C,setFloating:N}),[C,N]),M=m.useMemo(()=>({reference:E,floating:A}),[E,A]),K=m.useMemo(()=>{const V={position:n,left:0,top:0};if(!M.floating)return V;const D=iP(M.floating,h.x),J=iP(M.floating,h.y);return c?{...V,transform:"translate("+D+"px, "+J+"px)",...ND(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:J}},[n,c,M.floating,h.x,h.y]);return m.useMemo(()=>({...h,update:G,refs:R,elements:M,floatingStyles:K}),[h,G,R,M,K])}const rV=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?oP({element:r.current,padding:a}).fn(n):{}:r?oP({element:r,padding:a}).fn(n):{}}}},aV=(e,t)=>({...KW(e),options:[e,t]}),sV=(e,t)=>({...GW(e),options:[e,t]}),oV=(e,t)=>({...QW(e),options:[e,t]}),iV=(e,t)=>({...YW(e),options:[e,t]}),lV=(e,t)=>({...XW(e),options:[e,t]}),cV=(e,t)=>({...JW(e),options:[e,t]}),uV=(e,t)=>({...rV(e),options:[e,t]});var dV="Arrow",CD=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return s.jsx(Ke.svg,{...o,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"})})});CD.displayName=dV;var fV=CD;function lv(e){const[t,n]=m.useState(void 0);return tr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let i,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;i=f.inlineSize,c=f.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var bN="Popper",[_D,ti]=pr(bN),[pV,AD]=_D(bN),ED=e=>{const{__scopePopper:t,children:n}=e,[r,a]=m.useState(null);return s.jsx(pV,{scope:t,anchor:r,onAnchorChange:a,children:n})};ED.displayName=bN;var PD="PopperAnchor",kD=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=AD(PD,n),i=m.useRef(null),c=xt(t,i),d=m.useRef(null);return m.useEffect(()=>{const f=d.current;d.current=r?.current||i.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:s.jsx(Ke.div,{...a,ref:c})});kD.displayName=PD;var wN="PopperContent",[hV,mV]=_D(wN),TD=m.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:x="optimized",onPlaced:j,...b}=e,y=AD(wN,n),[S,C]=m.useState(null),N=xt(t,U=>C(U)),[E,A]=m.useState(null),k=lv(E),T=k?.width??0,O=k?.height??0,L=r+(o!=="center"?"-"+o:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},q=Array.isArray(f)?f:[f],F=q.length>0,G={padding:z,boundary:q.filter(gV),altBoundary:F},{refs:W,floatingStyles:R,placement:M,isPositioned:K,middlewareData:V}=nV({strategy:"fixed",placement:L,whileElementsMounted:(...U)=>HW(...U,{animationFrame:x==="always"}),elements:{reference:y.anchor},middleware:[aV({mainAxis:a+O,alignmentAxis:i}),d&&sV({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?oV():void 0,...G}),d&&iV({...G}),lV({...G,apply:({elements:U,rects:oe,availableWidth:re,availableHeight:ne})=>{const{width:ve,height:le}=oe.reference,Ae=U.floating.style;Ae.setProperty("--radix-popper-available-width",`${re}px`),Ae.setProperty("--radix-popper-available-height",`${ne}px`),Ae.setProperty("--radix-popper-anchor-width",`${ve}px`),Ae.setProperty("--radix-popper-anchor-height",`${le}px`)}}),E&&uV({element:E,padding:c}),xV({arrowWidth:T,arrowHeight:O}),g&&cV({strategy:"referenceHidden",...G})]}),[D,J]=ID(M),H=qn(j);tr(()=>{K&&H?.()},[K,H]);const I=V.arrow?.x,te=V.arrow?.y,de=V.arrow?.centerOffset!==0,[fe,me]=m.useState();return tr(()=>{S&&me(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:K?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[V.transformOrigin?.x,V.transformOrigin?.y].join(" "),...V.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(hV,{scope:n,placedSide:D,onArrowChange:A,arrowX:I,arrowY:te,shouldHideArrow:de,children:s.jsx(Ke.div,{"data-side":D,"data-align":J,...b,ref:N,style:{...b.style,animation:K?void 0:"none"}})})})});TD.displayName=wN;var OD="PopperArrow",vV={top:"bottom",right:"left",bottom:"top",left:"right"},RD=m.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=mV(OD,r),i=vV[o.placedSide];return s.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:s.jsx(fV,{...a,ref:n,style:{...a.style,display:"block"}})})});RD.displayName=OD;function gV(e){return e!==null}var xV=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,i=a.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,d=i?0:e.arrowHeight,[f,h]=ID(n),p={start:"0%",center:"50%",end:"100%"}[h],g=(a.arrow?.x??0)+c/2,x=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=i?p:`${g}px`,b=`${-d}px`):f==="top"?(j=i?p:`${g}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=i?p:`${x}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=i?p:`${x}px`),{data:{x:j,y:b}}}});function ID(e){const[t,n="center"]=e.split("-");return[t,n]}var cv=ED,_f=kD,uv=TD,dv=RD,yV=Symbol("radix.slottable");function bV(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yV,t}var[fv]=pr("Tooltip",[ti]),pv=ti(),MD="TooltipProvider",wV=700,oS="tooltip.open",[jV,jN]=fv(MD),$D=e=>{const{__scopeTooltip:t,delayDuration:n=wV,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:o}=e,i=m.useRef(!0),c=m.useRef(!1),d=m.useRef(0);return m.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(jV,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(d.current),i.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:m.useCallback(f=>{c.current=f},[]),disableHoverableContent:a,children:o})};$D.displayName=MD;var Od="Tooltip",[SV,Af]=fv(Od),DD=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:o,disableHoverableContent:i,delayDuration:c}=e,d=jN(Od,e.__scopeTooltip),f=pv(t),[h,p]=m.useState(null),g=er(),x=m.useRef(0),j=i??d.disableHoverableContent,b=c??d.delayDuration,y=m.useRef(!1),[S,C]=pa({prop:r,defaultProp:a??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(oS))):d.onClose(),o?.(T)},caller:Od}),N=m.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),E=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y.current=!1,C(!0)},[C]),A=m.useCallback(()=>{window.clearTimeout(x.current),x.current=0,C(!1)},[C]),k=m.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{y.current=!0,C(!0),x.current=0},b)},[b,C]);return m.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),s.jsx(cv,{...f,children:s.jsx(SV,{scope:t,contentId:g,open:S,stateAttribute:N,trigger:h,onTriggerChange:p,onTriggerEnter:m.useCallback(()=>{d.isOpenDelayedRef.current?k():E()},[d.isOpenDelayedRef,k,E]),onTriggerLeave:m.useCallback(()=>{j?A():(window.clearTimeout(x.current),x.current=0)},[A,j]),onOpen:E,onClose:A,disableHoverableContent:j,children:n})})};DD.displayName=Od;var iS="TooltipTrigger",LD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Af(iS,n),o=jN(iS,n),i=pv(n),c=m.useRef(null),d=xt(t,c,a.onTriggerChange),f=m.useRef(!1),h=m.useRef(!1),p=m.useCallback(()=>f.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(_f,{asChild:!0,...i,children:s.jsx(Ke.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Re(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Re(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Re(e.onBlur,a.onClose),onClick:Re(e.onClick,a.onClose)})})});LD.displayName=iS;var SN="TooltipPortal",[NV,CV]=fv(SN,{forceMount:void 0}),FD=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:a}=e,o=Af(SN,t);return s.jsx(NV,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||o.open,children:s.jsx(dl,{asChild:!0,container:a,children:r})})})};FD.displayName=SN;var Nc="TooltipContent",BD=m.forwardRef((e,t)=>{const n=CV(Nc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...o}=e,i=Af(Nc,e.__scopeTooltip);return s.jsx(Kn,{present:r||i.open,children:i.disableHoverableContent?s.jsx(zD,{side:a,...o,ref:t}):s.jsx(_V,{side:a,...o,ref:t})})}),_V=m.forwardRef((e,t)=>{const n=Af(Nc,e.__scopeTooltip),r=jN(Nc,e.__scopeTooltip),a=m.useRef(null),o=xt(t,a),[i,c]=m.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,g=m.useCallback(()=>{c(null),p(!1)},[p]),x=m.useCallback((j,b)=>{const y=j.currentTarget,S={x:j.clientX,y:j.clientY},C=TV(S,y.getBoundingClientRect()),N=OV(S,C),E=RV(b.getBoundingClientRect()),A=MV([...N,...E]);c(A),p(!0)},[p]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(d&&h){const j=y=>x(y,h),b=y=>x(y,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,x,g]),m.useEffect(()=>{if(i){const j=b=>{const y=b.target,S={x:b.clientX,y:b.clientY},C=d?.contains(y)||h?.contains(y),N=!IV(S,i);C?g():N&&(g(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,i,f,g]),s.jsx(zD,{...e,ref:o})}),[AV,EV]=fv(Od,{isInside:!1}),PV=bV("TooltipContent"),zD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:i,...c}=e,d=Af(Nc,n),f=pv(n),{onClose:h}=d;return m.useEffect(()=>(document.addEventListener(oS,h),()=>document.removeEventListener(oS,h)),[h]),m.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(ul,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(uv,{"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(PV,{children:r}),s.jsx(AV,{scope:n,isInside:!0,children:s.jsx(t7,{id:d.contentId,role:"tooltip",children:a||r})})]})})});BD.displayName=Nc;var UD="TooltipArrow",kV=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=pv(n);return EV(UD,n).isInside?null:s.jsx(dv,{...a,...r,ref:t})});kV.displayName=UD;function TV(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,a,o)){case o:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function OV(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 RV(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 IV(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const c=t[o],d=t[i],f=c.x,h=c.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(a=!a)}return a}function MV(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),$V(t)}function $V(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 o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(a.y-i.y)>=(o.y-i.y)*(a.x-i.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 o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(a.y-i.y)>=(o.y-i.y)*(a.x-i.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 DV=$D,LV=DD,FV=LD,BV=FD,qD=BD;const su=DV,ou=LV,iu=FV,pl=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(BV,{children:s.jsx(qD,{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})}));pl.displayName=qD.displayName;var hv=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(){}},zV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},UV=class{#e=zV;#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)}},lS=new UV;function qV(e){setTimeout(e,0)}var mv=typeof window>"u"||"Deno"in globalThis;function Ha(){}function WV(e,t){return typeof e=="function"?e(t):e}function VV(e){return typeof e=="number"&&e>=0&&e!==1/0}function HV(e,t){return Math.max(e+(t||0)-Date.now(),0)}function cS(e,t){return typeof e=="function"?e(t):e}function KV(e,t){return typeof e=="function"?e(t):e}function lP(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:i,stale:c}=e;if(i){if(r){if(t.queryHash!==NN(i,t.options))return!1}else if(!Id(t.queryKey,i))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||o&&!o(t))}function cP(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Rd(t.options.mutationKey)!==Rd(o))return!1}else if(!Id(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function NN(e,t){return(t?.queryKeyHashFn||Rd)(e)}function Rd(e){return JSON.stringify(e,(t,n)=>uS(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Id(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Id(e[n],t[n])):!1}var GV=Object.prototype.hasOwnProperty;function WD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=uP(e)&&uP(t);if(!r&&!(uS(e)&&uS(t)))return t;const o=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),c=i.length,d=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:i[h],g=e[p],x=t[p];if(g===x){d[p]=g,(r?h<o:GV.call(e,p))&&f++;continue}if(g===null||x===null||typeof g!="object"||typeof x!="object"){d[p]=x;continue}const j=WD(g,x,n+1);d[p]=j,j===g&&f++}return o===c&&f===o?e:d}function uP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function uS(e){if(!dP(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!dP(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function dP(e){return Object.prototype.toString.call(e)==="[object Object]"}function YV(e){return new Promise(t=>{lS.setTimeout(t,e)})}function XV(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?WD(e,t):t}function JV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function QV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var CN=Symbol();function VD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===CN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ZV(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 eH=class extends hv{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!mv&&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"}},HD=new eH;function tH(){let e,t;const n=new Promise((a,o)=>{e=a,t=o});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 nH=qV;function rH(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=nH;const o=c=>{t?e.push(c):a(()=>{n(c)})},i=()=>{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||i()}return d},batchCalls:c=>(...d)=>{o(()=>{c(...d)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var Cr=rH(),aH=class extends hv{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!mv&&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}},Fh=new aH;function sH(e){return Math.min(1e3*2**e,3e4)}function KD(e){return(e??"online")==="online"?Fh.isOnline():!0}var dS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function GD(e){let t=!1,n=0,r;const a=tH(),o=()=>a.status!=="pending",i=b=>{if(!o()){const y=new dS(b);g(y),e.onCancel?.(y)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>HD.isFocused()&&(e.networkMode==="always"||Fh.isOnline())&&e.canRun(),h=()=>KD(e.networkMode)&&e.canRun(),p=b=>{o()||(r?.(),a.resolve(b))},g=b=>{o()||(r?.(),a.reject(b))},x=()=>new Promise(b=>{r=y=>{(o()||f())&&b(y)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),j=()=>{if(o())return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{if(o())return;const C=e.retry??(mv?0:3),N=e.retryDelay??sH,E=typeof N=="function"?N(n,S):N,A=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,S);if(t||!A){g(S);return}n++,e.onFail?.(n,S),YV(E).then(()=>f()?void 0:x()).then(()=>{t?g(S):j()})})};return{promise:a,status:()=>a.status,cancel:i,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():x().then(j),a)}}var YD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),VV(this.gcTime)&&(this.#e=lS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mv?1/0:300*1e3))}clearGcTimeout(){this.#e&&(lS.clearTimeout(this.#e),this.#e=void 0)}},oH=class extends YD{#e;#n;#t;#a;#r;#o;#i;constructor(e){super(),this.#i=!1,this.#o=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=pP(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.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=pP(this.options);t.data!==void 0&&(this.setState(fP(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=XV(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(Ha).catch(Ha):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>KV(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>cS(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:!HV(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.#i?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.#i=!0,n.signal)})},a=()=>{const c=VD(this.options,t),f=(()=>{const h={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(h),h})();return this.#i=!1,this.options.persister?this.options.persister(c,f,this):c(f)},i=(()=>{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(i,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta}),this.#r=GD({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:c=>{c instanceof dS&&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:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.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 dS){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,...iH(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...fP(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),Cr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function iH(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:KD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function fP(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pP(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 hP(e){return{onFetch:(t,n)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let h=!1;const p=j=>{ZV(j,()=>t.signal,()=>h=!0)},g=VD(t.options,t.fetchOptions),x=async(j,b,y)=>{if(h)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const C=(()=>{const k={client:t.client,queryKey:t.queryKey,pageParam:b,direction:y?"backward":"forward",meta:t.options.meta};return p(k),k})(),N=await g(C),{maxPages:E}=t.options,A=y?QV:JV;return{pages:A(j.pages,N,E),pageParams:A(j.pageParams,b,E)}};if(a&&o.length){const j=a==="backward",b=j?lH:mP,y={pages:o,pageParams:i},S=b(r,y);c=await x(y,S,j)}else{const j=e??o.length;do{const b=d===0?i[0]??r.initialPageParam:mP(r,c);if(d>0&&b==null)break;c=await x(c,b),d++}while(d<j)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function mP(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 lH(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var cH=class extends YD{#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||uH(),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=GD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,i)=>{this.#r({type:"failed",failureCount:o,error:i})},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 i=await this.options.onMutate?.(e,n);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:a})}const o=await this.#a.start();return await this.#t.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#t.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{await this.#t.config.onError?.(o,e,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onError?.(o,e,this.state.context,n)}catch(i){Promise.reject(i)}try{await this.#t.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n)}catch(i){Promise.reject(i)}try{await this.options.onSettled?.(void 0,o,e,this.state.context,n)}catch(i){Promise.reject(i)}throw this.#r({type:"error",error:o}),o}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),Cr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function uH(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dH=class extends hv{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 cH({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=ah(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=ah(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=ah(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=ah(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Cr.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=>cP(t,n))}findAll(e={}){return this.getAll().filter(t=>cP(e,t))}notify(e){Cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Cr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ha))))}};function ah(e){return e.options.scope?.id}var fH=class extends hv{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??NN(r,t);let o=this.get(a);return o||(o=new oH({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}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(){Cr.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=>lP(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>lP(e,n)):t}notify(e){Cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Cr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},pH=class{#e;#n;#t;#a;#r;#o;#i;#s;constructor(e={}){this.#e=e.queryCache||new fH,this.#n=e.mutationCache||new dH,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#i=HD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Fh.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#i?.(),this.#i=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(cS(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}),o=this.#e.get(r.queryHash)?.state.data,i=WV(t,o);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Cr.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;Cr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Cr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Cr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Ha).catch(Ha)}invalidateQueries(e,t={}){return Cr.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=Cr.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(Ha)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Ha)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(cS(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ha).catch(Ha)}fetchInfiniteQuery(e){return e.behavior=hP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ha).catch(Ha)}ensureInfiniteQueryData(e){return e.behavior=hP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Fh.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=>{Id(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=>{Id(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=NN(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===CN&&(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()}},hH=m.createContext(void 0),mH=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(hH.Provider,{value:e,children:t}));function Md(){return Md=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},Md.apply(this,arguments)}var Wo;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Wo||(Wo={}));const vP="popstate";function vH(e){e===void 0&&(e={});function t(r,a){let{pathname:o,search:i,hash:c}=r.location;return fS("",{pathname:o,search:i,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Bh(a)}return xH(t,n,null,e)}function Mn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _N(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function gH(){return Math.random().toString(36).substr(2,8)}function gP(e,t){return{usr:e.state,key:e.key,idx:t}}function fS(e,t,n,r){return n===void 0&&(n=null),Md({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?lu(t):t,{state:n,key:t&&t.key||r||gH()})}function Bh(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 lu(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 xH(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:o=!1}=r,i=a.history,c=Wo.Pop,d=null,f=h();f==null&&(f=0,i.replaceState(Md({},i.state,{idx:f}),""));function h(){return(i.state||{idx:null}).idx}function p(){c=Wo.Pop;let y=h(),S=y==null?null:y-f;f=y,d&&d({action:c,location:b.location,delta:S})}function g(y,S){c=Wo.Push;let C=fS(b.location,y,S);f=h()+1;let N=gP(C,f),E=b.createHref(C);try{i.pushState(N,"",E)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(E)}o&&d&&d({action:c,location:b.location,delta:1})}function x(y,S){c=Wo.Replace;let C=fS(b.location,y,S);f=h();let N=gP(C,f),E=b.createHref(C);i.replaceState(N,"",E),o&&d&&d({action:c,location:b.location,delta:0})}function j(y){let S=a.location.origin!=="null"?a.location.origin:a.location.href,C=typeof y=="string"?y:Bh(y);return C=C.replace(/ $/,"%20"),Mn(S,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,S)}let b={get action(){return c},get location(){return e(a,i)},listen(y){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(vP,p),d=y,()=>{a.removeEventListener(vP,p),d=null}},createHref(y){return t(a,y)},createURL:j,encodeLocation(y){let S=j(y);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:g,replace:x,go(y){return i.go(y)}};return b}var xP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xP||(xP={}));function yH(e,t,n){return n===void 0&&(n="/"),bH(e,t,n)}function bH(e,t,n,r){let a=typeof t=="string"?lu(t):t,o=Cc(a.pathname||"/",n);if(o==null)return null;let i=XD(e);wH(i);let c=null;for(let d=0;c==null&&d<i.length;++d){let f=OH(o);c=kH(i[d],f)}return c}function XD(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(o,i,c)=>{let d={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};d.relativePath.startsWith("/")&&(Mn(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=Ko([r,d.relativePath]),h=n.concat(d);o.children&&o.children.length>0&&(Mn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),XD(o.children,t,h,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:EH(f,o.index),routesMeta:h})};return e.forEach((o,i)=>{var c;if(o.path===""||!((c=o.path)!=null&&c.includes("?")))a(o,i);else for(let d of JD(o.path))a(o,i,d)}),t}function JD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let i=JD(r.join("/")),c=[];return c.push(...i.map(d=>d===""?o:[o,d].join("/"))),a&&c.push(...i),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function wH(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:PH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const jH=/^:[\w-]+$/,SH=3,NH=2,CH=1,_H=10,AH=-2,yP=e=>e==="*";function EH(e,t){let n=e.split("/"),r=n.length;return n.some(yP)&&(r+=AH),t&&(r+=NH),n.filter(a=>!yP(a)).reduce((a,o)=>a+(jH.test(o)?SH:o===""?CH:_H),r)}function PH(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 kH(e,t,n){let{routesMeta:r}=e,a={},o="/",i=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",p=fn({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),g=d.route;if(!p)return null;Object.assign(a,p.params),i.push({params:a,pathname:Ko([o,p.pathname]),pathnameBase:DH(Ko([o,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(o=Ko([o,p.pathnameBase]))}return i}function fn(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=TH(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:g,isOptional:x}=h;if(g==="*"){let b=c[p]||"";i=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return x&&!j?f[g]=void 0:f[g]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:i,pattern:e}}function TH(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),_N(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,(i,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 OH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _N(!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 Cc(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 RH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,IH=e=>RH.test(e);function MH(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?lu(e):e,o;if(n)if(IH(n))o=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),_N(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?o=bP(n.substring(1),"/"):o=bP(n,t)}else o=t;return{pathname:o,search:LH(r),hash:FH(a)}}function bP(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 Sy(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 $H(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function AN(e,t){let n=$H(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function EN(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=lu(e):(a=Md({},e),Mn(!a.pathname||!a.pathname.includes("?"),Sy("?","pathname","search",a)),Mn(!a.pathname||!a.pathname.includes("#"),Sy("#","pathname","hash",a)),Mn(!a.search||!a.search.includes("#"),Sy("#","search","hash",a)));let o=e===""||a.pathname==="",i=o?"/":a.pathname,c;if(i==null)c=n;else{let p=t.length-1;if(!r&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),p-=1;a.pathname=g.join("/")}c=p>=0?t[p]:"/"}let d=MH(a,c),f=i&&i!=="/"&&i.endsWith("/"),h=(o||i===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Ko=e=>e.join("/").replace(/\/\/+/g,"/"),DH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),LH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,FH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function BH(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const QD=["post","put","patch","delete"];new Set(QD);const zH=["get",...QD];new Set(zH);function $d(){return $d=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},$d.apply(this,arguments)}const vv=m.createContext(null),ZD=m.createContext(null),fo=m.createContext(null),gv=m.createContext(null),Os=m.createContext({outlet:null,matches:[],isDataRoute:!1}),e5=m.createContext(null);function UH(e,t){let{relative:n}=t===void 0?{}:t;cu()||Mn(!1);let{basename:r,navigator:a}=m.useContext(fo),{hash:o,pathname:i,search:c}=xv(e,{relative:n}),d=i;return r!=="/"&&(d=i==="/"?r:Ko([r,i])),a.createHref({pathname:d,search:c,hash:o})}function cu(){return m.useContext(gv)!=null}function Rs(){return cu()||Mn(!1),m.useContext(gv).location}function t5(e){m.useContext(fo).static||m.useLayoutEffect(e)}function Ia(){let{isDataRoute:e}=m.useContext(Os);return e?rK():qH()}function qH(){cu()||Mn(!1);let e=m.useContext(vv),{basename:t,future:n,navigator:r}=m.useContext(fo),{matches:a}=m.useContext(Os),{pathname:o}=Rs(),i=JSON.stringify(AN(a,n.v7_relativeSplatPath)),c=m.useRef(!1);return t5(()=>{c.current=!0}),m.useCallback(function(f,h){if(h===void 0&&(h={}),!c.current)return;if(typeof f=="number"){r.go(f);return}let p=EN(f,JSON.parse(i),o,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Ko([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,i,o,e])}const WH=m.createContext(null);function VH(e){let t=m.useContext(Os).outlet;return t&&m.createElement(WH.Provider,{value:e},t)}function hl(){let{matches:e}=m.useContext(Os),t=e[e.length-1];return t?t.params:{}}function xv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(fo),{matches:a}=m.useContext(Os),{pathname:o}=Rs(),i=JSON.stringify(AN(a,r.v7_relativeSplatPath));return m.useMemo(()=>EN(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function HH(e,t){return KH(e,t)}function KH(e,t,n,r){cu()||Mn(!1);let{navigator:a}=m.useContext(fo),{matches:o}=m.useContext(Os),i=o[o.length-1],c=i?i.params:{};i&&i.pathname;let d=i?i.pathnameBase:"/";i&&i.route;let f=Rs(),h;if(t){var p;let y=typeof t=="string"?lu(t):t;d==="/"||(p=y.pathname)!=null&&p.startsWith(d)||Mn(!1),h=y}else h=f;let g=h.pathname||"/",x=g;if(d!=="/"){let y=d.replace(/^\//,"").split("/");x="/"+g.replace(/^\//,"").split("/").slice(y.length).join("/")}let j=yH(e,{pathname:x}),b=QH(j&&j.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Ko([d,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:Ko([d,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),o,n,r);return t&&b?m.createElement(gv.Provider,{value:{location:$d({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Wo.Pop}},b):b}function GH(){let e=nK(),t=BH(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 m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:a},n):null,null)}const YH=m.createElement(GH,null);class XH extends m.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?m.createElement(Os.Provider,{value:this.props.routeContext},m.createElement(e5.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function JH(e){let{routeContext:t,match:n,children:r}=e,a=m.useContext(vv);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Os.Provider,{value:t},r)}function QH(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,c=(a=n)==null?void 0:a.errors;if(c!=null){let h=i.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);h>=0||Mn(!1),i=i.slice(0,Math.min(i.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<i.length;h++){let p=i[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:g,errors:x}=n,j=p.route.loader&&g[p.route.id]===void 0&&(!x||x[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}return i.reduceRight((h,p,g)=>{let x,j=!1,b=null,y=null;n&&(x=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||YH,d&&(f<0&&g===0?(aK("route-fallback"),j=!0,y=null):f===g&&(j=!0,y=p.route.hydrateFallbackElement||null)));let S=t.concat(i.slice(0,g+1)),C=()=>{let N;return x?N=b:j?N=y:p.route.Component?N=m.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=h,m.createElement(JH,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?m.createElement(XH,{location:n.location,revalidation:n.revalidation,component:b,error:x,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):C()},null)}var n5=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(n5||{}),r5=(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})(r5||{});function ZH(e){let t=m.useContext(vv);return t||Mn(!1),t}function eK(e){let t=m.useContext(ZD);return t||Mn(!1),t}function tK(e){let t=m.useContext(Os);return t||Mn(!1),t}function a5(e){let t=tK(),n=t.matches[t.matches.length-1];return n.route.id||Mn(!1),n.route.id}function nK(){var e;let t=m.useContext(e5),n=eK(),r=a5();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function rK(){let{router:e}=ZH(n5.UseNavigateStable),t=a5(r5.UseNavigateStable),n=m.useRef(!1);return t5(()=>{n.current=!0}),m.useCallback(function(a,o){o===void 0&&(o={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,$d({fromRouteId:t},o)))},[e,t])}const wP={};function aK(e,t,n){wP[e]||(wP[e]=!0)}function sK(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function s5(e){let{to:t,replace:n,state:r,relative:a}=e;cu()||Mn(!1);let{future:o,static:i}=m.useContext(fo),{matches:c}=m.useContext(Os),{pathname:d}=Rs(),f=Ia(),h=EN(t,AN(c,o.v7_relativeSplatPath),d,a==="path"),p=JSON.stringify(h);return m.useEffect(()=>f(JSON.parse(p),{replace:n,state:r,relative:a}),[f,p,a,n,r]),null}function jP(e){return VH(e.context)}function dn(e){Mn(!1)}function oK(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Wo.Pop,navigator:o,static:i=!1,future:c}=e;cu()&&Mn(!1);let d=t.replace(/^\/*/,"/"),f=m.useMemo(()=>({basename:d,navigator:o,static:i,future:$d({v7_relativeSplatPath:!1},c)}),[d,c,o,i]);typeof r=="string"&&(r=lu(r));let{pathname:h="/",search:p="",hash:g="",state:x=null,key:j="default"}=r,b=m.useMemo(()=>{let y=Cc(h,d);return y==null?null:{location:{pathname:y,search:p,hash:g,state:x,key:j},navigationType:a}},[d,h,p,g,x,j,a]);return b==null?null:m.createElement(fo.Provider,{value:f},m.createElement(gv.Provider,{children:n,value:b}))}function iK(e){let{children:t,location:n}=e;return HH(pS(t),n)}new Promise(()=>{});function pS(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,a)=>{if(!m.isValidElement(r))return;let o=[...t,a];if(r.type===m.Fragment){n.push.apply(n,pS(r.props.children,o));return}r.type!==dn&&Mn(!1),!r.props.index||!r.props.children||Mn(!1);let i={id:r.props.id||o.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&&(i.children=pS(r.props.children,o)),n.push(i)}),n}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 o5(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function lK(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function cK(e,t){return e.button===0&&(!t||t==="_self")&&!lK(e)}function hS(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 uK(e,t){let n=hS(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}const dK=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],fK=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],pK="6";try{window.__reactRouterVersion=pK}catch{}const hK=m.createContext({isTransitioning:!1}),mK="startTransition",SP=Zm[mK];function vK(e){let{basename:t,children:n,future:r,window:a}=e,o=m.useRef();o.current==null&&(o.current=vH({window:a,v5Compat:!0}));let i=o.current,[c,d]=m.useState({action:i.action,location:i.location}),{v7_startTransition:f}=r||{},h=m.useCallback(p=>{f&&SP?SP(()=>d(p)):d(p)},[d,f]);return m.useLayoutEffect(()=>i.listen(h),[i,h]),m.useEffect(()=>sK(r),[r]),m.createElement(oK,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:i,future:r})}const gK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ct=m.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:i,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,g=o5(t,dK),{basename:x}=m.useContext(fo),j,b=!1;if(typeof f=="string"&&xK.test(f)&&(j=f,gK))try{let N=new URL(window.location.href),E=f.startsWith("//")?new URL(N.protocol+f):new URL(f),A=Cc(E.pathname,x);E.origin===N.origin&&A!=null?f=A+E.search+E.hash:b=!0}catch{}let y=UH(f,{relative:a}),S=wK(f,{replace:i,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function C(N){r&&r(N),N.defaultPrevented||S(N)}return m.createElement("a",zh({},g,{href:j||y,onClick:b||o?r:C,ref:n,target:d}))}),yK=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:i=!1,style:c,to:d,viewTransition:f,children:h}=t,p=o5(t,fK),g=xv(d,{relative:p.relative}),x=Rs(),j=m.useContext(ZD),{navigator:b,basename:y}=m.useContext(fo),S=j!=null&&jK(g)&&f===!0,C=b.encodeLocation?b.encodeLocation(g).pathname:g.pathname,N=x.pathname,E=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;a||(N=N.toLowerCase(),E=E?E.toLowerCase():null,C=C.toLowerCase()),E&&y&&(E=Cc(E,y)||E);const A=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let k=N===C||!i&&N.startsWith(C)&&N.charAt(A)==="/",T=E!=null&&(E===C||!i&&E.startsWith(C)&&E.charAt(C.length)==="/"),O={isActive:k,isPending:T,isTransitioning:S},L=k?r:void 0,z;typeof o=="function"?z=o(O):z=[o,k?"active":null,T?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let q=typeof c=="function"?c(O):c;return m.createElement(Ct,zh({},p,{"aria-current":L,className:z,ref:n,style:q,to:d,viewTransition:f}),typeof h=="function"?h(O):h)});var mS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(mS||(mS={}));var NP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(NP||(NP={}));function bK(e){let t=m.useContext(vv);return t||Mn(!1),t}function wK(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:i,viewTransition:c}=t===void 0?{}:t,d=Ia(),f=Rs(),h=xv(e,{relative:i});return m.useCallback(p=>{if(cK(p,n)){p.preventDefault();let g=r!==void 0?r:Bh(f)===Bh(h);d(e,{replace:g,state:a,preventScrollReset:o,relative:i,viewTransition:c})}},[f,d,h,r,a,n,e,o,i,c])}function ni(e){let t=m.useRef(hS(e)),n=m.useRef(!1),r=Rs(),a=m.useMemo(()=>uK(r.search,n.current?null:t.current),[r.search]),o=Ia(),i=m.useCallback((c,d)=>{const f=hS(typeof c=="function"?c(a):c);n.current=!0,o("?"+f,d)},[o,a]);return[a,i]}function jK(e,t){t===void 0&&(t={});let n=m.useContext(hK);n==null&&Mn(!1);let{basename:r}=bK(mS.useViewTransitionState),a=xv(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Cc(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Cc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return fn(a.pathname,i)!=null||fn(a.pathname,o)!=null}var SK=Symbol.for("react.lazy"),Uh=Zm[" use ".trim().toString()];function NK(e){return typeof e=="object"&&e!==null&&"then"in e}function i5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===SK&&"_payload"in e&&NK(e._payload)}function yv(e){const t=CK(e),n=m.forwardRef((r,a)=>{let{children:o,...i}=r;i5(o)&&typeof Uh=="function"&&(o=Uh(o._payload));const c=m.Children.toArray(o),d=c.find(AK);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...i,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}var ri=yv("Slot");function CK(e){const t=m.forwardRef((n,r)=>{let{children:a,...o}=n;if(i5(a)&&typeof Uh=="function"&&(a=Uh(a._payload)),m.isValidElement(a)){const i=PK(a),c=EK(o,a.props);return a.type!==m.Fragment&&(c.ref=r?kr(r,i):i),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _K=Symbol("radix.slottable");function AK(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_K}function EK(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...c)=>{const d=o(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function PK(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 Ny=768;function kK(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Ny-1}px)`),r=()=>{t(window.innerWidth<Ny)};return n.addEventListener("change",r),t(window.innerWidth<Ny),()=>n.removeEventListener("change",r)},[]),!!e}const PN=fl("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=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},o)=>{const i=r?ri:"button";return s.jsx(i,{className:Se(PN({variant:t,size:n,className:e})),ref:o,...a})});se.displayName="Button";const pt=m.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}));pt.displayName="Input";var TK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],OK=TK.reduce((e,t)=>{const n=yv(`Primitive.${t}`),r=m.forwardRef((a,o)=>{const{asChild:i,...c}=a,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),RK="Separator",CP="horizontal",IK=["horizontal","vertical"],l5=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=CP,...a}=e,o=MK(r)?r:CP,c=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return s.jsx(OK.div,{"data-orientation":o,...c,...a,ref:t})});l5.displayName=RK;function MK(e){return IK.includes(e)}var c5=l5;const u5=m.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(c5,{ref:a,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));u5.displayName=c5.displayName;var Cy="focusScope.autoFocusOnMount",_y="focusScope.autoFocusOnUnmount",_P={bubbles:!1,cancelable:!0},$K="FocusScope",Ef=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[c,d]=m.useState(null),f=qn(a),h=qn(o),p=m.useRef(null),g=xt(t,b=>d(b)),x=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let b=function(N){if(x.paused||!c)return;const E=N.target;c.contains(E)?p.current=E:Uo(p.current,{select:!0})},y=function(N){if(x.paused||!c)return;const E=N.relatedTarget;E!==null&&(c.contains(E)||Uo(p.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const A of N)A.removedNodes.length>0&&Uo(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const C=new MutationObserver(S);return c&&C.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),C.disconnect()}}},[r,c,x.paused]),m.useEffect(()=>{if(c){EP.add(x);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(Cy,_P);c.addEventListener(Cy,f),c.dispatchEvent(S),S.defaultPrevented||(DK(UK(d5(c)),{select:!0}),document.activeElement===b&&Uo(c))}return()=>{c.removeEventListener(Cy,f),setTimeout(()=>{const S=new CustomEvent(_y,_P);c.addEventListener(_y,h),c.dispatchEvent(S),S.defaultPrevented||Uo(b??document.body,{select:!0}),c.removeEventListener(_y,h),EP.remove(x)},0)}}},[c,f,h,x]);const j=m.useCallback(b=>{if(!n&&!r||x.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(y&&S){const C=b.currentTarget,[N,E]=LK(C);N&&E?!b.shiftKey&&S===E?(b.preventDefault(),n&&Uo(N,{select:!0})):b.shiftKey&&S===N&&(b.preventDefault(),n&&Uo(E,{select:!0})):S===C&&b.preventDefault()}},[n,r,x.paused]);return s.jsx(Ke.div,{tabIndex:-1,...i,ref:g,onKeyDown:j})});Ef.displayName=$K;function DK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Uo(r,{select:t}),document.activeElement!==n)return}function LK(e){const t=d5(e),n=AP(t,e),r=AP(t.reverse(),e);return[n,r]}function d5(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 AP(e,t){for(const n of e)if(!FK(n,{upTo:t}))return n}function FK(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 BK(e){return e instanceof HTMLInputElement&&"select"in e}function Uo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&BK(e)&&t&&e.select()}}var EP=zK();function zK(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=PP(e,t),e.unshift(t)},remove(t){e=PP(e,t),e[0]?.resume()}}}function PP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function UK(e){return e.filter(t=>t.tagName!=="A")}var Ay=0;function bv(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kP()),document.body.insertAdjacentElement("beforeend",e[1]??kP()),Ay++,()=>{Ay===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ay--}},[])}function kP(){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 vs=function(){return vs=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},vs.apply(this,arguments)};function f5(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 qK(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var kh="right-scroll-bar-position",Th="width-before-scroll-bar",WK="with-scroll-bars-hidden",VK="--removed-body-scroll-bar-size";function Ey(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function HK(e,t){var n=m.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 KK=typeof window<"u"?m.useLayoutEffect:m.useEffect,TP=new WeakMap;function GK(e,t){var n=HK(null,function(r){return e.forEach(function(a){return Ey(a,r)})});return KK(function(){var r=TP.get(n);if(r){var a=new Set(r),o=new Set(e),i=n.current;a.forEach(function(c){o.has(c)||Ey(c,null)}),o.forEach(function(c){a.has(c)||Ey(c,i)})}TP.set(n,e)},[e]),n}function YK(e){return e}function XK(e,t){t===void 0&&(t=YK);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(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(c){return o(c)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(o),i=n}var d=function(){var h=i;i=[],h.forEach(o)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){i.push(h),f()},filter:function(h){return i=i.filter(h),n}}}};return a}function JK(e){e===void 0&&(e={});var t=XK(null);return t.options=vs({async:!0,ssr:!1},e),t}var p5=function(e){var t=e.sideCar,n=f5(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 m.createElement(r,vs({},n))};p5.isSideCarExport=!0;function QK(e,t){return e.useMedium(t),p5}var h5=JK(),Py=function(){},wv=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Py,onWheelCapture:Py,onTouchMoveCapture:Py}),a=r[0],o=r[1],i=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,x=e.noRelative,j=e.noIsolation,b=e.inert,y=e.allowPinchZoom,S=e.as,C=S===void 0?"div":S,N=e.gapMode,E=f5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,k=GK([n,t]),T=vs(vs({},E),a);return m.createElement(m.Fragment,null,h&&m.createElement(A,{sideCar:h5,removeScrollBar:f,shards:p,noRelative:x,noIsolation:j,inert:b,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:N}),i?m.cloneElement(m.Children.only(c),vs(vs({},T),{ref:k})):m.createElement(C,vs({},T,{className:d,ref:k}),c))});wv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wv.classNames={fullWidth:Th,zeroRight:kh};var ZK=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function eG(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ZK();return t&&e.setAttribute("nonce",t),e}function tG(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function nG(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var rG=function(){var e=0,t=null;return{add:function(n){e==0&&(t=eG())&&(tG(t,n),nG(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aG=function(){var e=rG();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},m5=function(){var e=aG(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},sG={left:0,top:0,right:0,gap:0},ky=function(e){return parseInt(e||"",10)||0},oG=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[ky(n),ky(r),ky(a)]},iG=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sG;var t=oG(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])}},lG=m5(),vc="data-scroll-locked",cG=function(e,t,n,r){var a=e.left,o=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
10
|
-
.`.concat(WK,` {
|
|
11
|
-
overflow: hidden `).concat(r,`;
|
|
12
|
-
padding-right: `).concat(c,"px ").concat(r,`;
|
|
13
|
-
}
|
|
14
|
-
body[`).concat(vc,`] {
|
|
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(o,`px;
|
|
20
|
-
padding-right: `).concat(i,`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(kh,` {
|
|
28
|
-
right: `).concat(c,"px ").concat(r,`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.`).concat(Th,` {
|
|
32
|
-
margin-right: `).concat(c,"px ").concat(r,`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(kh," .").concat(kh,` {
|
|
36
|
-
right: 0 `).concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(Th," .").concat(Th,` {
|
|
40
|
-
margin-right: 0 `).concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[`).concat(vc,`] {
|
|
44
|
-
`).concat(VK,": ").concat(c,`px;
|
|
45
|
-
}
|
|
46
|
-
`)},OP=function(){var e=parseInt(document.body.getAttribute(vc)||"0",10);return isFinite(e)?e:0},uG=function(){m.useEffect(function(){return document.body.setAttribute(vc,(OP()+1).toString()),function(){var e=OP()-1;e<=0?document.body.removeAttribute(vc):document.body.setAttribute(vc,e.toString())}},[])},dG=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;uG();var o=m.useMemo(function(){return iG(a)},[a]);return m.createElement(lG,{styles:cG(o,!t,a,n?"":"!important")})},vS=!1;if(typeof window<"u")try{var sh=Object.defineProperty({},"passive",{get:function(){return vS=!0,!0}});window.addEventListener("test",sh,sh),window.removeEventListener("test",sh,sh)}catch{vS=!1}var Kl=vS?{passive:!1}:!1,fG=function(e){return e.tagName==="TEXTAREA"},v5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!fG(e)&&n[t]==="visible")},pG=function(e){return v5(e,"overflowY")},hG=function(e){return v5(e,"overflowX")},RP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=g5(e,r);if(a){var o=x5(e,r),i=o[1],c=o[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mG=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vG=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},g5=function(e,t){return e==="v"?pG(t):hG(t)},x5=function(e,t){return e==="v"?mG(t):vG(t)},gG=function(e,t){return e==="h"&&t==="rtl"?-1:1},xG=function(e,t,n,r,a){var o=gG(e,window.getComputedStyle(t).direction),i=o*r,c=n.target,d=t.contains(c),f=!1,h=i>0,p=0,g=0;do{if(!c)break;var x=x5(e,c),j=x[0],b=x[1],y=x[2],S=b-y-o*j;(j||S)&&g5(e,c)&&(p+=S,g+=j);var C=c.parentNode;c=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(f=!0),f},oh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},IP=function(e){return[e.deltaX,e.deltaY]},MP=function(e){return e&&"current"in e?e.current:e},yG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bG=function(e){return`
|
|
47
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
-
`)},wG=0,Gl=[];function jG(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),a=m.useState(wG++)[0],o=m.useState(m5)[0],i=m.useRef(e);m.useEffect(function(){i.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=qK([e.lockRef.current],(e.shards||[]).map(MP),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=m.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!i.current.allowPinchZoom;var S=oh(b),C=n.current,N="deltaX"in b?b.deltaX:C[0]-S[0],E="deltaY"in b?b.deltaY:C[1]-S[1],A,k=b.target,T=Math.abs(N)>Math.abs(E)?"h":"v";if("touches"in b&&T==="h"&&k.type==="range")return!1;var O=window.getSelection(),L=O&&O.anchorNode,z=L?L===k||L.contains(k):!1;if(z)return!1;var q=RP(T,k);if(!q)return!0;if(q?A=T:(A=T==="v"?"h":"v",q=RP(T,k)),!q)return!1;if(!r.current&&"changedTouches"in b&&(N||E)&&(r.current=A),!A)return!0;var F=r.current||A;return xG(F,y,b,F==="h"?N:E)},[]),d=m.useCallback(function(b){var y=b;if(!(!Gl.length||Gl[Gl.length-1]!==o)){var S="deltaY"in y?IP(y):oh(y),C=t.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&yG(A.delta,S)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var N=(i.current.shards||[]).map(MP).filter(Boolean).filter(function(A){return A.contains(y.target)}),E=N.length>0?c(y,N[0]):!i.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),f=m.useCallback(function(b,y,S,C){var N={name:b,delta:y,target:S,should:C,shadowParent:SG(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(E){return E!==N})},1)},[]),h=m.useCallback(function(b){n.current=oh(b),r.current=void 0},[]),p=m.useCallback(function(b){f(b.type,IP(b),b.target,c(b,e.lockRef.current))},[]),g=m.useCallback(function(b){f(b.type,oh(b),b.target,c(b,e.lockRef.current))},[]);m.useEffect(function(){return Gl.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Kl),document.addEventListener("touchmove",d,Kl),document.addEventListener("touchstart",h,Kl),function(){Gl=Gl.filter(function(b){return b!==o}),document.removeEventListener("wheel",d,Kl),document.removeEventListener("touchmove",d,Kl),document.removeEventListener("touchstart",h,Kl)}},[]);var x=e.removeScrollBar,j=e.inert;return m.createElement(m.Fragment,null,j?m.createElement(o,{styles:bG(a)}):null,x?m.createElement(dG,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function SG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const NG=QK(h5,jG);var Pf=m.forwardRef(function(e,t){return m.createElement(wv,vs({},e,{ref:t,sideCar:NG}))});Pf.classNames=wv.classNames;var CG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Yl=new WeakMap,ih=new WeakMap,lh={},Ty=0,y5=function(e){return e&&(e.host||y5(e.parentNode))},_G=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=y5(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})},AG=function(e,t,n,r){var a=_G(t,Array.isArray(e)?e:[e]);lh[n]||(lh[n]=new WeakMap);var o=lh[n],i=[],c=new Set,d=new Set(a),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};a.forEach(f);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(c.has(g))h(g);else try{var x=g.getAttribute(r),j=x!==null&&x!=="false",b=(Yl.get(g)||0)+1,y=(o.get(g)||0)+1;Yl.set(g,b),o.set(g,y),i.push(g),b===1&&j&&ih.set(g,!0),y===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return h(t),c.clear(),Ty++,function(){i.forEach(function(p){var g=Yl.get(p)-1,x=o.get(p)-1;Yl.set(p,g),o.set(p,x),g||(ih.has(p)||p.removeAttribute(r),ih.delete(p)),x||p.removeAttribute(n)}),Ty--,Ty||(Yl=new WeakMap,Yl=new WeakMap,ih=new WeakMap,lh={})}},jv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=CG(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),AG(r,a,n,"aria-hidden")):function(){return null}};function EG(e){const t=PG(e),n=m.forwardRef((r,a)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(TG);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...i,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function PG(e){const t=m.forwardRef((n,r)=>{const{children:a,...o}=n;if(m.isValidElement(a)){const i=RG(a),c=OG(o,a.props);return a.type!==m.Fragment&&(c.ref=r?kr(r,i):i),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kG=Symbol("radix.slottable");function TG(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kG}function OG(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...c)=>{const d=o(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function RG(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 Sv="Dialog",[b5,w5]=pr(Sv),[IG,ts]=b5(Sv),j5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,c=m.useRef(null),d=m.useRef(null),[f,h]=pa({prop:r,defaultProp:a??!1,onChange:o,caller:Sv});return s.jsx(IG,{scope:t,triggerRef:c,contentRef:d,contentId:er(),titleId:er(),descriptionId:er(),open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:i,children:n})};j5.displayName=Sv;var S5="DialogTrigger",N5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ts(S5,n),o=xt(t,a.triggerRef);return s.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":ON(a.open),...r,ref:o,onClick:Re(e.onClick,a.onOpenToggle)})});N5.displayName=S5;var kN="DialogPortal",[MG,C5]=b5(kN,{forceMount:void 0}),_5=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=ts(kN,t);return s.jsx(MG,{scope:t,forceMount:n,children:m.Children.map(r,i=>s.jsx(Kn,{present:n||o.open,children:s.jsx(dl,{asChild:!0,container:a,children:i})}))})};_5.displayName=kN;var qh="DialogOverlay",A5=m.forwardRef((e,t)=>{const n=C5(qh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=ts(qh,e.__scopeDialog);return o.modal?s.jsx(Kn,{present:r||o.open,children:s.jsx(DG,{...a,ref:t})}):null});A5.displayName=qh;var $G=EG("DialogOverlay.RemoveScroll"),DG=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ts(qh,n);return s.jsx(Pf,{as:$G,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Ke.div,{"data-state":ON(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ki="DialogContent",E5=m.forwardRef((e,t)=>{const n=C5(Ki,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=ts(Ki,e.__scopeDialog);return s.jsx(Kn,{present:r||o.open,children:o.modal?s.jsx(LG,{...a,ref:t}):s.jsx(FG,{...a,ref:t})})});E5.displayName=Ki;var LG=m.forwardRef((e,t)=>{const n=ts(Ki,e.__scopeDialog),r=m.useRef(null),a=xt(t,n.contentRef,r);return m.useEffect(()=>{const o=r.current;if(o)return jv(o)},[]),s.jsx(P5,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&o.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault())})}),FG=m.forwardRef((e,t)=>{const n=ts(Ki,e.__scopeDialog),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(P5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),P5=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,c=ts(Ki,n),d=m.useRef(null),f=xt(t,d);return bv(),s.jsxs(s.Fragment,{children:[s.jsx(Ef,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:s.jsx(ul,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":ON(c.open),...i,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(zG,{titleId:c.titleId}),s.jsx(qG,{contentRef:d,descriptionId:c.descriptionId})]})]})}),TN="DialogTitle",k5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ts(TN,n);return s.jsx(Ke.h2,{id:a.titleId,...r,ref:t})});k5.displayName=TN;var T5="DialogDescription",O5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ts(T5,n);return s.jsx(Ke.p,{id:a.descriptionId,...r,ref:t})});O5.displayName=T5;var R5="DialogClose",I5=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=ts(R5,n);return s.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>a.onOpenChange(!1))})});I5.displayName=R5;function ON(e){return e?"open":"closed"}var M5="DialogTitleWarning",[BG,$5]=Nq(M5,{contentName:Ki,titleName:TN,docsSlug:"dialog"}),zG=({titleId:e})=>{const t=$5(M5),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 m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},UG="DialogDescriptionWarning",qG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$5(UG).contentName}}.`;return m.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Nv=j5,WG=N5,Cv=_5,uu=A5,du=E5,kf=k5,Tf=O5,_v=I5;const D5=Nv,VG=Cv,L5=m.forwardRef(({className:e,...t},n)=>s.jsx(uu,{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}));L5.displayName=uu.displayName;const HG=fl("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"}}),RN=m.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(VG,{children:[s.jsx(L5,{}),s.jsxs(du,{ref:a,className:Se(HG({side:e}),t),...r,children:[n,s.jsxs(_v,{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(_s,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));RN.displayName=du.displayName;const F5=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});F5.displayName="SheetHeader";const B5=m.forwardRef(({className:e,...t},n)=>s.jsx(kf,{ref:n,className:Se("text-lg font-semibold text-foreground",e),...t}));B5.displayName=kf.displayName;const KG=m.forwardRef(({className:e,...t},n)=>s.jsx(Tf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));KG.displayName=Tf.displayName;function $P({className:e,...t}){return s.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}const GG="sidebar:state",YG=3600*24*7,XG="16rem",JG="18rem",QG="3rem",ZG="b",z5=m.createContext(null);function Of(){const e=m.useContext(z5);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const U5=m.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...i},c)=>{const d=kK(),[f,h]=m.useState(!1),[p,g]=m.useState(e),x=t??p,j=m.useCallback(C=>{const N=typeof C=="function"?C(x):C;n?n(N):g(N),document.cookie=`${GG}=${N}; path=/; max-age=${YG}`},[n,x]),b=m.useCallback(()=>d?h(C=>!C):j(C=>!C),[d,j,h]);m.useEffect(()=>{const C=N=>{N.key===ZG&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),b())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[b]);const y=x?"expanded":"collapsed",S=m.useMemo(()=>({state:y,open:x,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[y,x,j,d,f,h,b]);return s.jsx(z5.Provider,{value:S,children:s.jsx(su,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":XG,"--sidebar-width-icon":QG,...a},className:Se("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...i,children:o})})})});U5.displayName="SidebarProvider";const q5=m.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,...o},i)=>{const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=Of();return n==="none"?s.jsx("div",{className:Se("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:i,...o,children:a}):c?s.jsx(D5,{open:f,onOpenChange:h,...o,children:s.jsx(RN,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":JG},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):s.jsxs("div",{ref:i,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),...o,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})})]})});q5.displayName="Sidebar";const W5=m.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=Of();return s.jsxs(se,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Se("h-7 w-7",e),onClick:o=>{t?.(o),a()},...n,children:[s.jsx(R7,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});W5.displayName="SidebarTrigger";const eY=m.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=Of();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})});eY.displayName="SidebarRail";const tY=m.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}));tY.displayName="SidebarInset";const nY=m.forwardRef(({className:e,...t},n)=>s.jsx(pt,{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}));nY.displayName="SidebarInput";const V5=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:Se("flex flex-col gap-2 p-2",e),...t}));V5.displayName="SidebarHeader";const H5=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:Se("flex flex-col gap-2 p-2",e),...t}));H5.displayName="SidebarFooter";const gS=m.forwardRef(({className:e,...t},n)=>s.jsx(u5,{ref:n,"data-sidebar":"separator",className:Se("mx-2 w-auto bg-sidebar-border",e),...t}));gS.displayName="SidebarSeparator";const K5=m.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}));K5.displayName="SidebarContent";const G5=m.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}));G5.displayName="SidebarGroup";const Y5=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?ri:"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})});Y5.displayName="SidebarGroupLabel";const rY=m.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?ri:"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})});rY.displayName="SidebarGroupAction";const X5=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:Se("w-full text-sm",e),...t}));X5.displayName="SidebarGroupContent";const J5=m.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}));J5.displayName="SidebarMenu";const Q5=m.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Se("group/menu-item relative",e),...t}));Q5.displayName="SidebarMenuItem";const aY=fl("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"}}),Z5=m.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:o,...i},c)=>{const d=e?ri:"button",{isMobile:f,state:h}=Of(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Se(aY({variant:n,size:r}),o),...i});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(ou,{children:[s.jsx(iu,{asChild:!0,children:p}),s.jsx(pl,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});Z5.displayName="SidebarMenuButton";const sY=m.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const o=t?ri:"button";return s.jsx(o,{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})});sY.displayName="SidebarMenuAction";const oY=m.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}));oY.displayName="SidebarMenuBadge";const iY=m.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const a=m.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($P,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx($P,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});iY.displayName="SidebarMenuSkeleton";const lY=m.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}));lY.displayName="SidebarMenuSub";const cY=m.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));cY.displayName="SidebarMenuSubItem";const uY=m.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},o)=>{const i=e?ri:"a";return s.jsx(i,{ref:o,"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})});uY.displayName="SidebarMenuSubButton";const e3=m.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},o)=>s.jsx(yK,{ref:o,to:r,className:({isActive:i,isPending:c})=>Se(e,i&&t,c&&n),...a}));e3.displayName="NavLink";function dY({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...a}){const o=`grad-${m.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:o,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(#${o})`,fillRule:"evenodd"})]})}const fY=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:Z$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:Q$},{title:"Analyze MCP",url:"/tool-analysis",icon:eD},{title:"OAuth Debugger",url:"/oauth-debugger",icon:$7}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:J$},{title:"MCP servers",url:"/libraries/servers",icon:X$},{title:"Agents",url:"/libraries/agents",icon:Pr}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:Zs},{title:"Evaluation Results",url:"/results",icon:kd},{title:"Compare Evaluations",url:"/compare",icon:cN},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:tD},{title:"Custom Reports",url:"/markdown-reports",icon:oc}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:fN},{title:"MCPLab MCP server",url:"/settings/mcp",icon:Qj}]}];function pY(e={version:null}){const t=e.version??null,{state:n}=Of(),r=n==="collapsed",a=Rs(),o=m.useMemo(()=>fY,[]);return s.jsxs(q5,{collapsible:"icon",children:[s.jsx(V5,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:s.jsxs("div",{className:`flex items-center ${r?"justify-center overflow-visible":"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(dY,{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(K5,{children:o.map((i,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(gS,{className:"my-1.5"}),s.jsxs(G5,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(Y5,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:i.title}),s.jsx(X5,{children:s.jsx(J5,{children:i.items.map(d=>s.jsx(Q5,{children:s.jsx(Z5,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":d.url==="/settings"?a.pathname==="/settings":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(e3,{to:d.url,end:d.url==="/"||d.url==="/settings",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))})})]})]},i.title))}),s.jsxs(H5,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(gS,{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/mcplab",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(E7,{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 t3=m.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));t3.displayName="Breadcrumb";const n3=m.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}));n3.displayName="BreadcrumbList";const r3=m.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:Se("inline-flex items-center gap-1.5",e),...t}));r3.displayName="BreadcrumbItem";const a3=m.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?ri:"a";return s.jsx(a,{ref:r,className:Se("transition-colors hover:text-foreground",t),...n})});a3.displayName="BreadcrumbLink";const s3=m.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}));s3.displayName="BreadcrumbPage";const o3=({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(lN,{})});o3.displayName="BreadcrumbSeparator";function gs(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function tc(e,t){t&&(typeof t.inputTokens=="number"&&(e.input+=t.inputTokens,e.hasInput=!0),typeof t.outputTokens=="number"&&(e.output+=t.outputTokens,e.hasOutput=!0),typeof t.totalTokens=="number"&&(e.total+=t.totalTokens,e.hasTotal=!0))}function Ys(e){return!e.hasInput&&!e.hasOutput&&!e.hasTotal?null:{inputTokens:e.hasInput?e.input:null,outputTokens:e.hasOutput?e.output:null,totalTokens:e.hasTotal?e.total:null}}function hY(e){const t=gs();for(const n of e)tc(t,n);return Ys(t)}function mY(e,t){return`${e}-${t+1}`}function vY(e){switch(e.type){case"regex":return{type:"response_regex",value:e.pattern};case"contains":return{type:"response_contains",value:e.value};case"not_contains":return{type:"response_not_contains",value:e.value};case"starts_with":return{type:"response_starts_with",value:e.value};case"ends_with":return{type:"response_ends_with",value:e.value};case"equals":return{type:"response_equals",value:e.value};case"jsonpath":return{type:"response_jsonpath",path:e.path,equals:e.equals};case"jsonpath_exists":return{type:"response_jsonpath_exists",path:e.path};case"jsonpath_not_exists":return{type:"response_jsonpath_not_exists",path:e.path};default:throw new Error(`Unsupported response assertion type in config: ${String(e?.type??"(missing type)")}`)}}function i3(e){return e.type==="required_tool"||e.type==="forbidden_tool"?null:e.type==="response_contains"?e.value?{type:"contains",value:e.value}:null:e.type==="response_not_contains"?e.value?{type:"not_contains",value:e.value}:null:e.type==="response_starts_with"?e.value?{type:"starts_with",value:e.value}:null:e.type==="response_ends_with"?e.value?{type:"ends_with",value:e.value}:null:e.type==="response_equals"?e.value?{type:"equals",value:e.value}:null:e.type==="response_regex"?e.value?{type:"regex",pattern:e.value}:null:e.type==="response_jsonpath"?e.path?.trim()?e.equals!==void 0?{type:"jsonpath",path:e.path.trim(),equals:e.equals}:{type:"jsonpath",path:e.path.trim()}:null:e.type==="response_jsonpath_exists"?e.path?.trim()?{type:"jsonpath_exists",path:e.path.trim()}:null:e.type==="response_jsonpath_not_exists"&&e.path?.trim()?{type:"jsonpath_not_exists",path:e.path.trim()}:null}function nc(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,o=[],i=[];for(const p of n){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;a.set(y,y),i.push({kind:"referenced",ref:y});continue}const g=String(p.id||p.name||"").trim();if(!g)continue;const x=g;a.set(g,x);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="api_key"||p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:x,name:String(p.name||g),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.token??(p.auth.env?`\${${p.auth.env}}`:void 0):p.auth?.type==="api_key"?p.auth.value:void 0,apiKeyHeaderName:p.auth?.type==="api_key"?p.auth.header_name: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,oauthMode:p.auth?.type==="oauth_authorization_code"?p.auth.mode:void 0,oauthAuthorizationUrl:p.auth?.type==="oauth_authorization_code"?p.auth.authorization_url:void 0,oauthTokenEndpoint:p.auth?.type==="oauth_authorization_code"?p.auth.token_url: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};o.push(b),i.push({kind:"inline",server:b})}const c=[],d=[];for(const p of r){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;d.push({kind:"referenced",ref:y});continue}const g=String(p.id||p.name||"").trim();if(!g)continue;const x=g,j=p.provider==="azure_openai"?"azure":p.provider,b={id:x,name:String(p.name||g),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,maxTurns:p.max_turns,systemPrompt:p.system};c.push(b),d.push({kind:"inline",agent:b})}const f=[],h=[];return e.config.scenarios.forEach((p,g)=>{if("ref"in p){const b=String(p.ref||"").trim();if(!b)return;h.push({kind:"referenced",ref:b});return}const x=[];for(const b of p.eval?.tool_constraints?.required_tools??[])x.push({type:"required_tool",value:b});for(const b of p.eval?.tool_constraints?.forbidden_tools??[])x.push({type:"forbidden_tool",value:b});for(const b of p.eval?.response_assertions??[])x.push(vY(b));const j={id:p.id||mY("scn",g),name:p.name||p.id||`Scenario ${g+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(y=>a.get(y)??y).filter(Boolean);const b=p.mcp_servers;return Array.isArray(b)?b.flatMap(y=>{if("ref"in y&&y.ref)return[String(y.ref)];if("id"in y&&y.id){const S=String(y.id);if(!a.has(S)){a.set(S,S);const C=y.auth,N=C?.type==="bearer"?"bearer":C?.type==="api_key"||C?.type==="oauth_client_credentials"?"api-key":C?.type==="oauth_authorization_code"?"oauth2":"none";o.push({id:S,name:String(y.name||S),transport:"streamable-http",url:String(y.url||""),authType:N,authValue:C?.type==="bearer"?String(C.token||"")||(C.env?`\${${C.env}}`:void 0):C?.type==="api_key"?String(C.value||""):void 0,apiKeyHeaderName:C?.type==="api_key"?String(C.header_name||""):void 0,oauthClientId:C?.type==="oauth_authorization_code"&&String(C.client_id||"")||void 0,oauthClientSecret:C?.type==="oauth_authorization_code"&&String(C.client_secret||"")||void 0,oauthRedirectUrl:C?.type==="oauth_authorization_code"&&String(C.redirect_url||"")||void 0,oauthScope:(C?.type==="oauth_authorization_code"||C?.type==="oauth_client_credentials")&&String(C.scope||"")||void 0,oauthMode:C?.type==="oauth_authorization_code"?C.mode:void 0,oauthAuthorizationUrl:C?.type==="oauth_authorization_code"&&String(C.authorization_url||"")||void 0,oauthTokenEndpoint:C?.type==="oauth_authorization_code"&&String(C.token_url||"")||void 0,oauthTokenUrl:C?.type==="oauth_client_credentials"?String(C.token_url||""):void 0,oauthClientIdEnv:C?.type==="oauth_client_credentials"?String(C.client_id_env||""):void 0,oauthClientSecretEnv:C?.type==="oauth_client_credentials"?String(C.client_secret_env||""):void 0,oauthAudience:C?.type==="oauth_client_credentials"&&String(C.audience||"")||void 0}),i.push({kind:"inline",server:o[o.length-1]})}return[S]}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:x,extractRules:(p.extract??[]).map(b=>({name:b.name,pattern:b.regex}))};f.push(j),h.push({kind:"inline",scenario:j})}),{id:e.id,name:t||e.name,configName:t,description:e.path,...e.relativePath?{relativePath:e.relativePath}:{},...e.suitePath!==void 0?{suitePath:e.suitePath}:{},loadError:e.error,loadWarnings:e.warnings,servers:o,serverEntries:i,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 gY(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,max_turns:a.max_turns,system:a.system})),scenarios:e.scenarios}},n=nc(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function DP(e){const t=new Map,n=x=>{const j=x.id,b=x.authValue?.trim()??"",y=x.apiKeyHeaderName?.trim()??"",S=x.authType==="bearer"?(()=>{if(!b)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:b}})():x.authType==="api-key"&&!x.oauthTokenUrl?{type:"api_key",...y?{header_name:y}:{},value:(()=>{if(!b)throw new Error(`Server '${j}' is missing API key value`);return b})()}:x.authType==="api-key"?{type:"oauth_client_credentials",token_url:x.oauthTokenUrl||"",client_id_env:x.oauthClientIdEnv||"",client_secret_env:x.oauthClientSecretEnv||"",...x.oauthScope?{scope:x.oauthScope}:{},...x.oauthAudience?{audience:x.oauthAudience}:{}}:x.authType==="oauth2"?{type:"oauth_authorization_code",...x.oauthMode==="dcr"?{mode:"dcr"}:{},...x.oauthMode!=="dcr"&&x.oauthClientId?{client_id:x.oauthClientId}:{},...x.oauthClientSecret?{client_secret:x.oauthClientSecret}:{},...x.oauthRedirectUrl?{redirect_url:x.oauthRedirectUrl}:{},...x.oauthScope?{scope:x.oauthScope}:{},...x.oauthAuthorizationUrl?{authorization_url:x.oauthAuthorizationUrl}:{},...x.oauthTokenEndpoint?{token_url:x.oauthTokenEndpoint}:{}}:void 0;return{id:j,...x.name&&x.name!==j?{name:x.name}:{},transport:"http",url:x.url||"http://localhost:3000/mcp",...S!==void 0?{auth:S}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(x=>({kind:"inline",server:x}))],a=new Set,o=new Map,i=r.flatMap(x=>{if(x.kind==="referenced"){const b=String(x.ref||"").trim();return!b||a.has(b)?[]:(a.add(b),t.set(b,b),[{ref:b}])}const j=n(x.server);return t.set(x.server.id,j.id),o.set(j.id,j),[j]}),c=x=>{const j=x.id;return{id:j,...x.name&&x.name!==j?{name:x.name}:{},provider:x.provider==="azure"?"azure_openai":x.provider==="anthropic"?"anthropic":"openai",model:x.model,temperature:x.temperature,max_tokens:x.maxTokens,max_turns:x.maxTurns,system:x.systemPrompt}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(x=>({kind:"inline",agent:x}))],f=new Set,h=d.flatMap(x=>{if(x.kind==="referenced"){const j=String(x.ref||"").trim();return!j||f.has(j)?[]:(f.add(j),[{ref:j}])}return[c(x.agent)]}),p=x=>{const j=x.evalRules.filter(S=>S.type==="required_tool").map(S=>S.value).filter(S=>typeof S=="string"&&S.length>0),b=x.evalRules.filter(S=>S.type==="forbidden_tool").map(S=>S.value).filter(S=>typeof S=="string"&&S.length>0),y=x.evalRules.map(S=>i3(S)).filter(S=>!!S);return{id:x.id,name:x.name||void 0,mcp_servers:x.serverIds.length>0?x.serverIds.map(S=>{const C=t.get(S)??S;return o.get(C)??{ref:C}}):void 0,prompt:x.prompt,...x.snapshotEval?{snapshot_eval:{enabled:x.snapshotEval.enabled,baseline_snapshot_id:x.snapshotEval.baselineSnapshotId,baseline_source_run_id:x.snapshotEval.baselineSourceRunId,last_updated_at:x.snapshotEval.lastUpdatedAt}}:{},eval:{tool_constraints:{required_tools:j,forbidden_tools:b},response_assertions:y},extract:x.extractRules.map(S=>({name:S.name,from:"final_text",regex:S.pattern}))}},g=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(x=>x.kind==="referenced"?{ref:x.ref}:p(x.scenario)):[...e.scenarios.map(x=>p(x))];return{name:e.configName?.trim()||void 0,servers:i,agents:h,scenarios:g,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 xY(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,(()=>{const a=r.authValue?.trim()??"",o=r.apiKeyHeaderName?.trim()??"";return{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?(()=>{if(!a)throw new Error(`Server '${r.id}' is missing bearer token value`);return{type:"bearer",token:a}})():r.authType==="api-key"&&!r.oauthTokenUrl?{type:"api_key",...o?{header_name:o}:{},value:(()=>{if(!a)throw new Error(`Server '${r.id}' is missing API key value`);return a})()}: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",...r.oauthMode==="dcr"?{mode:"dcr"}:{},...r.oauthMode!=="dcr"&&r.oauthClientId?{client_id:r.oauthClientId}:{},...r.oauthClientSecret?{client_secret:r.oauthClientSecret}:{},...r.oauthRedirectUrl?{redirect_url:r.oauthRedirectUrl}:{},...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAuthorizationUrl?{authorization_url:r.oauthAuthorizationUrl}:{},...r.oauthTokenEndpoint?{token_url:r.oauthTokenEndpoint}:{}}: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,max_turns:r.maxTurns,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).filter(a=>typeof a=="string"&&a.length>0),forbidden_tools:r.evalRules.filter(a=>a.type==="forbidden_tool").map(a=>a.value).filter(a=>typeof a=="string"&&a.length>0)},response_assertions:r.evalRules.map(a=>i3(a)).filter(a=>!!a)},extract:r.extractRules.map(a=>({name:a.name,from:"final_text",regex:a.pattern}))}))}}function yY(e,t){if(e)return`${e}::${t??""}`}function ch(e){return e.type==="text"}function l3(e,t){if(!t)return e.tool_calls.map((a,o)=>({name:a,arguments:{},duration:e.tool_durations_ms[o]??0,timestamp:new Date().toISOString()}));const n=[],r=new Map;for(const a of t.messages)for(const o of a.content)o.type==="tool_use"?n.push({id:o.id,name:o.name,input:o.input??{},ts:a.ts}):o.type==="tool_result"&&r.set(o.tool_use_id,{durationMs:o.duration_ms,tsEnd:o.ts_end});return n.map((a,o)=>{const i=r.get(a.id);return{name:a.name,arguments:a.input,duration:i?.durationMs??e.tool_durations_ms[o]??0,timestamp:i?.tsEnd??a.ts??new Date().toISOString()}})}function c3(e,t){const n=[];if(!e)return n;let r;const a=e.messages??[];for(let o=0;o<a.length;o+=1){const i=a[o];if(i.role==="user"){const c=i.content.filter(ch);for(const d of c)n.push({id:`user_prompt-${n.length}`,kind:"user_prompt",text:d.text,timestamp:i.ts});continue}if(i.role==="assistant"){const c=i.content.filter(h=>h.type==="tool_use");for(const h of i.content)h.type==="text"&&(n.push({id:`assistant_thought-${n.length}`,kind:"assistant_thought",text:h.text,timestamp:i.ts}),r=n.length-1);const d=a[o+1],f=d?.role==="tool";if(c.length>0&&f){const h=new Map,p=[];for(const g of d.content)g.type==="tool_result"&&(g.tool_use_id?h.set(g.tool_use_id,g):p.push(g));for(const g of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:LP(g.input??{}),toolName:g.name,timestamp:i.ts,estimatedTokens:g.estimated_tokens?{inputTokens:g.estimated_tokens.input,outputTokens:g.estimated_tokens.output,totalTokens:g.estimated_tokens.total}:void 0,estimatedTokenMethod:g.estimated_tokens?.method});const x=h.get(g.id);if(!x)continue;const j=x.content.filter(ch).map(b=>b.text).join(`
|
|
54
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,toolName:x.name,ok:!x.is_error,durationMs:x.duration_ms,timestamp:x.ts_end??d.ts,estimatedTokens:x.estimated_tokens?{inputTokens:x.estimated_tokens.input,outputTokens:x.estimated_tokens.output,totalTokens:x.estimated_tokens.total}:void 0,estimatedTokenMethod:x.estimated_tokens?.method}),h.delete(g.id)}for(const g of[...h.values(),...p]){const x=g.content.filter(ch).map(j=>j.text).join(`
|
|
55
|
-
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:x,toolName:g.name,ok:!g.is_error,durationMs:g.duration_ms,timestamp:g.ts_end??d.ts,estimatedTokens:g.estimated_tokens?{inputTokens:g.estimated_tokens.input,outputTokens:g.estimated_tokens.output,totalTokens:g.estimated_tokens.total}:void 0,estimatedTokenMethod:g.estimated_tokens?.method})}o+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:LP(h.input??{}),toolName:h.name,timestamp:i.ts,estimatedTokens:h.estimated_tokens?{inputTokens:h.estimated_tokens.input,outputTokens:h.estimated_tokens.output,totalTokens:h.estimated_tokens.total}:void 0,estimatedTokenMethod:h.estimated_tokens?.method});continue}if(i.role==="tool")for(const c of i.content){if(c.type!=="tool_result")continue;const d=c.content.filter(ch).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??i.ts,estimatedTokens:c.estimated_tokens?{inputTokens:c.estimated_tokens.input,outputTokens:c.estimated_tokens.output,totalTokens:c.estimated_tokens.total}:void 0,estimatedTokenMethod:c.estimated_tokens?.method})}}return typeof r=="number"&&n[r]&&(n[r]={...n[r],kind:"assistant_final"}),n}function LP(e){try{return JSON.stringify(e)}catch{return String(e)}}function FP(e,t){t&&(typeof t.input_tokens=="number"&&(e.input+=t.input_tokens,e.hasInput=!0),typeof t.output_tokens=="number"&&(e.output+=t.output_tokens,e.hasOutput=!0),typeof t.total_tokens=="number"&&(e.total+=t.total_tokens,e.hasTotal=!0))}function Oy(e,t){if(typeof e!="number"||t<=0)return new Array(t).fill(void 0);const n=Math.floor(e/t),r=e%t;return Array.from({length:t},(a,o)=>n+(o<r?1:0))}function u3(e){const t=gs(),n=gs(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const o of e.messages??[]){if(o.role!=="assistant")continue;FP(t,o.usage);const i=o.content.filter(p=>p.type==="tool_use");if(i.length===0)continue;if(i.every(p=>!!p.estimated_tokens)){for(const p of i){const g=p.estimated_tokens;n.input+=g.input,n.hasInput=!0,n.output+=g.output,n.hasOutput=!0,n.total+=g.total,n.hasTotal=!0;const x=r.get(p.name)??gs();x.input+=g.input,x.hasInput=!0,x.output+=g.output,x.hasOutput=!0,x.total+=g.total,x.hasTotal=!0,r.set(p.name,x)}continue}FP(n,o.usage);const d=Oy(o.usage?.input_tokens,i.length),f=Oy(o.usage?.output_tokens,i.length),h=Oy(o.usage?.total_tokens,i.length);for(let p=0;p<i.length;p+=1){const g=i[p].name,x=r.get(g)??gs(),j=d[p],b=f[p],y=h[p];typeof j=="number"&&(x.input+=j,x.hasInput=!0),typeof b=="number"&&(x.output+=b,x.hasOutput=!0),typeof y=="number"&&(x.total+=y,x.hasTotal=!0),r.set(g,x)}}const a={};for(const[o,i]of Array.from(r.entries()).sort((c,d)=>c[0].localeCompare(d[0]))){const c=Ys(i);c&&(a[o]=c)}return{assistant:Ys(t),tool:Ys(n),perTool:a}}function BP(e,t=[]){const n=new Map;for(const i of t){const c=yY(i.scenario_id,i.agent);if(!c)continue;const d=n.get(c)??[];d.push(i),n.set(c,d)}const r=e.scenarios.map(i=>{const c=n.get(`${i.scenario_id}::${i.agent}`)??[],d=new Map;for(const y of c)d.set(y.run_index,y);const f=i.runs.map((y,S)=>{const C=d.get(y.run_index)??c[S],N=u3(C);return{runIndex:y.run_index,passed:y.pass,toolCalls:l3(y,C),assistantTokenUsage:N.assistant,toolTokenUsage:N.tool,toolTokenUsageByTool:N.perTool,finalAnswer:y.final_text,conversation:c3(C),duration:y.tool_durations_ms.reduce((E,A)=>E+A,0),extractedValues:Object.fromEntries(Object.entries(y.extracted).map(([E,A])=>[E,String(A??"")])),failureReasons:y.failures}}),h=gs(),p=gs(),g=new Map;for(const y of f){tc(h,y.assistantTokenUsage),tc(p,y.toolTokenUsage);for(const[S,C]of Object.entries(y.toolTokenUsageByTool??{})){const N=g.get(S)??gs();tc(N,C),g.set(S,N)}}const x={};for(const[y,S]of Array.from(g.entries()).sort((C,N)=>C[0].localeCompare(N[0]))){const C=Ys(S);C&&(x[y]=C)}const j=f.length===0?0:Math.round(f.reduce((y,S)=>y+S.duration,0)/f.length),b=f.length===0?0:f.reduce((y,S)=>y+S.toolCalls.length,0)/f.length;return{scenarioId:i.scenario_id,scenarioName:i.scenario_name||i.scenario_id,agentId:i.agent,agentName:i.agent,provider:i.provider,model:i.model,runs:f,passRate:i.pass_rate,avgToolCalls:b,avgDuration:j,assistantTokenUsage:Ys(h),toolTokenUsage:Ys(p),toolTokenUsageByTool:x}}),a=gs(),o=gs();for(const i of r)tc(a,i.assistantTokenUsage),tc(o,i.toolTokenUsage);return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:r,assistantTokenUsage:Ys(a),toolTokenUsage:Ys(o),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 bY(e,t){const n=u3(t??void 0);return{runIndex:e.run_index,passed:e.pass,toolCalls:l3(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:c3(t??void 0),duration:e.tool_durations_ms.reduce((r,a)=>r+a,0),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([r,a])=>[r,String(a??"")])),failureReasons:e.failures}}function wY(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Li=wY();class IN extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function ot(e,t){const n=await fetch(`${Li}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new IN(n.status,`Request failed (${n.status}): ${r}`)}return await n.json()}async function jY(e,t){const n=await fetch(`${Li}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new IN(n.status,`Request failed (${n.status}): ${r}`)}return n.text()}function zP(e,t){const n=new EventSource(`${Li}${e}`),r=e.replace(/\/events$/,""),a=["session_started","turn_started","tool_call_requested","tool_call_approved","tool_call_denied","tool_call_resolved","assistant_message_completed","session_warning","session_error","session_finished"];let o=!1;const i=()=>{o||(o=!0,n.close())},c=d=>{if(!o&&!(typeof d.data!="string"||!d.data))try{const f=JSON.parse(d.data);f.type==="session_finished"&&i(),t(f)}catch{}};for(const d of a)n.addEventListener(d,c);return n.onerror=()=>{if(!o){if(n.readyState===2){i();return}fetch(`${Li}${r}`,{method:"GET",cache:"no-store",headers:{accept:"application/json"}}).then(d=>{(d.status===404||d.status===410)&&i()}).catch(()=>{})}},()=>i()}const Je={health:()=>ot("/api/health"),getSettings:()=>ot("/api/settings"),updateSettings:e=>ot("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>ot("/api/evals"),createConfig:(e,t)=>ot("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>ot(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>ot(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>ot("/api/runs"),listMarkdownReports:()=>ot("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>ot(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>ot(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>ot(`/api/runs/${e}`),deleteRun:e=>ot(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>ot(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>ot(`/api/runs/${e}/trace`),listSnapshots:()=>ot("/api/snapshots"),createSnapshotFromRun:(e,t)=>ot("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>ot(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>ot(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),applyResultAssistantReport:e=>ot(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>ot("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getResultAssistantSession:e=>ot(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>ot(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>ot(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>ot(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>ot(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),subscribeResultAssistantSessionEvents:(e,t)=>zP(`/api/result-assistant/sessions/${e}/events`,t),generateSnapshotEvalBaseline:(e,t,n)=>ot("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>ot(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>ot("/api/libraries"),saveLibraries:e=>ot("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>ot("/api/runs",{method:"POST",body:JSON.stringify(e)}),runScenarioPreview:e=>ot("/api/runs/preview",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>ot(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>ot("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>ot(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>ot(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>ot(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>ot(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>ot(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>ot(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),subscribeScenarioAssistantSessionEvents:(e,t)=>zP(`/api/scenario-assistant/sessions/${e}/events`,t),discoverToolsForAnalysis:e=>ot("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>ot("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>ot(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>ot(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${Li}/api/tool-analysis/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},o=i=>{if(!r&&!(typeof i.data!="string"||!i.data))try{const c=JSON.parse(i.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("started",o),n.addEventListener("log",o),n.addEventListener("completed",o),n.addEventListener("error",o),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},listToolAnalysisResults:()=>ot("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>ot(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>ot(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>ot("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>ot(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>ot(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${Li}/api/oauth-debugger/sessions/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},o=i=>{if(!r&&!(typeof i.data!="string"||!i.data))try{const c=JSON.parse(i.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(i=>n.addEventListener(i,o)),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},submitOAuthDebuggerManualCallback:(e,t)=>ot(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>ot(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?ot(`/api/oauth-debugger/sessions/${e}/export?format=json`):jY(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>ot("/api/oauth-runtime/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>ot(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>ot(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>ot(`/api/oauth-runtime/sessions/${e}/callback`,{method:"POST",body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>ot(`/api/oauth-runtime/sessions/${e}/cancel`,{method:"POST",body:JSON.stringify({})}),ensureOAuthServers:e=>ot("/api/oauth-runtime/servers/ensure",{method:"POST",body:JSON.stringify(e)}),stopRun:e=>ot(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>ot("/api/runs/queue"),removeQueuedRun:e=>ot(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Li}/api/runs/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},o=i=>{if(!r&&!(typeof i.data!="string"||!i.data))try{const c=JSON.parse(i.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("queued",o),n.addEventListener("started",o),n.addEventListener("log",o),n.addEventListener("completed",o),n.addEventListener("error",o),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>{a()}}};function SY(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 NY(e){return e||`config-${Date.now()}`}const CY={async health(){return Je.health()},async listConfigs(){return(await Je.listConfigs()).map(nc)},async createConfig(e){const t=await Je.createConfig(SY(e),DP(e));return nc(t)},async updateConfig(e){const t=await Je.updateConfig(e.id,DP(e),NY(e.name));return nc(t)},async deleteConfig(e){await Je.deleteConfig(e)},async listResults(){const t=(await Je.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([Je.getRun(n.runId),Je.getRunTrace(n.runId)]);return BP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([Je.getRun(e),Je.getRunTrace(e)]);return BP(t,n.records)}catch{return}},async deleteResult(e){await Je.deleteRun(e)},async updateRunNote(e,t){await Je.updateRunNote(e,t)},async listMarkdownReports(){return Je.listMarkdownReports()},async getMarkdownReport(e){return Je.getMarkdownReport(e)},async deleteMarkdownReport(e){await Je.deleteMarkdownReport(e)},async startRun(e){return Je.startRun(e)},async runScenarioPreview(e){const t=await Je.runScenarioPreview(e),n=t.scenario.run;if(!n)throw new Error("Preview run did not return a run result");return{runId:t.runId,scenarioId:t.scenario.scenarioId,agentName:t.scenario.agent,run:bY(n,t.scenario.traceRecord)}},async stopRun(e){await Je.stopRun(e)},async getRunQueue(){return Je.getRunQueue()},async removeQueuedRun(e){await Je.removeQueuedRun(e)},subscribeRunJob(e,t){return Je.subscribeRunJob(e,t)},async listSnapshots(){return Je.listSnapshots()},async createSnapshotFromRun(e,t){return Je.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await Je.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return Je.compareSnapshot(e,t)},async applyResultAssistantReport(e){return Je.applyResultAssistantReport(e)},async createResultAssistantSession(e){return Je.createResultAssistantSession(e)},async getResultAssistantSession(e){return Je.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return Je.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return Je.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return Je.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await Je.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return Je.subscribeResultAssistantSessionEvents(e,t)},async generateSnapshotEvalBaseline(e,t,n){const r=await Je.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:nc(r.config)}},async updateSnapshotPolicy(e,t){const n=await Je.updateSnapshotPolicy(e,t);return nc(n)},async getLibraries(){const e=await Je.getLibraries();return gY(e)},async saveLibraries(e){await Je.saveLibraries(xY(e))},async listProviderModels(e){return Je.listProviderModels(e)},async getWorkspaceSettings(){return Je.getSettings()},async updateWorkspaceSettings(e){return Je.updateSettings(e)},async createScenarioAssistantSession(e){return Je.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return Je.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return Je.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return Je.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return Je.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return Je.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await Je.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return Je.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return Je.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return Je.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return Je.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return Je.getToolAnalysisResult(e)},async stopToolAnalysis(e){return Je.stopToolAnalysis(e)},async listToolAnalysisResults(){return Je.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return Je.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await Je.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return Je.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return Je.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return Je.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return Je.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return Je.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return Je.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return Je.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return Je.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return Je.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return Je.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return Je.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return Je.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return Je.ensureOAuthServers(e)}},d3=m.createContext(null);function _Y({children:e}){const t="workspace",[n,r]=m.useState("checking"),[a,o]=m.useState(null);m.useEffect(()=>{r("checking"),Je.health().then(c=>{r("connected"),o(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),o(null)})},[t]);const i=m.useMemo(()=>CY,[]);return s.jsx(d3.Provider,{value:{mode:t,connection:n,version:a,source:i},children:e})}function $n(){const e=m.useContext(d3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const AY=(e,t)=>{if(e==="/")return[{label:"Dashboard"}];const n=[{label:"Dashboard",to:"/"}];if(fn("/mcp-evaluations/:id",e))return n.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),n;if(fn("/mcp-evaluations",e))return n.push({label:"MCP Evaluations"}),n;if(fn("/settings/mcp",e))return n.push({label:"Settings",to:"/settings"},{label:"MCP Connection"}),n;if(fn("/settings",e))return n.push({label:"Settings"}),n;if(fn("/tool-analysis",e))return n.push({label:"Analyze MCP Tools"}),n;if(fn("/tool-analysis-results/:id",e)){const r=fn("/tool-analysis-results/:id",e);return n.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:r?.params.id??"Report"}),n}if(fn("/tool-analysis-results",e))return n.push({label:"Tool Analysis Results"}),n;if(fn("/markdown-reports/view",e))return n.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),n;if(fn("/markdown-reports",e))return n.push({label:"Markdown Reports"}),n;if(fn("/oauth-debugger",e))return n.push({label:"OAuth Debugger"}),n;if(fn("/results/:id",e))return n.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),n;if(fn("/results",e))return n.push({label:"Evaluation Results"}),n;if(fn("/run",e))return n.push({label:"Run Evaluation"}),n;if(fn("/libraries/servers/:serverId",e)){const r=fn("/libraries/servers/:serverId",e),a=r?.params.serverId?decodeURIComponent(r.params.serverId):"Server";return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers",to:"/libraries/servers"},{label:a==="new"?"New Server":a}),n}if(fn("/libraries/servers",e))return n.push({label:"Libraries",to:"/libraries/servers"},{label:"MCP servers"}),n;if(fn("/libraries/agents/:agentName",e)){const r=fn("/libraries/agents/:agentName",e),a=r?.params.agentName?decodeURIComponent(r.params.agentName):"Agent";return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents",to:"/libraries/agents"},{label:a==="new"?"New Agent":a}),n}if(fn("/libraries/agents",e))return n.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),n;if(fn("/libraries/test-cases/:testCaseId",e)){const r=fn("/libraries/test-cases/:testCaseId",e),a=r?.params.testCaseId?decodeURIComponent(r.params.testCaseId):"Test Case";return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases",to:"/libraries/test-cases"},{label:a}),n}if(fn("/libraries/test-cases",e))return n.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),n;if(fn("/compare/results",e))return n.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),n;if(fn("/compare",e)){const a=new URLSearchParams(t).get("mode")==="within-run"?"Agents":"Runs";return n.push({label:"Compare Evaluations",to:"/compare"},{label:a}),n}return n};function EY(){const e=Rs(),t=new URLSearchParams(e.search).get("embed")==="1",n=AY(e.pathname,e.search),{connection:r,version:a}=$n();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(jP,{})}):s.jsx(U5,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(pY,{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(W5,{}),s.jsx(t3,{children:s.jsx(n3,{children:n.map((o,i)=>{const c=i===n.length-1;return s.jsxs(m.Fragment,{children:[s.jsx(r3,{children:o.to&&!c?s.jsx(a3,{asChild:!0,children:s.jsx(Ct,{to:o.to,children:o.label})}):s.jsx(s3,{children:o.label})}),!c&&s.jsx(o3,{})]},`${o.label}-${i}`)})})}),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(jP,{})})]})]})})}const f3=m.createContext(null);function PY({children:e}){const{source:t}=$n(),[n,r]=m.useState([]),[a,o]=m.useState(!0),i=m.useCallback(async()=>{o(!0);try{const g=await t.listConfigs();r(g)}finally{o(!1)}},[t]);m.useEffect(()=>{i()},[i]);const c=m.useCallback(g=>n.find(x=>x.id===g),[n]),d=m.useCallback(async g=>{const x=await t.createConfig(g);return r(j=>[...j,x]),x},[t]),f=m.useCallback(async(g,x)=>{const j=await t.updateConfig({...x,id:g});return r(b=>b.map(y=>y.id===g?j:y)),j},[t]),h=m.useCallback(async g=>{await t.deleteConfig(g),r(x=>x.filter(j=>j.id!==g))},[t]),p=m.useCallback(async g=>{const x=n.find(y=>y.id===g);if(!x)throw new Error("Config not found");const j={...structuredClone(x),id:`cfg-${Date.now()}`,name:`${x.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},b=await t.createConfig(j);return r(y=>[...y,b]),b},[n,t]);return s.jsx(f3.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:i},children:e})}function Rf(){const e=m.useContext(f3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const p3=m.createContext(null);function kY({children:e}){const{source:t}=$n(),[n,r]=m.useState({servers:[],agents:[],scenarios:[]}),[a,o]=m.useState(!0),i=m.useCallback(async()=>{o(!0);try{const f=await t.getLibraries();r(f)}finally{o(!1)}},[t]);m.useEffect(()=>{i()},[t]),m.useEffect(()=>{const f=()=>{i()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=m.useCallback(async f=>{r(f),await t.saveLibraries(f)},[t]),d=m.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:i}),[n,a,i,c]);return s.jsx(p3.Provider,{value:d,children:e})}function ns(){const e=m.useContext(p3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const Be=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Be.displayName="Card";const St=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));St.displayName="CardHeader";const Nt=m.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));Nt.displayName="CardTitle";const Ur=m.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Ur.displayName="CardDescription";const ze=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("p-6 pt-0",e),...t}));ze.displayName="CardContent";const TY=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));TY.displayName="CardFooter";const qr=m.forwardRef(({className:e,containerClassName:t,...n},r)=>s.jsx("div",{className:Se("relative w-full overflow-auto",t),children:s.jsx("table",{ref:r,className:Se("w-full caption-bottom text-sm",e),...n})}));qr.displayName="Table";const Wr=m.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Wr.displayName="TableHeader";const Vr=m.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Vr.displayName="TableBody";const OY=m.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}));OY.displayName="TableFooter";const Vt=m.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}));Vt.displayName="TableRow";const tt=m.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}));tt.displayName="TableHead";const Fe=m.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Fe.displayName="TableCell";const RY=m.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));RY.displayName="TableCaption";function ms({title:e,value:t,subtitle:n,icon:r,trend:a}){return s.jsx(Be,{children:s.jsx(ze,{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 IY=fl("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"}}),Ue=m.forwardRef(({className:e,variant:t,asChild:n,...r},a)=>{const o=n?ri:"div";return s.jsx(o,{ref:a,className:Se(IY({variant:t}),e),...r})});Ue.displayName="Badge";function Xs({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(Ue,{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 Ry,UP;function Yr(){if(UP)return Ry;UP=1;var e=Array.isArray;return Ry=e,Ry}var Iy,qP;function h3(){if(qP)return Iy;qP=1;var e=typeof Qp=="object"&&Qp&&Qp.Object===Object&&Qp;return Iy=e,Iy}var My,WP;function Is(){if(WP)return My;WP=1;var e=h3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return My=n,My}var $y,VP;function If(){if(VP)return $y;VP=1;var e=Is(),t=e.Symbol;return $y=t,$y}var Dy,HP;function MY(){if(HP)return Dy;HP=1;var e=If(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function o(i){var c=n.call(i,a),d=i[a];try{i[a]=void 0;var f=!0}catch{}var h=r.call(i);return f&&(c?i[a]=d:delete i[a]),h}return Dy=o,Dy}var Ly,KP;function $Y(){if(KP)return Ly;KP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Ly=n,Ly}var Fy,GP;function po(){if(GP)return Fy;GP=1;var e=If(),t=MY(),n=$Y(),r="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function i(c){return c==null?c===void 0?a:r:o&&o in Object(c)?t(c):n(c)}return Fy=i,Fy}var By,YP;function ho(){if(YP)return By;YP=1;function e(t){return t!=null&&typeof t=="object"}return By=e,By}var zy,XP;function fu(){if(XP)return zy;XP=1;var e=po(),t=ho(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return zy=r,zy}var Uy,JP;function MN(){if(JP)return Uy;JP=1;var e=Yr(),t=fu(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(o,i){if(e(o))return!1;var c=typeof o;return c=="number"||c=="symbol"||c=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||i!=null&&o in Object(i)}return Uy=a,Uy}var qy,QP;function ai(){if(QP)return qy;QP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return qy=e,qy}var Wy,ZP;function $N(){if(ZP)return Wy;ZP=1;var e=po(),t=ai(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",o="[object Proxy]";function i(c){if(!t(c))return!1;var d=e(c);return d==r||d==a||d==n||d==o}return Wy=i,Wy}var Vy,ek;function DY(){if(ek)return Vy;ek=1;var e=Is(),t=e["__core-js_shared__"];return Vy=t,Vy}var Hy,tk;function LY(){if(tk)return Hy;tk=1;var e=DY(),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 Hy=n,Hy}var Ky,nk;function m3(){if(nk)return Ky;nk=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 Ky=n,Ky}var Gy,rk;function FY(){if(rk)return Gy;rk=1;var e=$N(),t=LY(),n=ai(),r=m3(),a=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,i=Function.prototype,c=Object.prototype,d=i.toString,f=c.hasOwnProperty,h=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var x=e(g)?h:o;return x.test(r(g))}return Gy=p,Gy}var Yy,ak;function BY(){if(ak)return Yy;ak=1;function e(t,n){return t?.[n]}return Yy=e,Yy}var Xy,sk;function ml(){if(sk)return Xy;sk=1;var e=FY(),t=BY();function n(r,a){var o=t(r,a);return e(o)?o:void 0}return Xy=n,Xy}var Jy,ok;function Av(){if(ok)return Jy;ok=1;var e=ml(),t=e(Object,"create");return Jy=t,Jy}var Qy,ik;function zY(){if(ik)return Qy;ik=1;var e=Av();function t(){this.__data__=e?e(null):{},this.size=0}return Qy=t,Qy}var Zy,lk;function UY(){if(lk)return Zy;lk=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Zy=e,Zy}var eb,ck;function qY(){if(ck)return eb;ck=1;var e=Av(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(o){var i=this.__data__;if(e){var c=i[o];return c===t?void 0:c}return r.call(i,o)?i[o]:void 0}return eb=a,eb}var tb,uk;function WY(){if(uk)return tb;uk=1;var e=Av(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var o=this.__data__;return e?o[a]!==void 0:n.call(o,a)}return tb=r,tb}var nb,dk;function VY(){if(dk)return nb;dk=1;var e=Av(),t="__lodash_hash_undefined__";function n(r,a){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&a===void 0?t:a,this}return nb=n,nb}var rb,fk;function HY(){if(fk)return rb;fk=1;var e=zY(),t=UY(),n=qY(),r=WY(),a=VY();function o(i){var c=-1,d=i==null?0:i.length;for(this.clear();++c<d;){var f=i[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=a,rb=o,rb}var ab,pk;function KY(){if(pk)return ab;pk=1;function e(){this.__data__=[],this.size=0}return ab=e,ab}var sb,hk;function DN(){if(hk)return sb;hk=1;function e(t,n){return t===n||t!==t&&n!==n}return sb=e,sb}var ob,mk;function Ev(){if(mk)return ob;mk=1;var e=DN();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return ob=t,ob}var ib,vk;function GY(){if(vk)return ib;vk=1;var e=Ev(),t=Array.prototype,n=t.splice;function r(a){var o=this.__data__,i=e(o,a);if(i<0)return!1;var c=o.length-1;return i==c?o.pop():n.call(o,i,1),--this.size,!0}return ib=r,ib}var lb,gk;function YY(){if(gk)return lb;gk=1;var e=Ev();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return lb=t,lb}var cb,xk;function XY(){if(xk)return cb;xk=1;var e=Ev();function t(n){return e(this.__data__,n)>-1}return cb=t,cb}var ub,yk;function JY(){if(yk)return ub;yk=1;var e=Ev();function t(n,r){var a=this.__data__,o=e(a,n);return o<0?(++this.size,a.push([n,r])):a[o][1]=r,this}return ub=t,ub}var db,bk;function Pv(){if(bk)return db;bk=1;var e=KY(),t=GY(),n=YY(),r=XY(),a=JY();function o(i){var c=-1,d=i==null?0:i.length;for(this.clear();++c<d;){var f=i[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=a,db=o,db}var fb,wk;function LN(){if(wk)return fb;wk=1;var e=ml(),t=Is(),n=e(t,"Map");return fb=n,fb}var pb,jk;function QY(){if(jk)return pb;jk=1;var e=HY(),t=Pv(),n=LN();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return pb=r,pb}var hb,Sk;function ZY(){if(Sk)return hb;Sk=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return hb=e,hb}var mb,Nk;function kv(){if(Nk)return mb;Nk=1;var e=ZY();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return mb=t,mb}var vb,Ck;function eX(){if(Ck)return vb;Ck=1;var e=kv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return vb=t,vb}var gb,_k;function tX(){if(_k)return gb;_k=1;var e=kv();function t(n){return e(this,n).get(n)}return gb=t,gb}var xb,Ak;function nX(){if(Ak)return xb;Ak=1;var e=kv();function t(n){return e(this,n).has(n)}return xb=t,xb}var yb,Ek;function rX(){if(Ek)return yb;Ek=1;var e=kv();function t(n,r){var a=e(this,n),o=a.size;return a.set(n,r),this.size+=a.size==o?0:1,this}return yb=t,yb}var bb,Pk;function FN(){if(Pk)return bb;Pk=1;var e=QY(),t=eX(),n=tX(),r=nX(),a=rX();function o(i){var c=-1,d=i==null?0:i.length;for(this.clear();++c<d;){var f=i[c];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=a,bb=o,bb}var wb,kk;function v3(){if(kk)return wb;kk=1;var e=FN(),t="Expected a function";function n(r,a){if(typeof r!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var o=function(){var i=arguments,c=a?a.apply(this,i):i[0],d=o.cache;if(d.has(c))return d.get(c);var f=r.apply(this,i);return o.cache=d.set(c,f)||d,f};return o.cache=new(n.Cache||e),o}return n.Cache=e,wb=n,wb}var jb,Tk;function aX(){if(Tk)return jb;Tk=1;var e=v3(),t=500;function n(r){var a=e(r,function(i){return o.size===t&&o.clear(),i}),o=a.cache;return a}return jb=n,jb}var Sb,Ok;function sX(){if(Ok)return Sb;Ok=1;var e=aX(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var o=[];return a.charCodeAt(0)===46&&o.push(""),a.replace(t,function(i,c,d,f){o.push(d?f.replace(n,"$1"):c||i)}),o});return Sb=r,Sb}var Nb,Rk;function BN(){if(Rk)return Nb;Rk=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,o=Array(a);++r<a;)o[r]=n(t[r],r,t);return o}return Nb=e,Nb}var Cb,Ik;function oX(){if(Ik)return Cb;Ik=1;var e=If(),t=BN(),n=Yr(),r=fu(),a=e?e.prototype:void 0,o=a?a.toString:void 0;function i(c){if(typeof c=="string")return c;if(n(c))return t(c,i)+"";if(r(c))return o?o.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return Cb=i,Cb}var _b,Mk;function g3(){if(Mk)return _b;Mk=1;var e=oX();function t(n){return n==null?"":e(n)}return _b=t,_b}var Ab,$k;function x3(){if($k)return Ab;$k=1;var e=Yr(),t=MN(),n=sX(),r=g3();function a(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))}return Ab=a,Ab}var Eb,Dk;function Tv(){if(Dk)return Eb;Dk=1;var e=fu();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Eb=t,Eb}var Pb,Lk;function zN(){if(Lk)return Pb;Lk=1;var e=x3(),t=Tv();function n(r,a){a=e(a,r);for(var o=0,i=a.length;r!=null&&o<i;)r=r[t(a[o++])];return o&&o==i?r:void 0}return Pb=n,Pb}var kb,Fk;function y3(){if(Fk)return kb;Fk=1;var e=zN();function t(n,r,a){var o=n==null?void 0:e(n,r);return o===void 0?a:o}return kb=t,kb}var iX=y3();const da=ln(iX);var Tb,Bk;function lX(){if(Bk)return Tb;Bk=1;function e(t){return t==null}return Tb=e,Tb}var cX=lX();const Tt=ln(cX);var Ob,zk;function uX(){if(zk)return Ob;zk=1;var e=po(),t=Yr(),n=ho(),r="[object String]";function a(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return Ob=a,Ob}var dX=uX();const Gi=ln(dX);var fX=$N();const kt=ln(fX);var pX=ai();const pu=ln(pX);var Rb={exports:{}},an={};var Uk;function hX(){if(Uk)return an;Uk=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"),o=Symbol.for("react.provider"),i=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function b(y){if(typeof y=="object"&&y!==null){var S=y.$$typeof;switch(S){case e:switch(y=y.type,y){case n:case a:case r:case f:case h:return y;default:switch(y=y&&y.$$typeof,y){case c:case i:case d:case g:case p:case o:return y;default:return S}}case t:return S}}}return an.ContextConsumer=i,an.ContextProvider=o,an.Element=e,an.ForwardRef=d,an.Fragment=n,an.Lazy=g,an.Memo=p,an.Portal=t,an.Profiler=a,an.StrictMode=r,an.Suspense=f,an.SuspenseList=h,an.isAsyncMode=function(){return!1},an.isConcurrentMode=function(){return!1},an.isContextConsumer=function(y){return b(y)===i},an.isContextProvider=function(y){return b(y)===o},an.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},an.isForwardRef=function(y){return b(y)===d},an.isFragment=function(y){return b(y)===n},an.isLazy=function(y){return b(y)===g},an.isMemo=function(y){return b(y)===p},an.isPortal=function(y){return b(y)===t},an.isProfiler=function(y){return b(y)===a},an.isStrictMode=function(y){return b(y)===r},an.isSuspense=function(y){return b(y)===f},an.isSuspenseList=function(y){return b(y)===h},an.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===a||y===r||y===f||y===h||y===x||typeof y=="object"&&y!==null&&(y.$$typeof===g||y.$$typeof===p||y.$$typeof===o||y.$$typeof===i||y.$$typeof===d||y.$$typeof===j||y.getModuleId!==void 0)},an.typeOf=b,an}var qk;function mX(){return qk||(qk=1,Rb.exports=hX()),Rb.exports}var vX=mX(),Ib,Wk;function b3(){if(Wk)return Ib;Wk=1;var e=po(),t=ho(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return Ib=r,Ib}var Mb,Vk;function gX(){if(Vk)return Mb;Vk=1;var e=b3();function t(n){return e(n)&&n!=+n}return Mb=t,Mb}var xX=gX();const Mf=ln(xX);var yX=b3();const bX=ln(yX);var _r=function(t){return t===0?0:t>0?1:-1},Ii=function(t){return Gi(t)&&t.indexOf("%")===t.length-1},qe=function(t){return bX(t)&&!Mf(t)},wX=function(t){return Tt(t)},Zn=function(t){return qe(t)||Gi(t)},jX=0,hu=function(t){var n=++jX;return"".concat(t||"").concat(n)},Ar=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(!qe(t)&&!Gi(t))return r;var o;if(Ii(t)){var i=t.indexOf("%");o=n*parseFloat(t.slice(0,i))/100}else o=+t;return Mf(o)&&(o=r),a&&o>n&&(o=n),o},rc=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},SX=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},ia=function(t,n){return qe(t)&&qe(n)?function(r){return t+r*(n-t)}:function(){return n}};function Wh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):da(r,t))===n})}var NX=function(t,n){return qe(t)&&qe(n)?t-n:Gi(t)&&Gi(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function gc(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 xS(e){"@babel/helpers - typeof";return xS=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},xS(e)}var CX=["viewBox","children"],_X=["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"],Hk=["points","pathLength"],$b={svg:CX,polygon:Hk,polyline:Hk},UN=["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"],Vh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(m.isValidElement(t)&&(r=t.props),!pu(r))return null;var a={};return Object.keys(r).forEach(function(o){UN.includes(o)&&(a[o]=n||function(i){return r[o](r,i)})}),a},AX=function(t,n,r){return function(a){return t(n,r,a),null}},Yi=function(t,n,r){if(!pu(t)||xS(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(o){var i=t[o];UN.includes(o)&&typeof i=="function"&&(a||(a={}),a[o]=AX(i,n,r))}),a},EX=["children"],PX=["children"];function Kk(e,t){if(e==null)return{};var n=kX(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kX(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 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)}var Gk={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"},eo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Yk=null,Db=null,qN=function e(t){if(t===Yk&&Array.isArray(Db))return Db;var n=[];return m.Children.forEach(t,function(r){Tt(r)||(vX.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Db=n,Yk=t,n};function fa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return eo(a)}):r=[eo(t)],qN(e).forEach(function(a){var o=da(a,"type.displayName")||da(a,"type.name");r.indexOf(o)!==-1&&n.push(a)}),n}function sa(e,t){var n=fa(e,t);return n&&n[0]}var Xk=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!qe(r)||r<=0||!qe(a)||a<=0)},TX=["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"],OX=function(t){return t&&t.type&&Gi(t.type)&&TX.indexOf(t.type)>=0},RX=function(t){return t&&yS(t)==="object"&&"clipDot"in t},IX=function(t,n,r,a){var o,i=(o=$b?.[a])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!kt(t)&&(a&&i.includes(n)||_X.includes(n))||r&&UN.includes(n)},yt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(m.isValidElement(t)&&(a=t.props),!pu(a))return null;var o={};return Object.keys(a).forEach(function(i){var c;IX((c=a)===null||c===void 0?void 0:c[i],i,n,r)&&(o[i]=a[i])}),o},bS=function e(t,n){if(t===n)return!0;var r=m.Children.count(t);if(r!==m.Children.count(n))return!1;if(r===0)return!0;if(r===1)return Jk(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var o=t[a],i=n[a];if(Array.isArray(o)||Array.isArray(i)){if(!e(o,i))return!1}else if(!Jk(o,i))return!1}return!0},Jk=function(t,n){if(Tt(t)&&Tt(n))return!0;if(!Tt(t)&&!Tt(n)){var r=t.props||{},a=r.children,o=Kk(r,EX),i=n.props||{},c=i.children,d=Kk(i,PX);return a&&c?gc(o,d)&&bS(a,c):!a&&!c?gc(o,d):!1}return!1},Qk=function(t,n){var r=[],a={};return qN(t).forEach(function(o,i){if(OX(o))r.push(o);else if(o){var c=eo(o.type),d=n[c]||{},f=d.handler,h=d.once;if(f&&(!h||!a[c])){var p=f(o,c,i);r.push(p),a[c]=!0}}}),r},MX=function(t){var n=t&&t.type;return n&&Gk[n]?Gk[n]:null},$X=function(t,n){return qN(n).indexOf(t)},DX=["children","width","height","viewBox","className","style","title","desc"];function wS(){return wS=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},wS.apply(this,arguments)}function LX(e,t){if(e==null)return{};var n=FX(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FX(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 jS(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,o=e.className,i=e.style,c=e.title,d=e.desc,f=LX(e,DX),h=a||{width:n,height:r,x:0,y:0},p=Ot("recharts-surface",o);return Y.createElement("svg",wS({},yt(f,!0,"svg"),{className:p,width:n,height:r,style:i,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),Y.createElement("title",null,c),Y.createElement("desc",null,d),t)}var BX=["children","className"];function SS(){return SS=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},SS.apply(this,arguments)}function zX(e,t){if(e==null)return{};var n=UX(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UX(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 Zt=Y.forwardRef(function(e,t){var n=e.children,r=e.className,a=zX(e,BX),o=Ot("recharts-layer",r);return Y.createElement("g",SS({className:o},yt(a,!0),{ref:t}),n)}),to=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o]},Lb,Zk;function qX(){if(Zk)return Lb;Zk=1;function e(t,n,r){var a=-1,o=t.length;n<0&&(n=-n>o?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var i=Array(o);++a<o;)i[a]=t[a+n];return i}return Lb=e,Lb}var Fb,eT;function WX(){if(eT)return Fb;eT=1;var e=qX();function t(n,r,a){var o=n.length;return a=a===void 0?o:a,!r&&a>=o?n:e(n,r,a)}return Fb=t,Fb}var Bb,tT;function w3(){if(tT)return Bb;tT=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",i="\\u200d",c=RegExp("["+i+e+a+o+"]");function d(f){return c.test(f)}return Bb=d,Bb}var zb,nT;function VX(){if(nT)return zb;nT=1;function e(t){return t.split("")}return zb=e,zb}var Ub,rT;function HX(){if(rT)return Ub;rT=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",i="["+e+"]",c="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",j=f+"?",b="["+o+"]?",y="(?:"+x+"(?:"+[h,p,g].join("|")+")"+b+j+")*",S=b+j+y,C="(?:"+[h+c+"?",c,p,g,i].join("|")+")",N=RegExp(d+"(?="+d+")|"+C+S,"g");function E(A){return A.match(N)||[]}return Ub=E,Ub}var qb,aT;function KX(){if(aT)return qb;aT=1;var e=VX(),t=w3(),n=HX();function r(a){return t(a)?n(a):e(a)}return qb=r,qb}var Wb,sT;function GX(){if(sT)return Wb;sT=1;var e=WX(),t=w3(),n=KX(),r=g3();function a(o){return function(i){i=r(i);var c=t(i)?n(i):void 0,d=c?c[0]:i.charAt(0),f=c?e(c,1).join(""):i.slice(1);return d[o]()+f}}return Wb=a,Wb}var Vb,oT;function YX(){if(oT)return Vb;oT=1;var e=GX(),t=e("toUpperCase");return Vb=t,Vb}var XX=YX();const Ov=ln(XX);function yn(e){return function(){return e}}const j3=Math.cos,Hh=Math.sin,rs=Math.sqrt,Kh=Math.PI,Rv=2*Kh,NS=Math.PI,CS=2*NS,Ti=1e-6,JX=CS-Ti;function S3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function QX(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return S3;const n=10**t;return function(r){this._+=r[0];for(let a=1,o=r.length;a<o;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class ZX{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?S3:QX(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,o,i){this._append`C${+t},${+n},${+r},${+a},${this._x1=+o},${this._y1=+i}`}arcTo(t,n,r,a,o){if(t=+t,n=+n,r=+r,a=+a,o=+o,o<0)throw new Error(`negative radius: ${o}`);let i=this._x1,c=this._y1,d=r-t,f=a-n,h=i-t,p=c-n,g=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Ti)if(!(Math.abs(p*d-f*h)>Ti)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-i,j=a-c,b=d*d+f*f,y=x*x+j*j,S=Math.sqrt(b),C=Math.sqrt(g),N=o*Math.tan((NS-Math.acos((b+g-y)/(2*S*C)))/2),E=N/C,A=N/S;Math.abs(E-1)>Ti&&this._append`L${t+E*h},${n+E*p}`,this._append`A${o},${o},0,0,${+(p*x>h*j)},${this._x1=t+A*d},${this._y1=n+A*f}`}}arc(t,n,r,a,o,i){if(t=+t,n=+n,r=+r,i=!!i,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^i,g=i?a-o:o-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>Ti||Math.abs(this._y1-h)>Ti)&&this._append`L${f},${h}`,r&&(g<0&&(g=g%CS+CS),g>JX?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:g>Ti&&this._append`A${r},${r},0,${+(g>=NS)},${p},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}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 WN(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 ZX(t)}function VN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function N3(e){this._context=e}N3.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 Iv(e){return new N3(e)}function C3(e){return e[0]}function _3(e){return e[1]}function A3(e,t){var n=yn(!0),r=null,a=Iv,o=null,i=WN(c);e=typeof e=="function"?e:e===void 0?C3:yn(e),t=typeof t=="function"?t:t===void 0?_3:yn(t);function c(d){var f,h=(d=VN(d)).length,p,g=!1,x;for(r==null&&(o=a(x=i())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===g&&((g=!g)?o.lineStart():o.lineEnd()),g&&o.point(+e(p,f,d),+t(p,f,d));if(x)return o=null,x+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:yn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:yn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:yn(!!d),c):n},c.curve=function(d){return arguments.length?(a=d,r!=null&&(o=a(r)),c):a},c.context=function(d){return arguments.length?(d==null?r=o=null:o=a(r=d),c):r},c}function uh(e,t,n){var r=null,a=yn(!0),o=null,i=Iv,c=null,d=WN(f);e=typeof e=="function"?e:e===void 0?C3:yn(+e),t=typeof t=="function"?t:yn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?_3:yn(+n);function f(p){var g,x,j,b=(p=VN(p)).length,y,S=!1,C,N=new Array(b),E=new Array(b);for(o==null&&(c=i(C=d())),g=0;g<=b;++g){if(!(g<b&&a(y=p[g],g,p))===S)if(S=!S)x=g,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=g-1;j>=x;--j)c.point(N[j],E[j]);c.lineEnd(),c.areaEnd()}S&&(N[g]=+e(y,g,p),E[g]=+t(y,g,p),c.point(r?+r(y,g,p):N[g],n?+n(y,g,p):E[g]))}if(C)return c=null,C+""||null}function h(){return A3().defined(a).curve(i).context(o)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:yn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:yn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:yn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:yn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:yn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:yn(+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:yn(!!p),f):a},f.curve=function(p){return arguments.length?(i=p,o!=null&&(c=i(o)),f):i},f.context=function(p){return arguments.length?(p==null?o=c=null:c=i(o=p),f):o},f}class E3{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 eJ(e){return new E3(e,!0)}function tJ(e){return new E3(e,!1)}const HN={draw(e,t){const n=rs(t/Kh);e.moveTo(n,0),e.arc(0,0,n,0,Rv)}},nJ={draw(e,t){const n=rs(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()}},P3=rs(1/3),rJ=P3*2,aJ={draw(e,t){const n=rs(t/rJ),r=n*P3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},sJ={draw(e,t){const n=rs(t),r=-n/2;e.rect(r,r,n,n)}},oJ=.8908130915292852,k3=Hh(Kh/10)/Hh(7*Kh/10),iJ=Hh(Rv/10)*k3,lJ=-j3(Rv/10)*k3,cJ={draw(e,t){const n=rs(t*oJ),r=iJ*n,a=lJ*n;e.moveTo(0,-n),e.lineTo(r,a);for(let o=1;o<5;++o){const i=Rv*o/5,c=j3(i),d=Hh(i);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},Hb=rs(3),uJ={draw(e,t){const n=-rs(t/(Hb*3));e.moveTo(0,n*2),e.lineTo(-Hb*n,-n),e.lineTo(Hb*n,-n),e.closePath()}},Sa=-.5,Na=rs(3)/2,_S=1/rs(12),dJ=(_S/2+1)*3,fJ={draw(e,t){const n=rs(t/dJ),r=n/2,a=n*_S,o=r,i=n*_S+n,c=-o,d=i;e.moveTo(r,a),e.lineTo(o,i),e.lineTo(c,d),e.lineTo(Sa*r-Na*a,Na*r+Sa*a),e.lineTo(Sa*o-Na*i,Na*o+Sa*i),e.lineTo(Sa*c-Na*d,Na*c+Sa*d),e.lineTo(Sa*r+Na*a,Sa*a-Na*r),e.lineTo(Sa*o+Na*i,Sa*i-Na*o),e.lineTo(Sa*c+Na*d,Sa*d-Na*c),e.closePath()}};function pJ(e,t){let n=null,r=WN(a);e=typeof e=="function"?e:yn(e||HN),t=typeof t=="function"?t:yn(t===void 0?64:+t);function a(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return a.type=function(o){return arguments.length?(e=typeof o=="function"?o:yn(o),a):e},a.size=function(o){return arguments.length?(t=typeof o=="function"?o:yn(+o),a):t},a.context=function(o){return arguments.length?(n=o??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 T3(e){this._context=e}T3.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 hJ(e){return new T3(e)}function O3(e){this._context=e}O3.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 mJ(e){return new O3(e)}function R3(e){this._context=e}R3.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 vJ(e){return new R3(e)}function I3(e){this._context=e}I3.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 gJ(e){return new I3(e)}function iT(e){return e<0?-1:1}function lT(e,t,n){var r=e._x1-e._x0,a=t-e._x1,o=(e._y1-e._y0)/(r||a<0&&-0),i=(n-e._y1)/(a||r<0&&-0),c=(o*a+i*r)/(r+a);return(iT(o)+iT(i))*Math.min(Math.abs(o),Math.abs(i),.5*Math.abs(c))||0}function cT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Kb(e,t,n){var r=e._x0,a=e._y0,o=e._x1,i=e._y1,c=(o-r)/3;e._context.bezierCurveTo(r+c,a+c*t,o-c,i-c*n,o,i)}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:Kb(this,this._t0,cT(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,Kb(this,cT(this,n=lT(this,e,t)),n);break;default:Kb(this,this._t0,n=lT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function M3(e){this._context=new $3(e)}(M3.prototype=Object.create(Xh.prototype)).point=function(e,t){Xh.prototype.point.call(this,t,e)};function $3(e){this._context=e}$3.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,o){this._context.bezierCurveTo(t,e,r,n,o,a)}};function xJ(e){return new Xh(e)}function yJ(e){return new M3(e)}function D3(e){this._context=e}D3.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=uT(e),a=uT(t),o=0,i=1;i<n;++o,++i)this._context.bezierCurveTo(r[0][o],a[0][o],r[1][o],a[1][o],e[i],t[i]);(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 uT(e){var t,n=e.length-1,r,a=new Array(n),o=new Array(n),i=new Array(n);for(a[0]=0,o[0]=2,i[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,o[t]=4,i[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,o[n-1]=7,i[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/o[t-1],o[t]-=r,i[t]-=r*i[t-1];for(a[n-1]=i[n-1]/o[n-1],t=n-2;t>=0;--t)a[t]=(i[t]-a[t+1])/o[t];for(o[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-a[t+1];return[a,o]}function bJ(e){return new D3(e)}function Mv(e,t){this._context=e,this._t=t}Mv.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 wJ(e){return new Mv(e,.5)}function jJ(e){return new Mv(e,0)}function SJ(e){return new Mv(e,1)}function _c(e,t){if((i=e.length)>1)for(var n=1,r,a,o=e[t[0]],i,c=o.length;n<i;++n)for(a=o,o=e[t[n]],r=0;r<c;++r)o[r][1]+=o[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function AS(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function NJ(e,t){return e[t]}function CJ(e){const t=[];return t.key=e,t}function _J(){var e=yn([]),t=AS,n=_c,r=NJ;function a(o){var i=Array.from(e.apply(this,arguments),CJ),c,d=i.length,f=-1,h;for(const p of o)for(c=0,++f;c<d;++c)(i[c][f]=[0,+r(p,i[c].key,f,o)]).data=p;for(c=0,h=VN(t(i));c<d;++c)i[h[c]].index=c;return n(i,h),i}return a.keys=function(o){return arguments.length?(e=typeof o=="function"?o:yn(Array.from(o)),a):e},a.value=function(o){return arguments.length?(r=typeof o=="function"?o:yn(+o),a):r},a.order=function(o){return arguments.length?(t=o==null?AS:typeof o=="function"?o:yn(Array.from(o)),a):t},a.offset=function(o){return arguments.length?(n=o??_c,a):n},a}function AJ(e,t){if((r=e.length)>0){for(var n,r,a=0,o=e[0].length,i;a<o;++a){for(i=n=0;n<r;++n)i+=e[n][a][1]||0;if(i)for(n=0;n<r;++n)e[n][a][1]/=i}_c(e,t)}}function EJ(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,o=r.length;n<o;++n){for(var i=0,c=0;i<a;++i)c+=e[i][n][1]||0;r[n][1]+=r[n][0]=-c/2}_c(e,t)}}function PJ(e,t){if(!(!((i=e.length)>0)||!((o=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,o,i;r<o;++r){for(var c=0,d=0,f=0;c<i;++c){for(var h=e[t[c]],p=h[r][1]||0,g=h[r-1][1]||0,x=(p-g)/2,j=0;j<c;++j){var b=e[t[j]],y=b[r][1]||0,S=b[r-1][1]||0;x+=y-S}d+=p,f+=x*p}a[r-1][1]+=a[r-1][0]=n,d&&(n-=f/d)}a[r-1][1]+=a[r-1][0]=n,_c(e,t)}}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)}var kJ=["type","size","sizeType"];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)}function dT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function fT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dT(Object(n),!0).forEach(function(r){TJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TJ(e,t,n){return t=OJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OJ(e){var t=RJ(e,"string");return Dd(t)=="symbol"?t:t+""}function RJ(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 IJ(e,t){if(e==null)return{};var n=MJ(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function MJ(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 L3={symbolCircle:HN,symbolCross:nJ,symbolDiamond:aJ,symbolSquare:sJ,symbolStar:cJ,symbolTriangle:uJ,symbolWye:fJ},$J=Math.PI/180,DJ=function(t){var n="symbol".concat(Ov(t));return L3[n]||HN},LJ=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*$J;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}},FJ=function(t,n){L3["symbol".concat(Ov(t))]=n},KN=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,o=a===void 0?64:a,i=t.sizeType,c=i===void 0?"area":i,d=IJ(t,kJ),f=fT(fT({},d),{},{type:r,size:o,sizeType:c}),h=function(){var y=DJ(r),S=pJ().type(y).size(LJ(o,c,r));return S()},p=f.className,g=f.cx,x=f.cy,j=yt(f,!0);return g===+g&&x===+x&&o===+o?Y.createElement("path",ES({},j,{className:Ot("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(x,")"),d:h()})):null};KN.registerSymbol=FJ;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 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 pT(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 BJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pT(Object(n),!0).forEach(function(r){Ld(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UJ(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,B3(r.key),r)}}function qJ(e,t,n){return t&&UJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function WJ(e,t,n){return t=Jh(t),VJ(e,F3()?Reflect.construct(t,n||[],Jh(e).constructor):t.apply(e,n))}function VJ(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 HJ(e)}function HJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F3=function(){return!!e})()}function Jh(e){return Jh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Jh(e)}function KJ(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 Ld(e,t,n){return t=B3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B3(e){var t=GJ(e,"string");return Ac(t)=="symbol"?t:t+""}function GJ(e,t){if(Ac(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ac(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ca=32,GN=(function(e){function t(){return zJ(this,t),WJ(this,t,arguments)}return KJ(t,e),qJ(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,o=Ca/2,i=Ca/6,c=Ca/3,d=r.inactive?a:r.color;if(r.type==="plainline")return Y.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:o,x2:Ca,y2:o,className:"recharts-legend-icon"});if(r.type==="line")return Y.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(o,"h").concat(c,`
|
|
57
|
-
A`).concat(i,",").concat(i,",0,1,1,").concat(2*c,",").concat(o,`
|
|
58
|
-
H`).concat(Ca,"M").concat(2*c,",").concat(o,`
|
|
59
|
-
A`).concat(i,",").concat(i,",0,1,1,").concat(c,",").concat(o),className:"recharts-legend-icon"});if(r.type==="rect")return Y.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(Ca/8,"h").concat(Ca,"v").concat(Ca*3/4,"h").concat(-Ca,"z"),className:"recharts-legend-icon"});if(Y.isValidElement(r.legendIcon)){var f=BJ({},r);return delete f.legendIcon,Y.cloneElement(r.legendIcon,f)}return Y.createElement(KN,{fill:d,cx:o,cy:o,size:Ca,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,o=a.payload,i=a.iconSize,c=a.layout,d=a.formatter,f=a.inactiveColor,h={x:0,y:0,width:Ca,height:Ca},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return o.map(function(x,j){var b=x.formatter||d,y=Ot(Ld(Ld({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",x.inactive));if(x.type==="none")return null;var S=kt(x.value)?null:x.value;to(!kt(x.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 C=x.inactive?f:x.color;return Y.createElement("li",PS({className:y,style:p,key:"legend-item-".concat(j)},Yi(r.props,x,j)),Y.createElement(jS,{width:i,height:i,viewBox:h,style:g},r.renderIcon(x)),Y.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},b?b(S,x,j):S))})}},{key:"render",value:function(){var r=this.props,a=r.payload,o=r.layout,i=r.align;if(!a||!a.length)return null;var c={padding:0,margin:0,textAlign:o==="horizontal"?i:"left"};return Y.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(m.PureComponent);Ld(GN,"displayName","Legend");Ld(GN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Gb,hT;function YJ(){if(hT)return Gb;hT=1;var e=Pv();function t(){this.__data__=new e,this.size=0}return Gb=t,Gb}var Yb,mT;function XJ(){if(mT)return Yb;mT=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Yb=e,Yb}var Xb,vT;function JJ(){if(vT)return Xb;vT=1;function e(t){return this.__data__.get(t)}return Xb=e,Xb}var Jb,gT;function QJ(){if(gT)return Jb;gT=1;function e(t){return this.__data__.has(t)}return Jb=e,Jb}var Qb,xT;function ZJ(){if(xT)return Qb;xT=1;var e=Pv(),t=LN(),n=FN(),r=200;function a(o,i){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<r-1)return d.push([o,i]),this.size=++c.size,this;c=this.__data__=new n(d)}return c.set(o,i),this.size=c.size,this}return Qb=a,Qb}var Zb,yT;function z3(){if(yT)return Zb;yT=1;var e=Pv(),t=YJ(),n=XJ(),r=JJ(),a=QJ(),o=ZJ();function i(c){var d=this.__data__=new e(c);this.size=d.size}return i.prototype.clear=t,i.prototype.delete=n,i.prototype.get=r,i.prototype.has=a,i.prototype.set=o,Zb=i,Zb}var e0,bT;function eQ(){if(bT)return e0;bT=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return e0=t,e0}var t0,wT;function tQ(){if(wT)return t0;wT=1;function e(t){return this.__data__.has(t)}return t0=e,t0}var n0,jT;function U3(){if(jT)return n0;jT=1;var e=FN(),t=eQ(),n=tQ();function r(a){var o=-1,i=a==null?0:a.length;for(this.__data__=new e;++o<i;)this.add(a[o])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,n0=r,n0}var r0,ST;function q3(){if(ST)return r0;ST=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 r0=e,r0}var a0,NT;function W3(){if(NT)return a0;NT=1;function e(t,n){return t.has(n)}return a0=e,a0}var s0,CT;function V3(){if(CT)return s0;CT=1;var e=U3(),t=q3(),n=W3(),r=1,a=2;function o(i,c,d,f,h,p){var g=d&r,x=i.length,j=c.length;if(x!=j&&!(g&&j>x))return!1;var b=p.get(i),y=p.get(c);if(b&&y)return b==c&&y==i;var S=-1,C=!0,N=d&a?new e:void 0;for(p.set(i,c),p.set(c,i);++S<x;){var E=i[S],A=c[S];if(f)var k=g?f(A,E,S,c,i,p):f(E,A,S,i,c,p);if(k!==void 0){if(k)continue;C=!1;break}if(N){if(!t(c,function(T,O){if(!n(N,O)&&(E===T||h(E,T,d,f,p)))return N.push(O)})){C=!1;break}}else if(!(E===A||h(E,A,d,f,p))){C=!1;break}}return p.delete(i),p.delete(c),C}return s0=o,s0}var o0,_T;function nQ(){if(_T)return o0;_T=1;var e=Is(),t=e.Uint8Array;return o0=t,o0}var i0,AT;function rQ(){if(AT)return i0;AT=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,o){r[++n]=[o,a]}),r}return i0=e,i0}var l0,ET;function YN(){if(ET)return l0;ET=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return l0=e,l0}var c0,PT;function aQ(){if(PT)return c0;PT=1;var e=If(),t=nQ(),n=DN(),r=V3(),a=rQ(),o=YN(),i=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",g="[object Number]",x="[object RegExp]",j="[object Set]",b="[object String]",y="[object Symbol]",S="[object ArrayBuffer]",C="[object DataView]",N=e?e.prototype:void 0,E=N?N.valueOf:void 0;function A(k,T,O,L,z,q,F){switch(O){case C:if(k.byteLength!=T.byteLength||k.byteOffset!=T.byteOffset)return!1;k=k.buffer,T=T.buffer;case S:return!(k.byteLength!=T.byteLength||!q(new t(k),new t(T)));case d:case f:case g:return n(+k,+T);case h:return k.name==T.name&&k.message==T.message;case x:case b:return k==T+"";case p:var G=a;case j:var W=L&i;if(G||(G=o),k.size!=T.size&&!W)return!1;var R=F.get(k);if(R)return R==T;L|=c,F.set(k,T);var M=r(G(k),G(T),L,z,q,F);return F.delete(k),M;case y:if(E)return E.call(k)==E.call(T)}return!1}return c0=A,c0}var u0,kT;function H3(){if(kT)return u0;kT=1;function e(t,n){for(var r=-1,a=n.length,o=t.length;++r<a;)t[o+r]=n[r];return t}return u0=e,u0}var d0,TT;function sQ(){if(TT)return d0;TT=1;var e=H3(),t=Yr();function n(r,a,o){var i=a(r);return t(r)?i:e(i,o(r))}return d0=n,d0}var f0,OT;function oQ(){if(OT)return f0;OT=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,o=0,i=[];++r<a;){var c=t[r];n(c,r,t)&&(i[o++]=c)}return i}return f0=e,f0}var p0,RT;function iQ(){if(RT)return p0;RT=1;function e(){return[]}return p0=e,p0}var h0,IT;function lQ(){if(IT)return h0;IT=1;var e=oQ(),t=iQ(),n=Object.prototype,r=n.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(i){return i==null?[]:(i=Object(i),e(a(i),function(c){return r.call(i,c)}))}:t;return h0=o,h0}var m0,MT;function cQ(){if(MT)return m0;MT=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return m0=e,m0}var v0,$T;function uQ(){if($T)return v0;$T=1;var e=po(),t=ho(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return v0=r,v0}var g0,DT;function XN(){if(DT)return g0;DT=1;var e=uQ(),t=ho(),n=Object.prototype,r=n.hasOwnProperty,a=n.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(i){return t(i)&&r.call(i,"callee")&&!a.call(i,"callee")};return g0=o,g0}var gd={exports:{}},x0,LT;function dQ(){if(LT)return x0;LT=1;function e(){return!1}return x0=e,x0}gd.exports;var FT;function K3(){return FT||(FT=1,(function(e,t){var n=Is(),r=dQ(),a=t&&!t.nodeType&&t,o=a&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===a,c=i?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(gd,gd.exports)),gd.exports}var y0,BT;function JN(){if(BT)return y0;BT=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,a){var o=typeof r;return a=a??e,!!a&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<a}return y0=n,y0}var b0,zT;function QN(){if(zT)return b0;zT=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return b0=t,b0}var w0,UT;function fQ(){if(UT)return w0;UT=1;var e=po(),t=QN(),n=ho(),r="[object Arguments]",a="[object Array]",o="[object Boolean]",i="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",g="[object RegExp]",x="[object Set]",j="[object String]",b="[object WeakMap]",y="[object ArrayBuffer]",S="[object DataView]",C="[object Float32Array]",N="[object Float64Array]",E="[object Int8Array]",A="[object Int16Array]",k="[object Int32Array]",T="[object Uint8Array]",O="[object Uint8ClampedArray]",L="[object Uint16Array]",z="[object Uint32Array]",q={};q[C]=q[N]=q[E]=q[A]=q[k]=q[T]=q[O]=q[L]=q[z]=!0,q[r]=q[a]=q[y]=q[o]=q[S]=q[i]=q[c]=q[d]=q[f]=q[h]=q[p]=q[g]=q[x]=q[j]=q[b]=!1;function F(G){return n(G)&&t(G.length)&&!!q[e(G)]}return w0=F,w0}var j0,qT;function G3(){if(qT)return j0;qT=1;function e(t){return function(n){return t(n)}}return j0=e,j0}var xd={exports:{}};xd.exports;var WT;function pQ(){return WT||(WT=1,(function(e,t){var n=h3(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===r,i=o&&n.process,c=(function(){try{var d=a&&a.require&&a.require("util").types;return d||i&&i.binding&&i.binding("util")}catch{}})();e.exports=c})(xd,xd.exports)),xd.exports}var S0,VT;function Y3(){if(VT)return S0;VT=1;var e=fQ(),t=G3(),n=pQ(),r=n&&n.isTypedArray,a=r?t(r):e;return S0=a,S0}var N0,HT;function hQ(){if(HT)return N0;HT=1;var e=cQ(),t=XN(),n=Yr(),r=K3(),a=JN(),o=Y3(),i=Object.prototype,c=i.hasOwnProperty;function d(f,h){var p=n(f),g=!p&&t(f),x=!p&&!g&&r(f),j=!p&&!g&&!x&&o(f),b=p||g||x||j,y=b?e(f.length,String):[],S=y.length;for(var C in f)(h||c.call(f,C))&&!(b&&(C=="length"||x&&(C=="offset"||C=="parent")||j&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||a(C,S)))&&y.push(C);return y}return N0=d,N0}var C0,KT;function mQ(){if(KT)return C0;KT=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return C0=t,C0}var _0,GT;function X3(){if(GT)return _0;GT=1;function e(t,n){return function(r){return t(n(r))}}return _0=e,_0}var A0,YT;function vQ(){if(YT)return A0;YT=1;var e=X3(),t=e(Object.keys,Object);return A0=t,A0}var E0,XT;function gQ(){if(XT)return E0;XT=1;var e=mQ(),t=vQ(),n=Object.prototype,r=n.hasOwnProperty;function a(o){if(!e(o))return t(o);var i=[];for(var c in Object(o))r.call(o,c)&&c!="constructor"&&i.push(c);return i}return E0=a,E0}var P0,JT;function $f(){if(JT)return P0;JT=1;var e=$N(),t=QN();function n(r){return r!=null&&t(r.length)&&!e(r)}return P0=n,P0}var k0,QT;function $v(){if(QT)return k0;QT=1;var e=hQ(),t=gQ(),n=$f();function r(a){return n(a)?e(a):t(a)}return k0=r,k0}var T0,ZT;function xQ(){if(ZT)return T0;ZT=1;var e=sQ(),t=lQ(),n=$v();function r(a){return e(a,n,t)}return T0=r,T0}var O0,eO;function yQ(){if(eO)return O0;eO=1;var e=xQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(o,i,c,d,f,h){var p=c&t,g=e(o),x=g.length,j=e(i),b=j.length;if(x!=b&&!p)return!1;for(var y=x;y--;){var S=g[y];if(!(p?S in i:r.call(i,S)))return!1}var C=h.get(o),N=h.get(i);if(C&&N)return C==i&&N==o;var E=!0;h.set(o,i),h.set(i,o);for(var A=p;++y<x;){S=g[y];var k=o[S],T=i[S];if(d)var O=p?d(T,k,S,i,o,h):d(k,T,S,o,i,h);if(!(O===void 0?k===T||f(k,T,c,d,h):O)){E=!1;break}A||(A=S=="constructor")}if(E&&!A){var L=o.constructor,z=i.constructor;L!=z&&"constructor"in o&&"constructor"in i&&!(typeof L=="function"&&L instanceof L&&typeof z=="function"&&z instanceof z)&&(E=!1)}return h.delete(o),h.delete(i),E}return O0=a,O0}var R0,tO;function bQ(){if(tO)return R0;tO=1;var e=ml(),t=Is(),n=e(t,"DataView");return R0=n,R0}var I0,nO;function wQ(){if(nO)return I0;nO=1;var e=ml(),t=Is(),n=e(t,"Promise");return I0=n,I0}var M0,rO;function J3(){if(rO)return M0;rO=1;var e=ml(),t=Is(),n=e(t,"Set");return M0=n,M0}var $0,aO;function jQ(){if(aO)return $0;aO=1;var e=ml(),t=Is(),n=e(t,"WeakMap");return $0=n,$0}var D0,sO;function SQ(){if(sO)return D0;sO=1;var e=bQ(),t=LN(),n=wQ(),r=J3(),a=jQ(),o=po(),i=m3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",g="[object DataView]",x=i(e),j=i(t),b=i(n),y=i(r),S=i(a),C=o;return(e&&C(new e(new ArrayBuffer(1)))!=g||t&&C(new t)!=c||n&&C(n.resolve())!=f||r&&C(new r)!=h||a&&C(new a)!=p)&&(C=function(N){var E=o(N),A=E==d?N.constructor:void 0,k=A?i(A):"";if(k)switch(k){case x:return g;case j:return c;case b:return f;case y:return h;case S:return p}return E}),D0=C,D0}var L0,oO;function NQ(){if(oO)return L0;oO=1;var e=z3(),t=V3(),n=aQ(),r=yQ(),a=SQ(),o=Yr(),i=K3(),c=Y3(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",g=Object.prototype,x=g.hasOwnProperty;function j(b,y,S,C,N,E){var A=o(b),k=o(y),T=A?h:a(b),O=k?h:a(y);T=T==f?p:T,O=O==f?p:O;var L=T==p,z=O==p,q=T==O;if(q&&i(b)){if(!i(y))return!1;A=!0,L=!1}if(q&&!L)return E||(E=new e),A||c(b)?t(b,y,S,C,N,E):n(b,y,T,S,C,N,E);if(!(S&d)){var F=L&&x.call(b,"__wrapped__"),G=z&&x.call(y,"__wrapped__");if(F||G){var W=F?b.value():b,R=G?y.value():y;return E||(E=new e),N(W,R,S,C,E)}}return q?(E||(E=new e),r(b,y,S,C,N,E)):!1}return L0=j,L0}var F0,iO;function ZN(){if(iO)return F0;iO=1;var e=NQ(),t=ho();function n(r,a,o,i,c){return r===a?!0:r==null||a==null||!t(r)&&!t(a)?r!==r&&a!==a:e(r,a,o,i,n,c)}return F0=n,F0}var B0,lO;function CQ(){if(lO)return B0;lO=1;var e=z3(),t=ZN(),n=1,r=2;function a(o,i,c,d){var f=c.length,h=f,p=!d;if(o==null)return!h;for(o=Object(o);f--;){var g=c[f];if(p&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++f<h;){g=c[f];var x=g[0],j=o[x],b=g[1];if(p&&g[2]){if(j===void 0&&!(x in o))return!1}else{var y=new e;if(d)var S=d(j,b,x,o,i,y);if(!(S===void 0?t(b,j,n|r,d,y):S))return!1}}return!0}return B0=a,B0}var z0,cO;function Q3(){if(cO)return z0;cO=1;var e=ai();function t(n){return n===n&&!e(n)}return z0=t,z0}var U0,uO;function _Q(){if(uO)return U0;uO=1;var e=Q3(),t=$v();function n(r){for(var a=t(r),o=a.length;o--;){var i=a[o],c=r[i];a[o]=[i,c,e(c)]}return a}return U0=n,U0}var q0,dO;function Z3(){if(dO)return q0;dO=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return q0=e,q0}var W0,fO;function AQ(){if(fO)return W0;fO=1;var e=CQ(),t=_Q(),n=Z3();function r(a){var o=t(a);return o.length==1&&o[0][2]?n(o[0][0],o[0][1]):function(i){return i===a||e(i,a,o)}}return W0=r,W0}var V0,pO;function EQ(){if(pO)return V0;pO=1;function e(t,n){return t!=null&&n in Object(t)}return V0=e,V0}var H0,hO;function PQ(){if(hO)return H0;hO=1;var e=x3(),t=XN(),n=Yr(),r=JN(),a=QN(),o=Tv();function i(c,d,f){d=e(d,c);for(var h=-1,p=d.length,g=!1;++h<p;){var x=o(d[h]);if(!(g=c!=null&&f(c,x)))break;c=c[x]}return g||++h!=p?g:(p=c==null?0:c.length,!!p&&a(p)&&r(x,p)&&(n(c)||t(c)))}return H0=i,H0}var K0,mO;function kQ(){if(mO)return K0;mO=1;var e=EQ(),t=PQ();function n(r,a){return r!=null&&t(r,a,e)}return K0=n,K0}var G0,vO;function TQ(){if(vO)return G0;vO=1;var e=ZN(),t=y3(),n=kQ(),r=MN(),a=Q3(),o=Z3(),i=Tv(),c=1,d=2;function f(h,p){return r(h)&&a(p)?o(i(h),p):function(g){var x=t(g,h);return x===void 0&&x===p?n(g,h):e(p,x,c|d)}}return G0=f,G0}var Y0,gO;function mu(){if(gO)return Y0;gO=1;function e(t){return t}return Y0=e,Y0}var X0,xO;function OQ(){if(xO)return X0;xO=1;function e(t){return function(n){return n?.[t]}}return X0=e,X0}var J0,yO;function RQ(){if(yO)return J0;yO=1;var e=zN();function t(n){return function(r){return e(r,n)}}return J0=t,J0}var Q0,bO;function IQ(){if(bO)return Q0;bO=1;var e=OQ(),t=RQ(),n=MN(),r=Tv();function a(o){return n(o)?e(r(o)):t(o)}return Q0=a,Q0}var Z0,wO;function Ms(){if(wO)return Z0;wO=1;var e=AQ(),t=TQ(),n=mu(),r=Yr(),a=IQ();function o(i){return typeof i=="function"?i:i==null?n:typeof i=="object"?r(i)?t(i[0],i[1]):e(i):a(i)}return Z0=o,Z0}var ew,jO;function eL(){if(jO)return ew;jO=1;function e(t,n,r,a){for(var o=t.length,i=r+(a?1:-1);a?i--:++i<o;)if(n(t[i],i,t))return i;return-1}return ew=e,ew}var tw,SO;function MQ(){if(SO)return tw;SO=1;function e(t){return t!==t}return tw=e,tw}var nw,NO;function $Q(){if(NO)return nw;NO=1;function e(t,n,r){for(var a=r-1,o=t.length;++a<o;)if(t[a]===n)return a;return-1}return nw=e,nw}var rw,CO;function DQ(){if(CO)return rw;CO=1;var e=eL(),t=MQ(),n=$Q();function r(a,o,i){return o===o?n(a,o,i):e(a,t,i)}return rw=r,rw}var aw,_O;function LQ(){if(_O)return aw;_O=1;var e=DQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return aw=t,aw}var sw,AO;function FQ(){if(AO)return sw;AO=1;function e(t,n,r){for(var a=-1,o=t==null?0:t.length;++a<o;)if(r(n,t[a]))return!0;return!1}return sw=e,sw}var ow,EO;function BQ(){if(EO)return ow;EO=1;function e(){}return ow=e,ow}var iw,PO;function zQ(){if(PO)return iw;PO=1;var e=J3(),t=BQ(),n=YN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(o){return new e(o)}:t;return iw=a,iw}var lw,kO;function UQ(){if(kO)return lw;kO=1;var e=U3(),t=LQ(),n=FQ(),r=W3(),a=zQ(),o=YN(),i=200;function c(d,f,h){var p=-1,g=t,x=d.length,j=!0,b=[],y=b;if(h)j=!1,g=n;else if(x>=i){var S=f?null:a(d);if(S)return o(S);j=!1,g=r,y=new e}else y=f?[]:b;e:for(;++p<x;){var C=d[p],N=f?f(C):C;if(C=h||C!==0?C:0,j&&N===N){for(var E=y.length;E--;)if(y[E]===N)continue e;f&&y.push(N),b.push(C)}else g(y,N,h)||(y!==b&&y.push(N),b.push(C))}return b}return lw=c,lw}var cw,TO;function qQ(){if(TO)return cw;TO=1;var e=Ms(),t=UQ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return cw=n,cw}var WQ=qQ();const OO=ln(WQ);function tL(e,t,n){return t===!0?OO(e,n):kt(t)?OO(e,t):e}function Ec(e){"@babel/helpers - typeof";return Ec=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},Ec(e)}var VQ=["ref"];function RO(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?RO(Object(n),!0).forEach(function(r){Dv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IO(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,rL(r.key),r)}}function KQ(e,t,n){return t&&IO(e.prototype,t),n&&IO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function GQ(e,t,n){return t=Qh(t),YQ(e,nL()?Reflect.construct(t,n||[],Qh(e).constructor):t.apply(e,n))}function YQ(e,t){if(t&&(Ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XQ(e)}function XQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nL=function(){return!!e})()}function Qh(e){return Qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qh(e)}function JQ(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 Dv(e,t,n){return t=rL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rL(e){var t=QQ(e,"string");return Ec(t)=="symbol"?t:t+""}function QQ(e,t){if(Ec(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ec(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ZQ(e,t){if(e==null)return{};var n=eZ(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eZ(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 tZ(e){return e.value}function nZ(e,t){if(Y.isValidElement(e))return Y.cloneElement(e,t);if(typeof e=="function")return Y.createElement(e,t);t.ref;var n=ZQ(t,VQ);return Y.createElement(GN,n)}var MO=1,Fi=(function(e){function t(){var n;HQ(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=GQ(this,t,[].concat(a)),Dv(n,"lastBoundingBox",{width:-1,height:-1}),n}return JQ(t,e),KQ(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)>MO||Math.abs(a.height-this.lastBoundingBox.height)>MO)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ks({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,o=a.layout,i=a.align,c=a.verticalAlign,d=a.margin,f=a.chartWidth,h=a.chartHeight,p,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(i==="center"&&o==="vertical"){var x=this.getBBoxSnapshot();p={left:((f||0)-x.width)/2}}else p=i==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var j=this.getBBoxSnapshot();g={top:((h||0)-j.height)/2}}else g=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Ks(Ks({},p),g)}},{key:"render",value:function(){var r=this,a=this.props,o=a.content,i=a.width,c=a.height,d=a.wrapperStyle,f=a.payloadUniqBy,h=a.payload,p=Ks(Ks({position:"absolute",width:i||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return Y.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(x){r.wrapperNode=x}},nZ(o,Ks(Ks({},this.props),{},{payload:tL(h,f,tZ)})))}}],[{key:"getWithHeight",value:function(r,a){var o=Ks(Ks({},this.defaultProps),r.props),i=o.layout;return i==="vertical"&&qe(r.props.height)?{height:r.props.height}:i==="horizontal"?{width:r.props.width||a}:null}}])})(m.PureComponent);Dv(Fi,"displayName","Legend");Dv(Fi,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var uw,$O;function rZ(){if($O)return uw;$O=1;var e=If(),t=XN(),n=Yr(),r=e?e.isConcatSpreadable:void 0;function a(o){return n(o)||t(o)||!!(r&&o&&o[r])}return uw=a,uw}var dw,DO;function aL(){if(DO)return dw;DO=1;var e=H3(),t=rZ();function n(r,a,o,i,c){var d=-1,f=r.length;for(o||(o=t),c||(c=[]);++d<f;){var h=r[d];a>0&&o(h)?a>1?n(h,a-1,o,i,c):e(c,h):i||(c[c.length]=h)}return c}return dw=n,dw}var fw,LO;function aZ(){if(LO)return fw;LO=1;function e(t){return function(n,r,a){for(var o=-1,i=Object(n),c=a(n),d=c.length;d--;){var f=c[t?d:++o];if(r(i[f],f,i)===!1)break}return n}}return fw=e,fw}var pw,FO;function sZ(){if(FO)return pw;FO=1;var e=aZ(),t=e();return pw=t,pw}var hw,BO;function sL(){if(BO)return hw;BO=1;var e=sZ(),t=$v();function n(r,a){return r&&e(r,a,t)}return hw=n,hw}var mw,zO;function oZ(){if(zO)return mw;zO=1;var e=$f();function t(n,r){return function(a,o){if(a==null)return a;if(!e(a))return n(a,o);for(var i=a.length,c=r?i:-1,d=Object(a);(r?c--:++c<i)&&o(d[c],c,d)!==!1;);return a}}return mw=t,mw}var vw,UO;function eC(){if(UO)return vw;UO=1;var e=sL(),t=oZ(),n=t(e);return vw=n,vw}var gw,qO;function oL(){if(qO)return gw;qO=1;var e=eC(),t=$f();function n(r,a){var o=-1,i=t(r)?Array(r.length):[];return e(r,function(c,d,f){i[++o]=a(c,d,f)}),i}return gw=n,gw}var xw,WO;function iZ(){if(WO)return xw;WO=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return xw=e,xw}var yw,VO;function lZ(){if(VO)return yw;VO=1;var e=fu();function t(n,r){if(n!==r){var a=n!==void 0,o=n===null,i=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||o&&d&&h||!a&&h||!i)return 1;if(!o&&!c&&!p&&n<r||p&&a&&i&&!o&&!c||f&&a&&i||!d&&i||!h)return-1}return 0}return yw=t,yw}var bw,HO;function cZ(){if(HO)return bw;HO=1;var e=lZ();function t(n,r,a){for(var o=-1,i=n.criteria,c=r.criteria,d=i.length,f=a.length;++o<d;){var h=e(i[o],c[o]);if(h){if(o>=f)return h;var p=a[o];return h*(p=="desc"?-1:1)}}return n.index-r.index}return bw=t,bw}var ww,KO;function uZ(){if(KO)return ww;KO=1;var e=BN(),t=zN(),n=Ms(),r=oL(),a=iZ(),o=G3(),i=cZ(),c=mu(),d=Yr();function f(h,p,g){p.length?p=e(p,function(b){return d(b)?function(y){return t(y,b.length===1?b[0]:b)}:b}):p=[c];var x=-1;p=e(p,o(n));var j=r(h,function(b,y,S){var C=e(p,function(N){return N(b)});return{criteria:C,index:++x,value:b}});return a(j,function(b,y){return i(b,y,g)})}return ww=f,ww}var jw,GO;function dZ(){if(GO)return jw;GO=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 jw=e,jw}var Sw,YO;function fZ(){if(YO)return Sw;YO=1;var e=dZ(),t=Math.max;function n(r,a,o){return a=t(a===void 0?r.length-1:a,0),function(){for(var i=arguments,c=-1,d=t(i.length-a,0),f=Array(d);++c<d;)f[c]=i[a+c];c=-1;for(var h=Array(a+1);++c<a;)h[c]=i[c];return h[a]=o(f),e(r,this,h)}}return Sw=n,Sw}var Nw,XO;function pZ(){if(XO)return Nw;XO=1;function e(t){return function(){return t}}return Nw=e,Nw}var Cw,JO;function iL(){if(JO)return Cw;JO=1;var e=ml(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Cw=t,Cw}var _w,QO;function hZ(){if(QO)return _w;QO=1;var e=pZ(),t=iL(),n=mu(),r=t?function(a,o){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:n;return _w=r,_w}var Aw,ZO;function mZ(){if(ZO)return Aw;ZO=1;var e=800,t=16,n=Date.now;function r(a){var o=0,i=0;return function(){var c=n(),d=t-(c-i);if(i=c,d>0){if(++o>=e)return arguments[0]}else o=0;return a.apply(void 0,arguments)}}return Aw=r,Aw}var Ew,eR;function vZ(){if(eR)return Ew;eR=1;var e=hZ(),t=mZ(),n=t(e);return Ew=n,Ew}var Pw,tR;function gZ(){if(tR)return Pw;tR=1;var e=mu(),t=fZ(),n=vZ();function r(a,o){return n(t(a,o,e),a+"")}return Pw=r,Pw}var kw,nR;function Lv(){if(nR)return kw;nR=1;var e=DN(),t=$f(),n=JN(),r=ai();function a(o,i,c){if(!r(c))return!1;var d=typeof i;return(d=="number"?t(c)&&n(i,c.length):d=="string"&&i in c)?e(c[i],o):!1}return kw=a,kw}var Tw,rR;function xZ(){if(rR)return Tw;rR=1;var e=aL(),t=uZ(),n=gZ(),r=Lv(),a=n(function(o,i){if(o==null)return[];var c=i.length;return c>1&&r(o,i[0],i[1])?i=[]:c>2&&r(i[0],i[1],i[2])&&(i=[i[0]]),t(o,e(i,1),[])});return Tw=a,Tw}var yZ=xZ();const tC=ln(yZ);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 OS(){return OS=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},OS.apply(this,arguments)}function bZ(e,t){return NZ(e)||SZ(e,t)||jZ(e,t)||wZ()}function wZ(){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 jZ(e,t){if(e){if(typeof e=="string")return aR(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 aR(e,t)}}function aR(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,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function NZ(e){if(Array.isArray(e))return e}function sR(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 Ow(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sR(Object(n),!0).forEach(function(r){CZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CZ(e,t,n){return t=_Z(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Z(e){var t=AZ(e,"string");return Fd(t)=="symbol"?t:t+""}function AZ(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 EZ(e){return Array.isArray(e)&&Zn(e[0])&&Zn(e[1])?e.join(" ~ "):e}var PZ=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,o=a===void 0?{}:a,i=t.itemStyle,c=i===void 0?{}:i,d=t.labelStyle,f=d===void 0?{}:d,h=t.payload,p=t.formatter,g=t.itemSorter,x=t.wrapperClassName,j=t.labelClassName,b=t.label,y=t.labelFormatter,S=t.accessibilityLayer,C=S===void 0?!1:S,N=function(){if(h&&h.length){var F={padding:0,margin:0},G=(g?tC(h,g):h).map(function(W,R){if(W.type==="none")return null;var M=Ow({display:"block",paddingTop:4,paddingBottom:4,color:W.color||"#000"},c),K=W.formatter||p||EZ,V=W.value,D=W.name,J=V,H=D;if(K&&J!=null&&H!=null){var I=K(V,D,W,R,h);if(Array.isArray(I)){var te=bZ(I,2);J=te[0],H=te[1]}else J=I}return Y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:M},Zn(H)?Y.createElement("span",{className:"recharts-tooltip-item-name"},H):null,Zn(H)?Y.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,Y.createElement("span",{className:"recharts-tooltip-item-value"},J),Y.createElement("span",{className:"recharts-tooltip-item-unit"},W.unit||""))});return Y.createElement("ul",{className:"recharts-tooltip-item-list",style:F},G)}return null},E=Ow({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),A=Ow({margin:0},f),k=!Tt(b),T=k?b:"",O=Ot("recharts-default-tooltip",x),L=Ot("recharts-tooltip-label",j);k&&y&&h!==void 0&&h!==null&&(T=y(b,h));var z=C?{role:"status","aria-live":"assertive"}:{};return Y.createElement("div",OS({className:O,style:E},z),Y.createElement("p",{className:L,style:A},Y.isValidElement(T)?T:"".concat(T)),N())};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 dh(e,t,n){return t=kZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kZ(e){var t=TZ(e,"string");return Bd(t)=="symbol"?t:t+""}function TZ(e,t){if(Bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var od="recharts-tooltip-wrapper",OZ={visibility:"hidden"};function RZ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ot(od,dh(dh(dh(dh({},"".concat(od,"-right"),qe(n)&&t&&qe(t.x)&&n>=t.x),"".concat(od,"-left"),qe(n)&&t&&qe(t.x)&&n<t.x),"".concat(od,"-bottom"),qe(r)&&t&&qe(t.y)&&r>=t.y),"".concat(od,"-top"),qe(r)&&t&&qe(t.y)&&r<t.y))}function oR(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,o=e.position,i=e.reverseDirection,c=e.tooltipDimension,d=e.viewBox,f=e.viewBoxDimension;if(o&&qe(o[r]))return o[r];var h=n[r]-c-a,p=n[r]+a;if(t[r])return i[r]?h:p;if(i[r]){var g=h,x=d[r];return g<x?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,b=d[r]+f;return j>b?Math.max(h,d[r]):Math.max(p,d[r])}function IZ(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 MZ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,o=e.reverseDirection,i=e.tooltipBox,c=e.useTranslate3d,d=e.viewBox,f,h,p;return i.height>0&&i.width>0&&n?(h=oR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:i.width,viewBox:d,viewBoxDimension:d.width}),p=oR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:i.height,viewBox:d,viewBoxDimension:d.height}),f=IZ({translateX:h,translateY:p,useTranslate3d:c})):f=OZ,{cssProperties:f,cssClasses:RZ({translateX:h,translateY:p,coordinate:n})}}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 iR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function lR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iR(Object(n),!0).forEach(function(r){IS(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DZ(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,cL(r.key),r)}}function LZ(e,t,n){return t&&DZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function FZ(e,t,n){return t=Zh(t),BZ(e,lL()?Reflect.construct(t,n||[],Zh(e).constructor):t.apply(e,n))}function BZ(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 zZ(e)}function zZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lL=function(){return!!e})()}function Zh(e){return Zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zh(e)}function UZ(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 IS(e,t,n){return t=cL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cL(e){var t=qZ(e,"string");return Pc(t)=="symbol"?t:t+""}function qZ(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 cR=1,WZ=(function(e){function t(){var n;$Z(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=FZ(this,t,[].concat(a)),IS(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),IS(n,"handleKeyDown",function(i){if(i.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 UZ(t,e),LZ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>cR||Math.abs(r.height-this.state.lastBoundingBox.height)>cR)&&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,o=a.active,i=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.children,h=a.coordinate,p=a.hasPayload,g=a.isAnimationActive,x=a.offset,j=a.position,b=a.reverseDirection,y=a.useTranslate3d,S=a.viewBox,C=a.wrapperStyle,N=MZ({allowEscapeViewBox:i,coordinate:h,offsetTopLeft:x,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:S}),E=N.cssClasses,A=N.cssProperties,k=lR(lR({transition:g&&o?"transform ".concat(c,"ms ").concat(d):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&p?"visible":"hidden",position:"absolute",top:0,left:0},C);return Y.createElement("div",{tabIndex:-1,className:E,style:k,ref:function(O){r.wrapperNode=O}},f)}}])})(m.PureComponent),VZ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},vl={isSsr:VZ()};function kc(e){"@babel/helpers - typeof";return kc=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},kc(e)}function uR(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 dR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uR(Object(n),!0).forEach(function(r){nC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function HZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KZ(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,dL(r.key),r)}}function GZ(e,t,n){return t&&KZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function YZ(e,t,n){return t=em(t),XZ(e,uL()?Reflect.construct(t,n||[],em(e).constructor):t.apply(e,n))}function XZ(e,t){if(t&&(kc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JZ(e)}function JZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uL=function(){return!!e})()}function em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},em(e)}function QZ(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 nC(e,t,n){return t=dL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dL(e){var t=ZZ(e,"string");return kc(t)=="symbol"?t:t+""}function ZZ(e,t){if(kc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function eee(e){return e.dataKey}function tee(e,t){return Y.isValidElement(e)?Y.cloneElement(e,t):typeof e=="function"?Y.createElement(e,t):Y.createElement(PZ,t)}var Br=(function(e){function t(){return HZ(this,t),YZ(this,t,arguments)}return QZ(t,e),GZ(t,[{key:"render",value:function(){var r=this,a=this.props,o=a.active,i=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.content,h=a.coordinate,p=a.filterNull,g=a.isAnimationActive,x=a.offset,j=a.payload,b=a.payloadUniqBy,y=a.position,S=a.reverseDirection,C=a.useTranslate3d,N=a.viewBox,E=a.wrapperStyle,A=j??[];p&&A.length&&(A=tL(j.filter(function(T){return T.value!=null&&(T.hide!==!0||r.props.includeHidden)}),b,eee));var k=A.length>0;return Y.createElement(WZ,{allowEscapeViewBox:i,animationDuration:c,animationEasing:d,isAnimationActive:g,active:o,coordinate:h,hasPayload:k,offset:x,position:y,reverseDirection:S,useTranslate3d:C,viewBox:N,wrapperStyle:E},tee(f,dR(dR({},this.props),{},{payload:A})))}}])})(m.PureComponent);nC(Br,"displayName","Tooltip");nC(Br,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!vl.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 Rw,fR;function nee(){if(fR)return Rw;fR=1;var e=Is(),t=function(){return e.Date.now()};return Rw=t,Rw}var Iw,pR;function ree(){if(pR)return Iw;pR=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Iw=t,Iw}var Mw,hR;function aee(){if(hR)return Mw;hR=1;var e=ree(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Mw=n,Mw}var $w,mR;function fL(){if(mR)return $w;mR=1;var e=aee(),t=ai(),n=fu(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^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=o.test(f);return p||i.test(f)?c(f.slice(2),p?2:8):a.test(f)?r:+f}return $w=d,$w}var Dw,vR;function see(){if(vR)return Dw;vR=1;var e=ai(),t=nee(),n=fL(),r="Expected a function",a=Math.max,o=Math.min;function i(c,d,f){var h,p,g,x,j,b,y=0,S=!1,C=!1,N=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,C="maxWait"in f,g=C?a(n(f.maxWait)||0,d):g,N="trailing"in f?!!f.trailing:N);function E(G){var W=h,R=p;return h=p=void 0,y=G,x=c.apply(R,W),x}function A(G){return y=G,j=setTimeout(O,d),S?E(G):x}function k(G){var W=G-b,R=G-y,M=d-W;return C?o(M,g-R):M}function T(G){var W=G-b,R=G-y;return b===void 0||W>=d||W<0||C&&R>=g}function O(){var G=t();if(T(G))return L(G);j=setTimeout(O,k(G))}function L(G){return j=void 0,N&&h?E(G):(h=p=void 0,x)}function z(){j!==void 0&&clearTimeout(j),y=0,h=b=p=j=void 0}function q(){return j===void 0?x:L(t())}function F(){var G=t(),W=T(G);if(h=arguments,p=this,b=G,W){if(j===void 0)return A(b);if(C)return clearTimeout(j),j=setTimeout(O,d),E(b)}return j===void 0&&(j=setTimeout(O,d)),x}return F.cancel=z,F.flush=q,F}return Dw=i,Dw}var Lw,gR;function oee(){if(gR)return Lw;gR=1;var e=see(),t=ai(),n="Expected a function";function r(a,o,i){var c=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(i)&&(c="leading"in i?!!i.leading:c,d="trailing"in i?!!i.trailing:d),e(a,o,{leading:c,maxWait:o,trailing:d})}return Lw=r,Lw}var iee=oee();const pL=ln(iee);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 xR(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 fh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xR(Object(n),!0).forEach(function(r){lee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lee(e,t,n){return t=cee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cee(e){var t=uee(e,"string");return zd(t)=="symbol"?t:t+""}function uee(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 dee(e,t){return mee(e)||hee(e,t)||pee(e,t)||fee()}function fee(){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 pee(e,t){if(e){if(typeof e=="string")return yR(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 yR(e,t)}}function yR(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 hee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function mee(e){if(Array.isArray(e))return e}var tm=m.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,o=e.width,i=o===void 0?"100%":o,c=e.height,d=c===void 0?"100%":c,f=e.minWidth,h=f===void 0?0:f,p=e.minHeight,g=e.maxHeight,x=e.children,j=e.debounce,b=j===void 0?0:j,y=e.id,S=e.className,C=e.onResize,N=e.style,E=N===void 0?{}:N,A=m.useRef(null),k=m.useRef();k.current=C,m.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 T=m.useState({containerWidth:a.width,containerHeight:a.height}),O=dee(T,2),L=O[0],z=O[1],q=m.useCallback(function(G,W){z(function(R){var M=Math.round(G),K=Math.round(W);return R.containerWidth===M&&R.containerHeight===K?R:{containerWidth:M,containerHeight:K}})},[]);m.useEffect(function(){var G=function(D){var J,H=D[0].contentRect,I=H.width,te=H.height;q(I,te),(J=k.current)===null||J===void 0||J.call(k,I,te)};b>0&&(G=pL(G,b,{trailing:!0,leading:!1}));var W=new ResizeObserver(G),R=A.current.getBoundingClientRect(),M=R.width,K=R.height;return q(M,K),W.observe(A.current),function(){W.disconnect()}},[q,b]);var F=m.useMemo(function(){var G=L.containerWidth,W=L.containerHeight;if(G<0||W<0)return null;to(Ii(i)||Ii(d),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
-
maybe you don't need to use a ResponsiveContainer.`,i,d),to(!n||n>0,"The aspect(%s) must be greater than zero.",n);var R=Ii(i)?G:i,M=Ii(d)?W:d;n&&n>0&&(R?M=R/n:M&&(R=M*n),g&&M>g&&(M=g)),to(R>0||M>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.`,R,M,i,d,h,p,n);var K=!Array.isArray(x)&&eo(x.type).endsWith("Chart");return Y.Children.map(x,function(V){return Y.isValidElement(V)?m.cloneElement(V,fh({width:R,height:M},K?{style:fh({height:"100%",width:"100%",maxHeight:M,maxWidth:R},V.props.style)}:{})):V})},[n,x,d,g,p,h,L,i]);return Y.createElement("div",{id:y?"".concat(y):void 0,className:Ot("recharts-responsive-container",S),style:fh(fh({},E),{},{width:i,height:d,minWidth:h,minHeight:p,maxHeight:g}),ref:A},F)}),Fv=function(t){return null};Fv.displayName="Cell";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 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 $S(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){vee(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 vee(e,t,n){return t=gee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gee(e){var t=xee(e,"string");return Ud(t)=="symbol"?t:t+""}function xee(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 Xl={widthCache:{},cacheCount:0},yee=2e3,bee={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},wR="recharts_measurement_span";function wee(e){var t=$S({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Sd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||vl.isSsr)return{width:0,height:0};var r=wee(n),a=JSON.stringify({text:t,copyStyle:r});if(Xl.widthCache[a])return Xl.widthCache[a];try{var o=document.getElementById(wR);o||(o=document.createElement("span"),o.setAttribute("id",wR),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var i=$S($S({},bee),r);Object.assign(o.style,i),o.textContent="".concat(t);var c=o.getBoundingClientRect(),d={width:c.width,height:c.height};return Xl.widthCache[a]=d,++Xl.cacheCount>yee&&(Xl.cacheCount=0,Xl.widthCache={}),d}catch{return{width:0,height:0}}},jee=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function qd(e){"@babel/helpers - typeof";return qd=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},qd(e)}function nm(e,t){return _ee(e)||Cee(e,t)||Nee(e,t)||See()}function See(){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 Nee(e,t){if(e){if(typeof e=="string")return jR(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 jR(e,t)}}function jR(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 Cee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function _ee(e){if(Array.isArray(e))return e}function Aee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SR(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,Pee(r.key),r)}}function Eee(e,t,n){return t&&SR(e.prototype,t),n&&SR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pee(e){var t=kee(e,"string");return qd(t)=="symbol"?t:t+""}function kee(e,t){if(qd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var NR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,CR=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Tee=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Oee=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,hL={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Ree=Object.keys(hL),ic="NaN";function Iee(e,t){return e*hL[t]}var ph=(function(){function e(t,n){Aee(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!Tee.test(n)&&(this.num=NaN,this.unit=""),Ree.includes(n)&&(this.num=Iee(t,n),this.unit="px")}return Eee(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=Oee.exec(n))!==null&&r!==void 0?r:[],o=nm(a,3),i=o[1],c=o[2];return new e(parseFloat(i),c??"")}}])})();function mL(e){if(e.includes(ic))return ic;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=NR.exec(t))!==null&&n!==void 0?n:[],a=nm(r,4),o=a[1],i=a[2],c=a[3],d=ph.parse(o??""),f=ph.parse(c??""),h=i==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return ic;t=t.replace(NR,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=CR.exec(t))!==null&&p!==void 0?p:[],x=nm(g,4),j=x[1],b=x[2],y=x[3],S=ph.parse(j??""),C=ph.parse(y??""),N=b==="+"?S.add(C):S.subtract(C);if(N.isNaN())return ic;t=t.replace(CR,N.toString())}return t}var _R=/\(([^()]*)\)/;function Mee(e){for(var t=e;t.includes("(");){var n=_R.exec(t),r=nm(n,2),a=r[1];t=t.replace(_R,mL(a))}return t}function $ee(e){var t=e.replace(/\s+/g,"");return t=Mee(t),t=mL(t),t}function Dee(e){try{return $ee(e)}catch{return ic}}function Fw(e){var t=Dee(e.slice(5,-1));return t===ic?"":t}var Lee=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Fee=["dx","dy","angle","className","breakAll"];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)}function AR(e,t){if(e==null)return{};var n=Bee(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Bee(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 ER(e,t){return Wee(e)||qee(e,t)||Uee(e,t)||zee()}function zee(){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 Uee(e,t){if(e){if(typeof e=="string")return PR(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 PR(e,t)}}function PR(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 qee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function Wee(e){if(Array.isArray(e))return e}var vL=/[ \f\n\r\t\v\u2028\u2029]+/,gL=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var o=[];Tt(n)||(r?o=n.toString().split(""):o=n.toString().split(vL));var i=o.map(function(d){return{word:d,width:Sd(d,a).width}}),c=r?0:Sd(" ",a).width;return{wordsWithComputedWidth:i,spaceWidth:c}}catch{return null}},Vee=function(t,n,r,a,o){var i=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=qe(i),p=c,g=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return R.reduce(function(M,K){var V=K.word,D=K.width,J=M[M.length-1];if(J&&(a==null||o||J.width+D+r<Number(a)))J.words.push(V),J.width+=D+r;else{var H={words:[V],width:D};M.push(H)}return M},[])},x=g(n),j=function(R){return R.reduce(function(M,K){return M.width>K.width?M:K})};if(!h)return x;for(var b="…",y=function(R){var M=p.slice(0,R),K=gL({breakAll:f,style:d,children:M+b}).wordsWithComputedWidth,V=g(K),D=V.length>i||j(V).width>Number(a);return[D,V]},S=0,C=p.length-1,N=0,E;S<=C&&N<=p.length-1;){var A=Math.floor((S+C)/2),k=A-1,T=y(k),O=ER(T,2),L=O[0],z=O[1],q=y(A),F=ER(q,1),G=F[0];if(!L&&!G&&(S=A+1),L&&G&&(C=A-1),!L&&G){E=z;break}N++}return E||x},kR=function(t){var n=Tt(t)?[]:t.toString().split(vL);return[{words:n}]},Hee=function(t){var n=t.width,r=t.scaleToFit,a=t.children,o=t.style,i=t.breakAll,c=t.maxLines;if((n||r)&&!vl.isSsr){var d,f,h=gL({breakAll:i,children:a,style:o});if(h){var p=h.wordsWithComputedWidth,g=h.spaceWidth;d=p,f=g}else return kR(a);return Vee({breakAll:i,children:a,maxLines:c,style:o},d,f,n,r)}return kR(a)},TR="#808080",Xi=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,i=t.lineHeight,c=i===void 0?"1em":i,d=t.capHeight,f=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,g=t.textAnchor,x=g===void 0?"start":g,j=t.verticalAnchor,b=j===void 0?"end":j,y=t.fill,S=y===void 0?TR:y,C=AR(t,Lee),N=m.useMemo(function(){return Hee({breakAll:C.breakAll,children:C.children,maxLines:C.maxLines,scaleToFit:p,style:C.style,width:C.width})},[C.breakAll,C.children,C.maxLines,p,C.style,C.width]),E=C.dx,A=C.dy,k=C.angle,T=C.className,O=C.breakAll,L=AR(C,Fee);if(!Zn(r)||!Zn(o))return null;var z=r+(qe(E)?E:0),q=o+(qe(A)?A:0),F;switch(b){case"start":F=Fw("calc(".concat(f,")"));break;case"middle":F=Fw("calc(".concat((N.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:F=Fw("calc(".concat(N.length-1," * -").concat(c,")"));break}var G=[];if(p){var W=N[0].width,R=C.width;G.push("scale(".concat((qe(R)?R/W:1)/W,")"))}return k&&G.push("rotate(".concat(k,", ").concat(z,", ").concat(q,")")),G.length&&(L.transform=G.join(" ")),Y.createElement("text",DS({},yt(L,!0),{x:z,y:q,className:Ot("recharts-text",T),textAnchor:x,fill:S.includes("url")?TR:S}),N.map(function(M,K){var V=M.words.join(O?"":" ");return Y.createElement("tspan",{x:z,dy:K===0?F:c,key:"".concat(V,"-").concat(K)},V)}))};function Go(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Kee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function rC(e){let t,n,r;e.length!==2?(t=Go,n=(c,d)=>Go(e(c),d),r=(c,d)=>e(c)-d):(t=e===Go||e===Kee?e:Gee,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 o(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){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:i,right:o}}function Gee(){return 0}function xL(e){return e===null?NaN:+e}function*Yee(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Xee=rC(Go),Df=Xee.right;rC(xL).center;class OR extends Map{constructor(t,n=Zee){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(RR(this,t))}has(t){return super.has(RR(this,t))}set(t,n){return super.set(Jee(this,t),n)}delete(t){return super.delete(Qee(this,t))}}function RR({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Jee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Qee({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Zee(e){return e!==null&&typeof e=="object"?e.valueOf():e}function ete(e=Go){if(e===Go)return yL;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 yL(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const tte=Math.sqrt(50),nte=Math.sqrt(10),rte=Math.sqrt(2);function rm(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),o=r/Math.pow(10,a),i=o>=tte?10:o>=nte?5:o>=rte?2:1;let c,d,f;return a<0?(f=Math.pow(10,-a)/i,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)*i,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?rm(e,t,n*2):[c,d,f]}function LS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,o,i]=r?rm(t,e,n):rm(e,t,n);if(!(o>=a))return[];const c=o-a+1,d=new Array(c);if(r)if(i<0)for(let f=0;f<c;++f)d[f]=(o-f)/-i;else for(let f=0;f<c;++f)d[f]=(o-f)*i;else if(i<0)for(let f=0;f<c;++f)d[f]=(a+f)/-i;else for(let f=0;f<c;++f)d[f]=(a+f)*i;return d}function FS(e,t,n){return t=+t,e=+e,n=+n,rm(e,t,n)[2]}function BS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?FS(t,e,n):FS(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function IR(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function MR(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function bL(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?yL:ete(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),x=Math.max(n,Math.floor(t-f*p/d+g)),j=Math.min(r,Math.floor(t+(d-f)*p/d+g));bL(e,t,x,j,a)}const o=e[t];let i=n,c=r;for(id(e,n,t),a(e[r],o)>0&&id(e,n,r);i<c;){for(id(e,i,c),++i,--c;a(e[i],o)<0;)++i;for(;a(e[c],o)>0;)--c}a(e[n],o)===0?id(e,n,c):(++c,id(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function id(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ate(e,t,n){if(e=Float64Array.from(Yee(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return MR(e);if(t>=1)return IR(e);var r,a=(r-1)*t,o=Math.floor(a),i=IR(bL(e,o).subarray(0,o+1)),c=MR(e.subarray(o+1));return i+(c-i)*(a-o)}}function ste(e,t,n=xL){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,o=Math.floor(a),i=+n(e[o],o,e),c=+n(e[o+1],o+1,e);return i+(c-i)*(a-o)}}function ote(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,o=new Array(a);++r<a;)o[r]=e+r*n;return o}function Ma(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function mo(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 zS=Symbol("implicit");function aC(){var e=new OR,t=[],n=[],r=zS;function a(o){let i=e.get(o);if(i===void 0){if(r!==zS)return r;e.set(o,i=t.push(o)-1)}return n[i%n.length]}return a.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new OR;for(const i of o)e.has(i)||e.set(i,t.push(i)-1);return a},a.range=function(o){return arguments.length?(n=Array.from(o),a):n.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.copy=function(){return aC(t,n).unknown(r)},Ma.apply(a,arguments),a}function Wd(){var e=aC().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,o,i,c=!1,d=0,f=0,h=.5;delete e.unknown;function p(){var g=t().length,x=a<r,j=x?a:r,b=x?r:a;o=(b-j)/Math.max(1,g-d+f*2),c&&(o=Math.floor(o)),j+=(b-j-o*(g-d))*h,i=o*(1-d),c&&(j=Math.round(j),i=Math.round(i));var y=ote(g).map(function(S){return j+o*S});return n(x?y.reverse():y)}return e.domain=function(g){return arguments.length?(t(g),p()):t()},e.range=function(g){return arguments.length?([r,a]=g,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(g){return[r,a]=g,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return i},e.step=function(){return o},e.round=function(g){return arguments.length?(c=!!g,p()):c},e.padding=function(g){return arguments.length?(d=Math.min(1,f=+g),p()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),p()):d},e.paddingOuter=function(g){return arguments.length?(f=+g,p()):f},e.align=function(g){return arguments.length?(h=Math.max(0,Math.min(1,g)),p()):h},e.copy=function(){return Wd(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},Ma.apply(p(),arguments)}function wL(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return wL(t())},e}function Nd(){return wL(Wd.apply(null,arguments).paddingInner(1))}function sC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function jL(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Lf(){}var Vd=.7,am=1/Vd,xc="\\s*([+-]?\\d+)\\s*",Hd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",js="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ite=/^#([0-9a-f]{3,8})$/,lte=new RegExp(`^rgb\\(${xc},${xc},${xc}\\)$`),cte=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),ute=new RegExp(`^rgba\\(${xc},${xc},${xc},${Hd}\\)$`),dte=new RegExp(`^rgba\\(${js},${js},${js},${Hd}\\)$`),fte=new RegExp(`^hsl\\(${Hd},${js},${js}\\)$`),pte=new RegExp(`^hsla\\(${Hd},${js},${js},${Hd}\\)$`),$R={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};sC(Lf,Kd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:DR,formatHex:DR,formatHex8:hte,formatHsl:mte,formatRgb:LR,toString:LR});function DR(){return this.rgb().formatHex()}function hte(){return this.rgb().formatHex8()}function mte(){return SL(this).formatHsl()}function LR(){return this.rgb().formatRgb()}function Kd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ite.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?FR(t):n===3?new Hr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?hh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?hh(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=lte.exec(e))?new Hr(t[1],t[2],t[3],1):(t=cte.exec(e))?new Hr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ute.exec(e))?hh(t[1],t[2],t[3],t[4]):(t=dte.exec(e))?hh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=fte.exec(e))?UR(t[1],t[2]/100,t[3]/100,1):(t=pte.exec(e))?UR(t[1],t[2]/100,t[3]/100,t[4]):$R.hasOwnProperty(e)?FR($R[e]):e==="transparent"?new Hr(NaN,NaN,NaN,0):null}function FR(e){return new Hr(e>>16&255,e>>8&255,e&255,1)}function hh(e,t,n,r){return r<=0&&(e=t=n=NaN),new Hr(e,t,n,r)}function vte(e){return e instanceof Lf||(e=Kd(e)),e?(e=e.rgb(),new Hr(e.r,e.g,e.b,e.opacity)):new Hr}function US(e,t,n,r){return arguments.length===1?vte(e):new Hr(e,t,n,r??1)}function Hr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}sC(Hr,US,jL(Lf,{brighter(e){return e=e==null?am:Math.pow(am,e),new Hr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vd:Math.pow(Vd,e),new Hr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Hr(Bi(this.r),Bi(this.g),Bi(this.b),sm(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:BR,formatHex:BR,formatHex8:gte,formatRgb:zR,toString:zR}));function BR(){return`#${Mi(this.r)}${Mi(this.g)}${Mi(this.b)}`}function gte(){return`#${Mi(this.r)}${Mi(this.g)}${Mi(this.b)}${Mi((isNaN(this.opacity)?1:this.opacity)*255)}`}function zR(){const e=sm(this.opacity);return`${e===1?"rgb(":"rgba("}${Bi(this.r)}, ${Bi(this.g)}, ${Bi(this.b)}${e===1?")":`, ${e})`}`}function sm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mi(e){return e=Bi(e),(e<16?"0":"")+e.toString(16)}function UR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qa(e,t,n,r)}function SL(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof Lf||(e=Kd(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,c=o-a,d=(o+a)/2;return c?(t===o?i=(n-r)/c+(n<r)*6:n===o?i=(r-t)/c+2:i=(t-n)/c+4,c/=d<.5?o+a:2-o-a,i*=60):c=d>0&&d<1?0:i,new Qa(i,c,d,e.opacity)}function xte(e,t,n,r){return arguments.length===1?SL(e):new Qa(e,t,n,r??1)}function Qa(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sC(Qa,xte,jL(Lf,{brighter(e){return e=e==null?am:Math.pow(am,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vd:Math.pow(Vd,e),new Qa(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 Hr(Bw(e>=240?e-240:e+120,a,r),Bw(e,a,r),Bw(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Qa(qR(this.h),mh(this.s),mh(this.l),sm(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=sm(this.opacity);return`${e===1?"hsl(":"hsla("}${qR(this.h)}, ${mh(this.s)*100}%, ${mh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qR(e){return e=(e||0)%360,e<0?e+360:e}function mh(e){return Math.max(0,Math.min(1,e||0))}function Bw(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 oC=e=>()=>e;function yte(e,t){return function(n){return e+n*t}}function bte(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 wte(e){return(e=+e)==1?NL:function(t,n){return n-t?bte(t,n,e):oC(isNaN(t)?n:t)}}function NL(e,t){var n=t-e;return n?yte(e,n):oC(isNaN(e)?t:e)}const WR=(function e(t){var n=wte(t);function r(a,o){var i=n((a=US(a)).r,(o=US(o)).r),c=n(a.g,o.g),d=n(a.b,o.b),f=NL(a.opacity,o.opacity);return function(h){return a.r=i(h),a.g=c(h),a.b=d(h),a.opacity=f(h),a+""}}return r.gamma=e,r})(1);function jte(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(o){for(a=0;a<n;++a)r[a]=e[a]*(1-o)+t[a]*o;return r}}function Ste(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Nte(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),o=new Array(n),i;for(i=0;i<r;++i)a[i]=vu(e[i],t[i]);for(;i<n;++i)o[i]=t[i];return function(c){for(i=0;i<r;++i)o[i]=a[i](c);return o}}function Cte(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function om(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function _te(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]=vu(e[a],t[a]):r[a]=t[a];return function(o){for(a in n)r[a]=n[a](o);return r}}var qS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zw=new RegExp(qS.source,"g");function Ate(e){return function(){return e}}function Ete(e){return function(t){return e(t)+""}}function Pte(e,t){var n=qS.lastIndex=zw.lastIndex=0,r,a,o,i=-1,c=[],d=[];for(e=e+"",t=t+"";(r=qS.exec(e))&&(a=zw.exec(t));)(o=a.index)>n&&(o=t.slice(n,o),c[i]?c[i]+=o:c[++i]=o),(r=r[0])===(a=a[0])?c[i]?c[i]+=a:c[++i]=a:(c[++i]=null,d.push({i,x:om(r,a)})),n=zw.lastIndex;return n<t.length&&(o=t.slice(n),c[i]?c[i]+=o:c[++i]=o),c.length<2?d[0]?Ete(d[0].x):Ate(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 vu(e,t){var n=typeof t,r;return t==null||n==="boolean"?oC(t):(n==="number"?om:n==="string"?(r=Kd(t))?(t=r,WR):Pte:t instanceof Kd?WR:t instanceof Date?Cte:Ste(t)?jte:Array.isArray(t)?Nte:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?_te:om)(e,t)}function iC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function kte(e,t){t===void 0&&(t=e,e=vu);for(var n=0,r=t.length-1,a=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(a,a=t[++n]);return function(i){var c=Math.max(0,Math.min(r-1,Math.floor(i*=r)));return o[c](i-c)}}function Tte(e){return function(){return e}}function im(e){return+e}var VR=[0,1];function Er(e){return e}function WS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Tte(isNaN(t)?NaN:.5)}function Ote(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Rte(e,t,n){var r=e[0],a=e[1],o=t[0],i=t[1];return a<r?(r=WS(a,r),o=n(i,o)):(r=WS(r,a),o=n(o,i)),function(c){return o(r(c))}}function Ite(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),o=new Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)a[i]=WS(e[i],e[i+1]),o[i]=n(t[i],t[i+1]);return function(c){var d=Df(e,c,1,r)-1;return o[d](a[d](c))}}function Ff(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Bv(){var e=VR,t=VR,n=vu,r,a,o,i=Er,c,d,f;function h(){var g=Math.min(e.length,t.length);return i!==Er&&(i=Ote(e[0],e[g-1])),c=g>2?Ite:Rte,d=f=null,p}function p(g){return g==null||isNaN(g=+g)?o:(d||(d=c(e.map(r),t,n)))(r(i(g)))}return p.invert=function(g){return i(a((f||(f=c(t,e.map(r),om)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,im),h()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),h()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=iC,h()},p.clamp=function(g){return arguments.length?(i=g?!0:Er,h()):i!==Er},p.interpolate=function(g){return arguments.length?(n=g,h()):n},p.unknown=function(g){return arguments.length?(o=g,p):o},function(g,x){return r=g,a=x,h()}}function lC(){return Bv()(Er,Er)}function Mte(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function lm(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 Tc(e){return e=lm(Math.abs(e)),e?e[1]:NaN}function $te(e,t){return function(n,r){for(var a=n.length,o=[],i=0,c=e[0],d=0;a>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),o.push(n.substring(a-=c,a+c)),!((d+=c+1)>r));)c=e[i=(i+1)%e.length];return o.reverse().join(t)}}function Dte(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Lte=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Gd(e){if(!(t=Lte.exec(e)))throw new Error("invalid format: "+e);var t;return new cC({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]})}Gd.prototype=cC.prototype;function cC(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+""}cC.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 Fte(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 cm;function Bte(e,t){var n=lm(e,t);if(!n)return cm=void 0,e.toPrecision(t);var r=n[0],a=n[1],o=a-(cm=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,i=r.length;return o===i?r:o>i?r+new Array(o-i+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+lm(e,Math.max(0,t+o-1))[0]}function HR(e,t){var n=lm(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 KR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Mte,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)=>HR(e*100,t),r:HR,s:Bte,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function GR(e){return e}var YR=Array.prototype.map,XR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zte(e){var t=e.grouping===void 0||e.thousands===void 0?GR:$te(YR.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+"",o=e.numerals===void 0?GR:Dte(YR.call(e.numerals,String)),i=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p,g){p=Gd(p);var x=p.fill,j=p.align,b=p.sign,y=p.symbol,S=p.zero,C=p.width,N=p.comma,E=p.precision,A=p.trim,k=p.type;k==="n"?(N=!0,k="g"):KR[k]||(E===void 0&&(E=12),A=!0,k="g"),(S||x==="0"&&j==="=")&&(S=!0,x="0",j="=");var T=(g&&g.prefix!==void 0?g.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(k)?"0"+k.toLowerCase():""),O=(y==="$"?r:/[%p]/.test(k)?i:"")+(g&&g.suffix!==void 0?g.suffix:""),L=KR[k],z=/[defgprs%]/.test(k);E=E===void 0?6:/[gprs]/.test(k)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function q(F){var G=T,W=O,R,M,K;if(k==="c")W=L(F)+W,F="";else{F=+F;var V=F<0||1/F<0;if(F=isNaN(F)?d:L(Math.abs(F),E),A&&(F=Fte(F)),V&&+F==0&&b!=="+"&&(V=!1),G=(V?b==="("?b:c:b==="-"||b==="("?"":b)+G,W=(k==="s"&&!isNaN(F)&&cm!==void 0?XR[8+cm/3]:"")+W+(V&&b==="("?")":""),z){for(R=-1,M=F.length;++R<M;)if(K=F.charCodeAt(R),48>K||K>57){W=(K===46?a+F.slice(R+1):F.slice(R))+W,F=F.slice(0,R);break}}}N&&!S&&(F=t(F,1/0));var D=G.length+F.length+W.length,J=D<C?new Array(C-D+1).join(x):"";switch(N&&S&&(F=t(J+F,J.length?C-W.length:1/0),J=""),j){case"<":F=G+F+W+J;break;case"=":F=G+J+F+W;break;case"^":F=J.slice(0,D=J.length>>1)+G+F+W+J.slice(D);break;default:F=J+G+F+W;break}return o(F)}return q.toString=function(){return p+""},q}function h(p,g){var x=Math.max(-8,Math.min(8,Math.floor(Tc(g)/3)))*3,j=Math.pow(10,-x),b=f((p=Gd(p),p.type="f",p),{suffix:XR[8+x/3]});return function(y){return b(j*y)}}return{format:f,formatPrefix:h}}var vh,uC,CL;Ute({thousands:",",grouping:[3],currency:["$",""]});function Ute(e){return vh=zte(e),uC=vh.format,CL=vh.formatPrefix,vh}function qte(e){return Math.max(0,-Tc(Math.abs(e)))}function Wte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Tc(t)/3)))*3-Tc(Math.abs(e)))}function Vte(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Tc(t)-Tc(e))+1}function _L(e,t,n,r){var a=BS(e,t,n),o;switch(r=Gd(r??",f"),r.type){case"s":{var i=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=Wte(a,i))&&(r.precision=o),CL(r,i)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Vte(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=qte(a))&&(r.precision=o-(r.type==="%")*2);break}}return uC(r)}function si(e){var t=e.domain;return e.ticks=function(n){var r=t();return LS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return _L(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,o=r.length-1,i=r[a],c=r[o],d,f,h=10;for(c<i&&(f=i,i=c,c=f,f=a,a=o,o=f);h-- >0;){if(f=FS(i,c,n),f===d)return r[a]=i,r[o]=c,t(r);if(f>0)i=Math.floor(i/f)*f,c=Math.ceil(c/f)*f;else if(f<0)i=Math.ceil(i*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function um(){var e=lC();return e.copy=function(){return Ff(e,um())},Ma.apply(e,arguments),si(e)}function AL(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,im),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return AL(e).unknown(t)},e=arguments.length?Array.from(e,im):[0,1],si(n)}function EL(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],o=e[r],i;return o<a&&(i=n,n=r,r=i,i=a,a=o,o=i),e[n]=t.floor(a),e[r]=t.ceil(o),e}function JR(e){return Math.log(e)}function QR(e){return Math.exp(e)}function Hte(e){return-Math.log(-e)}function Kte(e){return-Math.exp(-e)}function Gte(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Yte(e){return e===10?Gte:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Xte(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 ZR(e){return(t,n)=>-e(-t,n)}function dC(e){const t=e(JR,QR),n=t.domain;let r=10,a,o;function i(){return a=Xte(r),o=Yte(r),n()[0]<0?(a=ZR(a),o=ZR(o),e(Hte,Kte)):e(JR,QR),t}return t.base=function(c){return arguments.length?(r=+c,i()):r},t.domain=function(c){return arguments.length?(n(c),i()):n()},t.ticks=c=>{const d=n();let f=d[0],h=d[d.length-1];const p=h<f;p&&([f,h]=[h,f]);let g=a(f),x=a(h),j,b;const y=c==null?10:+c;let S=[];if(!(r%1)&&x-g<y){if(g=Math.floor(g),x=Math.ceil(x),f>0){for(;g<=x;++g)for(j=1;j<r;++j)if(b=g<0?j/o(-g):j*o(g),!(b<f)){if(b>h)break;S.push(b)}}else for(;g<=x;++g)for(j=r-1;j>=1;--j)if(b=g>0?j/o(-g):j*o(g),!(b<f)){if(b>h)break;S.push(b)}S.length*2<y&&(S=LS(f,h,y))}else S=LS(g,x,Math.min(x-g,y)).map(o);return p?S.reverse():S},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Gd(d)).precision==null&&(d.trim=!0),d=uC(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return h=>{let p=h/o(Math.round(a(h)));return p*r<r-.5&&(p*=r),p<=f?d(h):""}},t.nice=()=>n(EL(n(),{floor:c=>o(Math.floor(a(c))),ceil:c=>o(Math.ceil(a(c)))})),t}function PL(){const e=dC(Bv()).domain([1,10]);return e.copy=()=>Ff(e,PL()).base(e.base()),Ma.apply(e,arguments),e}function e2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function t2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function fC(e){var t=1,n=e(e2(t),t2(t));return n.constant=function(r){return arguments.length?e(e2(t=+r),t2(t)):t},si(n)}function kL(){var e=fC(Bv());return e.copy=function(){return Ff(e,kL()).constant(e.constant())},Ma.apply(e,arguments)}function n2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Jte(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Qte(e){return e<0?-e*e:e*e}function pC(e){var t=e(Er,Er),n=1;function r(){return n===1?e(Er,Er):n===.5?e(Jte,Qte):e(n2(n),n2(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},si(t)}function hC(){var e=pC(Bv());return e.copy=function(){return Ff(e,hC()).exponent(e.exponent())},Ma.apply(e,arguments),e}function Zte(){return hC.apply(null,arguments).exponent(.5)}function r2(e){return Math.sign(e)*e*e}function ene(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function TL(){var e=lC(),t=[0,1],n=!1,r;function a(o){var i=ene(e(o));return isNaN(i)?r:n?Math.round(i):i}return a.invert=function(o){return e.invert(r2(o))},a.domain=function(o){return arguments.length?(e.domain(o),a):e.domain()},a.range=function(o){return arguments.length?(e.range((t=Array.from(o,im)).map(r2)),a):t.slice()},a.rangeRound=function(o){return a.range(o).round(!0)},a.round=function(o){return arguments.length?(n=!!o,a):n},a.clamp=function(o){return arguments.length?(e.clamp(o),a):e.clamp()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.copy=function(){return TL(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Ma.apply(a,arguments),si(a)}function OL(){var e=[],t=[],n=[],r;function a(){var i=0,c=Math.max(1,t.length);for(n=new Array(c-1);++i<c;)n[i-1]=ste(e,i/c);return o}function o(i){return i==null||isNaN(i=+i)?r:t[Df(n,i)]}return o.invertExtent=function(i){var c=t.indexOf(i);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},o.domain=function(i){if(!arguments.length)return e.slice();e=[];for(let c of i)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Go),a()},o.range=function(i){return arguments.length?(t=Array.from(i),a()):t.slice()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return OL().domain(e).range(t).unknown(r)},Ma.apply(o,arguments)}function RL(){var e=0,t=1,n=1,r=[.5],a=[0,1],o;function i(d){return d!=null&&d<=d?a[Df(r,d,0,n)]:o}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return i}return i.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},i.range=function(d){return arguments.length?(n=(a=Array.from(d)).length-1,c()):a.slice()},i.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]]},i.unknown=function(d){return arguments.length&&(o=d),i},i.thresholds=function(){return r.slice()},i.copy=function(){return RL().domain([e,t]).range(a).unknown(o)},Ma.apply(si(i),arguments)}function IL(){var e=[.5],t=[0,1],n,r=1;function a(o){return o!=null&&o<=o?t[Df(e,o,0,r)]:n}return a.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(o){var i=t.indexOf(o);return[e[i-1],e[i]]},a.unknown=function(o){return arguments.length?(n=o,a):n},a.copy=function(){return IL().domain(e).range(t).unknown(n)},Ma.apply(a,arguments)}const Uw=new Date,qw=new Date;function nr(e,t,n,r){function a(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return a.floor=o=>(e(o=new Date(+o)),o),a.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),a.round=o=>{const i=a(o),c=a.ceil(o);return o-i<c-o?i:c},a.offset=(o,i)=>(t(o=new Date(+o),i==null?1:Math.floor(i)),o),a.range=(o,i,c)=>{const d=[];if(o=a.ceil(o),c=c==null?1:Math.floor(c),!(o<i)||!(c>0))return d;let f;do d.push(f=new Date(+o)),t(o,c),e(o);while(f<o&&o<i);return d},a.filter=o=>nr(i=>{if(i>=i)for(;e(i),!o(i);)i.setTime(i-1)},(i,c)=>{if(i>=i)if(c<0)for(;++c<=0;)for(;t(i,-1),!o(i););else for(;--c>=0;)for(;t(i,1),!o(i););}),n&&(a.count=(o,i)=>(Uw.setTime(+o),qw.setTime(+i),e(Uw),e(qw),Math.floor(n(Uw,qw))),a.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?a.filter(r?i=>r(i)%o===0:i=>a.count(0,i)%o===0):a)),a}const dm=nr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);dm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?nr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):dm);dm.range;const Js=1e3,Pa=Js*60,Qs=Pa*60,io=Qs*24,mC=io*7,a2=io*30,Ww=io*365,$i=nr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Js)},(e,t)=>(t-e)/Js,e=>e.getUTCSeconds());$i.range;const vC=nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Js)},(e,t)=>{e.setTime(+e+t*Pa)},(e,t)=>(t-e)/Pa,e=>e.getMinutes());vC.range;const gC=nr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Pa)},(e,t)=>(t-e)/Pa,e=>e.getUTCMinutes());gC.range;const xC=nr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Js-e.getMinutes()*Pa)},(e,t)=>{e.setTime(+e+t*Qs)},(e,t)=>(t-e)/Qs,e=>e.getHours());xC.range;const yC=nr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Qs)},(e,t)=>(t-e)/Qs,e=>e.getUTCHours());yC.range;const Bf=nr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Pa)/io,e=>e.getDate()-1);Bf.range;const zv=nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/io,e=>e.getUTCDate()-1);zv.range;const ML=nr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/io,e=>Math.floor(e/io));ML.range;function gl(e){return nr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Pa)/mC)}const Uv=gl(0),fm=gl(1),tne=gl(2),nne=gl(3),Oc=gl(4),rne=gl(5),ane=gl(6);Uv.range;fm.range;tne.range;nne.range;Oc.range;rne.range;ane.range;function xl(e){return nr(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)/mC)}const qv=xl(0),pm=xl(1),sne=xl(2),one=xl(3),Rc=xl(4),ine=xl(5),lne=xl(6);qv.range;pm.range;sne.range;one.range;Rc.range;ine.range;lne.range;const bC=nr(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());bC.range;const wC=nr(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());wC.range;const lo=nr(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());lo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nr(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)});lo.range;const co=nr(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());co.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:nr(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)});co.range;function $L(e,t,n,r,a,o){const i=[[$i,1,Js],[$i,5,5*Js],[$i,15,15*Js],[$i,30,30*Js],[o,1,Pa],[o,5,5*Pa],[o,15,15*Pa],[o,30,30*Pa],[a,1,Qs],[a,3,3*Qs],[a,6,6*Qs],[a,12,12*Qs],[r,1,io],[r,2,2*io],[n,1,mC],[t,1,a2],[t,3,3*a2],[e,1,Ww]];function c(f,h,p){const g=h<f;g&&([f,h]=[h,f]);const x=p&&typeof p.range=="function"?p:d(f,h,p),j=x?x.range(f,+h+1):[];return g?j.reverse():j}function d(f,h,p){const g=Math.abs(h-f)/p,x=rC(([,,y])=>y).right(i,g);if(x===i.length)return e.every(BS(f/Ww,h/Ww,p));if(x===0)return dm.every(Math.max(BS(f,h,p),1));const[j,b]=i[g/i[x-1][2]<i[x][2]/g?x-1:x];return j.every(b)}return[c,d]}const[cne,une]=$L(co,wC,qv,ML,yC,gC),[dne,fne]=$L(lo,bC,Uv,Bf,xC,vC);function Vw(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Hw(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 ld(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function pne(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,o=e.days,i=e.shortDays,c=e.months,d=e.shortMonths,f=cd(a),h=ud(a),p=cd(o),g=ud(o),x=cd(i),j=ud(i),b=cd(c),y=ud(c),S=cd(d),C=ud(d),N={a:K,A:V,b:D,B:J,c:null,d:u2,e:u2,f:$ne,g:Hne,G:Gne,H:Rne,I:Ine,j:Mne,L:DL,m:Dne,M:Lne,p:H,q:I,Q:p2,s:h2,S:Fne,u:Bne,U:zne,V:Une,w:qne,W:Wne,x:null,X:null,y:Vne,Y:Kne,Z:Yne,"%":f2},E={a:te,A:de,b:fe,B:me,c:null,d:d2,e:d2,f:Zne,g:cre,G:dre,H:Xne,I:Jne,j:Qne,L:FL,m:ere,M:tre,p:U,q:oe,Q:p2,s:h2,S:nre,u:rre,U:are,V:sre,w:ore,W:ire,x:null,X:null,y:lre,Y:ure,Z:fre,"%":f2},A={a:z,A:q,b:F,B:G,c:W,d:l2,e:l2,f:Pne,g:i2,G:o2,H:c2,I:c2,j:Cne,L:Ene,m:Nne,M:_ne,p:L,q:Sne,Q:Tne,s:One,S:Ane,u:xne,U:yne,V:bne,w:gne,W:wne,x:R,X:M,y:i2,Y:o2,Z:jne,"%":kne};N.x=k(n,N),N.X=k(r,N),N.c=k(t,N),E.x=k(n,E),E.X=k(r,E),E.c=k(t,E);function k(re,ne){return function(ve){var le=[],Ae=-1,be=0,We=re.length,B,ie,he;for(ve instanceof Date||(ve=new Date(+ve));++Ae<We;)re.charCodeAt(Ae)===37&&(le.push(re.slice(be,Ae)),(ie=s2[B=re.charAt(++Ae)])!=null?B=re.charAt(++Ae):ie=B==="e"?" ":"0",(he=ne[B])&&(B=he(ve,ie)),le.push(B),be=Ae+1);return le.push(re.slice(be,Ae)),le.join("")}}function T(re,ne){return function(ve){var le=ld(1900,void 0,1),Ae=O(le,re,ve+="",0),be,We;if(Ae!=ve.length)return null;if("Q"in le)return new Date(le.Q);if("s"in le)return new Date(le.s*1e3+("L"in le?le.L:0));if(ne&&!("Z"in le)&&(le.Z=0),"p"in le&&(le.H=le.H%12+le.p*12),le.m===void 0&&(le.m="q"in le?le.q:0),"V"in le){if(le.V<1||le.V>53)return null;"w"in le||(le.w=1),"Z"in le?(be=Hw(ld(le.y,0,1)),We=be.getUTCDay(),be=We>4||We===0?pm.ceil(be):pm(be),be=zv.offset(be,(le.V-1)*7),le.y=be.getUTCFullYear(),le.m=be.getUTCMonth(),le.d=be.getUTCDate()+(le.w+6)%7):(be=Vw(ld(le.y,0,1)),We=be.getDay(),be=We>4||We===0?fm.ceil(be):fm(be),be=Bf.offset(be,(le.V-1)*7),le.y=be.getFullYear(),le.m=be.getMonth(),le.d=be.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),We="Z"in le?Hw(ld(le.y,0,1)).getUTCDay():Vw(ld(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(We+5)%7:le.w+le.U*7-(We+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,Hw(le)):Vw(le)}}function O(re,ne,ve,le){for(var Ae=0,be=ne.length,We=ve.length,B,ie;Ae<be;){if(le>=We)return-1;if(B=ne.charCodeAt(Ae++),B===37){if(B=ne.charAt(Ae++),ie=A[B in s2?ne.charAt(Ae++):B],!ie||(le=ie(re,ve,le))<0)return-1}else if(B!=ve.charCodeAt(le++))return-1}return le}function L(re,ne,ve){var le=f.exec(ne.slice(ve));return le?(re.p=h.get(le[0].toLowerCase()),ve+le[0].length):-1}function z(re,ne,ve){var le=x.exec(ne.slice(ve));return le?(re.w=j.get(le[0].toLowerCase()),ve+le[0].length):-1}function q(re,ne,ve){var le=p.exec(ne.slice(ve));return le?(re.w=g.get(le[0].toLowerCase()),ve+le[0].length):-1}function F(re,ne,ve){var le=S.exec(ne.slice(ve));return le?(re.m=C.get(le[0].toLowerCase()),ve+le[0].length):-1}function G(re,ne,ve){var le=b.exec(ne.slice(ve));return le?(re.m=y.get(le[0].toLowerCase()),ve+le[0].length):-1}function W(re,ne,ve){return O(re,t,ne,ve)}function R(re,ne,ve){return O(re,n,ne,ve)}function M(re,ne,ve){return O(re,r,ne,ve)}function K(re){return i[re.getDay()]}function V(re){return o[re.getDay()]}function D(re){return d[re.getMonth()]}function J(re){return c[re.getMonth()]}function H(re){return a[+(re.getHours()>=12)]}function I(re){return 1+~~(re.getMonth()/3)}function te(re){return i[re.getUTCDay()]}function de(re){return o[re.getUTCDay()]}function fe(re){return d[re.getUTCMonth()]}function me(re){return c[re.getUTCMonth()]}function U(re){return a[+(re.getUTCHours()>=12)]}function oe(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ne=k(re+="",N);return ne.toString=function(){return re},ne},parse:function(re){var ne=T(re+="",!1);return ne.toString=function(){return re},ne},utcFormat:function(re){var ne=k(re+="",E);return ne.toString=function(){return re},ne},utcParse:function(re){var ne=T(re+="",!0);return ne.toString=function(){return re},ne}}}var s2={"-":"",_:" ",0:"0"},lr=/^\s*\d+/,hne=/^%/,mne=/[\\^$*+?|[\]().{}]/g;function en(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",o=a.length;return r+(o<n?new Array(n-o+1).join(t)+a:a)}function vne(e){return e.replace(mne,"\\$&")}function cd(e){return new RegExp("^(?:"+e.map(vne).join("|")+")","i")}function ud(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function gne(e,t,n){var r=lr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function xne(e,t,n){var r=lr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function yne(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bne(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function wne(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function o2(e,t,n){var r=lr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function i2(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function jne(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 Sne(e,t,n){var r=lr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Nne(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function l2(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Cne(e,t,n){var r=lr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function c2(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function _ne(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Ane(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Ene(e,t,n){var r=lr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Pne(e,t,n){var r=lr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function kne(e,t,n){var r=hne.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Tne(e,t,n){var r=lr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function One(e,t,n){var r=lr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function u2(e,t){return en(e.getDate(),t,2)}function Rne(e,t){return en(e.getHours(),t,2)}function Ine(e,t){return en(e.getHours()%12||12,t,2)}function Mne(e,t){return en(1+Bf.count(lo(e),e),t,3)}function DL(e,t){return en(e.getMilliseconds(),t,3)}function $ne(e,t){return DL(e,t)+"000"}function Dne(e,t){return en(e.getMonth()+1,t,2)}function Lne(e,t){return en(e.getMinutes(),t,2)}function Fne(e,t){return en(e.getSeconds(),t,2)}function Bne(e){var t=e.getDay();return t===0?7:t}function zne(e,t){return en(Uv.count(lo(e)-1,e),t,2)}function LL(e){var t=e.getDay();return t>=4||t===0?Oc(e):Oc.ceil(e)}function Une(e,t){return e=LL(e),en(Oc.count(lo(e),e)+(lo(e).getDay()===4),t,2)}function qne(e){return e.getDay()}function Wne(e,t){return en(fm.count(lo(e)-1,e),t,2)}function Vne(e,t){return en(e.getFullYear()%100,t,2)}function Hne(e,t){return e=LL(e),en(e.getFullYear()%100,t,2)}function Kne(e,t){return en(e.getFullYear()%1e4,t,4)}function Gne(e,t){var n=e.getDay();return e=n>=4||n===0?Oc(e):Oc.ceil(e),en(e.getFullYear()%1e4,t,4)}function Yne(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+en(t/60|0,"0",2)+en(t%60,"0",2)}function d2(e,t){return en(e.getUTCDate(),t,2)}function Xne(e,t){return en(e.getUTCHours(),t,2)}function Jne(e,t){return en(e.getUTCHours()%12||12,t,2)}function Qne(e,t){return en(1+zv.count(co(e),e),t,3)}function FL(e,t){return en(e.getUTCMilliseconds(),t,3)}function Zne(e,t){return FL(e,t)+"000"}function ere(e,t){return en(e.getUTCMonth()+1,t,2)}function tre(e,t){return en(e.getUTCMinutes(),t,2)}function nre(e,t){return en(e.getUTCSeconds(),t,2)}function rre(e){var t=e.getUTCDay();return t===0?7:t}function are(e,t){return en(qv.count(co(e)-1,e),t,2)}function BL(e){var t=e.getUTCDay();return t>=4||t===0?Rc(e):Rc.ceil(e)}function sre(e,t){return e=BL(e),en(Rc.count(co(e),e)+(co(e).getUTCDay()===4),t,2)}function ore(e){return e.getUTCDay()}function ire(e,t){return en(pm.count(co(e)-1,e),t,2)}function lre(e,t){return en(e.getUTCFullYear()%100,t,2)}function cre(e,t){return e=BL(e),en(e.getUTCFullYear()%100,t,2)}function ure(e,t){return en(e.getUTCFullYear()%1e4,t,4)}function dre(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Rc(e):Rc.ceil(e),en(e.getUTCFullYear()%1e4,t,4)}function fre(){return"+0000"}function f2(){return"%"}function p2(e){return+e}function h2(e){return Math.floor(+e/1e3)}var Jl,zL,UL;pre({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 pre(e){return Jl=pne(e),zL=Jl.format,Jl.parse,UL=Jl.utcFormat,Jl.utcParse,Jl}function hre(e){return new Date(e)}function mre(e){return e instanceof Date?+e:+new Date(+e)}function jC(e,t,n,r,a,o,i,c,d,f){var h=lC(),p=h.invert,g=h.domain,x=f(".%L"),j=f(":%S"),b=f("%I:%M"),y=f("%I %p"),S=f("%a %d"),C=f("%b %d"),N=f("%B"),E=f("%Y");function A(k){return(d(k)<k?x:c(k)<k?j:i(k)<k?b:o(k)<k?y:r(k)<k?a(k)<k?S:C:n(k)<k?N:E)(k)}return h.invert=function(k){return new Date(p(k))},h.domain=function(k){return arguments.length?g(Array.from(k,mre)):g().map(hre)},h.ticks=function(k){var T=g();return e(T[0],T[T.length-1],k??10)},h.tickFormat=function(k,T){return T==null?A:f(T)},h.nice=function(k){var T=g();return(!k||typeof k.range!="function")&&(k=t(T[0],T[T.length-1],k??10)),k?g(EL(T,k)):h},h.copy=function(){return Ff(h,jC(e,t,n,r,a,o,i,c,d,f))},h}function vre(){return Ma.apply(jC(dne,fne,lo,bC,Uv,Bf,xC,vC,$i,zL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gre(){return Ma.apply(jC(cne,une,co,wC,qv,zv,yC,gC,$i,UL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Wv(){var e=0,t=1,n,r,a,o,i=Er,c=!1,d;function f(p){return p==null||isNaN(p=+p)?d:i(a===0?.5:(p=(o(p)-n)*a,c?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,n=o(e=+e),r=o(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?(i=p,f):i};function h(p){return function(g){var x,j;return arguments.length?([x,j]=g,i=p(x,j),f):[i(0),i(1)]}}return f.range=h(vu),f.rangeRound=h(iC),f.unknown=function(p){return arguments.length?(d=p,f):d},function(p){return o=p,n=p(e),r=p(t),a=n===r?0:1/(r-n),f}}function oi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function qL(){var e=si(Wv()(Er));return e.copy=function(){return oi(e,qL())},mo.apply(e,arguments)}function WL(){var e=dC(Wv()).domain([1,10]);return e.copy=function(){return oi(e,WL()).base(e.base())},mo.apply(e,arguments)}function VL(){var e=fC(Wv());return e.copy=function(){return oi(e,VL()).constant(e.constant())},mo.apply(e,arguments)}function SC(){var e=pC(Wv());return e.copy=function(){return oi(e,SC()).exponent(e.exponent())},mo.apply(e,arguments)}function xre(){return SC.apply(null,arguments).exponent(.5)}function HL(){var e=[],t=Er;function n(r){if(r!=null&&!isNaN(r=+r))return t((Df(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(Go),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,o)=>ate(e,o/r))},n.copy=function(){return HL(t).domain(e)},mo.apply(n,arguments)}function Vv(){var e=0,t=.5,n=1,r=1,a,o,i,c,d,f=Er,h,p=!1,g;function x(b){return isNaN(b=+b)?g:(b=.5+((b=+h(b))-o)*(r*b<r*o?c:d),f(p?Math.max(0,Math.min(1,b)):b))}x.domain=function(b){return arguments.length?([e,t,n]=b,a=h(e=+e),o=h(t=+t),i=h(n=+n),c=a===o?0:.5/(o-a),d=o===i?0:.5/(i-o),r=o<a?-1:1,x):[e,t,n]},x.clamp=function(b){return arguments.length?(p=!!b,x):p},x.interpolator=function(b){return arguments.length?(f=b,x):f};function j(b){return function(y){var S,C,N;return arguments.length?([S,C,N]=y,f=kte(b,[S,C,N]),x):[f(0),f(.5),f(1)]}}return x.range=j(vu),x.rangeRound=j(iC),x.unknown=function(b){return arguments.length?(g=b,x):g},function(b){return h=b,a=b(e),o=b(t),i=b(n),c=a===o?0:.5/(o-a),d=o===i?0:.5/(i-o),r=o<a?-1:1,x}}function KL(){var e=si(Vv()(Er));return e.copy=function(){return oi(e,KL())},mo.apply(e,arguments)}function GL(){var e=dC(Vv()).domain([.1,1,10]);return e.copy=function(){return oi(e,GL()).base(e.base())},mo.apply(e,arguments)}function YL(){var e=fC(Vv());return e.copy=function(){return oi(e,YL()).constant(e.constant())},mo.apply(e,arguments)}function NC(){var e=pC(Vv());return e.copy=function(){return oi(e,NC()).exponent(e.exponent())},mo.apply(e,arguments)}function yre(){return NC.apply(null,arguments).exponent(.5)}const m2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Wd,scaleDiverging:KL,scaleDivergingLog:GL,scaleDivergingPow:NC,scaleDivergingSqrt:yre,scaleDivergingSymlog:YL,scaleIdentity:AL,scaleImplicit:zS,scaleLinear:um,scaleLog:PL,scaleOrdinal:aC,scalePoint:Nd,scalePow:hC,scaleQuantile:OL,scaleQuantize:RL,scaleRadial:TL,scaleSequential:qL,scaleSequentialLog:WL,scaleSequentialPow:SC,scaleSequentialQuantile:HL,scaleSequentialSqrt:xre,scaleSequentialSymlog:VL,scaleSqrt:Zte,scaleSymlog:kL,scaleThreshold:IL,scaleTime:vre,scaleUtc:gre,tickFormat:_L},Symbol.toStringTag,{value:"Module"}));var Kw,v2;function Hv(){if(v2)return Kw;v2=1;var e=fu();function t(n,r,a){for(var o=-1,i=n.length;++o<i;){var c=n[o],d=r(c);if(d!=null&&(f===void 0?d===d&&!e(d):a(d,f)))var f=d,h=c}return h}return Kw=t,Kw}var Gw,g2;function XL(){if(g2)return Gw;g2=1;function e(t,n){return t>n}return Gw=e,Gw}var Yw,x2;function bre(){if(x2)return Yw;x2=1;var e=Hv(),t=XL(),n=mu();function r(a){return a&&a.length?e(a,n,t):void 0}return Yw=r,Yw}var wre=bre();const Kv=ln(wre);var Xw,y2;function JL(){if(y2)return Xw;y2=1;function e(t,n){return t<n}return Xw=e,Xw}var Jw,b2;function jre(){if(b2)return Jw;b2=1;var e=Hv(),t=JL(),n=mu();function r(a){return a&&a.length?e(a,n,t):void 0}return Jw=r,Jw}var Sre=jre();const Gv=ln(Sre);var Qw,w2;function Nre(){if(w2)return Qw;w2=1;var e=BN(),t=Ms(),n=oL(),r=Yr();function a(o,i){var c=r(o)?e:n;return c(o,t(i,3))}return Qw=a,Qw}var Zw,j2;function Cre(){if(j2)return Zw;j2=1;var e=aL(),t=Nre();function n(r,a){return e(t(r,a),1)}return Zw=n,Zw}var _re=Cre();const Are=ln(_re);var ej,S2;function Ere(){if(S2)return ej;S2=1;var e=ZN();function t(n,r){return e(n,r)}return ej=t,ej}var Pre=Ere();const zf=ln(Pre);var gu=1e9,kre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_C,On=!0,Ra="[DecimalError] ",zi=Ra+"Invalid argument: ",CC=Ra+"Exponent out of range: ",xu=Math.floor,Oi=Math.pow,Tre=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,la,or=1e7,Pn=7,QL=9007199254740991,hm=xu(QL/Pn),et={};et.absoluteValue=et.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};et.comparedTo=et.cmp=function(e){var t,n,r,a,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===a?0:r>a^o.s<0?1:-1};et.decimalPlaces=et.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};et.dividedBy=et.div=function(e){return no(this,new this.constructor(e))};et.dividedToIntegerBy=et.idiv=function(e){var t=this,n=t.constructor;return vn(no(t,new n(e),0,1),n.precision)};et.equals=et.eq=function(e){return!this.cmp(e)};et.exponent=function(){return Hn(this)};et.greaterThan=et.gt=function(e){return this.cmp(e)>0};et.greaterThanOrEqualTo=et.gte=function(e){return this.cmp(e)>=0};et.isInteger=et.isint=function(){return this.e>this.d.length-2};et.isNegative=et.isneg=function(){return this.s<0};et.isPositive=et.ispos=function(){return this.s>0};et.isZero=function(){return this.s===0};et.lessThan=et.lt=function(e){return this.cmp(e)<0};et.lessThanOrEqualTo=et.lte=function(e){return this.cmp(e)<1};et.logarithm=et.log=function(e){var t,n=this,r=n.constructor,a=r.precision,o=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(la))throw Error(Ra+"NaN");if(n.s<1)throw Error(Ra+(n.s?"NaN":"-Infinity"));return n.eq(la)?new r(0):(On=!1,t=no(Yd(n,o),Yd(e,o),o),On=!0,vn(t,a))};et.minus=et.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?t4(t,e):ZL(t,(e.s=-e.s,e))};et.modulo=et.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Ra+"NaN");return n.s?(On=!1,t=no(n,e,0,1).times(e),On=!0,n.minus(t)):vn(new r(n),a)};et.naturalExponential=et.exp=function(){return e4(this)};et.naturalLogarithm=et.ln=function(){return Yd(this)};et.negated=et.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};et.plus=et.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ZL(t,e):t4(t,(e.s=-e.s,e))};et.precision=et.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(zi+e);if(t=Hn(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};et.squareRoot=et.sqrt=function(){var e,t,n,r,a,o,i,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(Ra+"NaN")}for(e=Hn(c),On=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ys(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=xu((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=i=n+3;;)if(o=r,r=o.plus(no(c,o,i+2)).times(.5),ys(o.d).slice(0,i)===(t=ys(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),a==i&&t=="4999"){if(vn(o,n+1,0),o.times(o).eq(c)){r=o;break}}else if(t!="9999")break;i+=4}return On=!0,vn(r,n)};et.times=et.mul=function(e){var t,n,r,a,o,i,c,d,f,h=this,p=h.constructor,g=h.d,x=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,d=g.length,f=x.length,d<f&&(o=g,g=x,x=o,i=d,d=f,f=i),o=[],i=d+f,r=i;r--;)o.push(0);for(r=f;--r>=0;){for(t=0,a=d+r;a>r;)c=o[a]+x[r]*g[a-r-1]+t,o[a--]=c%or|0,t=c/or|0;o[a]=(o[a]+t)%or|0}for(;!o[--i];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,On?vn(e,p.precision):e};et.toDecimalPlaces=et.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Es(e,0,gu),t===void 0?t=r.rounding:Es(t,0,8),vn(n,e+Hn(n)+1,t))};et.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Ji(r,!0):(Es(e,0,gu),t===void 0?t=a.rounding:Es(t,0,8),r=vn(new a(r),e+1,t),n=Ji(r,!0,e+1)),n};et.toFixed=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?Ji(a):(Es(e,0,gu),t===void 0?t=o.rounding:Es(t,0,8),r=vn(new o(a),e+Hn(a)+1,t),n=Ji(r.abs(),!1,e+Hn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};et.toInteger=et.toint=function(){var e=this,t=e.constructor;return vn(new t(e),Hn(e)+1,t.rounding)};et.toNumber=function(){return+this};et.toPower=et.pow=function(e){var t,n,r,a,o,i,c=this,d=c.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(la);if(c=new d(c),!c.s){if(e.s<1)throw Error(Ra+"Infinity");return c}if(c.eq(la))return c;if(r=d.precision,e.eq(la))return vn(c,r);if(t=e.e,n=e.d.length-1,i=t>=n,o=c.s,i){if((n=h<0?-h:h)<=QL){for(a=new d(la),t=Math.ceil(r/Pn+4),On=!1;n%2&&(a=a.times(c),C2(a.d,t)),n=xu(n/2),n!==0;)c=c.times(c),C2(c.d,t);return On=!0,e.s<0?new d(la).div(a):vn(a,r)}}else if(o<0)throw Error(Ra+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,On=!1,a=e.times(Yd(c,r+f)),On=!0,a=e4(a),a.s=o,a};et.toPrecision=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?(n=Hn(a),r=Ji(a,n<=o.toExpNeg||n>=o.toExpPos)):(Es(e,1,gu),t===void 0?t=o.rounding:Es(t,0,8),a=vn(new o(a),e,t),n=Hn(a),r=Ji(a,e<=n||n<=o.toExpNeg,e)),r};et.toSignificantDigits=et.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Es(e,1,gu),t===void 0?t=r.rounding:Es(t,0,8)),vn(new r(n),e,t)};et.toString=et.valueOf=et.val=et.toJSON=et[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Hn(e),n=e.constructor;return Ji(e,t<=n.toExpNeg||t>=n.toExpPos)};function ZL(e,t){var n,r,a,o,i,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),On?vn(t,p):t;if(d=e.d,f=t.d,i=e.e,a=t.e,d=d.slice(),o=i-a,o){for(o<0?(r=d,o=-o,c=f.length):(r=f,a=i,c=d.length),i=Math.ceil(p/Pn),c=i>c?i+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=d.length,o=f.length,c-o<0&&(o=c,r=f,f=d,d=r),n=0;o;)n=(d[--o]=d[o]+f[o]+n)/or|0,d[o]%=or;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,On?vn(t,p):t}function Es(e,t,n){if(e!==~~e||e<t||e>n)throw Error(zi+e)}function ys(e){var t,n,r,a=e.length-1,o="",i=e[0];if(a>0){for(o+=i,t=1;t<a;t++)r=e[t]+"",n=Pn-r.length,n&&(o+=qo(n)),o+=r;i=e[t],r=i+"",n=Pn-r.length,n&&(o+=qo(n))}else if(i===0)return"0";for(;i%10===0;)i/=10;return o+i}var no=(function(){function e(r,a){var o,i=0,c=r.length;for(r=r.slice();c--;)o=r[c]*a+i,r[c]=o%or|0,i=o/or|0;return i&&r.unshift(i),r}function t(r,a,o,i){var c,d;if(o!=i)d=o>i?1:-1;else for(c=d=0;c<o;c++)if(r[c]!=a[c]){d=r[c]>a[c]?1:-1;break}return d}function n(r,a,o){for(var i=0;o--;)r[o]-=i,i=r[o]<a[o]?1:0,r[o]=i*or+r[o]-a[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,o,i){var c,d,f,h,p,g,x,j,b,y,S,C,N,E,A,k,T,O,L=r.constructor,z=r.s==a.s?1:-1,q=r.d,F=a.d;if(!r.s)return new L(r);if(!a.s)throw Error(Ra+"Division by zero");for(d=r.e-a.e,T=F.length,A=q.length,x=new L(z),j=x.d=[],f=0;F[f]==(q[f]||0);)++f;if(F[f]>(q[f]||0)&&--d,o==null?C=o=L.precision:i?C=o+(Hn(r)-Hn(a))+1:C=o,C<0)return new L(0);if(C=C/Pn+2|0,f=0,T==1)for(h=0,F=F[0],C++;(f<A||h)&&C--;f++)N=h*or+(q[f]||0),j[f]=N/F|0,h=N%F|0;else{for(h=or/(F[0]+1)|0,h>1&&(F=e(F,h),q=e(q,h),T=F.length,A=q.length),E=T,b=q.slice(0,T),y=b.length;y<T;)b[y++]=0;O=F.slice(),O.unshift(0),k=F[0],F[1]>=or/2&&++k;do h=0,c=t(F,b,T,y),c<0?(S=b[0],T!=y&&(S=S*or+(b[1]||0)),h=S/k|0,h>1?(h>=or&&(h=or-1),p=e(F,h),g=p.length,y=b.length,c=t(p,b,g,y),c==1&&(h--,n(p,T<g?O:F,g))):(h==0&&(c=h=1),p=F.slice()),g=p.length,g<y&&p.unshift(0),n(b,p,y),c==-1&&(y=b.length,c=t(F,b,T,y),c<1&&(h++,n(b,T<y?O:F,y))),y=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[y++]=q[E]||0:(b=[q[E]],y=1);while((E++<A||b[0]!==void 0)&&C--)}return j[0]||j.shift(),x.e=d,vn(x,i?o+Hn(x)+1:o)}})();function e4(e,t){var n,r,a,o,i,c,d=0,f=0,h=e.constructor,p=h.precision;if(Hn(e)>16)throw Error(CC+Hn(e));if(!e.s)return new h(la);for(On=!1,c=p,i=new h(.03125);e.abs().gte(.1);)e=e.times(i),f+=5;for(r=Math.log(Oi(2,f))/Math.LN10*2+5|0,c+=r,n=a=o=new h(la),h.precision=c;;){if(a=vn(a.times(e),c),n=n.times(++d),i=o.plus(no(a,n,c)),ys(i.d).slice(0,c)===ys(o.d).slice(0,c)){for(;f--;)o=vn(o.times(o),c);return h.precision=p,t==null?(On=!0,vn(o,p)):o}o=i}}function Hn(e){for(var t=e.e*Pn,n=e.d[0];n>=10;n/=10)t++;return t}function tj(e,t,n){if(t>e.LN10.sd())throw On=!0,n&&(e.precision=n),Error(Ra+"LN10 precision limit exceeded");return vn(new e(e.LN10),t)}function qo(e){for(var t="";e--;)t+="0";return t}function Yd(e,t){var n,r,a,o,i,c,d,f,h,p=1,g=10,x=e,j=x.d,b=x.constructor,y=b.precision;if(x.s<1)throw Error(Ra+(x.s?"NaN":"-Infinity"));if(x.eq(la))return new b(0);if(t==null?(On=!1,f=y):f=t,x.eq(10))return t==null&&(On=!0),tj(b,f);if(f+=g,b.precision=f,n=ys(j),r=n.charAt(0),o=Hn(x),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=ys(x.d),r=n.charAt(0),p++;o=Hn(x),r>1?(x=new b("0."+n),o++):x=new b(r+"."+n.slice(1))}else return d=tj(b,f+2,y).times(o+""),x=Yd(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=y,t==null?(On=!0,vn(x,y)):x;for(c=i=x=no(x.minus(la),x.plus(la),f),h=vn(x.times(x),f),a=3;;){if(i=vn(i.times(h),f),d=c.plus(no(i,new b(a),f)),ys(d.d).slice(0,f)===ys(c.d).slice(0,f))return c=c.times(2),o!==0&&(c=c.plus(tj(b,f+2,y).times(o+""))),c=no(c,new b(p),f),b.precision=y,t==null?(On=!0,vn(c,y)):c;c=d,a+=2}}function N2(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=xu(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),On&&(e.e>hm||e.e<-hm))throw Error(CC+n)}else e.s=0,e.e=0,e.d=[0];return e}function vn(e,t,n){var r,a,o,i,c,d,f,h,p=e.d;for(i=1,o=p[0];o>=10;o/=10)i++;if(r=t-i,r<0)r+=Pn,a=t,f=p[h=0];else{if(h=Math.ceil((r+1)/Pn),o=p.length,h>=o)return e;for(f=o=p[h],i=1;o>=10;o/=10)i++;r%=Pn,a=r-Pn+i}if(n!==void 0&&(o=Oi(10,i-a-1),c=f/o%10|0,d=t<0||p[h+1]!==void 0||f%o,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/Oi(10,i-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(o=Hn(e),p.length=1,t=t-o-1,p[0]=Oi(10,(Pn-t%Pn)%Pn),e.e=xu(-t/Pn)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,o=1,h--):(p.length=h+1,o=Oi(10,Pn-r),p[h]=a>0?(f/Oi(10,i-a)%Oi(10,a)|0)*o:0),d)for(;;)if(h==0){(p[0]+=o)==or&&(p[0]=1,++e.e);break}else{if(p[h]+=o,p[h]!=or)break;p[h--]=0,o=1}for(r=p.length;p[--r]===0;)p.pop();if(On&&(e.e>hm||e.e<-hm))throw Error(CC+Hn(e));return e}function t4(e,t){var n,r,a,o,i,c,d,f,h,p,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),On?vn(t,x):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),i=f-r,i){for(h=i<0,h?(n=d,i=-i,c=p.length):(n=p,r=f,c=d.length),a=Math.max(Math.ceil(x/Pn),c)+2,i>a&&(i=a,n.length=1),n.reverse(),a=i;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}i=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>i;){if(d[--a]<p[a]){for(o=a;o&&d[--o]===0;)d[o]=or-1;--d[o],d[a]+=or}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,On?vn(t,x):t):new g(0)}function Ji(e,t,n){var r,a=Hn(e),o=ys(e.d),i=o.length;return t?(n&&(r=n-i)>0?o=o.charAt(0)+"."+o.slice(1)+qo(r):i>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(a<0?"e":"e+")+a):a<0?(o="0."+qo(-a-1)+o,n&&(r=n-i)>0&&(o+=qo(r))):a>=i?(o+=qo(a+1-i),n&&(r=n-a-1)>0&&(o=o+"."+qo(r))):((r=a+1)<i&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-i)>0&&(a+1===i&&(o+="."),o+=qo(r))),e.s<0?"-"+o:o}function C2(e,t){if(e.length>t)return e.length=t,!0}function n4(e){var t,n,r;function a(o){var i=this;if(!(i instanceof a))return new a(o);if(i.constructor=a,o instanceof a){i.s=o.s,i.e=o.e,i.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(zi+o);if(o>0)i.s=1;else if(o<0)o=-o,i.s=-1;else{i.s=0,i.e=0,i.d=[0];return}if(o===~~o&&o<1e7){i.e=0,i.d=[o];return}return N2(i,o.toString())}else if(typeof o!="string")throw Error(zi+o);if(o.charCodeAt(0)===45?(o=o.slice(1),i.s=-1):i.s=1,Tre.test(o))N2(i,o);else throw Error(zi+o)}if(a.prototype=et,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=n4,a.config=a.set=Ore,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 Ore(e){if(!e||typeof e!="object")throw Error(Ra+"Object expected");var t,n,r,a=["precision",1,gu,"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(xu(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(zi+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(zi+n+": "+r);return this}var _C=n4(kre);la=new _C(1);const pn=_C;function Rre(e){return Dre(e)||$re(e)||Mre(e)||Ire()}function Ire(){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 Mre(e,t){if(e){if(typeof e=="string")return VS(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 VS(e,t)}}function $re(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Dre(e){if(Array.isArray(e))return VS(e)}function VS(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 Lre=function(t){return t},r4={},a4=function(t){return t===r4},_2=function(t){return function n(){return arguments.length===0||arguments.length===1&&a4(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},Fre=function e(t,n){return t===1?n:_2(function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];var i=a.filter(function(c){return c!==r4}).length;return i>=t?n.apply(void 0,a):e(t-i,_2(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 a4(p)?d.shift():p});return n.apply(void 0,Rre(h).concat(d))}))})},Yv=function(t){return Fre(t.length,t)},HS=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Bre=Yv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),zre=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Lre;var a=n.reverse(),o=a[0],i=a.slice(1);return function(){return i.reduce(function(c,d){return d(c)},o.apply(void 0,arguments))}},KS=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},s4=function(t){var n=null,r=null;return function(){for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return n&&o.every(function(c,d){return c===n[d]})||(n=o,r=t.apply(void 0,o)),r}};function Ure(e){var t;return e===0?t=1:t=Math.floor(new pn(e).abs().log(10).toNumber())+1,t}function qre(e,t,n){for(var r=new pn(e),a=0,o=[];r.lt(t)&&a<1e5;)o.push(r.toNumber()),r=r.add(n),a++;return o}var Wre=Yv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),Vre=Yv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Hre=Yv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Xv={rangeStep:qre,getDigitCount:Ure,interpolateNumber:Wre,uninterpolateNumber:Vre,uninterpolateTruncation:Hre};function GS(e){return Yre(e)||Gre(e)||o4(e)||Kre()}function Kre(){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 Gre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Yre(e){if(Array.isArray(e))return YS(e)}function Xd(e,t){return Qre(e)||Jre(e,t)||o4(e,t)||Xre()}function Xre(){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 o4(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 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}function Jre(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,o=void 0;try{for(var i=e[Symbol.iterator](),c;!(r=(c=i.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,o=d}finally{try{!r&&i.return!=null&&i.return()}finally{if(a)throw o}}return n}}function Qre(e){if(Array.isArray(e))return e}function i4(e){var t=Xd(e,2),n=t[0],r=t[1],a=n,o=r;return n>r&&(a=r,o=n),[a,o]}function l4(e,t,n){if(e.lte(0))return new pn(0);var r=Xv.getDigitCount(e.toNumber()),a=new pn(10).pow(r),o=e.div(a),i=r!==1?.05:.1,c=new pn(Math.ceil(o.div(i).toNumber())).add(n).mul(i),d=c.mul(a);return t?d:new pn(Math.ceil(d))}function Zre(e,t,n){var r=1,a=new pn(e);if(!a.isint()&&n){var o=Math.abs(e);o<1?(r=new pn(10).pow(Xv.getDigitCount(e)-1),a=new pn(Math.floor(a.div(r).toNumber())).mul(r)):o>1&&(a=new pn(Math.floor(e)))}else e===0?a=new pn(Math.floor((t-1)/2)):n||(a=new pn(Math.floor(e)));var i=Math.floor((t-1)/2),c=zre(Bre(function(d){return a.add(new pn(d-i).mul(r)).toNumber()}),HS);return c(0,t)}function c4(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 pn(0),tickMin:new pn(0),tickMax:new pn(0)};var o=l4(new pn(t).sub(e).div(n-1),r,a),i;e<=0&&t>=0?i=new pn(0):(i=new pn(e).add(t).div(2),i=i.sub(new pn(i).mod(o)));var c=Math.ceil(i.sub(e).div(o).toNumber()),d=Math.ceil(new pn(t).sub(i).div(o).toNumber()),f=c+d+1;return f>n?c4(e,t,n,r,a+1):(f<n&&(d=t>0?d+(n-f):d,c=t>0?c:c+(n-f)),{step:o,tickMin:i.sub(new pn(c).mul(o)),tickMax:i.add(new pn(d).mul(o))})}function eae(e){var t=Xd(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=Math.max(a,2),c=i4([n,r]),d=Xd(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(GS(HS(0,a-1).map(function(){return 1/0}))):[].concat(GS(HS(0,a-1).map(function(){return-1/0})),[h]);return n>r?KS(p):p}if(f===h)return Zre(f,a,o);var g=c4(f,h,i,o),x=g.step,j=g.tickMin,b=g.tickMax,y=Xv.rangeStep(j,b.add(new pn(.1).mul(x)),x);return n>r?KS(y):y}function tae(e,t){var n=Xd(e,2),r=n[0],a=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=i4([r,a]),c=Xd(i,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=l4(new pn(f).sub(d).div(h-1),o,0),g=[].concat(GS(Xv.rangeStep(new pn(d),new pn(f).sub(new pn(.99).mul(p)),p)),[f]);return r>a?KS(g):g}var nae=s4(eae),rae=s4(tae),aae="Invariant failed";function Qi(e,t){throw new Error(aae)}var sae=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];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 mm(){return mm=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},mm.apply(this,arguments)}function oae(e,t){return uae(e)||cae(e,t)||lae(e,t)||iae()}function iae(){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 lae(e,t){if(e){if(typeof e=="string")return A2(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 A2(e,t)}}function A2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function uae(e){if(Array.isArray(e))return e}function dae(e,t){if(e==null)return{};var n=fae(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fae(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 pae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f4(r.key),r)}}function mae(e,t,n){return t&&hae(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vae(e,t,n){return t=vm(t),gae(e,u4()?Reflect.construct(t,n||[],vm(e).constructor):t.apply(e,n))}function gae(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 xae(e)}function xae(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u4=function(){return!!e})()}function vm(e){return vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vm(e)}function yae(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&&XS(e,t)}function XS(e,t){return XS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},XS(e,t)}function d4(e,t,n){return t=f4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f4(e){var t=bae(e,"string");return Ic(t)=="symbol"?t:t+""}function bae(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 Uf=(function(e){function t(){return pae(this,t),vae(this,t,arguments)}return yae(t,e),mae(t,[{key:"render",value:function(){var r=this.props,a=r.offset,o=r.layout,i=r.width,c=r.dataKey,d=r.data,f=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,g=dae(r,sae),x=yt(g,!1);this.props.direction==="x"&&h.type!=="number"&&Qi();var j=d.map(function(b){var y=f(b,c),S=y.x,C=y.y,N=y.value,E=y.errorVal;if(!E)return null;var A=[],k,T;if(Array.isArray(E)){var O=oae(E,2);k=O[0],T=O[1]}else k=T=E;if(o==="vertical"){var L=h.scale,z=C+a,q=z+i,F=z-i,G=L(N-k),W=L(N+T);A.push({x1:W,y1:q,x2:W,y2:F}),A.push({x1:G,y1:z,x2:W,y2:z}),A.push({x1:G,y1:q,x2:G,y2:F})}else if(o==="horizontal"){var R=p.scale,M=S+a,K=M-i,V=M+i,D=R(N-k),J=R(N+T);A.push({x1:K,y1:J,x2:V,y2:J}),A.push({x1:M,y1:D,x2:M,y2:J}),A.push({x1:K,y1:D,x2:V,y2:D})}return Y.createElement(Zt,mm({className:"recharts-errorBar",key:"bar-".concat(A.map(function(H){return"".concat(H.x1,"-").concat(H.x2,"-").concat(H.y1,"-").concat(H.y2)}))},x),A.map(function(H){return Y.createElement("line",mm({},H,{key:"line-".concat(H.x1,"-").concat(H.x2,"-").concat(H.y1,"-").concat(H.y2)}))}))});return Y.createElement(Zt,{className:"recharts-errorBars"},j)}}])})(Y.Component);d4(Uf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});d4(Uf,"displayName","ErrorBar");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 E2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ci(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E2(Object(n),!0).forEach(function(r){wae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wae(e,t,n){return t=jae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jae(e){var t=Sae(e,"string");return Jd(t)=="symbol"?t:t+""}function Sae(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)}var p4=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,o=t.legendContent,i=sa(n,Fi);if(!i)return null;var c=Fi.defaultProps,d=c!==void 0?Ci(Ci({},c),i.props):{},f;return i.props&&i.props.payload?f=i.props&&i.props.payload:o==="children"?f=(r||[]).reduce(function(h,p){var g=p.item,x=p.props,j=x.sectors||x.data||[];return h.concat(j.map(function(b){return{type:i.props.iconType||g.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,g=p.type.defaultProps,x=g!==void 0?Ci(Ci({},g),p.props):{},j=x.dataKey,b=x.name,y=x.legendType,S=x.hide;return{inactive:S,dataKey:j,type:d.iconType||y||"square",color:AC(p),value:b||j,payload:x}}),Ci(Ci(Ci({},d),Fi.getWithHeight(i,a)),{},{payload:f,item:i})};function Qd(e){"@babel/helpers - typeof";return Qd=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},Qd(e)}function P2(e){return Aae(e)||_ae(e)||Cae(e)||Nae()}function Nae(){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 Cae(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 _ae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Aae(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 k2(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 Ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k2(Object(n),!0).forEach(function(r){yc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yc(e,t,n){return t=Eae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eae(e){var t=Pae(e,"string");return Qd(t)=="symbol"?t:t+""}function Pae(e,t){if(Qd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qn(e,t,n){return Tt(e)||Tt(t)?n:Zn(t)?da(e,t,n):kt(t)?t(e):n}function Cd(e,t,n,r){var a=Are(e,function(c){return Qn(c,t)});if(n==="number"){var o=a.filter(function(c){return qe(c)||parseFloat(c)});return o.length?[Gv(o),Kv(o)]:[1/0,-1/0]}var i=r?a.filter(function(c){return!Tt(c)}):a;return i.map(function(c){return Zn(c)||c instanceof Date?c:""})}var kae=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=-1,c=(n=r?.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var d=o.range,f=0;f<c;f++){var h=f>0?a[f-1].coordinate:a[c-1].coordinate,p=a[f].coordinate,g=f>=c-1?a[0].coordinate:a[f+1].coordinate,x=void 0;if(_r(p-h)!==_r(g-p)){var j=[];if(_r(g-p)===_r(d[1]-d[0])){x=g;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+h)/2),j[1]=Math.max(b,(b+h)/2)}else{x=h;var y=g+d[1]-d[0];j[0]=Math.min(p,(y+p)/2),j[1]=Math.max(p,(y+p)/2)}var S=[Math.min(p,(x+p)/2),Math.max(p,(x+p)/2)];if(t>S[0]&&t<=S[1]||t>=j[0]&&t<=j[1]){i=a[f].index;break}}else{var C=Math.min(h,g),N=Math.max(h,g);if(t>(C+p)/2&&t<=(N+p)/2){i=a[f].index;break}}}else for(var E=0;E<c;E++)if(E===0&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E>0&&E<c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E===c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2){i=r[E].index;break}return i},AC=function(t){var n,r=t,a=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ln(Ln({},t.type.defaultProps),t.props):t.props,i=o.stroke,c=o.fill,d;switch(a){case"Line":d=i;break;case"Area":case"Radar":d=i&&i!=="none"?i:c;break;default:d=c;break}return d},Tae=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,o=a===void 0?{}:a;if(!o)return{};for(var i={},c=Object.keys(o),d=0,f=c.length;d<f;d++)for(var h=o[c[d]].stackGroups,p=Object.keys(h),g=0,x=p.length;g<x;g++){var j=h[p[g]],b=j.items,y=j.cateAxisId,S=b.filter(function(T){return eo(T.type).indexOf("Bar")>=0});if(S&&S.length){var C=S[0].type.defaultProps,N=C!==void 0?Ln(Ln({},C),S[0].props):S[0].props,E=N.barSize,A=N[y];i[A]||(i[A]=[]);var k=Tt(E)?n:E;i[A].push({item:S[0],stackList:S.slice(1),barSize:Tt(k)?void 0:Ar(k,r,0)})}}return i},Oae=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,o=t.sizeList,i=o===void 0?[]:o,c=t.maxBarSize,d=i.length;if(d<1)return null;var f=Ar(n,a,0,!0),h,p=[];if(i[0].barSize===+i[0].barSize){var g=!1,x=a/d,j=i.reduce(function(E,A){return E+A.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&x>0&&(g=!0,x*=.9,j=d*x);var b=(a-j)/2>>0,y={offset:b-f,size:0};h=i.reduce(function(E,A){var k={item:A.item,position:{offset:y.offset+y.size+f,size:g?x:A.barSize}},T=[].concat(P2(E),[k]);return y=T[T.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(O){T.push({item:O,position:y})}),T},p)}else{var S=Ar(r,a,0,!0);a-2*S-(d-1)*f<=0&&(f=0);var C=(a-2*S-(d-1)*f)/d;C>1&&(C>>=0);var N=c===+c?Math.min(C,c):C;h=i.reduce(function(E,A,k){var T=[].concat(P2(E),[{item:A.item,position:{offset:S+(C+f)*k+(C-N)/2,size:N}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(O){T.push({item:O,position:T[T.length-1].position})}),T},p)}return h},Rae=function(t,n,r,a){var o=r.children,i=r.width,c=r.margin,d=i-(c.left||0)-(c.right||0),f=p4({children:o,legendWidth:d});if(f){var h=a||{},p=h.width,g=h.height,x=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&x!=="center"&&qe(t[x]))return Ln(Ln({},t),{},yc({},x,t[x]+(p||0)));if((b==="horizontal"||b==="vertical"&&x==="center")&&j!=="middle"&&qe(t[j]))return Ln(Ln({},t),{},yc({},j,t[j]+(g||0)))}return t},Iae=function(t,n,r){return Tt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},h4=function(t,n,r,a,o){var i=n.props.children,c=fa(i,Uf).filter(function(f){return Iae(a,o,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=Qn(h,r);if(Tt(p))return f;var g=Array.isArray(p)?[Gv(p),Kv(p)]:[p,p],x=d.reduce(function(j,b){var y=Qn(h,b,0),S=g[0]-Math.abs(Array.isArray(y)?y[0]:y),C=g[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(S,j[0]),Math.max(C,j[1])]},[1/0,-1/0]);return[Math.min(x[0],f[0]),Math.max(x[1],f[1])]},[1/0,-1/0])}return null},Mae=function(t,n,r,a,o){var i=n.map(function(c){return h4(t,c,r,o,a)}).filter(function(c){return!Tt(c)});return i&&i.length?i.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]):null},m4=function(t,n,r,a,o){var i=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&h4(t,d,f,a)||Cd(t,f,r,o)});if(r==="number")return i.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var c={};return i.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},[])},v4=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},Di=function(t,n,r){if(!t)return null;var a=t.scale,o=t.duplicateDomain,i=t.type,c=t.range,d=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,f=(n||r)&&i==="category"&&a.bandwidth?a.bandwidth()/d:0;if(f=t.axisType==="angleAxis"&&c?.length>=2?_r(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var g=o?o.indexOf(p):p;return{coordinate:a(g)+f,value:p,offset:f}});return h.filter(function(p){return!Mf(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:a(p)+f,value:p,index:g,offset:f}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+f,value:p,offset:f}}):a.domain().map(function(p,g){return{coordinate:a(p)+f,value:o?o[p]:p,index:g,offset:f}})},nj=new WeakMap,gh=function(t,n){if(typeof n!="function")return t;nj.has(t)||nj.set(t,new WeakMap);var r=nj.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},g4=function(t,n,r){var a=t.scale,o=t.type,i=t.layout,c=t.axisType;if(a==="auto")return i==="radial"&&c==="radiusAxis"?{scale:Wd(),realScaleType:"band"}:i==="radial"&&c==="angleAxis"?{scale:um(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Nd(),realScaleType:"point"}:o==="category"?{scale:Wd(),realScaleType:"band"}:{scale:um(),realScaleType:"linear"};if(Gi(a)){var d="scale".concat(Ov(a));return{scale:(m2[d]||Nd)(),realScaleType:m2[d]?d:"point"}}return kt(a)?{scale:a}:{scale:Nd(),realScaleType:"point"}},T2=1e-4,x4=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),o=Math.min(a[0],a[1])-T2,i=Math.max(a[0],a[1])+T2,c=t(n[0]),d=t(n[r-1]);(c<o||c>i||d<o||d>i)&&t.domain([n[0],n[r-1]])}},$ae=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},Dae=function(t,n){if(!n||n.length!==2||!qe(n[0])||!qe(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),o=[t[0],t[1]];return(!qe(t[0])||t[0]<r)&&(o[0]=r),(!qe(t[1])||t[1]>a)&&(o[1]=a),o[0]>a&&(o[0]=a),o[1]<r&&(o[1]=r),o},Lae=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var o=0,i=0,c=0;c<n;++c){var d=Mf(t[c][r][1])?t[c][r][0]:t[c][r][1];d>=0?(t[c][r][0]=o,t[c][r][1]=o+d,o=t[c][r][1]):(t[c][r][0]=i,t[c][r][1]=i+d,i=t[c][r][1])}},Fae=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var o=0,i=0;i<n;++i){var c=Mf(t[i][r][1])?t[i][r][0]:t[i][r][1];c>=0?(t[i][r][0]=o,t[i][r][1]=o+c,o=t[i][r][1]):(t[i][r][0]=0,t[i][r][1]=0)}},Bae={sign:Lae,expand:AJ,none:_c,silhouette:EJ,wiggle:PJ,positive:Fae},zae=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),o=Bae[r],i=_J().keys(a).value(function(c,d){return+Qn(c,d,0)}).order(AS).offset(o);return i(t)},Uae=function(t,n,r,a,o,i){if(!t)return null;var c=i?n.reverse():n,d={},f=c.reduce(function(p,g){var x,j=(x=g.type)!==null&&x!==void 0&&x.defaultProps?Ln(Ln({},g.type.defaultProps),g.props):g.props,b=j.stackId,y=j.hide;if(y)return p;var S=j[r],C=p[S]||{hasStack:!1,stackGroups:{}};if(Zn(b)){var N=C.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};N.items.push(g),C.hasStack=!0,C.stackGroups[b]=N}else C.stackGroups[hu("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[g]};return Ln(Ln({},p),{},yc({},S,C))},d),h={};return Object.keys(f).reduce(function(p,g){var x=f[g];if(x.hasStack){var j={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(b,y){var S=x.stackGroups[y];return Ln(Ln({},b),{},yc({},y,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:zae(t,S.items,o)}))},j)}return Ln(Ln({},p),{},yc({},g,x))},h)},y4=function(t,n){var r=n.realScaleType,a=n.type,o=n.tickCount,i=n.originalDomain,c=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(o&&a==="number"&&i&&(i[0]==="auto"||i[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=nae(f,o,c);return t.domain([Gv(h),Kv(h)]),{niceTicks:h}}if(o&&a==="number"){var p=t.domain(),g=rae(p,o,c);return{niceTicks:g}}return null};function O2(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,o=e.index,i=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Tt(a[t.dataKey])){var c=Wh(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var d=Qn(a,Tt(i)?t.dataKey:i);return Tt(d)?null:t.scale(d)}var R2=function(t){var n=t.axis,r=t.ticks,a=t.offset,o=t.bandSize,i=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+a:null;var d=Qn(i,n.dataKey,n.domain[c]);return Tt(d)?null:n.scale(d)-o/2+a},qae=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return a<=0&&o>=0?0:o<0?o:a}return r[0]},Wae=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ln(Ln({},t.type.defaultProps),t.props):t.props,o=a.stackId;if(Zn(o)){var i=n[o];if(i){var c=i.items.indexOf(t);return c>=0?i.stackedData[c]:null}}return null},Vae=function(t){return t.reduce(function(n,r){return[Gv(r.concat([n[0]]).filter(qe)),Kv(r.concat([n[1]]).filter(qe))]},[1/0,-1/0])},b4=function(t,n,r){return Object.keys(t).reduce(function(a,o){var i=t[o],c=i.stackedData,d=c.reduce(function(f,h){var p=Vae(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})},I2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,M2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,QS=function(t,n,r){if(kt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(qe(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(I2.test(t[0])){var o=+I2.exec(t[0])[1];a[0]=n[0]-o}else kt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(qe(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(M2.test(t[1])){var i=+M2.exec(t[1])[1];a[1]=n[1]+i}else kt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},gm=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 o=tC(n,function(p){return p.coordinate}),i=1/0,c=1,d=o.length;c<d;c++){var f=o[c],h=o[c-1];i=Math.min((f.coordinate||0)-(h.coordinate||0),i)}return i===1/0?0:i}return r?void 0:0},$2=function(t,n,r){return!t||!t.length||zf(t,da(r,"type.defaultProps.domain"))?n:t},w4=function(t,n){var r=t.type.defaultProps?Ln(Ln({},t.type.defaultProps),t.props):t.props,a=r.dataKey,o=r.name,i=r.unit,c=r.formatter,d=r.tooltipType,f=r.chartType,h=r.hide;return Ln(Ln({},yt(t,!1)),{},{dataKey:a,unit:i,formatter:c,name:o||a,color:AC(t),value:Qn(n,a),type:d,payload:n,chartType:f,hide:h})};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 D2(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 Gs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?D2(Object(n),!0).forEach(function(r){j4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j4(e,t,n){return t=Hae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hae(e){var t=Kae(e,"string");return Zd(t)=="symbol"?t:t+""}function Kae(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 Gae(e,t){return Qae(e)||Jae(e,t)||Xae(e,t)||Yae()}function Yae(){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 Xae(e,t){if(e){if(typeof e=="string")return L2(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 L2(e,t)}}function L2(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 Jae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function Qae(e){if(Array.isArray(e))return e}var xm=Math.PI/180,Zae=function(t){return t*180/Math.PI},jn=function(t,n,r,a){return{x:t+Math.cos(-xm*a)*r,y:n+Math.sin(-xm*a)*r}},S4=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},ese=function(t,n,r,a,o){var i=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=Ar(t.cx,i,i/2),p=Ar(t.cy,c,c/2),g=S4(i,c,r),x=Ar(t.innerRadius,g,0),j=Ar(t.outerRadius,g,g*.8),b=Object.keys(n);return b.reduce(function(y,S){var C=n[S],N=C.domain,E=C.reversed,A;if(Tt(C.range))a==="angleAxis"?A=[d,f]:a==="radiusAxis"&&(A=[x,j]),E&&(A=[A[1],A[0]]);else{A=C.range;var k=A,T=Gae(k,2);d=T[0],f=T[1]}var O=g4(C,o),L=O.realScaleType,z=O.scale;z.domain(N).range(A),x4(z);var q=y4(z,Gs(Gs({},C),{},{realScaleType:L})),F=Gs(Gs(Gs({},C),q),{},{range:A,radius:j,realScaleType:L,scale:z,cx:h,cy:p,innerRadius:x,outerRadius:j,startAngle:d,endAngle:f});return Gs(Gs({},y),{},j4({},S,F))},{})},tse=function(t,n){var r=t.x,a=t.y,o=n.x,i=n.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(a-i,2))},nse=function(t,n){var r=t.x,a=t.y,o=n.cx,i=n.cy,c=tse({x:r,y:a},{x:o,y:i});if(c<=0)return{radius:c};var d=(r-o)/c,f=Math.acos(d);return a>i&&(f=2*Math.PI-f),{radius:c,angle:Zae(f),angleInRadian:f}},rse=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),o=Math.floor(r/360),i=Math.min(a,o);return{startAngle:n-i*360,endAngle:r-i*360}},ase=function(t,n){var r=n.startAngle,a=n.endAngle,o=Math.floor(r/360),i=Math.floor(a/360),c=Math.min(o,i);return t+c*360},F2=function(t,n){var r=t.x,a=t.y,o=nse({x:r,y:a},n),i=o.radius,c=o.angle,d=n.innerRadius,f=n.outerRadius;if(i<d||i>f)return!1;if(i===0)return!0;var h=rse(n),p=h.startAngle,g=h.endAngle,x=c,j;if(p<=g){for(;x>g;)x-=360;for(;x<p;)x+=360;j=x>=p&&x<=g}else{for(;x>p;)x-=360;for(;x<g;)x+=360;j=x>=g&&x<=p}return j?Gs(Gs({},n),{},{radius:i,angle:ase(x,n)}):null},N4=function(t){return!m.isValidElement(t)&&!kt(t)&&typeof t!="boolean"?t.className:""};function ef(e){"@babel/helpers - typeof";return ef=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},ef(e)}var sse=["offset"];function ose(e){return use(e)||cse(e)||lse(e)||ise()}function ise(){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 lse(e,t){if(e){if(typeof e=="string")return ZS(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 ZS(e,t)}}function cse(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function use(e){if(Array.isArray(e))return ZS(e)}function ZS(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 dse(e,t){if(e==null)return{};var n=fse(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fse(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 B2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B2(Object(n),!0).forEach(function(r){pse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pse(e,t,n){return t=hse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hse(e){var t=mse(e,"string");return ef(t)=="symbol"?t:t+""}function mse(e,t){if(ef(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ef(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tf(){return tf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tf.apply(this,arguments)}var vse=function(t){var n=t.value,r=t.formatter,a=Tt(t.children)?n:t.children;return kt(r)?r(a):a},gse=function(t,n){var r=_r(n-t),a=Math.min(Math.abs(n-t),360);return r*a},xse=function(t,n,r){var a=t.position,o=t.viewBox,i=t.offset,c=t.className,d=o,f=d.cx,h=d.cy,p=d.innerRadius,g=d.outerRadius,x=d.startAngle,j=d.endAngle,b=d.clockWise,y=(p+g)/2,S=gse(x,j),C=S>=0?1:-1,N,E;a==="insideStart"?(N=x+C*i,E=b):a==="insideEnd"?(N=j-C*i,E=!b):a==="end"&&(N=j+C*i,E=b),E=S<=0?E:!E;var A=jn(f,h,y,N),k=jn(f,h,y,N+(E?1:-1)*359),T="M".concat(A.x,",").concat(A.y,`
|
|
75
|
-
A`).concat(y,",").concat(y,",0,1,").concat(E?0:1,`,
|
|
76
|
-
`).concat(k.x,",").concat(k.y),O=Tt(t.id)?hu("recharts-radial-line-"):t.id;return Y.createElement("text",tf({},r,{dominantBaseline:"central",className:Ot("recharts-radial-bar-label",c)}),Y.createElement("defs",null,Y.createElement("path",{id:O,d:T})),Y.createElement("textPath",{xlinkHref:"#".concat(O)},n))},yse=function(t){var n=t.viewBox,r=t.offset,a=t.position,o=n,i=o.cx,c=o.cy,d=o.innerRadius,f=o.outerRadius,h=o.startAngle,p=o.endAngle,g=(h+p)/2;if(a==="outside"){var x=jn(i,c,f+r,g),j=x.x,b=x.y;return{x:j,y:b,textAnchor:j>=i?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:i,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:i,y:c,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:i,y:c,textAnchor:"middle",verticalAnchor:"end"};var y=(d+f)/2,S=jn(i,c,y,g),C=S.x,N=S.y;return{x:C,y:N,textAnchor:"middle",verticalAnchor:"middle"}},bse=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,o=t.position,i=n,c=i.x,d=i.y,f=i.width,h=i.height,p=h>=0?1:-1,g=p*a,x=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,y=b*a,S=b>0?"end":"start",C=b>0?"start":"end";if(o==="top"){var N={x:c+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:x};return Jn(Jn({},N),r?{height:Math.max(d-r.y,0),width:f}:{})}if(o==="bottom"){var E={x:c+f/2,y:d+h+g,textAnchor:"middle",verticalAnchor:j};return Jn(Jn({},E),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(o==="left"){var A={x:c-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Jn(Jn({},A),r?{width:Math.max(A.x-r.x,0),height:h}:{})}if(o==="right"){var k={x:c+f+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"};return Jn(Jn({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:h}:{})}var T=r?{width:f,height:h}:{};return o==="insideLeft"?Jn({x:c+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"},T):o==="insideRight"?Jn({x:c+f-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},T):o==="insideTop"?Jn({x:c+f/2,y:d+g,textAnchor:"middle",verticalAnchor:j},T):o==="insideBottom"?Jn({x:c+f/2,y:d+h-g,textAnchor:"middle",verticalAnchor:x},T):o==="insideTopLeft"?Jn({x:c+y,y:d+g,textAnchor:C,verticalAnchor:j},T):o==="insideTopRight"?Jn({x:c+f-y,y:d+g,textAnchor:S,verticalAnchor:j},T):o==="insideBottomLeft"?Jn({x:c+y,y:d+h-g,textAnchor:C,verticalAnchor:x},T):o==="insideBottomRight"?Jn({x:c+f-y,y:d+h-g,textAnchor:S,verticalAnchor:x},T):pu(o)&&(qe(o.x)||Ii(o.x))&&(qe(o.y)||Ii(o.y))?Jn({x:c+Ar(o.x,f),y:d+Ar(o.y,h),textAnchor:"end",verticalAnchor:"end"},T):Jn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},T)},wse=function(t){return"cx"in t&&qe(t.cx)};function ir(e){var t=e.offset,n=t===void 0?5:t,r=dse(e,sse),a=Jn({offset:n},r),o=a.viewBox,i=a.position,c=a.value,d=a.children,f=a.content,h=a.className,p=h===void 0?"":h,g=a.textBreakAll;if(!o||Tt(c)&&Tt(d)&&!m.isValidElement(f)&&!kt(f))return null;if(m.isValidElement(f))return m.cloneElement(f,a);var x;if(kt(f)){if(x=m.createElement(f,a),m.isValidElement(x))return x}else x=vse(a);var j=wse(o),b=yt(a,!0);if(j&&(i==="insideStart"||i==="insideEnd"||i==="end"))return xse(a,x,b);var y=j?yse(a):bse(a);return Y.createElement(Xi,tf({className:Ot("recharts-label",p)},b,y,{breakAll:g}),x)}ir.displayName="Label";var C4=function(t){var n=t.cx,r=t.cy,a=t.angle,o=t.startAngle,i=t.endAngle,c=t.r,d=t.radius,f=t.innerRadius,h=t.outerRadius,p=t.x,g=t.y,x=t.top,j=t.left,b=t.width,y=t.height,S=t.clockWise,C=t.labelViewBox;if(C)return C;if(qe(b)&&qe(y)){if(qe(p)&&qe(g))return{x:p,y:g,width:b,height:y};if(qe(x)&&qe(j))return{x,y:j,width:b,height:y}}return qe(p)&&qe(g)?{x:p,y:g,width:0,height:0}:qe(n)&&qe(r)?{cx:n,cy:r,startAngle:o||a||0,endAngle:i||a||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:S}:t.viewBox?t.viewBox:{}},jse=function(t,n){return t?t===!0?Y.createElement(ir,{key:"label-implicit",viewBox:n}):Zn(t)?Y.createElement(ir,{key:"label-implicit",viewBox:n,value:t}):m.isValidElement(t)?t.type===ir?m.cloneElement(t,{key:"label-implicit",viewBox:n}):Y.createElement(ir,{key:"label-implicit",content:t,viewBox:n}):kt(t)?Y.createElement(ir,{key:"label-implicit",content:t,viewBox:n}):pu(t)?Y.createElement(ir,tf({viewBox:n},t,{key:"label-implicit"})):null:null},Sse=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,o=C4(t),i=fa(a,ir).map(function(d,f){return m.cloneElement(d,{viewBox:n||o,key:"label-".concat(f)})});if(!r)return i;var c=jse(t.label,n||o);return[c].concat(ose(i))};ir.parseViewBox=C4;ir.renderCallByParent=Sse;var rj,z2;function Nse(){if(z2)return rj;z2=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return rj=e,rj}var Cse=Nse();const _se=ln(Cse);function nf(e){"@babel/helpers - typeof";return nf=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},nf(e)}var Ase=["valueAccessor"],Ese=["data","dataKey","clockWise","id","textBreakAll"];function Pse(e){return Rse(e)||Ose(e)||Tse(e)||kse()}function kse(){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 Tse(e,t){if(e){if(typeof e=="string")return e1(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 e1(e,t)}}function Ose(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rse(e){if(Array.isArray(e))return e1(e)}function e1(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 ym(){return ym=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},ym.apply(this,arguments)}function U2(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 q2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U2(Object(n),!0).forEach(function(r){Ise(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ise(e,t,n){return t=Mse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mse(e){var t=$se(e,"string");return nf(t)=="symbol"?t:t+""}function $se(e,t){if(nf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W2(e,t){if(e==null)return{};var n=Dse(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Dse(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 Lse=function(t){return Array.isArray(t.value)?_se(t.value):t.value};function ro(e){var t=e.valueAccessor,n=t===void 0?Lse:t,r=W2(e,Ase),a=r.data,o=r.dataKey,i=r.clockWise,c=r.id,d=r.textBreakAll,f=W2(r,Ese);return!a||!a.length?null:Y.createElement(Zt,{className:"recharts-label-list"},a.map(function(h,p){var g=Tt(o)?n(h,p):Qn(h&&h.payload,o),x=Tt(c)?{}:{id:"".concat(c,"-").concat(p)};return Y.createElement(ir,ym({},yt(h,!0),f,x,{parentViewBox:h.parentViewBox,value:g,textBreakAll:d,viewBox:ir.parseViewBox(Tt(i)?h:q2(q2({},h),{},{clockWise:i})),key:"label-".concat(p),index:p}))}))}ro.displayName="LabelList";function Fse(e,t){return e?e===!0?Y.createElement(ro,{key:"labelList-implicit",data:t}):Y.isValidElement(e)||kt(e)?Y.createElement(ro,{key:"labelList-implicit",data:t,content:e}):pu(e)?Y.createElement(ro,ym({data:t},e,{key:"labelList-implicit"})):null:null}function Bse(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=fa(r,ro).map(function(i,c){return m.cloneElement(i,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var o=Fse(e.label,t);return[o].concat(Pse(a))}ro.renderCallByParent=Bse;function rf(e){"@babel/helpers - typeof";return rf=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},rf(e)}function t1(){return t1=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},t1.apply(this,arguments)}function V2(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 H2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V2(Object(n),!0).forEach(function(r){zse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zse(e,t,n){return t=Use(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Use(e){var t=qse(e,"string");return rf(t)=="symbol"?t:t+""}function qse(e,t){if(rf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wse=function(t,n){var r=_r(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},xh=function(t){var n=t.cx,r=t.cy,a=t.radius,o=t.angle,i=t.sign,c=t.isExternal,d=t.cornerRadius,f=t.cornerIsExternal,h=d*(c?1:-1)+a,p=Math.asin(d/h)/xm,g=f?o:o+i*p,x=jn(n,r,h,g),j=jn(n,r,a,g),b=f?o-i*p:o,y=jn(n,r,h*Math.cos(p*xm),b);return{center:x,circleTangency:j,lineTangency:y,theta:p}},_4=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,o=t.outerRadius,i=t.startAngle,c=t.endAngle,d=Wse(i,c),f=i+d,h=jn(n,r,o,i),p=jn(n,r,o,f),g="M ".concat(h.x,",").concat(h.y,`
|
|
78
|
-
A `).concat(o,",").concat(o,`,0,
|
|
79
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(i>f),`,
|
|
80
|
-
`).concat(p.x,",").concat(p.y,`
|
|
81
|
-
`);if(a>0){var x=jn(n,r,a,i),j=jn(n,r,a,f);g+="L ".concat(j.x,",").concat(j.y,`
|
|
82
|
-
A `).concat(a,",").concat(a,`,0,
|
|
83
|
-
`).concat(+(Math.abs(d)>180),",").concat(+(i<=f),`,
|
|
84
|
-
`).concat(x.x,",").concat(x.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},Vse=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,o=t.outerRadius,i=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,p=_r(h-f),g=xh({cx:n,cy:r,radius:o,angle:f,sign:p,cornerRadius:i,cornerIsExternal:d}),x=g.circleTangency,j=g.lineTangency,b=g.theta,y=xh({cx:n,cy:r,radius:o,angle:h,sign:-p,cornerRadius:i,cornerIsExternal:d}),S=y.circleTangency,C=y.lineTangency,N=y.theta,E=d?Math.abs(f-h):Math.abs(f-h)-b-N;if(E<0)return c?"M ".concat(j.x,",").concat(j.y,`
|
|
85
|
-
a`).concat(i,",").concat(i,",0,0,1,").concat(i*2,`,0
|
|
86
|
-
a`).concat(i,",").concat(i,",0,0,1,").concat(-i*2,`,0
|
|
87
|
-
`):_4({cx:n,cy:r,innerRadius:a,outerRadius:o,startAngle:f,endAngle:h});var A="M ".concat(j.x,",").concat(j.y,`
|
|
88
|
-
A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(x.x,",").concat(x.y,`
|
|
89
|
-
A`).concat(o,",").concat(o,",0,").concat(+(E>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
|
|
90
|
-
A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(C.x,",").concat(C.y,`
|
|
91
|
-
`);if(a>0){var k=xh({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:i,cornerIsExternal:d}),T=k.circleTangency,O=k.lineTangency,L=k.theta,z=xh({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:i,cornerIsExternal:d}),q=z.circleTangency,F=z.lineTangency,G=z.theta,W=d?Math.abs(f-h):Math.abs(f-h)-L-G;if(W<0&&i===0)return"".concat(A,"L").concat(n,",").concat(r,"Z");A+="L".concat(F.x,",").concat(F.y,`
|
|
92
|
-
A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(q.x,",").concat(q.y,`
|
|
93
|
-
A`).concat(a,",").concat(a,",0,").concat(+(W>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,`
|
|
94
|
-
A`).concat(i,",").concat(i,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,"Z")}else A+="L".concat(n,",").concat(r,"Z");return A},Hse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},A4=function(t){var n=H2(H2({},Hse),t),r=n.cx,a=n.cy,o=n.innerRadius,i=n.outerRadius,c=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,g=n.className;if(i<o||h===p)return null;var x=Ot("recharts-sector",g),j=i-o,b=Ar(c,j,0,!0),y;return b>0&&Math.abs(h-p)<360?y=Vse({cx:r,cy:a,innerRadius:o,outerRadius:i,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):y=_4({cx:r,cy:a,innerRadius:o,outerRadius:i,startAngle:h,endAngle:p}),Y.createElement("path",t1({},yt(n,!0),{className:x,d:y,role:"img"}))};function af(e){"@babel/helpers - typeof";return af=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},af(e)}function n1(){return n1=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},n1.apply(this,arguments)}function K2(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 G2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K2(Object(n),!0).forEach(function(r){Kse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kse(e,t,n){return t=Gse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gse(e){var t=Yse(e,"string");return af(t)=="symbol"?t:t+""}function Yse(e,t){if(af(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(af(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Y2={curveBasisClosed:mJ,curveBasisOpen:vJ,curveBasis:hJ,curveBumpX:eJ,curveBumpY:tJ,curveLinearClosed:gJ,curveLinear:Iv,curveMonotoneX:xJ,curveMonotoneY:yJ,curveNatural:bJ,curveStep:wJ,curveStepAfter:SJ,curveStepBefore:jJ},yh=function(t){return t.x===+t.x&&t.y===+t.y},dd=function(t){return t.x},fd=function(t){return t.y},Xse=function(t,n){if(kt(t))return t;var r="curve".concat(Ov(t));return(r==="curveMonotone"||r==="curveBump")&&n?Y2["".concat(r).concat(n==="vertical"?"Y":"X")]:Y2[r]||Iv},Jse=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,o=a===void 0?[]:a,i=t.baseLine,c=t.layout,d=t.connectNulls,f=d===void 0?!1:d,h=Xse(r,c),p=f?o.filter(function(b){return yh(b)}):o,g;if(Array.isArray(i)){var x=f?i.filter(function(b){return yh(b)}):i,j=p.map(function(b,y){return G2(G2({},b),{},{base:x[y]})});return c==="vertical"?g=uh().y(fd).x1(dd).x0(function(b){return b.base.x}):g=uh().x(dd).y1(fd).y0(function(b){return b.base.y}),g.defined(yh).curve(h),g(j)}return c==="vertical"&&qe(i)?g=uh().y(fd).x1(dd).x0(i):qe(i)?g=uh().x(dd).y1(fd).y0(i):g=A3().x(dd).y(fd),g.defined(yh).curve(h),g(p)},bm=function(t){var n=t.className,r=t.points,a=t.path,o=t.pathRef;if((!r||!r.length)&&!a)return null;var i=r&&r.length?Jse(t):a;return m.createElement("path",n1({},yt(t,!1),Vh(t),{className:Ot("recharts-curve",n),d:i,ref:o}))},aj={exports:{}},sj,X2;function Qse(){if(X2)return sj;X2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return sj=e,sj}var oj,J2;function Zse(){if(J2)return oj;J2=1;var e=Qse();function t(){}function n(){}return n.resetWarningCache=t,oj=function(){function r(i,c,d,f,h,p){if(p!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function a(){return r}var o={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 o.PropTypes=o,o},oj}var Q2;function eoe(){return Q2||(Q2=1,aj.exports=Zse()()),aj.exports}var toe=eoe();const sn=ln(toe),{getOwnPropertyNames:noe,getOwnPropertySymbols:roe}=Object,{hasOwnProperty:aoe}=Object.prototype;function ij(e,t){return function(r,a,o){return e(r,a,o)&&t(r,a,o)}}function bh(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);const{cache:o}=a,i=o.get(n),c=o.get(r);if(i&&c)return i===r&&c===n;o.set(n,r),o.set(r,n);const d=e(n,r,a);return o.delete(n),o.delete(r),d}}function soe(e){return e?.[Symbol.toStringTag]}function Z2(e){return noe(e).concat(roe(e))}const ooe=Object.hasOwn||((e,t)=>aoe.call(e,t));function yl(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const ioe="__v",loe="__o",coe="_owner",{getOwnPropertyDescriptor:eI,keys:tI}=Object;function uoe(e,t){return e.byteLength===t.byteLength&&wm(new Uint8Array(e),new Uint8Array(t))}function doe(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 foe(e,t){return e.byteLength===t.byteLength&&wm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function poe(e,t){return yl(e.getTime(),t.getTime())}function hoe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function moe(e,t){return e===t}function nI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),o=e.entries();let i,c,d=0;for(;(i=o.next())&&!i.done;){const f=t.entries();let h=!1,p=0;for(;(c=f.next())&&!c.done;){if(a[p]){p++;continue}const g=i.value,x=c.value;if(n.equals(g[0],x[0],d,p,e,t,n)&&n.equals(g[1],x[1],g[0],x[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const voe=yl;function goe(e,t,n){const r=tI(e);let a=r.length;if(tI(t).length!==a)return!1;for(;a-- >0;)if(!E4(e,t,n,r[a]))return!1;return!0}function pd(e,t,n){const r=Z2(e);let a=r.length;if(Z2(t).length!==a)return!1;let o,i,c;for(;a-- >0;)if(o=r[a],!E4(e,t,n,o)||(i=eI(e,o),c=eI(t,o),(i||c)&&(!i||!c||i.configurable!==c.configurable||i.enumerable!==c.enumerable||i.writable!==c.writable)))return!1;return!0}function xoe(e,t){return yl(e.valueOf(),t.valueOf())}function yoe(e,t){return e.source===t.source&&e.flags===t.flags}function rI(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),o=e.values();let i,c;for(;(i=o.next())&&!i.done;){const d=t.values();let f=!1,h=0;for(;(c=d.next())&&!c.done;){if(!a[h]&&n.equals(i.value,c.value,i.value,c.value,e,t,n)){f=a[h]=!0;break}h++}if(!f)return!1}return!0}function wm(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 boe(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 E4(e,t,n,r){return(r===coe||r===loe||r===ioe)&&(e.$$typeof||t.$$typeof)?!0:ooe(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const woe="[object ArrayBuffer]",joe="[object Arguments]",Soe="[object Boolean]",Noe="[object DataView]",Coe="[object Date]",_oe="[object Error]",Aoe="[object Map]",Eoe="[object Number]",Poe="[object Object]",koe="[object RegExp]",Toe="[object Set]",Ooe="[object String]",Roe={"[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},Ioe="[object URL]",Moe=Object.prototype.toString;function $oe({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:g,areUrlsEqual:x,unknownTagComparators:j}){return function(y,S,C){if(y===S)return!0;if(y==null||S==null)return!1;const N=typeof y;if(N!==typeof S)return!1;if(N!=="object")return N==="number"?c(y,S,C):N==="function"?o(y,S,C):!1;const E=y.constructor;if(E!==S.constructor)return!1;if(E===Object)return d(y,S,C);if(Array.isArray(y))return t(y,S,C);if(E===Date)return r(y,S,C);if(E===RegExp)return h(y,S,C);if(E===Map)return i(y,S,C);if(E===Set)return p(y,S,C);const A=Moe.call(y);if(A===Coe)return r(y,S,C);if(A===koe)return h(y,S,C);if(A===Aoe)return i(y,S,C);if(A===Toe)return p(y,S,C);if(A===Poe)return typeof y.then!="function"&&typeof S.then!="function"&&d(y,S,C);if(A===Ioe)return x(y,S,C);if(A===_oe)return a(y,S,C);if(A===joe)return d(y,S,C);if(Roe[A])return g(y,S,C);if(A===woe)return e(y,S,C);if(A===Noe)return n(y,S,C);if(A===Soe||A===Eoe||A===Ooe)return f(y,S,C);if(j){let k=j[A];if(!k){const T=soe(y);T&&(k=j[T])}if(k)return k(y,S,C)}return!1}}function Doe({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:uoe,areArraysEqual:n?pd:doe,areDataViewsEqual:foe,areDatesEqual:poe,areErrorsEqual:hoe,areFunctionsEqual:moe,areMapsEqual:n?ij(nI,pd):nI,areNumbersEqual:voe,areObjectsEqual:n?pd:goe,arePrimitiveWrappersEqual:xoe,areRegExpsEqual:yoe,areSetsEqual:n?ij(rI,pd):rI,areTypedArraysEqual:n?ij(wm,pd):wm,areUrlsEqual:boe,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=bh(r.areArraysEqual),o=bh(r.areMapsEqual),i=bh(r.areObjectsEqual),c=bh(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:i,areSetsEqual:c})}return r}function Loe(e){return function(t,n,r,a,o,i,c){return e(t,n,c)}}function Foe({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 o={cache:void 0,equals:r,meta:void 0,strict:a};return function(c,d){return t(c,d,o)}}const Boe=ii();ii({strict:!0});ii({circular:!0});ii({circular:!0,strict:!0});ii({createInternalComparator:()=>yl});ii({strict:!0,createInternalComparator:()=>yl});ii({circular:!0,createInternalComparator:()=>yl});ii({circular:!0,createInternalComparator:()=>yl,strict:!0});function ii(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,o=Doe(e),i=$oe(o),c=n?n(i):Loe(i);return Foe({circular:t,comparator:i,createState:r,equals:c,strict:a})}function zoe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function aI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(o){n<0&&(n=o),o-n>t?(e(o),n=-1):zoe(a)};requestAnimationFrame(r)}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)}function Uoe(e){return Hoe(e)||Voe(e)||Woe(e)||qoe()}function qoe(){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 Woe(e,t){if(e){if(typeof e=="string")return sI(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 sI(e,t)}}function sI(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 Voe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hoe(e){if(Array.isArray(e))return e}function Koe(){var e={},t=function(){return null},n=!1,r=function a(o){if(!n){if(Array.isArray(o)){if(!o.length)return;var i=o,c=Uoe(i),d=c[0],f=c.slice(1);if(typeof d=="number"){aI(a.bind(null,f),d);return}a(d),aI(a.bind(null,f));return}r1(o)==="object"&&(e=o,t(e)),typeof o=="function"&&o()}};return{stop:function(){n=!0},start:function(o){n=!1,r(o)},subscribe:function(o){return t=o,function(){t=function(){return null}}}}}function sf(e){"@babel/helpers - typeof";return sf=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},sf(e)}function oI(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 iI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(n),!0).forEach(function(r){P4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P4(e,t,n){return t=Goe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Goe(e){var t=Yoe(e,"string");return sf(t)==="symbol"?t:String(t)}function Yoe(e,t){if(sf(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sf(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xoe=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(o){return a.includes(o)})})},Joe=function(t){return t},Qoe=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},_d=function(t,n){return Object.keys(n).reduce(function(r,a){return iI(iI({},r),{},P4({},a,t(a,n[a])))},{})},lI=function(t,n,r){return t.map(function(a){return"".concat(Qoe(a)," ").concat(n,"ms ").concat(r)}).join(",")};function Zoe(e,t){return nie(e)||tie(e,t)||k4(e,t)||eie()}function eie(){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 tie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function nie(e){if(Array.isArray(e))return e}function rie(e){return oie(e)||sie(e)||k4(e)||aie()}function aie(){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 k4(e,t){if(e){if(typeof e=="string")return a1(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 a1(e,t)}}function sie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oie(e){if(Array.isArray(e))return a1(e)}function a1(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 jm=1e-4,T4=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},O4=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},cI=function(t,n){return function(r){var a=T4(t,n);return O4(a,r)}},iie=function(t,n){return function(r){var a=T4(t,n),o=[].concat(rie(a.map(function(i,c){return i*c}).slice(1)),[0]);return O4(o,r)}},uI=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],o=n[1],i=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,o=0,i=1,c=1;break;case"ease":a=.25,o=.1,i=.25,c=1;break;case"ease-in":a=.42,o=0,i=1,c=1;break;case"ease-out":a=.42,o=0,i=.58,c=1;break;case"ease-in-out":a=0,o=0,i=.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(y){return parseFloat(y)}),h=Zoe(f,4);a=h[0],o=h[1],i=h[2],c=h[3]}}}var p=cI(a,i),g=cI(o,c),x=iie(a,i),j=function(S){return S>1?1:S<0?0:S},b=function(S){for(var C=S>1?1:S,N=C,E=0;E<8;++E){var A=p(N)-C,k=x(N);if(Math.abs(A-C)<jm||k<jm)return g(N);N=j(N-A/k)}return g(N)};return b.isStepper=!1,b},lie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,o=a===void 0?8:a,i=t.dt,c=i===void 0?17:i,d=function(h,p,g){var x=-(h-p)*r,j=g*o,b=g+(x-j)*c/1e3,y=g*c/1e3+h;return Math.abs(y-p)<jm&&Math.abs(b)<jm?[p,0]:[y,b]};return d.isStepper=!0,d.dt=c,d},cie=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 uI(a);case"spring":return lie();default:if(a.split("(")[0]==="cubic-bezier")return uI(a)}return typeof a=="function"?a:null};function of(e){"@babel/helpers - typeof";return of=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},of(e)}function dI(e){return fie(e)||die(e)||R4(e)||uie()}function uie(){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 die(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fie(e){if(Array.isArray(e))return o1(e)}function fI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fI(Object(n),!0).forEach(function(r){s1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function s1(e,t,n){return t=pie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pie(e){var t=hie(e,"string");return of(t)==="symbol"?t:String(t)}function hie(e,t){if(of(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(of(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mie(e,t){return xie(e)||gie(e,t)||R4(e,t)||vie()}function vie(){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 R4(e,t){if(e){if(typeof e=="string")return o1(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 o1(e,t)}}function o1(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 gie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function xie(e){if(Array.isArray(e))return e}var Sm=function(t,n,r){return t+(n-t)*r},i1=function(t){var n=t.from,r=t.to;return n!==r},yie=function e(t,n,r){var a=_d(function(o,i){if(i1(i)){var c=t(i.from,i.to,i.velocity),d=mie(c,2),f=d[0],h=d[1];return fr(fr({},i),{},{from:f,velocity:h})}return i},n);return r<1?_d(function(o,i){return i1(i)?fr(fr({},i),{},{velocity:Sm(i.velocity,a[o].velocity,r),from:Sm(i.from,a[o].from,r)}):i},n):e(t,a,r-1)};const bie=(function(e,t,n,r,a){var o=Xoe(e,t),i=o.reduce(function(y,S){return fr(fr({},y),{},s1({},S,[e[S],t[S]]))},{}),c=o.reduce(function(y,S){return fr(fr({},y),{},s1({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},g=function(){return _d(function(S,C){return C.from},c)},x=function(){return!Object.values(c).filter(i1).length},j=function(S){f||(f=S);var C=S-f,N=C/n.dt;c=yie(n,c,N),a(fr(fr(fr({},e),t),g())),f=S,x()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var C=(S-h)/r,N=_d(function(A,k){return Sm.apply(void 0,dI(k).concat([n(C)]))},i);if(a(fr(fr(fr({},e),t),N)),C<1)d=requestAnimationFrame(p);else{var E=_d(function(A,k){return Sm.apply(void 0,dI(k).concat([n(1)]))},i);a(fr(fr(fr({},e),t),E))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});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)}var wie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function jie(e,t){if(e==null)return{};var n=Sie(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sie(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function lj(e){return Aie(e)||_ie(e)||Cie(e)||Nie()}function Nie(){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 Cie(e,t){if(e){if(typeof e=="string")return l1(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 l1(e,t)}}function _ie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Aie(e){if(Array.isArray(e))return l1(e)}function l1(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 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 Wa(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){yd(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 yd(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 Eie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pie(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 kie(e,t,n){return t&&Pie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function I4(e){var t=Tie(e,"string");return Mc(t)==="symbol"?t:String(t)}function Tie(e,t){if(Mc(e)!=="object"||e===null)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(t==="string"?String:Number)(e)}function Oie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c1(e,t)}function c1(e,t){return c1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},c1(e,t)}function Rie(e){var t=Iie();return function(){var r=Nm(e),a;if(t){var o=Nm(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return u1(this,a)}}function u1(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 d1(e)}function d1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Iie(){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 Nm(e){return Nm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nm(e)}var Ps=(function(e){Oie(n,e);var t=Rie(n);function n(r,a){var o;Eie(this,n),o=t.call(this,r,a);var i=o.props,c=i.isActive,d=i.attributeName,f=i.from,h=i.to,p=i.steps,g=i.children,x=i.duration;if(o.handleStyleChange=o.handleStyleChange.bind(d1(o)),o.changeStyle=o.changeStyle.bind(d1(o)),!c||x<=0)return o.state={style:{}},typeof g=="function"&&(o.state={style:h}),u1(o);if(p&&p.length)o.state={style:p[0].style};else if(f){if(typeof g=="function")return o.state={style:f},u1(o);o.state={style:d?yd({},d,f):f}}else o.state={style:{}};return o}return kie(n,[{key:"componentDidMount",value:function(){var a=this.props,o=a.isActive,i=a.canBegin;this.mounted=!0,!(!o||!i)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var o=this.props,i=o.isActive,c=o.canBegin,d=o.attributeName,f=o.shouldReAnimate,h=o.to,p=o.from,g=this.state.style;if(c){if(!i){var x={style:d?yd({},d,h):h};this.state&&g&&(d&&g[d]!==h||!d&&g!==h)&&this.setState(x);return}if(!(Boe(a.to,h)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:a.to;if(this.state&&g){var y={style:d?yd({},d,b):b};(d&&g[d]!==b||!d&&g!==b)&&this.setState(y)}this.runAnimation(Wa(Wa({},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 o=this,i=a.from,c=a.to,d=a.duration,f=a.easing,h=a.begin,p=a.onAnimationEnd,g=a.onAnimationStart,x=bie(i,c,cie(f),d,this.changeStyle),j=function(){o.stopJSAnimation=x()};this.manager.start([g,h,j,d,p])}},{key:"runStepAnimation",value:function(a){var o=this,i=a.steps,c=a.begin,d=a.onAnimationStart,f=i[0],h=f.style,p=f.duration,g=p===void 0?0:p,x=function(b,y,S){if(S===0)return b;var C=y.duration,N=y.easing,E=N===void 0?"ease":N,A=y.style,k=y.properties,T=y.onAnimationEnd,O=S>0?i[S-1]:y,L=k||Object.keys(A);if(typeof E=="function"||E==="spring")return[].concat(lj(b),[o.runJSAnimation.bind(o,{from:O.style,to:A,duration:C,easing:E}),C]);var z=lI(L,C,E),q=Wa(Wa(Wa({},O.style),A),{},{transition:z});return[].concat(lj(b),[q,C,T]).filter(Joe)};return this.manager.start([d].concat(lj(i.reduce(x,[h,Math.max(g,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Koe());var o=a.begin,i=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,g=a.steps,x=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof x=="function"||f==="spring"){this.runJSAnimation(a);return}if(g.length>1){this.runStepAnimation(a);return}var b=c?yd({},c,d):d,y=lI(Object.keys(b),i,f);j.start([h,o,Wa(Wa({},b),{},{transition:y}),i,p])}},{key:"render",value:function(){var a=this.props,o=a.children;a.begin;var i=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=jie(a,wie),f=m.Children.count(o),h=this.state.style;if(typeof o=="function")return o(h);if(!c||f===0||i<=0)return o;var p=function(x){var j=x.props,b=j.style,y=b===void 0?{}:b,S=j.className,C=m.cloneElement(x,Wa(Wa({},d),{},{style:Wa(Wa({},y),h),className:S}));return C};return f===1?p(m.Children.only(o)):Y.createElement("div",null,m.Children.map(o,function(g){return p(g)}))}}]),n})(m.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:sn.oneOfType([sn.object,sn.string]),to:sn.oneOfType([sn.object,sn.string]),attributeName:sn.string,duration:sn.number,begin:sn.number,easing:sn.oneOfType([sn.string,sn.func]),steps:sn.arrayOf(sn.shape({duration:sn.number.isRequired,style:sn.object.isRequired,easing:sn.oneOfType([sn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),sn.func]),properties:sn.arrayOf("string"),onAnimationEnd:sn.func})),children:sn.oneOfType([sn.node,sn.func]),isActive:sn.bool,canBegin:sn.bool,onAnimationEnd:sn.func,shouldReAnimate:sn.bool,onAnimationStart:sn.func,onAnimationReStart:sn.func};function lf(e){"@babel/helpers - typeof";return lf=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},lf(e)}function Cm(){return Cm=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},Cm.apply(this,arguments)}function Mie(e,t){return Fie(e)||Lie(e,t)||Die(e,t)||$ie()}function $ie(){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 Die(e,t){if(e){if(typeof e=="string")return hI(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 hI(e,t)}}function hI(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 Lie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function Fie(e){if(Array.isArray(e))return e}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 vI(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){Bie(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 Bie(e,t,n){return t=zie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zie(e){var t=Uie(e,"string");return lf(t)=="symbol"?t:t+""}function Uie(e,t){if(lf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gI=function(t,n,r,a,o){var i=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(i>0&&o instanceof Array){for(var p=[0,0,0,0],g=0,x=4;g<x;g++)p[g]=o[g]>i?i:o[g];h="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),h+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`,
|
|
102
|
-
`).concat(t+r,",").concat(n+c*p[1])),h+="L ".concat(t+r,",").concat(n+a-c*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`,
|
|
103
|
-
`).concat(t+r-d*p[2],",").concat(n+a)),h+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`,
|
|
104
|
-
`).concat(t,",").concat(n+a-c*p[3])),h+="Z"}else if(i>0&&o===+o&&o>0){var j=Math.min(i,o);h="M ".concat(t,",").concat(n+c*j,`
|
|
105
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,`
|
|
106
|
-
L `).concat(t+r-d*j,",").concat(n,`
|
|
107
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+c*j,`
|
|
108
|
-
L `).concat(t+r,",").concat(n+a-c*j,`
|
|
109
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,`
|
|
110
|
-
L `).concat(t+d*j,",").concat(n+a,`
|
|
111
|
-
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-c*j," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return h},qie=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,o=n.x,i=n.y,c=n.width,d=n.height;if(Math.abs(c)>0&&Math.abs(d)>0){var f=Math.min(o,o+c),h=Math.max(o,o+c),p=Math.min(i,i+d),g=Math.max(i,i+d);return r>=f&&r<=h&&a>=p&&a<=g}return!1},Wie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},EC=function(t){var n=vI(vI({},Wie),t),r=m.useRef(),a=m.useState(-1),o=Mie(a,2),i=o[0],c=o[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&c(E)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,g=n.radius,x=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isAnimationActive,C=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var N=Ot("recharts-rectangle",x);return C?Y.createElement(Ps,{canBegin:i>0,from:{width:h,height:p,x:d,y:f},to:{width:h,height:p,x:d,y:f},duration:b,animationEasing:j,isActive:C},function(E){var A=E.width,k=E.height,T=E.x,O=E.y;return Y.createElement(Ps,{canBegin:i>0,from:"0px ".concat(i===-1?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,isActive:S,easing:j},Y.createElement("path",Cm({},yt(n,!0),{className:N,d:gI(T,O,A,k,g),ref:r})))}):Y.createElement("path",Cm({},yt(n,!0),{className:N,d:gI(d,f,h,p,g)}))},Vie=["points","className","baseLinePoints","connectNulls"];function lc(){return lc=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},lc.apply(this,arguments)}function Hie(e,t){if(e==null)return{};var n=Kie(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Kie(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 xI(e){return Jie(e)||Xie(e)||Yie(e)||Gie()}function Gie(){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 Yie(e,t){if(e){if(typeof e=="string")return f1(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 f1(e,t)}}function Xie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jie(e){if(Array.isArray(e))return f1(e)}function f1(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 yI=function(t){return t&&t.x===+t.x&&t.y===+t.y},Qie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){yI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),yI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Ad=function(t,n){var r=Qie(t);n&&(r=[r.reduce(function(o,i){return[].concat(xI(o),xI(i))},[])]);var a=r.map(function(o){return o.reduce(function(i,c,d){return"".concat(i).concat(d===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},Zie=function(t,n,r){var a=Ad(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Ad(n.reverse(),r).slice(1))},ele=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,o=t.connectNulls,i=Hie(t,Vie);if(!n||!n.length)return null;var c=Ot("recharts-polygon",r);if(a&&a.length){var d=i.stroke&&i.stroke!=="none",f=Zie(n,a,o);return Y.createElement("g",{className:c},Y.createElement("path",lc({},yt(i,!0),{fill:f.slice(-1)==="Z"?i.fill:"none",stroke:"none",d:f})),d?Y.createElement("path",lc({},yt(i,!0),{fill:"none",d:Ad(n,o)})):null,d?Y.createElement("path",lc({},yt(i,!0),{fill:"none",d:Ad(a,o)})):null)}var h=Ad(n,o);return Y.createElement("path",lc({},yt(i,!0),{fill:h.slice(-1)==="Z"?i.fill:"none",className:c,d:h}))};function p1(){return p1=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},p1.apply(this,arguments)}var Jv=function(t){var n=t.cx,r=t.cy,a=t.r,o=t.className,i=Ot("recharts-dot",o);return n===+n&&r===+r&&a===+a?m.createElement("circle",p1({},yt(t,!1),Vh(t),{className:i,cx:n,cy:r,r:a})):null};function cf(e){"@babel/helpers - typeof";return cf=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},cf(e)}var tle=["x","y","top","left","width","height","className"];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 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 nle(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){rle(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 rle(e,t,n){return t=ale(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ale(e){var t=sle(e,"string");return cf(t)=="symbol"?t:t+""}function sle(e,t){if(cf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ole(e,t){if(e==null)return{};var n=ile(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ile(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 lle=function(t,n,r,a,o,i){return"M".concat(t,",").concat(o,"v").concat(a,"M").concat(i,",").concat(n,"h").concat(r)},cle=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,i=t.top,c=i===void 0?0:i,d=t.left,f=d===void 0?0:d,h=t.width,p=h===void 0?0:h,g=t.height,x=g===void 0?0:g,j=t.className,b=ole(t,tle),y=nle({x:r,y:o,top:c,left:f,width:p,height:x},b);return!qe(r)||!qe(o)||!qe(p)||!qe(x)||!qe(c)||!qe(f)?null:Y.createElement("path",h1({},yt(y,!0),{className:Ot("recharts-cross",j),d:lle(r,o,p,x,c,f)}))},cj,wI;function ule(){if(wI)return cj;wI=1;var e=Hv(),t=XL(),n=Ms();function r(a,o){return a&&a.length?e(a,n(o,2),t):void 0}return cj=r,cj}var dle=ule();const fle=ln(dle);var uj,jI;function ple(){if(jI)return uj;jI=1;var e=Hv(),t=Ms(),n=JL();function r(a,o){return a&&a.length?e(a,t(o,2),n):void 0}return uj=r,uj}var hle=ple();const mle=ln(hle);var vle=["cx","cy","angle","ticks","axisLine"],gle=["ticks","tick","angle","tickFormatter","stroke"];function $c(e){"@babel/helpers - typeof";return $c=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},$c(e)}function Ed(){return Ed=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},Ed.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 _i(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){Qv(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 NI(e,t){if(e==null)return{};var n=xle(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xle(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 yle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CI(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 ble(e,t,n){return t&&CI(e.prototype,t),n&&CI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wle(e,t,n){return t=_m(t),jle(e,M4()?Reflect.construct(t,n||[],_m(e).constructor):t.apply(e,n))}function jle(e,t){if(t&&($c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sle(e)}function Sle(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 _m(e){return _m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_m(e)}function Nle(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&&m1(e,t)}function m1(e,t){return m1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},m1(e,t)}function Qv(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=Cle(e,"string");return $c(t)=="symbol"?t:t+""}function Cle(e,t){if($c(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zv=(function(e){function t(){return yle(this,t),wle(this,t,arguments)}return Nle(t,e),ble(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,o=this.props,i=o.angle,c=o.cx,d=o.cy;return jn(c,d,a,i)}},{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,o=r.cy,i=r.angle,c=r.ticks,d=fle(c,function(h){return h.coordinate||0}),f=mle(c,function(h){return h.coordinate||0});return{cx:a,cy:o,startAngle:i,endAngle:i,innerRadius:f.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,o=r.cy,i=r.angle,c=r.ticks,d=r.axisLine,f=NI(r,vle),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=jn(a,o,h[0],i),g=jn(a,o,h[1],i),x=_i(_i(_i({},yt(f,!1)),{},{fill:"none"},yt(d,!1)),{},{x1:p.x,y1:p.y,x2:g.x,y2:g.y});return Y.createElement("line",Ed({className:"recharts-polar-radius-axis-line"},x))}},{key:"renderTicks",value:function(){var r=this,a=this.props,o=a.ticks,i=a.tick,c=a.angle,d=a.tickFormatter,f=a.stroke,h=NI(a,gle),p=this.getTickTextAnchor(),g=yt(h,!1),x=yt(i,!1),j=o.map(function(b,y){var S=r.getTickValueCoord(b),C=_i(_i(_i(_i({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},g),{},{stroke:"none",fill:f},x),{},{index:y},S),{},{payload:b});return Y.createElement(Zt,Ed({className:Ot("recharts-polar-radius-axis-tick",N4(i)),key:"tick-".concat(b.coordinate)},Yi(r.props,b,y)),t.renderTickItem(i,C,d?d(b.value,y):b.value))});return Y.createElement(Zt,{className:"recharts-polar-radius-axis-ticks"},j)}},{key:"render",value:function(){var r=this.props,a=r.ticks,o=r.axisLine,i=r.tick;return!a||!a.length?null:Y.createElement(Zt,{className:Ot("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),i&&this.renderTicks(),ir.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,o){var i;return Y.isValidElement(r)?i=Y.cloneElement(r,a):kt(r)?i=r(a):i=Y.createElement(Xi,Ed({},a,{className:"recharts-polar-radius-axis-tick-value"}),o),i}}])})(m.PureComponent);Qv(Zv,"displayName","PolarRadiusAxis");Qv(Zv,"axisType","radiusAxis");Qv(Zv,"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 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 Ri(){return Ri=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},Ri.apply(this,arguments)}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){eg(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 _le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AI(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,L4(r.key),r)}}function Ale(e,t,n){return t&&AI(e.prototype,t),n&&AI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ele(e,t,n){return t=Am(t),Ple(e,D4()?Reflect.construct(t,n||[],Am(e).constructor):t.apply(e,n))}function Ple(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 kle(e)}function kle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D4=function(){return!!e})()}function Am(e){return Am=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Am(e)}function Tle(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 eg(e,t,n){return t=L4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L4(e){var t=Ole(e,"string");return Dc(t)=="symbol"?t:t+""}function Ole(e,t){if(Dc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rle=Math.PI/180,EI=1e-5,tg=(function(e){function t(){return _le(this,t),Ele(this,t,arguments)}return Tle(t,e),Ale(t,[{key:"getTickLineCoord",value:function(r){var a=this.props,o=a.cx,i=a.cy,c=a.radius,d=a.orientation,f=a.tickSize,h=f||8,p=jn(o,i,c,r.coordinate),g=jn(o,i,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:g.x,y2:g.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,o=Math.cos(-r.coordinate*Rle),i;return o>EI?i=a==="outer"?"start":"end":o<-EI?i=a==="outer"?"end":"start":i="middle",i}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,o=r.cy,i=r.radius,c=r.axisLine,d=r.axisLineType,f=Ai(Ai({},yt(this.props,!1)),{},{fill:"none"},yt(c,!1));if(d==="circle")return Y.createElement(Jv,Ri({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:o,r:i}));var h=this.props.ticks,p=h.map(function(g){return jn(a,o,i,g.coordinate)});return Y.createElement(ele,Ri({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,o=a.ticks,i=a.tick,c=a.tickLine,d=a.tickFormatter,f=a.stroke,h=yt(this.props,!1),p=yt(i,!1),g=Ai(Ai({},h),{},{fill:"none"},yt(c,!1)),x=o.map(function(j,b){var y=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),C=Ai(Ai(Ai({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:y.x2,y:y.y2});return Y.createElement(Zt,Ri({className:Ot("recharts-polar-angle-axis-tick",N4(i)),key:"tick-".concat(j.coordinate)},Yi(r.props,j,b)),c&&Y.createElement("line",Ri({className:"recharts-polar-angle-axis-tick-line"},g,y)),i&&t.renderTickItem(i,C,d?d(j.value,b):j.value))});return Y.createElement(Zt,{className:"recharts-polar-angle-axis-ticks"},x)}},{key:"render",value:function(){var r=this.props,a=r.ticks,o=r.radius,i=r.axisLine;return o<=0||!a||!a.length?null:Y.createElement(Zt,{className:Ot("recharts-polar-angle-axis",this.props.className)},i&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,o){var i;return Y.isValidElement(r)?i=Y.cloneElement(r,a):kt(r)?i=r(a):i=Y.createElement(Xi,Ri({},a,{className:"recharts-polar-angle-axis-tick-value"}),o),i}}])})(m.PureComponent);eg(tg,"displayName","PolarAngleAxis");eg(tg,"axisType","angleAxis");eg(tg,"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 dj,PI;function Ile(){if(PI)return dj;PI=1;var e=X3(),t=e(Object.getPrototypeOf,Object);return dj=t,dj}var fj,kI;function Mle(){if(kI)return fj;kI=1;var e=po(),t=Ile(),n=ho(),r="[object Object]",a=Function.prototype,o=Object.prototype,i=a.toString,c=o.hasOwnProperty,d=i.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var g=c.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&i.call(g)==d}return fj=f,fj}var $le=Mle();const Dle=ln($le);var pj,TI;function Lle(){if(TI)return pj;TI=1;var e=po(),t=ho(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return pj=r,pj}var Fle=Lle();const Ble=ln(Fle);function uf(e){"@babel/helpers - typeof";return uf=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},uf(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 zle(e,t){return Vle(e)||Wle(e,t)||qle(e,t)||Ule()}function Ule(){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 qle(e,t){if(e){if(typeof e=="string")return OI(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 OI(e,t)}}function OI(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 Wle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function Vle(e){if(Array.isArray(e))return 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 II(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){Hle(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 Hle(e,t,n){return t=Kle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kle(e){var t=Gle(e,"string");return uf(t)=="symbol"?t:t+""}function Gle(e,t){if(uf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MI=function(t,n,r,a,o){var i=r-a,c;return c="M ".concat(t,",").concat(n),c+="L ".concat(t+r,",").concat(n),c+="L ".concat(t+r-i/2,",").concat(n+o),c+="L ".concat(t+r-i/2-a,",").concat(n+o),c+="L ".concat(t,",").concat(n," Z"),c},Yle={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Xle=function(t){var n=II(II({},Yle),t),r=m.useRef(),a=m.useState(-1),o=zle(a,2),i=o[0],c=o[1];m.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&c(N)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,g=n.height,x=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||g!==+g||h===0&&p===0||g===0)return null;var C=Ot("recharts-trapezoid",x);return S?Y.createElement(Ps,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:g,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(N){var E=N.upperWidth,A=N.lowerWidth,k=N.height,T=N.x,O=N.y;return Y.createElement(Ps,{canBegin:i>0,from:"0px ".concat(i===-1?1:i,"px"),to:"".concat(i,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,easing:j},Y.createElement("path",Em({},yt(n,!0),{className:C,d:MI(T,O,E,A,k),ref:r})))}):Y.createElement("g",null,Y.createElement("path",Em({},yt(n,!0),{className:C,d:MI(d,f,h,p,g)})))},Jle=["option","shapeType","propTransformer","activeClassName","isActive"];function df(e){"@babel/helpers - typeof";return df=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},df(e)}function Qle(e,t){if(e==null)return{};var n=Zle(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zle(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 $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 Pm(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){ece(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 ece(e,t,n){return t=tce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tce(e){var t=nce(e,"string");return df(t)=="symbol"?t:t+""}function nce(e,t){if(df(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(df(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rce(e,t){return Pm(Pm({},t),e)}function ace(e,t){return e==="symbols"}function DI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return Y.createElement(EC,n);case"trapezoid":return Y.createElement(Xle,n);case"sector":return Y.createElement(A4,n);case"symbols":if(ace(t))return Y.createElement(KN,n);break;default:return null}}function sce(e){return m.isValidElement(e)?e.props:e}function F4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?rce:r,o=e.activeClassName,i=o===void 0?"recharts-active-shape":o,c=e.isActive,d=Qle(e,Jle),f;if(m.isValidElement(t))f=m.cloneElement(t,Pm(Pm({},d),sce(t)));else if(kt(t))f=t(d);else if(Dle(t)&&!Ble(t)){var h=a(t,d);f=Y.createElement(DI,{shapeType:n,elementProps:h})}else{var p=d;f=Y.createElement(DI,{shapeType:n,elementProps:p})}return c?Y.createElement(Zt,{className:i},f):f}function ng(e,t){return t!=null&&"trapezoids"in e.props}function rg(e,t){return t!=null&&"sectors"in e.props}function ff(e,t){return t!=null&&"points"in e.props}function oce(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,o=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&o}function ice(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function lce(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function cce(e,t){var n;return ng(e,t)?n=oce:rg(e,t)?n=ice:ff(e,t)&&(n=lce),n}function uce(e,t){var n;return ng(e,t)?n="trapezoids":rg(e,t)?n="sectors":ff(e,t)&&(n="points"),n}function dce(e,t){if(ng(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(rg(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 ff(e,t)?t.payload:{}}function fce(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=uce(n,t),o=dce(n,t),i=r.filter(function(d,f){var h=zf(o,d),p=n.props[a].filter(function(j){var b=cce(n,t);return b(j,t)}),g=n.props[a].indexOf(p[p.length-1]),x=f===g;return h&&x}),c=r.indexOf(i[i.length-1]);return c}var Oh;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 cc(){return cc=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},cc.apply(this,arguments)}function LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(r){Aa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FI(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,z4(r.key),r)}}function hce(e,t,n){return t&&FI(e.prototype,t),n&&FI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mce(e,t,n){return t=km(t),vce(e,B4()?Reflect.construct(t,n||[],km(e).constructor):t.apply(e,n))}function vce(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 gce(e)}function gce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B4=function(){return!!e})()}function km(e){return km=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},km(e)}function xce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g1(e,t)}function g1(e,t){return g1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},g1(e,t)}function Aa(e,t,n){return t=z4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z4(e){var t=yce(e,"string");return Lc(t)=="symbol"?t:t+""}function yce(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 vo=(function(e){function t(n){var r;return pce(this,t),r=mce(this,t,[n]),Aa(r,"pieRef",null),Aa(r,"sectorRefs",[]),Aa(r,"id",hu("recharts-pie-")),Aa(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),kt(a)&&a()}),Aa(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),kt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return xce(t,e),hce(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 o=this.props,i=o.label,c=o.labelLine,d=o.dataKey,f=o.valueKey,h=yt(this.props,!1),p=yt(i,!1),g=yt(c,!1),x=i&&i.offsetRadius||20,j=r.map(function(b,y){var S=(b.startAngle+b.endAngle)/2,C=jn(b.cx,b.cy,b.outerRadius+x,S),N=xn(xn(xn(xn({},h),b),{},{stroke:"none"},p),{},{index:y,textAnchor:t.getTextAnchor(C.x,b.cx)},C),E=xn(xn(xn(xn({},h),b),{},{fill:"none",stroke:b.fill},g),{},{index:y,points:[jn(b.cx,b.cy,b.outerRadius,S),C]}),A=d;return Tt(d)&&Tt(f)?A="value":Tt(d)&&(A=f),Y.createElement(Zt,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(y)},c&&t.renderLabelLineItem(c,E,"line"),t.renderLabelItem(i,N,Qn(b,A)))});return Y.createElement(Zt,{className:"recharts-pie-labels"},j)}},{key:"renderSectorsStatically",value:function(r){var a=this,o=this.props,i=o.activeShape,c=o.blendStroke,d=o.inactiveShape;return r.map(function(f,h){if(f?.startAngle===0&&f?.endAngle===0&&r.length!==1)return null;var p=a.isActiveIndex(h),g=d&&a.hasActiveIndex()?d:null,x=p?i:g,j=xn(xn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return Y.createElement(Zt,cc({ref:function(y){y&&!a.sectorRefs.includes(y)&&a.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},Yi(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),Y.createElement(F4,cc({option:x,isActive:p,shapeType:"sector"},j)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,a=this.props,o=a.sectors,i=a.isAnimationActive,c=a.animationBegin,d=a.animationDuration,f=a.animationEasing,h=a.animationId,p=this.state,g=p.prevSectors,x=p.prevIsAnimationActive;return Y.createElement(Ps,{begin:c,duration:d,isActive:i,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(x),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var b=j.t,y=[],S=o&&o[0],C=S.startAngle;return o.forEach(function(N,E){var A=g&&g[E],k=E>0?da(N,"paddingAngle",0):0;if(A){var T=ia(A.endAngle-A.startAngle,N.endAngle-N.startAngle),O=xn(xn({},N),{},{startAngle:C+k,endAngle:C+T(b)+k});y.push(O),C=O.endAngle}else{var L=N.endAngle,z=N.startAngle,q=ia(0,L-z),F=q(b),G=xn(xn({},N),{},{startAngle:C+k,endAngle:C+F+k});y.push(G),C=G.endAngle}}),Y.createElement(Zt,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var i=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[i].focus(),a.setState({sectorToFocus:i});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,o=r.isAnimationActive,i=this.state.prevSectors;return o&&a&&a.length&&(!i||!zf(i,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,o=a.hide,i=a.sectors,c=a.className,d=a.label,f=a.cx,h=a.cy,p=a.innerRadius,g=a.outerRadius,x=a.isAnimationActive,j=this.state.isAnimationFinished;if(o||!i||!i.length||!qe(f)||!qe(h)||!qe(p)||!qe(g))return null;var b=Ot("recharts-pie",c);return Y.createElement(Zt,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(i),ir.renderCallByParent(this.props,null,!1),(!x||j)&&ro.renderCallByParent(this.props,i,!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,o){if(Y.isValidElement(r))return Y.cloneElement(r,a);if(kt(r))return r(a);var i=Ot("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return Y.createElement(bm,cc({},a,{key:o,type:"linear",className:i}))}},{key:"renderLabelItem",value:function(r,a,o){if(Y.isValidElement(r))return Y.cloneElement(r,a);var i=o;if(kt(r)&&(i=r(a),Y.isValidElement(i)))return i;var c=Ot("recharts-pie-label-text",typeof r!="boolean"&&!kt(r)?r.className:"");return Y.createElement(Xi,cc({},a,{alignmentBaseline:"middle",className:c}),i)}}])})(m.PureComponent);Oh=vo;Aa(vo,"displayName","Pie");Aa(vo,"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:!vl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Aa(vo,"parseDeltaAngle",function(e,t){var n=_r(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Aa(vo,"getRealPieData",function(e){var t=e.data,n=e.children,r=yt(e,!1),a=fa(n,Fv);return t&&t.length?t.map(function(o,i){return xn(xn(xn({payload:o},r),o),a&&a[i]&&a[i].props)}):a&&a.length?a.map(function(o){return xn(xn({},r),o.props)}):[]});Aa(vo,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,o=t.height,i=S4(a,o),c=r+Ar(e.cx,a,a/2),d=n+Ar(e.cy,o,o/2),f=Ar(e.innerRadius,i,0),h=Ar(e.outerRadius,i,i*.8),p=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:c,cy:d,innerRadius:f,outerRadius:h,maxRadius:p}});Aa(vo,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?xn(xn({},t.type.defaultProps),t.props):t.props,a=Oh.getRealPieData(r);if(!a||!a.length)return null;var o=r.cornerRadius,i=r.startAngle,c=r.endAngle,d=r.paddingAngle,f=r.dataKey,h=r.nameKey,p=r.valueKey,g=r.tooltipType,x=Math.abs(r.minAngle),j=Oh.parseCoordinateOfPie(r,n),b=Oh.parseDeltaAngle(i,c),y=Math.abs(b),S=f;Tt(f)&&Tt(p)?(to(!1,`Use "dataKey" to specify the value of pie,
|
|
114
|
-
the props "valueKey" will be deprecated in 1.1.0`),S="value"):Tt(f)&&(to(!1,`Use "dataKey" to specify the value of pie,
|
|
115
|
-
the props "valueKey" will be deprecated in 1.1.0`),S=p);var C=a.filter(function(O){return Qn(O,S,0)!==0}).length,N=(y>=360?C:C-1)*d,E=y-C*x-N,A=a.reduce(function(O,L){var z=Qn(L,S,0);return O+(qe(z)?z:0)},0),k;if(A>0){var T;k=a.map(function(O,L){var z=Qn(O,S,0),q=Qn(O,h,L),F=(qe(z)?z:0)/A,G;L?G=T.endAngle+_r(b)*d*(z!==0?1:0):G=i;var W=G+_r(b)*((z!==0?x:0)+F*E),R=(G+W)/2,M=(j.innerRadius+j.outerRadius)/2,K=[{name:q,value:z,payload:O,dataKey:S,type:g}],V=jn(j.cx,j.cy,M,R);return T=xn(xn(xn({percent:F,cornerRadius:o,name:q,tooltipPayload:K,midAngle:R,middleRadius:M,tooltipPosition:V},O),j),{},{value:Qn(O,S),startAngle:G,endAngle:W,payload:O,paddingAngle:_r(b)*d}),T})}return xn(xn({},j),{},{sectors:k,data:a})});var hj,BI;function bce(){if(BI)return hj;BI=1;var e=Math.ceil,t=Math.max;function n(r,a,o,i){for(var c=-1,d=t(e((a-r)/(o||1)),0),f=Array(d);d--;)f[i?d:++c]=r,r+=o;return f}return hj=n,hj}var mj,zI;function U4(){if(zI)return mj;zI=1;var e=fL(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var o=a<0?-1:1;return o*n}return a===a?a:0}return mj=r,mj}var vj,UI;function wce(){if(UI)return vj;UI=1;var e=bce(),t=Lv(),n=U4();function r(a){return function(o,i,c){return c&&typeof c!="number"&&t(o,i,c)&&(i=c=void 0),o=n(o),i===void 0?(i=o,o=0):i=n(i),c=c===void 0?o<i?1:-1:n(c),e(o,i,c,a)}}return vj=r,vj}var gj,qI;function jce(){if(qI)return gj;qI=1;var e=wce(),t=e();return gj=t,gj}var Sce=jce();const Tm=ln(Sce);function pf(e){"@babel/helpers - typeof";return pf=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},pf(e)}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 VI(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){q4(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 q4(e,t,n){return t=Nce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nce(e){var t=Cce(e,"string");return pf(t)=="symbol"?t:t+""}function Cce(e,t){if(pf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _ce=["Webkit","Moz","O","ms"],Ace=function(t,n){var r=t.replace(/(\w)/,function(o){return o.toUpperCase()}),a=_ce.reduce(function(o,i){return VI(VI({},o),{},q4({},i+r,n))},{});return a[t]=n,a};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 Om(){return Om=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Om.apply(this,arguments)}function HI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function xj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HI(Object(n),!0).forEach(function(r){aa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ece(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(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 Pce(e,t,n){return t&&KI(e.prototype,t),n&&KI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kce(e,t,n){return t=Rm(t),Tce(e,W4()?Reflect.construct(t,n||[],Rm(e).constructor):t.apply(e,n))}function Tce(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 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 W4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(W4=function(){return!!e})()}function Rm(e){return Rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Rm(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&&x1(e,t)}function x1(e,t){return x1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},x1(e,t)}function aa(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=Ice(e,"string");return Fc(t)=="symbol"?t:t+""}function Ice(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 Mce=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,o=t.x,i=t.width,c=t.travellerWidth;if(!n||!n.length)return{};var d=n.length,f=Nd().domain(Tm(0,d)).range([o,o+i-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}},GI=function(t){return t.changedTouches&&!!t.changedTouches.length},Bc=(function(e){function t(n){var r;return Ece(this,t),r=kce(this,t,[n]),aa(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),aa(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),aa(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,o=a.endIndex,i=a.onDragEnd,c=a.startIndex;i?.({endIndex:o,startIndex:c})}),r.detachDragEndListener()}),aa(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),aa(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),aa(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),aa(r,"handleSlideDragStart",function(a){var o=GI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Rce(t,e),Pce(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,o=r.endX,i=this.state.scaleValues,c=this.props,d=c.gap,f=c.data,h=f.length-1,p=Math.min(a,o),g=Math.max(a,o),x=t.getIndexInRange(i,p),j=t.getIndexInRange(i,g);return{startIndex:x-x%d,endIndex:j===h?h:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,o=a.data,i=a.tickFormatter,c=a.dataKey,d=Qn(o[r],c,r);return kt(i)?i(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,o=a.slideMoveStartX,i=a.startX,c=a.endX,d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.startIndex,x=d.endIndex,j=d.onChange,b=r.pageX-o;b>0?b=Math.min(b,f+h-p-c,f+h-p-i):b<0&&(b=Math.max(b,f-i,f-c));var y=this.getIndex({startX:i+b,endX:c+b});(y.startIndex!==g||y.endIndex!==x)&&j&&j(y),this.setState({startX:i+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var o=GI(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,o=a.brushMoveStartX,i=a.movingTravellerId,c=a.endX,d=a.startX,f=this.state[i],h=this.props,p=h.x,g=h.width,x=h.travellerWidth,j=h.onChange,b=h.gap,y=h.data,S={startX:this.state.startX,endX:this.state.endX},C=r.pageX-o;C>0?C=Math.min(C,p+g-x-f):C<0&&(C=Math.max(C,p-f)),S[i]=f+C;var N=this.getIndex(S),E=N.startIndex,A=N.endIndex,k=function(){var O=y.length-1;return i==="startX"&&(c>d?E%b===0:A%b===0)||c<d&&A===O||i==="endX"&&(c>d?A%b===0:E%b===0)||c>d&&A===O};this.setState(aa(aa({},i,f+C),"brushMoveStartX",r.pageX),function(){j&&k()&&j(N)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var o=this,i=this.state,c=i.scaleValues,d=i.startX,f=i.endX,h=this.state[a],p=c.indexOf(h);if(p!==-1){var g=p+r;if(!(g===-1||g>=c.length)){var x=c[g];a==="startX"&&x>=f||a==="endX"&&x<=d||this.setState(aa({},a,x),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,o=r.y,i=r.width,c=r.height,d=r.fill,f=r.stroke;return Y.createElement("rect",{stroke:f,fill:d,x:a,y:o,width:i,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,o=r.y,i=r.width,c=r.height,d=r.data,f=r.children,h=r.padding,p=m.Children.only(f);return p?Y.cloneElement(p,{x:a,y:o,width:i,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var o,i,c=this,d=this.props,f=d.y,h=d.travellerWidth,p=d.height,g=d.traveller,x=d.ariaLabel,j=d.data,b=d.startIndex,y=d.endIndex,S=Math.max(r,this.props.x),C=xj(xj({},yt(this.props,!1)),{},{x:S,y:f,width:h,height:p}),N=x||"Min value: ".concat((o=j[b])===null||o===void 0?void 0:o.name,", Max value: ").concat((i=j[y])===null||i===void 0?void 0:i.name);return Y.createElement(Zt,{tabIndex:0,role:"slider","aria-label":N,"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(g,C))}},{key:"renderSlide",value:function(r,a){var o=this.props,i=o.y,c=o.height,d=o.stroke,f=o.travellerWidth,h=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return Y.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:i,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,o=r.endIndex,i=r.y,c=r.height,d=r.travellerWidth,f=r.stroke,h=this.state,p=h.startX,g=h.endX,x=5,j={pointerEvents:"none",fill:f};return Y.createElement(Zt,{className:"recharts-brush-texts"},Y.createElement(Xi,Om({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-x,y:i+c/2},j),this.getTextOfTick(a)),Y.createElement(Xi,Om({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+x,y:i+c/2},j),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,a=r.data,o=r.className,i=r.children,c=r.x,d=r.y,f=r.width,h=r.height,p=r.alwaysShowText,g=this.state,x=g.startX,j=g.endX,b=g.isTextActive,y=g.isSlideMoving,S=g.isTravellerMoving,C=g.isTravellerFocused;if(!a||!a.length||!qe(c)||!qe(d)||!qe(f)||!qe(h)||f<=0||h<=0)return null;var N=Ot("recharts-brush",o),E=Y.Children.count(i)===1,A=Ace("userSelect","none");return Y.createElement(Zt,{className:N,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(x,j),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(j,"endX"),(b||y||S||C||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,o=r.y,i=r.width,c=r.height,d=r.stroke,f=Math.floor(o+c/2)-1;return Y.createElement(Y.Fragment,null,Y.createElement("rect",{x:a,y:o,width:i,height:c,fill:d,stroke:"none"}),Y.createElement("line",{x1:a+1,y1:f,x2:a+i-1,y2:f,fill:"none",stroke:"#fff"}),Y.createElement("line",{x1:a+1,y1:f+2,x2:a+i-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var o;return Y.isValidElement(r)?o=Y.cloneElement(r,a):kt(r)?o=r(a):o=t.renderDefaultTraveller(a),o}},{key:"getDerivedStateFromProps",value:function(r,a){var o=r.data,i=r.width,c=r.x,d=r.travellerWidth,f=r.updateId,h=r.startIndex,p=r.endIndex;if(o!==a.prevData||f!==a.prevUpdateId)return xj({prevData:o,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:i},o&&o.length?Mce({data:o,width:i,x:c,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(i!==a.prevWidth||c!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([c,c+i-d]);var g=a.scale.domain().map(function(x){return a.scale(x)});return{prevData:o,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:i,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(r,a){for(var o=r.length,i=0,c=o-1;c-i>1;){var d=Math.floor((i+c)/2);r[d]>a?c=d:i=d}return a>=r[c]?c:i}}])})(m.PureComponent);aa(Bc,"displayName","Brush");aa(Bc,"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 yj,YI;function $ce(){if(YI)return yj;YI=1;var e=eC();function t(n,r){var a;return e(n,function(o,i,c){return a=r(o,i,c),!a}),!!a}return yj=t,yj}var bj,XI;function Dce(){if(XI)return bj;XI=1;var e=q3(),t=Ms(),n=$ce(),r=Yr(),a=Lv();function o(i,c,d){var f=r(i)?e:n;return d&&a(i,c,d)&&(c=void 0),f(i,t(c,3))}return bj=o,bj}var Lce=Dce();const Fce=ln(Lce);var Ss=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},wj,JI;function Bce(){if(JI)return wj;JI=1;var e=iL();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return wj=t,wj}var jj,QI;function zce(){if(QI)return jj;QI=1;var e=Bce(),t=sL(),n=Ms();function r(a,o){var i={};return o=n(o,3),t(a,function(c,d,f){e(i,d,o(c,d,f))}),i}return jj=r,jj}var Uce=zce();const qce=ln(Uce);var Sj,ZI;function Wce(){if(ZI)return Sj;ZI=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 Sj=e,Sj}var Nj,eM;function Vce(){if(eM)return Nj;eM=1;var e=eC();function t(n,r){var a=!0;return e(n,function(o,i,c){return a=!!r(o,i,c),a}),a}return Nj=t,Nj}var Cj,tM;function Hce(){if(tM)return Cj;tM=1;var e=Wce(),t=Vce(),n=Ms(),r=Yr(),a=Lv();function o(i,c,d){var f=r(i)?e:t;return d&&a(i,c,d)&&(c=void 0),f(i,n(c,3))}return Cj=o,Cj}var Kce=Hce();const Gce=ln(Kce);var Yce=["x","y"];function hf(e){"@babel/helpers - typeof";return hf=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},hf(e)}function y1(){return y1=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},y1.apply(this,arguments)}function nM(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 hd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nM(Object(n),!0).forEach(function(r){Xce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xce(e,t,n){return t=Jce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jce(e){var t=Qce(e,"string");return hf(t)=="symbol"?t:t+""}function Qce(e,t){if(hf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zce(e,t){if(e==null)return{};var n=eue(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eue(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 tue(e,t){var n=e.x,r=e.y,a=Zce(e,Yce),o="".concat(n),i=parseInt(o,10),c="".concat(r),d=parseInt(c,10),f="".concat(t.height||a.height),h=parseInt(f,10),p="".concat(t.width||a.width),g=parseInt(p,10);return hd(hd(hd(hd(hd({},t),a),i?{x:i}:{}),d?{y:d}:{}),{},{height:h,width:g,name:t.name,radius:t.radius})}function rM(e){return Y.createElement(F4,y1({shapeType:"rectangle",propTransformer:tue,activeClassName:"recharts-active-bar"},e))}var nue=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 o=qe(r)||wX(r);return o?t(r,a):(o||Qi(),n)}},rue=["value","background"],H4;function zc(e){"@babel/helpers - typeof";return zc=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},zc(e)}function aue(e,t){if(e==null)return{};var n=sue(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sue(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 Im(){return Im=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},Im.apply(this,arguments)}function aM(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 Vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aM(Object(n),!0).forEach(function(r){Vo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function oue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sM(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,G4(r.key),r)}}function iue(e,t,n){return t&&sM(e.prototype,t),n&&sM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lue(e,t,n){return t=Mm(t),cue(e,K4()?Reflect.construct(t,n||[],Mm(e).constructor):t.apply(e,n))}function cue(e,t){if(t&&(zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uue(e)}function uue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K4=function(){return!!e})()}function Mm(e){return Mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mm(e)}function due(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&&b1(e,t)}function b1(e,t){return b1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},b1(e,t)}function Vo(e,t,n){return t=G4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G4(e){var t=fue(e,"string");return zc(t)=="symbol"?t:t+""}function fue(e,t){if(zc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var bl=(function(e){function t(){var n;oue(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=lue(this,t,[].concat(a)),Vo(n,"state",{isAnimationFinished:!1}),Vo(n,"id",hu("recharts-bar-")),Vo(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),i&&i()}),Vo(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),i&&i()}),n}return due(t,e),iue(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,o=this.props,i=o.shape,c=o.dataKey,d=o.activeIndex,f=o.activeBar,h=yt(this.props,!1);return r&&r.map(function(p,g){var x=g===d,j=x?f:i,b=Vn(Vn(Vn({},h),p),{},{isActive:x,option:j,index:g,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return Y.createElement(Zt,Im({className:"recharts-bar-rectangle"},Yi(a.props,p,g),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(g)}),Y.createElement(rM,b))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,o=a.data,i=a.layout,c=a.isAnimationActive,d=a.animationBegin,f=a.animationDuration,h=a.animationEasing,p=a.animationId,g=this.state.prevData;return Y.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(x){var j=x.t,b=o.map(function(y,S){var C=g&&g[S];if(C){var N=ia(C.x,y.x),E=ia(C.y,y.y),A=ia(C.width,y.width),k=ia(C.height,y.height);return Vn(Vn({},y),{},{x:N(j),y:E(j),width:A(j),height:k(j)})}if(i==="horizontal"){var T=ia(0,y.height),O=T(j);return Vn(Vn({},y),{},{y:y.y+y.height-O,height:O})}var L=ia(0,y.width),z=L(j);return Vn(Vn({},y),{},{width:z})});return Y.createElement(Zt,null,r.renderRectanglesStatically(b))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,o=r.isAnimationActive,i=this.state.prevData;return o&&a&&a.length&&(!i||!zf(i,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,o=a.data,i=a.dataKey,c=a.activeIndex,d=yt(this.props.background,!1);return o.map(function(f,h){f.value;var p=f.background,g=aue(f,rue);if(!p)return null;var x=Vn(Vn(Vn(Vn(Vn({},g),{},{fill:"#eee"},p),d),Yi(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:i,index:h,className:"recharts-bar-background-rectangle"});return Y.createElement(rM,Im({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},x))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,i=o.data,c=o.xAxis,d=o.yAxis,f=o.layout,h=o.children,p=fa(h,Uf);if(!p)return null;var g=f==="vertical"?i[0].height/2:i[0].width/2,x=function(y,S){var C=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:C,errorVal:Qn(y,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return Y.createElement(Zt,j,p.map(function(b){return Y.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:i,xAxis:c,yAxis:d,layout:f,offset:g,dataPointFormatter:x})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,o=r.data,i=r.className,c=r.xAxis,d=r.yAxis,f=r.left,h=r.top,p=r.width,g=r.height,x=r.isAnimationActive,j=r.background,b=r.id;if(a||!o||!o.length)return null;var y=this.state.isAnimationFinished,S=Ot("recharts-bar",i),C=c&&c.allowDataOverflow,N=d&&d.allowDataOverflow,E=C||N,A=Tt(b)?this.id:b;return Y.createElement(Zt,{className:S},C||N?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(A)},Y.createElement("rect",{x:C?f:f-p/2,y:N?h:h-g/2,width:C?p:p*2,height:N?g:g*2}))):null,Y.createElement(Zt,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(A,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,A),(!x||y)&&ro.renderCallByParent(this.props,o))}}],[{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}}])})(m.PureComponent);H4=bl;Vo(bl,"displayName","Bar");Vo(bl,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!vl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Vo(bl,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,o=e.xAxis,i=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,p=e.displayedData,g=e.offset,x=$ae(r,n);if(!x)return null;var j=t.layout,b=n.type.defaultProps,y=b!==void 0?Vn(Vn({},b),n.props):n.props,S=y.dataKey,C=y.children,N=y.minPointSize,E=j==="horizontal"?i:o,A=f?E.scale.domain():null,k=qae({numericAxis:E}),T=fa(C,Fv),O=p.map(function(L,z){var q,F,G,W,R,M;f?q=Dae(f[h+z],A):(q=Qn(L,S),Array.isArray(q)||(q=[k,q]));var K=nue(N,H4.defaultProps.minPointSize)(q[1],z);if(j==="horizontal"){var V,D=[i.scale(q[0]),i.scale(q[1])],J=D[0],H=D[1];F=R2({axis:o,ticks:c,bandSize:a,offset:x.offset,entry:L,index:z}),G=(V=H??J)!==null&&V!==void 0?V:void 0,W=x.size;var I=J-H;if(R=Number.isNaN(I)?0:I,M={x:F,y:i.y,width:W,height:i.height},Math.abs(K)>0&&Math.abs(R)<Math.abs(K)){var te=_r(R||K)*(Math.abs(K)-Math.abs(R));G-=te,R+=te}}else{var de=[o.scale(q[0]),o.scale(q[1])],fe=de[0],me=de[1];if(F=fe,G=R2({axis:i,ticks:d,bandSize:a,offset:x.offset,entry:L,index:z}),W=me-fe,R=x.size,M={x:o.x,y:G,width:o.width,height:R},Math.abs(K)>0&&Math.abs(W)<Math.abs(K)){var U=_r(W||K)*(Math.abs(K)-Math.abs(W));W+=U}}return Vn(Vn(Vn({},L),{},{x:F,y:G,width:W,height:R,value:f?q:q[1],payload:L,background:M},T&&T[z]&&T[z].props),{},{tooltipPayload:[w4(n,L)],tooltipPosition:{x:F+W/2,y:G+R/2}})});return Vn({data:O,layout:j},g)});function mf(e){"@babel/helpers - typeof";return mf=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},mf(e)}function pue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oM(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 hue(e,t,n){return t&&oM(e.prototype,t),n&&oM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iM(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 Ka(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iM(Object(n),!0).forEach(function(r){ag(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ag(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=mue(e,"string");return mf(t)=="symbol"?t:t+""}function mue(e,t){if(mf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var X4=function(t,n,r,a,o){var i=t.width,c=t.height,d=t.layout,f=t.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:i-r.right,rightMirror:i-r.right,top:r.top,topMirror:r.top,bottom:c-r.bottom,bottomMirror:c-r.bottom},g=!!sa(f,bl);return h.reduce(function(x,j){var b=n[j],y=b.orientation,S=b.domain,C=b.padding,N=C===void 0?{}:C,E=b.mirror,A=b.reversed,k="".concat(y).concat(E?"Mirror":""),T,O,L,z,q;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var F=S[1]-S[0],G=1/0,W=b.categoricalDomain.sort(NX);if(W.forEach(function(de,fe){fe>0&&(G=Math.min((de||0)-(W[fe-1]||0),G))}),Number.isFinite(G)){var R=G/F,M=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(T=R*M/2),b.padding==="no-gap"){var K=Ar(t.barCategoryGap,R*M),V=R*M/2;T=V-K-(V-K)/M*K}}}a==="xAxis"?O=[r.left+(N.left||0)+(T||0),r.left+r.width-(N.right||0)-(T||0)]:a==="yAxis"?O=d==="horizontal"?[r.top+r.height-(N.bottom||0),r.top+(N.top||0)]:[r.top+(N.top||0)+(T||0),r.top+r.height-(N.bottom||0)-(T||0)]:O=b.range,A&&(O=[O[1],O[0]]);var D=g4(b,o,g),J=D.scale,H=D.realScaleType;J.domain(S).range(O),x4(J);var I=y4(J,Ka(Ka({},b),{},{realScaleType:H}));a==="xAxis"?(q=y==="top"&&!E||y==="bottom"&&E,L=r.left,z=p[k]-q*b.height):a==="yAxis"&&(q=y==="left"&&!E||y==="right"&&E,L=p[k]-q*b.width,z=r.top);var te=Ka(Ka(Ka({},b),I),{},{realScaleType:H,x:L,y:z,scale:J,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return te.bandSize=gm(te,I),!b.hide&&a==="xAxis"?p[k]+=(q?-1:1)*te.height:b.hide||(p[k]+=(q?-1:1)*te.width),Ka(Ka({},x),{},ag({},j,te))},{})},J4=function(t,n){var r=t.x,a=t.y,o=n.x,i=n.y;return{x:Math.min(r,o),y:Math.min(a,i),width:Math.abs(o-r),height:Math.abs(i-a)}},vue=function(t){var n=t.x1,r=t.y1,a=t.x2,o=t.y2;return J4({x:n,y:r},{x:a,y:o})},Q4=(function(){function e(t){pue(this,e),this.scale=t}return hue(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,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+i}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],o=r[r.length-1];return a<=o?n>=a&&n<=o:n>=o&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();ag(Q4,"EPS",1e-4);var PC=function(t){var n=Object.keys(t).reduce(function(r,a){return Ka(Ka({},r),{},ag({},a,Q4.create(t[a])))},{});return Ka(Ka({},n),{},{apply:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=o.bandAware,c=o.position;return qce(a,function(d,f){return n[f].apply(d,{bandAware:i,position:c})})},isInRange:function(a){return Gce(a,function(o,i){return n[i].isInRange(o)})}})};function gue(e){return(e%180+180)%180}var xue=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=gue(a),i=o*Math.PI/180,c=Math.atan(r/n),d=i>c&&i<Math.PI-c?r/Math.sin(i):n/Math.cos(i);return Math.abs(d)},_j,lM;function yue(){if(lM)return _j;lM=1;var e=Ms(),t=$f(),n=$v();function r(a){return function(o,i,c){var d=Object(o);if(!t(o)){var f=e(i,3);o=n(o),i=function(p){return f(d[p],p,d)}}var h=a(o,i,c);return h>-1?d[f?o[h]:h]:void 0}}return _j=r,_j}var Aj,cM;function bue(){if(cM)return Aj;cM=1;var e=U4();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return Aj=t,Aj}var Ej,uM;function wue(){if(uM)return Ej;uM=1;var e=eL(),t=Ms(),n=bue(),r=Math.max;function a(o,i,c){var d=o==null?0:o.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(o,t(i,3),f)}return Ej=a,Ej}var Pj,dM;function jue(){if(dM)return Pj;dM=1;var e=yue(),t=wue(),n=e(t);return Pj=n,Pj}jue();var Sue=v3();const Nue=ln(Sue);var Cue=Nue(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("")}),Z4=m.createContext(void 0),eF=m.createContext(void 0),tF=m.createContext(void 0),_ue=m.createContext({}),nF=m.createContext(void 0),rF=m.createContext(0),aF=m.createContext(0),fM=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,o=n.offset,i=t.clipPathId,c=t.children,d=t.width,f=t.height,h=Cue(o);return Y.createElement(Z4.Provider,{value:r},Y.createElement(eF.Provider,{value:a},Y.createElement(_ue.Provider,{value:o},Y.createElement(tF.Provider,{value:h},Y.createElement(nF.Provider,{value:i},Y.createElement(rF.Provider,{value:f},Y.createElement(aF.Provider,{value:d},c)))))))},Aue=function(){return m.useContext(nF)},sF=function(t){var n=m.useContext(Z4);n==null&&Qi();var r=n[t];return r==null&&Qi(),r},oF=function(t){var n=m.useContext(eF);n==null&&Qi();var r=n[t];return r==null&&Qi(),r},Eue=function(){var t=m.useContext(tF);return t},iF=function(){return m.useContext(aF)},lF=function(){return m.useContext(rF)};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 Pue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kue(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,uF(r.key),r)}}function Tue(e,t,n){return t&&kue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oue(e,t,n){return t=$m(t),Rue(e,cF()?Reflect.construct(t,n||[],$m(e).constructor):t.apply(e,n))}function Rue(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 Iue(e)}function Iue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cF=function(){return!!e})()}function $m(e){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$m(e)}function Mue(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 pM(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 hM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pM(Object(n),!0).forEach(function(r){kC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kC(e,t,n){return t=uF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uF(e){var t=$ue(e,"string");return Uc(t)=="symbol"?t:t+""}function $ue(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)}function Due(e,t){return zue(e)||Bue(e,t)||Fue(e,t)||Lue()}function Lue(){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 Fue(e,t){if(e){if(typeof e=="string")return mM(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 mM(e,t)}}function mM(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 Bue(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function zue(e){if(Array.isArray(e))return e}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)}var Uue=function(t,n){var r;return Y.isValidElement(t)?r=Y.cloneElement(t,n):kt(t)?r=t(n):r=Y.createElement("line",j1({},n,{className:"recharts-reference-line-line"})),r},que=function(t,n,r,a,o,i,c,d,f){var h=o.x,p=o.y,g=o.width,x=o.height;if(r){var j=f.y,b=t.y.apply(j,{position:i});if(Ss(f,"discard")&&!t.y.isInRange(b))return null;var y=[{x:h+g,y:b},{x:h,y:b}];return d==="left"?y.reverse():y}if(n){var S=f.x,C=t.x.apply(S,{position:i});if(Ss(f,"discard")&&!t.x.isInRange(C))return null;var N=[{x:C,y:p+x},{x:C,y:p}];return c==="top"?N.reverse():N}if(a){var E=f.segment,A=E.map(function(k){return t.apply(k,{position:i})});return Ss(f,"discard")&&Fce(A,function(k){return!t.isInRange(k)})?null:A}return null};function Wue(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,o=e.yAxisId,i=e.shape,c=e.className,d=e.alwaysShow,f=Aue(),h=sF(a),p=oF(o),g=Eue();if(!f||!g)return null;to(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var x=PC({x:h.scale,y:p.scale}),j=Zn(t),b=Zn(n),y=r&&r.length===2,S=que(x,j,b,y,g,e.position,h.orientation,p.orientation,e);if(!S)return null;var C=Due(S,2),N=C[0],E=N.x,A=N.y,k=C[1],T=k.x,O=k.y,L=Ss(e,"hidden")?"url(#".concat(f,")"):void 0,z=hM(hM({clipPath:L},yt(e,!0)),{},{x1:E,y1:A,x2:T,y2:O});return Y.createElement(Zt,{className:Ot("recharts-reference-line",c)},Uue(i,z),ir.renderCallByParent(e,vue({x1:E,y1:A,x2:T,y2:O})))}var TC=(function(e){function t(){return Pue(this,t),Oue(this,t,arguments)}return Mue(t,e),Tue(t,[{key:"render",value:function(){return Y.createElement(Wue,this.props)}}])})(Y.Component);kC(TC,"displayName","ReferenceLine");kC(TC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function S1(){return S1=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},S1.apply(this,arguments)}function qc(e){"@babel/helpers - typeof";return qc=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},qc(e)}function vM(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 gM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vM(Object(n),!0).forEach(function(r){sg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hue(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,fF(r.key),r)}}function Kue(e,t,n){return t&&Hue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Gue(e,t,n){return t=Dm(t),Yue(e,dF()?Reflect.construct(t,n||[],Dm(e).constructor):t.apply(e,n))}function Yue(e,t){if(t&&(qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xue(e)}function Xue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dF=function(){return!!e})()}function Dm(e){return Dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dm(e)}function Jue(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&&N1(e,t)}function N1(e,t){return N1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},N1(e,t)}function sg(e,t,n){return t=fF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fF(e){var t=Que(e,"string");return qc(t)=="symbol"?t:t+""}function Que(e,t){if(qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Zue=function(t){var n=t.x,r=t.y,a=t.xAxis,o=t.yAxis,i=PC({x:a.scale,y:o.scale}),c=i.apply({x:n,y:r},{bandAware:!0});return Ss(t,"discard")&&!i.isInRange(c)?null:c},og=(function(e){function t(){return Vue(this,t),Gue(this,t,arguments)}return Jue(t,e),Kue(t,[{key:"render",value:function(){var r=this.props,a=r.x,o=r.y,i=r.r,c=r.alwaysShow,d=r.clipPathId,f=Zn(a),h=Zn(o);if(to(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=Zue(this.props);if(!p)return null;var g=p.x,x=p.y,j=this.props,b=j.shape,y=j.className,S=Ss(this.props,"hidden")?"url(#".concat(d,")"):void 0,C=gM(gM({clipPath:S},yt(this.props,!0)),{},{cx:g,cy:x});return Y.createElement(Zt,{className:Ot("recharts-reference-dot",y)},t.renderDot(b,C),ir.renderCallByParent(this.props,{x:g-i,y:x-i,width:2*i,height:2*i}))}}])})(Y.Component);sg(og,"displayName","ReferenceDot");sg(og,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});sg(og,"renderDot",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):kt(e)?n=e(t):n=Y.createElement(Jv,S1({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function C1(){return C1=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},C1.apply(this,arguments)}function Wc(e){"@babel/helpers - typeof";return Wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wc(e)}function xM(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 yM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xM(Object(n),!0).forEach(function(r){ig(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ede(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tde(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,hF(r.key),r)}}function nde(e,t,n){return t&&tde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rde(e,t,n){return t=Lm(t),ade(e,pF()?Reflect.construct(t,n||[],Lm(e).constructor):t.apply(e,n))}function ade(e,t){if(t&&(Wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sde(e)}function sde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pF=function(){return!!e})()}function Lm(e){return Lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lm(e)}function ode(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&&_1(e,t)}function _1(e,t){return _1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_1(e,t)}function ig(e,t,n){return t=hF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hF(e){var t=ide(e,"string");return Wc(t)=="symbol"?t:t+""}function ide(e,t){if(Wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var lde=function(t,n,r,a,o){var i=o.x1,c=o.x2,d=o.y1,f=o.y2,h=o.xAxis,p=o.yAxis;if(!h||!p)return null;var g=PC({x:h.scale,y:p.scale}),x={x:t?g.x.apply(i,{position:"start"}):g.x.rangeMin,y:r?g.y.apply(d,{position:"start"}):g.y.rangeMin},j={x:n?g.x.apply(c,{position:"end"}):g.x.rangeMax,y:a?g.y.apply(f,{position:"end"}):g.y.rangeMax};return Ss(o,"discard")&&(!g.isInRange(x)||!g.isInRange(j))?null:J4(x,j)},lg=(function(e){function t(){return ede(this,t),rde(this,t,arguments)}return ode(t,e),nde(t,[{key:"render",value:function(){var r=this.props,a=r.x1,o=r.x2,i=r.y1,c=r.y2,d=r.className,f=r.alwaysShow,h=r.clipPathId;to(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Zn(a),g=Zn(o),x=Zn(i),j=Zn(c),b=this.props.shape;if(!p&&!g&&!x&&!j&&!b)return null;var y=lde(p,g,x,j,this.props);if(!y&&!b)return null;var S=Ss(this.props,"hidden")?"url(#".concat(h,")"):void 0;return Y.createElement(Zt,{className:Ot("recharts-reference-area",d)},t.renderRect(b,yM(yM({clipPath:S},yt(this.props,!0)),y)),ir.renderCallByParent(this.props,y))}}])})(Y.Component);ig(lg,"displayName","ReferenceArea");ig(lg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});ig(lg,"renderRect",function(e,t){var n;return Y.isValidElement(e)?n=Y.cloneElement(e,t):kt(e)?n=e(t):n=Y.createElement(EC,C1({},t,{className:"recharts-reference-area-rect"})),n});function mF(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 cde(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return xue(r,n)}function ude(e,t,n){var r=n==="width",a=e.x,o=e.y,i=e.width,c=e.height;return t===1?{start:r?a:o,end:r?a+i:o+c}:{start:r?a+i:o+c,end:r?a:o}}function Fm(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-a)<=0}function dde(e,t){return mF(e,t+1)}function fde(e,t,n,r,a){for(var o=(r||[]).slice(),i=t.start,c=t.end,d=0,f=1,h=i,p=function(){var j=r?.[d];if(j===void 0)return{v:mF(r,f)};var b=d,y,S=function(){return y===void 0&&(y=n(j,b)),y},C=j.coordinate,N=d===0||Fm(e,C,S,h,c);N||(d=0,h=i,f+=1),N&&(h=C+e*(S()/2+a),d+=f)},g;f<=o.length;)if(g=p(),g)return g.v;return[]}function vf(e){"@babel/helpers - typeof";return vf=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},vf(e)}function bM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bM(Object(n),!0).forEach(function(r){pde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pde(e,t,n){return t=hde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hde(e){var t=mde(e,"string");return vf(t)=="symbol"?t:t+""}function mde(e,t){if(vf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vde(e,t,n,r,a){for(var o=(r||[]).slice(),i=o.length,c=t.start,d=t.end,f=function(g){var x=o[g],j,b=function(){return j===void 0&&(j=n(x,g)),j};if(g===i-1){var y=e*(x.coordinate+e*b()/2-d);o[g]=x=br(br({},x),{},{tickCoord:y>0?x.coordinate-y*e:x.coordinate})}else o[g]=x=br(br({},x),{},{tickCoord:x.coordinate});var S=Fm(e,x.tickCoord,b,c,d);S&&(d=x.tickCoord-e*(b()/2+a),o[g]=br(br({},x),{},{isShow:!0}))},h=i-1;h>=0;h--)f(h);return o}function gde(e,t,n,r,a,o){var i=(r||[]).slice(),c=i.length,d=t.start,f=t.end;if(o){var h=r[c-1],p=n(h,c-1),g=e*(h.coordinate+e*p/2-f);i[c-1]=h=br(br({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate});var x=Fm(e,h.tickCoord,function(){return p},d,f);x&&(f=h.tickCoord-e*(p/2+a),i[c-1]=br(br({},h),{},{isShow:!0}))}for(var j=o?c-1:c,b=function(C){var N=i[C],E,A=function(){return E===void 0&&(E=n(N,C)),E};if(C===0){var k=e*(N.coordinate-e*A()/2-d);i[C]=N=br(br({},N),{},{tickCoord:k<0?N.coordinate-k*e:N.coordinate})}else i[C]=N=br(br({},N),{},{tickCoord:N.coordinate});var T=Fm(e,N.tickCoord,A,d,f);T&&(d=N.tickCoord+e*(A()/2+a),i[C]=br(br({},N),{},{isShow:!0}))},y=0;y<j;y++)b(y);return i}function xde(e,t,n){var r=e.tick,a=e.ticks,o=e.viewBox,i=e.minTickGap,c=e.orientation,d=e.interval,f=e.tickFormatter,h=e.unit,p=e.angle;if(!a||!a.length||!r)return[];if(qe(d)||vl.isSsr)return dde(a,typeof d=="number"&&qe(d)?d:0);var g=[],x=c==="top"||c==="bottom"?"width":"height",j=h&&x==="width"?Sd(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(N,E){var A=kt(f)?f(N.value,E):N.value;return x==="width"?cde(Sd(A,{fontSize:t,letterSpacing:n}),j,p):Sd(A,{fontSize:t,letterSpacing:n})[x]},y=a.length>=2?_r(a[1].coordinate-a[0].coordinate):1,S=ude(o,y,x);return d==="equidistantPreserveStart"?fde(y,S,b,a,i):(d==="preserveStart"||d==="preserveStartEnd"?g=gde(y,S,b,a,i,d==="preserveStartEnd"):g=vde(y,S,b,a,i),g.filter(function(C){return C.isShow}))}var yde=["viewBox"],bde=["viewBox"],wde=["ticks"];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 uc(){return uc=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},uc.apply(this,arguments)}function wM(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 Xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wM(Object(n),!0).forEach(function(r){OC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kj(e,t){if(e==null)return{};var n=jde(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jde(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 Sde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jM(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,gF(r.key),r)}}function Nde(e,t,n){return t&&jM(e.prototype,t),n&&jM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Cde(e,t,n){return t=Bm(t),_de(e,vF()?Reflect.construct(t,n||[],Bm(e).constructor):t.apply(e,n))}function _de(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 Ade(e)}function Ade(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vF=function(){return!!e})()}function Bm(e){return Bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bm(e)}function Ede(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&&A1(e,t)}function A1(e,t){return A1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},A1(e,t)}function OC(e,t,n){return t=gF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gF(e){var t=Pde(e,"string");return Vc(t)=="symbol"?t:t+""}function Pde(e,t){if(Vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var cg=(function(e){function t(n){var r;return Sde(this,t),r=Cde(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Ede(t,e),Nde(t,[{key:"shouldComponentUpdate",value:function(r,a){var o=r.viewBox,i=kj(r,yde),c=this.props,d=c.viewBox,f=kj(c,bde);return!gc(o,d)||!gc(i,f)||!gc(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,o=a.x,i=a.y,c=a.width,d=a.height,f=a.orientation,h=a.tickSize,p=a.mirror,g=a.tickMargin,x,j,b,y,S,C,N=p?-1:1,E=r.tickSize||h,A=qe(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":x=j=r.coordinate,y=i+ +!p*d,b=y-N*E,C=b-N*g,S=A;break;case"left":b=y=r.coordinate,j=o+ +!p*c,x=j-N*E,S=x-N*g,C=A;break;case"right":b=y=r.coordinate,j=o+ +p*c,x=j+N*E,S=x+N*g,C=A;break;default:x=j=r.coordinate,y=i+ +p*d,b=y+N*E,C=b+N*g,S=A;break}return{line:{x1:x,y1:b,x2:j,y2:y},tick:{x:S,y:C}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,o=r.mirror,i;switch(a){case"left":i=o?"start":"end";break;case"right":i=o?"end":"start";break;default:i="middle";break}return i}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,o=r.mirror,i="end";switch(a){case"left":case"right":i="middle";break;case"top":i=o?"start":"end";break;default:i=o?"end":"start";break}return i}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,o=r.y,i=r.width,c=r.height,d=r.orientation,f=r.mirror,h=r.axisLine,p=Xn(Xn(Xn({},yt(this.props,!1)),yt(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var g=+(d==="top"&&!f||d==="bottom"&&f);p=Xn(Xn({},p),{},{x1:a,y1:o+g*c,x2:a+i,y2:o+g*c})}else{var x=+(d==="left"&&!f||d==="right"&&f);p=Xn(Xn({},p),{},{x1:a+x*i,y1:o,x2:a+x*i,y2:o+c})}return Y.createElement("line",uc({},p,{className:Ot("recharts-cartesian-axis-line",da(h,"className"))}))}},{key:"renderTicks",value:function(r,a,o){var i=this,c=this.props,d=c.tickLine,f=c.stroke,h=c.tick,p=c.tickFormatter,g=c.unit,x=xde(Xn(Xn({},this.props),{},{ticks:r}),a,o),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),y=yt(this.props,!1),S=yt(h,!1),C=Xn(Xn({},y),{},{fill:"none"},yt(d,!1)),N=x.map(function(E,A){var k=i.getTickLineCoord(E),T=k.line,O=k.tick,L=Xn(Xn(Xn(Xn({textAnchor:j,verticalAnchor:b},y),{},{stroke:"none",fill:f},S),O),{},{index:A,payload:E,visibleTicksCount:x.length,tickFormatter:p});return Y.createElement(Zt,uc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},Yi(i.props,E,A)),d&&Y.createElement("line",uc({},C,T,{className:Ot("recharts-cartesian-axis-tick-line",da(d,"className"))})),h&&t.renderTickItem(h,L,"".concat(kt(p)?p(E.value,A):E.value).concat(g||"")))});return Y.createElement("g",{className:"recharts-cartesian-axis-ticks"},N)}},{key:"render",value:function(){var r=this,a=this.props,o=a.axisLine,i=a.width,c=a.height,d=a.ticksGenerator,f=a.className,h=a.hide;if(h)return null;var p=this.props,g=p.ticks,x=kj(p,wde),j=g;return kt(d)&&(j=g&&g.length>0?d(this.props):d(x)),i<=0||c<=0||!j||!j.length?null:Y.createElement(Zt,{className:Ot("recharts-cartesian-axis",f),ref:function(y){r.layerReference=y}},o&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),ir.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,o){var i,c=Ot(a.className,"recharts-cartesian-axis-tick-value");return Y.isValidElement(r)?i=Y.cloneElement(r,Xn(Xn({},a),{},{className:c})):kt(r)?i=r(Xn(Xn({},a),{},{className:c})):i=Y.createElement(Xi,uc({},a,{className:"recharts-cartesian-axis-tick-value"}),o),i}}])})(m.Component);OC(cg,"displayName","CartesianAxis");OC(cg,"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 kde=["type","layout","connectNulls","ref"],Tde=["key"];function Hc(e){"@babel/helpers - typeof";return Hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hc(e)}function SM(e,t){if(e==null)return{};var n=Ode(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ode(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pd.apply(this,arguments)}function NM(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 na(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NM(Object(n),!0).forEach(function(r){Ga(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ql(e){return $de(e)||Mde(e)||Ide(e)||Rde()}function Rde(){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 Ide(e,t){if(e){if(typeof e=="string")return E1(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 E1(e,t)}}function Mde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $de(e){if(Array.isArray(e))return E1(e)}function E1(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 Dde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CM(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,yF(r.key),r)}}function Lde(e,t,n){return t&&CM(e.prototype,t),n&&CM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fde(e,t,n){return t=zm(t),Bde(e,xF()?Reflect.construct(t,n||[],zm(e).constructor):t.apply(e,n))}function Bde(e,t){if(t&&(Hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zde(e)}function zde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xF=function(){return!!e})()}function zm(e){return zm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zm(e)}function Ude(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&&P1(e,t)}function P1(e,t){return P1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},P1(e,t)}function Ga(e,t,n){return t=yF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yF(e){var t=qde(e,"string");return Hc(t)=="symbol"?t:t+""}function qde(e,t){if(Hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Zi=(function(e){function t(){var n;Dde(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=Fde(this,t,[].concat(a)),Ga(n,"state",{isAnimationFinished:!0,totalLength:0}),Ga(n,"generateSimpleStrokeDasharray",function(i,c){return"".concat(c,"px ").concat(i-c,"px")}),Ga(n,"getStrokeDasharray",function(i,c,d){var f=d.reduce(function(S,C){return S+C});if(!f)return n.generateSimpleStrokeDasharray(c,i);for(var h=Math.floor(i/f),p=i%f,g=c-i,x=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){x=[].concat(Ql(d.slice(0,j)),[p-b]);break}var y=x.length%2===0?[0,g]:[g];return[].concat(Ql(t.repeat(d,h)),Ql(x),y).map(function(S){return"".concat(S,"px")}).join(", ")}),Ga(n,"id",hu("recharts-line-")),Ga(n,"pathRef",function(i){n.mainCurve=i}),Ga(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Ga(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Ude(t,e),Lde(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 o=this.props,i=o.points,c=o.xAxis,d=o.yAxis,f=o.layout,h=o.children,p=fa(h,Uf);if(!p)return null;var g=function(b,y){return{x:b.x,y:b.y,value:b.value,errorVal:Qn(b.payload,y)}},x={clipPath:r?"url(#clipPath-".concat(a,")"):null};return Y.createElement(Zt,x,p.map(function(j){return Y.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:i,xAxis:c,yAxis:d,layout:f,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,a,o){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var c=this.props,d=c.dot,f=c.points,h=c.dataKey,p=yt(this.props,!1),g=yt(d,!0),x=f.map(function(b,y){var S=na(na(na({key:"dot-".concat(y),r:3},p),g),{},{index:y,cx:b.x,cy:b.y,value:b.value,dataKey:h,payload:b.payload,points:f});return t.renderDotItem(d,S)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(o,")"):null};return Y.createElement(Zt,Pd({className:"recharts-line-dots",key:"dots"},j),x)}},{key:"renderCurveStatically",value:function(r,a,o,i){var c=this.props,d=c.type,f=c.layout,h=c.connectNulls;c.ref;var p=SM(c,kde),g=na(na(na({},yt(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(o,")"):null,points:r},i),{},{type:d,layout:f,connectNulls:h});return Y.createElement(bm,Pd({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var o=this,i=this.props,c=i.points,d=i.strokeDasharray,f=i.isAnimationActive,h=i.animationBegin,p=i.animationDuration,g=i.animationEasing,x=i.animationId,j=i.animateNewValues,b=i.width,y=i.height,S=this.state,C=S.prevPoints,N=S.totalLength;return Y.createElement(Ps,{begin:h,duration:p,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(x),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var A=E.t;if(C){var k=C.length/c.length,T=c.map(function(F,G){var W=Math.floor(G*k);if(C[W]){var R=C[W],M=ia(R.x,F.x),K=ia(R.y,F.y);return na(na({},F),{},{x:M(A),y:K(A)})}if(j){var V=ia(b*2,F.x),D=ia(y/2,F.y);return na(na({},F),{},{x:V(A),y:D(A)})}return na(na({},F),{},{x:F.x,y:F.y})});return o.renderCurveStatically(T,r,a)}var O=ia(0,N),L=O(A),z;if(d){var q="".concat(d).split(/[,\s]+/gim).map(function(F){return parseFloat(F)});z=o.getStrokeDasharray(L,N,q)}else z=o.generateSimpleStrokeDasharray(N,L);return o.renderCurveStatically(c,r,a,{strokeDasharray:z})})}},{key:"renderCurve",value:function(r,a){var o=this.props,i=o.points,c=o.isAnimationActive,d=this.state,f=d.prevPoints,h=d.totalLength;return c&&i&&i.length&&(!f&&h>0||!zf(f,i))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(i,r,a)}},{key:"render",value:function(){var r,a=this.props,o=a.hide,i=a.dot,c=a.points,d=a.className,f=a.xAxis,h=a.yAxis,p=a.top,g=a.left,x=a.width,j=a.height,b=a.isAnimationActive,y=a.id;if(o||!c||!c.length)return null;var S=this.state.isAnimationFinished,C=c.length===1,N=Ot("recharts-line",d),E=f&&f.allowDataOverflow,A=h&&h.allowDataOverflow,k=E||A,T=Tt(y)?this.id:y,O=(r=yt(i,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},L=O.r,z=L===void 0?3:L,q=O.strokeWidth,F=q===void 0?2:q,G=RX(i)?i:{},W=G.clipDot,R=W===void 0?!0:W,M=z*2+F;return Y.createElement(Zt,{className:N},E||A?Y.createElement("defs",null,Y.createElement("clipPath",{id:"clipPath-".concat(T)},Y.createElement("rect",{x:E?g:g-x/2,y:A?p:p-j/2,width:E?x:x*2,height:A?j:j*2})),!R&&Y.createElement("clipPath",{id:"clipPath-dots-".concat(T)},Y.createElement("rect",{x:g-M/2,y:p-M/2,width:x+M,height:j+M}))):null,!C&&this.renderCurve(k,T),this.renderErrorBar(k,T),(C||i)&&this.renderDots(k,R,T),(!b||S)&&ro.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 o=r.length%2!==0?[].concat(Ql(r),[0]):r,i=[],c=0;c<a;++c)i=[].concat(Ql(i),Ql(o));return i}},{key:"renderDotItem",value:function(r,a){var o;if(Y.isValidElement(r))o=Y.cloneElement(r,a);else if(kt(r))o=r(a);else{var i=a.key,c=SM(a,Tde),d=Ot("recharts-line-dot",typeof r!="boolean"?r.className:"");o=Y.createElement(Jv,Pd({key:i},c,{className:d}))}return o}}])})(m.PureComponent);Ga(Zi,"displayName","Line");Ga(Zi,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!vl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Ga(Zi,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,i=e.dataKey,c=e.bandSize,d=e.displayedData,f=e.offset,h=t.layout,p=d.map(function(g,x){var j=Qn(g,i);return h==="horizontal"?{x:O2({axis:n,ticks:a,bandSize:c,entry:g,index:x}),y:Tt(j)?null:r.scale(j),value:j,payload:g}:{x:Tt(j)?null:n.scale(j),y:O2({axis:r,ticks:o,bandSize:c,entry:g,index:x}),value:j,payload:g}});return na({points:p,layout:h},f)});function Kc(e){"@babel/helpers - typeof";return Kc=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},Kc(e)}function Wde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vde(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,jF(r.key),r)}}function Hde(e,t,n){return t&&Vde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kde(e,t,n){return t=Um(t),Gde(e,bF()?Reflect.construct(t,n||[],Um(e).constructor):t.apply(e,n))}function Gde(e,t){if(t&&(Kc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yde(e)}function Yde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bF=function(){return!!e})()}function Um(e){return Um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Um(e)}function Xde(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 wF(e,t,n){return t=jF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jF(e){var t=Jde(e,"string");return Kc(t)=="symbol"?t:t+""}function Jde(e,t){if(Kc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function T1(){return T1=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},T1.apply(this,arguments)}function Qde(e){var t=e.xAxisId,n=iF(),r=lF(),a=sF(t);return a==null?null:m.createElement(cg,T1({},a,{className:Ot("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(i){return Di(i,!0)}}))}var Qo=(function(e){function t(){return Wde(this,t),Kde(this,t,arguments)}return Xde(t,e),Hde(t,[{key:"render",value:function(){return m.createElement(Qde,this.props)}}])})(m.Component);wF(Qo,"displayName","XAxis");wF(Qo,"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 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 Zde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function efe(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,CF(r.key),r)}}function tfe(e,t,n){return t&&efe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function nfe(e,t,n){return t=qm(t),rfe(e,SF()?Reflect.construct(t,n||[],qm(e).constructor):t.apply(e,n))}function rfe(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 afe(e)}function afe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function SF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SF=function(){return!!e})()}function qm(e){return qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qm(e)}function sfe(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&&O1(e,t)}function O1(e,t){return O1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},O1(e,t)}function NF(e,t,n){return t=CF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CF(e){var t=ofe(e,"string");return Gc(t)=="symbol"?t:t+""}function ofe(e,t){if(Gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function R1(){return R1=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},R1.apply(this,arguments)}var ife=function(t){var n=t.yAxisId,r=iF(),a=lF(),o=oF(n);return o==null?null:m.createElement(cg,R1({},o,{className:Ot("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return Di(c,!0)}}))},Zo=(function(e){function t(){return Zde(this,t),nfe(this,t,arguments)}return sfe(t,e),tfe(t,[{key:"render",value:function(){return m.createElement(ife,this.props)}}])})(m.Component);NF(Zo,"displayName","YAxis");NF(Zo,"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 _M(e){return dfe(e)||ufe(e)||cfe(e)||lfe()}function lfe(){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 cfe(e,t){if(e){if(typeof e=="string")return I1(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 I1(e,t)}}function ufe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dfe(e){if(Array.isArray(e))return I1(e)}function I1(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 M1=function(t,n,r,a,o){var i=fa(t,TC),c=fa(t,og),d=[].concat(_M(i),_M(c)),f=fa(t,lg),h="".concat(a,"Id"),p=a[0],g=n;if(d.length&&(g=d.reduce(function(b,y){if(y.props[h]===r&&Ss(y.props,"extendDomain")&&qe(y.props[p])){var S=y.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},g)),f.length){var x="".concat(p,"1"),j="".concat(p,"2");g=f.reduce(function(b,y){if(y.props[h]===r&&Ss(y.props,"extendDomain")&&qe(y.props[x])&&qe(y.props[j])){var S=y.props[x],C=y.props[j];return[Math.min(b[0],S,C),Math.max(b[1],S,C)]}return b},g)}return o&&o.length&&(g=o.reduce(function(b,y){return qe(y)?[Math.min(b[0],y),Math.max(b[1],y)]:b},g)),g},Tj={exports:{}},AM;function ffe(){return AM||(AM=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 o(d,f,h,p,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var x=new a(h,p||d,g),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],x]:d._events[j].push(x):(d._events[j]=x,d._eventsCount++),d}function i(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},c.prototype.listeners=function(f){var h=n?n+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var g=0,x=p.length,j=new Array(x);g<x;g++)j[g]=p[g].fn;return j},c.prototype.listenerCount=function(f){var h=n?n+f:f,p=this._events[h];return p?p.fn?1:p.length:0},c.prototype.emit=function(f,h,p,g,x,j){var b=n?n+f:f;if(!this._events[b])return!1;var y=this._events[b],S=arguments.length,C,N;if(y.fn){switch(y.once&&this.removeListener(f,y.fn,void 0,!0),S){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,h),!0;case 3:return y.fn.call(y.context,h,p),!0;case 4:return y.fn.call(y.context,h,p,g),!0;case 5:return y.fn.call(y.context,h,p,g,x),!0;case 6:return y.fn.call(y.context,h,p,g,x,j),!0}for(N=1,C=new Array(S-1);N<S;N++)C[N-1]=arguments[N];y.fn.apply(y.context,C)}else{var E=y.length,A;for(N=0;N<E;N++)switch(y[N].once&&this.removeListener(f,y[N].fn,void 0,!0),S){case 1:y[N].fn.call(y[N].context);break;case 2:y[N].fn.call(y[N].context,h);break;case 3:y[N].fn.call(y[N].context,h,p);break;case 4:y[N].fn.call(y[N].context,h,p,g);break;default:if(!C)for(A=1,C=new Array(S-1);A<S;A++)C[A-1]=arguments[A];y[N].fn.apply(y[N].context,C)}}return!0},c.prototype.on=function(f,h,p){return o(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return o(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,g){var x=n?n+f:f;if(!this._events[x])return this;if(!h)return i(this,x),this;var j=this._events[x];if(j.fn)j.fn===h&&(!g||j.once)&&(!p||j.context===p)&&i(this,x);else{for(var b=0,y=[],S=j.length;b<S;b++)(j[b].fn!==h||g&&!j[b].once||p&&j[b].context!==p)&&y.push(j[b]);y.length?this._events[x]=y.length===1?y[0]:y:i(this,x)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&i(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})(Tj)),Tj.exports}var pfe=ffe();const hfe=ln(pfe);var Oj=new hfe,Rj="recharts.syncMouseEvents";function gf(e){"@babel/helpers - typeof";return gf=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},gf(e)}function mfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vfe(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,_F(r.key),r)}}function gfe(e,t,n){return t&&vfe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ij(e,t,n){return t=_F(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _F(e){var t=xfe(e,"string");return gf(t)=="symbol"?t:t+""}function xfe(e,t){if(gf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yfe=(function(){function e(){mfe(this,e),Ij(this,"activeIndex",0),Ij(this,"coordinateList",[]),Ij(this,"layout","horizontal")}return gfe(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,o=a===void 0?null:a,i=n.container,c=i===void 0?null:i,d=n.layout,f=d===void 0?null:d,h=n.offset,p=h===void 0?null:h,g=n.mouseHandlerCallback,x=g===void 0?null:g;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=c??this.container,this.layout=f??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=x??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(),o=a.x,i=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=o+d+f,g=i+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:g})}}}])})();function bfe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&qe(r)&&qe(a))return!0}return!1}function wfe(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 AF(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,o=e.endAngle,i=jn(t,n,r,a),c=jn(t,n,r,o);return{points:[i,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:o}}function jfe(e,t,n){var r,a,o,i;if(e==="horizontal")r=t.x,o=r,a=n.top,i=n.top+n.height;else if(e==="vertical")a=t.y,i=a,r=n.left,o=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var c=t.cx,d=t.cy,f=t.innerRadius,h=t.outerRadius,p=t.angle,g=jn(c,d,f,p),x=jn(c,d,h,p);r=g.x,a=g.y,o=x.x,i=x.y}else return AF(t);return[{x:r,y:a},{x:o,y:i}]}function xf(e){"@babel/helpers - typeof";return xf=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},xf(e)}function EM(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 wh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EM(Object(n),!0).forEach(function(r){Sfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sfe(e,t,n){return t=Nfe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nfe(e){var t=Cfe(e,"string");return xf(t)=="symbol"?t:t+""}function Cfe(e,t){if(xf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _fe(e){var t,n,r=e.element,a=e.tooltipEventType,o=e.isActive,i=e.activeCoordinate,c=e.activePayload,d=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,g=e.chartName,x=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!x||!o||!i||g!=="ScatterChart"&&a!=="axis")return null;var j,b=bm;if(g==="ScatterChart")j=i,b=cle;else if(g==="BarChart")j=wfe(p,i,d,h),b=EC;else if(p==="radial"){var y=AF(i),S=y.cx,C=y.cy,N=y.radius,E=y.startAngle,A=y.endAngle;j={cx:S,cy:C,startAngle:E,endAngle:A,innerRadius:N,outerRadius:N},b=A4}else j={points:jfe(p,i,d)},b=bm;var k=wh(wh(wh(wh({stroke:"#ccc",pointerEvents:"none"},d),j),yt(x,!1)),{},{payload:c,payloadIndex:f,className:Ot("recharts-tooltip-cursor",x.className)});return m.isValidElement(x)?m.cloneElement(x,k):m.createElement(b,k)}var Afe=["item"],Efe=["children","className","width","height","style","compact","title","desc"];function Yc(e){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yc(e)}function dc(){return dc=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},dc.apply(this,arguments)}function PM(e,t){return Tfe(e)||kfe(e,t)||PF(e,t)||Pfe()}function Pfe(){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 kfe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,i,c=[],d=!0,f=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.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&&(i=n.return(),Object(i)!==i))return}finally{if(f)throw a}}return c}}function Tfe(e){if(Array.isArray(e))return e}function kM(e,t){if(e==null)return{};var n=Ofe(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ofe(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 Rfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ife(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,kF(r.key),r)}}function Mfe(e,t,n){return t&&Ife(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $fe(e,t,n){return t=Wm(t),Dfe(e,EF()?Reflect.construct(t,n||[],Wm(e).constructor):t.apply(e,n))}function Dfe(e,t){if(t&&(Yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lfe(e)}function Lfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function EF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EF=function(){return!!e})()}function Wm(e){return Wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wm(e)}function Ffe(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&&$1(e,t)}function $1(e,t){return $1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$1(e,t)}function Xc(e){return Ufe(e)||zfe(e)||PF(e)||Bfe()}function Bfe(){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 PF(e,t){if(e){if(typeof e=="string")return D1(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 D1(e,t)}}function zfe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ufe(e){if(Array.isArray(e))return D1(e)}function D1(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 TM(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 je(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TM(Object(n),!0).forEach(function(r){wt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wt(e,t,n){return t=kF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kF(e){var t=qfe(e,"string");return Yc(t)=="symbol"?t:t+""}function qfe(e,t){if(Yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wfe={xAxis:["bottom","top"],yAxis:["left","right"]},Vfe={width:"100%",height:"100%"},TF={x:0,y:0};function jh(e){return e}var Hfe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Kfe=function(t,n,r,a){var o=n.find(function(h){return h&&h.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:o.coordinate};if(t==="centric"){var i=o.coordinate,c=a.radius;return je(je(je({},a),jn(a.cx,a.cy,c,i)),{},{angle:i,radius:c})}var d=o.coordinate,f=a.angle;return je(je(je({},a),jn(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return TF},ug=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,o=n.dataEndIndex,i=(r??[]).reduce(function(c,d){var f=d.props.data;return f&&f.length?[].concat(Xc(c),Xc(f)):c},[]);return i.length>0?i:t&&t.length&&qe(a)&&qe(o)?t.slice(a,o+1):[]};function OF(e){return e==="number"?[0,"auto"]:void 0}var L1=function(t,n,r,a){var o=t.graphicalItems,i=t.tooltipAxis,c=ug(n,t);return r<0||!o||!o.length||r>=c.length?null:o.reduce(function(d,f){var h,p=(h=f.props.data)!==null&&h!==void 0?h:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(i.dataKey&&!i.allowDuplicatedCategory){var x=p===void 0?c:p;g=Wh(x,i.dataKey,a)}else g=p&&p[r]||c[r];return g?[].concat(Xc(d),[w4(f,g)]):d},[])},OM=function(t,n,r,a){var o=a||{x:t.chartX,y:t.chartY},i=Hfe(o,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=kae(i,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,g=L1(t,n,h,p),x=Kfe(r,c,h,o);return{activeTooltipIndex:h,activeLabel:p,activePayload:g,activeCoordinate:x}}return null},Gfe=function(t,n){var r=n.axes,a=n.graphicalItems,o=n.axisType,i=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,g=t.stackOffset,x=v4(h,o);return r.reduce(function(j,b){var y,S=b.type.defaultProps!==void 0?je(je({},b.type.defaultProps),b.props):b.props,C=S.type,N=S.dataKey,E=S.allowDataOverflow,A=S.allowDuplicatedCategory,k=S.scale,T=S.ticks,O=S.includeHidden,L=S[i];if(j[L])return j;var z=ug(t.data,{graphicalItems:a.filter(function(I){var te,de=i in I.props?I.props[i]:(te=I.type.defaultProps)===null||te===void 0?void 0:te[i];return de===L}),dataStartIndex:d,dataEndIndex:f}),q=z.length,F,G,W;bfe(S.domain,E,C)&&(F=QS(S.domain,null,E),x&&(C==="number"||k!=="auto")&&(W=Cd(z,N,"category")));var R=OF(C);if(!F||F.length===0){var M,K=(M=S.domain)!==null&&M!==void 0?M:R;if(N){if(F=Cd(z,N,C),C==="category"&&x){var V=SX(F);A&&V?(G=F,F=Tm(0,q)):A||(F=$2(K,F,b).reduce(function(I,te){return I.indexOf(te)>=0?I:[].concat(Xc(I),[te])},[]))}else if(C==="category")A?F=F.filter(function(I){return I!==""&&!Tt(I)}):F=$2(K,F,b).reduce(function(I,te){return I.indexOf(te)>=0||te===""||Tt(te)?I:[].concat(Xc(I),[te])},[]);else if(C==="number"){var D=Mae(z,a.filter(function(I){var te,de,fe=i in I.props?I.props[i]:(te=I.type.defaultProps)===null||te===void 0?void 0:te[i],me="hide"in I.props?I.props.hide:(de=I.type.defaultProps)===null||de===void 0?void 0:de.hide;return fe===L&&(O||!me)}),N,o,h);D&&(F=D)}x&&(C==="number"||k!=="auto")&&(W=Cd(z,N,"category"))}else x?F=Tm(0,q):c&&c[L]&&c[L].hasStack&&C==="number"?F=g==="expand"?[0,1]:b4(c[L].stackGroups,d,f):F=m4(z,a.filter(function(I){var te=i in I.props?I.props[i]:I.type.defaultProps[i],de="hide"in I.props?I.props.hide:I.type.defaultProps.hide;return te===L&&(O||!de)}),C,h,!0);if(C==="number")F=M1(p,F,L,o,T),K&&(F=QS(K,F,E));else if(C==="category"&&K){var J=K,H=F.every(function(I){return J.indexOf(I)>=0});H&&(F=J)}}return je(je({},j),{},wt({},L,je(je({},S),{},{axisType:o,domain:F,categoricalDomain:W,duplicateDomain:G,originalDomain:(y=S.domain)!==null&&y!==void 0?y:R,isCategorical:x,layout:h})))},{})},Yfe=function(t,n){var r=n.graphicalItems,a=n.Axis,o=n.axisType,i=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,g=ug(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),x=g.length,j=v4(h,o),b=-1;return r.reduce(function(y,S){var C=S.type.defaultProps!==void 0?je(je({},S.type.defaultProps),S.props):S.props,N=C[i],E=OF("number");if(!y[N]){b++;var A;return j?A=Tm(0,x):c&&c[N]&&c[N].hasStack?(A=b4(c[N].stackGroups,d,f),A=M1(p,A,N,o)):(A=QS(E,m4(g,r.filter(function(k){var T,O,L=i in k.props?k.props[i]:(T=k.type.defaultProps)===null||T===void 0?void 0:T[i],z="hide"in k.props?k.props.hide:(O=k.type.defaultProps)===null||O===void 0?void 0:O.hide;return L===N&&!z}),"number",h),a.defaultProps.allowDataOverflow),A=M1(p,A,N,o)),je(je({},y),{},wt({},N,je(je({axisType:o},a.defaultProps),{},{hide:!0,orientation:da(Wfe,"".concat(o,".").concat(b%2),null),domain:A,originalDomain:E,isCategorical:j,layout:h})))}return y},{})},Xfe=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,o=n.AxisComp,i=n.graphicalItems,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.children,p="".concat(a,"Id"),g=fa(h,o),x={};return g&&g.length?x=Gfe(t,{axes:g,graphicalItems:i,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):i&&i.length&&(x=Yfe(t,{Axis:o,graphicalItems:i,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),x},Jfe=function(t){var n=rc(t),r=Di(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:tC(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:gm(n,r)}},RM=function(t){var n=t.children,r=t.defaultShowTooltip,a=sa(n,Bc),o=0,i=0;return t.data&&t.data.length!==0&&(i=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(o=a.props.startIndex),a.props.endIndex>=0&&(i=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:i,activeTooltipIndex:-1,isTooltipActive:!!r}},Qfe=function(t){return!t||!t.length?!1:t.some(function(n){var r=eo(n&&n.type);return r&&r.indexOf("Bar")>=0})},IM=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"}},Zfe=function(t,n){var r=t.props,a=t.graphicalItems,o=t.xAxisMap,i=o===void 0?{}:o,c=t.yAxisMap,d=c===void 0?{}:c,f=r.width,h=r.height,p=r.children,g=r.margin||{},x=sa(p,Bc),j=sa(p,Fi),b=Object.keys(d).reduce(function(A,k){var T=d[k],O=T.orientation;return!T.mirror&&!T.hide?je(je({},A),{},wt({},O,A[O]+T.width)):A},{left:g.left||0,right:g.right||0}),y=Object.keys(i).reduce(function(A,k){var T=i[k],O=T.orientation;return!T.mirror&&!T.hide?je(je({},A),{},wt({},O,da(A,"".concat(O))+T.height)):A},{top:g.top||0,bottom:g.bottom||0}),S=je(je({},y),b),C=S.bottom;x&&(S.bottom+=x.props.height||Bc.defaultProps.height),j&&n&&(S=Rae(S,a,r,n));var N=f-S.left-S.right,E=h-S.top-S.bottom;return je(je({brushBottom:C},S),{},{width:Math.max(N,0),height:Math.max(E,0)})},epe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},RC=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,o=a===void 0?"axis":a,i=t.validateTooltipEventTypes,c=i===void 0?["axis"]:i,d=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,g=function(S,C){var N=C.graphicalItems,E=C.stackGroups,A=C.offset,k=C.updateId,T=C.dataStartIndex,O=C.dataEndIndex,L=S.barSize,z=S.layout,q=S.barGap,F=S.barCategoryGap,G=S.maxBarSize,W=IM(z),R=W.numericAxisName,M=W.cateAxisName,K=Qfe(N),V=[];return N.forEach(function(D,J){var H=ug(S.data,{graphicalItems:[D],dataStartIndex:T,dataEndIndex:O}),I=D.type.defaultProps!==void 0?je(je({},D.type.defaultProps),D.props):D.props,te=I.dataKey,de=I.maxBarSize,fe=I["".concat(R,"Id")],me=I["".concat(M,"Id")],U={},oe=d.reduce(function(ut,dt){var ht=C["".concat(dt.axisType,"Map")],jt=I["".concat(dt.axisType,"Id")];ht&&ht[jt]||dt.axisType==="zAxis"||Qi();var It=ht[jt];return je(je({},ut),{},wt(wt({},dt.axisType,It),"".concat(dt.axisType,"Ticks"),Di(It)))},U),re=oe[M],ne=oe["".concat(M,"Ticks")],ve=E&&E[fe]&&E[fe].hasStack&&Wae(D,E[fe].stackGroups),le=eo(D.type).indexOf("Bar")>=0,Ae=gm(re,ne),be=[],We=K&&Tae({barSize:L,stackGroups:E,totalSize:epe(oe,M)});if(le){var B,ie,he=Tt(de)?G:de,Te=(B=(ie=gm(re,ne,!0))!==null&&ie!==void 0?ie:he)!==null&&B!==void 0?B:0;be=Oae({barGap:q,barCategoryGap:F,bandSize:Te!==Ae?Te:Ae,sizeList:We[me],maxBarSize:he}),Te!==Ae&&(be=be.map(function(ut){return je(je({},ut),{},{position:je(je({},ut.position),{},{offset:ut.position.offset-Te/2})})}))}var Ye=D&&D.type&&D.type.getComposedData;Ye&&V.push({props:je(je({},Ye(je(je({},oe),{},{displayedData:H,props:S,dataKey:te,item:D,bandSize:Ae,barPosition:be,offset:A,stackedData:ve,layout:z,dataStartIndex:T,dataEndIndex:O}))),{},wt(wt(wt({key:D.key||"item-".concat(J)},R,oe[R]),M,oe[M]),"animationId",k)),childIndex:$X(D,S.children),item:D})}),V},x=function(S,C){var N=S.props,E=S.dataStartIndex,A=S.dataEndIndex,k=S.updateId;if(!Xk({props:N}))return null;var T=N.children,O=N.layout,L=N.stackOffset,z=N.data,q=N.reverseStackOrder,F=IM(O),G=F.numericAxisName,W=F.cateAxisName,R=fa(T,r),M=Uae(z,R,"".concat(G,"Id"),"".concat(W,"Id"),L,q),K=d.reduce(function(I,te){var de="".concat(te.axisType,"Map");return je(je({},I),{},wt({},de,Xfe(N,je(je({},te),{},{graphicalItems:R,stackGroups:te.axisType===G&&M,dataStartIndex:E,dataEndIndex:A}))))},{}),V=Zfe(je(je({},K),{},{props:N,graphicalItems:R}),C?.legendBBox);Object.keys(K).forEach(function(I){K[I]=h(N,K[I],V,I.replace("Map",""),n)});var D=K["".concat(W,"Map")],J=Jfe(D),H=g(N,je(je({},K),{},{dataStartIndex:E,dataEndIndex:A,updateId:k,graphicalItems:R,stackGroups:M,offset:V}));return je(je({formattedGraphicalItems:H,graphicalItems:R,offset:V,stackGroups:M},J),K)},j=(function(y){function S(C){var N,E,A;return Rfe(this,S),A=$fe(this,S,[C]),wt(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),wt(A,"accessibilityManager",new yfe),wt(A,"handleLegendBBoxUpdate",function(k){if(k){var T=A.state,O=T.dataStartIndex,L=T.dataEndIndex,z=T.updateId;A.setState(je({legendBBox:k},x({props:A.props,dataStartIndex:O,dataEndIndex:L,updateId:z},je(je({},A.state),{},{legendBBox:k}))))}}),wt(A,"handleReceiveSyncEvent",function(k,T,O){if(A.props.syncId===k){if(O===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(T)}}),wt(A,"handleBrushChange",function(k){var T=k.startIndex,O=k.endIndex;if(T!==A.state.dataStartIndex||O!==A.state.dataEndIndex){var L=A.state.updateId;A.setState(function(){return je({dataStartIndex:T,dataEndIndex:O},x({props:A.props,dataStartIndex:T,dataEndIndex:O,updateId:L},A.state))}),A.triggerSyncEvent({dataStartIndex:T,dataEndIndex:O})}}),wt(A,"handleMouseEnter",function(k){var T=A.getMouseInfo(k);if(T){var O=je(je({},T),{},{isTooltipActive:!0});A.setState(O),A.triggerSyncEvent(O);var L=A.props.onMouseEnter;kt(L)&&L(O,k)}}),wt(A,"triggeredAfterMouseMove",function(k){var T=A.getMouseInfo(k),O=T?je(je({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(O),A.triggerSyncEvent(O);var L=A.props.onMouseMove;kt(L)&&L(O,k)}),wt(A,"handleItemMouseEnter",function(k){A.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),wt(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),wt(A,"handleMouseMove",function(k){k.persist(),A.throttleTriggeredAfterMouseMove(k)}),wt(A,"handleMouseLeave",function(k){A.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var O=A.props.onMouseLeave;kt(O)&&O(T,k)}),wt(A,"handleOuterEvent",function(k){var T=MX(k),O=da(A.props,"".concat(T));if(T&&kt(O)){var L,z;/.*touch.*/i.test(T)?z=A.getMouseInfo(k.changedTouches[0]):z=A.getMouseInfo(k),O((L=z)!==null&&L!==void 0?L:{},k)}}),wt(A,"handleClick",function(k){var T=A.getMouseInfo(k);if(T){var O=je(je({},T),{},{isTooltipActive:!0});A.setState(O),A.triggerSyncEvent(O);var L=A.props.onClick;kt(L)&&L(O,k)}}),wt(A,"handleMouseDown",function(k){var T=A.props.onMouseDown;if(kt(T)){var O=A.getMouseInfo(k);T(O,k)}}),wt(A,"handleMouseUp",function(k){var T=A.props.onMouseUp;if(kt(T)){var O=A.getMouseInfo(k);T(O,k)}}),wt(A,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),wt(A,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&A.handleMouseDown(k.changedTouches[0])}),wt(A,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&A.handleMouseUp(k.changedTouches[0])}),wt(A,"handleDoubleClick",function(k){var T=A.props.onDoubleClick;if(kt(T)){var O=A.getMouseInfo(k);T(O,k)}}),wt(A,"handleContextMenu",function(k){var T=A.props.onContextMenu;if(kt(T)){var O=A.getMouseInfo(k);T(O,k)}}),wt(A,"triggerSyncEvent",function(k){A.props.syncId!==void 0&&Oj.emit(Rj,A.props.syncId,k,A.eventEmitterSymbol)}),wt(A,"applySyncEvent",function(k){var T=A.props,O=T.layout,L=T.syncMethod,z=A.state.updateId,q=k.dataStartIndex,F=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)A.setState(je({dataStartIndex:q,dataEndIndex:F},x({props:A.props,dataStartIndex:q,dataEndIndex:F,updateId:z},A.state)));else if(k.activeTooltipIndex!==void 0){var G=k.chartX,W=k.chartY,R=k.activeTooltipIndex,M=A.state,K=M.offset,V=M.tooltipTicks;if(!K)return;if(typeof L=="function")R=L(V,k);else if(L==="value"){R=-1;for(var D=0;D<V.length;D++)if(V[D].value===k.activeLabel){R=D;break}}var J=je(je({},K),{},{x:K.left,y:K.top}),H=Math.min(G,J.x+J.width),I=Math.min(W,J.y+J.height),te=V[R]&&V[R].value,de=L1(A.state,A.props.data,R),fe=V[R]?{x:O==="horizontal"?V[R].coordinate:H,y:O==="horizontal"?I:V[R].coordinate}:TF;A.setState(je(je({},k),{},{activeLabel:te,activeCoordinate:fe,activePayload:de,activeTooltipIndex:R}))}else A.setState(k)}),wt(A,"renderCursor",function(k){var T,O=A.state,L=O.isTooltipActive,z=O.activeCoordinate,q=O.activePayload,F=O.offset,G=O.activeTooltipIndex,W=O.tooltipAxisBandSize,R=A.getTooltipEventType(),M=(T=k.props.active)!==null&&T!==void 0?T:L,K=A.props.layout,V=k.key||"_recharts-cursor";return Y.createElement(_fe,{key:V,activeCoordinate:z,activePayload:q,activeTooltipIndex:G,chartName:n,element:k,isActive:M,layout:K,offset:F,tooltipAxisBandSize:W,tooltipEventType:R})}),wt(A,"renderPolarAxis",function(k,T,O){var L=da(k,"type.axisType"),z=da(A.state,"".concat(L,"Map")),q=k.type.defaultProps,F=q!==void 0?je(je({},q),k.props):k.props,G=z&&z[F["".concat(L,"Id")]];return m.cloneElement(k,je(je({},G),{},{className:Ot(L,G.className),key:k.key||"".concat(T,"-").concat(O),ticks:Di(G,!0)}))}),wt(A,"renderPolarGrid",function(k){var T=k.props,O=T.radialLines,L=T.polarAngles,z=T.polarRadius,q=A.state,F=q.radiusAxisMap,G=q.angleAxisMap,W=rc(F),R=rc(G),M=R.cx,K=R.cy,V=R.innerRadius,D=R.outerRadius;return m.cloneElement(k,{polarAngles:Array.isArray(L)?L:Di(R,!0).map(function(J){return J.coordinate}),polarRadius:Array.isArray(z)?z:Di(W,!0).map(function(J){return J.coordinate}),cx:M,cy:K,innerRadius:V,outerRadius:D,key:k.key||"polar-grid",radialLines:O})}),wt(A,"renderLegend",function(){var k=A.state.formattedGraphicalItems,T=A.props,O=T.children,L=T.width,z=T.height,q=A.props.margin||{},F=L-(q.left||0)-(q.right||0),G=p4({children:O,formattedGraphicalItems:k,legendWidth:F,legendContent:f});if(!G)return null;var W=G.item,R=kM(G,Afe);return m.cloneElement(W,je(je({},R),{},{chartWidth:L,chartHeight:z,margin:q,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),wt(A,"renderTooltip",function(){var k,T=A.props,O=T.children,L=T.accessibilityLayer,z=sa(O,Br);if(!z)return null;var q=A.state,F=q.isTooltipActive,G=q.activeCoordinate,W=q.activePayload,R=q.activeLabel,M=q.offset,K=(k=z.props.active)!==null&&k!==void 0?k:F;return m.cloneElement(z,{viewBox:je(je({},M),{},{x:M.left,y:M.top}),active:K,label:R,payload:K?W:[],coordinate:G,accessibilityLayer:L})}),wt(A,"renderBrush",function(k){var T=A.props,O=T.margin,L=T.data,z=A.state,q=z.offset,F=z.dataStartIndex,G=z.dataEndIndex,W=z.updateId;return m.cloneElement(k,{key:k.key||"_recharts-brush",onChange:gh(A.handleBrushChange,k.props.onChange),data:L,x:qe(k.props.x)?k.props.x:q.left,y:qe(k.props.y)?k.props.y:q.top+q.height+q.brushBottom-(O.bottom||0),width:qe(k.props.width)?k.props.width:q.width,startIndex:F,endIndex:G,updateId:"brush-".concat(W)})}),wt(A,"renderReferenceElement",function(k,T,O){if(!k)return null;var L=A,z=L.clipPathId,q=A.state,F=q.xAxisMap,G=q.yAxisMap,W=q.offset,R=k.type.defaultProps||{},M=k.props,K=M.xAxisId,V=K===void 0?R.xAxisId:K,D=M.yAxisId,J=D===void 0?R.yAxisId:D;return m.cloneElement(k,{key:k.key||"".concat(T,"-").concat(O),xAxis:F[V],yAxis:G[J],viewBox:{x:W.left,y:W.top,width:W.width,height:W.height},clipPathId:z})}),wt(A,"renderActivePoints",function(k){var T=k.item,O=k.activePoint,L=k.basePoint,z=k.childIndex,q=k.isRange,F=[],G=T.props.key,W=T.item.type.defaultProps!==void 0?je(je({},T.item.type.defaultProps),T.item.props):T.item.props,R=W.activeDot,M=W.dataKey,K=je(je({index:z,dataKey:M,cx:O.x,cy:O.y,r:4,fill:AC(T.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value},yt(R,!1)),Vh(R));return F.push(S.renderActiveDot(R,K,"".concat(G,"-activePoint-").concat(z))),L?F.push(S.renderActiveDot(R,je(je({},K),{},{cx:L.x,cy:L.y}),"".concat(G,"-basePoint-").concat(z))):q&&F.push(null),F}),wt(A,"renderGraphicChild",function(k,T,O){var L=A.filterFormatItem(k,T,O);if(!L)return null;var z=A.getTooltipEventType(),q=A.state,F=q.isTooltipActive,G=q.tooltipAxis,W=q.activeTooltipIndex,R=q.activeLabel,M=A.props.children,K=sa(M,Br),V=L.props,D=V.points,J=V.isRange,H=V.baseLine,I=L.item.type.defaultProps!==void 0?je(je({},L.item.type.defaultProps),L.item.props):L.item.props,te=I.activeDot,de=I.hide,fe=I.activeBar,me=I.activeShape,U=!!(!de&&F&&K&&(te||fe||me)),oe={};z!=="axis"&&K&&K.props.trigger==="click"?oe={onClick:gh(A.handleItemMouseEnter,k.props.onClick)}:z!=="axis"&&(oe={onMouseLeave:gh(A.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:gh(A.handleItemMouseEnter,k.props.onMouseEnter)});var re=m.cloneElement(k,je(je({},L.props),oe));function ne(dt){return typeof G.dataKey=="function"?G.dataKey(dt.payload):null}if(U)if(W>=0){var ve,le;if(G.dataKey&&!G.allowDuplicatedCategory){var Ae=typeof G.dataKey=="function"?ne:"payload.".concat(G.dataKey.toString());ve=Wh(D,Ae,R),le=J&&H&&Wh(H,Ae,R)}else ve=D?.[W],le=J&&H&&H[W];if(me||fe){var be=k.props.activeIndex!==void 0?k.props.activeIndex:W;return[m.cloneElement(k,je(je(je({},L.props),oe),{},{activeIndex:be})),null,null]}if(!Tt(ve))return[re].concat(Xc(A.renderActivePoints({item:L,activePoint:ve,basePoint:le,childIndex:W,isRange:J})))}else{var We,B=(We=A.getItemByXY(A.state.activeCoordinate))!==null&&We!==void 0?We:{graphicalItem:re},ie=B.graphicalItem,he=ie.item,Te=he===void 0?k:he,Ye=ie.childIndex,ut=je(je(je({},L.props),oe),{},{activeIndex:Ye});return[m.cloneElement(Te,ut),null,null]}return J?[re,null,null]:[re,null]}),wt(A,"renderCustomized",function(k,T,O){return m.cloneElement(k,je(je({key:"recharts-customized-".concat(O)},A.props),A.state))}),wt(A,"renderMap",{CartesianGrid:{handler:jh,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:jh},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:jh},YAxis:{handler:jh},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=C.id)!==null&&N!==void 0?N:hu("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=pL(A.triggeredAfterMouseMove,(E=C.throttleDelay)!==null&&E!==void 0?E:1e3/60),A.state={},A}return Ffe(S,y),Mfe(S,[{key:"componentDidMount",value:function(){var N,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var N=this.props,E=N.children,A=N.data,k=N.height,T=N.layout,O=sa(E,Br);if(O){var L=O.props.defaultIndex;if(!(typeof L!="number"||L<0||L>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[L]&&this.state.tooltipTicks[L].value,q=L1(this.state,A,L,z),F=this.state.tooltipTicks[L].coordinate,G=(this.state.offset.top+k)/2,W=T==="horizontal",R=W?{x:F,y:G}:{y:F,x:G},M=this.state.formattedGraphicalItems.find(function(V){var D=V.item;return D.type.name==="Scatter"});M&&(R=je(je({},R),M.props.points[L].tooltipPosition),q=M.props.points[L].tooltipPayload);var K={activeTooltipIndex:L,isTooltipActive:!0,activeLabel:z,activePayload:q,activeCoordinate:R};this.setState(K),this.renderCursor(O),this.accessibilityManager.setIndex(L)}}}},{key:"getSnapshotBeforeUpdate",value:function(N,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==N.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==N.margin){var A,k;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(N){bS([sa(N.children,Br)],[sa(this.props.children,Br)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var N=sa(this.props.children,Br);if(N&&typeof N.props.shared=="boolean"){var E=N.props.shared?"axis":"item";return c.indexOf(E)>=0?E:o}return o}},{key:"getMouseInfo",value:function(N){if(!this.container)return null;var E=this.container,A=E.getBoundingClientRect(),k=jee(A),T={chartX:Math.round(N.pageX-k.left),chartY:Math.round(N.pageY-k.top)},O=A.width/E.offsetWidth||1,L=this.inRange(T.chartX,T.chartY,O);if(!L)return null;var z=this.state,q=z.xAxisMap,F=z.yAxisMap,G=this.getTooltipEventType(),W=OM(this.state,this.props.data,this.props.layout,L);if(G!=="axis"&&q&&F){var R=rc(q).scale,M=rc(F).scale,K=R&&R.invert?R.invert(T.chartX):null,V=M&&M.invert?M.invert(T.chartY):null;return je(je({},T),{},{xValue:K,yValue:V},W)}return W?je(je({},T),W):null}},{key:"inRange",value:function(N,E){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,T=N/A,O=E/A;if(k==="horizontal"||k==="vertical"){var L=this.state.offset,z=T>=L.left&&T<=L.left+L.width&&O>=L.top&&O<=L.top+L.height;return z?{x:T,y:O}:null}var q=this.state,F=q.angleAxisMap,G=q.radiusAxisMap;if(F&&G){var W=rc(F);return F2({x:T,y:O},W)}return null}},{key:"parseEventsOfWrapper",value:function(){var N=this.props.children,E=this.getTooltipEventType(),A=sa(N,Br),k={};A&&E==="axis"&&(A.props.trigger==="click"?k={onClick:this.handleClick}:k={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 T=Vh(this.props,this.handleOuterEvent);return je(je({},T),k)}},{key:"addListener",value:function(){Oj.on(Rj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Oj.removeListener(Rj,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(N,E,A){for(var k=this.state.formattedGraphicalItems,T=0,O=k.length;T<O;T++){var L=k[T];if(L.item===N||L.props.key===N.key||E===eo(L.item.type)&&A===L.childIndex)return L}return null}},{key:"renderClipPath",value:function(){var N=this.clipPathId,E=this.state.offset,A=E.left,k=E.top,T=E.height,O=E.width;return Y.createElement("defs",null,Y.createElement("clipPath",{id:N},Y.createElement("rect",{x:A,y:k,height:T,width:O})))}},{key:"getXScales",value:function(){var N=this.state.xAxisMap;return N?Object.entries(N).reduce(function(E,A){var k=PM(A,2),T=k[0],O=k[1];return je(je({},E),{},wt({},T,O.scale))},{}):null}},{key:"getYScales",value:function(){var N=this.state.yAxisMap;return N?Object.entries(N).reduce(function(E,A){var k=PM(A,2),T=k[0],O=k[1];return je(je({},E),{},wt({},T,O.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(N){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(N){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(N){var E=this.state,A=E.formattedGraphicalItems,k=E.activeItem;if(A&&A.length)for(var T=0,O=A.length;T<O;T++){var L=A[T],z=L.props,q=L.item,F=q.type.defaultProps!==void 0?je(je({},q.type.defaultProps),q.props):q.props,G=eo(q.type);if(G==="Bar"){var W=(z.data||[]).find(function(V){return qie(N,V)});if(W)return{graphicalItem:L,payload:W}}else if(G==="RadialBar"){var R=(z.data||[]).find(function(V){return F2(N,V)});if(R)return{graphicalItem:L,payload:R}}else if(ng(L,k)||rg(L,k)||ff(L,k)){var M=fce({graphicalItem:L,activeTooltipItem:k,itemData:F.data}),K=F.activeIndex===void 0?M:F.activeIndex;return{graphicalItem:je(je({},L),{},{childIndex:K}),payload:ff(L,k)?F.data[M]:L.props.data[M]}}}return null}},{key:"render",value:function(){var N=this;if(!Xk(this))return null;var E=this.props,A=E.children,k=E.className,T=E.width,O=E.height,L=E.style,z=E.compact,q=E.title,F=E.desc,G=kM(E,Efe),W=yt(G,!1);if(z)return Y.createElement(fM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement(jS,dc({},W,{width:T,height:O,title:q,desc:F}),this.renderClipPath(),Qk(A,this.renderMap)));if(this.props.accessibilityLayer){var R,M;W.tabIndex=(R=this.props.tabIndex)!==null&&R!==void 0?R:0,W.role=(M=this.props.role)!==null&&M!==void 0?M:"application",W.onKeyDown=function(V){N.accessibilityManager.keyboardEvent(V)},W.onFocus=function(){N.accessibilityManager.focus()}}var K=this.parseEventsOfWrapper();return Y.createElement(fM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},Y.createElement("div",dc({className:Ot("recharts-wrapper",k),style:je({position:"relative",cursor:"default",width:T,height:O},L)},K,{ref:function(D){N.container=D}}),Y.createElement(jS,dc({},W,{width:T,height:O,title:q,desc:F,style:Vfe}),this.renderClipPath(),Qk(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(m.Component);wt(j,"displayName",n),wt(j,"defaultProps",je({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),wt(j,"getDerivedStateFromProps",function(y,S){var C=y.dataKey,N=y.data,E=y.children,A=y.width,k=y.height,T=y.layout,O=y.stackOffset,L=y.margin,z=S.dataStartIndex,q=S.dataEndIndex;if(S.updateId===void 0){var F=RM(y);return je(je(je({},F),{},{updateId:0},x(je(je({props:y},F),{},{updateId:0}),S)),{},{prevDataKey:C,prevData:N,prevWidth:A,prevHeight:k,prevLayout:T,prevStackOffset:O,prevMargin:L,prevChildren:E})}if(C!==S.prevDataKey||N!==S.prevData||A!==S.prevWidth||k!==S.prevHeight||T!==S.prevLayout||O!==S.prevStackOffset||!gc(L,S.prevMargin)){var G=RM(y),W={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},R=je(je({},OM(S,N,T)),{},{updateId:S.updateId+1}),M=je(je(je({},G),W),R);return je(je(je({},M),x(je({props:y},M),S)),{},{prevDataKey:C,prevData:N,prevWidth:A,prevHeight:k,prevLayout:T,prevStackOffset:O,prevMargin:L,prevChildren:E})}if(!bS(E,S.prevChildren)){var K,V,D,J,H=sa(E,Bc),I=H&&(K=(V=H.props)===null||V===void 0?void 0:V.startIndex)!==null&&K!==void 0?K:z,te=H&&(D=(J=H.props)===null||J===void 0?void 0:J.endIndex)!==null&&D!==void 0?D:q,de=I!==z||te!==q,fe=!Tt(N),me=fe&&!de?S.updateId:S.updateId+1;return je(je({updateId:me},x(je(je({props:y},S),{},{updateId:me,dataStartIndex:I,dataEndIndex:te}),S)),{},{prevChildren:E,dataStartIndex:I,dataEndIndex:te})}return null}),wt(j,"renderActiveDot",function(y,S,C){var N;return m.isValidElement(y)?N=m.cloneElement(y,S):kt(y)?N=y(S):N=Y.createElement(Jv,S),Y.createElement(Zt,{className:"recharts-active-dot",key:C},N)});var b=m.forwardRef(function(S,C){return Y.createElement(j,dc({},S,{ref:C}))});return b.displayName=j.displayName,b},F1=RC({chartName:"LineChart",GraphicalChild:Zi,axisComponents:[{axisType:"xAxis",AxisComp:Qo},{axisType:"yAxis",AxisComp:Zo}],formatAxisMap:X4}),tpe=RC({chartName:"BarChart",GraphicalChild:bl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Qo},{axisType:"yAxis",AxisComp:Zo}],formatAxisMap:X4}),npe=RC({chartName:"PieChart",GraphicalChild:vo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:tg},{axisType:"radiusAxis",AxisComp:Zv}],formatAxisMap:ese,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const rpe=()=>{const{configs:e}=Rf(),{source:t}=$n(),[n,r]=m.useState([]),[a,o]=m.useState("timestamp"),[i,c]=m.useState("desc"),d=y=>{if(a===y){c(S=>S==="asc"?"desc":"asc");return}o(y),c("desc")};m.useEffect(()=>{let y=!0;return t.listResults().then(S=>{y&&r(S)}),()=>{y=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((y,S)=>y+S.overallPassRate,0)/h,g=h===0?0:Math.round(n.reduce((y,S)=>y+S.avgLatency,0)/h),x=m.useMemo(()=>[...n].sort((S,C)=>{let N=0;return a==="timestamp"&&(N=new Date(S.timestamp).getTime()-new Date(C.timestamp).getTime()),a==="passRate"&&(N=S.overallPassRate-C.overallPassRate),a==="latency"&&(N=S.avgLatency-C.avgLatency),a==="scenarios"&&(N=S.totalScenarios-C.totalScenarios),i==="asc"?N:-N}),[n,a,i]),j=[...x].reverse().map(y=>({date:new Date(y.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(y.overallPassRate*100),latency:y.avgLatency})),b=y=>{const S=Array.from(new Set(y.scenarios.map(O=>O.scenarioId).filter(Boolean))),C=Array.from(new Set(y.scenarios.map(O=>O.agentName).filter(Boolean))),N=Array.from(new Set(y.scenarios.map(O=>O.model).filter(O=>!!O))),E=S.slice(0,2).join(", "),A=S.length>2?` +${S.length-2}`:"",k=N.slice(0,2).join(", "),T=N.length>2?` +${N.length-2}`:"";return{scenarioCount:S.length,agentCount:C.length,scenarioPreview:E?`${E}${A}`:"n/a",modelSummary:k?`${k}${T}`:""}};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(Z$,{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(Ct,{to:"/mcp-evaluations/new",children:[s.jsx(fN,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(se,{variant:"outline",asChild:!0,children:s.jsxs(Ct,{to:"/run",children:[s.jsx(Zs,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(se,{variant:"outline",asChild:!0,children:s.jsxs(Ct,{to:"/results",children:[s.jsx(kd,{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(ms,{title:"MCP Evaluations",value:f,icon:Jj,subtitle:`${f} active`}),s.jsx(ms,{title:"Total Runs",value:h,icon:G$,subtitle:"Last 30 days"}),s.jsx(ms,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:kd,subtitle:"+5% from last week",trend:"up"}),s.jsx(ms,{title:"Avg Latency",value:`${g}ms`,icon:nD,subtitle:"-120ms from last week",trend:"up"})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(ze,{children:s.jsx(tm,{width:"100%",height:200,children:s.jsxs(F1,{data:j,children:[s.jsx(Qo,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Zo,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:y=>`${y}%`}),s.jsx(Br,{formatter:y=>[`${y}%`,"Pass Rate"]}),s.jsx(Zi,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(ze,{children:s.jsx(tm,{width:"100%",height:200,children:s.jsxs(F1,{data:j,children:[s.jsx(Qo,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Zo,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Br,{formatter:y=>[`${y}ms`,"Latency"]}),s.jsx(Zi,{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(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Recent Runs"})}),s.jsx(ze,{className:"p-0",children:s.jsxs(qr,{children:[s.jsx(Wr,{children:s.jsxs(Vt,{children:[s.jsx(tt,{children:"Run ID"}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("timestamp"),children:["Timestamp",a==="timestamp"?i==="asc"?s.jsx(bs,{className:"h-3.5 w-3.5"}):s.jsx(Kt,{className:"h-3.5 w-3.5"}):s.jsx(fc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("passRate"),children:["Pass Rate",a==="passRate"?i==="asc"?s.jsx(bs,{className:"h-3.5 w-3.5"}):s.jsx(Kt,{className:"h-3.5 w-3.5"}):s.jsx(fc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(tt,{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"?i==="asc"?s.jsx(bs,{className:"h-3.5 w-3.5"}):s.jsx(Kt,{className:"h-3.5 w-3.5"}):s.jsx(fc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(Vr,{children:x.map(y=>s.jsxs(Vt,{className:"cursor-pointer",children:[s.jsx(Fe,{children:s.jsx(Ct,{to:`/results/${y.id}`,className:"font-mono text-xs text-primary hover:underline",children:y.id})}),s.jsx(Fe,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=b(y);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",S.scenarioCount," scenario",S.scenarioCount===1?"":"s"," · ",S.agentCount," agent",S.agentCount===1?"":"s",S.modelSummary?` · ${S.modelSummary}`:""]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:S.scenarioPreview})]})})()}),s.jsx(Fe,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(uo,{className:"h-3 w-3"}),new Date(y.timestamp).toLocaleString()]})}),s.jsx(Fe,{children:s.jsx(Xs,{rate:y.overallPassRate})}),s.jsx(Fe,{className:"text-right font-mono text-sm",children:y.totalScenarios})]},y.id))})]})})]})})]})};function IC({value:e,onValueChange:t,placeholder:n="Search...",className:r,inputClassName:a,clearAriaLabel:o="Clear search"}){return s.jsxs("div",{className:Se("relative",r),children:[s.jsx(pt,{value:e,onChange:i=>t(i.target.value),placeholder:n,className:Se("h-9 w-[240px] pr-8",a)}),e&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 border border-border/60",onClick:()=>t(""),"aria-label":o,children:s.jsx(_s,{className:"h-4 w-4"})})]})}var ape=m.createContext(void 0);function yu(e){const t=m.useContext(ape);return e||t||"ltr"}var Mj="rovingFocusGroup.onEntryFocus",spe={bubbles:!1,cancelable:!0},qf="RovingFocusGroup",[B1,RF,ope]=Sf(qf),[ipe,dg]=pr(qf,[ope]),[lpe,cpe]=ipe(qf),IF=m.forwardRef((e,t)=>s.jsx(B1.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(B1.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(upe,{...e,ref:t})})}));IF.displayName=qf;var upe=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,g=m.useRef(null),x=xt(t,g),j=yu(o),[b,y]=pa({prop:i,defaultProp:c??null,onChange:d,caller:qf}),[S,C]=m.useState(!1),N=qn(f),E=RF(n),A=m.useRef(!1),[k,T]=m.useState(0);return m.useEffect(()=>{const O=g.current;if(O)return O.addEventListener(Mj,N),()=>O.removeEventListener(Mj,N)},[N]),s.jsx(lpe,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:m.useCallback(O=>y(O),[y]),onItemShiftTab:m.useCallback(()=>C(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(O=>O+1),[]),onFocusableItemRemove:m.useCallback(()=>T(O=>O-1),[]),children:s.jsx(Ke.div,{tabIndex:S||k===0?-1:0,"data-orientation":r,...p,ref:x,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{A.current=!0}),onFocus:Re(e.onFocus,O=>{const L=!A.current;if(O.target===O.currentTarget&&L&&!S){const z=new CustomEvent(Mj,spe);if(O.currentTarget.dispatchEvent(z),!z.defaultPrevented){const q=E().filter(M=>M.focusable),F=q.find(M=>M.active),G=q.find(M=>M.id===b),R=[F,G,...q].filter(Boolean).map(M=>M.ref.current);DF(R,h)}}A.current=!1}),onBlur:Re(e.onBlur,()=>C(!1))})})}),MF="RovingFocusGroupItem",$F=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:i,...c}=e,d=er(),f=o||d,h=cpe(MF,n),p=h.currentTabStopId===f,g=RF(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:b}=h;return m.useEffect(()=>{if(r)return x(),()=>j()},[r,x,j]),s.jsx(B1.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(Ke.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Re(e.onMouseDown,y=>{r?h.onItemFocus(f):y.preventDefault()}),onFocus:Re(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Re(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){h.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=ppe(y,h.orientation,h.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let N=g().filter(E=>E.focusable).map(E=>E.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const E=N.indexOf(y.currentTarget);N=h.loop?hpe(N,E+1):N.slice(E+1)}setTimeout(()=>DF(N))}}),children:typeof i=="function"?i({isCurrentTabStop:p,hasTabStop:b!=null}):i})})});$F.displayName=MF;var dpe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function fpe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ppe(e,t,n){const r=fpe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return dpe[r]}function DF(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function hpe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var LF=IF,FF=$F;function mpe(e){const t=vpe(e),n=m.forwardRef((r,a)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(xpe);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...i,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function vpe(e){const t=m.forwardRef((n,r)=>{const{children:a,...o}=n;if(m.isValidElement(a)){const i=bpe(a),c=ype(o,a.props);return a.type!==m.Fragment&&(c.ref=r?kr(r,i):i),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var gpe=Symbol("radix.slottable");function xpe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gpe}function ype(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...c)=>{const d=o(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function bpe(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 z1=["Enter"," "],wpe=["ArrowDown","PageUp","Home"],BF=["ArrowUp","PageDown","End"],jpe=[...wpe,...BF],Spe={ltr:[...z1,"ArrowRight"],rtl:[...z1,"ArrowLeft"]},Npe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Wf="Menu",[yf,Cpe,_pe]=Sf(Wf),[wl,zF]=pr(Wf,[_pe,ti,dg]),fg=ti(),UF=dg(),[Ape,jl]=wl(Wf),[Epe,Vf]=wl(Wf),qF=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:i=!0}=e,c=fg(t),[d,f]=m.useState(null),h=m.useRef(!1),p=qn(o),g=yu(a);return m.useEffect(()=>{const x=()=>{h.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>h.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(cv,{...c,children:s.jsx(Ape,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Epe,{scope:t,onClose:m.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:g,modal:i,children:r})})})};qF.displayName=Wf;var Ppe="MenuAnchor",MC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=fg(n);return s.jsx(_f,{...a,...r,ref:t})});MC.displayName=Ppe;var $C="MenuPortal",[kpe,WF]=wl($C,{forceMount:void 0}),VF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,o=jl($C,t);return s.jsx(kpe,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||o.open,children:s.jsx(dl,{asChild:!0,container:a,children:r})})})};VF.displayName=$C;var ka="MenuContent",[Tpe,DC]=wl(ka),HF=m.forwardRef((e,t)=>{const n=WF(ka,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=jl(ka,e.__scopeMenu),i=Vf(ka,e.__scopeMenu);return s.jsx(yf.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||o.open,children:s.jsx(yf.Slot,{scope:e.__scopeMenu,children:i.modal?s.jsx(Ope,{...a,ref:t}):s.jsx(Rpe,{...a,ref:t})})})})}),Ope=m.forwardRef((e,t)=>{const n=jl(ka,e.__scopeMenu),r=m.useRef(null),a=xt(t,r);return m.useEffect(()=>{const o=r.current;if(o)return jv(o)},[]),s.jsx(LC,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Rpe=m.forwardRef((e,t)=>{const n=jl(ka,e.__scopeMenu);return s.jsx(LC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ipe=mpe("MenuContent.ScrollLock"),LC=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:x,disableOutsideScroll:j,...b}=e,y=jl(ka,n),S=Vf(ka,n),C=fg(n),N=UF(n),E=Cpe(n),[A,k]=m.useState(null),T=m.useRef(null),O=xt(t,T,y.onContentChange),L=m.useRef(0),z=m.useRef(""),q=m.useRef(0),F=m.useRef(null),G=m.useRef("right"),W=m.useRef(0),R=j?Pf:m.Fragment,M=j?{as:Ipe,allowPinchZoom:!0}:void 0,K=D=>{const J=z.current+D,H=E().filter(U=>!U.disabled),I=document.activeElement,te=H.find(U=>U.ref.current===I)?.textValue,de=H.map(U=>U.textValue),fe=Hpe(de,J,te),me=H.find(U=>U.textValue===fe)?.ref.current;(function U(oe){z.current=oe,window.clearTimeout(L.current),oe!==""&&(L.current=window.setTimeout(()=>U(""),1e3))})(J),me&&setTimeout(()=>me.focus())};m.useEffect(()=>()=>window.clearTimeout(L.current),[]),bv();const V=m.useCallback(D=>G.current===F.current?.side&&Gpe(D,F.current?.area),[]);return s.jsx(Tpe,{scope:n,searchRef:z,onItemEnter:m.useCallback(D=>{V(D)&&D.preventDefault()},[V]),onItemLeave:m.useCallback(D=>{V(D)||(T.current?.focus(),k(null))},[V]),onTriggerLeave:m.useCallback(D=>{V(D)&&D.preventDefault()},[V]),pointerGraceTimerRef:q,onPointerGraceIntentChange:m.useCallback(D=>{F.current=D},[]),children:s.jsx(R,{...M,children:s.jsx(Ef,{asChild:!0,trapped:a,onMountAutoFocus:Re(o,D=>{D.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:s.jsx(ul,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:x,children:s.jsx(LF,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:k,onEntryFocus:Re(d,D=>{S.isUsingKeyboardRef.current||D.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(uv,{role:"menu","aria-orientation":"vertical","data-state":lB(y.open),"data-radix-menu-content":"",dir:S.dir,...C,...b,ref:O,style:{outline:"none",...b.style},onKeyDown:Re(b.onKeyDown,D=>{const H=D.target.closest("[data-radix-menu-content]")===D.currentTarget,I=D.ctrlKey||D.altKey||D.metaKey,te=D.key.length===1;H&&(D.key==="Tab"&&D.preventDefault(),!I&&te&&K(D.key));const de=T.current;if(D.target!==de||!jpe.includes(D.key))return;D.preventDefault();const me=E().filter(U=>!U.disabled).map(U=>U.ref.current);BF.includes(D.key)&&me.reverse(),Wpe(me)}),onBlur:Re(e.onBlur,D=>{D.currentTarget.contains(D.target)||(window.clearTimeout(L.current),z.current="")}),onPointerMove:Re(e.onPointerMove,bf(D=>{const J=D.target,H=W.current!==D.clientX;if(D.currentTarget.contains(J)&&H){const I=D.clientX>W.current?"right":"left";G.current=I,W.current=D.clientX}}))})})})})})})});HF.displayName=ka;var Mpe="MenuGroup",FC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ke.div,{role:"group",...r,ref:t})});FC.displayName=Mpe;var $pe="MenuLabel",KF=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ke.div,{...r,ref:t})});KF.displayName=$pe;var Vm="MenuItem",MM="menu.itemSelect",pg=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,o=m.useRef(null),i=Vf(Vm,e.__scopeMenu),c=DC(Vm,e.__scopeMenu),d=xt(t,o),f=m.useRef(!1),h=()=>{const p=o.current;if(!n&&p){const g=new CustomEvent(MM,{bubbles:!0,cancelable:!0});p.addEventListener(MM,x=>r?.(x),{once:!0}),aN(p,g),g.defaultPrevented?f.current=!1:i.onClose()}};return s.jsx(GF,{...a,ref:d,disabled:n,onClick:Re(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Re(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Re(e.onKeyDown,p=>{const g=c.searchRef.current!=="";n||g&&p.key===" "||z1.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});pg.displayName=Vm;var GF=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...o}=e,i=DC(Vm,n),c=UF(n),d=m.useRef(null),f=xt(t,d),[h,p]=m.useState(!1),[g,x]=m.useState("");return m.useEffect(()=>{const j=d.current;j&&x((j.textContent??"").trim())},[o.children]),s.jsx(yf.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:s.jsx(FF,{asChild:!0,...c,focusable:!r,children:s.jsx(Ke.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:f,onPointerMove:Re(e.onPointerMove,bf(j=>{r?i.onItemLeave(j):(i.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,bf(j=>i.onItemLeave(j))),onFocus:Re(e.onFocus,()=>p(!0)),onBlur:Re(e.onBlur,()=>p(!1))})})})}),Dpe="MenuCheckboxItem",YF=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(eB,{scope:e.__scopeMenu,checked:n,children:s.jsx(pg,{role:"menuitemcheckbox","aria-checked":Hm(n)?"mixed":n,...a,ref:t,"data-state":zC(n),onSelect:Re(a.onSelect,()=>r?.(Hm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});YF.displayName=Dpe;var XF="MenuRadioGroup",[Lpe,Fpe]=wl(XF,{value:void 0,onValueChange:()=>{}}),JF=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,o=qn(r);return s.jsx(Lpe,{scope:e.__scopeMenu,value:n,onValueChange:o,children:s.jsx(FC,{...a,ref:t})})});JF.displayName=XF;var QF="MenuRadioItem",ZF=m.forwardRef((e,t)=>{const{value:n,...r}=e,a=Fpe(QF,e.__scopeMenu),o=n===a.value;return s.jsx(eB,{scope:e.__scopeMenu,checked:o,children:s.jsx(pg,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":zC(o),onSelect:Re(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ZF.displayName=QF;var BC="MenuItemIndicator",[eB,Bpe]=wl(BC,{checked:!1}),tB=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,o=Bpe(BC,n);return s.jsx(Kn,{present:r||Hm(o.checked)||o.checked===!0,children:s.jsx(Ke.span,{...a,ref:t,"data-state":zC(o.checked)})})});tB.displayName=BC;var zpe="MenuSeparator",nB=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});nB.displayName=zpe;var Upe="MenuArrow",rB=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=fg(n);return s.jsx(dv,{...a,...r,ref:t})});rB.displayName=Upe;var qpe="MenuSub",[Yxe,aB]=wl(qpe),bd="MenuSubTrigger",sB=m.forwardRef((e,t)=>{const n=jl(bd,e.__scopeMenu),r=Vf(bd,e.__scopeMenu),a=aB(bd,e.__scopeMenu),o=DC(bd,e.__scopeMenu),i=m.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=o,f={__scopeMenu:e.__scopeMenu},h=m.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return m.useEffect(()=>h,[h]),m.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),s.jsx(MC,{asChild:!0,...f,children:s.jsx(GF,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":lB(n.open),...e,ref:kr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,bf(p=>{o.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Re(e.onPointerLeave,bf(p=>{h();const g=n.content?.getBoundingClientRect();if(g){const x=n.content?.dataset.side,j=x==="right",b=j?-5:5,y=g[j?"left":"right"],S=g[j?"right":"left"];o.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:y,y:g.bottom}],side:x}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(p),p.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,p=>{const g=o.searchRef.current!=="";e.disabled||g&&p.key===" "||Spe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});sB.displayName=bd;var oB="MenuSubContent",iB=m.forwardRef((e,t)=>{const n=WF(ka,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,o=jl(ka,e.__scopeMenu),i=Vf(ka,e.__scopeMenu),c=aB(oB,e.__scopeMenu),d=m.useRef(null),f=xt(t,d);return s.jsx(yf.Provider,{scope:e.__scopeMenu,children:s.jsx(Kn,{present:r||o.open,children:s.jsx(yf.Slot,{scope:e.__scopeMenu,children:s.jsx(LC,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:f,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{i.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Re(e.onFocusOutside,h=>{h.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,h=>{i.onClose(),h.preventDefault()}),onKeyDown:Re(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),g=Npe[i.dir].includes(h.key);p&&g&&(o.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});iB.displayName=oB;function lB(e){return e?"open":"closed"}function Hm(e){return e==="indeterminate"}function zC(e){return Hm(e)?"indeterminate":e?"checked":"unchecked"}function Wpe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Vpe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Hpe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=Vpe(e,Math.max(o,0));a.length===1&&(i=i.filter(f=>f!==n));const d=i.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Kpe(e,t){const{x:n,y:r}=e;let a=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const c=t[o],d=t[i],f=c.x,h=c.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(a=!a)}return a}function Gpe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Kpe(n,t)}function bf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Ype=qF,Xpe=MC,Jpe=VF,Qpe=HF,Zpe=FC,ehe=KF,the=pg,nhe=YF,rhe=JF,ahe=ZF,she=tB,ohe=nB,ihe=rB,lhe=sB,che=iB,hg="DropdownMenu",[uhe]=pr(hg,[zF]),Tr=zF(),[dhe,cB]=uhe(hg),uB=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:i,modal:c=!0}=e,d=Tr(t),f=m.useRef(null),[h,p]=pa({prop:a,defaultProp:o??!1,onChange:i,caller:hg});return s.jsx(dhe,{scope:t,triggerId:er(),triggerRef:f,contentId:er(),open:h,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(g=>!g),[p]),modal:c,children:s.jsx(Ype,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};uB.displayName=hg;var dB="DropdownMenuTrigger",fB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,o=cB(dB,n),i=Tr(n);return s.jsx(Xpe,{asChild:!0,...i,children:s.jsx(Ke.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:kr(t,o.triggerRef),onPointerDown:Re(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(o.onOpenToggle(),o.open||c.preventDefault())}),onKeyDown:Re(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&o.onOpenToggle(),c.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});fB.displayName=dB;var fhe="DropdownMenuPortal",pB=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Tr(t);return s.jsx(Jpe,{...r,...n})};pB.displayName=fhe;var hB="DropdownMenuContent",mB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=cB(hB,n),o=Tr(n),i=m.useRef(!1);return s.jsx(Qpe,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...r,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,c=>{i.current||a.triggerRef.current?.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!a.modal||h)&&(i.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)"}})});mB.displayName=hB;var phe="DropdownMenuGroup",hhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(Zpe,{...a,...r,ref:t})});hhe.displayName=phe;var mhe="DropdownMenuLabel",vB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(ehe,{...a,...r,ref:t})});vB.displayName=mhe;var vhe="DropdownMenuItem",gB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(the,{...a,...r,ref:t})});gB.displayName=vhe;var ghe="DropdownMenuCheckboxItem",xB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(nhe,{...a,...r,ref:t})});xB.displayName=ghe;var xhe="DropdownMenuRadioGroup",yhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(rhe,{...a,...r,ref:t})});yhe.displayName=xhe;var bhe="DropdownMenuRadioItem",yB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(ahe,{...a,...r,ref:t})});yB.displayName=bhe;var whe="DropdownMenuItemIndicator",bB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(she,{...a,...r,ref:t})});bB.displayName=whe;var jhe="DropdownMenuSeparator",wB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(ohe,{...a,...r,ref:t})});wB.displayName=jhe;var She="DropdownMenuArrow",Nhe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(ihe,{...a,...r,ref:t})});Nhe.displayName=She;var Che="DropdownMenuSubTrigger",jB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(lhe,{...a,...r,ref:t})});jB.displayName=Che;var _he="DropdownMenuSubContent",SB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Tr(n);return s.jsx(che,{...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)"}})});SB.displayName=_he;var Ahe=uB,Ehe=fB,Phe=pB,NB=mB,CB=vB,_B=gB,AB=xB,EB=yB,PB=bB,kB=wB,TB=jB,OB=SB;const Hf=Ahe,Kf=Ehe,khe=m.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(TB,{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(lN,{className:"ml-auto h-4 w-4"})]}));khe.displayName=TB.displayName;const The=m.forwardRef(({className:e,...t},n)=>s.jsx(OB,{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}));The.displayName=OB.displayName;const bu=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Phe,{children:s.jsx(NB,{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})}));bu.displayName=NB.displayName;const Kr=m.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(_B,{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}));Kr.displayName=_B.displayName;const Ohe=m.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(AB,{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(PB,{children:s.jsx(wc,{className:"h-4 w-4"})})}),t]}));Ohe.displayName=AB.displayName;const Rhe=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(EB,{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(PB,{children:s.jsx(N7,{className:"h-2 w-2 fill-current"})})}),t]}));Rhe.displayName=EB.displayName;const RB=m.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(CB,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));RB.displayName=CB.displayName;const IB=m.forwardRef(({className:e,...t},n)=>s.jsx(kB,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));IB.displayName=kB.displayName;function wf(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ihe(e){const t=Mhe(e),n=m.forwardRef((r,a)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(Dhe);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...i,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function Mhe(e){const t=m.forwardRef((n,r)=>{const{children:a,...o}=n;if(m.isValidElement(a)){const i=Fhe(a),c=Lhe(o,a.props);return a.type!==m.Fragment&&(c.ref=r?kr(r,i):i),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $he=Symbol("radix.slottable");function Dhe(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$he}function Lhe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...c)=>{const d=o(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Fhe(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 mg(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Bhe=[" ","Enter","ArrowUp","ArrowDown"],zhe=[" ","Enter"],el="Select",[vg,gg,Uhe]=Sf(el),[wu]=pr(el,[Uhe,ti]),xg=ti(),[qhe,li]=wu(el),[Whe,Vhe]=wu(el),MB=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:i,defaultValue:c,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:g,required:x,form:j}=e,b=xg(t),[y,S]=m.useState(null),[C,N]=m.useState(null),[E,A]=m.useState(!1),k=yu(f),[T,O]=pa({prop:r,defaultProp:a??!1,onChange:o,caller:el}),[L,z]=pa({prop:i,defaultProp:c,onChange:d,caller:el}),q=m.useRef(null),F=y?j||!!y.closest("form"):!0,[G,W]=m.useState(new Set),R=Array.from(G).map(M=>M.props.value).join(";");return s.jsx(cv,{...b,children:s.jsxs(qhe,{required:x,scope:t,trigger:y,onTriggerChange:S,valueNode:C,onValueNodeChange:N,valueNodeHasChildren:E,onValueNodeHasChildrenChange:A,contentId:er(),value:L,onValueChange:z,open:T,onOpenChange:O,dir:k,triggerPointerDownPosRef:q,disabled:g,children:[s.jsx(vg.Provider,{scope:t,children:s.jsx(Whe,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(M=>{W(K=>new Set(K).add(M))},[]),onNativeOptionRemove:m.useCallback(M=>{W(K=>{const V=new Set(K);return V.delete(M),V})},[]),children:n})}),F?s.jsxs(sz,{"aria-hidden":!0,required:x,tabIndex:-1,name:h,autoComplete:p,value:L,onChange:M=>z(M.target.value),disabled:g,form:j,children:[L===void 0?s.jsx("option",{value:""}):null,Array.from(G)]},R):null]})})};MB.displayName=el;var $B="SelectTrigger",DB=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=xg(n),i=li($B,n),c=i.disabled||r,d=xt(t,i.onTriggerChange),f=gg(n),h=m.useRef("touch"),[p,g,x]=iz(b=>{const y=f().filter(N=>!N.disabled),S=y.find(N=>N.value===i.value),C=lz(y,b,S);C!==void 0&&i.onValueChange(C.value)}),j=b=>{c||(i.onOpenChange(!0),x()),b&&(i.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return s.jsx(_f,{asChild:!0,...o,children:s.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":oz(i.value)?"":void 0,...a,ref:d,onClick:Re(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:Re(a.onPointerDown,b=>{h.current=b.pointerType;const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Re(a.onKeyDown,b=>{const y=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&g(b.key),!(y&&b.key===" ")&&Bhe.includes(b.key)&&(j(),b.preventDefault())})})})});DB.displayName=$B;var LB="SelectValue",FB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:i="",...c}=e,d=li(LB,n),{onValueNodeHasChildrenChange:f}=d,h=o!==void 0,p=xt(t,d.onValueNodeChange);return tr(()=>{f(h)},[f,h]),s.jsx(Ke.span,{...c,ref:p,style:{pointerEvents:"none"},children:oz(d.value)?s.jsx(s.Fragment,{children:i}):o})});FB.displayName=LB;var Hhe="SelectIcon",BB=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(Ke.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});BB.displayName=Hhe;var Khe="SelectPortal",zB=e=>s.jsx(dl,{asChild:!0,...e});zB.displayName=Khe;var tl="SelectContent",UB=m.forwardRef((e,t)=>{const n=li(tl,e.__scopeSelect),[r,a]=m.useState();if(tr(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?tu.createPortal(s.jsx(qB,{scope:e.__scopeSelect,children:s.jsx(vg.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),o):null}return s.jsx(WB,{...e,ref:t})});UB.displayName=tl;var Va=10,[qB,ci]=wu(tl),Ghe="SelectContentImpl",Yhe=Ihe("SelectContent.RemoveScroll"),WB=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:i,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:y,...S}=e,C=li(tl,n),[N,E]=m.useState(null),[A,k]=m.useState(null),T=xt(t,U=>E(U)),[O,L]=m.useState(null),[z,q]=m.useState(null),F=gg(n),[G,W]=m.useState(!1),R=m.useRef(!1);m.useEffect(()=>{if(N)return jv(N)},[N]),bv();const M=m.useCallback(U=>{const[oe,...re]=F().map(le=>le.ref.current),[ne]=re.slice(-1),ve=document.activeElement;for(const le of U)if(le===ve||(le?.scrollIntoView({block:"nearest"}),le===oe&&A&&(A.scrollTop=0),le===ne&&A&&(A.scrollTop=A.scrollHeight),le?.focus(),document.activeElement!==ve))return},[F,A]),K=m.useCallback(()=>M([O,N]),[M,O,N]);m.useEffect(()=>{G&&K()},[G,K]);const{onOpenChange:V,triggerPointerDownPosRef:D}=C;m.useEffect(()=>{if(N){let U={x:0,y:0};const oe=ne=>{U={x:Math.abs(Math.round(ne.pageX)-(D.current?.x??0)),y:Math.abs(Math.round(ne.pageY)-(D.current?.y??0))}},re=ne=>{U.x<=10&&U.y<=10?ne.preventDefault():N.contains(ne.target)||V(!1),document.removeEventListener("pointermove",oe),D.current=null};return D.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",re,{capture:!0})}}},[N,V,D]),m.useEffect(()=>{const U=()=>V(!1);return window.addEventListener("blur",U),window.addEventListener("resize",U),()=>{window.removeEventListener("blur",U),window.removeEventListener("resize",U)}},[V]);const[J,H]=iz(U=>{const oe=F().filter(ve=>!ve.disabled),re=oe.find(ve=>ve.ref.current===document.activeElement),ne=lz(oe,U,re);ne&&setTimeout(()=>ne.ref.current.focus())}),I=m.useCallback((U,oe,re)=>{const ne=!R.current&&!re;(C.value!==void 0&&C.value===oe||ne)&&(L(U),ne&&(R.current=!0))},[C.value]),te=m.useCallback(()=>N?.focus(),[N]),de=m.useCallback((U,oe,re)=>{const ne=!R.current&&!re;(C.value!==void 0&&C.value===oe||ne)&&q(U)},[C.value]),fe=r==="popper"?U1:VB,me=fe===U1?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:x,sticky:j,hideWhenDetached:b,avoidCollisions:y}:{};return s.jsx(qB,{scope:n,content:N,viewport:A,onViewportChange:k,itemRefCallback:I,selectedItem:O,onItemLeave:te,itemTextRefCallback:de,focusSelectedItem:K,selectedItemText:z,position:r,isPositioned:G,searchRef:J,children:s.jsx(Pf,{as:Yhe,allowPinchZoom:!0,children:s.jsx(Ef,{asChild:!0,trapped:C.open,onMountAutoFocus:U=>{U.preventDefault()},onUnmountAutoFocus:Re(a,U=>{C.trigger?.focus({preventScroll:!0}),U.preventDefault()}),children:s.jsx(ul,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:U=>U.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:s.jsx(fe,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:U=>U.preventDefault(),...S,...me,onPlaced:()=>W(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Re(S.onKeyDown,U=>{const oe=U.ctrlKey||U.altKey||U.metaKey;if(U.key==="Tab"&&U.preventDefault(),!oe&&U.key.length===1&&H(U.key),["ArrowUp","ArrowDown","Home","End"].includes(U.key)){let ne=F().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);if(["ArrowUp","End"].includes(U.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(U.key)){const ve=U.target,le=ne.indexOf(ve);ne=ne.slice(le+1)}setTimeout(()=>M(ne)),U.preventDefault()}})})})})})})});WB.displayName=Ghe;var Xhe="SelectItemAlignedPosition",VB=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=li(tl,n),i=ci(tl,n),[c,d]=m.useState(null),[f,h]=m.useState(null),p=xt(t,T=>h(T)),g=gg(n),x=m.useRef(!1),j=m.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:S,focusSelectedItem:C}=i,N=m.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&f&&b&&y&&S){const T=o.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),L=o.valueNode.getBoundingClientRect(),z=S.getBoundingClientRect();if(o.dir!=="rtl"){const ve=z.left-O.left,le=L.left-ve,Ae=T.left-le,be=T.width+Ae,We=Math.max(be,O.width),B=window.innerWidth-Va,ie=wf(le,[Va,Math.max(Va,B-We)]);c.style.minWidth=be+"px",c.style.left=ie+"px"}else{const ve=O.right-z.right,le=window.innerWidth-L.right-ve,Ae=window.innerWidth-T.right-le,be=T.width+Ae,We=Math.max(be,O.width),B=window.innerWidth-Va,ie=wf(le,[Va,Math.max(Va,B-We)]);c.style.minWidth=be+"px",c.style.right=ie+"px"}const q=g(),F=window.innerHeight-Va*2,G=b.scrollHeight,W=window.getComputedStyle(f),R=parseInt(W.borderTopWidth,10),M=parseInt(W.paddingTop,10),K=parseInt(W.borderBottomWidth,10),V=parseInt(W.paddingBottom,10),D=R+M+G+V+K,J=Math.min(y.offsetHeight*5,D),H=window.getComputedStyle(b),I=parseInt(H.paddingTop,10),te=parseInt(H.paddingBottom,10),de=T.top+T.height/2-Va,fe=F-de,me=y.offsetHeight/2,U=y.offsetTop+me,oe=R+M+U,re=D-oe;if(oe<=de){const ve=q.length>0&&y===q[q.length-1].ref.current;c.style.bottom="0px";const le=f.clientHeight-b.offsetTop-b.offsetHeight,Ae=Math.max(fe,me+(ve?te:0)+le+K),be=oe+Ae;c.style.height=be+"px"}else{const ve=q.length>0&&y===q[0].ref.current;c.style.top="0px";const Ae=Math.max(de,R+b.offsetTop+(ve?I:0)+me)+re;c.style.height=Ae+"px",b.scrollTop=oe-de+b.offsetTop}c.style.margin=`${Va}px 0`,c.style.minHeight=J+"px",c.style.maxHeight=F+"px",r?.(),requestAnimationFrame(()=>x.current=!0)}},[g,o.trigger,o.valueNode,c,f,b,y,S,o.dir,r]);tr(()=>N(),[N]);const[E,A]=m.useState();tr(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const k=m.useCallback(T=>{T&&j.current===!0&&(N(),C?.(),j.current=!1)},[N,C]);return s.jsx(Qhe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:x,onScrollButtonChange:k,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:s.jsx(Ke.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});VB.displayName=Xhe;var Jhe="SelectPopperPosition",U1=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Va,...o}=e,i=xg(n);return s.jsx(uv,{...i,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.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)"}})});U1.displayName=Jhe;var[Qhe,UC]=wu(tl,{}),q1="SelectViewport",HB=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=ci(q1,n),i=UC(q1,n),c=xt(t,o.onViewportChange),d=m.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(vg.Slot,{scope:n,children:s.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Re(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=i;if(g?.current&&p){const x=Math.abs(d.current-h.scrollTop);if(x>0){const j=window.innerHeight-Va*2,b=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(b,y);if(S<j){const C=S+x,N=Math.min(j,C),E=C-N;p.style.height=N+"px",p.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});HB.displayName=q1;var KB="SelectGroup",[Zhe,eme]=wu(KB),tme=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=er();return s.jsx(Zhe,{scope:n,id:a,children:s.jsx(Ke.div,{role:"group","aria-labelledby":a,...r,ref:t})})});tme.displayName=KB;var GB="SelectLabel",YB=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=eme(GB,n);return s.jsx(Ke.div,{id:a.id,...r,ref:t})});YB.displayName=GB;var Km="SelectItem",[nme,XB]=wu(Km),JB=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...i}=e,c=li(Km,n),d=ci(Km,n),f=c.value===r,[h,p]=m.useState(o??""),[g,x]=m.useState(!1),j=xt(t,C=>d.itemRefCallback?.(C,r,a)),b=er(),y=m.useRef("touch"),S=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(nme,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:m.useCallback(C=>{p(N=>N||(C?.textContent??"").trim())},[]),children:s.jsx(vg.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(Ke.div,{role:"option","aria-labelledby":b,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...i,ref:j,onFocus:Re(i.onFocus,()=>x(!0)),onBlur:Re(i.onBlur,()=>x(!1)),onClick:Re(i.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:Re(i.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:Re(i.onPointerDown,C=>{y.current=C.pointerType}),onPointerMove:Re(i.onPointerMove,C=>{y.current=C.pointerType,a?d.onItemLeave?.():y.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(i.onPointerLeave,C=>{C.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Re(i.onKeyDown,C=>{d.searchRef?.current!==""&&C.key===" "||(zhe.includes(C.key)&&S(),C.key===" "&&C.preventDefault())})})})})});JB.displayName=Km;var wd="SelectItemText",QB=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,i=li(wd,n),c=ci(wd,n),d=XB(wd,n),f=Vhe(wd,n),[h,p]=m.useState(null),g=xt(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),x=h?.textContent,j=m.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=f;return tr(()=>(b(j),()=>y(j)),[b,y,j]),s.jsxs(s.Fragment,{children:[s.jsx(Ke.span,{id:d.textId,...o,ref:g}),d.isSelected&&i.valueNode&&!i.valueNodeHasChildren?tu.createPortal(o.children,i.valueNode):null]})});QB.displayName=wd;var ZB="SelectItemIndicator",ez=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return XB(ZB,n).isSelected?s.jsx(Ke.span,{"aria-hidden":!0,...r,ref:t}):null});ez.displayName=ZB;var W1="SelectScrollUpButton",tz=m.forwardRef((e,t)=>{const n=ci(W1,e.__scopeSelect),r=UC(W1,e.__scopeSelect),[a,o]=m.useState(!1),i=xt(t,r.onScrollButtonChange);return tr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;o(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(rz,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});tz.displayName=W1;var V1="SelectScrollDownButton",nz=m.forwardRef((e,t)=>{const n=ci(V1,e.__scopeSelect),r=UC(V1,e.__scopeSelect),[a,o]=m.useState(!1),i=xt(t,r.onScrollButtonChange);return tr(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;o(h)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(rz,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});nz.displayName=V1;var rz=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=ci("SelectScrollButton",n),i=m.useRef(null),c=gg(n),d=m.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return m.useEffect(()=>()=>d(),[d]),tr(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(Ke.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Re(a.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:Re(a.onPointerMove,()=>{o.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:Re(a.onPointerLeave,()=>{d()})})}),rme="SelectSeparator",az=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Ke.div,{"aria-hidden":!0,...r,ref:t})});az.displayName=rme;var H1="SelectArrow",ame=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=xg(n),o=li(H1,n),i=ci(H1,n);return o.open&&i.position==="popper"?s.jsx(dv,{...a,...r,ref:t}):null});ame.displayName=H1;var sme="SelectBubbleInput",sz=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=m.useRef(null),o=xt(r,a),i=mg(t);return m.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&h){const p=new Event("change",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[i,t]),s.jsx(Ke.select,{...n,style:{..._$,...n.style},ref:o,defaultValue:t})});sz.displayName=sme;function oz(e){return e===""||e===void 0}function iz(e){const t=qn(e),n=m.useRef(""),r=m.useRef(0),a=m.useCallback(i=>{const c=n.current+i;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),o=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function lz(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=ome(e,Math.max(o,0));a.length===1&&(i=i.filter(f=>f!==n));const d=i.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function ome(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ime=MB,cz=DB,lme=FB,cme=BB,ume=zB,uz=UB,dme=HB,dz=YB,fz=JB,fme=QB,pme=ez,pz=tz,hz=nz,mz=az;const bn=ime,wn=lme,hn=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(cz,{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(cme,{asChild:!0,children:s.jsx(Kt,{className:"h-4 w-4 opacity-50"})})]}));hn.displayName=cz.displayName;const vz=m.forwardRef(({className:e,...t},n)=>s.jsx(pz,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(bs,{className:"h-4 w-4"})}));vz.displayName=pz.displayName;const gz=m.forwardRef(({className:e,...t},n)=>s.jsx(hz,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Kt,{className:"h-4 w-4"})}));gz.displayName=hz.displayName;const mn=m.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(ume,{children:s.jsxs(uz,{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(vz,{}),s.jsx(dme,{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(gz,{})]})}));mn.displayName=uz.displayName;const hme=m.forwardRef(({className:e,...t},n)=>s.jsx(dz,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));hme.displayName=dz.displayName;const Qe=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(fz,{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(pme,{children:s.jsx(wc,{className:"h-4 w-4"})})}),s.jsx(fme,{children:t})]}));Qe.displayName=fz.displayName;const mme=m.forwardRef(({className:e,...t},n)=>s.jsx(mz,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));mme.displayName=mz.displayName;const Zl=e=>e.configName?.trim()||e.name,vme="(root)",xz="__ROOT__",$M="mcplab.configurations.collapsedSuites",$j=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,Ei=e=>e??vme,Dj=e=>e===null?xz:`suite:${e}`,gme=e=>e===xz?null:e.startsWith("suite:")?e.slice(6):null,DM=["bg-red-400","bg-red-500","bg-orange-400","bg-orange-500","bg-amber-400","bg-amber-500","bg-yellow-400","bg-yellow-500","bg-lime-400","bg-lime-500","bg-green-400","bg-green-500","bg-emerald-400","bg-emerald-500","bg-teal-400","bg-teal-500","bg-cyan-400","bg-cyan-500","bg-sky-400","bg-sky-500","bg-blue-400","bg-blue-500","bg-indigo-400","bg-indigo-500","bg-violet-400","bg-violet-500","bg-purple-400","bg-purple-500","bg-fuchsia-400","bg-fuchsia-500","bg-pink-400","bg-pink-500","bg-rose-400","bg-rose-500"];function xme(e){if(e===null)return"bg-slate-400";const t=e.split("").reduce((n,r)=>(n+r.charCodeAt(0))%DM.length,0);return DM[t]??"bg-slate-400"}const yme=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=Rf(),{source:o}=$n(),i=Ia(),[c,d]=m.useState("name"),[f,h]=m.useState("asc"),[p,g]=m.useState(""),[x,j]=m.useState("all"),[b,y]=m.useState(()=>{try{const M=window.localStorage.getItem($M);if(!M)return new Set;const K=JSON.parse(M);return Array.isArray(K)?new Set(K.filter(V=>typeof V=="string")):new Set}catch(M){return console.warn("Failed to restore collapsed suites from localStorage",M),new Set}}),[S,C]=m.useState(new Set),N=p.trim().toLowerCase(),E=M=>{if(c===M){h(K=>K==="asc"?"desc":"asc");return}d(M),h(M==="updatedAt"?"desc":"asc")};m.useEffect(()=>{a();const M=()=>{a()};return window.addEventListener("focus",M),()=>{window.removeEventListener("focus",M)}},[a]);const A=async(M,K)=>{await t(M),Pe({title:"Deleted",description:`"${K}" has been removed.`})},k=async M=>{const K=await n(M);Pe({title:"Cloned",description:`Created "${Zl(K)}".`}),i(`/mcp-evaluations/${K.id}`)},T=M=>M.agentEntries?.length??M.agents?.length??0,O=M=>M.scenarioEntries?.length??M.scenarios?.length??0,L=m.useMemo(()=>{const M=new Set;for(const K of e)M.add($j(K));return Array.from(M).sort((K,V)=>Ei(K).localeCompare(Ei(V)))},[e]),z=m.useMemo(()=>e.filter(M=>{const K=$j(M),V=x==="all"?void 0:gme(x),D=Ei(K);return V!==void 0&&K!==V?!1:N.length===0?!0:[Zl(M),M.id,M.description??"",M.loadError??"",D,M.relativePath??""].join(" ").toLowerCase().includes(N)}),[e,N,x]),q=m.useMemo(()=>[...z].sort((K,V)=>{let D=0;return c==="name"&&(D=Zl(K).localeCompare(Zl(V))),c==="scenarios"&&(D=O(K)-O(V)),c==="agents"&&(D=T(K)-T(V)),c==="updatedAt"&&(D=new Date(K.updatedAt).getTime()-new Date(V.updatedAt).getTime()),f==="asc"?D:-D}),[z,c,f]),F=M=>c!==M?s.jsx(fc,{className:"h-3.5 w-3.5 text-muted-foreground"}):f==="asc"?s.jsx(bs,{className:"h-3.5 w-3.5"}):s.jsx(Kt,{className:"h-3.5 w-3.5"}),G=M=>{y(K=>{const V=new Set(K);return V.has(M)?V.delete(M):V.add(M),V})};m.useEffect(()=>{try{window.localStorage.setItem($M,JSON.stringify(Array.from(b)))}catch(M){console.warn("Failed to persist collapsed suites to localStorage (quota/private mode?)",M)}},[b]);const W=async(M,K,V)=>{if(!S.has(M)){C(D=>new Set(D).add(M));try{const D=V.filter(fe=>typeof fe.sourcePath=="string"&&fe.sourcePath.trim().length>0);if(D.length===0){Pe({title:"No runnable evaluations",description:`Suite "${K}" has no evaluation files with a source path.`,variant:"destructive"});return}const J=await Promise.allSettled(D.map(fe=>o.startRun({configPath:String(fe.sourcePath),runsPerScenario:1,applySnapshotEval:!0}))),H=J.filter(fe=>fe.status==="fulfilled").length,I=J.length-H,te=J.find(fe=>fe.status==="rejected"),de=te?te.reason instanceof Error?te.reason.message:String(te.reason):void 0;Pe({title:I===0?"Suite queued":"Suite queued with errors",description:I===0?`Queued ${H} evaluation${H===1?"":"s"} for suite "${K}".`:`Queued ${H}/${D.length} evaluations for suite "${K}" (${I} failed${de?`: ${de}`:""}).`,variant:I===0?"default":"destructive"})}catch(D){Pe({title:"Could not queue suite",description:D instanceof Error?D.message:String(D),variant:"destructive"})}finally{C(D=>{const J=new Set(D);return J.delete(M),J})}}},R=m.useMemo(()=>{const M=new Map;for(const K of q){const V=$j(K),D=M.get(V);D?D.push(K):M.set(V,[K])}return Array.from(M.entries()).sort((K,V)=>Ei(K[0]).localeCompare(Ei(V[0])))},[q]);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(Q$,{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.jsx(IC,{value:p,onValueChange:g,placeholder:"Search evaluations..."}),s.jsxs(bn,{value:x,onValueChange:j,children:[s.jsx(hn,{className:"h-9 w-[200px]",children:s.jsx(wn,{placeholder:"All suites"})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"all",children:"All suites"}),L.map(M=>s.jsx(Qe,{value:Dj(M),children:Ei(M)},Dj(M)))]})]}),s.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{variant:"outline",size:"sm",children:[s.jsx(D7,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(se,{size:"sm",asChild:!0,children:s.jsxs(Ct,{to:"/mcp-evaluations/new",children:[s.jsx(ao,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(Be,{children:s.jsx(ze,{className:"p-0",children:s.jsxs(qr,{children:[s.jsx(Wr,{children:s.jsxs(Vt,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>E("name"),children:["Name",F("name")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>E("scenarios"),children:["Scenarios",F("scenarios")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>E("agents"),children:["Agents",F("agents")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>E("updatedAt"),children:["Last Updated",F("updatedAt")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsxs(Vr,{children:[R.map(([M,K])=>{const V=Ei(M),D=Dj(M),J=b.has(D),H=S.has(D);return s.jsxs(m.Fragment,{children:[s.jsx(Vt,{className:"bg-muted/40 hover:bg-muted/40",children:s.jsx(Fe,{colSpan:5,className:"py-2",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("button",{type:"button",className:"inline-flex h-6 items-center gap-2 text-xs leading-none hover:text-foreground",onClick:()=>G(D),"aria-expanded":!J,"aria-label":`${J?"Expand":"Collapse"} suite ${V}`,children:[s.jsx(lN,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${J?"":"rotate-90"}`,"aria-hidden":"true"}),s.jsx("span",{className:`h-2 w-2 rounded-full ${xme(M)}`,"aria-hidden":"true"}),M===null?s.jsx(P7,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}):s.jsx(A7,{className:"h-3.5 w-3.5 text-muted-foreground","aria-hidden":"true"}),s.jsx("span",{className:"font-medium",children:V}),s.jsxs("span",{className:"text-muted-foreground",children:["(",K.length,")"]})]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:H,onClick:()=>{W(D,V,K)},children:[s.jsx(Zs,{className:"mr-1 h-3.5 w-3.5"}),H?"Queueing...":"Run Suite"]})]})})},`suite-${D}`),!J&&K.map(I=>s.jsxs(Vt,{children:[s.jsx(Fe,{children:s.jsxs("div",{children:[s.jsx(Ct,{to:`/mcp-evaluations/${I.id}`,className:"font-medium text-sm hover:text-primary",children:Zl(I)}),I.loadError&&s.jsxs(Ue,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(Eh,{className:"mr-1 h-3 w-3"}),"Broken"]}),I.relativePath&&s.jsx("div",{className:"mt-0.5",children:s.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:I.relativePath})}),I.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:I.loadError})]})}),s.jsx(Fe,{className:"text-right font-mono text-sm",children:O(I)}),s.jsx(Fe,{className:"text-right font-mono text-sm",children:T(I)}),s.jsx(Fe,{className:"text-right text-xs text-muted-foreground",children:s.jsxs("div",{className:"inline-flex items-center gap-1",children:[s.jsx(uo,{className:"h-3 w-3"}),new Date(I.updatedAt).toLocaleDateString()]})}),s.jsx(Fe,{children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(Ct,{to:`/run?configId=${encodeURIComponent(I.id)}`,children:[s.jsx(Zs,{className:"h-3.5 w-3.5"}),"Run"]})}),s.jsxs(Hf,{children:[s.jsx(Kf,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(nv,{className:"h-4 w-4"})})}),s.jsxs(bu,{align:"end",children:[s.jsxs(Kr,{onClick:()=>i(`/mcp-evaluations/${I.id}`),children:[s.jsx(rv,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(Kr,{onClick:()=>{k(I.id)},children:[s.jsx(Cs,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(Kr,{className:"text-destructive",onClick:()=>{A(I.id,Zl(I))},children:[s.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})]})})]},I.id))]},`suite-group-${D}`)}),!r&&e.length===0&&s.jsx(Vt,{children:s.jsx(Fe,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),!r&&e.length>0&&q.length===0&&s.jsx(Vt,{children:s.jsx(Fe,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations match this filter."})}),r&&s.jsx(Vt,{children:s.jsx(Fe,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var bme=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wme=bme.reduce((e,t)=>{const n=yv(`Primitive.${t}`),r=m.forwardRef((a,o)=>{const{asChild:i,...c}=a,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),jme="Label",yz=m.forwardRef((e,t)=>s.jsx(wme.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));yz.displayName=jme;var bz=yz;const Sme=fl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),$e=m.forwardRef(({className:e,...t},n)=>s.jsx(bz,{ref:n,className:Se(Sme(),e),...t}));$e.displayName=bz.displayName;const ks=m.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";var yg="Switch",[Nme]=pr(yg),[Cme,_me]=Nme(yg),wz=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:i,disabled:c,value:d="on",onCheckedChange:f,form:h,...p}=e,[g,x]=m.useState(null),j=xt(t,N=>x(N)),b=m.useRef(!1),y=g?h||!!g.closest("form"):!0,[S,C]=pa({prop:a,defaultProp:o??!1,onChange:f,caller:yg});return s.jsxs(Cme,{scope:n,checked:S,disabled:c,children:[s.jsx(Ke.button,{type:"button",role:"switch","aria-checked":S,"aria-required":i,"data-state":Cz(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Re(e.onClick,N=>{C(E=>!E),y&&(b.current=N.isPropagationStopped(),b.current||N.stopPropagation())})}),y&&s.jsx(Nz,{control:g,bubbles:!b.current,name:r,value:d,checked:S,required:i,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});wz.displayName=yg;var jz="SwitchThumb",Sz=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=_me(jz,n);return s.jsx(Ke.span,{"data-state":Cz(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});Sz.displayName=jz;var Ame="SwitchBubbleInput",Nz=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},o)=>{const i=m.useRef(null),c=xt(i,o),d=mg(n),f=lv(t);return m.useEffect(()=>{const h=i.current;if(!h)return;const p=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&x){const j=new Event("click",{bubbles:r});x.call(h,n),h.dispatchEvent(j)}},[d,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Nz.displayName=Ame;function Cz(e){return e?"checked":"unchecked"}var _z=wz,Eme=Sz;const Gm=m.forwardRef(({className:e,...t},n)=>s.jsx(_z,{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(Eme,{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")})}));Gm.displayName=_z.displayName;var bg="Tabs",[Pme]=pr(bg,[dg]),Az=dg(),[kme,qC]=Pme(bg),Ez=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:i="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=yu(c),[p,g]=pa({prop:r,onChange:a,defaultProp:o??"",caller:bg});return s.jsx(kme,{scope:n,baseId:er(),value:p,onValueChange:g,orientation:i,dir:h,activationMode:d,children:s.jsx(Ke.div,{dir:h,"data-orientation":i,...f,ref:t})})});Ez.displayName=bg;var Pz="TabsList",kz=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=qC(Pz,n),i=Az(n);return s.jsx(LF,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:r,children:s.jsx(Ke.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});kz.displayName=Pz;var Tz="TabsTrigger",Oz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,i=qC(Tz,n),c=Az(n),d=Mz(i.baseId,r),f=$z(i.baseId,r),h=r===i.value;return s.jsx(FF,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(Ke.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,...o,ref:t,onMouseDown:Re(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?i.onValueChange(r):p.preventDefault()}),onKeyDown:Re(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&i.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const p=i.activationMode!=="manual";!h&&!a&&p&&i.onValueChange(r)})})})});Oz.displayName=Tz;var Rz="TabsContent",Iz=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...i}=e,c=qC(Rz,n),d=Mz(c.baseId,r),f=$z(c.baseId,r),h=r===c.value,p=m.useRef(h);return m.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(Kn,{present:a||h,children:({present:g})=>s.jsx(Ke.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});Iz.displayName=Rz;function Mz(e,t){return`${e}-trigger-${t}`}function $z(e,t){return`${e}-content-${t}`}var Tme=Ez,Dz=kz,Lz=Oz,Fz=Iz;const wg=Tme,Gf=m.forwardRef(({className:e,...t},n)=>s.jsx(Dz,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Gf.displayName=Dz.displayName;const Ns=m.forwardRef(({className:e,...t},n)=>s.jsx(Lz,{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}));Ns.displayName=Lz.displayName;const jf=m.forwardRef(({className:e,...t},n)=>s.jsx(Fz,{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}));jf.displayName=Fz.displayName;const Ome={openai:"OpenAI",anthropic:"Anthropic",azure:"Azure OpenAI",azure_openai:"Azure OpenAI",google:"Google"};function Ym(e){return Ome[e]??e}const LM={openai:"bg-emerald-100 text-emerald-800",anthropic:"bg-orange-100 text-orange-800",azure:"bg-blue-100 text-blue-800",azure_openai:"bg-blue-100 text-blue-800",google:"bg-yellow-100 text-yellow-800",custom:"bg-gray-100 text-gray-800"};function Bz({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${LM[e]??LM.custom}`,children:Ym(e)})}var jg="Collapsible",[Rme]=pr(jg),[Ime,WC]=Rme(jg),zz=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:o,onOpenChange:i,...c}=e,[d,f]=pa({prop:r,defaultProp:a??!1,onChange:i,caller:jg});return s.jsx(Ime,{scope:n,disabled:o,contentId:er(),open:d,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),children:s.jsx(Ke.div,{"data-state":HC(d),"data-disabled":o?"":void 0,...c,ref:t})})});zz.displayName=jg;var Uz="CollapsibleTrigger",qz=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=WC(Uz,n);return s.jsx(Ke.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":HC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Re(e.onClick,a.onOpenToggle)})});qz.displayName=Uz;var VC="CollapsibleContent",Wz=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=WC(VC,e.__scopeCollapsible);return s.jsx(Kn,{present:n||a.open,children:({present:o})=>s.jsx(Mme,{...r,ref:t,present:o})})});Wz.displayName=VC;var Mme=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...o}=e,i=WC(VC,n),[c,d]=m.useState(r),f=m.useRef(null),h=xt(t,f),p=m.useRef(0),g=p.current,x=m.useRef(0),j=x.current,b=i.open||c,y=m.useRef(b),S=m.useRef(void 0);return m.useEffect(()=>{const C=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(C)},[]),tr(()=>{const C=f.current;if(C){S.current=S.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const N=C.getBoundingClientRect();p.current=N.height,x.current=N.width,y.current||(C.style.transitionDuration=S.current.transitionDuration,C.style.animationName=S.current.animationName),d(r)}},[i.open,r]),s.jsx(Ke.div,{"data-state":HC(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!b,...o,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:b&&a})});function HC(e){return e?"open":"closed"}var $me=zz;const Ya=$me,_a=qz,Xa=Wz;function Ta({text:e,variant:t="assistant",className:n}){const r=Dme(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,o)=>s.jsx(m.Fragment,{children:Lme(a,o,t)},`md-${o}`))})}function Dme(e){const t=e.replace(/\r\n/g,`
|
|
121
|
-
`).split(`
|
|
122
|
-
`),n=[];let r=0;const a=i=>i.trim()==="",o=i=>i.trimStart().startsWith("```");for(;r<t.length;){const i=t[r],c=i.trim();if(a(i)){r+=1;continue}if(o(i)){const g=c.replace(/^```/,"").trim()||void 0;r+=1;const x=[];for(;r<t.length&&!o(t[r]);)x.push(t[r]),r+=1;r<t.length&&o(t[r])&&(r+=1),n.push({type:"code",lang:g,code:x.join(`
|
|
123
|
-
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const g=[];for(;r<t.length&&t[r].trim().startsWith(">");)g.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:g.join(`
|
|
124
|
-
`)});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(FM(t,r)){const g=BM(t[r]);r+=2;const x=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)x.push(BM(t[r])),r+=1;n.push({type:"table",headers:g,rows:x});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const g=!!f,x=[];for(;r<t.length;){const j=t[r].trim();if(g?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){x.push(j.replace(g?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:g,items:x});continue}const p=[i];for(r+=1;r<t.length;){const g=t[r],x=g.trim();if(a(g)||o(g)||/^---+$/.test(x)||/^#{1,4}\s+/.test(x)||x.startsWith(">")||FM(t,r)||/^\d+\.\s+/.test(x)||/^[-*+]\s+/.test(x))break;p.push(g),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
125
|
-
`)})}return n}function FM(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 BM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Lme(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:ec(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:ec(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:ec(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,o)=>s.jsx("li",{className:"leading-relaxed",children:ec(a,`${t}-li-${o}`)},`${t}-li-${o}`))})}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:ec(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((o,i)=>s.jsx("td",{className:"px-2 py-1.5 align-top",children:ec(o,`${t}-tdc-${a}-${i}`)},`${t}-td-${a}-${i}`))},`${t}-row-${a}`))})]})}):null}function ec(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 o=r.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return o?s.jsx("a",{href:o[2],target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:o[1]},`${t}-${a}`):s.jsx(m.Fragment,{children:r},`${t}-${a}`)})}function Vz({message:e,className:t,assistantLabel:n,renderActions:r}){const a=e.role;if(a==="tool"){const c=String(e.text??"").trim();return/^(Approved|Denied) tool call\b/i.test(c)?null:s.jsxs("div",{className:Se("rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm",t),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(Ja,{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(a==="system")return s.jsxs("div",{className:Se("flex items-start gap-2 text-xs",t),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(uN,{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(Ta,{text:e.text,variant:"assistant"})})]});const o=a==="user",i=o?jc:Pr;return s.jsxs("div",{className:Se(`flex items-start gap-2 text-xs ${o?"justify-end":"justify-start"}`,t),children:[!o&&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.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full break-words rounded-md border px-3 py-2 text-sm ${o?"border-primary/20 bg-primary/10":"border-border/80 bg-background shadow-sm"}`,children:[!o&&n&&s.jsx("p",{className:"mb-2 text-[11px] font-semibold text-muted-foreground",children:n}),o?s.jsx("p",{className:"whitespace-pre-wrap",children:e.text}):s.jsx(Ta,{text:e.text,variant:"assistant",className:"text-sm"})]}),r]}),o&&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(jc,{className:"h-3 w-3"})})]})}function K1({call:e,loading:t=!1,onApprove:n,onDeny:r,defaultOpen:a,className:o,description:i}){const c=e.status==="pending",d=e.tool||e.publicToolName||"unknown_tool";return s.jsxs("details",{open:a??c,className:Se("group overflow-hidden rounded-md border border-border/60 bg-background",o),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 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ja,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${d}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${c?"bg-amber-100 text-amber-900":e.status==="error"?"bg-red-100 text-red-900":e.status==="denied"?"bg-gray-100 text-gray-700":"bg-muted text-muted-foreground"}`,children:c?"Needs approval":e.status==="error"?"Error":e.status==="denied"?"Denied":"Approved"})]})}),s.jsx(Kt,{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:[i&&s.jsx(Ta,{text:i,variant:"assistant",className:"text-sm"}),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(e.arguments??{},null,2)})}),e.error&&s.jsx("p",{className:"text-xs text-destructive",children:e.error}),c&&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:t,onClick:()=>r?.(e.id),children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:t,onClick:()=>n?.(e.id),children:"Approve"})]})]})]})}function Hz(){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(Pr,{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(wr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]})}function Fme({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:a="w-[360px]"}){return s.jsxs(Hf,{children:[s.jsx(Kf,{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:r,children:[s.jsx(ao,{className:"h-3 w-3"}),"Snippets",s.jsx(Kt,{className:"h-3 w-3"})]})}),s.jsxs(bu,{align:"start",className:a,children:[s.jsx(RB,{children:t}),s.jsx(IB,{}),e.map(o=>s.jsx(Kr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>n(o.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:o.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:o.description})]})},o.label))]})]})}function Kz({input:e,onInputChange:t,onSend:n,inputPlaceholder:r,snippets:a,snippetsLabel:o,onSnippetSelect:i,loading:c=!1,disabled:d=!1,inputRef:f,snippetContentClassName:h}){const p=d||c;return s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(ks,{ref:f,value:e,onChange:g=>t(g.target.value),placeholder:r,disabled:d,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(),p||n())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsx(Fme,{snippets:a,snippetsLabel:o,onSnippetSelect:i,disabled:p,contentClassName:h}),s.jsx(se,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:n,disabled:p||!e.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:c?s.jsx(wr,{className:"h-4 w-4 animate-spin"}):s.jsx(M7,{className:"h-4 w-4"})})]})]})}const Bme=Nv,zme=Cv,Gz=m.forwardRef(({className:e,...t},n)=>s.jsx(uu,{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}));Gz.displayName=uu.displayName;const Yz=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(zme,{children:[s.jsx(Gz,{}),s.jsxs(du,{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(_v,{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(_s,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Yz.displayName=du.displayName;const Xz=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Xz.displayName="DialogHeader";const Jz=m.forwardRef(({className:e,...t},n)=>s.jsx(kf,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));Jz.displayName=kf.displayName;const Qz=m.forwardRef(({className:e,...t},n)=>s.jsx(Tf,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Qz.displayName=Tf.displayName;function Ume(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var KC="ScrollArea",[Zz]=pr(KC),[qme,$a]=Zz(KC),e8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...i}=e,[c,d]=m.useState(null),[f,h]=m.useState(null),[p,g]=m.useState(null),[x,j]=m.useState(null),[b,y]=m.useState(null),[S,C]=m.useState(0),[N,E]=m.useState(0),[A,k]=m.useState(!1),[T,O]=m.useState(!1),L=xt(t,q=>d(q)),z=yu(a);return s.jsx(qme,{scope:n,type:r,dir:z,scrollHideDelay:o,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:g,scrollbarX:x,onScrollbarXChange:j,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:T,onScrollbarYEnabledChange:O,onCornerWidthChange:C,onCornerHeightChange:E,children:s.jsx(Ke.div,{dir:z,...i,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});e8.displayName=KC;var t8="ScrollAreaViewport",n8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,i=$a(t8,n),c=m.useRef(null),d=xt(t,c,i.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(Ke.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});n8.displayName=t8;var $s="ScrollAreaScrollbar",GC=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=$a($s,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=a,c=e.orientation==="horizontal";return m.useEffect(()=>(c?o(!0):i(!0),()=>{c?o(!1):i(!1)}),[c,o,i]),a.type==="hover"?s.jsx(Wme,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Vme,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(r8,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(YC,{...r,ref:t}):null});GC.displayName=$s;var Wme=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=$a($s,e.__scopeScrollArea),[o,i]=m.useState(!1);return m.useEffect(()=>{const c=a.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),i(!0)},h=()=>{d=window.setTimeout(()=>i(!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(Kn,{present:n||o,children:s.jsx(r8,{"data-state":o?"visible":"hidden",...r,ref:t})})}),Vme=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=$a($s,e.__scopeScrollArea),o=e.orientation==="horizontal",i=Ng(()=>d("SCROLL_END"),100),[c,d]=Ume("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 m.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,a.scrollHideDelay,d]),m.useEffect(()=>{const f=a.viewport,h=o?"scrollLeft":"scrollTop";if(f){let p=f[h];const g=()=>{const x=f[h];p!==x&&(d("SCROLL"),i()),p=x};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[a.viewport,o,d,i]),s.jsx(Kn,{present:n||c!=="hidden",children:s.jsx(YC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),r8=m.forwardRef((e,t)=>{const n=$a($s,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,i]=m.useState(!1),c=e.orientation==="horizontal",d=Ng(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(c?f:h)}},10);return Jc(n.viewport,d),Jc(n.content,d),s.jsx(Kn,{present:r||o,children:s.jsx(YC,{"data-state":o?"visible":"hidden",...a,ref:t})})}),YC=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=$a($s,e.__scopeScrollArea),o=m.useRef(null),i=m.useRef(0),[c,d]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=l8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:g=>i.current=g};function p(g,x){return Jme(g,i.current,c,x)}return n==="horizontal"?s.jsx(Hme,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollLeft,x=zM(g,c,a.dir);o.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=p(g,a.dir))}}):n==="vertical"?s.jsx(Kme,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollTop,x=zM(g,c);o.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=p(g))}}):null}),Hme=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=$a($s,e.__scopeScrollArea),[i,c]=m.useState(),d=m.useRef(null),f=xt(t,d,o.onScrollbarXChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(s8,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Sg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(o.viewport){const g=o.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),u8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Jm(i.paddingLeft),paddingEnd:Jm(i.paddingRight)}})}})}),Kme=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=$a($s,e.__scopeScrollArea),[i,c]=m.useState(),d=m.useRef(null),f=xt(t,d,o.onScrollbarYChange);return m.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(s8,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Sg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(o.viewport){const g=o.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),u8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Jm(i.paddingTop),paddingEnd:Jm(i.paddingBottom)}})}})}),[Gme,a8]=Zz($s),s8=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...g}=e,x=$a($s,n),[j,b]=m.useState(null),y=xt(t,L=>b(L)),S=m.useRef(null),C=m.useRef(""),N=x.viewport,E=r.content-r.viewport,A=qn(h),k=qn(d),T=Ng(p,10);function O(L){if(S.current){const z=L.clientX-S.current.left,q=L.clientY-S.current.top;f({x:z,y:q})}}return m.useEffect(()=>{const L=z=>{const q=z.target;j?.contains(q)&&A(z,E)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[N,j,E,A]),m.useEffect(k,[r,k]),Jc(j,T),Jc(x.content,T),s.jsx(Gme,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:qn(o),onThumbPointerUp:qn(i),onThumbPositionChange:k,onThumbPointerDown:qn(c),children:s.jsx(Ke.div,{...g,ref:y,style:{position:"absolute",...g.style},onPointerDown:Re(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),S.current=j.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),O(L))}),onPointerMove:Re(e.onPointerMove,O),onPointerUp:Re(e.onPointerUp,L=>{const z=L.target;z.hasPointerCapture(L.pointerId)&&z.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=C.current,x.viewport&&(x.viewport.style.scrollBehavior=""),S.current=null})})})}),Xm="ScrollAreaThumb",o8=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=a8(Xm,e.__scopeScrollArea);return s.jsx(Kn,{present:n||a.hasThumb,children:s.jsx(Yme,{ref:t,...r})})}),Yme=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=$a(Xm,n),i=a8(Xm,n),{onThumbPositionChange:c}=i,d=xt(t,p=>i.onThumbChange(p)),f=m.useRef(void 0),h=Ng(()=>{f.current&&(f.current(),f.current=void 0)},100);return m.useEffect(()=>{const p=o.viewport;if(p){const g=()=>{if(h(),!f.current){const x=Qme(p,c);f.current=x,c()}};return c(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[o.viewport,h,c]),s.jsx(Ke.div,{"data-state":i.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Re(e.onPointerDownCapture,p=>{const x=p.target.getBoundingClientRect(),j=p.clientX-x.left,b=p.clientY-x.top;i.onThumbPointerDown({x:j,y:b})}),onPointerUp:Re(e.onPointerUp,i.onThumbPointerUp)})});o8.displayName=Xm;var XC="ScrollAreaCorner",i8=m.forwardRef((e,t)=>{const n=$a(XC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(Xme,{...e,ref:t}):null});i8.displayName=XC;var Xme=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=$a(XC,n),[o,i]=m.useState(0),[c,d]=m.useState(0),f=!!(o&&c);return Jc(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),Jc(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),i(h)}),f?s.jsx(Ke.div,{...r,ref:t,style:{width:o,height:c,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Jm(e){return e?parseInt(e,10):0}function l8(e,t){const n=e/t;return isNaN(n)?0:n}function Sg(e){const t=l8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Jme(e,t,n,r="ltr"){const a=Sg(n),o=a/2,i=t||o,c=a-i,d=n.scrollbar.paddingStart+i,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return c8([d,f],p)(e)}function zM(e,t,n="ltr"){const r=Sg(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,i=t.content-t.viewport,c=o-r,d=n==="ltr"?[0,i]:[i*-1,0],f=wf(e,d);return c8([0,i],[0,c])(f)}function c8(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 u8(e,t){return e>0&&e<t}var Qme=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const o={left:e.scrollLeft,top:e.scrollTop},i=n.left!==o.left,c=n.top!==o.top;(i||c)&&t(),n=o,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function Ng(e,t){const n=qn(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Jc(e,t){const n=qn(t);tr(()=>{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 d8=e8,Zme=n8,eve=i8;const JC=m.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(d8,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[s.jsx(Zme,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(f8,{}),s.jsx(eve,{})]}));JC.displayName=d8.displayName;const f8=m.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(GC,{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(o8,{className:"relative flex-1 rounded-full bg-border"})}));f8.displayName=GC.displayName;async function tve(e){const{sessionId:t,source:n,serverName:r,onLaunchUrl:a,timeoutMs:o=5*6e4}=e,i=Date.now()+o;let c=!1;for(;Date.now()<i;){const{session:d}=await n.getOAuthRuntimeSession(t),f=d.authorizeLaunchUrl||d.authorizationUrl||"";if(f&&a&&a(f),d.status==="completed"&&d.hasAccessToken){c=!0;break}if(d.status==="error"||d.status==="stopped")throw new Error(`OAuth login failed for '${r}' (${d.status}). ${d.lastError||""}`.trim());await new Promise(h=>setTimeout(h,1500))}if(!c)throw new Error(`OAuth login timed out for '${r}'. Authorization was not completed within 5 minutes.`)}const nve=250;async function nl(e){const{serverNames:t,source:n,onServerAuthStart:r,onServerStatus:a,timeoutMs:o=5*6e4}=e,i=Array.from(new Set(t.filter(Boolean)));if(i.length===0)return;const c=Date.now()+o,d=new Set,f=new Map;for(;Date.now()<c;){const h=await n.ensureOAuthServers({serverNames:i});for(const g of h.servers){const x=`${g.status}:${g.debugState??""}:${g.runtimeSessionId??""}`;f.get(g.serverName)!==x&&(f.set(g.serverName,x),a?.({serverName:g.serverName,status:g.status,debugState:g.debugState,tokenExpiresAt:g.tokenExpiresAt,tokenExpiresInSeconds:g.tokenExpiresInSeconds,message:g.message}))}const p=h.servers.filter(g=>g.status==="auth_required");if(p.length===0&&h.allReady)return;for(const g of p){const x=g.runtimeSessionId;if(!x)throw new Error(g.message||`OAuth login required for '${g.serverName}'.`);d.has(x)||(d.add(x),r?.(g.serverName));const j=(()=>{let b=!1;return y=>{if(b||!y)return;b=!0;const S=y.startsWith("http")?y:`${window.location.origin}${y}`;window.open(S,"_blank","noopener,noreferrer")}})();j(g.authorizeLaunchUrl||g.authorizationUrl||""),await tve({sessionId:x,source:n,serverName:g.serverName,onLaunchUrl:j,timeoutMs:Math.max(1e4,c-Date.now())})}await new Promise(g=>{window.setTimeout(g,nve)})}throw new Error("OAuth login timed out before all required servers were authorized.")}const rve=[{label:"Suggest Checks",description:"Propose stronger evaluation checks for this scenario.",prompt:"Review the current checks in this scenario and suggest stronger alternatives. For each suggestion, explain what failure mode it catches that the existing checks miss. Prioritize checks that are deterministic, not sensitive to minor phrasing changes, and that would reliably catch regressions."},{label:"Suggest Value Capture Rules",description:"Recommend extract/value capture rules for key outputs.",prompt:"Analyze the expected tool calls and outputs in this scenario and suggest value capture rules that extract the most meaningful structured data. For each rule, explain which field to capture, why it matters for evaluation, and what a good vs. bad captured value looks like."},{label:"Improve Prompt Determinism",description:"Reduce ambiguity and improve reproducibility.",prompt:"Identify parts of this scenario's prompt or context that are ambiguous, open-ended, or likely to produce different results across runs. Suggest specific rewrites that make the expected behavior more deterministic — without changing the intent of what is being tested."},{label:"Generate Scenario Draft",description:"Create a draft scenario from the current context.",prompt:"Based on the current tool configuration and context, generate a complete scenario draft. Include a clear prompt, realistic expected tool calls with arguments, meaningful checks that validate the core behavior, and at least one value capture rule. Explain your choices so I can adjust them."}];function ave({open:e,onOpenChange:t,configId:n,configPath:r,scenario:a,agents:o,servers:i,snapshotEval:c,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:h}){const{source:p}=$n(),[g,x]=m.useState(null),[j,b]=m.useState(null),[y,S]=m.useState(""),[C,N]=m.useState(!1),[E,A]=m.useState(new Set),k=m.useRef(null),T=m.useRef(null),O=m.useRef(null),[L,z]=m.useState(!1),q=m.useRef(!1),F=d||o[0]?.id||"";m.useEffect(()=>{if(!e||!F||g)return;let U=!1;return N(!0),(async()=>{const re=Array.from(new Set(a.serverIds.filter(ve=>i.find(Ae=>Ae.id===ve)?.authType==="oauth2")));await nl({serverNames:re,source:p});const ne=await p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:F,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,evalRules:a.evalRules,extractRules:a.extractRules,snapshotEval:a.snapshotEval?{enabled:a.snapshotEval.enabled,baselineSnapshotId:a.snapshotEval.baselineSnapshotId}:void 0},availableServers:i.map(ve=>({name:ve.name||ve.id,url:ve.url})),availableAgents:o.map(ve=>({name:ve.name||ve.id,provider:ve.provider,model:ve.model}))}});U||(x(ne.sessionId),W(ne.session))})().catch(re=>{U||Pe({title:"Could not start Scenario Assistant",description:re instanceof Error?re.message:String(re),variant:"destructive"})}).finally(()=>{U||N(!1)}),()=>{U=!0}},[e,p,g,n,r,a,c,o,i,F]);const G=()=>{x(null),b(null),S(""),A(new Set),O.current=null},W=m.useCallback(U=>{b(oe=>oe&&oe.messages.length>U.messages.length?oe:U)},[]),R=U=>{G(),p.closeScenarioAssistantSession(U).catch(()=>{})};m.useEffect(()=>{e||g&&(q.current||L||R(g))},[e,g,p,L]),m.useEffect(()=>()=>{g&&p.closeScenarioAssistantSession(g).catch(()=>{})},[g,p]),m.useEffect(()=>{if(!e)return;L&&z(!1),q.current&&(q.current=!1);const U=window.setTimeout(()=>{k.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(U)},[e,C,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),m.useEffect(()=>{const U=T.current;if(!U)return;U.style.height="0px";const oe=Math.min(U.scrollHeight,160);U.style.height=`${Math.max(40,oe)}px`},[y,e]);const M=o.length>0&&a.serverIds.length>0&&!!F,K=async U=>{if(!g)return;const oe=U.trim();if(!oe)return;const re=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ne={id:re,role:"user",text:oe,createdAt:new Date().toISOString()};b(ve=>ve&&{...ve,messages:[...ve.messages,ne]}),S(""),N(!0);try{const ve=await p.sendScenarioAssistantMessage(g,oe);W(ve.session)}catch(ve){b(le=>le&&{...le,messages:le.messages.filter(Ae=>Ae.id!==re)}),S(le=>le.trim()?le:oe),Pe({title:"Scenario Assistant error",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{N(!1)}},V=U=>{S(U),requestAnimationFrame(()=>T.current?.focus())};m.useEffect(()=>{if(!e||!g||!j||!M||C)return;const U=String(f??"").trim();U&&O.current!==U&&(O.current=U,K(U))},[e,g,j,M,C,f]),m.useEffect(()=>{if(!(!e||!g||!j))return p.subscribeScenarioAssistantSessionEvents(g,U=>{W(U.payload.session)})},[e,g,p,W]);const D=async U=>{if(g){N(!0);try{const oe=await p.approveScenarioAssistantToolCall(g,U);W(oe.session)}catch(oe){Pe({title:"Tool call failed",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}finally{N(!1)}}},J=async U=>{if(g){N(!0);try{const oe=await p.denyScenarioAssistantToolCall(g,U);W(oe.session)}catch(oe){Pe({title:"Could not deny tool call",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}finally{N(!1)}}},H=async()=>{if(g){N(!0);try{const U=await p.approveAllScenarioAssistantToolCalls(g);W(U.session)}catch(U){Pe({title:"Could not approve all tool calls",description:U instanceof Error?U.message:String(U),variant:"destructive"})}finally{N(!1)}}},I=(U,oe,re)=>{if(!oe)return;if(re==="prompt"&&oe.prompt&&h({prompt:oe.prompt.replacement}),re==="evalRules"&&oe.evalRules&&h({evalRules:oe.evalRules.replacement}),re==="extractRules"&&oe.extractRules&&h({extractRules:oe.extractRules.replacement}),re==="snapshotEval"&&oe.snapshotEval&&h({snapshotEval:{enabled:oe.snapshotEval.patch.enabled,baselineSnapshotId:oe.snapshotEval.patch.baselineSnapshotId}}),U){const ve=`${U}:${re}`;A(le=>new Set([...le,ve]))}Pe({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[re]}`})},te=()=>{const U=document.activeElement;U instanceof HTMLElement&&U.blur()},de=U=>{U||(te(),z(!1),q.current=!1),t(U)},fe=()=>{te(),q.current=!0,z(!0),t(!1)},me=()=>{te(),q.current=!1,z(!1),g&&R(g)};return s.jsxs(s.Fragment,{children:[!e&&g&&s.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium",children:"Scenario Assistant (session active)"}),s.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Resume conversation for ",s.jsx("span",{className:"font-mono",children:a.id}),j?` · ${j.messages.length} messages`:""]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(zr,{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:me,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(_s,{className:"h-4 w-4"})})]})]}),s.jsx(Bme,{open:e,onOpenChange:de,children:s.jsxs(Yz,{className:"max-w-6xl h-[85vh] flex flex-col",children:[g&&s.jsxs("button",{type:"button",className:"absolute right-12 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:fe,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(O7,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(Xz,{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(Jz,{className:"flex items-center gap-2",children:[s.jsx(zr,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(Qz,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),M?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($e,{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(Ja,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(JC,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((U,oe)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:U},`${U}-${oe}`)),j?.messages.map(U=>s.jsxs(m.Fragment,{children:[(()=>{const oe=U.pendingToolCallIds??(U.pendingToolCallId?[U.pendingToolCallId]:[]),re=oe.map(be=>(j?.pendingToolCalls??[]).find(We=>We.id===be)).filter(be=>!!be),ne=oe.map(be=>j.pendingToolCalls.find(We=>We.id===be)??j.pendingToolCalls.find(We=>We.id===be)).filter(Boolean);if(!(U.role==="assistant"&&oe.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(sve,{message:U})});const le=re.length,Ae=ne.length-le;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(Pr,{className:"h-3 w-3"})}),s.jsxs("div",{className:"w-full max-w-[92%] space-y-2",children:[ne.length>1&&le>0&&s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-amber-200 bg-amber-50/50 px-3 py-1.5",children:[s.jsxs("span",{className:"text-xs text-amber-900",children:[Ae," of ",ne.length," tool calls resolved"]}),s.jsxs(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:le===0,onClick:()=>{H()},children:["Approve All (",le,")"]})]}),ne.map((be,We)=>s.jsx(K1,{call:be,loading:C,description:We===0?U.text:void 0,onApprove:B=>{D(B)},onDeny:B=>{J(B)}},be.id))]})]})})(),U.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(zr,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),U.suggestions.prompt&&s.jsx(Sh,{title:"Prompt",rationale:U.suggestions.prompt.rationale,preview:U.suggestions.prompt.replacement,applied:E.has(`${U.id}:prompt`),onApply:()=>I(U.id,U.suggestions,"prompt")}),U.suggestions.evalRules&&s.jsx(Sh,{title:"Checks",rationale:U.suggestions.evalRules.rationale,preview:JSON.stringify(U.suggestions.evalRules.replacement,null,2),applied:E.has(`${U.id}:evalRules`),onApply:()=>I(U.id,U.suggestions,"evalRules")}),U.suggestions.extractRules&&s.jsx(Sh,{title:"Value Capture Rules",rationale:U.suggestions.extractRules.rationale,preview:JSON.stringify(U.suggestions.extractRules.replacement,null,2),applied:E.has(`${U.id}:extractRules`),onApply:()=>I(U.id,U.suggestions,"extractRules")}),U.suggestions.snapshotEval&&s.jsx(Sh,{title:"Snapshot Settings",rationale:U.suggestions.snapshotEval.rationale,preview:JSON.stringify(U.suggestions.snapshotEval.patch,null,2),applied:E.has(`${U.id}:snapshotEval`),onApply:()=>I(U.id,U.suggestions,"snapshotEval")}),(()=>{const oe=U.suggestions?.notes,re=Array.isArray(oe)?oe:typeof oe=="string"?[oe]:[];return re.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:re.map((ne,ve)=>s.jsx("li",{children:ne},`${U.id}-note-${ve}`))})]})})()]})]},U.id)),(j?.pendingToolCalls??[]).filter(U=>!(j?.messages??[]).some(oe=>oe.pendingToolCallId===U.id||oe.pendingToolCallIds?.includes(U.id))).map(U=>s.jsx(K1,{call:U,loading:C,onApprove:oe=>{D(oe)},onDeny:oe=>{J(oe)}},U.id)),!j&&C&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&C&&s.jsx(Hz,{}),s.jsx("div",{ref:k})]})}),s.jsx(Kz,{input:y,onInputChange:S,onSend:()=>{K(y)},inputPlaceholder:"Get assistance with creating or refining this scenario ...",snippets:rve,snippetsLabel:"Scenario Assistant Snippets",onSnippetSelect:V,loading:C,disabled:!g,inputRef:T,snippetContentClassName:"w-[320px]"})]}):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 Sh({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(Ho,{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 sve({message:e}){const t=async a=>{try{await navigator.clipboard.writeText(a),Pe({title:"Copied"})}catch(o){Pe({title:"Could not copy",description:o instanceof Error?o.message:String(o),variant:"destructive"})}},n=e.role==="user"||e.role==="assistant",r=e.role==="user";return s.jsx(Vz,{message:e,assistantLabel:e.role==="assistant"?"Assistant":void 0,renderActions:n?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(Cs,{className:"h-3.5 w-3.5"})}):void 0})}function ra(e){return typeof e=="number"?e.toLocaleString():"n/a"}function G1(e,t){const n=t?.nonPositiveLabel??"0s";if(!Number.isFinite(e)||e<=0)return n;const r=Math.floor(e),a=Math.floor(r/3600),o=Math.floor(r%3600/60),i=r%60;return a>0?`${a}h ${o}m ${i}s`:o>0?`${o}m ${i}s`:`${i}s`}function ove({run:e,fallbackUserPrompt:t}){const[n,r]=m.useState(!0),[a,o]=m.useState(!1);return s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ya,{open:n,onOpenChange:r,children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(_a,{asChild:!0,children:s.jsx("button",{type:"button",className:"mb-2 flex w-full items-center justify-between gap-2 text-left",children:s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(Kt,{className:`h-3.5 w-3.5 transition-transform ${n?"rotate-180":""}`}),s.jsx(Pr,{className:"h-3.5 w-3.5"}),"Final answer"]})})}),s.jsx(Xa,{children:s.jsx(Y1,{text:e.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Ya,{open:a,onOpenChange:o,children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[s.jsx(_a,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(Kt,{className:`h-3.5 w-3.5 transition-transform ${a?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),s.jsxs(Ue,{variant:"outline",className:"h-5 text-[10px]",children:[e.toolCalls.length," tool calls"]})]}),s.jsx(Xa,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:e.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):e.conversation.map(i=>s.jsx(ive,{item:i,fallbackUserPrompt:t},i.id))})})]})})]})}function ive({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=UM(e,"input");return s.jsx(WM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=UM(e,"output"),f=e.ok?s.jsx(Ho,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(pc,{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`:""}${d}`,text:e.text,icon:f})}const n=e.kind==="user_prompt",r=qM(e.text,e.kind),a=t?qM(t,"user_prompt"):"",o=n&&!r&&a?a:r,i=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?jc:Pr;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:i}),n?s.jsx(Y1,{text:o,maxLength:280,className:"text-xs"}):s.jsx(Y1,{text:o,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 UM(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · estimated ${ra(n)} tokens`}function qM(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 WM({variant:e,title:t,text:n,icon:r}){const[a,o]=m.useState(!1),i={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(Ya,{open:a,onOpenChange:o,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${i[e]}`,children:[s.jsx(_a,{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(Ja,{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(Xa,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function Y1({text:e,maxLength:t,className:n}){const[r,a]=m.useState(!1),o=e.length>t,i=r||!o?e:`${e.slice(0,t)}...`;return s.jsxs("div",{children:[s.jsx(Ta,{text:i,className:n}),o&&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"})]})}const lve="mcplab.feature.";function Cg(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${lve}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const cve=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function X1({scenarios:e,scenarioOrigins:t,agents:n,servers:r,configId:a,configPath:o,defaultAssistantAgentName:i,assistantInitialPromptByScenarioId:c,assistantAutoOpenNonceByScenarioId:d,snapshotEval:f,onChange:h,readOnly:p,allowAdd:g=!p,allowStructureEdits:x=!p}){const j=(C,N)=>{const E=e.map((A,k)=>k===C?{...A,...N}:A);h(E)},b=C=>h(e.filter((N,E)=>E!==C)),y=()=>h([...e,cve()]),S=(C,N)=>{const E=C+N;if(E<0||E>=e.length)return;const A=[...e],[k]=A.splice(C,1);A.splice(E,0,k),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"}),g&&x&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",onClick:y,children:[s.jsx(ao,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((C,N)=>s.jsx(uve,{scenario:C,scenarioOrigin:t?.[N],index:N,total:e.length,agents:n,servers:r,configId:a,configPath:o,defaultAssistantAgentName:i,assistantInitialPrompt:c?.[C.id],assistantAutoOpenNonce:d?.[C.id],snapshotEval:f,onUpdate:E=>j(N,E),onMoveUp:()=>S(N,-1),onMoveDown:()=>S(N,1),onRemove:()=>b(N),readOnly:p,allowStructureEdits:x},C.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 uve({scenario:e,scenarioOrigin:t,index:n,total:r,agents:a,servers:o,configId:i,configPath:c,defaultAssistantAgentName:d,assistantInitialPrompt:f,assistantAutoOpenNonce:h,snapshotEval:p,onUpdate:g,onMoveUp:x,onMoveDown:j,onRemove:b,readOnly:y,allowStructureEdits:S}){const{source:C}=$n(),N=Cg("snapshots",!1),[E,A]=m.useState("required_tool"),[k,T]=m.useState(""),[O,L]=m.useState(""),[z,q]=m.useState(""),[F,G]=m.useState(""),[W,R]=m.useState(null),[M,K]=m.useState(!1),[V,D]=m.useState(null),[J,H]=m.useState(""),[I,te]=m.useState(""),[de,fe]=m.useState(!1),[me,U]=m.useState(d||a[0]?.id||""),[oe,re]=m.useState(!1),[ne,ve]=m.useState(null),[le,Ae]=m.useState(""),[be,We]=m.useState(null),[B,ie]=m.useState(!y),he=()=>{if(E==="response_jsonpath"||E==="response_jsonpath_exists"||E==="response_jsonpath_not_exists"){const we=O.trim();if(!we)return;if(E==="response_jsonpath"){const _t=z.trim();let $t;_t.length>0&&(_t==="true"?$t=!0:_t==="false"?$t=!1:Number.isNaN(Number(_t))?$t=_t:$t=Number(_t)),g({evalRules:[...e.evalRules,{type:E,path:we,...$t!==void 0?{equals:$t}:{}}]})}else g({evalRules:[...e.evalRules,{type:E,path:we}]});L(""),q("");return}k.trim()&&(g({evalRules:[...e.evalRules,{type:E,value:k.trim()}]}),T(""),G(""))},Te=we=>{g({evalRules:e.evalRules.filter((_t,$t)=>$t!==we)})},Ye=()=>{!J.trim()||!I.trim()||(g({extractRules:[...e.extractRules,{name:J.trim(),pattern:I.trim()}]}),H(""),te(""))},ut=we=>{g({extractRules:e.extractRules.filter((_t,$t)=>$t!==we)})},dt=we=>{const _t=e.serverIds.includes(we)?e.serverIds.filter($t=>$t!==we):[...e.serverIds,we];g({serverIds:_t})},ht={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains",response_starts_with:"Starts With",response_ends_with:"Ends With",response_equals:"Equals",response_regex:"Regex",response_jsonpath:"JSONPath",response_jsonpath_exists:"JSONPath Exists",response_jsonpath_not_exists:"JSONPath Not Exists"},jt={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",response_starts_with:"border-cyan-300/60 bg-cyan-500/10 text-cyan-700",response_ends_with:"border-indigo-300/60 bg-indigo-500/10 text-indigo-700",response_equals:"border-lime-300/60 bg-lime-500/10 text-lime-700",response_regex:"border-fuchsia-300/60 bg-fuchsia-500/10 text-fuchsia-700",response_jsonpath:"border-emerald-300/60 bg-emerald-500/10 text-emerald-700",response_jsonpath_exists:"border-green-300/60 bg-green-500/10 text-green-700",response_jsonpath_not_exists:"border-orange-300/60 bg-orange-500/10 text-orange-700"},It=E==="required_tool"||E==="forbidden_tool",Dt=E==="response_jsonpath"||E==="response_jsonpath_exists"||E==="response_jsonpath_not_exists",qt=e.serverIds.filter(we=>o.some(_t=>_t.id===we)),ee=a.map(we=>we.id).filter(Boolean),Ee=qt.length>0,Ne=e.snapshotEval?.baselineSnapshotId!==void 0,[Ge,_e]=m.useState(""),[Le,Lt]=m.useState(0);m.useEffect(()=>{const we=(f??"").trim();we&&Ge!==we&&(fe(!0),_e(we))},[f,Ge]),m.useEffect(()=>{h&&h!==Le&&(fe(!0),Lt(h))},[h,Le]),m.useEffect(()=>{R(null),D(null),G("")},[e.serverIds.join("|")]),m.useEffect(()=>{G(""),L(""),q("")},[E]),m.useEffect(()=>{me&&ee.includes(me)||U(d||a[0]?.id||"")},[me,d,a,ee]);const cn=async()=>{if(me){re(!0),ve(null);try{const we=e.serverIds.filter($t=>o.find(tn=>tn.id===$t)?.authType==="oauth2");await nl({serverNames:we,source:C});const _t=await C.runScenarioPreview({selectedAgentName:me,scenario:{id:e.id,name:e.name,prompt:e.prompt,serverNames:e.serverIds,evalRules:e.evalRules,extractRules:e.extractRules}});We(_t)}catch(we){ve(we instanceof Error?we.message:String(we))}finally{re(!1)}}},Sn=()=>{if(!be)return;const we=VM(e.evalRules,be.run.failureReasons),_t=we.length?we.map(Gt=>`${Gt.status.toUpperCase()} - ${dve(Gt.rule)}${Gt.failureReason?` (${Gt.failureReason})`:""}`).join(`
|
|
126
|
-
`):"No checks configured.",$t=Object.keys(be.run.extractedValues).length>0?Object.entries(be.run.extractedValues).map(([Gt,hr])=>`${Gt}: ${String(hr)}`).join(`
|
|
127
|
-
`):"No extracted values.",Wt=be.run.toolCalls.length>0?be.run.toolCalls.map((Gt,hr)=>`${hr+1}. ${Gt.name} (${Gt.duration}ms)`).join(`
|
|
128
|
-
`):"No tool calls.",tn=[`I ran a prompt preview for scenario '${e.id}' and want you to suggest concrete updates.`,`Run ID: ${be.runId}`,`Agent: ${be.agentName}`,`Outcome: ${be.run.passed?"passed":"failed"}`,`Duration: ${be.run.duration}ms`,"","Current check outcomes:",_t,"","Tool sequence:",Wt,"","Extracted values:",$t,"","Final answer:",be.run.finalAnswer||"(empty)","","Please propose concrete updates to the Prompt, Checks, and/or Value Capture Rules based on this preview."].join(`
|
|
129
|
-
`);Ae(tn),fe(!0)},Or=async()=>{if(!(!Ee||y)){K(!0),D(null);try{const we=qt.filter($t=>o.find(tn=>tn.id===$t)?.authType==="oauth2");await nl({serverNames:we,source:C});const _t=new Set;for(const $t of qt){const Wt=await C.discoverToolsForAnalysis({serverNames:[$t]});for(const tn of Wt.servers)for(const Gt of tn.tools)_t.add(Gt.name)}R(Array.from(_t).sort(($t,Wt)=>$t.localeCompare(Wt)))}catch(we){D(we instanceof Error?we.message:"Failed to load tools")}finally{K(!1)}}};return s.jsx(Ya,{open:B,onOpenChange:ie,children:s.jsxs(Be,{className:y?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(St,{className:y?"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:[!y&&s.jsx(_a,{asChild:!0,children:s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(Kt,{className:`h-3.5 w-3.5 transition-transform ${B?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(Nt,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),y?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(Ue,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),s.jsx(_a,{asChild:!0,children:s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":B?"Collapse scenario details":"Expand scenario details",children:s.jsx(Kt,{className:`h-4 w-4 transition-transform ${B?"rotate-180":""}`})})})]}):S&&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:()=>fe(!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(zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]}),s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:x,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(bs,{className:"h-3.5 w-3.5"})}),s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:n===r-1,"aria-label":"Move scenario down",children:s.jsx(Kt,{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(Oa,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(Xa,{children:s.jsxs(ze,{className:"space-y-3",children:[s.jsx(ave,{open:de,onOpenChange:we=>{fe(we),we||Ae("")},configId:i,configPath:c,scenario:e,agents:a,servers:o,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:le||f,onApplyPatch:we=>g({...we.prompt!==void 0?{prompt:we.prompt}:{},...we.evalRules!==void 0?{evalRules:we.evalRules}:{},...we.extractRules!==void 0?{extractRules:we.extractRules}:{},...we.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...we.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Name"}),s.jsx(pt,{value:e.name,onChange:we=>g({name:we.target.value}),disabled:y,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[o.map(we=>s.jsx(Ue,{variant:e.serverIds.includes(we.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(we.id)?"":"opacity-50"}`,onClick:()=>!y&&dt(we.id),children:we.name||we.id},we.id)),o.length===0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),s.jsxs(Be,{className:"border bg-card",children:[s.jsxs(St,{className:"pb-2",children:[s.jsx(Nt,{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(ze,{className:"pt-0",children:s.jsx(ks,{value:e.prompt,onChange:we=>g({prompt:we.target.value}),disabled:y,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),!y&&s.jsxs(Be,{className:"border bg-muted/20",children:[s.jsxs(St,{className:"pb-2",children:[s.jsx(Nt,{className:"text-sm",children:"Run Prompt Preview"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Execute the current draft prompt once and inspect final answer, conversation trace, tool calls, and check outcomes."})]}),s.jsxs(ze,{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Agent"}),s.jsxs(bn,{value:me,onValueChange:U,children:[s.jsx(hn,{className:"h-8 text-xs",children:s.jsx(wn,{placeholder:"Select agent"})}),s.jsx(mn,{children:a.map(we=>s.jsx(Qe,{value:we.id,children:we.name||we.id},we.id))})]})]}),s.jsx("div",{className:"flex items-end",children:s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>{cn()},disabled:oe||!me||!e.prompt.trim()||e.serverIds.length===0,children:oe?s.jsxs(s.Fragment,{children:[s.jsx(wr,{className:"h-3.5 w-3.5 animate-spin"}),"Running..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Zs,{className:"h-3.5 w-3.5"}),"Run Prompt"]})})})]}),!e.prompt.trim()&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Add a prompt to run preview."}),e.serverIds.length===0&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server to run preview."}),ne&&s.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:ne}),be&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsx(Ue,{variant:be.run.passed?"default":"destructive",children:be.run.passed?"Passed":"Failed"}),s.jsxs(Ue,{variant:"outline",children:[be.run.duration,"ms"]}),s.jsxs(Ue,{variant:"outline",children:[be.run.toolCalls.length," tool calls"]}),s.jsx(Ue,{variant:"outline",className:"font-mono",children:be.agentName}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-6 gap-1.5 px-2 text-[11px]",onClick:Sn,children:[s.jsx(zr,{className:"h-3 w-3"}),"Send to Assistant"]})]}),e.evalRules.length===0?s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx("p",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Check results"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"No checks configured for this scenario."})]}):(()=>{const we=VM(e.evalRules,be.run.failureReasons),_t=we.filter(Wt=>Wt.status==="passed"),$t=we.filter(Wt=>Wt.status==="failed");return s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Ue,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[_t.length," passed"]}),s.jsxs(Ue,{variant:"outline",className:`h-5 text-[10px] ${$t.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[$t.length," failed"]})]}),s.jsx("div",{className:"space-y-1",children:we.map((Wt,tn)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Wt.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:[Wt.status==="failed"?s.jsx(pc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(Ho,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:fve(Wt.rule)})]}),Wt.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:pve(Wt.failureReason)})]}),s.jsx(Ue,{variant:"outline",className:`shrink-0 text-[10px] ${Wt.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Wt.status})]},`${e.id}-preview-check-${tn}`))})]})})(),be.run.failureReasons.length>0&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2",children:[s.jsx("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:"Check failures"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4 text-xs text-destructive",children:be.run.failureReasons.map((we,_t)=>s.jsx("li",{children:we},`${be.runId}-failure-${_t}`))})]}),Object.keys(be.run.extractedValues).length>0&&s.jsxs("div",{className:"rounded-md border bg-background p-2",children:[s.jsx("p",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Extracted values"}),s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(be.run.extractedValues).map(([we,_t])=>s.jsxs("div",{className:"rounded border bg-muted/20 px-2 py-1 text-xs",children:[s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:we}),s.jsx("div",{className:"break-all",children:String(_t)})]},we))})]}),s.jsx(ove,{run:be.run,fallbackUserPrompt:e.prompt})]})]})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs(Be,{className:"border bg-muted/20",children:[s.jsx(St,{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(Nt,{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."})]}),!y&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>fe(!0),title:"Ask for help improving checks",children:[s.jsx(zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})]})}),s.jsx(ze,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{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((we,_t)=>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 ${jt[we.type]}`,children:ht[we.type]}),s.jsx("span",{className:"font-mono break-all",children:we.path?we.equals!==void 0?`${we.path} == ${String(we.equals)}`:we.path:we.value})]})}),!y&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>Te(_t),"aria-label":`Remove check ${_t+1}`,children:s.jsx(_s,{className:"h-3.5 w-3.5"})})]},_t))}),!y&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(bn,{value:E,onValueChange:we=>A(we),children:[s.jsx(hn,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"required_tool",children:"Required Tool"}),s.jsx(Qe,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(Qe,{value:"response_contains",children:"Text contains"}),s.jsx(Qe,{value:"response_not_contains",children:"Text does not contain"}),s.jsx(Qe,{value:"response_starts_with",children:"Text starts with"}),s.jsx(Qe,{value:"response_ends_with",children:"Text ends with"}),s.jsx(Qe,{value:"response_equals",children:"Text equals"}),s.jsx(Qe,{value:"response_regex",children:"Text matches regex"}),s.jsx(Qe,{value:"response_jsonpath",children:"JSONPath (optional equals)"}),s.jsx(Qe,{value:"response_jsonpath_exists",children:"JSONPath exists"}),s.jsx(Qe,{value:"response_jsonpath_not_exists",children:"JSONPath not exists"})]})]}),Dt?s.jsxs(s.Fragment,{children:[s.jsx(pt,{value:O,onChange:we=>L(we.target.value),placeholder:"JSONPath (e.g. $.status)",className:"h-8 text-xs font-mono",onKeyDown:we=>we.key==="Enter"&&(we.preventDefault(),he())}),E==="response_jsonpath"&&s.jsx(pt,{value:z,onChange:we=>q(we.target.value),placeholder:"Equals (optional)",className:"h-8 w-[12rem] text-xs font-mono",onKeyDown:we=>we.key==="Enter"&&(we.preventDefault(),he())})]}):s.jsx(pt,{value:k,onChange:we=>T(we.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:we=>we.key==="Enter"&&(we.preventDefault(),he())}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:he,children:"Add"})]}),It&&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($e,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(bn,{value:F,onValueChange:we=>{G(we),T(we)},disabled:M||!W||W.length===0,children:[s.jsx(hn,{className:"h-8 text-xs",children:s.jsx(wn,{placeholder:M?"Loading tools...":W&&W.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(mn,{children:(W??[]).map(we=>s.jsx(Qe,{value:we,children:we},we))})]})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Or,disabled:!Ee||M,children:M?"Loading...":W?"Refresh tools":"Load tools"})]}),!Ee&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),V&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",V]})]})]})]})})]}),s.jsxs(Be,{className:"border bg-muted/10",children:[s.jsx(St,{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(Nt,{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."})]}),!y&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>fe(!0),title:"Ask for help improving value capture rules",children:[s.jsx(zr,{className:"h-3.5 w-3.5 text-amber-500"}),"Ask Assistant"]})]})}),s.jsx(ze,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{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((we,_t)=>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:we.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:we.pattern})]})}),!y&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>ut(_t),"aria-label":`Remove value capture rule ${_t+1}`,children:s.jsx(_s,{className:"h-3.5 w-3.5"})})]},_t))}),!y&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(pt,{value:J,onChange:we=>H(we.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(pt,{value:I,onChange:we=>te(we.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:we=>we.key==="Enter"&&(we.preventDefault(),Ye())}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Ye,children:"Add"})]})]})})]})]}),N&&s.jsxs(Be,{className:"border bg-amber-50/40",children:[s.jsxs(St,{className:"pb-2",children:[s.jsx(Nt,{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(ze,{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(Gm,{checked:e.snapshotEval?.enabled!==!1,disabled:y,onCheckedChange:we=>g({snapshotEval:{...e.snapshotEval??{},enabled:we}})})]}),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(Gm,{checked:!Ne,disabled:y,onCheckedChange:we=>{if(we){g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ne&&s.jsx(pt,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:we=>g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:we.target.value}}),disabled:y,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"})]})]})]})]})})]})})}function VM(e,t){return e.map(n=>{const r=hve(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function dve(e){return e.path?e.equals!==void 0?`${e.type}: ${e.path} == ${String(e.equals)}`:`${e.type}: ${e.path}`:`${e.type}: ${e.value??""}`}function fve(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="response_contains"?`Text contains · ${e.value}`:e.type==="response_not_contains"?`Text does not contain · ${e.value}`:e.type==="response_starts_with"?`Text starts with · ${e.value}`:e.type==="response_ends_with"?`Text ends with · ${e.value}`:e.type==="response_equals"?`Text equals · ${e.value}`:e.type==="response_regex"?`Text matches regex · ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals · ${e.path} == ${String(e.equals)}`:`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not exists · ${e.path}`:`${e.type} · ${e.value}`}function pve(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function hve(e,t){if(e.type==="response_jsonpath_exists"){const r=String(e.path??"").trim();return r?t.find(a=>a.startsWith(`JSONPath assertion failed: ${r}`)||a.startsWith(`JSONPath assertion failed: invalid JSON for path ${r}`)):void 0}const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:e.type==="response_contains"?`Contains assertion failed: ${e.value}`:e.type==="response_not_contains"?`Not-contains assertion failed: ${e.value}`:e.type==="response_starts_with"?`Starts-with assertion failed: ${e.value}`:e.type==="response_ends_with"?`Ends-with assertion failed: ${e.value}`:e.type==="response_equals"?`Equals assertion failed: ${e.value}`:e.type==="response_regex"?`Regex assertion failed: ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals assertion failed: ${e.path}`:`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not-exists assertion failed: ${e.path}`:"";if(n)return t.find(r=>r.startsWith(n))}function p8(e){const t=e.name?.trim()||e.id||"Server",n=e.authValue?.trim()||"",r=e.oauthTokenUrl?.trim()||"";return e.authType==="bearer"&&n.length===0?`${t}: bearer token is required.`:e.authType==="api-key"&&r.length===0&&n.length===0?`${t}: API key value is required.`:null}const mve=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),HM=()=>{const{id:e,tab:t}=hl(),n=Ia(),[r,a]=ni(),{getConfig:o,addConfig:i,updateConfig:c,loading:d}=Rf(),{source:f}=$n(),h=Cg("snapshots",!1),{servers:p,agents:g,scenarios:x}=ns(),j=e==="new",b=!j&&!!e,y=b?o(e):void 0,[S,C]=m.useState(j),[N,E]=m.useState(()=>y?structuredClone(y):mve()),[A,k]=m.useState([]),[T,O]=m.useState(""),[L,z]=m.useState(""),[q,F]=m.useState(""),[G,W]=m.useState(null),[R,M]=m.useState(!1),[K,V]=m.useState(!1),[D,J]=m.useState(""),[H,I]=m.useState(""),[te,de]=m.useState({}),[fe,me]=m.useState({}),[U,oe]=m.useState({}),re=m.useMemo(()=>{const X=t||r.get("tab");return X==="agents"||X==="scenarios"?X:"scenarios"},[t,r]);m.useEffect(()=>{y&&!S&&E(structuredClone(y))},[y,S]),m.useEffect(()=>{let X=!0;return f.listSnapshots().then(xe=>{X&&k(xe)}).catch(()=>{X&&k([])}),()=>{X=!1}},[f]),m.useEffect(()=>{if(!T.trim()){W(null);return}let X=!0;return f.getResult(T.trim()).then(xe=>{if(!X)return;if(!xe){W(!1);return}const Ve=xe.overallPassRate===1&&xe.scenarios.every(ct=>ct.runs.every(Ft=>Ft.passed));W(Ve)}).catch(()=>{X&&W(!1)}),()=>{X=!1}},[T,f]);const ne=X=>E(xe=>({...xe,...X})),ve=m.useMemo(()=>N.serverEntries&&N.serverEntries.length>0?N.serverEntries:(N.servers??[]).map(X=>({kind:"inline",server:X})),[N.serverEntries,N.servers]),le=m.useMemo(()=>N.scenarioEntries&&N.scenarioEntries.length>0?N.scenarioEntries:N.scenarios.map(X=>({kind:"inline",scenario:X})),[N.scenarioEntries,N.scenarios]),Ae=X=>{ne({scenarioEntries:X,scenarios:X.filter(xe=>xe.kind==="inline").map(xe=>xe.scenario)})},be=m.useMemo(()=>N.agentEntries&&N.agentEntries.length>0?N.agentEntries:N.agents.map(X=>({kind:"inline",agent:X})),[N.agentEntries,N.agents]),We=X=>{ne({agentEntries:X,agents:X.filter(xe=>xe.kind==="inline").map(xe=>xe.agent)})},B=!S,ie=N.runDefaults?.selectedAgentNames??[],he=async X=>{if(!N.id||B===!1){ne({snapshotEval:{enabled:X.enabled,mode:X.mode,baselineSnapshotId:X.baselineSnapshotId,baselineSourceRunId:X.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}M(!0);try{const xe=await f.updateSnapshotPolicy(N.id,X);E(xe),Pe({title:"Snapshot policy updated"})}catch(xe){Pe({title:"Could not update snapshot policy",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{M(!1)}},Te=async()=>{if(!(!N.id||!T.trim())){V(!0);try{const X=await f.generateSnapshotEvalBaseline(T.trim(),N.id,L.trim()||void 0);E(X.config),F(X.snapshot.id),k(xe=>[X.snapshot,...xe.filter(Ve=>Ve.id!==X.snapshot.id)]),Pe({title:"Snapshot baseline generated",description:`${X.snapshot.name} (${X.snapshot.id})`})}catch(X){Pe({title:"Could not generate baseline",description:X instanceof Error?X.message:String(X),variant:"destructive"})}finally{V(!1)}}},Ye=async()=>{if(!N.name.trim()){Pe({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const X=ve.map(He=>He.kind==="referenced"?{kind:"referenced",ref:p.find(Yt=>Yt.id===He.ref)?.id||He.ref}:He),xe=be.map(He=>He.kind==="referenced"?{kind:"referenced",ref:g.find(Yt=>Yt.id===He.ref)?.id||He.ref}:He),Ve=le.map(He=>He.kind==="referenced"?{kind:"referenced",ref:x.find(Yt=>Yt.id===He.ref)?.id||He.ref}:He),ct=X.filter(He=>He.kind==="inline").map(He=>({server:He.server,error:p8(He.server)})).find(He=>!!He.error);if(ct?.error){Pe({title:"Validation Error",description:ct.error,variant:"destructive"});return}if(Ve.filter(He=>He.kind==="inline").some(He=>!He.scenario.name?.trim())){Pe({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Ht=new Set(xe.map(He=>He.kind==="inline"?He.agent.id:He.ref)),Bt=(N.runDefaults?.selectedAgentNames??[]).filter(He=>Ht.has(He)),Bn={...N,serverEntries:X,servers:X.filter(He=>He.kind==="inline").map(He=>He.server),agentEntries:xe,agents:xe.filter(He=>He.kind==="inline").map(He=>He.agent),scenarioEntries:Ve,scenarios:Ve.filter(He=>He.kind==="inline").map(He=>He.scenario),runDefaults:Bt.length>0?{...N.runDefaults??{},selectedAgentNames:Bt}:void 0,updatedAt:new Date().toISOString()};if(j){const He=await i(Bn);E(He);const rn=He.configName?.trim()||He.name;Pe({title:"MCP Evaluation Created",description:`"${rn}" has been saved.`}),n(`/mcp-evaluations/${He.id}`)}else{const He=await c(N.id,Bn);E(He);const rn=He.configName?.trim()||He.name;Pe({title:"MCP Evaluation Updated",description:`"${rn}" has been updated.`}),C(!1),He.id!==e&&n(`/mcp-evaluations/${He.id}`,{replace:!0})}},ut=N.configName?.trim()||N.name,dt=j?"New MCP Evaluation":S?`Editing: ${ut}`:ut,ht=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(N.id||e||"")}`,jt=!!y?.loadError,It=m.useMemo(()=>g.map(X=>({id:X.id,ref:X.id,label:X.name||X.id,model:X.model})).sort((X,xe)=>X.label.localeCompare(xe.label)),[g]),Dt=(X,xe)=>{const Ve=xe?Array.from(new Set([...ie,X])):ie.filter(ct=>ct!==X);ne({runDefaults:{...N.runDefaults??{},selectedAgentNames:Ve}})},qt=X=>{const xe=new Set([...be.filter(Ht=>Ht.kind==="inline").map(Ht=>Ht.agent.name||Ht.agent.id),...g.map(Ht=>Ht.name||Ht.id)]),Ve=`${X}-custom`;let ct=Ve,Ft=2;for(;xe.has(ct);)ct=`${Ve}-${Ft}`,Ft+=1;return ct},ee=()=>{const xe={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};We([{kind:"inline",agent:xe},...be]),de(Ve=>({...Ve,[xe.id]:!0}))},Ee=()=>{const X=g.find(ct=>ct.id===H);if(!X)return;const xe=X.id;new Set(be.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(xe)||We([...be,{kind:"referenced",ref:xe}]),I("")},Ne=()=>{const X=new Set(be.filter(Ve=>Ve.kind==="referenced").map(Ve=>Ve.ref)),xe=g.filter(Ve=>!X.has(Ve.id)).map(Ve=>({kind:"referenced",ref:Ve.id}));xe.length>0&&We([...be,...xe])},Ge=()=>{const X=g.find(Ft=>Ft.id===H);if(!X)return;const xe=X.name||X.id,Ve=qt(xe),ct={...structuredClone(X),id:`agt-${Date.now()}`,name:Ve};We([...be,{kind:"inline",agent:ct}]),de(Ft=>({...Ft,[ct.id]:!0})),I(""),Pe({title:"Imported agent as inline",description:Ve})},_e=X=>{const xe=be[X];if(!xe)return;const Ve=xe.kind==="inline"?xe.agent.id:xe.ref,ct=ie.filter(Ft=>Ft!==Ve);ne({runDefaults:{...N.runDefaults??{},selectedAgentNames:ct}}),xe.kind==="inline"&&de(Ft=>{const Ht={...Ft};return delete Ht[xe.agent.id],Ht}),We(be.filter((Ft,Ht)=>Ht!==X))},Le=(X,xe)=>{const Ve=X+xe;if(Ve<0||Ve>=be.length)return;const ct=[...be],[Ft]=ct.splice(X,1);ct.splice(Ve,0,Ft),We(ct)},Lt=X=>{const xe=be[X];if(!xe||xe.kind!=="referenced")return;const Ve=tn(xe.ref);if(!Ve){Pe({title:"Referenced agent not found",variant:"destructive"});return}const ct=Ve.name||Ve.id,Ft=qt(ct),Ht={...structuredClone(Ve),id:`agt-${Date.now()}`,name:Ft},Bt=[...be];if(Bt[X]={kind:"inline",agent:Ht},We(Bt),ie.includes(xe.ref)){const Bn=ie.map(He=>He===xe.ref?Ht.id:He);ne({runDefaults:{...N.runDefaults??{},selectedAgentNames:Array.from(new Set(Bn))}})}de(Bn=>({...Bn,[Ht.id]:!0})),Pe({title:"Referenced agent converted to inline",description:Ft})},cn=()=>{const X=x.find(Ve=>Ve.id===D);if(!X)return;const xe={...structuredClone(X),id:`scn-${Date.now()}`,serverIds:[...X.serverIds]};Ae([...le,{kind:"inline",scenario:xe}]),oe(Ve=>({...Ve,[xe.id]:!0})),J("")},Sn=()=>{const xe={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};Ae([{kind:"inline",scenario:xe},...le]),oe(Ve=>({...Ve,[xe.id]:!0}))},Or=()=>{const X=x.find(ct=>ct.id===D);if(!X)return;const xe=X.id;new Set(le.filter(ct=>ct.kind==="referenced").map(ct=>ct.ref)).has(xe)||Ae([...le,{kind:"referenced",ref:xe}]),J("")},we=X=>{const xe=le[X];xe?.kind==="inline"&&oe(Ve=>{const ct={...Ve};return delete ct[xe.scenario.id],ct}),Ae(le.filter((Ve,ct)=>ct!==X))},_t=(X,xe)=>{const Ve=X+xe;if(Ve<0||Ve>=le.length)return;const ct=[...le],[Ft]=ct.splice(X,1);ct.splice(Ve,0,Ft),Ae(ct)},$t=X=>{const xe=le[X];if(!xe||xe.kind!=="referenced")return;const Ve=Gt(xe.ref);if(!Ve){Pe({title:"Referenced scenario not found",variant:"destructive"});return}const ct=new Set(le.filter(Yt=>Yt.kind==="inline").map(Yt=>Yt.scenario.name?.trim().toLowerCase()).filter(Boolean)),Ft=`${(Ve.name||Ve.id).trim()}-custom`;let Ht=Ft,Bt=2;for(;ct.has(Ht.toLowerCase());)Ht=`${Ft}-${Bt}`,Bt+=1;const Bn=Date.now(),He={...structuredClone(Ve),id:`scn-${Bn}`,name:Ht,serverIds:[...Ve.serverIds]},rn=[...le];rn[X]={kind:"inline",scenario:He},Ae(rn),oe(Yt=>({...Yt,[He.id]:!0})),Pe({title:"Referenced scenario converted to inline",description:Ht})},Wt=X=>p.find(xe=>xe.id===X),tn=X=>g.find(xe=>xe.id===X),Gt=X=>x.find(xe=>xe.id===X),hr=ve.filter(X=>X.kind==="referenced").map(X=>X.ref),ft=hr.map(Wt).filter(X=>!!X),Pt=be.filter(X=>X.kind==="referenced").map(X=>X.ref),Rt=Pt.map(tn).filter(X=>!!X);be.filter(X=>X.kind==="inline");const nn=be.flatMap(X=>{if(X.kind==="referenced"){const xe=tn(X.ref);return xe?[{agent:xe,origin:"referenced",ref:X.ref}]:[]}return[{agent:X.agent,origin:"inline",ref:void 0}]}),Fn=le.filter(X=>X.kind==="referenced").map(X=>X.ref),ue=le.flatMap(X=>{if(X.kind==="referenced"){const xe=Gt(X.ref);return xe?[{scenario:xe,origin:"referenced"}]:[]}return[{scenario:X.scenario,origin:"inline"}]}),nt=Array.from(new Map([...g,...N.agents,...Rt].map(X=>[X.id,X])).values()),bt=Array.from(new Map([...p,...N.servers??[],...ft].map(X=>[X.id,X])).values()),Jt=hr.filter(X=>!Wt(X)),mt=Pt.filter(X=>!tn(X)),kn=Fn.filter(X=>!Gt(X));new Set(Jt);const cr=new Set(kn),ma=be.length,xo=le.length;return m.useEffect(()=>{if(!H)return;g.some(xe=>xe.id===H)||I("")},[g,H]),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(Ct,{to:"/mcp-evaluations",children:s.jsx(Vi,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h1",{className:"text-2xl font-bold truncate",children:dt}),s.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":y?y.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(N.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!S&&s.jsx(se,{size:"sm",onClick:()=>C(!0),children:"Edit"}),b&&!S&&y&&!jt&&s.jsx(se,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(Ct,{to:`/run?configId=${encodeURIComponent(y.id)}`,children:[s.jsx(Zs,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&jt&&s.jsxs(Ue,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(Eh,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(se,{variant:"outline",size:"sm",onClick:()=>{E(structuredClone(y)),C(!1)},children:"Cancel"}),s.jsxs(se,{size:"sm",onClick:()=>{Ye()},children:[s.jsx(I7,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),jt&&!S&&s.jsx(Be,{className:"border-destructive/40",children:s.jsxs(ze,{className:"pt-6 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Eh,{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:y?.sourcePath||y?.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:y?.loadError})]}),(Jt.length>0||mt.length>0||kn.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"}),Jt.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:Jt.join(", ")})]}),mt.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:mt.join(", ")})]}),kn.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:kn.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!jt&&(N.loadWarnings?.length??0)>0&&s.jsx(Be,{className:"border-amber-500/30",children:s.jsxs(ze,{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(Eh,{className:"h-4 w-4"}),"Migration warnings"]}),N.loadWarnings?.map((X,xe)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:X},`${X}-${xe}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Ue,{variant:re==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(Ct,{to:`${ht}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(VE,{className:"h-3 w-3"}),xo," scenario",xo!==1?"s":""]})}),s.jsx(Ue,{variant:re==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(Ct,{to:`${ht}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(Pr,{className:"h-3 w-3"}),ma," agent",ma!==1?"s":""]})})]}),s.jsx(Be,{children:s.jsx(ze,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${B||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!B&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Config ID"}),s.jsx(pt,{value:N.name,onChange:X=>ne({name:X.target.value}),disabled:B,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Name (optional)"}),s.jsx(pt,{value:N.configName||"",onChange:X=>ne({configName:X.target.value}),disabled:B,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Description"}),s.jsx(pt,{value:N.description||"",onChange:X=>ne({description:X.target.value}),disabled:B,placeholder:"Brief description..."})]})]})})}),h&&s.jsx(Be,{children:s.jsxs(ze,{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($e,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(Gm,{checked:N.snapshotEval?.enabled??!1,disabled:R,onCheckedChange:X=>{const xe=N.snapshotEval;he({enabled:X,mode:xe?.mode??"warn",baselineSnapshotId:xe?.baselineSnapshotId,baselineSourceRunId:xe?.baselineSourceRunId})}})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Drift mode"}),s.jsxs(bn,{value:N.snapshotEval?.mode??"warn",onValueChange:X=>{const xe=N.snapshotEval;he({enabled:xe?.enabled??!1,mode:X,baselineSnapshotId:xe?.baselineSnapshotId,baselineSourceRunId:xe?.baselineSourceRunId})},children:[s.jsx(hn,{className:"h-8",children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"warn",children:"Warn"}),s.jsx(Qe,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{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:N.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),N.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($e,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(pt,{value:T,onChange:X=>O(X.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),G===!1&&s.jsx("p",{className:"text-[11px] text-destructive",children:"Run is missing or not fully passing."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(pt,{value:L,onChange:X=>z(X.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Switch baseline"}),s.jsxs(bn,{value:q||N.snapshotEval?.baselineSnapshotId||"",onValueChange:X=>{F(X),he({enabled:N.snapshotEval?.enabled??!0,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:X||void 0,baselineSourceRunId:N.snapshotEval?.baselineSourceRunId})},children:[s.jsx(hn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select snapshot"})}),s.jsx(mn,{children:A.map(X=>s.jsx(Qe,{value:X.id,children:X.name},X.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{Te()},disabled:K||!T.trim()||G!==!0,children:K?"Generating...":"Generate Baseline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{he({enabled:N.snapshotEval?.enabled??!1,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:R,children:"Clear Baseline"})]})]})]})}),s.jsxs(wg,{value:re,onValueChange:X=>{if(X!=="servers"&&X!=="agents"&&X!=="scenarios")return;const xe=new URLSearchParams(r);if(xe.delete("tab"),a(xe,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${X}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${X}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(Gf,{children:[s.jsxs(Ns,{value:"scenarios",className:"gap-1.5",children:[s.jsx(VE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(Ns,{value:"agents",className:"gap-1.5",children:[s.jsx(Pr,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(jf,{value:"agents",children:[!B&&s.jsx(Be,{className:"mb-4",children:s.jsxs(ze,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(bn,{value:H,onValueChange:I,children:[s.jsx(hn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select agent from library"})}),s.jsx(mn,{children:It.map(X=>s.jsx(Qe,{value:X.id,children:X.label},X.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!H,onClick:Ee,children:"Add Ref"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!H,onClick:Ge,children:"Import Inline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:g.length===0||g.every(X=>be.some(xe=>xe.kind==="referenced"&&xe.ref===X.id)),onClick:Ne,children:"Add All Refs"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:ee,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[be.map((X,xe)=>{const Ve=X.kind==="referenced"?tn(X.ref):null,ct=X.kind==="inline"?X.agent.name?.trim()||X.agent.id:Ve?.name||X.ref,Ft=X.kind==="inline"?X.agent.model:Ve?.model||"unknown",Ht=X.kind==="inline"?X.agent.id:X.ref,Bt=X.kind==="referenced"&&!Ve,Bn=X.kind==="inline"?X.agent.id:X.ref,He=ie.includes(Bn),rn=X.kind==="inline"&&!!te[X.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:()=>Le(xe,-1),disabled:xe===0,"aria-label":"Move agent up",children:s.jsx(bs,{className:"h-3 w-3"})}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Le(xe,1),disabled:xe===be.length-1,"aria-label":"Move agent down",children:s.jsx(Kt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[xe+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ct}),s.jsx(Ue,{variant:X.kind==="inline"?"secondary":"outline",children:X.kind==="inline"?"Inline":"Referenced"}),s.jsx(Ue,{variant:"outline",className:"font-mono text-[10px]",children:Ft}),He&&s.jsx(Ue,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Bt&&s.jsx(Ue,{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:He,onChange:Yt=>Dt(Bn,Yt.target.checked)}),s.jsx("span",{children:"Default"})]}),X.kind==="inline"&&s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>de(Yt=>({...Yt,[X.agent.id]:!Yt[X.agent.id]})),children:rn?"Collapse":"Expand"}),X.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>Lt(xe),disabled:Bt,children:"Convert to inline"})}),s.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>_e(xe),"aria-label":"Remove agent entry",children:s.jsx(Oa,{className:"h-3.5 w-3.5"})})]})]}),X.kind==="inline"&&rn&&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($e,{className:"text-xs",children:"Name"}),s.jsx(pt,{value:X.agent.name,onChange:Yt=>{const zn=[...be];zn[xe]={kind:"inline",agent:{...X.agent,name:Yt.target.value}},We(zn)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Provider"}),s.jsxs(bn,{value:X.agent.provider,onValueChange:Yt=>{const zn=[...be];zn[xe]={kind:"inline",agent:{...X.agent,provider:Yt}},We(zn)},children:[s.jsx(hn,{children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"openai",children:"OpenAI"}),s.jsx(Qe,{value:"anthropic",children:"Anthropic"}),s.jsx(Qe,{value:"azure",children:"Azure OpenAI"}),s.jsx(Qe,{value:"google",children:"Google"}),s.jsx(Qe,{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($e,{className:"text-xs",children:"Model"}),s.jsx(pt,{value:X.agent.model,onChange:Yt=>{const zn=[...be];zn[xe]={kind:"inline",agent:{...X.agent,model:Yt.target.value}},We(zn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Max Tokens"}),s.jsx(pt,{type:"number",min:1,max:128e3,value:X.agent.maxTokens,onChange:Yt=>{const zn=[...be];zn[xe]={kind:"inline",agent:{...X.agent,maxTokens:parseInt(Yt.target.value)||0}},We(zn)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Temperature"}),s.jsx(pt,{type:"number",min:0,max:2,step:.01,value:X.agent.temperature,onChange:Yt=>{const zn=[...be];zn[xe]={kind:"inline",agent:{...X.agent,temperature:Number(Yt.target.value)||0}},We(zn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"System Prompt"}),s.jsx(ks,{value:X.agent.systemPrompt||"",onChange:Yt=>{const zn=[...be];zn[xe]={kind:"inline",agent:{...X.agent,systemPrompt:Yt.target.value}},We(zn)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${xe}-${Ht}`)}),be.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),mt.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",mt.join(", ")]})]})}),B?s.jsx(Be,{children:s.jsx(ze,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[nn.map((X,xe)=>{const Ve=X.agent.name||X.agent.id,ct=ie.includes(X.origin==="inline"?X.agent.id:X.ref||X.agent.id),Ft=X.ref??X.agent.id,Ht=!!fe[Ft];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:[xe+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:Ve})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ct&&s.jsx(Ue,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Ue,{variant:X.origin==="inline"?"secondary":"outline",children:X.origin==="inline"?"Inline":"Referenced"}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>me(Bt=>({...Bt,[Ft]:!Bt[Ft]})),"aria-label":Ht?"Collapse agent details":"Expand agent details",children:s.jsx(Kt,{className:`h-4 w-4 transition-transform ${Ht?"rotate-180":""}`})})]})]}),Ht&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(Bz,{provider:X.agent.provider}),s.jsx(Ue,{variant:"outline",className:"text-xs font-mono",children:X.agent.model}),s.jsxs(Ue,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",X.agent.maxTokens]}),s.jsxs(Ue,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",X.agent.temperature]})]})]},`agent-view-${xe}-${X.ref??X.agent.id}`)}),nn.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(jf,{value:"scenarios",children:[!B&&s.jsx(Be,{className:"mb-4",children:s.jsxs(ze,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(bn,{value:D,onValueChange:J,children:[s.jsx(hn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select scenario from library"})}),s.jsx(mn,{children:[...x].sort((X,xe)=>(X.name||X.id).localeCompare(xe.name||xe.id)).map(X=>s.jsx(Qe,{value:X.id,children:X.name||X.id},X.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:Or,children:"Add Ref"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!D,onClick:cn,children:"Import Inline"}),s.jsx(se,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Sn,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[le.map((X,xe)=>{const Ve=X.kind==="referenced"?Gt(X.ref):null,ct=X.kind==="inline"?X.scenario.name?.trim()||X.scenario.id:Ve?.name||X.ref,Ft=X.kind==="inline"&&!X.scenario.name?.trim(),Ht=X.kind==="referenced"&&cr.has(X.ref),Bt=X.kind==="inline"&&!!U[X.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:()=>_t(xe,-1),disabled:xe===0,"aria-label":"Move scenario up",children:s.jsx(bs,{className:"h-3 w-3"})}),s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>_t(xe,1),disabled:xe===le.length-1,"aria-label":"Move scenario down",children:s.jsx(Kt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[xe+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ct}),s.jsx(Ue,{variant:X.kind==="inline"?"secondary":"outline",children:X.kind==="inline"?"Inline":"Referenced"}),Ft&&s.jsx(Ue,{variant:"destructive",children:"Name required"}),Ht&&s.jsx(Ue,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[X.kind==="inline"&&s.jsx(se,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>oe(Bn=>({...Bn,[X.scenario.id]:!Bn[X.scenario.id]})),"aria-label":Bt?"Collapse scenario details":"Expand scenario details",children:s.jsx(Kt,{className:`h-3.5 w-3.5 transition-transform ${Bt?"rotate-180":""}`})}),X.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>$t(xe),disabled:Ht,children:"Convert to inline"})}),s.jsx(se,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>we(xe),"aria-label":"Remove scenario entry",children:s.jsx(Oa,{className:"h-3.5 w-3.5"})})]})]}),X.kind==="inline"&&Bt&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(X1,{scenarios:[X.scenario],scenarioOrigins:["inline"],agents:[...N.agents,...Rt],servers:[...N.servers??[],...ft],configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:Bn=>{const He=Bn[0];if(!He)return;const rn=[...le];rn[xe]={kind:"inline",scenario:He},Ae(rn)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${xe}-${X.kind==="inline"?X.scenario.id:X.ref}`)}),le.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),kn.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",kn.join(", ")]})]})}),B?s.jsx(Be,{children:s.jsx(ze,{className:"pt-4",children:s.jsx(X1,{scenarios:ue.map(X=>X.scenario),scenarioOrigins:ue.map(X=>X.origin),agents:nt,servers:bt,configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var vve=Symbol("radix.slottable");function gve(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=vve,t}var h8="AlertDialog",[xve]=pr(h8,[w5]),go=w5(),m8=e=>{const{__scopeAlertDialog:t,...n}=e,r=go(t);return s.jsx(Nv,{...r,...n,modal:!0})};m8.displayName=h8;var yve="AlertDialogTrigger",bve=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=go(n);return s.jsx(WG,{...a,...r,ref:t})});bve.displayName=yve;var wve="AlertDialogPortal",v8=e=>{const{__scopeAlertDialog:t,...n}=e,r=go(t);return s.jsx(Cv,{...r,...n})};v8.displayName=wve;var jve="AlertDialogOverlay",g8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=go(n);return s.jsx(uu,{...a,...r,ref:t})});g8.displayName=jve;var bc="AlertDialogContent",[Sve,Nve]=xve(bc),Cve=gve("AlertDialogContent"),x8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,o=go(n),i=m.useRef(null),c=xt(t,i),d=m.useRef(null);return s.jsx(BG,{contentName:bc,titleName:y8,docsSlug:"alert-dialog",children:s.jsx(Sve,{scope:n,cancelRef:d,children:s.jsxs(du,{role:"alertdialog",...o,...a,ref:c,onOpenAutoFocus:Re(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(Cve,{children:r}),s.jsx(Ave,{contentRef:i})]})})})});x8.displayName=bc;var y8="AlertDialogTitle",b8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=go(n);return s.jsx(kf,{...a,...r,ref:t})});b8.displayName=y8;var w8="AlertDialogDescription",j8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=go(n);return s.jsx(Tf,{...a,...r,ref:t})});j8.displayName=w8;var _ve="AlertDialogAction",S8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=go(n);return s.jsx(_v,{...a,...r,ref:t})});S8.displayName=_ve;var N8="AlertDialogCancel",C8=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=Nve(N8,n),o=go(n),i=xt(t,a);return s.jsx(_v,{...o,...r,ref:i})});C8.displayName=N8;var Ave=({contentRef:e})=>{const t=`\`${bc}\` requires a description for the component to be accessible for screen reader users.
|
|
130
|
-
|
|
131
|
-
You can add a description to the \`${bc}\` by passing a \`${w8}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
132
|
-
|
|
133
|
-
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 \`${bc}\`. 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.
|
|
134
|
-
|
|
135
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return m.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Eve=m8,Pve=v8,_8=g8,A8=x8,E8=S8,P8=C8,k8=b8,T8=j8;const Ds=Eve,kve=Pve,O8=m.forwardRef(({className:e,...t},n)=>s.jsx(_8,{className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));O8.displayName=_8.displayName;const as=m.forwardRef(({className:e,...t},n)=>s.jsxs(kve,{children:[s.jsx(O8,{}),s.jsx(A8,{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})]}));as.displayName=A8.displayName;const ss=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});ss.displayName="AlertDialogHeader";const os=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});os.displayName="AlertDialogFooter";const is=m.forwardRef(({className:e,...t},n)=>s.jsx(k8,{ref:n,className:Se("text-lg font-semibold",e),...t}));is.displayName=k8.displayName;const ls=m.forwardRef(({className:e,...t},n)=>s.jsx(T8,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));ls.displayName=T8.displayName;const cs=m.forwardRef(({className:e,...t},n)=>s.jsx(E8,{ref:n,className:Se(PN(),e),...t}));cs.displayName=E8.displayName;const us=m.forwardRef(({className:e,...t},n)=>s.jsx(P8,{ref:n,className:Se(PN({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));us.displayName=P8.displayName;const Tve=()=>{const{servers:e,setServers:t,reload:n,loading:r}=ns(),a=Ia(),[o,i]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=b=>b.name?.trim()||b.id,p=async b=>{const y=`${h(b)}-copy`;let S=y,C=1;for(;e.some(E=>(E.name?.trim()||E.id)===S);)S=`${y}-${C}`,C+=1;const N={...structuredClone(b),id:`srv-${Date.now()}`,name:S};await t([...e,N]),Pe({title:"Server duplicated",description:`Created ${S}.`})},g=async b=>{await t(e.filter(y=>y.id!==b.id)),Pe({title:"Server deleted",description:`${h(b)} was removed.`}),i(null)},x=b=>b.transport==="stdio"?[b.command,...b.args||[]].filter(Boolean).join(" "):b.url||"",j=m.useMemo(()=>[...f.length===0?e:e.filter(y=>[h(y),y.id,y.transport,x(y),y.authType??""].join(" ").toLowerCase().includes(f))].sort((y,S)=>h(y).localeCompare(h(S),void 0,{sensitivity:"base"})),[e,f]);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(X$,{className:"h-6 w-6"}),"MCP 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.jsx(IC,{value:c,onValueChange:d,placeholder:"Search MCP servers..."}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(ao,{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(ao,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):j.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers match this filter."})}):s.jsx(Be,{children:s.jsx(ze,{className:"p-0",children:s.jsxs(qr,{children:[s.jsx(Wr,{children:s.jsxs(Vt,{children:[s.jsx(tt,{children:"Name"}),s.jsx(tt,{children:"Transport"}),s.jsx(tt,{children:"Endpoint"}),s.jsx(tt,{children:"Auth"}),s.jsx(tt,{className:"text-right",children:"Actions"})]})}),s.jsx(Vr,{children:j.map(b=>s.jsxs(Vt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[s.jsx(Fe,{className:"font-medium",children:h(b)}),s.jsx(Fe,{children:s.jsx(Ue,{variant:"secondary",className:"font-mono text-xs",children:b.transport})}),s.jsx(Fe,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:x(b)})}),s.jsx(Fe,{children:!b.authType||b.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(Ue,{variant:"outline",className:"text-xs",children:b.authType})}),s.jsx(Fe,{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:()=>i(b),children:[s.jsx(Oa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(b)},children:[s.jsx(Cs,{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(b.id)}`),children:[s.jsx(rv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},b.id))})]})})}),s.jsx(Ds,{open:!!o,onOpenChange:b=>!b&&i(null),children:s.jsxs(as,{children:[s.jsxs(ss,{children:[s.jsx(is,{children:"Delete server?"}),s.jsxs(ls,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:o?h(o):""})," from the library. This action cannot be undone."]})]}),s.jsxs(os,{children:[s.jsx(us,{children:"Cancel"}),s.jsx(cs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{o&&g(o)},children:"Delete Server"})]})]})})]})},KM={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"},GM=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none"}),Ove=()=>{const{serverId:e}=hl(),t=Ia(),{servers:n,setServers:r}=ns(),{source:a}=$n(),o=e==="new",i=e?decodeURIComponent(e):"",c=o?null:n.find(R=>R.id===i||R.name===i),d=R=>R.name?.trim()||R.id,[f,h]=m.useState(()=>c??GM()),[p,g]=m.useState(!1),[x,j]=m.useState(!1),[b,y]=m.useState({status:"idle"}),[S,C]=m.useState(!1),[N,E]=m.useState(!1),[A,k]=m.useState([]),[T,O]=m.useState(!1),L=m.useRef(null);m.useEffect(()=>{const R=o?`new:${i||"new"}`:`srv:${i}`;if(L.current!==R){if(o){h(GM()),O(!1),L.current=R;return}c&&(h(c),O(!1),L.current=R)}},[o,i,c]);const z=R=>{O(!1),h(M=>({...M,authType:R,...R!=="bearer"&&R!=="api-key"?{authValue:void 0}:{},...R!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:M.apiKeyHeaderName||"X-API-Key"},...R!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0,oauthMode:void 0,oauthAuthorizationUrl:void 0,oauthTokenEndpoint:void 0}:{oauthRedirectUrl:M.oauthRedirectUrl||void 0}}))},q=async()=>{if(C(!0),y({status:"loading"}),k([]),f.authType==="oauth2")try{E(!0),await nl({serverNames:[f.id],source:a,onServerStatus:R=>{const M=new Date().toLocaleTimeString(),K=typeof R.tokenExpiresInSeconds=="number"?` (valid ${G1(R.tokenExpiresInSeconds,{nonPositiveLabel:"expired"})}; until ${new Date(R.tokenExpiresAt||Date.now()).toLocaleTimeString()})`:"";if(R.status==="auth_required"){k(V=>[...V,`[${M}] OAuth debug: callback required for '${R.serverName}'`]);return}R.status==="ready"&&(R.debugState==="refreshed"?k(V=>[...V,`[${M}] OAuth debug: token refreshed (no callback)${K}`]):R.debugState==="reused"?k(V=>[...V,`[${M}] OAuth debug: session/token reused${K}`]):k(V=>[...V,`[${M}] OAuth debug: authorized${K}`]))}})}catch(R){y({status:"error",message:`OAuth login failed: ${R instanceof Error?R.message:String(R)}`,testedAt:new Date().toISOString()}),E(!1);return}finally{E(!1)}try{const M=(await a.discoverToolsForAnalysis({serverNames:[f.id]})).servers[0];M&&M.warnings.length===0?y({status:"success",toolNames:M.tools.map(K=>K.name),toolCount:M.tools.length,mcpServerVersion:M.mcpServerVersion,mcpServerImplementation:M.mcpServerImplementation,testedAt:new Date().toISOString()}):y({status:"error",message:M?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(R){y({status:"error",message:R instanceof Error?R.message:String(R),testedAt:new Date().toISOString()})}},F=async()=>{if(!f.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}const R=p8(f);if(R){Pe({title:"Validation Error",description:R,variant:"destructive"});return}const M={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(o)await r([...n,M]),Pe({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(M.id)}`);else{const K=n.map(V=>V.id===c?.id?M:V);await r(K),Pe({title:"Server saved"}),M.id!==i&&t(`/libraries/servers/${encodeURIComponent(M.id)}`,{replace:!0})}}finally{j(!1)}},G=async()=>{const R=n.filter(M=>M.id!==c?.id);await r(R),Pe({title:"Server deleted"}),t("/libraries/servers")},W=()=>f.transport==="stdio"?[f.command,...f.args||[]].filter(Boolean).join(" "):f.url||"";return!o&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Ct,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Vi,{className:"h-4 w-4"})," Servers"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',i,'" 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(Ct,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Vi,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:o?"New Server":d(f)})]}),!o&&s.jsxs(se,{type:"button",onClick:()=>{q()},disabled:b.status==="loading"||N,children:[s.jsx(rD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(Be,{children:[s.jsxs(St,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Nt,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>C(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(_s,{className:"h-4 w-4"})})]}),s.jsxs(ze,{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}),W()&&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:W()})]})]}),b.status==="loading"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(wr,{className:"h-4 w-4 animate-spin"}),N?"Waiting for OAuth login in browser…":"Connecting to MCP server…"]}),A.length>0&&s.jsx("div",{className:"space-y-0.5",children:A.map((R,M)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:R},M))})]}),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(wc,{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))})]}),(b.mcpServerImplementation||b.mcpServerVersion)&&s.jsx("div",{className:"rounded-md border bg-muted/40 p-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[b.mcpServerImplementation?.icons?.[0]?.src?s.jsx("img",{src:b.mcpServerImplementation.icons[0].src,alt:b.mcpServerImplementation.title||b.mcpServerImplementation.name,className:"h-7 w-7 rounded-sm border bg-background object-contain"}):null,s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"MCP server"}),s.jsx("p",{className:"truncate text-sm",children:b.mcpServerImplementation?b.mcpServerImplementation.title||b.mcpServerImplementation.name:"Unknown MCP server"}),b.mcpServerVersion?s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Version: ",s.jsx("code",{className:"font-mono",children:b.mcpServerVersion})]}):null,b.mcpServerImplementation?.description?s.jsx("p",{className:"text-xs text-muted-foreground",children:b.mcpServerImplementation.description}):null]})]})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]}),A.length>0&&s.jsx("div",{className:"space-y-0.5",children:A.map((R,M)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:R},M))})]}),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]}),KM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",KM[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),s.jsxs(Be,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Configuration"})}),s.jsxs(ze,{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($e,{children:"Name"}),s.jsx(pt,{value:f.name,onChange:R=>h(M=>({...M,name:R.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Transport"}),s.jsxs(bn,{value:f.transport,onValueChange:R=>h(M=>({...M,transport:R})),children:[s.jsx(hn,{children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"stdio",children:"stdio"}),s.jsx(Qe,{value:"sse",children:"SSE"}),s.jsx(Qe,{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($e,{children:"Command"}),s.jsx(pt,{value:f.command||"",onChange:R=>h(M=>({...M,command:R.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Args (comma-separated)"}),s.jsx(pt,{value:(f.args||[]).join(", "),onChange:R=>h(M=>({...M,args:R.target.value.split(",").map(K=>K.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"URL"}),s.jsx(pt,{value:f.url||"",onChange:R=>h(M=>({...M,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($e,{children:"Auth Type"}),s.jsxs(bn,{value:f.authType||"none",onValueChange:R=>z(R),children:[s.jsx(hn,{children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"none",children:"None"}),s.jsx(Qe,{value:"bearer",children:"Bearer Token"}),s.jsx(Qe,{value:"api-key",children:"API Key"}),s.jsx(Qe,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Token"}),s.jsx(pt,{value:f.authValue||"",onChange:R=>h(M=>({...M,authValue:R.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:"font-mono text-xs"})]})]}),f.authType==="bearer"&&s.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a token directly."]}),f.authType==="api-key"&&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:"API Key"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Header Name"}),s.jsx(pt,{value:f.apiKeyHeaderName||"X-API-Key",onChange:R=>h(M=>({...M,apiKeyHeaderName:R.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Value"}),s.jsx(pt,{value:f.authValue||"",onChange:R=>h(M=>({...M,authValue:R.target.value})),placeholder:"${MY_API_KEY}",className:"font-mono text-xs"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a value directly."]})]}),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:"flex gap-2",children:[s.jsx(se,{type:"button",variant:!f.oauthMode||f.oauthMode==="pre_registered"?"default":"outline",size:"sm",onClick:()=>h(R=>({...R,oauthMode:"pre_registered"})),children:"Pre-registered"}),s.jsx(se,{type:"button",variant:f.oauthMode==="dcr"?"default":"outline",size:"sm",onClick:()=>h(R=>({...R,oauthMode:"dcr",oauthClientId:void 0,oauthClientSecret:void 0})),children:"DCR (Dynamic)"})]}),(!f.oauthMode||f.oauthMode==="pre_registered")&&s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Client ID"}),s.jsx(pt,{value:f.oauthClientId||"",onChange:R=>h(M=>({...M,oauthClientId:R.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(pt,{type:"password",value:f.oauthClientSecret||"",onChange:R=>h(M=>({...M,oauthClientSecret:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Scope (optional, space-separated)"}),s.jsx(pt,{value:f.oauthScope||"",onChange:R=>h(M=>({...M,oauthScope:R.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]}),s.jsxs("div",{children:[s.jsxs("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>O(R=>!R),children:[s.jsx("span",{children:T?"▾":"▸"}),"Advanced — manual endpoint overrides"]}),T&&s.jsxs("div",{className:"mt-2 grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Authorization URL"}),s.jsx(pt,{value:f.oauthAuthorizationUrl||"",onChange:R=>h(M=>({...M,oauthAuthorizationUrl:R.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Token URL"}),s.jsx(pt,{value:f.oauthTokenEndpoint||"",onChange:R=>h(M=>({...M,oauthTokenEndpoint:R.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!o&&s.jsx(se,{type:"button",variant:"destructive",size:"sm",onClick:()=>g(!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:()=>{F()},disabled:x,children:[x&&s.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),o?"Create Server":"Save"]})]})]})]})]}),s.jsx(Ds,{open:p,onOpenChange:g,children:s.jsxs(as,{children:[s.jsxs(ss,{children:[s.jsx(is,{children:"Delete server?"}),s.jsxs(ls,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(os,{children:[s.jsx(us,{children:"Cancel"}),s.jsx(cs,{onClick:()=>{G()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},Rve=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=ns(),a=Ia(),[o,i]=m.useState(null),[c,d]=m.useState(""),f=c.trim().toLowerCase(),h=m.useMemo(()=>f.length===0?e:e.filter(x=>{const j=x.name.toLowerCase(),b=x.model.toLowerCase();return j.includes(f)||b.includes(f)}),[e,f]),p=async x=>{const j=`${x.name}-copy`;let b=j,y=1;for(;e.some(C=>C.name===b);)b=`${j}-${y}`,y+=1;const S={...structuredClone(x),id:`agt-${Date.now()}`,name:b};await t([...e,S]),Pe({title:"Agent duplicated",description:`Created ${b}.`})},g=async x=>{await t(e.filter(j=>j.id!==x.id)),Pe({title:"Agent deleted",description:`${x.name} was removed.`}),i(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(Pr,{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.jsx(IC,{value:c,onValueChange:d,placeholder:"Search agents..."}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(se,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(ao,{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(ao,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):h.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents match this filter."})}):s.jsx(Be,{children:s.jsx(ze,{className:"p-0",children:s.jsxs(qr,{children:[s.jsx(Wr,{children:s.jsxs(Vt,{children:[s.jsx(tt,{children:"Name"}),s.jsx(tt,{children:"Provider"}),s.jsx(tt,{children:"Model"}),s.jsx(tt,{children:"Max Tokens"}),s.jsx(tt,{children:"Temperature"}),s.jsx(tt,{className:"text-right",children:"Actions"})]})}),s.jsx(Vr,{children:h.map(x=>s.jsxs(Vt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(x.id)}`),children:[s.jsx(Fe,{className:"font-medium",children:x.name}),s.jsx(Fe,{children:s.jsx(Bz,{provider:x.provider})}),s.jsx(Fe,{children:s.jsx("span",{className:"font-mono text-xs",children:x.model})}),s.jsx(Fe,{className:"font-mono text-xs",children:x.maxTokens}),s.jsx(Fe,{className:"font-mono text-xs",children:x.temperature.toFixed(2)}),s.jsx(Fe,{className:"text-right",onClick:j=>j.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:()=>i(x),children:[s.jsx(Oa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(x)},children:[s.jsx(Cs,{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(x.id)}`),children:[s.jsx(rv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},x.id))})]})})}),s.jsx(Ds,{open:!!o,onOpenChange:x=>!x&&i(null),children:s.jsxs(as,{children:[s.jsxs(ss,{children:[s.jsx(is,{children:"Delete agent?"}),s.jsxs(ls,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:o?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(os,{children:[s.jsx(us,{children:"Cancel"}),s.jsx(cs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{o&&g(o)},children:"Delete Agent"})]})]})})]})};var R8=["PageUp","PageDown"],I8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],M8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ju="Slider",[J1,Ive,Mve]=Sf(ju),[$8]=pr(ju,[Mve]),[$ve,_g]=$8(ju),D8=m.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:o=1,orientation:i="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:j,...b}=e,y=m.useRef(new Set),S=m.useRef(0),N=i==="horizontal"?Dve:Lve,[E=[],A]=pa({prop:h,defaultProp:f,onChange:q=>{[...y.current][S.current]?.focus(),p(q)}}),k=m.useRef(E);function T(q){const F=qve(E,q);z(q,F)}function O(q){z(q,S.current)}function L(){const q=k.current[S.current];E[S.current]!==q&&g(E)}function z(q,F,{commit:G}={commit:!1}){const W=Kve(o),R=Gve(Math.round((q-r)/o)*o+r,W),M=wf(R,[r,a]);A((K=[])=>{const V=zve(K,M,F);if(Hve(V,d*o)){S.current=V.indexOf(M);const D=String(V)!==String(K);return D&&G&&g(V),D?V:K}else return K})}return s.jsx($ve,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:S,thumbs:y.current,values:E,orientation:i,form:j,children:s.jsx(J1.Provider,{scope:e.__scopeSlider,children:s.jsx(J1.Slot,{scope:e.__scopeSlider,children:s.jsx(N,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Re(b.onPointerDown,()=>{c||(k.current=E)}),min:r,max:a,inverted:x,onSlideStart:c?void 0:T,onSlideMove:c?void 0:O,onSlideEnd:c?void 0:L,onHomeKeyDown:()=>!c&&z(r,0,{commit:!0}),onEndKeyDown:()=>!c&&z(a,E.length-1,{commit:!0}),onStepKeyDown:({event:q,direction:F})=>{if(!c){const R=R8.includes(q.key)||q.shiftKey&&I8.includes(q.key)?10:1,M=S.current,K=E[M],V=o*R*F;z(K+V,M,{commit:!0})}}})})})})});D8.displayName=ju;var[L8,F8]=$8(ju,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Dve=m.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:o,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,g]=m.useState(null),x=xt(t,N=>g(N)),j=m.useRef(void 0),b=yu(a),y=b==="ltr",S=y&&!o||!y&&o;function C(N){const E=j.current||p.getBoundingClientRect(),A=[0,E.width],T=QC(A,S?[n,r]:[r,n]);return j.current=E,T(N-E.left)}return s.jsx(L8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(B8,{dir:b,"data-orientation":"horizontal",...h,ref:x,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const E=C(N.clientX);i?.(E)},onSlideMove:N=>{const E=C(N.clientX);c?.(E)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:N=>{const A=M8[S?"from-left":"from-right"].includes(N.key);f?.({event:N,direction:A?-1:1})}})})}),Lve=m.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:o,onSlideMove:i,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=m.useRef(null),p=xt(t,h),g=m.useRef(void 0),x=!a;function j(b){const y=g.current||h.current.getBoundingClientRect(),S=[0,y.height],N=QC(S,x?[r,n]:[n,r]);return g.current=y,N(b-y.top)}return s.jsx(L8,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:s.jsx(B8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const y=j(b.clientY);o?.(y)},onSlideMove:b=>{const y=j(b.clientY);i?.(y)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:b=>{const S=M8[x?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),B8=m.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:i,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=_g(ju,n);return s.jsx(Ke.span,{...f,ref:t,onKeyDown:Re(e.onKeyDown,p=>{p.key==="Home"?(i(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):R8.concat(I8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Re(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(g)?g.focus():r(p)}),onPointerMove:Re(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Re(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),o(p))})})}),z8="SliderTrack",U8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=_g(z8,n);return s.jsx(Ke.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});U8.displayName=z8;var Q1="SliderRange",q8=m.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=_g(Q1,n),o=F8(Q1,n),i=m.useRef(null),c=xt(t,i),d=a.values.length,f=a.values.map(g=>H8(g,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(Ke.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[o.startEdge]:h+"%",[o.endEdge]:p+"%"}})});q8.displayName=Q1;var Z1="SliderThumb",W8=m.forwardRef((e,t)=>{const n=Ive(e.__scopeSlider),[r,a]=m.useState(null),o=xt(t,c=>a(c)),i=m.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Fve,{...e,ref:o,index:i})}),Fve=m.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...o}=e,i=_g(Z1,n),c=F8(Z1,n),[d,f]=m.useState(null),h=xt(t,C=>f(C)),p=d?i.form||!!d.closest("form"):!0,g=lv(d),x=i.values[r],j=x===void 0?0:H8(x,i.min,i.max),b=Uve(r,i.values.length),y=g?.[c.size],S=y?Wve(y,j,c.direction):0;return m.useEffect(()=>{if(d)return i.thumbs.add(d),()=>{i.thumbs.delete(d)}},[d,i.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${j}% + ${S}px)`},children:[s.jsx(J1.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(Ke.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":i.min,"aria-valuenow":x,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...o,ref:h,style:x===void 0?{display:"none"}:e.style,onFocus:Re(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})})}),p&&s.jsx(V8,{name:a??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:x},r)]})});W8.displayName=Z1;var Bve="RadioBubbleInput",V8=m.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=m.useRef(null),o=xt(a,r),i=mg(t);return m.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(i!==t&&h){const p=new Event("input",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[i,t]),s.jsx(Ke.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});V8.displayName=Bve;function zve(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,o)=>a-o)}function H8(e,t,n){const o=100/(n-t)*(e-t);return wf(o,[0,100])}function Uve(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function qve(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 Wve(e,t,n){const r=e/2,o=QC([0,50],[0,r]);return(r-o(t)*n)*n}function Vve(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Hve(e,t){if(t>0){const n=Vve(e);return Math.min(...n)>=t}return!0}function QC(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 Kve(e){return(String(e).split(".")[1]||"").length}function Gve(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var K8=D8,Yve=U8,Xve=q8,Jve=W8;const G8=m.forwardRef(({className:e,...t},n)=>s.jsxs(K8,{ref:n,className:Se("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(Yve,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Xve,{className:"absolute h-full bg-primary"})}),s.jsx(Jve,{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"})]}));G8.displayName=K8.displayName;function Qve(e){const t=Zve(e),n=m.forwardRef((r,a)=>{const{children:o,...i}=r,c=m.Children.toArray(o),d=c.find(tge);if(d){const f=d.props.children,h=c.map(p=>p===d?m.Children.count(f)>1?m.Children.only(null):m.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...i,ref:a,children:m.isValidElement(f)?m.cloneElement(f,void 0,h):null})}return s.jsx(t,{...i,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function Zve(e){const t=m.forwardRef((n,r)=>{const{children:a,...o}=n;if(m.isValidElement(a)){const i=rge(a),c=nge(o,a.props);return a.type!==m.Fragment&&(c.ref=r?kr(r,i):i),m.cloneElement(a,c)}return m.Children.count(a)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ege=Symbol("radix.slottable");function tge(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ege}function nge(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...c)=>{const d=o(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function rge(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 Ag="Popover",[Y8]=pr(Ag,[ti]),Yf=ti(),[age,ui]=Y8(Ag),X8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:i=!1}=e,c=Yf(t),d=m.useRef(null),[f,h]=m.useState(!1),[p,g]=pa({prop:r,defaultProp:a??!1,onChange:o,caller:Ag});return s.jsx(cv,{...c,children:s.jsx(age,{scope:t,contentId:er(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:f,onCustomAnchorAdd:m.useCallback(()=>h(!0),[]),onCustomAnchorRemove:m.useCallback(()=>h(!1),[]),modal:i,children:n})})};X8.displayName=Ag;var J8="PopoverAnchor",sge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ui(J8,n),o=Yf(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:c}=a;return m.useEffect(()=>(i(),()=>c()),[i,c]),s.jsx(_f,{...o,...r,ref:t})});sge.displayName=J8;var Q8="PopoverTrigger",Z8=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ui(Q8,n),o=Yf(n),i=xt(t,a.triggerRef),c=s.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":a6(a.open),...r,ref:i,onClick:Re(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(_f,{asChild:!0,...o,children:c})});Z8.displayName=Q8;var ZC="PopoverPortal",[oge,ige]=Y8(ZC,{forceMount:void 0}),e6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,o=ui(ZC,t);return s.jsx(oge,{scope:t,forceMount:n,children:s.jsx(Kn,{present:n||o.open,children:s.jsx(dl,{asChild:!0,container:a,children:r})})})};e6.displayName=ZC;var Qc="PopoverContent",t6=m.forwardRef((e,t)=>{const n=ige(Qc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=ui(Qc,e.__scopePopover);return s.jsx(Kn,{present:r||o.open,children:o.modal?s.jsx(cge,{...a,ref:t}):s.jsx(uge,{...a,ref:t})})});t6.displayName=Qc;var lge=Qve("PopoverContent.RemoveScroll"),cge=m.forwardRef((e,t)=>{const n=ui(Qc,e.__scopePopover),r=m.useRef(null),a=xt(t,r),o=m.useRef(!1);return m.useEffect(()=>{const i=r.current;if(i)return jv(i)},[]),s.jsx(Pf,{as:lge,allowPinchZoom:!0,children:s.jsx(n6,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,i=>{i.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;o.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Re(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),uge=m.forwardRef((e,t)=>{const n=ui(Qc,e.__scopePopover),r=m.useRef(!1),a=m.useRef(!1);return s.jsx(n6,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=o.target;n.triggerRef.current?.contains(i)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),n6=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:i,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,g=ui(Qc,n),x=Yf(n);return bv(),s.jsx(Ef,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:s.jsx(ul,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:s.jsx(uv,{"data-state":a6(g.open),role:"dialog",id:g.contentId,...x,...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)"}})})})}),r6="PopoverClose",dge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ui(r6,n);return s.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>a.onOpenChange(!1))})});dge.displayName=r6;var fge="PopoverArrow",pge=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Yf(n);return s.jsx(dv,{...a,...r,ref:t})});pge.displayName=fge;function a6(e){return e?"open":"closed"}var hge=X8,mge=Z8,vge=e6,s6=t6;const Zc=hge,eu=mge,rl=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(vge,{children:s.jsx(s6,{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})}));rl.displayName=s6.displayName;var YM=1,gge=.9,xge=.8,yge=.17,Lj=.1,Fj=.999,bge=.9999,wge=.99,jge=/[\\\/_+.#"@\[\(\{&]/,Sge=/[\\\/_+.#"@\[\(\{&]/g,Nge=/[\s-]/,o6=/[\s-]/g;function eN(e,t,n,r,a,o,i){if(o===t.length)return a===e.length?YM:wge;var c=`${a},${o}`;if(i[c]!==void 0)return i[c];for(var d=r.charAt(o),f=n.indexOf(d,a),h=0,p,g,x,j;f>=0;)p=eN(e,t,n,r,f+1,o+1,i),p>h&&(f===a?p*=YM:jge.test(e.charAt(f-1))?(p*=xge,x=e.slice(a,f-1).match(Sge),x&&a>0&&(p*=Math.pow(Fj,x.length))):Nge.test(e.charAt(f-1))?(p*=gge,j=e.slice(a,f-1).match(o6),j&&a>0&&(p*=Math.pow(Fj,j.length))):(p*=yge,a>0&&(p*=Math.pow(Fj,f-a))),e.charAt(f)!==t.charAt(o)&&(p*=bge)),(p<Lj&&n.charAt(f-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(f-1)!==r.charAt(o))&&(g=eN(e,t,n,r,f+1,o+2,i),g*Lj>p&&(p=g*Lj)),p>h&&(h=p),f=n.indexOf(d,f+1);return i[c]=h,h}function XM(e){return e.toLowerCase().replace(o6," ")}function Cge(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,eN(e,t,XM(e),XM(t),0,0,{})}var md='[cmdk-group=""]',Bj='[cmdk-group-items=""]',_ge='[cmdk-group-heading=""]',i6='[cmdk-item=""]',JM=`${i6}:not([aria-disabled="true"])`,tN="cmdk-item-select",ac="data-value",Age=(e,t,n)=>Cge(e,t,n),l6=m.createContext(void 0),Xf=()=>m.useContext(l6),c6=m.createContext(void 0),e_=()=>m.useContext(c6),u6=m.createContext(void 0),d6=m.forwardRef((e,t)=>{let n=sc(()=>{var I,te;return{search:"",value:(te=(I=e.value)!=null?I:e.defaultValue)!=null?te:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=sc(()=>new Set),a=sc(()=>new Map),o=sc(()=>new Map),i=sc(()=>new Set),c=f6(e),{label:d,children:f,value:h,onValueChange:p,filter:g,shouldFilter:x,loop:j,disablePointerSelection:b=!1,vimBindings:y=!0,...S}=e,C=er(),N=er(),E=er(),A=m.useRef(null),k=Lge();al(()=>{if(h!==void 0){let I=h.trim();n.current.value=I,T.emit()}},[h]),al(()=>{k(6,G)},[]);let T=m.useMemo(()=>({subscribe:I=>(i.current.add(I),()=>i.current.delete(I)),snapshot:()=>n.current,setState:(I,te,de)=>{var fe,me,U,oe;if(!Object.is(n.current[I],te)){if(n.current[I]=te,I==="search")F(),z(),k(1,q);else if(I==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(E);re?re.focus():(fe=document.getElementById(C))==null||fe.focus()}if(k(7,()=>{var re;n.current.selectedItemId=(re=W())==null?void 0:re.id,T.emit()}),de||k(5,G),((me=c.current)==null?void 0:me.value)!==void 0){let re=te??"";(oe=(U=c.current).onValueChange)==null||oe.call(U,re);return}}T.emit()}},emit:()=>{i.current.forEach(I=>I())}}),[]),O=m.useMemo(()=>({value:(I,te,de)=>{var fe;te!==((fe=o.current.get(I))==null?void 0:fe.value)&&(o.current.set(I,{value:te,keywords:de}),n.current.filtered.items.set(I,L(te,de)),k(2,()=>{z(),T.emit()}))},item:(I,te)=>(r.current.add(I),te&&(a.current.has(te)?a.current.get(te).add(I):a.current.set(te,new Set([I]))),k(3,()=>{F(),z(),n.current.value||q(),T.emit()}),()=>{o.current.delete(I),r.current.delete(I),n.current.filtered.items.delete(I);let de=W();k(4,()=>{F(),de?.getAttribute("id")===I&&q(),T.emit()})}),group:I=>(a.current.has(I)||a.current.set(I,new Set),()=>{o.current.delete(I),a.current.delete(I)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:C,inputId:E,labelId:N,listInnerRef:A}),[]);function L(I,te){var de,fe;let me=(fe=(de=c.current)==null?void 0:de.filter)!=null?fe:Age;return I?me(I,n.current.search,te):0}function z(){if(!n.current.search||c.current.shouldFilter===!1)return;let I=n.current.filtered.items,te=[];n.current.filtered.groups.forEach(fe=>{let me=a.current.get(fe),U=0;me.forEach(oe=>{let re=I.get(oe);U=Math.max(re,U)}),te.push([fe,U])});let de=A.current;R().sort((fe,me)=>{var U,oe;let re=fe.getAttribute("id"),ne=me.getAttribute("id");return((U=I.get(ne))!=null?U:0)-((oe=I.get(re))!=null?oe:0)}).forEach(fe=>{let me=fe.closest(Bj);me?me.appendChild(fe.parentElement===me?fe:fe.closest(`${Bj} > *`)):de.appendChild(fe.parentElement===de?fe:fe.closest(`${Bj} > *`))}),te.sort((fe,me)=>me[1]-fe[1]).forEach(fe=>{var me;let U=(me=A.current)==null?void 0:me.querySelector(`${md}[${ac}="${encodeURIComponent(fe[0])}"]`);U?.parentElement.appendChild(U)})}function q(){let I=R().find(de=>de.getAttribute("aria-disabled")!=="true"),te=I?.getAttribute(ac);T.setState("value",te||void 0)}function F(){var I,te,de,fe;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let me=0;for(let U of r.current){let oe=(te=(I=o.current.get(U))==null?void 0:I.value)!=null?te:"",re=(fe=(de=o.current.get(U))==null?void 0:de.keywords)!=null?fe:[],ne=L(oe,re);n.current.filtered.items.set(U,ne),ne>0&&me++}for(let[U,oe]of a.current)for(let re of oe)if(n.current.filtered.items.get(re)>0){n.current.filtered.groups.add(U);break}n.current.filtered.count=me}function G(){var I,te,de;let fe=W();fe&&(((I=fe.parentElement)==null?void 0:I.firstChild)===fe&&((de=(te=fe.closest(md))==null?void 0:te.querySelector(_ge))==null||de.scrollIntoView({block:"nearest"})),fe.scrollIntoView({block:"nearest"}))}function W(){var I;return(I=A.current)==null?void 0:I.querySelector(`${i6}[aria-selected="true"]`)}function R(){var I;return Array.from(((I=A.current)==null?void 0:I.querySelectorAll(JM))||[])}function M(I){let te=R()[I];te&&T.setState("value",te.getAttribute(ac))}function K(I){var te;let de=W(),fe=R(),me=fe.findIndex(oe=>oe===de),U=fe[me+I];(te=c.current)!=null&&te.loop&&(U=me+I<0?fe[fe.length-1]:me+I===fe.length?fe[0]:fe[me+I]),U&&T.setState("value",U.getAttribute(ac))}function V(I){let te=W(),de=te?.closest(md),fe;for(;de&&!fe;)de=I>0?$ge(de,md):Dge(de,md),fe=de?.querySelector(JM);fe?T.setState("value",fe.getAttribute(ac)):K(I)}let D=()=>M(R().length-1),J=I=>{I.preventDefault(),I.metaKey?D():I.altKey?V(1):K(1)},H=I=>{I.preventDefault(),I.metaKey?M(0):I.altKey?V(-1):K(-1)};return m.createElement(Ke.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:I=>{var te;(te=S.onKeyDown)==null||te.call(S,I);let de=I.nativeEvent.isComposing||I.keyCode===229;if(!(I.defaultPrevented||de))switch(I.key){case"n":case"j":{y&&I.ctrlKey&&J(I);break}case"ArrowDown":{J(I);break}case"p":case"k":{y&&I.ctrlKey&&H(I);break}case"ArrowUp":{H(I);break}case"Home":{I.preventDefault(),M(0);break}case"End":{I.preventDefault(),D();break}case"Enter":{I.preventDefault();let fe=W();if(fe){let me=new Event(tN);fe.dispatchEvent(me)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:O.inputId,id:O.labelId,style:Bge},d),Eg(e,I=>m.createElement(c6.Provider,{value:T},m.createElement(l6.Provider,{value:O},I))))}),Ege=m.forwardRef((e,t)=>{var n,r;let a=er(),o=m.useRef(null),i=m.useContext(u6),c=Xf(),d=f6(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:i?.forceMount;al(()=>{if(!f)return c.item(a,i?.id)},[f]);let h=p6(a,o,[e.value,e.children,o],e.keywords),p=e_(),g=ei(k=>k.value&&k.value===h.current),x=ei(k=>f||c.filter()===!1?!0:k.search?k.filtered.items.get(a)>0:!0);m.useEffect(()=>{let k=o.current;if(!(!k||e.disabled))return k.addEventListener(tN,j),()=>k.removeEventListener(tN,j)},[x,e.onSelect,e.disabled]);function j(){var k,T;b(),(T=(k=d.current).onSelect)==null||T.call(k,h.current)}function b(){p.setState("value",h.current,!0)}if(!x)return null;let{disabled:y,value:S,onSelect:C,forceMount:N,keywords:E,...A}=e;return m.createElement(Ke.div,{ref:kr(o,t),...A,id:a,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!g,"data-disabled":!!y,"data-selected":!!g,onPointerMove:y||c.getDisablePointerSelection()?void 0:b,onClick:y?void 0:j},e.children)}),Pge=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,i=er(),c=m.useRef(null),d=m.useRef(null),f=er(),h=Xf(),p=ei(x=>a||h.filter()===!1?!0:x.search?x.filtered.groups.has(i):!0);al(()=>h.group(i),[]),p6(i,c,[e.value,e.heading,d]);let g=m.useMemo(()=>({id:i,forceMount:a}),[a]);return m.createElement(Ke.div,{ref:kr(c,t),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&m.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Eg(e,x=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},m.createElement(u6.Provider,{value:g},x))))}),kge=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=m.useRef(null),o=ei(i=>!i.search);return!n&&!o?null:m.createElement(Ke.div,{ref:kr(a,t),...r,"cmdk-separator":"",role:"separator"})}),Tge=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=e_(),i=ei(f=>f.search),c=ei(f=>f.selectedItemId),d=Xf();return m.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),m.createElement(Ke.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:i,onChange:f=>{a||o.setState("search",f.target.value),n?.(f.target.value)}})}),Oge=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=m.useRef(null),i=m.useRef(null),c=ei(f=>f.selectedItemId),d=Xf();return m.useEffect(()=>{if(i.current&&o.current){let f=i.current,h=o.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let x=f.offsetHeight;h.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),m.createElement(Ke.div,{ref:kr(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Eg(e,f=>m.createElement("div",{ref:kr(i,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Rge=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:i,...c}=e;return m.createElement(Nv,{open:n,onOpenChange:r},m.createElement(Cv,{container:i},m.createElement(uu,{"cmdk-overlay":"",className:a}),m.createElement(du,{"aria-label":e.label,"cmdk-dialog":"",className:o},m.createElement(d6,{ref:t,...c}))))}),Ige=m.forwardRef((e,t)=>ei(n=>n.filtered.count===0)?m.createElement(Ke.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Mge=m.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return m.createElement(Ke.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Eg(e,i=>m.createElement("div",{"aria-hidden":!0},i)))}),Xr=Object.assign(d6,{List:Oge,Item:Ege,Input:Tge,Group:Pge,Separator:kge,Dialog:Rge,Empty:Ige,Loading:Mge});function $ge(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Dge(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function f6(e){let t=m.useRef(e);return al(()=>{t.current=e}),t}var al=typeof window>"u"?m.useEffect:m.useLayoutEffect;function sc(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function ei(e){let t=e_(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function p6(e,t,n,r=[]){let a=m.useRef(),o=Xf();return al(()=>{var i;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());o.value(e,c,d),(i=t.current)==null||i.setAttribute(ac,c),a.current=c}),a}var Lge=()=>{let[e,t]=m.useState(),n=sc(()=>new Map);return al(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Fge(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Eg({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(Fge(t),{ref:t.ref},n(t.props.children)):n(t)}var Bge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const sl=m.forwardRef(({className:e,...t},n)=>s.jsx(Xr,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));sl.displayName=Xr.displayName;const ol=m.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(dN,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Xr.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})]}));ol.displayName=Xr.Input.displayName;const il=m.forwardRef(({className:e,...t},n)=>s.jsx(Xr.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));il.displayName=Xr.List.displayName;const ll=m.forwardRef((e,t)=>s.jsx(Xr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));ll.displayName=Xr.Empty.displayName;const cl=m.forwardRef(({className:e,...t},n)=>s.jsx(Xr.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}));cl.displayName=Xr.Group.displayName;const zge=m.forwardRef(({className:e,...t},n)=>s.jsx(Xr.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",e),...t}));zge.displayName=Xr.Separator.displayName;const ca=m.forwardRef(({className:e,...t},n)=>s.jsx(Xr.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}));ca.displayName=Xr.Item.displayName;const QM={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:[]},ZM={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"},e$=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Uge=()=>{const{agentName:e}=hl(),t=Ia(),{agents:n,setAgents:r}=ns(),{source:a}=$n(),o=e==="new",i=e?decodeURIComponent(e):"",c=o?null:n.find(D=>D.id===i)??n.find(D=>D.name===i),[d,f]=m.useState(()=>c??e$()),[h,p]=m.useState(!1),[g,x]=m.useState(!1),[j,b]=m.useState({status:"idle"}),[y,S]=m.useState(!1),[C,N]=m.useState([]),[E,A]=m.useState(!1),[k,T]=m.useState(!1),[O,L]=m.useState(!1),z=m.useRef(null);m.useEffect(()=>{const D=o?`new:${i||"new"}`:`agt:${i}`;if(z.current!==D){if(o){f(e$()),z.current=D;return}c&&(f(c),z.current=D)}},[o,i,c]);const q=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",F=Array.from(new Set([...QM[d.provider]||[],...C])),G=F.includes(d.model),W=O||!!d.model&&!G,R=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const D=await a.listProviderModels(d.provider);b({status:"success",items:D.items,source:D.source,kind:D.kind,testedAt:new Date().toISOString()})}catch(D){b({status:"error",message:D instanceof Error?D.message:String(D),testedAt:new Date().toISOString()})}},M=async()=>{if(!q){Pe({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}A(!0);try{const D=await a.listProviderModels(d.provider);N(D.items),Pe({title:D.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${D.items.length} ${D.kind} from ${D.source}`})}catch(D){Pe({title:"Could not load provider models",description:String(D instanceof Error?D.message:D),variant:"destructive"})}finally{A(!1)}},K=async()=>{if(!d.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}x(!0);try{if(o)await r([...n,d]),Pe({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const D=n.map(J=>J.id===c?.id?d:J);await r(D),Pe({title:"Agent saved"}),d.id!==i&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{x(!1)}},V=async()=>{const D=n.filter(J=>J.id!==c?.id);await r(D),Pe({title:"Agent deleted"}),t("/libraries/agents")};return!o&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Ct,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Vi,{className:"h-4 w-4"})," Agents"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',i,'" 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(Ct,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Vi,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:o?"New Agent":d.name})]}),!o&&s.jsxs(se,{type:"button",onClick:()=>{R()},children:[s.jsx(rD,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),y&&s.jsxs(Be,{children:[s.jsxs(St,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Nt,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>S(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(_s,{className:"h-4 w-4"})})]}),s.jsxs(ze,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Provider:"}),s.jsx("span",{className:"font-medium text-foreground",children:d.provider}),s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsxs("code",{className:"font-mono text-xs",children:["/api/providers/models?provider=",d.provider]})]}),j.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Testing connection..."]}),j.status==="success"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[s.jsx(wc,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",j.items.length," ",j.kind," from"," ",j.source]}),s.jsxs("div",{className:"rounded-md bg-muted p-3",children:[s.jsxs("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:["First 5 ",j.kind,":"]}),s.jsx("ul",{className:"space-y-0.5",children:j.items.slice(0,5).map(D=>s.jsx("li",{className:"font-mono text-xs",children:D},D))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," —"," ",j.message]}),ZM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",ZM[d.provider]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="unsupported"&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:["Connection testing is not supported for the"," ",s.jsx("span",{className:"font-medium",children:d.provider})," provider. Supported providers: Anthropic, OpenAI, Azure OpenAI."]})]})]}),s.jsxs(Be,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Configuration"})}),s.jsxs(ze,{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($e,{children:"Name"}),s.jsx(pt,{value:d.name,onChange:D=>f(J=>({...J,name:D.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Provider"}),s.jsxs(bn,{value:d.provider,onValueChange:D=>f(J=>({...J,provider:D,model:QM[D]?.[0]||""})),children:[s.jsx(hn,{children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"openai",children:"OpenAI"}),s.jsx(Qe,{value:"anthropic",children:"Anthropic"}),s.jsx(Qe,{value:"azure",children:"Azure OpenAI"}),s.jsx(Qe,{value:"google",children:"Google"}),s.jsx(Qe,{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($e,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Zc,{open:k,onOpenChange:T,children:[s.jsx(eu,{asChild:!0,children:s.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":k,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(Kt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(rl,{className:"w-[420px] p-0",align:"start",children:s.jsxs(sl,{children:[s.jsx(ol,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(il,{children:[s.jsxs(ll,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(cl,{heading:d.provider==="azure"?"Deployments":"Models",children:[F.map(D=>s.jsxs(ca,{value:D,onSelect:J=>{f(H=>({...H,model:J})),L(!1),T(!1)},children:[s.jsx(wc,{className:Se("mr-2 h-4 w-4",d.model===D?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:D})]},D)),s.jsx(ca,{value:"__custom_model_id__",onSelect:()=>{L(!0),T(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),q&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{M()},disabled:E,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[E?s.jsx(wr,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(ha,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),W&&s.jsx(pt,{value:d.model,onChange:D=>f(J=>({...J,model:D.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),C.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",C.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Max Tokens"}),s.jsx(pt,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:D=>f(J=>({...J,maxTokens:parseInt(D.target.value)||0})),className:"font-mono text-xs"})]})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"Max Turns"}),s.jsx(pt,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:D=>{const J=D.target.value.trim();f(H=>({...H,maxTurns:J&&parseInt(J)||void 0}))},placeholder:"30 (default)",className:"font-mono text-xs"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Maximum number of LLM round-trips (tool calls + final answer) per eval run."})]})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx($e,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(G8,{value:[d.temperature],onValueChange:([D])=>f(J=>({...J,temperature:D})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{children:"System Prompt"}),s.jsx(ks,{value:d.systemPrompt||"",onChange:D=>f(J=>({...J,systemPrompt:D.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:!o&&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:()=>{K()},disabled:g,children:[g&&s.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),o?"Create Agent":"Save"]})]})]})]})]}),s.jsx(Ds,{open:h,onOpenChange:p,children:s.jsxs(as,{children:[s.jsxs(ss,{children:[s.jsx(is,{children:"Delete agent?"}),s.jsxs(ls,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(os,{children:[s.jsx(us,{children:"Cancel"}),s.jsx(cs,{onClick:()=>{V()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},t$="mcplab.resultAssistantScenarioHandoff",n$=()=>{const{testCaseId:e}=hl(),[t,n]=ni(),r=Ia(),{source:a}=$n(),{scenarios:o,setScenarios:i,agents:c,servers:d,reload:f,loading:h}=ns(),[p,g]=m.useState(""),[x,j]=m.useState("all"),[b,y]=m.useState("name"),[S,C]=m.useState("asc"),[N,E]=m.useState(""),[A,k]=m.useState(null),[T,O]=m.useState("idle"),[L,z]=m.useState(""),[q,F]=m.useState(""),[G,W]=m.useState(0),[R,M]=m.useState(null),K=m.useRef(null),V=m.useRef(!1),D=m.useRef(!1),J=m.useRef(null),H=m.useRef(0),I=e?decodeURIComponent(e):void 0,te=I?o.findIndex(B=>B.id===I):-1,de=te>=0?o[te]:void 0,fe=async B=>{if(!de||te<0||!B)return;const ie=[...o];ie[te]=B,await i(ie)},me=async()=>{const B=J.current;if(!B||!de)return;if(V.current){D.current=!0;return}V.current=!0,D.current=!1;const ie=++H.current;O("saving"),z("");try{await fe(B),ie===H.current&&O("saved")}catch(he){const Te=he instanceof Error?he.message:String(he);ie===H.current&&(O("error"),z(Te)),Pe({title:"Could not save scenario",description:Te,variant:"destructive"})}finally{V.current=!1,D.current&&(D.current=!1,me())}},U=B=>{J.current=B,O("dirty"),z(""),K.current&&window.clearTimeout(K.current),K.current=window.setTimeout(()=>{K.current=null,me()},700)},oe=async()=>{const B=`scn-${Date.now()}`;let ie=B,he=1;for(;o.some(Ye=>Ye.id===ie);)ie=`${B}-${he}`,he+=1;const Te={id:ie,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await i([...o,Te]),r(`/libraries/test-cases/${encodeURIComponent(ie)}`),Pe({title:"Test case created",description:`Opened ${ie} for editing.`})},re=B=>{const ie=(B||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let he=ie,Te=1;for(;o.some(Ye=>Ye.id===he);)he=`${ie}-${Te}`,Te+=1;return he},ne=async(B,ie=!1)=>{const he=re(`${B.id}-copy`),Te={...structuredClone(B),id:he,name:B.name?`${B.name} (Copy)`:""};await i([...o,Te]),Pe({title:"Test case duplicated",description:`Created ${Te.id}.`}),ie&&r(`/libraries/test-cases/${encodeURIComponent(Te.id)}`)},ve=async B=>{K.current&&(window.clearTimeout(K.current),K.current=null);const ie=o.filter(he=>he.id!==B.id);await i(ie),Pe({title:"Test case deleted",description:`${B.id} was removed.`}),de?.id===B.id&&(k(null),J.current=null,O("idle"),z(""),r("/libraries/test-cases"))},le=B=>B.map(ie=>d.find(he=>he.id===ie)).filter(Boolean).map(ie=>ie?.name||ie?.id).filter(Boolean),Ae=m.useMemo(()=>{const B=new Set;for(const ie of o)for(const he of le(ie.serverIds))B.add(he);return Array.from(B).sort((ie,he)=>ie.localeCompare(he))},[o,d]),be=m.useMemo(()=>{const B=p.trim().toLowerCase(),ie=o.filter(he=>{const Te=(he.name||"").toLowerCase(),Ye=he.id.toLowerCase(),ut=(he.prompt||"").toLowerCase(),dt=le(he.serverIds);return x!=="all"&&!dt.includes(x)?!1:B?Te.includes(B)||Ye.includes(B)||ut.includes(B)||dt.some(ht=>ht.toLowerCase().includes(B)):!0});return ie.sort((he,Te)=>{const Ye=le(he.serverIds),ut=le(Te.serverIds);let dt=0;switch(b){case"id":dt=he.id.localeCompare(Te.id);break;case"servers":dt=Ye.length-ut.length;break;case"evalRules":dt=he.evalRules.length-Te.evalRules.length;break;case"extractRules":dt=he.extractRules.length-Te.extractRules.length;break;default:dt=(he.name||he.id).localeCompare(Te.name||Te.id);break}return dt===0&&(dt=he.id.localeCompare(Te.id)),S==="asc"?dt:-dt}),ie},[o,p,x,b,S,d]);m.useEffect(()=>{let B=!0;return a.getWorkspaceSettings().then(ie=>{!B||!ie||E(ie.scenarioAssistantAgentName??"")}).catch(()=>{B&&E("")}),()=>{B=!1}},[a]),m.useEffect(()=>{if(I&&t.get("assistantHandoff")==="1")try{const B=window.sessionStorage.getItem(t$);if(!B)return;const ie=JSON.parse(B);if(!ie||ie.scenarioId!==I||!ie.prompt)return;F(String(ie.prompt)),W(Date.now()),window.sessionStorage.removeItem(t$);const he=new URLSearchParams(t);he.delete("assistantHandoff"),n(he,{replace:!0}),Pe({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[I,t,n]),m.useEffect(()=>{de?(k(structuredClone(de)),J.current=structuredClone(de),O("idle"),z("")):(k(null),J.current=null,O("idle"),z("")),K.current&&(window.clearTimeout(K.current),K.current=null),V.current=!1,D.current=!1},[de]),m.useEffect(()=>()=>{K.current&&window.clearTimeout(K.current)},[]);const We=N||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(J$,{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:[de&&s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(Vi,{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(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!de&&s.jsxs(se,{type:"button",size:"sm",onClick:()=>{oe()},children:[s.jsx(ao,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!de&&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($e,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(dN,{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(pt,{value:p,onChange:B=>g(B.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($e,{className:"text-xs",children:"Server Filter"}),s.jsxs(bn,{value:x,onValueChange:j,children:[s.jsx(hn,{className:"h-8 text-xs",children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"all",children:"All servers"}),Ae.map(B=>s.jsx(Qe,{value:B,children:B},B))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Sort By"}),s.jsxs(bn,{value:b,onValueChange:B=>y(B),children:[s.jsx(hn,{className:"h-8 text-xs",children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"name",children:"Name"}),s.jsx(Qe,{value:"id",children:"ID"}),s.jsx(Qe,{value:"servers",children:"# Servers"}),s.jsx(Qe,{value:"evalRules",children:"# Eval Rules"}),s.jsx(Qe,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx($e,{className:"text-xs",children:"Direction"}),s.jsxs(bn,{value:S,onValueChange:B=>C(B),children:[s.jsx(hn,{className:"h-8 w-28 text-xs",children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"asc",children:"Ascending"}),s.jsx(Qe,{value:"desc",children:"Descending"})]})]})]})]}),s.jsx(Be,{children:s.jsxs(ze,{className:"space-y-3 pt-6",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",be.length," of ",o.length," test case",o.length!==1?"s":"","."]}),I&&!de&&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:I})," was not found."]}),o.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library test cases yet."}):be.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:be.map(B=>{const ie=I===B.id,he=`/libraries/test-cases/${encodeURIComponent(B.id)}`,Te=le(B.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${ie?"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(Ct,{to:he,className:"font-medium truncate hover:underline",children:B.name||B.id}),s.jsx(Ue,{variant:"outline",className:"font-mono text-[10px]",children:B.id}),ie&&s.jsx(Ue,{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:[Te.length," server",Te.length!==1?"s":""]}),s.jsxs("span",{children:[B.evalRules.length," eval rule",B.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[B.extractRules.length," extract rule",B.extractRules.length!==1?"s":""]})]}),Te.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:Te.map(Ye=>s.jsx(Ue,{variant:"secondary",className:"text-[10px]",children:Ye},`${B.id}-${Ye}`))})]}),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:()=>M(B),children:[s.jsx(Oa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ne(B)},children:[s.jsx(Cs,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(se,{type:"button",size:"sm",variant:ie?"default":"outline",asChild:!0,children:s.jsxs(Ct,{to:he,children:[s.jsx(rv,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},B.id)})})]})})]}),de&&A?s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Nt,{className:"text-base",children:["Edit Test Case ·"," ",s.jsx("code",{className:"font-mono text-muted-foreground",children:de.id})]}),s.jsx(Ue,{variant:"outline",className:`text-[10px] ${T==="saving"?"border-amber-300 text-amber-700":T==="saved"?"border-emerald-300 text-emerald-700":T==="error"?"border-destructive/40 text-destructive":T==="dirty"?"border-sky-300 text-sky-700":""}`,children:T==="saving"?"Saving...":T==="saved"?"Saved":T==="error"?"Save failed":T==="dirty"?"Unsaved changes":"Ready"})]}),T==="error"&&L&&s.jsx("div",{className:"text-[11px] text-destructive",children:L})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ne(A,!0)},children:[s.jsx(Cs,{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:()=>M(A),children:[s.jsx(Oa,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]})}),s.jsx(ze,{className:"pt-3",children:s.jsx(X1,{scenarios:[A],agents:c,servers:d,defaultAssistantAgentName:We,assistantInitialPromptByScenarioId:q&&A?.id?{[A.id]:q}:void 0,assistantAutoOpenNonceByScenarioId:A?.id&&G?{[A.id]:G}:void 0,onChange:B=>{const ie=B[0];ie&&(k(ie),U(ie))},allowAdd:!1})})]}):null,s.jsx(Ds,{open:!!R,onOpenChange:B=>!B&&M(null),children:s.jsxs(as,{children:[s.jsxs(ss,{children:[s.jsx(is,{children:"Delete test case?"}),s.jsxs(ls,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:R?.name||R?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(os,{children:[s.jsx(us,{children:"Cancel"}),s.jsx(cs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{R&&(ve(R),M(null))},children:"Delete Test Case"})]})]})})]})},qge=()=>{const{source:e}=$n(),{agents:t,reload:n,loading:r}=ns(),[a,o]=m.useState(!1),[i,c]=m.useState(!1),[d,f]=m.useState(""),h=m.useMemo(()=>d||t[0]?.name||"",[d,t]),p=m.useCallback(async()=>{o(!0);try{const j=await e.getWorkspaceSettings();f(j?.scenarioAssistantAgentName??"")}catch(j){f(""),Pe({title:"Could not load settings",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{o(!1)}},[e]);m.useEffect(()=>{p()},[p]);const g=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),Pe({title:"Settings updated",description:j?`Default assistant agent set to ${j}.`:"Default 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)}},x=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(fN,{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:()=>{x()},disabled:r||a,children:[s.jsx(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(Be,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Assistant Defaults"}),s.jsx(Ur,{children:"Default assistant agent used across assistant flows. If unset, MCP Lab uses the first available agent automatically."})]}),s.jsxs(ze,{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($e,{className:"text-xs",children:"Default Assistant Agent"}),s.jsxs(bn,{value:h||"__none__",onValueChange:j=>{g(j==="__none__"?"":j)},disabled:i,children:[s.jsx(hn,{className:"h-9 text-sm",children:s.jsx(wn,{placeholder:"Select assistant agent"})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(Qe,{value:j.id,children:[j.name||j.id," · ",j.model]},j.id))]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Applies to the assistant flows that use the workspace default. 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"})]})]})]})},Wge=fl("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"}}),Ui=m.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:Se(Wge({variant:t}),e),...n}));Ui.displayName="Alert";const qi=m.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Se("mb-1 font-medium leading-none tracking-tight",e),...t}));qi.displayName="AlertTitle";const Wi=m.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("text-sm [&_p]:leading-relaxed",e),...t}));Wi.displayName="AlertDescription";const Vge="127.0.0.1",Hge=3011,Kge="/mcp",Gge=`http://${Vge}:${Hge}${Kge}`;function Yge(e){return navigator.clipboard.writeText(e)}function h6({text:e,label:t}){const[n,r]=m.useState(!1),a=async()=>{try{await Yge(e),r(!0),Pe({title:"Copied",description:`${t} copied to clipboard.`}),window.setTimeout(()=>r(!1),1500)}catch(o){Pe({title:"Copy failed",description:o instanceof Error?o.message:String(o),variant:"destructive"})}};return s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},children:[s.jsx(Cs,{className:"mr-2 h-3.5 w-3.5"}),n?"Copied":"Copy"]})}function zj({label:e,value:t,copyText:n,valueClassName:r=""}){return s.jsx("div",{className:"rounded-lg border bg-muted/20 p-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:e}),s.jsx("div",{className:`mt-1 break-all text-sm font-medium ${r}`,children:t})]}),n&&s.jsx(h6,{text:n,label:e})]})})}function r$({title:e,description:t,code:n,iconSrc:r}){return s.jsxs(Be,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsxs(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx("img",{src:r,alt:"","aria-hidden":"true",className:"h-4 w-4"}),e]}),s.jsx(Ur,{children:t})]}),s.jsxs(ze,{className:"space-y-3",children:[s.jsx("pre",{className:"max-h-80 overflow-auto rounded-lg border bg-muted/30 p-3 text-xs whitespace-pre-wrap break-all",children:n}),s.jsx("div",{className:"flex justify-end",children:s.jsx(h6,{text:n,label:e})})]})]})}const Xge=()=>{const{source:e}=$n(),[t,n]=m.useState(!0),[r,a]=m.useState(null),o=m.useCallback(async()=>{n(!0);try{const p=await e.health();a(p)}catch(p){a(null),Pe({title:"Could not load MCP connection info",description:p instanceof Error?p.message:String(p),variant:"destructive"})}finally{n(!1)}},[e]);m.useEffect(()=>{o()},[o]);const i=r?.mcp?.enabled?r.mcp:null,c=i?.directUrl??Gge,d=i?.transport??"streamable-http",f=m.useMemo(()=>JSON.stringify({mcpServers:{mcplab:{command:"npx",args:["mcp-remote",c]}}},null,2),[c]),h=m.useMemo(()=>JSON.stringify({name:"mcplab",transport:d,url:c},null,2),[c,d]);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(Qj,{className:"h-6 w-6"}),"MCP Connection Info"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Copy the local MCPLab MCP server details into Claude Desktop or any MCP-capable client."})]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{o()},disabled:t,children:[s.jsx(ha,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),!i&&s.jsxs(Ui,{children:[s.jsx(Qj,{className:"h-4 w-4"}),s.jsx(qi,{children:"MCP server not reported"}),s.jsx(Wi,{children:"The page is showing the default local connection details. Start MCP Lab in dev mode to see the live runtime endpoint and package version."})]}),s.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1.1fr_0.9fr]",children:[s.jsxs(Be,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Connection Details"}),s.jsx(Ur,{children:"The local server is exposed over streamable HTTP."})]}),s.jsx(ze,{className:"space-y-3",children:s.jsxs("div",{className:"grid gap-3",children:[s.jsx(zj,{label:"Direct MCP URL",value:c,copyText:c}),s.jsx(zj,{label:"Transport",value:d}),s.jsx(zj,{label:"Authentication",value:"none"})]})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsx(r$,{title:"Claude Desktop",description:"Use mcp-remote to bridge Claude Desktop to the local streamable HTTP MCP server.",code:f,iconSrc:"/icons/claude-color.svg"}),s.jsx(r$,{title:"OpenAI / MCP-capable client",description:"Use this endpoint block in any client or adapter that accepts a single MCP-over-HTTP server.",code:h,iconSrc:"/icons/openai.svg"})]})]})]})};var Pg="Checkbox",[Jge]=pr(Pg),[Qge,t_]=Jge(Pg);function Zge(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:i,name:c,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:p}=e,[g,x]=pa({prop:n,defaultProp:a??!1,onChange:d,caller:Pg}),[j,b]=m.useState(null),[y,S]=m.useState(null),C=m.useRef(!1),N=j?!!i||!!j.closest("form"):!0,E={checked:g,disabled:o,setChecked:x,control:j,setControl:b,name:c,form:i,value:h,hasConsumerStoppedPropagationRef:C,required:f,defaultChecked:Yo(a)?!1:a,isFormControl:N,bubbleInput:y,setBubbleInput:S};return s.jsx(Qge,{scope:t,...E,children:exe(p)?p(E):r})}var m6="CheckboxTrigger",v6=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:o,value:i,disabled:c,checked:d,required:f,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:x,bubbleInput:j}=t_(m6,e),b=xt(a,h),y=m.useRef(d);return m.useEffect(()=>{const S=o?.form;if(S){const C=()=>p(y.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[o,p]),s.jsx(Ke.button,{type:"button",role:"checkbox","aria-checked":Yo(d)?"mixed":d,"aria-required":f,"data-state":w6(d),"data-disabled":c?"":void 0,disabled:c,value:i,...r,ref:b,onKeyDown:Re(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Re(n,S=>{p(C=>Yo(C)?!0:!C),j&&x&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})})});v6.displayName=m6;var n_=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:i,disabled:c,value:d,onCheckedChange:f,form:h,...p}=e;return s.jsx(Zge,{__scopeCheckbox:n,checked:a,defaultChecked:o,disabled:c,required:i,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:g})=>s.jsxs(s.Fragment,{children:[s.jsx(v6,{...p,ref:t,__scopeCheckbox:n}),g&&s.jsx(b6,{__scopeCheckbox:n})]})})});n_.displayName=Pg;var g6="CheckboxIndicator",x6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=t_(g6,n);return s.jsx(Kn,{present:r||Yo(o.checked)||o.checked===!0,children:s.jsx(Ke.span,{"data-state":w6(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});x6.displayName=g6;var y6="CheckboxBubbleInput",b6=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:i,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:g,setBubbleInput:x}=t_(y6,e),j=xt(n,x),b=mg(o),y=lv(r);m.useEffect(()=>{const C=g;if(!C)return;const N=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(N,"checked").set,k=!a.current;if(b!==o&&A){const T=new Event("click",{bubbles:k});C.indeterminate=Yo(o),A.call(C,Yo(o)?!1:o),C.dispatchEvent(T)}},[g,b,o,a]);const S=m.useRef(Yo(o)?!1:o);return s.jsx(Ke.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??S.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});b6.displayName=y6;function exe(e){return typeof e=="function"}function Yo(e){return e==="indeterminate"}function w6(e){return Yo(e)?"indeterminate":e?"checked":"unchecked"}const Gr=m.forwardRef(({className:e,...t},n)=>s.jsx(n_,{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(x6,{className:Se("flex items-center justify-center text-current"),children:s.jsx(wc,{className:"h-4 w-4"})})}));Gr.displayName=n_.displayName;function txe(e,t=[]){let n=[];function r(o,i){const c=m.createContext(i);c.displayName=o+"Context";const d=n.length;n=[...n,i];const f=p=>{const{scope:g,children:x,...j}=p,b=g?.[e]?.[d]||c,y=m.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:y,children:x})};f.displayName=o+"Provider";function h(p,g){const x=g?.[e]?.[d]||c,j=m.useContext(x);if(j)return j;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[f,h]}const a=()=>{const o=n.map(i=>m.createContext(i));return function(c){const d=c?.[e]||o;return m.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,nxe(a,...t)]}function nxe(...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(o){const i=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(o)[`__scope${f}`];return{...c,...p}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var rxe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],j6=rxe.reduce((e,t)=>{const n=yv(`Primitive.${t}`),r=m.forwardRef((a,o)=>{const{asChild:i,...c}=a,d=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),r_="Progress",a_=100,[axe]=txe(r_),[sxe,oxe]=axe(r_),S6=m.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:o=ixe,...i}=e;(a||a===0)&&!a$(a)&&console.error(lxe(`${a}`,"Progress"));const c=a$(a)?a:a_;r!==null&&!s$(r,c)&&console.error(cxe(`${r}`,"Progress"));const d=s$(r,c)?r:null,f=Qm(d)?o(d,c):void 0;return s.jsx(sxe,{scope:n,value:d,max:c,children:s.jsx(j6.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Qm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":_6(d,c),"data-value":d??void 0,"data-max":c,...i,ref:t})})});S6.displayName=r_;var N6="ProgressIndicator",C6=m.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=oxe(N6,n);return s.jsx(j6.div,{"data-state":_6(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});C6.displayName=N6;function ixe(e,t){return`${Math.round(e/t*100)}%`}function _6(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Qm(e){return typeof e=="number"}function a$(e){return Qm(e)&&!isNaN(e)&&e>0}function s$(e,t){return Qm(e)&&!isNaN(e)&&e<=t&&e>=0}function lxe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${a_}\`.`}function cxe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
136
|
-
- a positive number
|
|
137
|
-
- less than the value passed to \`max\` (or ${a_} if no \`max\` prop is set)
|
|
138
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
139
|
-
|
|
140
|
-
Defaulting to \`null\`.`}var A6=S6,uxe=C6;const kg=m.forwardRef(({className:e,value:t,...n},r)=>s.jsx(A6,{ref:r,className:Se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(uxe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));kg.displayName=A6.displayName;function E6(e){const t=e.toLowerCase();return t.includes("side-effectful prefix")||t.includes("destructive behavior")||t.includes("destructivehint")}function o$(e){try{return JSON.stringify(e,null,2)}catch{return"[schema not serializable]"}}const Pi=["critical","high","medium","low","info"];function Nh(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 dxe(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 i$(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tool"}function Uj({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(T7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function fxe({label:e,reason:t,variantClassName:n}){return s.jsx(su,{delayDuration:0,children:s.jsxs(ou,{children:[s.jsx(iu,{asChild:!0,children:s.jsx(Ue,{variant:"outline",className:n,children:e})}),s.jsx(pl,{className:"max-w-sm text-xs",children:s.jsx("p",{children:t})})]})})}function s_(e){const t=[],n=(r,a)=>{t.push(`#### ${r}`),t.push("```json");try{t.push(JSON.stringify(a,null,2))}catch{t.push('"[schema not serializable]"')}t.push("```")};if(t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),e.mcpServerVersions&&Object.keys(e.mcpServerVersions).length>0){const r=Object.entries(e.mcpServerVersions).map(([a,o])=>`${a}: ${o??"unknown"}`).join(", ");t.push(`- MCP Server Versions: ${r}`)}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 r of e.servers){t.push(`## Server: ${r.serverName}`),r.warnings.length>0&&t.push(...r.warnings.map(a=>`- Warning: ${a}`),"");for(const a of r.tools){if(t.push(`### ${a.publicToolName}`),a.title&&t.push(`- Title: ${a.title}`),t.push(`- Safety: ${a.safetyClassification} (${a.classificationReason})`),a.inputSchema!==void 0&&n("Input schema",a.inputSchema),a.outputSchema!==void 0&&n("Output schema",a.outputSchema),a.metadataReview?.issues.length){t.push("#### Metadata issues");for(const o of a.metadataReview.issues)t.push(` - [${o.severity}] ${o.title}: ${o.detail}`)}if(a.deeperAnalysis)if(!a.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${a.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${a.deeperAnalysis.sampleCalls.length}`);for(const o of a.deeperAnalysis.sampleCalls){t.push(` - Call ${o.callIndex}: ${o.ok?"ok":"error"}${o.durationMs?` (${o.durationMs}ms)`:""}`),o.error&&t.push(` - Error: ${o.error}`);for(const i of o.observations)t.push(` - ${i}`)}}if(a.overallRecommendations.length>0){t.push("#### Recommendations");for(const o of a.overallRecommendations)t.push(` - ${o}`)}if(a.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const o of a.metadataReview.evalReadinessNotes)t.push(` - ${o}`)}t.push("")}}return`${t.join(`
|
|
141
|
-
`)}
|
|
142
|
-
`}function P6({report:e}){const[t,n]=ni(),[r,a]=m.useState([...Pi]),[o,i]=m.useState(new Set),[c,d]=m.useState(""),[f,h]=m.useState(!1),p=t.get("groupBy")==="severity"?"severity":"tool",g=m.useRef(null),x=c.trim().toLowerCase(),j=m.useMemo(()=>new Set(r),[r]),b=O=>{a(L=>{const z=L.includes(O)?L.filter(q=>q!==O):[...L,O];return z.length===0?[...Pi]:z})},y=O=>{const L=new URLSearchParams(t);O==="severity"?L.set("groupBy","severity"):L.delete("groupBy"),n(L,{replace:!0})},S=m.useMemo(()=>{const O={critical:[],high:[],medium:[],low:[],info:[]};for(const L of e.servers)for(const z of L.tools){const q=`tool-${i$(`${L.serverName}-${z.publicToolName}`)}`,F=`${L.serverName}::${z.publicToolName}`,G=z.publicToolName.split("::").pop()??z.publicToolName;for(const W of z.metadataReview?.issues??[]){const R=W.severity;O[R].push({key:`${F}-metadata-${W.id}`,toolAnchorId:q,toolLabel:F,toolDisplayName:G,sourceLabel:"Metadata review",issue:{id:W.id,title:W.title,detail:W.detail,severity:R,suggestion:W.suggestion}})}for(const W of z.deeperAnalysis?.sampleCalls??[])for(const R of W.issues){const M=R.severity;O[M].push({key:`${F}-call-${W.callIndex}-${R.id}`,toolAnchorId:q,toolLabel:F,toolDisplayName:G,sourceLabel:`Sample call ${W.callIndex}`,issue:{id:R.id,title:R.title,detail:R.detail,severity:M,suggestion:R.suggestion}})}}return O},[e.servers]),C=m.useMemo(()=>Array.from(new Set(e.servers.flatMap(O=>O.tools.map(L=>L.publicToolName)).map(O=>O.split("::").pop()??O))).sort((O,L)=>O.localeCompare(L)),[e.servers]),N=O=>x.length===0?!0:(O.toLowerCase().split("::").pop()??O.toLowerCase()).includes(x),E=O=>{if(!g.current)return;g.current.querySelectorAll("details").forEach(z=>{z.open=O})},A=()=>i(new Set(Pi)),k=()=>i(new Set),T=O=>{i(L=>{const z=new Set(L);return z.has(O)?z.delete(O):z.add(O),z})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsx(Be,{children:s.jsxs(ze,{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(Be,{children:s.jsxs(ze,{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(Be,{children:s.jsxs(ze,{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(Be,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Analysis Overview"}),s.jsx(Ur,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),s.jsx(ze,{children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[Pi.filter(O=>e.summary.issueCounts[O]>0).map(O=>{const L=j.has(O);return s.jsx("button",{type:"button",onClick:()=>b(O),className:"rounded-full","aria-pressed":L,children:s.jsxs(Ue,{variant:"outline",className:`capitalize font-normal ${L?Nh(O):dxe(O)} ${L?"ring-1 ring-current":"opacity-70"}`,children:[O,": ",e.summary.issueCounts[O]]})},O)}),s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>a([...Pi]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsxs("div",{className:"space-y-0",children:[s.jsx(wg,{value:p,onValueChange:O=>{(O==="tool"||O==="severity")&&y(O)},className:"min-w-0 px-3 pt-1",children:s.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2 border-b",children:[s.jsxs(Gf,{className:"h-auto justify-start rounded-none bg-transparent p-0",children:[s.jsx(Ns,{value:"tool",className:"-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold 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:"Report by Tool"}),s.jsx(Ns,{value:"severity",className:"-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold 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:"By Severity"})]}),s.jsxs("div",{className:"mb-2 flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"whitespace-nowrap text-xs text-muted-foreground",children:"Filter tools"}),s.jsxs(Zc,{open:f,onOpenChange:h,children:[s.jsx(eu,{asChild:!0,children:s.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":f,className:"h-8 w-[320px] max-w-full justify-between text-xs font-normal",children:[s.jsx("span",{className:"truncate text-left",children:c||"All tools"}),s.jsx(Kt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(rl,{className:"w-[320px] p-0",align:"end",children:s.jsxs(sl,{children:[s.jsx(ol,{placeholder:"Search tools..."}),s.jsxs(il,{children:[s.jsx(ll,{children:"No tools found."}),s.jsxs(cl,{children:[s.jsx(ca,{value:"all tools",onSelect:()=>{d(""),h(!1)},children:"All tools"}),C.map(O=>s.jsx(ca,{value:O,onSelect:()=>{d(O),h(!1)},children:O},O))]})]})]})})]}),p==="severity"&&s.jsxs(s.Fragment,{children:[s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:k,children:"Expand all"}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:A,children:"Collapse all"})]}),p==="tool"&&s.jsxs(s.Fragment,{children:[s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!0),children:"Expand all"}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!1),children:"Collapse all"})]})]})]})}),p==="severity"?s.jsx("div",{className:"space-y-4",children:Pi.filter(O=>j.has(O)).map(O=>{const L=S[O].filter(q=>N(q.toolLabel));if(L.length===0)return null;const z=o.has(O);return s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base capitalize",children:O}),s.jsxs(Ur,{children:[L.length," finding(s)"]})]}),s.jsx("div",{className:"flex gap-2",children:s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>T(O),children:z?"Expand":"Collapse"})})]})}),!z&&s.jsx(ze,{className:"space-y-2",children:L.map((q,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:q.issue.title})]}),s.jsx(Ue,{variant:"outline",className:`shrink-0 text-[10px] ${Nh(q.issue.severity)}`,children:q.issue.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",q.issue.detail]}),s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px]",children:[s.jsx(Ue,{variant:"secondary",className:"font-normal",children:q.sourceLabel}),s.jsx(se,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 font-mono text-[11px]",title:q.toolLabel,onClick:()=>{y("tool"),requestAnimationFrame(()=>{document.getElementById(q.toolAnchorId)?.scrollIntoView({behavior:"smooth",block:"start"})})},children:q.toolDisplayName})]}),q.issue.suggestion&&s.jsx(Uj,{text:q.issue.suggestion})]},q.key))})]},O)})}):s.jsx("div",{ref:g,className:"space-y-4",children:e.servers.map(O=>{const L=O.tools.filter(z=>{const q=`${O.serverName}::${z.publicToolName}`;if(!N(q))return!1;const F=[...z.metadataReview?.issues??[],...z.deeperAnalysis?.sampleCalls.flatMap(G=>G.issues)??[]];return F.length===0?r.length===Pi.length:F.some(G=>j.has(G.severity))});return L.length===0?null:s.jsxs(Be,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:O.serverName}),s.jsxs(Ur,{children:["Discovered ",O.toolCountDiscovered," · Showing ",L.length," of ",O.toolCountAnalyzed," analyzed · Skipped ",O.toolCountSkipped]})]}),s.jsxs(ze,{className:"space-y-3",children:[O.warnings.length>0&&s.jsxs(Ui,{children:[s.jsx(qi,{children:"Warnings"}),s.jsx(Wi,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:O.warnings.map(z=>s.jsx("li",{children:z},`${O.serverName}-${z}`))})})]}),L.map(z=>{const q=z.publicToolName.split("::").pop()??z.publicToolName,F=E6(z.classificationReason),G=z.safetyClassification==="read_like"?"read-like":F?"write/delete":"unsafe/unknown",W=z.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":F?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return s.jsxs("details",{id:`tool-${i$(`${O.serverName}-${z.publicToolName}`)}`,className:"group rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("div",{className:"min-w-0 truncate font-mono text-sm",title:z.publicToolName,children:q}),s.jsx(fxe,{label:G,reason:z.classificationReason,variantClassName:W})]}),s.jsx(Kt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),z.title&&s.jsx("p",{className:"text-sm text-foreground/85",children:z.title}),z.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:z.description})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[(z.inputSchema!==void 0||z.outputSchema!==void 0)&&s.jsxs("details",{className:"group/schema rounded border bg-muted/10 p-2",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 text-xs font-medium",children:[s.jsx("span",{children:"Schemas"}),s.jsx(Kt,{className:"h-4 w-4 text-muted-foreground transition-transform group-open/schema:rotate-180"})]}),s.jsxs("div",{className:"mt-2 space-y-2",children:[z.inputSchema!==void 0&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Input schema"}),s.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:o$(z.inputSchema)})]}),z.outputSchema!==void 0&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Output schema"}),s.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:o$(z.outputSchema)})]})]})]}),z.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),z.metadataReview.issues.filter(R=>j.has(R.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:z.metadataReview.issues.filter(R=>j.has(R.severity)).map((R,M)=>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:M+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:R.title})]}),s.jsx(Ue,{variant:"outline",className:`shrink-0 text-[10px] ${Nh(R.severity)}`,children:R.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",R.detail]}),R.suggestion&&s.jsx(Uj,{text:R.suggestion})]},R.id))})]}),z.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),z.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:z.deeperAnalysis.sampleCalls.map(R=>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(Ue,{variant:R.ok?"secondary":"destructive",className:"text-[10px]",children:R.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",R.callIndex]}),R.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[R.durationMs,"ms"]})]}),R.error&&s.jsx("p",{className:"text-destructive",children:R.error}),R.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:R.observations.map((M,K)=>s.jsx("li",{children:M},`${z.publicToolName}-obs-${R.callIndex}-${K}`))})]}),R.issues.filter(M=>j.has(M.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:R.issues.filter(M=>j.has(M.severity)).map((M,K)=>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:K+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:M.title})]}),s.jsx(Ue,{variant:"outline",className:`shrink-0 text-[10px] ${Nh(M.severity)}`,children:M.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",M.detail]}),M.suggestion&&s.jsx(Uj,{text:M.suggestion})]},`${R.callIndex}-${M.id}`))})]},`${z.publicToolName}-call-${R.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:z.deeperAnalysis.skippedReason??"Skipped"})]})]})]},z.publicToolName)})]})]},O.serverName)})})]})]})}function pxe(e){let t=0;const n=new Set,r=new Set;for(const o of e){const i=typeof o.payload?.message=="string"?o.payload.message:"";if(!i)continue;const c=i.match(/\((\d+)\s+selected\s+of\s+\d+\s+discovered\)/i);c&&(t=Math.max(t,Number(c[1])||0));const d=i.match(/^Started\s+(.+)$/);d&&n.add(d[1]);const f=i.match(/^Finished\s+(.+)$/);f&&r.add(f[1])}const a=t>0?Math.max(0,Math.min(100,Math.round(r.size/t*100))):0;return{totalTools:t,startedTools:n.size,finishedTools:r.size,percent:a}}const qj="mcplab.toolAnalysis.activeJobId";function l$(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,o.click(),URL.revokeObjectURL(a)}function c$({text:e}){return s.jsxs(ou,{children:[s.jsx(iu,{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(S7,{className:"h-3.5 w-3.5"})})}),s.jsx(pl,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function hxe(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}function mxe({label:e,reason:t,variantClassName:n}){return s.jsx(su,{delayDuration:0,children:s.jsxs(ou,{children:[s.jsx(iu,{asChild:!0,children:s.jsx(Ue,{variant:"outline",className:n,children:e})}),s.jsx(pl,{className:"max-w-sm text-xs",children:s.jsx("p",{children:t})})]})})}const vxe=()=>{const{source:e}=$n(),{servers:t,agents:n,loading:r,reload:a}=ns(),[o,i]=m.useState(""),[c,d]=m.useState([]),[f,h]=m.useState(!1),[p,g]=m.useState([]),[x,j]=m.useState({}),[b,y]=m.useState(""),[S,C]=m.useState(!0),[N,E]=m.useState(!1),[A,k]=m.useState(2),[T,O]=m.useState(1),[L,z]=m.useState(1e4),[q,F]=m.useState(null),[G,W]=m.useState([]),[R,M]=m.useState(null),[K,V]=m.useState(null),[D,J]=m.useState(!1),[H,I]=m.useState("configure"),[te,de]=m.useState("idle"),[fe,me]=m.useState(!1),U=m.useRef(null),oe=m.useRef(null),re=o||n[0]?.name||"",ne=m.useMemo(()=>pxe(G),[G]);m.useEffect(()=>{let ee=!0;return e.getWorkspaceSettings().then(Ee=>{!ee||!Ee||i(Ee.scenarioAssistantAgentName??"")}).catch(()=>{ee&&i("")}),()=>{ee=!1}},[e]),m.useEffect(()=>()=>{U.current?.()},[]),m.useEffect(()=>{const ee=oe.current;ee&&requestAnimationFrame(()=>{ee.scrollTop=ee.scrollHeight})},[G.length]);const ve=()=>{try{sessionStorage.removeItem(qj)}catch{}},le=ee=>{try{sessionStorage.setItem(qj,ee)}catch{}},Ae=ee=>{U.current?.(),U.current=e.subscribeToolAnalysisJob(ee,Ee=>{if(W(Ne=>[...Ne,Ee]),Ee.type==="completed")e.getToolAnalysisResult(ee).then(Ne=>{M(Ne.report),V(Ne.savedReportId??null)}).catch(Ne=>Pe({title:"Could not load analysis report",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})).finally(()=>{ve(),F(null),J(!1),de("idle"),I("run")});else if(Ee.type==="error"){const Ne=String(Ee.payload?.message??"");ve(),de(Ne.toLowerCase().includes("abort")?"stopped":"error"),F(null),J(!1)}})};m.useEffect(()=>{if(q||R)return;let ee="";try{ee=sessionStorage.getItem(qj)??""}catch{ee=""}if(ee)return I("run"),de("running"),J(!0),F(ee),W([]),Ae(ee),()=>{}},[e,q,R]);const be=async()=>{if(c.length===0){g([]),j({});return}const ee=c.filter(Ee=>t.find(Ge=>Ge.id===Ee)?.authType==="oauth2");try{ee.length>0&&(me(!0),await nl({serverNames:ee,source:e,onServerAuthStart:Ee=>{Pe({title:`OAuth login required for ${Ee}`,description:"Complete login in the opened browser tab. Discovery will continue automatically."})}}))}catch(Ee){Pe({title:"OAuth login failed",description:Ee instanceof Error?Ee.message:String(Ee),variant:"destructive"}),me(!1);return}finally{me(!1)}h(!0);try{const Ee=await e.discoverToolsForAnalysis({serverNames:c});g(Ee.servers),j(Ne=>{const Ge={};for(const _e of Ee.servers){const Le=Ne[_e.serverName]??[],Lt=_e.tools.map(Sn=>Sn.name),cn=Le.filter(Sn=>Lt.includes(Sn));Ge[_e.serverName]=cn.length>0?cn:Lt}return Ge})}catch(Ee){Pe({title:"Could not discover MCP tools",description:Ee instanceof Error?Ee.message:String(Ee),variant:"destructive"})}finally{h(!1)}};m.useEffect(()=>{be()},[c.join("|")]);const We=m.useMemo(()=>{const ee=b.trim().toLowerCase();return ee?p.map(Ee=>({...Ee,tools:Ee.tools.filter(Ne=>Ne.name.toLowerCase().includes(ee)||(Ne.description||"").toLowerCase().includes(ee))})).filter(Ee=>Ee.tools.length>0):p},[p,b]),B=m.useMemo(()=>Object.values(x).reduce((ee,Ee)=>ee+Ee.length,0),[x]),ie=c[0]??"",he=async()=>{if(!S&&!N){Pe({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Pe({title:"Select exactly one server",variant:"destructive"});return}if(B===0){Pe({title:"Select at least one tool",variant:"destructive"});return}J(!0),W([]),M(null),V(null),I("run"),de("running");try{const ee=c[0];t.find(Ge=>Ge.id===ee)?.authType==="oauth2"&&(me(!0),await nl({serverNames:[ee],source:e,onServerAuthStart:Ge=>{Pe({title:`OAuth login required for ${Ge}`,description:"Complete login in the opened browser tab. Analysis will continue automatically."})}}));const{jobId:Ne}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:x,maxParallelTools:A,modes:{metadataReview:S,deeperAnalysis:N},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:T,toolCallTimeoutMs:L}});F(Ne),le(Ne),Ae(Ne)}catch(ee){J(!1),de("error"),I("run"),Pe({title:"Could not start tool analysis",description:ee instanceof Error?ee.message:String(ee),variant:"destructive"})}finally{me(!1)}},Te=async()=>{if(!q)return;const ee=q;try{const Ee=await e.stopToolAnalysis(ee);if(Ee.status==="completed"){U.current?.(),U.current=null;const Ne=await e.getToolAnalysisResult(ee);M(Ne.report),V(Ne.savedReportId??null),ve(),F(null),J(!1),de("idle"),I("run"),Pe({title:"Analysis already finished",description:"Showing the result overview."});return}if(Ee.status==="stopped"){U.current?.(),U.current=null,ve(),F(null),J(!1),de("stopped"),Pe({title:"Analysis stopped"});return}if(Ee.status==="error"){U.current?.(),U.current=null,ve(),F(null),J(!1),de("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(Ee){Pe({title:"Could not stop analysis",description:Ee instanceof Error?Ee.message:String(Ee),variant:"destructive"})}},Ye=()=>{I("configure"),de("idle"),F(null)},ut=(ee,Ee)=>{d(Ne=>Ee?[ee]:Ne.filter(Ge=>Ge!==ee))},dt=(ee,Ee,Ne)=>{j(Ge=>{const _e=new Set(Ge[ee]??[]);return Ne?_e.add(Ee):_e.delete(Ee),{...Ge,[ee]:Array.from(_e)}})},ht=(ee,Ee)=>{j(Ne=>({...Ne,[ee]:Ee}))},jt=!0,It=q!==null||G.length>0||te==="stopped"||te==="error",Dt=!!R,qt=ee=>{if(ee==="configure"&&jt){I("configure");return}if(ee==="run"&&It){I("run");return}ee==="report"&&Dt&&I("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(eD,{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:()=>qt("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Ue,{variant:H==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>qt("run"),disabled:!It,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Ue,{variant:H==="run"?"default":"outline",className:It?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>qt("report"),disabled:!Dt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Ue,{variant:H==="report"?"default":"outline",className:Dt?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),H==="configure"&&s.jsxs(Be,{children:[s.jsxs(St,{children:[s.jsx(Nt,{className:"text-base",children:"Run MCP analysis"}),s.jsx(Ur,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(ze,{className:"space-y-5",children:[!re&&s.jsxs(Ui,{children:[s.jsx(qi,{children:"No assistant agent available"}),s.jsxs(Wi,{children:["Add a library agent in"," ",s.jsx(Ct,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(Ct,{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($e,{className:"text-xs",children:"Servers"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r||fe,children:[s.jsx(ha,{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(ee=>{const Ee=c.includes(ee.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(Gr,{checked:Ee,onCheckedChange:Ne=>ut(ee.id,!!Ne)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:ee.name||ee.id}),ee.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:ee.url})]})]},ee.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($e,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(dN,{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(pt,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:ee=>y(ee.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($e,{className:"text-xs",children:ie?`Tools for ${ie}`:"Tools"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{be()},disabled:f||fe||c.length===0,children:[f&&s.jsx(wr,{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..."}):We.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):We.map(ee=>{const Ee=new Set(x[ee.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:ee.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>ht(ee.serverName,ee.tools.map(Ne=>Ne.name)),children:"Select all"}),s.jsx(se,{type:"button",size:"sm",variant:"ghost",onClick:()=>ht(ee.serverName,[]),children:"Clear"})]})]}),ee.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:ee.warnings.map(Ne=>s.jsx("div",{className:"text-xs text-amber-700",children:hxe(ee.serverName,Ne)},`${ee.serverName}-${Ne}`))}),s.jsx("div",{className:"grid gap-2",children:ee.tools.map(Ne=>{const Ge=E6(Ne.classificationReason),_e=Ne.safetyClassification==="read_like"?"read-like":Ge?"write/delete":"unsafe/unknown",Le=Ne.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":Ge?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700";return s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(Gr,{checked:Ee.has(Ne.name),onCheckedChange:Lt=>dt(ee.serverName,Ne.name,!!Lt)}),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:Ne.name}),Ne.title&&s.jsx("span",{className:"text-xs text-muted-foreground",children:Ne.title}),s.jsx(mxe,{label:_e,reason:Ne.classificationReason,variantClassName:Le}),Ne.inputSchema&&s.jsx(Ue,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: input"}),Ne.outputSchema&&s.jsx(Ue,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: output"})]}),Ne.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ne.description})]})]},`${ee.serverName}-${Ne.name}`)})})]},ee.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",B]})]}),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(Gr,{checked:S,onCheckedChange:ee=>C(!!ee)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(c$,{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(Gr,{checked:N,onCheckedChange:ee=>E(!!ee)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(c$,{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($e,{className:"text-xs",children:"Max parallel tools"}),s.jsx(pt,{type:"number",min:1,max:8,value:A,onChange:ee=>k(Math.max(1,Math.min(8,Number(ee.target.value)||2))),className:"h-8"})]}),N?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{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($e,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(pt,{type:"number",min:1,max:5,value:T,onChange:ee=>O(Math.max(1,Math.min(5,Number(ee.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(pt,{type:"number",min:1e3,max:6e4,step:500,value:L,onChange:ee=>z(Math.max(1e3,Math.min(6e4,Number(ee.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:()=>{he()},disabled:D||fe||!!q,children:[(D||!!q)&&s.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),H==="run"&&s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(Ur,{children:q?"Live tool-analysis job events:":R?"Analysis finished. Review the summary below or open the saved report details.":te==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":te==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),q?s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Te()},children:"Stop Analysis"}):s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Ye,children:"Back to Configure Analysis"})]})}),s.jsxs(ze,{className:"space-y-2",children:[q&&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(wr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(ne.totalTools>0||q)&&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:ne.totalTools>0?`${ne.finishedTools}/${ne.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:ne.totalTools>0?`${ne.percent}%`:"0%"})]}),s.jsx(kg,{value:ne.totalTools>0?ne.percent:0,className:"h-2"})]}),G.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:q?"Starting analysis...":"No progress events captured."}):s.jsx("div",{ref:oe,className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:G.map((ee,Ee)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ee.ts).toLocaleTimeString()}),s.jsx(Ue,{variant:"outline",className:"mr-2 text-[10px]",children:ee.type}),s.jsx("span",{className:"break-all",children:typeof ee.payload.message=="string"?ee.payload.message:JSON.stringify(ee.payload)})]},`${ee.ts}-${Ee}`))}),!q&&R&&s.jsx(Be,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:s.jsxs(ze,{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:[R.summary.toolsAnalyzed," tools analyzed, ",R.summary.toolsSkipped," skipped, across"," ",R.summary.serversAnalyzed," server",R.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[K&&s.jsx(se,{asChild:!0,size:"sm",children:s.jsx(Ct,{to:`/tool-analysis-results/${K}`,children:"Open result details"})}),s.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(Ct,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>qt("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.summary.issueCounts.critical>0&&s.jsxs(Ue,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",R.summary.issueCounts.critical]}),R.summary.issueCounts.high>0&&s.jsxs(Ue,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",R.summary.issueCounts.high]}),R.summary.issueCounts.medium>0&&s.jsxs(Ue,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",R.summary.issueCounts.medium]}),R.summary.issueCounts.low>0&&s.jsxs(Ue,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",R.summary.issueCounts.low]}),R.summary.issueCounts.info>0&&s.jsxs(Ue,{variant:"outline",children:["Info: ",R.summary.issueCounts.info]}),Object.values(R.summary.issueCounts).every(ee=>ee===0)&&s.jsx(Ue,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),H==="report"&&R&&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:[R.summary.toolsAnalyzed," tools analyzed across ",R.summary.serversAnalyzed," server",R.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:Ye,children:"Back to Configure Analysis"}),K&&s.jsxs(s.Fragment,{children:[s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(Ct,{to:`/tool-analysis-results/${K}`,children:"Open saved report"})}),s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(Ct,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>l$(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(R,null,2)}
|
|
143
|
-
`,"application/json"),children:[s.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>l$(`tool-analysis-${Date.now()}.md`,s_(R),"text/markdown"),children:[s.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(P6,{report:R})]})]})};function u$(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,o.click(),URL.revokeObjectURL(a)}function gxe(){const{source:e}=$n(),[t,n]=m.useState([]),[r,a]=m.useState(!0),[o,i]=m.useState(null),[c,d]=m.useState(!1),[f,h]=m.useState("all"),[p,g]=m.useState(!1),x=async()=>{a(!0);try{n(await e.listToolAnalysisResults())}catch(N){Pe({title:"Could not load tool analysis results",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{a(!1)}};m.useEffect(()=>{x()},[]);const j=m.useMemo(()=>Array.from(new Set(t.flatMap(N=>N.serverNames))).sort((N,E)=>N.localeCompare(E)),[t]),b=m.useMemo(()=>f==="all"?t:t.filter(N=>N.serverNames.includes(f)),[t,f]),y=m.useMemo(()=>t.find(N=>N.reportId===o)??null,[t,o]),S=async()=>{if(o){d(!0);try{await e.deleteToolAnalysisSavedResult(o),n(N=>N.filter(E=>E.reportId!==o)),Pe({title:"Tool analysis report deleted"}),i(null)}catch(N){Pe({title:"Could not delete report",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{d(!1)}}},C=async(N,E)=>{try{const A=await e.getToolAnalysisSavedResult(N);E==="json"?u$(`${N}.json`,`${JSON.stringify(A,null,2)}
|
|
144
|
-
`,"application/json"):u$(`${N}.md`,s_(A.report),"text/markdown")}catch(A){Pe({title:"Could not export saved report",description:A instanceof Error?A.message:String(A),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(tD,{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.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP server"}),s.jsxs(Zc,{open:p,onOpenChange:g,children:[s.jsx(eu,{asChild:!0,children:s.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":p,className:"h-9 w-[240px] justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:f==="all"?"All servers":f}),s.jsx(Kt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(rl,{className:"w-[240px] p-0",align:"start",children:s.jsxs(sl,{children:[s.jsx(ol,{placeholder:"Search MCP servers..."}),s.jsxs(il,{children:[s.jsx(ll,{children:"No servers found."}),s.jsxs(cl,{children:[s.jsx(ca,{value:"all servers",onSelect:()=>{h("all"),g(!1)},children:"All servers"}),j.map(N=>s.jsx(ca,{value:N,onSelect:()=>{h(N),g(!1)},children:N},N))]})]})]})})]})]}),s.jsx(se,{variant:"outline",onClick:()=>{x()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(se,{asChild:!0,variant:"outline",children:s.jsx(Ct,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx(Be,{children:s.jsx(ze,{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(s.Fragment,{children:[s.jsx("div",{className:"border-b px-4 py-3",children:s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",s.jsx("span",{className:"font-medium text-foreground",children:b.length})," of"," ",s.jsx("span",{className:"font-medium text-foreground",children:t.length})," reports"]})}),b.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No reports for the selected MCP server."}):s.jsxs(qr,{children:[s.jsx(Wr,{children:s.jsxs(Vt,{children:[s.jsx(tt,{children:"Report ID"}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:"Timestamp"}),s.jsx(tt,{children:"Issues"}),s.jsx(tt,{children:"Modes"}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Vr,{children:b.map(N=>s.jsxs(Vt,{children:[s.jsx(Fe,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ct,{to:`/tool-analysis-results/${N.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:N.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[N.assistantAgentName," · ",N.assistantAgentModel]})]})}),s.jsx(Fe,{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:N.serverNames.length})," · Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsAnalyzed})," · ","Skipped: ",s.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsSkipped})]}),s.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[N.serverNames.slice(0,2).join(", "),N.serverNames.length>2?` +${N.serverNames.length-2}`:""]})]})}),s.jsx(Fe,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(uo,{className:"h-3 w-3"}),new Date(N.createdAt).toLocaleString()]})}),s.jsx(Fe,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(E=>N.summary.issueCounts[E]>0?s.jsxs(Ue,{variant:"outline",className:"capitalize",children:[E,": ",N.summary.issueCounts[E]]},`${N.reportId}-${E}`):null),Object.values(N.summary.issueCounts).every(E=>E===0)&&s.jsx(Ue,{variant:"outline",children:"No issues"})]})}),s.jsx(Fe,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[N.modes.metadataReview&&s.jsx(Ue,{variant:"outline",children:"metadata"}),N.modes.deeperAnalysis&&s.jsx(Ue,{variant:"outline",children:"deeper"})]})}),s.jsx(Fe,{children:s.jsxs(Hf,{children:[s.jsx(Kf,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(nv,{className:"h-4 w-4"})})}),s.jsxs(bu,{align:"end",children:[s.jsx(Kr,{asChild:!0,children:s.jsx(Ct,{to:`/tool-analysis-results/${N.reportId}`,children:"View"})}),s.jsxs(Kr,{onSelect:()=>{C(N.reportId,"json")},children:[s.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(Kr,{onSelect:()=>{C(N.reportId,"markdown")},children:[s.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(Kr,{className:"text-destructive",onSelect:E=>{E.preventDefault(),i(N.reportId)},children:[s.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},N.reportId))})]})]})})}),s.jsx(Ds,{open:!!o,onOpenChange:N=>!N&&i(null),children:s.jsxs(as,{children:[s.jsxs(ss,{children:[s.jsx(is,{children:"Delete tool analysis report?"}),s.jsx(ls,{children:y?`Delete saved report '${y.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),s.jsxs(os,{children:[s.jsx(us,{disabled:c,children:"Cancel"}),s.jsx(cs,{onClick:N=>{N.preventDefault(),S()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function d$(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=e,o.click(),URL.revokeObjectURL(a)}function xxe(){const{id:e=""}=hl(),t=Ia(),{source:n}=$n(),[r,a]=m.useState(null),[o,i]=m.useState(!0),[c,d]=m.useState(!1),[f,h]=m.useState(!1),[p,g]=m.useState(!1);m.useEffect(()=>{let j=!0;return i(!0),d(!1),n.getToolAnalysisSavedResult(e).then(b=>{j&&a(b)}).catch(b=>{if(!j)return;const y=b instanceof Error?b.message:String(b);if(y.includes("(404)")){d(!0),a(null);return}Pe({title:"Could not load saved tool analysis report",description:y,variant:"destructive"})}).finally(()=>{j&&i(!1)}),()=>{j=!1}},[e,n]);const x=async()=>{g(!0);try{await n.deleteToolAnalysisSavedResult(e),Pe({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Pe({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{g(!1),h(!1)}};return o?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(Ct,{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-xs text-muted-foreground",children:[s.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[s.jsx(uo,{className:"h-3 w-3 shrink-0"}),new Date(r.createdAt).toLocaleString()]})," ","· ",r.serverNames.join(", ")||"—"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.report.mcpServerVersions&&Object.keys(r.report.mcpServerVersions).length>0&&s.jsxs("span",{className:"inline-flex items-center align-middle rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] leading-none text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"MCP:"}),s.jsx("span",{className:"ml-1 font-mono",children:Object.entries(r.report.mcpServerVersions).map(([j,b])=>`${j}: ${b??"unknown"}`).join(", ")})]}),s.jsx(se,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(Ct,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>d$(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
145
|
-
`,"application/json"),children:[s.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>d$(`${r.reportId}.md`,s_(r.report),"text/markdown"),children:[s.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(Oa,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(P6,{report:r.report}),s.jsx(Ds,{open:f,onOpenChange:h,children:s.jsxs(as,{children:[s.jsxs(ss,{children:[s.jsx(is,{children:"Delete tool analysis report?"}),s.jsxs(ls,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(os,{children:[s.jsx(us,{disabled:p,children:"Cancel"}),s.jsx(cs,{onClick:j=>{j.preventDefault(),x()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const yxe=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function Nr({text:e}){return s.jsx(su,{delayDuration:200,children:s.jsxs(ou,{children:[s.jsx(iu,{type:"button",className:"inline-flex shrink-0 items-center",onClick:t=>t.preventDefault(),children:s.jsx(k7,{className:"h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground"})}),s.jsx(pl,{className:"max-w-xs text-xs leading-relaxed",children:e})]})})}function f$(e){return navigator.clipboard.writeText(e)}function Wj(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function bxe(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(`
|
|
146
|
-
`)}
|
|
147
|
-
`}function wxe(){const{source:e}=$n(),{servers:t,reload:n,loading:r}=ns(),[a,o]=m.useState("configure"),[i,c]=m.useState(""),[d,f]=m.useState("pre_registered"),[h,p]=m.useState("local_callback"),[g,x]=m.useState(!0),[j,b]=m.useState(!0),[y,S]=m.useState(!0),[C,N]=m.useState(""),[E,A]=m.useState(""),[k,T]=m.useState(""),[O,L]=m.useState(""),[z,q]=m.useState("__default__"),[F,G]=m.useState("{}"),[W,R]=m.useState(""),[M,K]=m.useState(""),[V,D]=m.useState(""),[J,H]=m.useState(""),[I,te]=m.useState(""),[de,fe]=m.useState(""),[me,U]=m.useState(""),[oe,re]=m.useState(""),[ne,ve]=m.useState(null),[le,Ae]=m.useState(null),[be,We]=m.useState([]),[B,ie]=m.useState(!1),[he,Te]=m.useState(!1),[Ye,ut]=m.useState(!1),[dt,ht]=m.useState("all"),[jt,It]=m.useState("all"),[Dt,qt]=m.useState("inspector"),ee=m.useRef(null),Ee=m.useRef(null),Ne=m.useRef(!1),Ge=m.useRef(j);m.useEffect(()=>{Ge.current=j},[j]),m.useEffect(()=>()=>{ee.current?.(),ee.current=null},[]),m.useEffect(()=>{Ee.current?.scrollIntoView({behavior:"smooth",block:"end"})},[be.length]);const _e=m.useMemo(()=>t.filter(ue=>ue.authType==="oauth2").slice().sort((ue,nt)=>(ue.name||ue.id).localeCompare(nt.name||nt.id,void 0,{sensitivity:"base"})),[t]),Le=_e.find(ue=>ue.id===i);m.useEffect(()=>{i&&(_e.some(ue=>ue.id===i)||c(""))},[_e,i]),m.useEffect(()=>{Le&&(Le.oauthMode==="dcr"?(f("dcr"),T(""),L("")):(f("pre_registered"),T(Le.oauthClientId??""),L(Le.oauthClientSecret??"")),N(Le.oauthScope??""),H(Le.oauthAuthorizationUrl??""),te(Le.oauthTokenEndpoint??""))},[Le?.id]);const Lt=m.useMemo(()=>{const ue=ne?.stepStates.length??0,nt=ne?.stepStates.filter(mt=>mt.status==="completed"||mt.status==="skipped").length??0,bt=ne?.stepStates.filter(mt=>mt.status==="failed").length??0,Jt=ue>0?Math.round((nt+bt)/ue*100):0;return{total:ue,completed:nt,failed:bt,percent:Jt}},[ne]),cn=m.useMemo(()=>{const ue=ne?.network??[],nt=new Map,bt=[],Jt=mt=>`${mt.stepId}::${mt.label}::${mt.url}`;for(const mt of ue){if(mt.phase==="request"){const xo=bt.length;bt.push({key:mt.id,stepId:mt.stepId,label:mt.label,method:mt.method,url:mt.url,request:mt});const X=Jt(mt),xe=nt.get(X)??[];xe.push(xo),nt.set(X,xe);continue}const kn=Jt(mt),cr=nt.get(kn),ma=cr?.shift();if(typeof ma=="number"){bt[ma]={...bt[ma],response:mt},cr&&cr.length>0?nt.set(kn,cr):nt.delete(kn);continue}bt.push({key:mt.id,stepId:mt.stepId,label:mt.label,method:mt.method,url:mt.url,response:mt})}return bt.filter(mt=>dt!=="all"&&mt.stepId!==dt?!1:jt==="error"?typeof mt.response?.status=="number"&&mt.response.status>=400:jt==="ok"?typeof mt.response?.status=="number"&&mt.response.status<400:!0)},[ne?.network,dt,jt]),Sn=!!le,Or=!!(ne&&(ne.status==="completed"||ne.status==="error"||ne.status==="stopped")),we=m.useMemo(()=>{const ue=new Map;return(ne?.stepStates??[]).forEach((nt,bt)=>{ue.set(nt.id,bt+1)}),ue},[ne?.stepStates]),_t=ue=>{if(ue==="configure"||ue==="run"&&Sn||ue==="report"&&Or)return o(ue)},$t=()=>{let ue;if(d==="dcr"&&F.trim())try{ue=JSON.parse(F)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Le)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Le.id,overrides:{authorizationServerMetadataUrl:V||void 0,authorizationEndpoint:J||void 0,tokenEndpoint:I||void 0,registrationEndpoint:de||void 0,cimdUrl:W||void 0,resourceBaseUrl:me||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:k.trim(),clientSecret:O.trim()||void 0,tokenEndpointAuthMethod:z==="__default__"?void 0:z||void 0}:void 0,dcr:d==="dcr"?{metadata:ue,tokenEndpointAuthMethod:z==="__default__"?void 0:z||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:W||void 0,expectedClientId:M||void 0}:void 0},runtime:{redirectMode:h,scopes:C.split(/[,\s]+/).map(nt=>nt.trim()).filter(Boolean),resource:E.trim()||void 0,usePkce:y,codeChallengeMethod:"S256"},display:{showSensitiveValues:g}}},Wt=ue=>{ee.current?.(),ee.current=e.subscribeOAuthDebuggerSession(ue,nt=>{We(Jt=>[...Jt,nt]),(nt.type==="completed"||nt.type==="error"||nt.type==="stopped")&&ie(!1),e.getOAuthDebuggerSession(ue).then(Jt=>{ve(Jt.session),Jt.session.uiHints.authorizationUrl&&tn(`${Wj()}/api/oauth-debugger/sessions/${ue}/authorize`),Jt.session.status==="completed"&&o("report")}).catch(()=>{})})},tn=ue=>{!Ge.current||Ne.current||!ue||(Ne.current=!0,window.open(ue,"_blank","noopener,noreferrer"))},Gt=async()=>{Te(!0),Ne.current=!1;try{const ue=$t(),nt=await e.createOAuthDebuggerSession(ue);Ae(nt.sessionId),ve(nt.session),We([]),o("run"),Wt(nt.sessionId);const bt=await e.startOAuthDebuggerSession(nt.sessionId);ve(bt.session),ie(!0),(bt.session.status==="waiting_for_user"||bt.session.status==="waiting_for_browser_callback")&&(ie(!1),bt.session.uiHints.authorizationUrl&&tn(`${Wj()}/api/oauth-debugger/sessions/${nt.sessionId}/authorize`))}catch(ue){Pe({title:"Could not start OAuth Debugger session",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{Te(!1)}},hr=async()=>{if(le)try{Te(!0);const ue=await e.submitOAuthDebuggerManualCallback(le,{redirectUrl:oe.trim()||void 0});ve(ue.session),re(""),ie(!0)}catch(ue){Pe({title:"Could not submit callback",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{Te(!1)}},ft=async()=>{if(le){ut(!0);try{const ue=await e.stopOAuthDebuggerSession(le);if(ie(!1),ue.status!=="running"){const nt=await e.getOAuthDebuggerSession(le);ve(nt.session),nt.session.status==="completed"?o("report"):o("run")}}catch(ue){Pe({title:"Could not stop session",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{ut(!1)}}},Pt=async()=>{ee.current?.(),ee.current=null,ve(null),Ae(null),We([]),ie(!1),ut(!1),Te(!1),re(""),ht("all"),It("all"),qt("inspector"),o("run"),await Gt()},Rt=async ue=>{if(!(!le||!ne))try{const nt=await e.exportOAuthDebuggerSession(le,ue);let bt="";const Jt=ue==="json"?"json":ue==="raw"?"txt":"md";typeof nt=="string"?bt=nt:bt=`${JSON.stringify(nt,null,2)}
|
|
148
|
-
`;const mt=new Blob([bt],{type:"text/plain;charset=utf-8"}),kn=URL.createObjectURL(mt),cr=document.createElement("a");cr.href=kn,cr.download=`oauth-debugger-${le}.${Jt}`,cr.click(),URL.revokeObjectURL(kn)}catch(nt){if(ue==="markdown"){const bt=bxe(ne,be),Jt=new Blob([bt],{type:"text/markdown;charset=utf-8"}),mt=URL.createObjectURL(Jt),kn=document.createElement("a");kn.href=mt,kn.download=`oauth-debugger-${ne.id}.md`,kn.click(),URL.revokeObjectURL(mt);return}Pe({title:"Export failed",description:nt instanceof Error?nt.message:String(nt),variant:"destructive"})}},nn=le?`${Wj()}/api/oauth-debugger/sessions/${le}/authorize`:void 0,Fn=ue=>ue==="error"?"destructive":ue==="warning"?"outline":"secondary";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"OAuth Debugger"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile)."})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:yxe.map(ue=>{const nt=a===ue.id,bt=ue.id==="configure"||ue.id==="run"&&Sn||ue.id==="report"&⩔return s.jsx("button",{type:"button",onClick:()=>bt&&_t(ue.id),disabled:!bt,className:"rounded-full",children:s.jsx(Ue,{variant:nt?"default":"outline",className:bt?"":"opacity-50",children:ue.label})},ue.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base",children:"Target MCP Server"}),s.jsx(Ur,{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(ha,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),s.jsx(ze,{className:"space-y-3",children:s.jsxs("div",{className:"max-w-xl space-y-2",children:[s.jsx($e,{children:"MCP Server"}),s.jsxs(bn,{value:i,onValueChange:c,children:[s.jsx(hn,{children:s.jsx(wn,{placeholder:"Select an MCP server"})}),s.jsx(mn,{children:_e.map(ue=>s.jsx(Qe,{value:ue.id,children:ue.name||ue.id},ue.id))})]}),_e.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"}),"."]}),Le&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Le.transport," · ",Le.url||Le.command||"No URL/command"," · ",s.jsxs("span",{className:"text-primary",children:[Le.oauthMode==="dcr"?"DCR":"pre-registered"," fields pre-filled"]})]})]})})]}),s.jsxs(Be,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Client Registration Method"}),s.jsx(Ur,{children:"How your OAuth client is identified with the authorization server."})]}),s.jsxs(ze,{className:"space-y-3",children:[s.jsx("div",{className:"grid gap-2 md:grid-cols-3",children:[{id:"pre_registered",label:"Pre-registered client",hint:"You already have a client_id issued by the authorization server."},{id:"dcr",label:"Dynamic Client Registration",hint:"The server issues a client_id automatically at the start of the flow (RFC 7591)."},{id:"cimd",label:"Client ID Metadata Document",hint:"The client identifies itself via a hosted JSON metadata document at a public URL (RFC 9728)."}].map(ue=>s.jsxs("button",{type:"button",onClick:()=>f(ue.id),className:"rounded-md border p-3 text-left",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`h-2.5 w-2.5 shrink-0 rounded-full ${d===ue.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:ue.label})]}),s.jsx("p",{className:"mt-1 pl-5 text-xs text-muted-foreground",children:ue.hint})]},ue.id))}),s.jsx("div",{className:"grid gap-3 md:grid-cols-1",children:s.jsxs("div",{className:"max-w-md space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Redirect mode",s.jsx(Nr,{text:"Local callback (recommended): MCP Lab automatically captures the redirect after you log in — no copy-pasting needed. Manual: you complete the browser login and then paste the final redirect URL back here."})]}),s.jsxs(bn,{value:h,onValueChange:ue=>p(ue),children:[s.jsx(hn,{children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(Qe,{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.jsxs($e,{className:"text-xs flex items-center gap-1",children:["client_id",s.jsx(Nr,{text:"The unique identifier for your application, issued by the authorization server when you registered the client."})]}),s.jsx(pt,{value:k,onChange:ue=>T(ue.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["client_secret",s.jsx(Nr,{text:"Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint."})]}),s.jsx(pt,{value:O,onChange:ue=>L(ue.target.value),type:"password",placeholder:"optional"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["CIMD URL",s.jsx(Nr,{text:"A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client."})]}),s.jsx(pt,{value:W,onChange:ue=>R(ue.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Be,{children:[s.jsxs(St,{className:"pb-3",children:[s.jsx(Nt,{className:"text-base",children:"Runtime OAuth Inputs"}),s.jsx(Ur,{children:"Parameters sent in the authorization request."})]}),s.jsxs(ze,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Scopes"}),s.jsx(pt,{value:C,onChange:ue=>N(ue.target.value),placeholder:"openid profile email"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Space or comma separated. Leave empty to use scopes auto-discovered from the server metadata."})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(Gr,{checked:y,onCheckedChange:ue=>S(!!ue)}),s.jsxs($e,{className:"flex items-center gap-1",children:["Use PKCE (S256)",s.jsx(Nr,{text:"Proof Key for Code Exchange — generates a one-time code verifier so the authorization code can't be hijacked. Recommended for all clients; required for public clients."})]})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(Gr,{checked:j,onCheckedChange:ue=>b(!!ue)}),s.jsx($e,{children:"Auto-open browser when authorization URL is ready"})]})]})]}),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.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Token endpoint auth method",s.jsx(Nr,{text:"How your client authenticates when exchanging the authorization code for a token. Choose 'none' for public clients (no secret). Leave as server default if unsure."})]}),s.jsxs(bn,{value:z,onValueChange:q,children:[s.jsx(hn,{children:s.jsx(wn,{placeholder:"Server default (recommended)"})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"__default__",children:"Server default (let the server decide)"}),s.jsx(Qe,{value:"client_secret_basic",children:"client_secret_basic — credentials in Authorization header"}),s.jsx(Qe,{value:"client_secret_post",children:"client_secret_post — credentials in request body"}),s.jsx(Qe,{value:"none",children:"none — public client, no secret"}),s.jsx(Qe,{value:"private_key_jwt",children:"private_key_jwt — signed JWT assertion"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Use "server default" unless the server requires a specific method.'})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Resource / audience",s.jsx(Nr,{text:"Some servers (RFC 8707) require the target API's URI in the token request to scope the token. Only set this if your server explicitly requires it."})]}),s.jsx(pt,{value:E,onChange:ue=>A(ue.target.value),placeholder:"https://api.example.com"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Only needed for servers that use resource indicators."})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["DCR metadata JSON",s.jsx(Nr,{text:'Extra fields for the dynamic client registration request (RFC 7591), e.g. {"client_name": "My App"}. redirect_uris and grant_types are always added automatically.'})]}),s.jsx(ks,{value:F,onChange:ue=>G(ue.target.value),className:"min-h-32 font-mono text-xs"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional extra fields for the registration request body."})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Expected client_id",s.jsx(Nr,{text:"If you know what client_id the server should assign from the metadata document, enter it here for verification. Leave blank to accept whatever the server returns."})]}),s.jsx(pt,{value:M,onChange:ue=>K(ue.target.value),placeholder:"optional"})]}),s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("div",{className:"mb-1 text-sm font-medium",children:"Endpoint overrides"}),s.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Override specific endpoints if auto-discovery fails or you want to test against a specific URL. Leave blank to use what the server advertises."}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Authorization server metadata URL",s.jsx(Nr,{text:"The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path."})]}),s.jsx(pt,{value:V,onChange:ue=>D(ue.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Resource server base URL",s.jsx(Nr,{text:"The MCP server's base URL used to look up its /.well-known/oauth-protected-resource metadata. Override if the server uses a different base path."})]}),s.jsx(pt,{value:me,onChange:ue=>U(ue.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Authorization endpoint",s.jsx(Nr,{text:"The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata."})]}),s.jsx(pt,{value:J,onChange:ue=>H(ue.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Token endpoint",s.jsx(Nr,{text:"The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically."})]}),s.jsx(pt,{value:I,onChange:ue=>te(ue.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["Registration endpoint (DCR)",s.jsx(Nr,{text:"The URL used to dynamically register a new client (RFC 7591). Only relevant when using DCR. Override if the server doesn't advertise it in its metadata."})]}),s.jsx(pt,{value:de,onChange:ue=>fe(ue.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs($e,{className:"text-xs flex items-center gap-1",children:["CIMD URL override",s.jsx(Nr,{text:"Override the Client ID Metadata Document URL. Use this if the server doesn't discover it automatically or you want to test with a specific metadata document."})]}),s.jsx(pt,{value:W,onChange:ue=>R(ue.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Ui,{children:[s.jsx(yy,{className:"h-4 w-4"}),s.jsx(qi,{children:"Secrets display"}),s.jsxs(Wi,{className:"space-y-2",children:[s.jsx("p",{children:"By default, full tokens and secrets are visible in the network inspector and exports — useful for debugging but not for sharing."}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Gr,{checked:!g,onCheckedChange:ue=>x(ue===!1)}),s.jsx($e,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(se,{type:"button",onClick:()=>{Gt()},disabled:he,children:[he&&s.jsx(wr,{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(Be,{className:"xl:col-span-1 min-w-0",children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base",children:"Progress"}),s.jsx(Ur,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ne?.uiHints.authorizationUrl&&nn&&s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:nn,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Ih,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Pt()},disabled:he,children:[s.jsx(ha,{className:"mr-2 h-4 w-4"}),"Restart"]}),le&&s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{ft()},disabled:Ye||!le,children:[(Ye||B)&&Ye&&s.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(Ah,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),s.jsxs(ze,{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:[Lt.completed+Lt.failed,"/",Lt.total," steps"]}),s.jsxs("span",{children:[Lt.percent,"%"]})]}),s.jsx(kg,{value:Lt.percent,className:"h-2"})]}),ne?.status==="waiting_for_user"&&s.jsx(Be,{children:s.jsxs(ze,{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:oe,onChange:ue=>re(ue.target.value),placeholder:"Paste the final redirect URL (with code and state)",className:"min-h-24 text-xs font-mono"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(se,{type:"button",size:"sm",onClick:()=>{hr()},disabled:he||!oe.trim(),children:[he&&s.jsx(wr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),ne.uiHints.authorizationUrl&&nn&&s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:nn,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),ne?.status==="waiting_for_browser_callback"&&s.jsxs(Ui,{children:[s.jsx(yy,{className:"h-4 w-4"}),s.jsx(qi,{children:"Waiting for browser callback"}),s.jsxs(Wi,{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:ne.uiHints.callbackUrl}),ne.uiHints.authorizationUrl&&nn&&s.jsx("div",{className:"pt-2",children:s.jsx(se,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:nn,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(Ih,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:ne?.stepStates.map(ue=>{const nt=we.get(ue.id);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:"min-w-0 flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold",children:nt}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:ue.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:ue.description})]})]}),s.jsx(Ue,{variant:ue.status==="failed"?"destructive":ue.status==="completed"?"outline":ue.status==="active"?"secondary":"outline",className:ue.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:ue.status})]}),ue.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:ue.outcomeSummary})]},ue.id)})||s.jsx("p",{className:"text-sm text-muted-foreground",children:"No steps yet."})})]})]}),s.jsx("div",{className:"space-y-4 xl:col-span-1 min-w-0",children:s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Nt,{className:"text-base",children:"Inspect"}),s.jsx(Ur,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rt("raw")},disabled:!le||!ne,children:[s.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})}),s.jsx(ze,{className:"space-y-3",children:s.jsxs(wg,{value:Dt,onValueChange:ue=>qt(ue),className:"min-w-0",children:[s.jsxs(Gf,{className:"grid grid-cols-2",children:[s.jsx(Ns,{value:"inspector",children:"Network Inspector"}),s.jsx(Ns,{value:"events",children:"Live Debug"})]}),s.jsx(jf,{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:[be.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):be.map((ue,nt)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ue.ts).toLocaleTimeString()}),s.jsx(Ue,{variant:"outline",className:"mr-2 text-[10px]",children:ue.type}),typeof ue.payload.message=="string"?ue.payload.message:JSON.stringify(ue.payload)]},`${ue.ts}-${nt}`)),s.jsx("div",{ref:Ee})]})}),s.jsxs(jf,{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($e,{className:"text-xs",children:"Filter by step"}),s.jsxs(bn,{value:dt,onValueChange:ht,children:[s.jsx(hn,{className:"h-8",children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"all",children:"All steps"}),(ne?.stepStates??[]).map(ue=>s.jsxs(Qe,{value:ue.id,children:[we.get(ue.id),". ",ue.title]},ue.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Filter by status"}),s.jsxs(bn,{value:jt,onValueChange:It,children:[s.jsx(hn,{className:"h-8",children:s.jsx(wn,{})}),s.jsxs(mn,{children:[s.jsx(Qe,{value:"all",children:"All"}),s.jsx(Qe,{value:"ok",children:"Successful responses"}),s.jsx(Qe,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] min-w-0 space-y-2 overflow-auto",children:cn.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):cn.map(ue=>s.jsxs("details",{className:"rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0 flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full border bg-muted text-xs font-semibold",children:we.get(ue.stepId)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:ue.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[ue.method?`${ue.method} `:"",ue.url]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ue,{variant:"outline",children:"request"}),s.jsx(Ue,{variant:"outline",children:"response"}),typeof ue.response?.status=="number"&&s.jsx(Ue,{variant:ue.response.status>=400?"destructive":"secondary",children:ue.response.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:"Request Headers"}),s.jsx("pre",{className:"max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:JSON.stringify(ue.request?.headers??{},null,2)})]}),ue.request?.bodyText&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Request Body"}),s.jsx("pre",{className:"max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:ue.request.bodyText})]}),s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Response Headers"}),s.jsx("pre",{className:"max-h-40 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:JSON.stringify(ue.response?.headers??{},null,2)})]}),ue.response?.bodyText&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Response Body"}),s.jsx("pre",{className:"max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs",children:ue.response.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{f$(JSON.stringify(ue,null,2))},children:[s.jsx(Cs,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},ue.key))})]})]})})]})})]})}),a==="report"&&ne&&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:()=>o("configure"),children:"Back to Configure"}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rt("json")},children:[s.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rt("markdown")},children:[s.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rt("raw")},children:[s.jsx(Ea,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(Ui,{children:[s.jsx(yy,{className:"h-4 w-4"}),s.jsx(qi,{children:"Secrets display mode"}),s.jsx(Wi,{children:ne.summary?.showSensitiveValues?"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(Be,{children:s.jsxs(ze,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),s.jsx("div",{className:"text-lg font-semibold",children:ne.status})]})}),s.jsx(Be,{children:s.jsxs(ze,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),s.jsx("div",{className:"text-lg font-semibold",children:ne.networkSummary.requestCount})]})}),s.jsx(Be,{children:s.jsxs(ze,{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:ne.networkSummary.errorCount})]})}),s.jsx(Be,{children:s.jsxs(ze,{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:ne.validations.length})]})})]}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Key values"})}),s.jsxs(ze,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:ne.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:ne.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:ne.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:ne.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:ne.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(ne.summary?.grantedScopes??[]).join(", ")||"-"})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Token validity"}),s.jsxs("p",{className:"text-sm",children:[typeof ne.summary?.accessTokenValidForSeconds=="number"?`${G1(ne.summary.accessTokenValidForSeconds)} remaining`:typeof ne.summary?.accessTokenExpiresInSeconds=="number"?`${G1(ne.summary.accessTokenExpiresInSeconds)} from issuance`:"No expiry advertised by token endpoint",ne.summary?.accessTokenExpiresAt?` (until ${new Date(ne.summary.accessTokenExpiresAt).toLocaleTimeString()})`:""]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Source:"," ",ne.summary?.accessTokenExpirySource==="expires_in"?"token endpoint expires_in":ne.summary?.accessTokenExpirySource==="jwt_exp"?"JWT exp claim":"not available"]})]}),s.jsxs("div",{children:[s.jsx($e,{className:"text-xs",children:"Refresh option"}),s.jsx("p",{className:"text-sm",children:ne.summary?.refreshTokenAvailable?"Refresh token available (silent refresh possible)":"No refresh token in response (full login likely required after expiry)"})]}),ne.summary?.accessToken&&s.jsxs("div",{className:"md:col-span-2 space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Access token"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("code",{className:"flex-1 truncate rounded bg-muted px-2 py-1 text-xs font-mono text-muted-foreground",children:[ne.summary.accessToken.slice(0,48),"…"]}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"shrink-0 h-7 px-2 text-xs",onClick:()=>{f$(ne.summary.accessToken)},children:[s.jsx(Cs,{className:"mr-1 h-3 w-3"}),"Copy token"]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:['Visible because "Hide sensitive values" is off. Use this token with the CLI via ',s.jsx("code",{className:"font-mono",children:"--oauth-token"}),"."]})]})]})]}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Validation findings"})}),s.jsx(ze,{className:"space-y-2",children:ne.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):ne.validations.map((ue,nt)=>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:nt+1}),s.jsx("span",{className:"font-bold",children:ue.title})]}),s.jsx(Ue,{variant:Fn(ue.severity),children:ue.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",ue.detail]}),ue.recommendation&&s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-xs",children:[s.jsx("div",{className:"mb-1 font-medium text-muted-foreground",children:"Suggested improvement"}),s.jsx("p",{children:ue.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",ue.stepId,ue.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:ue.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},ue.id))})]})]})]})}const Vj="mcplab.runEvaluation.activeJobId",jxe=()=>{const[e]=ni(),[t,n]=m.useState(""),[r,a]=m.useState("1"),[o,i]=m.useState(!1),[c,d]=m.useState(0),[f,h]=m.useState([]),[p,g]=m.useState(!1),[x,j]=m.useState(!1),[b,y]=m.useState(""),[S,C]=m.useState(null),[N,E]=m.useState([]),[A,k]=m.useState([]),[T,O]=m.useState(!0),[L,z]=m.useState(""),[q,F]=m.useState(""),[G,W]=m.useState(!1),[R,M]=m.useState([]),[K,V]=m.useState(null),[D,J]=m.useState(!1),H=m.useRef(null),I=m.useRef(null),{configs:te,reload:de}=Rf(),{source:fe}=$n(),me=Cg("snapshots",!1),{agents:U,scenarios:oe,servers:re,reload:ne}=ns(),ve=b.trim(),le=ve?`/results/${encodeURIComponent(ve)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",Ae=te.find(ee=>ee.id===t),be=e.get("configId"),We=m.useMemo(()=>{if(!Ae)return[];const ee=new Map,Ee=Ae.agentEntries&&Ae.agentEntries.length>0?Ae.agentEntries:Ae.agents.map(Ne=>({kind:"inline",agent:Ne}));for(const Ne of Ee){if(Ne.kind==="inline"){const _e=Ne.agent.id;ee.has(_e)||ee.set(_e,Ne.agent);continue}const Ge=U.find(_e=>_e.id===Ne.ref);Ge&&!ee.has(Ge.id)&&ee.set(Ge.id,Ge)}for(const Ne of U)ee.has(Ne.id)||ee.set(Ne.id,Ne);return Array.from(ee.values())},[Ae,U]),B=m.useMemo(()=>{if(!Ae)return[];const ee=new Map,Ee=Ae.scenarioEntries&&Ae.scenarioEntries.length>0?Ae.scenarioEntries:Ae.scenarios.map(Ne=>({kind:"inline",scenario:Ne}));for(const Ne of Ee){if(Ne.kind==="inline"){ee.has(Ne.scenario.id)||ee.set(Ne.scenario.id,Ne.scenario);continue}const Ge=oe.find(_e=>_e.id===Ne.ref);Ge&&!ee.has(Ge.id)&&ee.set(Ge.id,Ge)}return Array.from(ee.values())},[Ae,oe]);m.useEffect(()=>{be&&te.some(ee=>ee.id===be)&&n(be)},[be,te]);const ie=m.useRef("");m.useEffect(()=>{const ee=Ae?`${Ae.id}::${Ae.sourcePath??""}`:"";if(ee===ie.current)return;if(ie.current=ee,!Ae){E([]),k([]);return}const Ee=We.filter(Ne=>(Ae.runDefaults?.selectedAgentNames??[]).includes(Ne.id)).map(Ne=>Ne.id);E(Ee.length>0?Ee:We.map(Ne=>Ne.id)),k(B.map(Ne=>Ne.id)),O(!0)},[Ae?.id,Ae?.sourcePath,We,B]);const he=async()=>{if(!Ae?.sourcePath){h(_e=>[..._e,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ee=We.filter(_e=>N.includes(_e.id));if(ee.length===0){h(_e=>[..._e,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const Ee=B.filter(_e=>A.includes(_e.id));if(Ee.length===0){h(_e=>[..._e,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}const Ne=Array.from(new Set(Ee.flatMap(_e=>_e.serverIds||[]).filter(_e=>{const Le=(Ae.servers??[]).find(cn=>cn.id===_e),Lt=re.find(cn=>cn.id===_e);return(Le||Lt)?.authType==="oauth2"})));try{Ne.length>0&&(J(!0),await nl({serverNames:Ne,source:fe,onServerAuthStart:_e=>{h(Le=>[...Le,`[${new Date().toLocaleTimeString()}] OAuth login required for '${_e}'. Complete the browser sign-in flow...`])}}),h(_e=>[..._e,`[${new Date().toLocaleTimeString()}] OAuth login completed for required server(s): ${Ne.join(", ")}.`]))}catch(_e){const Le=_e instanceof Error?_e.message:String(_e);h(Lt=>[...Lt,`[${new Date().toLocaleTimeString()}] OAuth error: ${Le}`]),J(!1);return}finally{J(!1)}i(!0),g(!1),j(!1),y("");const Ge=(Ae.serverEntries??[]).some(_e=>_e.kind==="referenced")||(Ae.agentEntries??[]).some(_e=>_e.kind==="referenced")||(Ae.scenarioEntries??[]).some(_e=>_e.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${Ae.name} mode=${Ge} agents=${ee.map(_e=>_e.name||_e.id).join(", ")} tests=${Ee.map(_e=>_e.id).join(", ")} runs=${Number(r)} snapshotEval=${me&&T?"on":"off"}${L.trim()?` note=${L.trim()}`:""}`]),d(10);try{const{jobId:_e}=await fe.startRun({configPath:Ae.sourcePath,runsPerScenario:Number(r),agents:ee.map(Le=>Le.id),scenarioIds:Ee.map(Le=>Le.id),applySnapshotEval:me?T:!1,runNote:L.trim()?L.trim():void 0});C(_e),ht(_e),qt(_e),jt()}catch(_e){const Le=_e instanceof Error?_e.message:String(_e),Lt=Le.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(cn=>[...cn,`[${new Date().toLocaleTimeString()}] Error: ${Le}${Lt}`]),i(!1),d(0),C(null),J(!1)}},Te=()=>{he()},Ye=()=>{S&&fe.stopRun(S),I.current?.(),I.current=null,dt(),C(null),i(!1),g(!1),j(!0),h(ee=>[...ee,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),jt()},ut=async()=>{if(b){W(!0);try{const ee=await fe.createSnapshotFromRun(b,q.trim()||void 0);Pe({title:"Snapshot saved",description:`Created ${ee.name} (${ee.id})`}),q.trim()||F(ee.name)}catch(ee){Pe({title:"Could not save snapshot",description:ee instanceof Error?ee.message:String(ee),variant:"destructive"})}finally{W(!1)}}};m.useEffect(()=>{H.current&&(H.current.scrollTop=H.current.scrollHeight)},[f]),m.useEffect(()=>()=>{I.current?.()},[]),m.useEffect(()=>{if(S||p)return;let ee="";try{ee=sessionStorage.getItem(Vj)??""}catch{ee=""}if(ee)return C(ee),i(!0),g(!1),j(!1),h(Ee=>Ee.length>0?Ee:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),qt(ee),()=>{}},[S,p]);const dt=()=>{try{sessionStorage.removeItem(Vj)}catch{}},ht=ee=>{try{sessionStorage.setItem(Vj,ee)}catch{}},jt=async()=>{try{const ee=await fe.getRunQueue();M(ee.queued),V(ee.active)}catch{}},It=()=>{de(),ne()};m.useEffect(()=>{It(),jt();const ee=()=>{It(),jt()};return window.addEventListener("focus",ee),()=>{window.removeEventListener("focus",ee)}},[de,ne]);const Dt=async ee=>{try{await fe.removeQueuedRun(ee),M(Ee=>Ee.filter(Ne=>Ne.jobId!==ee))}catch(Ee){const Ne=Ee instanceof Error?Ee.message:String(Ee);if(Ne.includes("Use the /stop endpoint"))try{await fe.stopRun(ee)}catch{}else Pe({title:"Could not remove queued run",description:Ne,variant:"destructive"})}jt()},qt=ee=>{I.current?.(),I.current=fe.subscribeRunJob(ee,Ee=>{const Ne=new Date(Ee.ts).toLocaleTimeString();if(Ee.type==="queued"){h(Ge=>{const _e=Ee.payload.position?` (position ${Ee.payload.position})`:"",Le=`[${Ne}] Run queued${_e}. Waiting for active run to finish...`;return Ge.includes(Le)?Ge:[...Ge,Le]}),d(5);return}if(Ee.type==="started"&&(h(Ge=>{const _e=`[${Ne}] Run started.`;return Ge.includes(_e)?Ge:[...Ge,_e]}),d(Ge=>Math.max(Ge,30)),j(!1)),Ee.type==="log"){const Ge=String(Ee.payload.message??"").trim();Ge&&(h(_e=>{const Le=`[${Ne}] ${Ge}`;return _e.includes(Le)?_e:[..._e,Le]}),d(_e=>{const Le=Ge.toLowerCase();if(Le.startsWith("loading mcp evaluation config"))return Math.max(_e,15);if(Le.startsWith("loaded config"))return Math.max(_e,20);if(Le.startsWith("selected "))return Math.max(_e,30);if(Le.startsWith("using requested agents")||Le.startsWith("using resolved default agents"))return Math.max(_e,35);if(Le.startsWith("expanded to "))return Math.max(_e,45);if(Le.startsWith("running evaluation"))return Math.max(_e,50);const Lt=Le.match(/^scenario (\d+)\/(\d+) finished:/);if(Lt){const cn=Number(Lt[1]),Sn=Number(Lt[2]);return Math.max(_e,50+Math.round(cn/Sn*25))}return Le.startsWith("evaluation execution finished")?Math.max(_e,78):Le.startsWith("applying snapshot evaluation policy")?Math.max(_e,82):Le.includes("snapshot evaluation applied")||Le.includes("snapshot evaluation enabled")?Math.max(_e,88):Le.startsWith("writing results to ")?Math.max(_e,94):Le.startsWith("run finished:")?Math.max(_e,98):_e}))}if(Ee.type==="completed"){const Ge=String(Ee.payload.runId??"").trim();if(h(_e=>{const Le=`[${Ne}] Run completed.`;return _e.includes(Le)?_e:[..._e,Le]}),Ee.payload.snapshotEval&&typeof Ee.payload.snapshotEval=="object"){const _e=Ee.payload.snapshotEval;h(Le=>{const Lt=`[${Ne}] Snapshot eval (${_e.mode??"warn"}) baseline=${_e.baseline_snapshot_id??"-"} score=${_e.overall_score??"-"} status=${_e.status??"-"}`;return Le.includes(Lt)?Le:[...Le,Lt]})}d(100),i(!1),g(!0),j(!1),y(Ge),dt(),C(null),I.current?.(),I.current=null,jt()}if(Ee.type==="error"){const Ge=String(Ee.payload.message??"Unknown error"),_e=Ge.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(Le=>[...Le,`[${Ne}] Error: ${Ge}${_e}`]),i(!1),g(!1),j(!1),d(0),dt(),C(null),I.current?.(),I.current=null,jt()}})};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(Zs,{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(Be,{children:s.jsxs(ze,{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($e,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(bn,{value:t,onValueChange:n,children:[s.jsx(hn,{children:s.jsx(wn,{placeholder:"Select a config"})}),s.jsx(mn,{children:te.map(ee=>s.jsx(Qe,{value:ee.id,children:ee.name},ee.id))})]}),s.jsx(se,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:It,"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(ha,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx($e,{children:"Variance Runs"}),s.jsx(pt,{type:"number",min:"1",max:"10",value:r,onChange:ee=>a(ee.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx($e,{htmlFor:"run-note",children:"Run Note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[L.length,"/500"]})]}),s.jsx(ks,{id:"run-note",value:L,onChange:ee=>z(ee.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),Ae&&s.jsxs("div",{className:"space-y-2",children:[me&&Ae.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 (",Ae.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:Ae.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx($e,{children:"Agents"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E(We.map(ee=>ee.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E([]),children:"Clear"})]})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:We.map(ee=>{const Ee=N.includes(ee.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(Gr,{checked:Ee,onCheckedChange:Ne=>{const Ge=Ne===!0;E(_e=>Ge?[..._e,ee.id]:_e.filter(Le=>Le!==ee.id))}}),s.jsx("span",{children:ee.name||ee.id})]},ee.id)})}),We.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available. Add agents to your workspace library, or define inline agents in this config."})]}),Ae&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx($e,{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:()=>k(B.map(ee=>ee.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>k([]),children:"Clear"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.length," of ",B.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:B.map(ee=>{const Ee=A.includes(ee.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(Gr,{checked:Ee,onCheckedChange:Ne=>{const Ge=Ne===!0;k(_e=>Ge?[..._e,ee.id]:_e.filter(Le=>Le!==ee.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:ee.name||ee.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:ee.id})]})]},ee.id)})})]}),me&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(Gr,{checked:T,onCheckedChange:ee=>O(ee===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(se,{onClick:Te,disabled:!t||D||We.length>0&&N.length===0||B.length>0&&A.length===0,children:[s.jsx(Zs,{className:"mr-2 h-4 w-4"}),K?"Queue Run":"Run"]}),o&&s.jsxs(se,{variant:"destructive",onClick:Ye,children:[s.jsx(Ah,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(o||f.length>0)&&s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Nt,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(ze,{className:"space-y-4",children:[s.jsx(kg,{value:c,className:"h-2"}),s.jsx("div",{ref:H,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((ee,Ee)=>s.jsx("div",{className:ee.includes("✓")?"text-success":ee.includes("aborted")?"text-destructive":"text-foreground",children:ee},Ee))})]})]}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Nt,{className:"inline-flex items-center gap-2 text-base",children:[s.jsx(uo,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(se,{variant:"ghost",size:"sm",onClick:()=>{jt()},children:s.jsx(ha,{className:"h-3 w-3"})})]})}),s.jsx(ze,{children:!K&&R.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No active or queued runs. Start a run above."}):s.jsxs("div",{className:"space-y-2",children:[K&&s.jsxs("div",{className:`flex items-center justify-between rounded-md border border-primary/30 bg-primary/5 p-2 text-sm cursor-pointer hover:bg-primary/10 transition-colors ${S===K.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==K.jobId&&(C(K.jobId),ht(K.jobId),i(!0),g(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${K.jobId}...`]),d(10),qt(K.jobId))},title:"Click to view progress",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:"Running"}),s.jsx("span",{className:"font-mono text-xs",children:K.runParams.configPath.split("/").pop()??K.runParams.configPath}),K.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",K.runParams.agents.join(", ")]}),K.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",K.runParams.runNote]})]}),s.jsxs(se,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:ee=>{ee.stopPropagation(),K&&(fe.stopRun(K.jobId),jt())},title:"Stop running job",children:[s.jsx(Ah,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),R.map((ee,Ee)=>{const Ne=ee.runParams.configPath.split("/").pop()??ee.runParams.configPath;return s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-2 text-sm",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsxs("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:["#",Ee+1," Queued"]}),s.jsx("span",{className:"font-mono text-xs",children:Ne}),ee.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",ee.runParams.agents.join(", ")]}),ee.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",ee.runParams.runNote]})]}),s.jsx(se,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{Dt(ee.jobId)},title:"Remove from queue",children:s.jsx(_s,{className:"h-4 w-4"})})]},ee.jobId)})]})})]}),x&&!o&&!p&&s.jsx(Be,{className:"border-amber-300/60 bg-amber-50/40",children:s.jsx(ze,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(Ah,{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),j(!1)},children:"Clear Progress"}),s.jsxs(se,{type:"button",onClick:Te,disabled:!t,children:[s.jsx(Zs,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&s.jsx(Be,{className:"border-success/50",children:s.jsxs(ze,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ho,{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(Ct,{to:le,children:ve?"View Results":"View Runs"})})]}),me&&ve&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx($e,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(pt,{value:q,onChange:ee=>F(ee.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:()=>{ut()},disabled:G,children:G?"Saving...":"Save Snapshot"})]})]})})]})};function k6({title:e,description:t,expanded:n,onToggleExpanded:r,onHide:a,messages:o,pendingToolCalls:i,loading:c,input:d,onInputChange:f,onSend:h,inputPlaceholder:p,snippets:g,snippetsLabel:x="Result Assistant Snippets",onSnippetSelect:j,onApproveToolCall:b,onDenyToolCall:y,chatEndRef:S,inputRef:C,renderMessage:N,renderMessageExtras:E,className:A="min-w-0 overflow-hidden xl:flex xl:h-full xl:min-h-0 xl:flex-col",contentClassName:k="flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1"}){return s.jsxs(Be,{className:A,children:[s.jsx(St,{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(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(zr,{className:"h-4 w-4 text-amber-500"}),e]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:r,children:[n?s.jsx(Zj,{className:"h-3.5 w-3.5"}):s.jsx(eS,{className:"h-3.5 w-3.5"}),n?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:a,children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:t})]})}),s.jsxs(ze,{className:k,children:[s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[o.map((T,O)=>{const L=T.role==="user",z=T.role==="assistant",q=T.role==="system",F=T.role==="tool",G=T.pendingToolCallId?i.find(R=>R.id===T.pendingToolCallId):void 0;return N?N({message:T,index:O,linkedPendingToolCall:G,isUser:L,isAssistant:z,isSystem:q,isTool:F}):z&&!!T.pendingToolCallId?s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx(Ta,{text:T.text,className:"text-sm"}),G&&s.jsx(K1,{call:G,loading:c,onApprove:b,onDeny:y,className:"mt-3"})]},`${T.id??`${T.role}-${O}`}-tool`):s.jsx(Vz,{message:T},T.id??`${T.role}-${O}`)}),E,c&&s.jsx(Hz,{}),s.jsx("div",{ref:S})]})}),s.jsx("div",{className:"border-t bg-background px-4 py-3",children:s.jsx(Kz,{input:d,onInputChange:f,onSend:h,inputPlaceholder:p,snippets:g,snippetsLabel:x,onSnippetSelect:j,loading:c,inputRef:C})})]})]})}function vd(e){return e instanceof IN&&e.status===404}function T6(e){const{source:t,open:n,scope:r,runId:a,onSessionSync:o}=e,[i,c]=m.useState(null),[d,f]=m.useState([]),[h,p]=m.useState([]),[g,x]=m.useState(""),[j,b]=m.useState(!1),y=m.useRef(null),S=m.useRef(t),C=m.useRef(o),N=m.useRef(null),E=m.useRef(null);m.useEffect(()=>{y.current=i},[i]),m.useEffect(()=>{S.current=t},[t]),m.useEffect(()=>{C.current=o},[o]);const A=m.useCallback((G,W)=>{c(W??G.id),f(R=>R.length>G.messages.length?R:G.messages),p(G.pendingToolCalls),C.current?.(G)},[]),k=m.useCallback(async(G,W)=>{const R=W.session.id||G;A(W.session,R)},[A]),T=m.useCallback(async()=>{const G=g.trim();if(!G||r==="run"&&!a)return;const W=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,R={id:W,role:"user",text:G,createdAt:new Date().toISOString()};x(""),f(M=>[...M,R]),b(!0);try{let M=i;if(!M){const K=r==="run"&&a?await t.createResultAssistantSession({runId:a,scope:"run"}):await t.createResultAssistantSession({scope:"all_runs"});M=K.sessionId||K.session.id,A(K.session,M),f(V=>V.some(J=>J.id===W)?[...K.session.messages,R]:K.session.messages)}try{const K=await t.sendResultAssistantMessage(M,G);await k(M,K)}catch(K){if(!vd(K))throw K;const V=r==="run"&&a?await t.createResultAssistantSession({runId:a,scope:"run"}):await t.createResultAssistantSession({scope:"all_runs"}),D=V.sessionId||V.session.id;A(V.session,D),f(H=>H.some(te=>te.id===W)?[...V.session.messages,R]:V.session.messages);const J=await t.sendResultAssistantMessage(D,G);await k(D,J)}}catch(M){f(K=>K.filter(V=>V.id!==W)),Pe({title:"MCP Lab Assistant error",description:M instanceof Error?M.message:String(M),variant:"destructive"})}finally{b(!1)}},[g,r,a,i,t,A,k]),O=m.useCallback(async G=>{if(i){b(!0);try{const W=await t.approveResultAssistantToolCall(i,G);await k(i,W)}catch(W){vd(W)&&(c(null),p([])),Pe({title:"Could not approve assistant action",description:vd(W)?"Assistant session expired. Ask a new question to start a fresh session.":W instanceof Error?W.message:String(W),variant:"destructive"})}finally{b(!1)}}},[i,t,k]),L=m.useCallback(async G=>{if(i){b(!0);try{const W=await t.denyResultAssistantToolCall(i,G);await k(i,W)}catch(W){vd(W)&&(c(null),p([])),Pe({title:"Could not deny assistant action",description:vd(W)?"Assistant session expired. Ask a new question to start a fresh session.":W instanceof Error?W.message:String(W),variant:"destructive"})}finally{b(!1)}}},[i,t,k]),z=m.useCallback(()=>{const G=y.current;G&&t.closeResultAssistantSession(G).catch(()=>{}),y.current=null,c(null),f([]),p([]),x("")},[t]),q=m.useCallback(G=>{f(W=>W.length>0?W:[{id:`msg-${Date.now()}`,role:"assistant",text:G,createdAt:new Date().toISOString()}])},[]),F=m.useCallback(G=>{x(G),requestAnimationFrame(()=>E.current?.focus())},[]);return m.useEffect(()=>{if(!n)return;const G=window.setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(G)},[n,d.length,j]),m.useEffect(()=>{const G=E.current;if(!G)return;G.style.height="0px";const W=Math.min(G.scrollHeight,160);G.style.height=`${Math.max(40,W)}px`},[g,n]),m.useEffect(()=>{if(!(!n||!i))return S.current.subscribeResultAssistantSessionEvents(i,G=>{A(G.payload.session,G.payload.sessionId)})},[n,i,A]),m.useEffect(()=>()=>{const G=y.current;G&&S.current.closeResultAssistantSession(G).catch(()=>{})},[]),{assistantSessionId:i,assistantMessages:d,assistantPendingToolCalls:h,assistantInput:g,assistantLoading:j,assistantChatEndRef:N,assistantInputRef:E,setAssistantInput:x,setAssistantMessages:f,askAssistant:T,approveResultAssistantToolCall:O,denyResultAssistantToolCall:L,applyResultAssistantSnippet:F,ensureIntroMessage:q,resetAssistantSession:z}}function Rh(e){const t=String(e??"").trim();return t&&(t.split("::").pop()??t).replace(/^mcplab__/,"").replace(/^mcplab_/,"").replace(/_/g," ").replace(/\s+/g," ").trim()||"unknown_tool"}function Sxe(e){const t=Array.from(new Map(e.scenarios.map(d=>{const f=String(d.scenarioId??"").trim(),h=String(d.scenarioName??"").trim();return!f&&!h?null:[f||h,h||f]}).filter(d=>!!d)).values()),n=Array.from(new Set(e.scenarios.map(d=>d.agentName).filter(Boolean))),r=Array.from(new Set(e.scenarios.map(d=>d.model).filter(d=>!!d))),a=t.slice(0,2).join(", "),o=t.length>2?` +${t.length-2}`:"",i=r.slice(0,2).join(", "),c=r.length>2?` +${r.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:a?`${a}${o}`:"n/a",modelSummary:i?`${i}${c}`:""}}const Nxe=[{label:"Summarize Run Trends",description:"Highlight the main changes across the selected runs.",prompt:"Summarize the main trends across these runs. Call out pass-rate changes, latency, and tool usage shifts."},{label:"Explain Failures",description:"Identify the most important failures and likely root causes.",prompt:"Identify the most important failures across these runs and explain likely root causes from the traces."},{label:"Compare Agents",description:"Compare agent behavior, tool use, and answer quality across runs.",prompt:"Compare agent behavior across these runs. Highlight differences in tool use, answer quality, and consistency."},{label:"Spot Anomalies",description:"Find outliers in latency, tool calls, or pass rate.",prompt:"Find unusual runs or outliers in latency, tool calls, or pass rate, and explain why they stand out."}],Cxe=()=>{const{source:e}=$n(),[t,n]=m.useState([]),[r,a]=m.useState(!1),[o,i]=m.useState(null),[c,d]=m.useState(!1),[f,h]=m.useState("timestamp"),[p,g]=m.useState("desc"),[x,j]=m.useState("all"),[b,y]=m.useState(!1),[S,C]=m.useState(!1),[N,E]=m.useState(!1),A=U=>{if(f===U){g(oe=>oe==="asc"?"desc":"asc");return}h(U),g(U==="timestamp"?"desc":"asc")},k=async()=>{a(!0);try{n(await e.listResults())}catch(U){Pe({title:"Could not load results",description:U instanceof Error?U.message:String(U),variant:"destructive"})}finally{a(!1)}};m.useEffect(()=>{let U=!0;return a(!0),e.listResults().then(oe=>{U&&n(oe)}).catch(oe=>{U&&Pe({title:"Could not load results",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}).finally(()=>{U&&a(!1)}),()=>{U=!1}},[e]);const{assistantMessages:T,assistantPendingToolCalls:O,assistantInput:L,assistantLoading:z,assistantChatEndRef:q,assistantInputRef:F,setAssistantInput:G,askAssistant:W,approveResultAssistantToolCall:R,denyResultAssistantToolCall:M,applyResultAssistantSnippet:K,ensureIntroMessage:V}=T6({source:e,open:S,scope:"all_runs"}),D=m.useMemo(()=>{const U=new Set;return t.forEach(oe=>{oe.scenarios.forEach(re=>{const ne=String(re.scenarioName??"").trim(),ve=String(re.scenarioId??"").trim(),le=ne||ve;le&&U.add(le)})}),Array.from(U).sort((oe,re)=>oe.localeCompare(re))},[t]),J=m.useMemo(()=>x==="all"?t:t.filter(U=>U.scenarios.some(oe=>{const re=String(oe.scenarioName??"").trim(),ne=String(oe.scenarioId??"").trim();return(re||ne)===x})),[t,x]),H=m.useMemo(()=>{const U=(re,ne)=>re===null&&ne===null?0:re===null?1:ne===null?-1:p==="asc"?re-ne:ne-re;return[...J].sort((re,ne)=>{if(f==="toolTokens")return U(re.toolTokenUsage?.totalTokens??null,ne.toolTokenUsage?.totalTokens??null);let ve=0;return f==="id"&&(ve=re.id.localeCompare(ne.id)),f==="timestamp"&&(ve=new Date(re.timestamp).getTime()-new Date(ne.timestamp).getTime()),f==="passRate"&&(ve=re.overallPassRate-ne.overallPassRate),f==="scenarios"&&(ve=re.totalScenarios-ne.totalScenarios),f==="avgToolCalls"&&(ve=re.avgToolCalls-ne.avgToolCalls),p==="asc"?ve:-ve})},[J,f,p]),I=U=>f!==U?s.jsx(fc,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(bs,{className:"h-3.5 w-3.5"}):s.jsx(Kt,{className:"h-3.5 w-3.5"}),te=U=>{const oe=U.toolTokenUsage?.totalTokens;return typeof oe=="number"?oe.toLocaleString():"n/a"},de=m.useMemo(()=>{const U=new Map;for(const oe of H)U.set(oe.id,Sxe(oe));return U},[H]),fe=()=>{C(!0),V("Ask me to compare runs, explain regressions over time, or summarize historical drift patterns.")},me=async U=>{d(!0);try{await e.deleteResult(U),n(oe=>oe.filter(re=>re.id!==U)),Pe({title:"Run deleted",description:U}),i(null)}catch(oe){Pe({title:"Could not delete run",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}finally{d(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Ds,{open:o!==null,onOpenChange:U=>{!U&&!c&&i(null)},children:s.jsxs(as,{children:[s.jsxs(ss,{children:[s.jsx(is,{children:"Delete run?"}),s.jsxs(ls,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:o??""}),"."]})]}),s.jsxs(os,{children:[s.jsx(us,{disabled:c,children:"Cancel"}),s.jsx(cs,{disabled:c||!o,onClick:U=>{U.preventDefault(),o&&me(o)},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(kd,{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(Zc,{open:b,onOpenChange:y,children:[s.jsx(eu,{asChild:!0,children:s.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":b,className:"w-[260px] justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:x==="all"?"All scenarios":x}),s.jsx(Kt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(rl,{className:"w-[260px] p-0",align:"start",children:s.jsxs(sl,{children:[s.jsx(ol,{placeholder:"Search scenarios..."}),s.jsxs(il,{children:[s.jsx(ll,{children:"No scenarios found."}),s.jsxs(cl,{children:[s.jsx(ca,{value:"all scenarios",onSelect:()=>{j("all"),y(!1)},children:"All scenarios"}),D.map(U=>s.jsx(ca,{value:U,onSelect:()=>{j(U),y(!1)},children:U},U))]})]})]})})]}),s.jsx(se,{variant:"outline",onClick:()=>{k()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsxs(se,{type:"button",variant:"outline",className:"gap-1.5",onClick:fe,children:[s.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"MCP Lab Assistant"]})]})]}),s.jsxs("div",{className:`grid gap-6 ${S?N?"xl:grid-cols-[minmax(0,1fr)_52rem]":"xl:grid-cols-[minmax(0,1fr)_30rem]":"grid-cols-1"}`,children:[s.jsx(Be,{children:s.jsx(ze,{className:"p-0",children:s.jsxs(qr,{children:[s.jsx(Wr,{children:s.jsxs(Vt,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>A("id"),children:["Run ID",I("id")]})}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>A("timestamp"),children:["Timestamp",I("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>A("passRate"),children:["Pass Rate",I("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>A("scenarios"),children:["Scenarios",I("scenarios")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>A("avgToolCalls"),children:["Avg Tool Calls",I("avgToolCalls")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>A("toolTokens"),children:["Tool Tokens",I("toolTokens")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Vr,{children:H.map(U=>s.jsxs(Vt,{children:[s.jsx(Fe,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ct,{to:`/results/${U.id}`,className:"font-mono text-xs text-primary hover:underline",children:U.id}),U.configId?s.jsx("div",{className:"text-[11px] text-muted-foreground",children:U.configId}):null,U.runNote?s.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",U.runNote]}):null]})}),s.jsx(Fe,{className:"text-[11px] text-muted-foreground",children:(()=>{const oe=de.get(U.id)??{scenarioCount:0,agentCount:0,scenarioPreview:"n/a",modelSummary:""};return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",oe.scenarioCount," scenario",oe.scenarioCount===1?"":"s"," ·"," ",oe.agentCount," agent",oe.agentCount===1?"":"s",oe.modelSummary?` · ${oe.modelSummary}`:""]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:oe.scenarioPreview})]})})()}),s.jsx(Fe,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(uo,{className:"h-3 w-3"}),new Date(U.timestamp).toLocaleString()]})}),s.jsx(Fe,{children:s.jsx(Xs,{rate:U.overallPassRate})}),s.jsx(Fe,{className:"font-mono text-sm",children:U.totalScenarios}),s.jsx(Fe,{className:"font-mono text-sm",children:U.avgToolCalls.toFixed(0)}),s.jsx(Fe,{className:"font-mono text-sm",children:te(U)}),s.jsx(Fe,{children:s.jsxs(Hf,{children:[s.jsx(Kf,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(nv,{className:"h-4 w-4"})})}),s.jsxs(bu,{align:"end",children:[s.jsx(Kr,{asChild:!0,children:s.jsxs(Ct,{to:`/results/${U.id}`,children:[s.jsx(_7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(Kr,{children:[s.jsx(Ea,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(Kr,{className:"text-destructive",onSelect:oe=>{oe.preventDefault();const re=document.activeElement;re instanceof HTMLElement&&re.blur(),i(U.id)},children:[s.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},U.id))})]})})}),S&&s.jsx(k6,{title:"MCP Lab Assistant",description:"Analyze historical differences and trends across all result runs.",expanded:N,onToggleExpanded:()=>E(U=>!U),onHide:()=>C(!1),messages:T,pendingToolCalls:O,loading:z,input:L,onInputChange:G,onSend:()=>{W()},inputPlaceholder:"Ask about historical run differences...",snippets:Nxe,onSnippetSelect:U=>{C(!0),K(U)},onApproveToolCall:U=>{R(U)},onDenyToolCall:U=>{M(U)},chatEndRef:q,inputRef:F,className:"min-w-0 overflow-hidden xl:flex xl:h-[calc(100vh-14rem)] xl:min-h-0 xl:flex-col",renderMessage:({message:U,index:oe,linkedPendingToolCall:re,isUser:ne,isAssistant:ve,isSystem:le,isTool:Ae})=>{const be=ve&&!!U.pendingToolCallId;if(Ae&&/^(Approved|Denied) tool call\b/i.test(String(U.text??"").trim()))return null;if(be){const We=Rh(re?.tool??U.toolRequestName??re?.publicToolName??U.toolRequestPublicName??"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(Pr,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!re,className:"group min-w-0 w-full max-w-[92%] overflow-hidden 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 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ja,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${We}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${re?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:re?"Needs approval":"Completed"})]})}),s.jsx(Kt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsx("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:s.jsx(Ta,{text:U.text,className:"text-sm"})})]})]},`${U.id??`${U.role}-${oe}`}:tool`)}return s.jsxs("div",{className:`flex items-start gap-2 ${ne?"justify-end":"justify-start"}`,children:[!ne&&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:le?s.jsx(uN,{className:"h-3 w-3"}):s.jsx(Pr,{className:"h-3 w-3"})}),s.jsx("div",{className:`min-w-0 max-w-[92%] break-words rounded-md border p-3 text-sm ${ne?"border-primary/20 bg-primary/10":le?"border-amber-400/30 bg-amber-50/70":Ae?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:s.jsx(Ta,{text:U.text,className:"text-sm"})}),ne&&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(jc,{className:"h-3 w-3"})})]},U.id??`${U.role}-${oe}`)}})]})]})};function _xe(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),o=Object.values(r),i=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">${ki(c.scenarioName)}</span>
|
|
153
|
-
<span class="scenario-agent">${ki(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">${ki(f.name)} <small>${f.duration}ms</small></span>`).join("")}
|
|
166
|
-
</div>
|
|
167
|
-
${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>ki(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 — ${ki(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">${ki(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">${ki(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
|
-
${i}
|
|
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(o)},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 ki(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const Axe="mcplab.resultAssistantScenarioHandoff",Exe=[{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 p$(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function h$(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const Pxe=()=>{const{id:e}=hl(),t=Ia(),[n]=ni(),{source:r}=$n(),a=n.get("embed")==="1",o=Cg("snapshots",!1),{configs:i}=Rf(),{scenarios:c}=ns(),[d,f]=m.useState(void 0),[h,p]=m.useState(!0),[g,x]=m.useState(!1),[j,b]=m.useState(""),[y,S]=m.useState(!1),[C,N]=m.useState(new Set),[E,A]=m.useState(new Set),[k,T]=m.useState([]),[O,L]=m.useState(""),[z,q]=m.useState(null),[F,G]=m.useState(!1),[W,R]=m.useState(""),[M,K]=m.useState(""),[V,D]=m.useState(!1),[J,H]=m.useState(!1),[I,te]=m.useState(!1),[de,fe]=m.useState("assistant"),[me,U]=m.useState(null),[oe,re]=m.useState(!1),[ne,ve]=m.useState(""),[le,Ae]=m.useState(""),[be,We]=m.useState(!1),[B,ie]=m.useState(!1),[he,Te]=m.useState(!1),[Ye,ut]=m.useState([]),[dt,ht]=m.useState(!1),[jt,It]=m.useState(""),[Dt,qt]=m.useState(null),[ee,Ee]=m.useState(!1),[Ne,Ge]=m.useState(null),{assistantMessages:_e,assistantPendingToolCalls:Le,assistantInput:Lt,assistantLoading:cn,assistantChatEndRef:Sn,assistantInputRef:Or,setAssistantInput:we,askAssistant:_t,approveResultAssistantToolCall:$t,denyResultAssistantToolCall:Wt,applyResultAssistantSnippet:tn,ensureIntroMessage:Gt,resetAssistantSession:hr}=T6({source:r,open:J,scope:"run",runId:e,onSessionSync:void 0}),ft=m.useCallback(async(Z,Ce)=>{ht(!0);try{const Me=(await r.listMarkdownReports()).filter(zt=>{const At=String(zt.relativePath??""),Cn=String(zt.name??"");return At.includes(Z)||Cn.includes(Z)});if(ut(Me),Ce&&Me.length>0){const zt=Me.find(At=>At.relativePath===Ce||At.path===Ce||At.relativePath.endsWith(Ce)||At.path.endsWith(Ce));zt&&It(zt.relativePath)}return Me}catch{return ut([]),[]}finally{ht(!1)}},[r]);m.useEffect(()=>{if(!e)return;let Z=!0;return hr(),p(!0),r.getResult(e).then(Ce=>{Z&&(f(Ce),b(Ce?.runNote??""),x(!1),p(!1))}),()=>{Z=!1}},[e,r,hr]),m.useEffect(()=>{let Z=!0;return r.listSnapshots().then(Ce=>{Z&&T(Ce)}).catch(()=>{Z&&T([])}),()=>{Z=!1}},[r]),m.useEffect(()=>{if(!d?.id){ut([]);return}let Z=!0;return(async()=>{const Ce=await ft(d.id)})(),()=>{Z=!1}},[d?.id,ft]),m.useEffect(()=>{if(Ye.length===0){It(""),qt(null),Ge(null);return}(!jt||!Ye.some(Z=>Z.relativePath===jt))&&It(Ye[0].relativePath)},[Ye,jt]),m.useEffect(()=>{if(!J||de!=="reports")return;if(!jt){qt(null),Ge(null);return}let Z=!0;return Ee(!0),Ge(null),r.getMarkdownReport(jt).then(Ce=>{Z&&qt(Ce)}).catch(Ce=>{Z&&(qt(null),Ge(Ce instanceof Error?Ce.message:String(Ce)))}).finally(()=>{Z&&Ee(!1)}),()=>{Z=!1}},[J,de,jt,r]);const Pt=n.get("configId")??"",Rt=(n.get("agent")??"").trim(),nn=m.useMemo(()=>{const Z=Pt?i.find(Ce=>Ce.id===Pt):void 0;return Z||(d?i.find(Ce=>Ce.id===d.configId):void 0)},[i,Pt,d]),Fn=m.useMemo(()=>{const Z=new Map;if(nn){for(const Ce of nn.scenarios)Z.set(Ce.id,Ce),Ce.name&&!Z.has(Ce.name)&&Z.set(Ce.name,Ce);for(const Ce of nn.scenarioEntries??[]){if(Ce.kind!=="referenced")continue;const it=c.find(Me=>Me.id===Ce.ref);it&&(Z.set(it.id,it),it.name&&Z.set(it.name,it),Z.has(Ce.ref)||Z.set(Ce.ref,it))}}for(const Ce of c)Z.has(Ce.id)||Z.set(Ce.id,Ce),Ce.name&&!Z.has(Ce.name)&&Z.set(Ce.name,Ce);return Z},[nn,c]),ue=m.useMemo(()=>{if(!d?.snapshotEval?.baselineSnapshotId)return"";const Z=i.filter(Ce=>Ce.snapshotEval?.baselineSnapshotId===d.snapshotEval?.baselineSnapshotId);return Z.length===1?Z[0].id:""},[i,d?.snapshotEval?.baselineSnapshotId]);m.useEffect(()=>{d?.snapshotEval?.baselineSnapshotId&&L(Z=>Z||d.snapshotEval.baselineSnapshotId)},[d?.snapshotEval?.baselineSnapshotId]),m.useEffect(()=>{if(Pt&&i.some(Z=>Z.id===Pt)){R(Pt);return}ue&&R(Z=>Z||ue)},[Pt,i,ue]);const{filteredScenarios:nt,filteredTotalRuns:bt,filteredPassCount:Jt,displayPassRate:mt,displayAvgToolCalls:kn,displayAvgLatency:cr,displayToolTokenUsage:ma}=m.useMemo(()=>{if(!d)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayToolTokenUsage:null};const Z=Rt?d.scenarios.filter(At=>At.agentId===Rt||At.agentName===Rt):d.scenarios,Ce=Z.reduce((At,Cn)=>At+Cn.runs.length,0),it=Z.reduce((At,Cn)=>At+Cn.runs.filter(mr=>mr.passed).length,0),Me=Z.reduce((At,Cn)=>At+Cn.runs.reduce((mr,un)=>mr+un.toolCalls.length,0),0),zt=Z.reduce((At,Cn)=>At+Cn.runs.reduce((mr,un)=>mr+un.duration,0),0);return{filteredScenarios:Z,filteredTotalRuns:Ce,filteredPassCount:it,displayPassRate:Ce===0?0:it/Ce,displayAvgToolCalls:Ce===0?0:Me/Ce,displayAvgLatency:Ce===0?0:Math.round(zt/Ce),displayToolTokenUsage:hY(Z.map(At=>At.toolTokenUsage))}},[d,Rt]),xo=m.useMemo(()=>{const Z={};return nt.forEach(Ce=>Ce.runs.forEach(it=>it.toolCalls.forEach(Me=>{Z[Me.name]=(Z[Me.name]||0)+1}))),Object.entries(Z).map(([Ce,it])=>({name:Ce,count:it})).sort((Ce,it)=>it.count-Ce.count)},[nt]);if(h)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading result..."});if(!d)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Result not found"});const xe=Object.entries(d.mcpServerVersions??{}).map(([Z,Ce])=>`${Z}: ${Ce??"unknown"}`).join(", "),Ve=Jt,ct=Math.max(0,bt-Ve),Ft=[{name:"Pass",value:Ve,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:ct,color:"hsl(0, 72%, 51%)"}],Ht=Z=>{N(Ce=>{const it=new Set(Ce);return it.has(Z)?it.delete(Z):it.add(Z),it})},Bt=(Z,Ce,it,Me)=>`${Z}:${Ce}:${it}:${Me}`,Bn=(Z,Ce)=>`${Z}::${Ce}`,He=Z=>{A(Ce=>{const it=new Set(Ce);return it.has(Z)?it.delete(Z):it.add(Z),it})},rn=Z=>{const Ce=!Z.endsWith(":conversation");return E.has(Z)?!Ce:Ce},Yt=new Map((z?.scenario_results??[]).map(Z=>[Z.scenario_id,Z])),zn=async()=>{if(!(!d||!O)){G(!0);try{const Z=await r.compareSnapshot(O,d.id);q(Z)}finally{G(!1)}}},Nn=async Z=>{const Ce=Z||d.snapshotEval?.baselineSnapshotId;if(Ce){L(Ce),G(!0);try{const it=await r.compareSnapshot(Ce,d.id);q(it)}catch(it){Pe({title:"Could not review drift",description:it instanceof Error?it.message:String(it),variant:"destructive"})}finally{G(!1)}}},Tg=async()=>{if(!W){Pe({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}D(!0);try{const Z=await r.generateSnapshotEvalBaseline(d.id,W,M.trim()||void 0);T(Ce=>[Z.snapshot,...Ce.filter(it=>it.id!==Z.snapshot.id)]),L(Z.snapshot.id),Pe({title:"Baseline updated",description:`${Z.snapshot.name} is now linked to the selected config.`}),M.trim()||K(Z.snapshot.name),d.snapshotEval?.applied&&Nn(Z.snapshot.id)}catch(Z){Pe({title:"Could not accept new baseline",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}finally{D(!1)}},yo=(Z,Ce)=>{fe("assistant"),H(!0),U(Ce?.scenarioId??null),Gt("Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result."),Z&&we(Z)},Su=Le.filter(Z=>Z.status==="pending"&&!_e.some(Ce=>Ce.pendingToolCallId===Z.id)),Sl=Z=>{fe("reports"),H(!0)},Og=()=>{fe("note"),H(!0)},Jf=Z=>{if(!d)return;if(!me){Pe({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const Ce=c.find(Me=>Me.id===me)??c.find(Me=>Me.name===me);if(!Ce){Pe({title:"Scenario not found in library",description:`Could not find library scenario '${me}' to open in Scenario Assistant.`,variant:"destructive"});return}const it=[`I am sending a suggestion from the Result Assistant for scenario '${me}' based on run '${d.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:",Z].join(`
|
|
249
|
-
`);try{window.sessionStorage.setItem(Axe,JSON.stringify({type:"result-assistant-handoff-v1",runId:d.id,configId:Pt||d.configId||"",scenarioId:Ce.id,prompt:it,sourceReply:Z})),t(`/libraries/test-cases/${encodeURIComponent(Ce.id)}?assistantHandoff=1`)}catch(Me){Pe({title:"Could not create handoff",description:Me instanceof Error?Me.message:String(Me),variant:"destructive"})}},di=Z=>{d&&(Te(!1),ve(Z),Ae(p$(d.id)),We(!1),re(!0))},va=()=>{d&&(Te(!0),ve(""),Ae(p$(d.id)),We(!1),re(!0))},Rg=async()=>{if(!d)return;if(!ne.trim()){Pe({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}ie(!0);try{const Ce=await r.applyResultAssistantReport({runId:d.id,markdown:ne,outputPath:le.trim()||void 0,overwrite:be});Pe({title:"Markdown report written",description:typeof Ce.path=="string"&&Ce.path?Ce.path:Ce.outputPath}),await ft(d.id,typeof Ce.path=="string"&&Ce.path||Ce.outputPath||void 0),J&&fe("reports"),re(!1)}catch(Ce){Pe({title:"Could not write markdown report",description:Ce instanceof Error?Ce.message:String(Ce),variant:"destructive"})}finally{ie(!1)}},Jr=async Z=>{try{await navigator.clipboard.writeText(Z),Pe({title:"Copied"})}catch(Ce){Pe({title:"Could not copy",description:Ce instanceof Error?Ce.message:String(Ce),variant:"destructive"})}},Ig=async()=>{if(d){S(!0);try{const Z=j.trim();await r.updateRunNote(d.id,Z||void 0),f(Ce=>Ce&&{...Ce,runNote:Z||void 0}),b(Z),x(!1),Pe({title:"Run note saved"})}catch(Z){Pe({title:"Could not save run note",description:Z instanceof Error?Z.message:String(Z),variant:"destructive"})}finally{S(!1)}}};return s.jsxs("div",{className:`${J?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${J?"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:[!a&&s.jsx(se,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(Ct,{to:"/results",children:s.jsx(Vi,{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:d.id}),s.jsx(Xs,{rate:mt}),o&&d.snapshotEval?.applied&&s.jsxs(Ue,{variant:"outline",className:"text-xs",children:["Snapshot policy · ",d.snapshotEval.mode," · ",d.snapshotEval.status]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[s.jsx(C7,{className:"h-3 w-3 shrink-0"}),new Date(d.timestamp).toLocaleString()]}),s.jsx("span",{className:"mx-1",children:"·"}),Rt?s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"inline-flex items-center align-middle",children:["Agent: ",Rt]}),s.jsx("span",{className:"mx-1",children:"·"})]}):null,s.jsxs("span",{className:"inline-flex items-center align-middle",children:["Config hash: ",s.jsx("span",{className:"ml-1 font-mono",children:d.configHash})]})]}),o&&d.snapshotEval?.applied&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Baseline: ",s.jsx("span",{className:"font-mono",children:d.snapshotEval.baselineSnapshotId})," · score: ",d.snapshotEval.overallScore]})]})]}),s.jsxs("div",{className:"flex w-full min-w-0 items-center justify-between gap-2 sm:ml-auto sm:w-auto",children:[xe?s.jsxs("span",{className:"inline-flex max-w-[18rem] min-w-0 items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"MCP:"}),s.jsx("span",{className:"ml-1 min-w-0 truncate font-mono",children:xe})]}):null,s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-end gap-2",children:[o&&d.snapshotEval?.applied&&s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>{Nn()},disabled:F,children:[s.jsx(cN,{className:"h-3.5 w-3.5"}),F?"Reviewing drift...":"Review Drift"]}),s.jsxs(se,{variant:"outline",size:"sm",className:`max-w-full gap-1.5 ${a?"px-2":""}`,onClick:()=>{const Z=_xe(d),Ce=new Blob([Z],{type:"text/html"}),it=URL.createObjectURL(Ce),Me=document.createElement("a");Me.href=it,Me.download=`mcplab-report-${d.id}.html`,Me.click(),URL.revokeObjectURL(it)},"aria-label":"Download Report",title:"Download Report",children:[s.jsx(Ea,{className:"h-3.5 w-3.5"}),!a&&"Download Report"]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>Sl(),disabled:dt,children:[s.jsx(oc,{className:"h-3.5 w-3.5"}),dt?"Reference Reports...":`Reference Reports${Ye.length?` (${Ye.length})`:""}`]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>Og(),children:[s.jsx(oc,{className:"h-3.5 w-3.5"}),"Run Note"]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"max-w-full gap-1.5",onClick:()=>yo(),children:[s.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"MCP Lab Assistant"]})]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${J?I?"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 ${J?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[o&&d.snapshotEval?.applied&&s.jsxs(Be,{className:"border-amber-500/30",children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Snapshot Drift Review"})}),s.jsxs(ze,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsxs(Ue,{variant:"outline",children:["Mode: ",d.snapshotEval.mode]}),s.jsxs(Ue,{variant:"outline",children:["Status: ",d.snapshotEval.status]}),s.jsxs(Ue,{variant:"outline",children:["Overall score: ",d.snapshotEval.overallScore]}),s.jsxs(Ue,{variant:"outline",className:"font-mono",children:["Baseline: ",d.snapshotEval.baselineSnapshotId]})]}),d.snapshotEval.impactedScenarios.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Impacted scenarios: ",d.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(bn,{value:W,onValueChange:R,children:[s.jsx(hn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select config to update"})}),s.jsx(mn,{children:i.map(Z=>s.jsx(Qe,{value:Z.id,children:Z.name},Z.id))})]}),!W&&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:M,onChange:Z=>K(Z.target.value),placeholder:`Snapshot ${d.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:()=>{Nn()},disabled:F,children:[s.jsx(ha,{className:`h-3.5 w-3.5 ${F?"animate-spin":""}`}),"Review Drift"]}),s.jsx(se,{type:"button",size:"sm",className:"h-8",onClick:()=>{Tg()},disabled:V||mt!==1,children:V?"Accepting...":"Accept as New Baseline"})]})]}),mt!==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 ${J?"grid-cols-3":"sm:grid-cols-2 lg:grid-cols-6"}`,children:[s.jsx(ms,{title:"Scenarios",value:nt.length,icon:Jj}),s.jsx(ms,{title:"Total Runs",value:bt,icon:G$}),s.jsx(ms,{title:"Pass Rate",value:`${Math.round(mt*100)}%`,icon:kd}),s.jsx(ms,{title:"Avg Tool Calls",value:h$(kn),icon:Ho}),s.jsx(ms,{title:"Avg Latency",value:`${cr}ms`,icon:nD}),s.jsx(ms,{title:"Tool Tokens",value:ra(ma?.totalTokens),icon:Ja})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(Be,{children:[s.jsx(St,{className:"pb-2",children:s.jsx(Nt,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(ze,{className:"flex items-center justify-center",children:[s.jsxs(npe,{width:180,height:180,children:[s.jsx(vo,{data:Ft,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:Ft.map((Z,Ce)=>s.jsx(Fv,{fill:Z.color},Ce))}),s.jsx(Br,{})]}),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"}),Ve," 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"}),ct," failed"]})]})]})]}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-2",children:s.jsx(Nt,{className:"text-base",children:"Tool Usage"})}),s.jsx(ze,{children:s.jsx(tm,{width:"100%",height:180,children:s.jsxs(tpe,{data:xo,layout:"vertical",children:[s.jsx(Qo,{type:"number",tick:{fontSize:11}}),s.jsx(Zo,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Br,{}),s.jsx(bl,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Nt,{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:()=>yo("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]})}),s.jsxs(ze,{className:"p-0",children:[o&&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(bn,{value:O,onValueChange:L,children:[s.jsx(hn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select snapshot"})}),s.jsx(mn,{children:k.map(Z=>s.jsx(Qe,{value:Z.id,children:Z.name},Z.id))})]})]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",disabled:!O||F,onClick:()=>{zn()},children:F?"Comparing...":"Compare Snapshot"}),z&&s.jsxs(Ue,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",z.overall_score]})]}),s.jsxs(qr,{children:[s.jsx(Wr,{children:s.jsxs(Vt,{children:[s.jsx(tt,{className:"w-8"}),s.jsx(tt,{children:"Scenario"}),s.jsx(tt,{children:"Agent"}),s.jsx(tt,{children:"Runs"}),s.jsx(tt,{children:"Pass Rate"}),s.jsx(tt,{children:"Tool Calls"}),s.jsx(tt,{children:"Tool Tokens"}),s.jsx(tt,{children:"Snapshot"})]})}),s.jsx(Vr,{children:nt.map(Z=>{const Ce=Bn(Z.scenarioId,Z.agentName),it=Z.scenarioName||Z.scenarioId;return s.jsx(Ya,{open:C.has(Ce),onOpenChange:()=>Ht(Ce),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(_a,{asChild:!0,children:s.jsxs(Vt,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(Fe,{children:s.jsx(Kt,{className:`h-4 w-4 transition-transform ${C.has(Ce)?"rotate-180":""}`})}),s.jsx(Fe,{className:"font-medium text-sm",children:Z.scenarioName}),s.jsxs(Fe,{className:"text-sm",children:[s.jsx("div",{children:Z.agentName}),(Z.provider||Z.model)&&s.jsx("div",{className:"text-xs text-muted-foreground",children:[Z.provider?Ym(Z.provider):null,Z.model].filter(Boolean).join(" · ")})]}),s.jsx(Fe,{className:"font-mono text-sm",children:Z.runs.length}),s.jsx(Fe,{children:s.jsx(Xs,{rate:Z.passRate})}),s.jsx(Fe,{className:"font-mono text-sm",children:h$(Z.avgToolCalls)}),s.jsx(Fe,{className:"font-mono text-sm",children:ra(Z.toolTokenUsage?.totalTokens)}),s.jsx(Fe,{children:(()=>{const Me=Yt.get(Z.scenarioId);if(!Me)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const zt=Me.status==="Match"?"bg-success/15 text-success":Me.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Ue,{variant:"outline",className:`text-xs ${zt}`,children:[Me.status," · ",Me.score]})})()})]})}),s.jsx(Xa,{asChild:!0,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,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:[it," · ",Z.agentName," · ",Math.round(Z.passRate*100),"% pass rate · ",ra(Z.toolTokenUsage?.totalTokens)," tool tokens"]})]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>yo(`Explain why scenario '${it}' failed (agent: ${Z.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:Z.scenarioId}),children:[s.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})]}),(()=>{const Me=Yt.get(Z.scenarioId);return!Me||Me.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: ",Me.baseline_agents.join(", ")||"—"," · observed agents: ",Me.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:Me.reasons.map((zt,At)=>s.jsxs("li",{children:["• ",zt]},At))})]})})(),Z.runs.map(Me=>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:Me.passed?s.jsx(Ho,{className:"h-4 w-4 text-success"}):s.jsx(pc,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const zt=Fn.get(Z.scenarioId),At=zt?Oxe(zt.evalRules,Me.failureReasons):[],Cn=At.filter(un=>un.status==="failed"),mr=At.filter(un=>un.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 #",Me.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[Me.duration,"ms"]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ra(Me.toolTokenUsage?.totalTokens)," tool tokens"]}),!Me.passed&&s.jsx(Ue,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),Me.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(pc,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:Me.failureReasons.map((un,bo)=>s.jsxs("li",{children:["• ",x$(un)]},bo))})]}),At.length>0&&s.jsx(Ya,{open:rn(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"checks")),onOpenChange:()=>He(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(_a,{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(Kt,{className:`h-3.5 w-3.5 transition-transform ${rn(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Ue,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[mr.length," passed"]}),s.jsxs(Ue,{variant:"outline",className:`h-5 text-[10px] ${Cn.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[Cn.length," failed"]})]})}),s.jsx(Xa,{children:s.jsx("div",{className:"space-y-1",children:At.map((un,bo)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${un.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:[un.status==="failed"?s.jsx(pc,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(Ho,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:Ixe(un.rule)})]}),un.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:x$(un.failureReason)})]}),s.jsx(Ue,{variant:"outline",className:`shrink-0 text-[10px] ${un.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:un.status})]},`${un.rule.type}-${un.rule.value??un.rule.path??""}-${bo}`))})})]})})]})})(),s.jsx(Ya,{open:rn(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"extracts")),onOpenChange:()=>He(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(_a,{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(Kt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${rn(Bt(Z.scenarioId,Z.agentName,Me.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(Jj,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(Ue,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(Me.extractedValues??{}).length," total"]})]})}),s.jsx(Xa,{children:Object.keys(Me.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(Me.extractedValues??{}).map(([zt,At])=>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:zt}),s.jsx("div",{className:"font-mono break-all text-foreground",children:At===null?"null":String(At)})]},zt))})})]})}),s.jsx(Ya,{open:rn(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"tools")),onOpenChange:()=>He(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(_a,{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(Kt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${rn(Bt(Z.scenarioId,Z.agentName,Me.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(Ja,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Ue,{variant:"outline",className:"h-5 text-[10px]",children:[Me.toolCalls.length," total"]})]})}),s.jsx(Xa,{children:Me.toolCalls.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"flex flex-wrap gap-1",children:s.jsx(su,{delayDuration:0,children:Me.toolCalls.map((zt,At)=>{const Cn=Me.conversation.filter(un=>un.kind==="tool_call")[At]?.estimatedTokens,mr=typeof Cn?.totalTokens=="number";return s.jsxs(ou,{children:[s.jsx(iu,{asChild:!0,children:s.jsxs(Ue,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",At+1]}),zt.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[zt.duration,"ms"]}),mr&&s.jsxs("span",{className:"ml-1 text-muted-foreground",children:["· ",ra(Cn?.totalTokens),"tok"]})]})}),mr&&s.jsx(pl,{className:"text-xs",children:`${zt.name} · tokens total: ${ra(Cn?.totalTokens)} · in: ${ra(Cn?.inputTokens)} · out: ${ra(Cn?.outputTokens)}`})]},At)})})}),s.jsxs("div",{className:"rounded-md border bg-background p-2",children:[s.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Tool token estimate"}),s.jsx(Ue,{variant:"outline",className:"h-5 text-[10px]",children:"estimated"})]}),Object.keys(Me.toolTokenUsageByTool??{}).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"n/a"}):s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(Me.toolTokenUsageByTool??{}).map(([zt,At])=>s.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"font-mono text-[11px]",children:zt}),s.jsxs("div",{className:"text-muted-foreground",children:["total: ",ra(At.totalTokens)," · in: ",ra(At.inputTokens)," · out: ",ra(At.outputTokens)]})]},zt))})]})]})})]})}),s.jsx(Ya,{open:rn(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"final")),onOpenChange:()=>He(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(_a,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(Kt,{className:`h-3.5 w-3.5 transition-transform ${rn(Bt(Z.scenarioId,Z.agentName,Me.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(Pr,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(Xa,{children:s.jsx(nN,{text:Me.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Ya,{open:rn(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"conversation")),onOpenChange:()=>He(Bt(Z.scenarioId,Z.agentName,Me.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(_a,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(Kt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${rn(Bt(Z.scenarioId,Z.agentName,Me.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:()=>yo(`Explain Run #${Me.runIndex+1} for scenario '${it}'. It ${Me.passed?"passed":"failed"} in ${Me.duration}ms. Focus on the tool sequence and ${Me.passed?"why it passed":"what caused the failure"}.`,{scenarioId:Z.scenarioId}),children:[s.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"Ask Assistant"]})})]}),s.jsx(Xa,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:Me.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):Me.conversation.map(zt=>s.jsx(kxe,{item:zt,fallbackUserPrompt:Fn.get(Z.scenarioId)?.prompt},zt.id))})}),!rn(Bt(Z.scenarioId,Z.agentName,Me.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},Me.runIndex))]})})})})]})},Ce)})})]})]})]})]}),J&&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(wg,{value:de,onValueChange:Z=>fe(Z),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(Gf,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(Ns,{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(Ns,{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"}),s.jsx(Ns,{value:"note",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:"Note"})]})}),de==="assistant"?s.jsx(k6,{title:"MCP Lab Assistant",description:"Ask questions about this run result, failures, tool usage, and snapshot drift.",expanded:I,onToggleExpanded:()=>te(Z=>!Z),onHide:()=>H(!1),messages:_e,pendingToolCalls:Le,loading:cn,input:Lt,onInputChange:we,onSend:()=>{_t()},inputPlaceholder:"Ask about this result...",snippets:Exe,onSnippetSelect:tn,onApproveToolCall:Z=>{$t(Z)},onDenyToolCall:Z=>{Wt(Z)},chatEndRef:Sn,inputRef:Or,className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",renderMessage:({message:Z,index:Ce,linkedPendingToolCall:it,isUser:Me,isAssistant:zt,isSystem:At,isTool:Cn})=>{const mr=zt&&!!Z.pendingToolCallId;if(Cn&&/^(Approved|Denied) tool call\\b/i.test(String(Z.text??"").trim()))return null;const un=it?.tool??Z.toolRequestName,bo=it?.publicToolName??Z.toolRequestPublicName,Nl=zt&&!mr&&Txe(Z.text,!!me);if(mr){const Nu=it?.status==="pending",Cu=Rh(un??bo??"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(Pr,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!it,className:"group min-w-0 w-full max-w-[92%] overflow-hidden 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 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ja,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${Cu}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Nu?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:Nu?"Needs approval":"Completed"})]})}),s.jsx(Kt,{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(Ta,{text:Z.text,className:"text-sm"}),Nu&&it&&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(it.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:cn,onClick:()=>{Wt(it.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:cn,onClick:()=>{$t(it.id)},children:"Approve"})]})]})]})]})]},`${Z.id??`${Z.role}-${Ce}`}:${it?"pending":"completed"}`)}const fi=Me||zt&&!Cn&&!At;return s.jsxs("div",{className:`flex items-start gap-2 ${Me?"justify-end":"justify-start"}`,children:[!Me&&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:At?s.jsx(uN,{className:"h-3 w-3"}):s.jsx(Pr,{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 ${Me?"border-primary/20 bg-primary/10":At?"border-amber-400/30 bg-amber-50/70":Cn?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(Me||At)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${Me?"text-right":""}`,children:Cn?"Tool":"Assistant"}),s.jsx(Ta,{text:Z.text,className:"text-sm"}),Nl&&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:()=>Jf(Z.text),children:[s.jsx(zr,{className:"h-4 w-4 text-amber-500"}),"Send to Scenario Assistant"]}),s.jsxs(se,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>di(Z.text),children:[s.jsx(Ja,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Nl&&zt&&!mr&&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:()=>di(Z.text),children:[s.jsx(Ja,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),fi&&s.jsx(se,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{Jr(Z.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Cs,{className:"h-3.5 w-3.5"})})]}),Me&&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(jc,{className:"h-3 w-3"})})]},Z.id??`${Z.role}-${Ce}`)},renderMessageExtras:Su.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)"}),Su.map(Z=>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:Rh(Z.publicToolName)}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[Z.server,"::",Rh(Z.tool)]})]}),s.jsx(Kt,{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(Z.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:cn,onClick:()=>{Wt(Z.id)},children:"Deny"}),s.jsx(se,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:cn,onClick:()=>{$t(Z.id)},children:"Approve"})]})]})]},Z.id))]}):null}):de==="reports"?s.jsxs(Be,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{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(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(oc,{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:()=>te(Z=>!Z),children:[I?s.jsx(Zj,{className:"h-3.5 w-3.5"}):s.jsx(eS,{className:"h-3.5 w-3.5"}),I?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>H(!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(ze,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(dt||Ye.length===0||Ye.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:dt?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):Ye.length===0?s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No reference reports for this run yet."}),s.jsxs(se,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>va(),children:[s.jsx(ao,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:Ye.length>1?s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Selected report"}),s.jsxs(bn,{value:jt,onValueChange:It,children:[s.jsx(hn,{className:"h-8",children:s.jsx(wn,{placeholder:"Select a report"})}),s.jsx(mn,{children:Ye.map(Z=>s.jsx(Qe,{value:Z.relativePath,children:Z.name},Z.path))})]})]}):null})}),s.jsx(JC,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:Ye.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):ee?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(wr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):Ne?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",Ne]}):Dt?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:Dt.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:Dt.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(Dt.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(Ta,{text:Dt.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):s.jsxs(Be,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(St,{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(Nt,{className:"flex items-center gap-2 text-base",children:[s.jsx(oc,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),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:()=>te(Z=>!Z),children:[I?s.jsx(Zj,{className:"h-3.5 w-3.5"}):s.jsx(eS,{className:"h-3.5 w-3.5"}),I?"Compact":"Expand"]}),s.jsx(se,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>H(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Add context for this run, such as server version or environment details."})]})}),s.jsx(ze,{className:"flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1",children:g?s.jsxs("div",{className:"w-full max-w-xl space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-xs font-medium",children:"Run note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[j.length,"/500"]})]}),s.jsx(ks,{value:j,onChange:Z=>b(Z.target.value.slice(0,500)),placeholder:"Optional context for this run",rows:3,className:"min-h-20 resize"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(se,{size:"sm",onClick:()=>{Ig()},disabled:y,children:y?"Saving...":"Save note"}),s.jsx(se,{size:"sm",variant:"outline",onClick:()=>{b(d.runNote??""),x(!1)},disabled:y,children:"Cancel"})]})]}):s.jsxs("div",{className:"flex w-full max-w-3xl items-center gap-2 rounded-md border bg-muted/20 px-2 py-1 text-xs",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Run note:"}),s.jsx("span",{className:`break-words ${d.runNote?"text-foreground":"text-muted-foreground"}`,children:d.runNote||"none"})]}),s.jsx(se,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>x(!0),children:d.runNote?"Edit":"Add note"})]})})]})]}),s.jsx(Ds,{open:oe,onOpenChange:Z=>!B&&re(Z),children:s.jsxs(as,{className:"max-w-2xl",children:[s.jsxs(ss,{children:[s.jsx(is,{children:he?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(ls,{children:he?"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:[!he&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(pt,{value:le,onChange:Z=>Ae(Z.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:B})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Gr,{checked:be,onCheckedChange:Z=>We(Z===!0),disabled:B}),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:he?"Markdown content":"Markdown preview (to be written)"}),s.jsx(ks,{value:ne,onChange:Z=>ve(Z.target.value),rows:10,className:"font-mono text-xs",disabled:B})]})]}),s.jsxs(os,{children:[s.jsx(us,{disabled:B,children:"Cancel"}),s.jsx(cs,{onClick:Z=>{Z.preventDefault(),Rg()},disabled:B,children:B?"Writing...":he?"Save Report":"Approve & Write"})]})]})})]})]})};function kxe({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call"){const d=m$(e,"input");return s.jsx(g$,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}${d}`,text:e.text})}if(e.kind==="tool_result"){const d=m$(e,"output"),f=e.ok?s.jsx(Ho,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(pc,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(g$,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}${d}`,text:e.text,icon:f})}const n=e.kind==="user_prompt",r=v$(e.text,e.kind),a=t?v$(t,"user_prompt"):"",o=n&&!r&&a?a:r,i=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?jc:Pr;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:i}),n?s.jsx(nN,{text:o,maxLength:280,className:"text-xs"}):s.jsx(nN,{text:o,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 m$(e,t){const n=t==="input"?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n!="number"?"":` · ${ra(n)} tokens`}function v$(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 Txe(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 i=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 i&&(c||d||f)}function g$({variant:e,title:t,text:n,icon:r}){const[a,o]=m.useState(!1),i={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(Ya,{open:a,onOpenChange:o,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${i[e]}`,children:[s.jsx(_a,{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(Ja,{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(Xa,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function nN({text:e,maxLength:t,className:n}){const[r,a]=m.useState(!1),o=e.length>t,i=r||!o?e:`${e.slice(0,t)}...`;return s.jsxs("div",{children:[s.jsx(Ta,{text:i,className:n}),o&&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 Oxe(e,t){return e.map(n=>{const r=Rxe(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function Rxe(e,t){const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:e.type==="response_contains"?`Contains assertion failed: ${e.value}`:e.type==="response_not_contains"?`Not-contains assertion failed: ${e.value}`:e.type==="response_starts_with"?`Starts-with assertion failed: ${e.value}`:e.type==="response_ends_with"?`Ends-with assertion failed: ${e.value}`:e.type==="response_equals"?`Equals assertion failed: ${e.value}`:e.type==="response_regex"?`Regex assertion failed: ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals assertion failed: ${e.path}`:`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath assertion failed: ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not-exists assertion failed: ${e.path}`:"",r=t.find(a=>a===n);if(r)return r;if(e.type==="response_regex")return t.find(a=>a.startsWith("Regex assertion failed:")&&a.includes(e.value??""));if(e.type==="response_jsonpath"||e.type==="response_jsonpath_exists"||e.type==="response_jsonpath_not_exists")return t.find(a=>a.includes(e.path??""))}function Ixe(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="response_contains"?`Text contains · ${e.value}`:e.type==="response_not_contains"?`Text does not contain · ${e.value}`:e.type==="response_starts_with"?`Text starts with · ${e.value}`:e.type==="response_ends_with"?`Text ends with · ${e.value}`:e.type==="response_equals"?`Text equals · ${e.value}`:e.type==="response_regex"?`Text matches regex · ${e.value}`:e.type==="response_jsonpath"?e.equals!==void 0?`JSONPath equals · ${e.path} == ${String(e.equals)}`:`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_exists"?`JSONPath exists · ${e.path}`:e.type==="response_jsonpath_not_exists"?`JSONPath not exists · ${e.path}`:`${e.type} · ${e.value}`}function x$(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const Hj=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"];function Mxe(e,t){return e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function $xe(e){const t=Array.from(new Map(e.scenarios.map(d=>{const f=String(d.scenarioId??"").trim(),h=String(d.scenarioName??"").trim();return!f&&!h?null:[f||h,h||f]}).filter(d=>!!d)).values()),n=Array.from(new Set(e.scenarios.map(d=>d.agentId).filter(Boolean))),r=Array.from(new Set(e.scenarios.map(d=>d.model).filter(d=>!!d))),a=t.slice(0,2).join(", "),o=t.length>2?` +${t.length-2}`:"",i=r.slice(0,2).join(", "),c=r.length>2?` +${r.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:a?`${a}${o}`:"n/a",modelSummary:i?`${i}${c}`:""}}function Dxe(e){const t=e.find(n=>n.provider&&n.model)??e.find(n=>n.provider||n.model);return{provider:t?.provider,model:t?.model}}const Lxe=()=>{const{source:e}=$n(),[t,n]=ni(),r=t.get("mode")==="within-run"?"within-run":"runs",[a,o]=m.useState([]),[i,c]=m.useState(!1),[d,f]=m.useState(new Set),[h,p]=m.useState("timestamp"),[g,x]=m.useState("desc"),[j,b]=m.useState("all"),[y,S]=m.useState(!1),C=t.get("runId")??"",N=(t.get("agents")??"").split(",").map(B=>B.trim()).filter(Boolean),E=t.get("scenario")??"all",[A,k]=m.useState(C),[T,O]=m.useState(N),[L,z]=m.useState(E),[q,F]=m.useState(!1),G=async()=>{c(!0);try{o(await e.listResults())}catch(B){Pe({title:"Could not load results",description:B instanceof Error?B.message:String(B),variant:"destructive"})}finally{c(!1)}};m.useEffect(()=>{let B=!0;return c(!0),e.listResults().then(ie=>{B&&o(ie)}).catch(ie=>{B&&Pe({title:"Could not load results",description:ie instanceof Error?ie.message:String(ie),variant:"destructive"})}).finally(()=>{B&&c(!1)}),()=>{B=!1}},[e]);const W=B=>{if(h===B){x(ie=>ie==="asc"?"desc":"asc");return}p(B),x(B==="timestamp"?"desc":"asc")},R=B=>{f(ie=>{const he=new Set(ie);return he.has(B)?he.delete(B):he.add(B),he})},M=m.useMemo(()=>{const B=new Set;return a.forEach(ie=>{ie.scenarios.forEach(he=>{const Te=String(he.scenarioName??"").trim(),Ye=String(he.scenarioId??"").trim(),ut=Te||Ye;ut&&B.add(ut)})}),Array.from(B).sort((ie,he)=>ie.localeCompare(he))},[a]),K=m.useMemo(()=>j==="all"?a:a.filter(B=>B.scenarios.some(ie=>{const he=String(ie.scenarioName??"").trim(),Te=String(ie.scenarioId??"").trim();return(he||Te)===j})),[a,j]),V=m.useMemo(()=>[...K].sort((B,ie)=>{let he=0;return h==="id"&&(he=B.id.localeCompare(ie.id)),h==="timestamp"&&(he=new Date(B.timestamp).getTime()-new Date(ie.timestamp).getTime()),h==="passRate"&&(he=B.overallPassRate-ie.overallPassRate),h==="scenarios"&&(he=B.totalScenarios-ie.totalScenarios),g==="asc"?he:-he}),[K,h,g]),D=m.useMemo(()=>V.filter(B=>d.has(B.id)),[V,d]),J=B=>h!==B?s.jsx(fc,{className:"h-3.5 w-3.5 text-muted-foreground"}):g==="asc"?s.jsx(bs,{className:"h-3.5 w-3.5"}):s.jsx(Kt,{className:"h-3.5 w-3.5"}),H=m.useMemo(()=>{const B=new Map;for(const ie of V)B.set(ie.id,$xe(ie));return B},[V]),I=B=>{const ie=Array.from(new Set(B.scenarios.map(he=>he.agentId).filter(Boolean)));return ie.slice(0,Math.min(2,ie.length))},te=B=>{const ie=I(B);k(B.id),O(ie),z("all");const he=new URLSearchParams(t);he.set("mode","within-run"),he.set("runId",B.id),ie.length>0?he.set("agents",ie.join(",")):he.delete("agents"),he.delete("scenario"),n(he,{replace:!0})},de=m.useMemo(()=>[...new Set(D.flatMap(B=>B.scenarios.map(ie=>ie.scenarioId)))],[D]),fe=m.useMemo(()=>{const B=new Map;for(const ie of D)for(const he of ie.scenarios){const Te=String(he.scenarioId??"").trim();if(!Te)continue;const Ye=String(he.scenarioName??"").trim();B.set(Te,Ye||Te)}return B},[D]),me=m.useMemo(()=>a.find(B=>B.id===A),[a,A]),U=m.useMemo(()=>{if(!me)return[];const B=new Map;for(const ie of me.scenarios)B.set(ie.agentId,ie.agentName||ie.agentId);return Array.from(B.entries()).map(([ie,he])=>({id:ie,name:he})).sort((ie,he)=>ie.name.localeCompare(he.name))},[me]),oe=m.useMemo(()=>{if(!me)return[];const B=new Set;for(const ie of me.scenarios){const he=String(ie.scenarioName??"").trim(),Te=String(ie.scenarioId??"").trim(),Ye=he||Te;Ye&&B.add(Ye)}return Array.from(B).sort((ie,he)=>ie.localeCompare(he))},[me]),re=m.useMemo(()=>T.join(","),[T]);m.useEffect(()=>{if(r==="within-run"){const B=t.get("runId")??"",ie=(t.get("agents")??"").split(",").map(Te=>Te.trim()).filter(Boolean),he=t.get("scenario")??"all";k(Te=>Te===B?Te:B),O(Te=>Mxe(Te,ie)?Te:ie),z(Te=>Te===he?Te:he)}},[r,t]),m.useEffect(()=>{if(r!=="within-run"||a.length===0)return;let B=A;(!B||!a.some(ht=>ht.id===B))&&(B=a[0].id);const ie=a.find(ht=>ht.id===B),he=(()=>{if(!ie)return[];const ht=new Map;for(const jt of ie.scenarios)ht.set(jt.agentId,jt.agentName||jt.agentId);return Array.from(ht.keys())})(),Te=new Set(he);let Ye=re.split(",").map(ht=>ht.trim()).filter(ht=>!!ht).filter(ht=>Te.has(ht));Ye.length===0&&he.length>0&&(Ye=he.slice(0,Math.min(2,he.length)));const ut=(()=>{if(!ie)return new Set;const ht=new Set;for(const jt of ie.scenarios){const It=String(jt.scenarioName??"").trim(),Dt=String(jt.scenarioId??"").trim(),qt=It||Dt;qt&&ht.add(qt)}return new Set(ht)})(),dt=L!=="all"&&!ut.has(L)?"all":L;B!==A&&k(B),Ye.join(",")!==re&&O(Ye),dt!==L&&z(dt)},[r,a,A,re,L]),m.useEffect(()=>{const B=new URLSearchParams(t);r==="within-run"?(B.set("mode","within-run"),A?B.set("runId",A):B.delete("runId"),T.length>0?B.set("agents",T.join(",")):B.delete("agents"),L!=="all"?B.set("scenario",L):B.delete("scenario")):(B.delete("mode"),B.delete("runId"),B.delete("agents"),B.delete("scenario"));const ie=t.toString(),he=B.toString();ie!==he&&n(B,{replace:!0})},[r,A,T,L,t,n]);const ne=m.useMemo(()=>{if(!me)return[];const B=new Map;for(const he of me.scenarios){const Te=String(he.scenarioId??"").trim(),Ye=String(he.scenarioName??"").trim(),ut=Ye||Te;if(!Te&&!ut)continue;const dt=Te||ut,ht=B.get(dt);if(ht){ht.byAgent[he.agentId]=he;continue}B.set(dt,{scenarioId:Te||ut,scenarioName:Ye,displayLabel:ut||Te,byAgent:{[he.agentId]:he}})}const ie=Array.from(B.values()).sort((he,Te)=>{const Ye=(he.displayLabel||he.scenarioId).toLowerCase(),ut=(Te.displayLabel||Te.scenarioId).toLowerCase();return Ye.localeCompare(ut)});return L==="all"?ie:ie.filter(he=>he.displayLabel===L)},[me,L]),ve=m.useMemo(()=>{const B=new Map(U.map(ie=>[ie.id,ie]));return T.map(ie=>B.get(ie)).filter(ie=>!!ie)},[T,U]),le=m.useMemo(()=>{if(!me||ve.length!==2)return null;const[B,ie]=ve;return{left:B,right:ie,link:`/compare/results?left=${encodeURIComponent(me.id)}&right=${encodeURIComponent(me.id)}&leftConfig=${encodeURIComponent(me.configId)}&rightConfig=${encodeURIComponent(me.configId)}&leftAgent=${encodeURIComponent(B.id)}&rightAgent=${encodeURIComponent(ie.id)}`}},[me,ve]),Ae=m.useMemo(()=>!me||ve.length===0?[]:ve.map(B=>{const ie=ne.map(It=>It.byAgent[B.id]).filter(It=>!!It),he=ie.flatMap(It=>It.runs),Te=he.length,Ye=he.filter(It=>It.passed).length,ut=he.reduce((It,Dt)=>It+Dt.toolCalls.length,0),dt=he.reduce((It,Dt)=>It+Dt.duration,0),{provider:ht,model:jt}=Dxe(ie);return{agentId:B.id,agentName:B.name,provider:ht,model:jt,passRate:Te===0?0:Ye/Te,totalRuns:Te,avgToolCalls:Te===0?0:ut/Te,avgLatency:Te===0?0:dt/Te}}),[me,ve,ne]),be=B=>{O(ie=>ie.includes(B)?ie.filter(he=>he!==B):[...ie,B])},We=B=>s.jsxs("div",{className:"min-w-0 rounded border bg-muted/20 px-2 py-1.5",children:[s.jsxs("div",{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["#",B.runIndex+1]})," ",s.jsx("span",{className:B.passed?"text-emerald-700":"text-destructive",children:B.passed?"PASS":"FAIL"})," ","· tools: ",B.toolCalls.length," · ",B.duration,"ms"]}),!B.passed&&B.failureReasons.length>0&&s.jsx("div",{className:"mt-1 max-h-16 overflow-y-auto whitespace-pre-wrap break-all pr-1 text-[11px] text-muted-foreground",children:B.failureReasons.join("; ")})]},B.runIndex);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(cN,{className:"h-6 w-6"}),"Compare Runs"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:r==="runs"?"Select 2–5 runs to compare":"Compare agents side-by-side within one run"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[r==="within-run"&&s.jsxs(se,{variant:"outline",size:"sm",onClick:()=>{const B=new URLSearchParams(t);B.delete("mode"),B.delete("runId"),B.delete("agents"),B.delete("scenario"),n(B,{replace:!0})},children:[s.jsx(Y$,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]}),r==="runs"&&s.jsxs(Zc,{open:y,onOpenChange:S,children:[s.jsx(eu,{asChild:!0,children:s.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":y,className:"w-[260px] justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:j==="all"?"All scenarios":j}),s.jsx(Kt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(rl,{className:"w-[260px] p-0",align:"start",children:s.jsxs(sl,{children:[s.jsx(ol,{placeholder:"Search scenarios..."}),s.jsxs(il,{children:[s.jsx(ll,{children:"No scenarios found."}),s.jsxs(cl,{children:[s.jsx(ca,{value:"all scenarios",onSelect:()=>{b("all"),S(!1)},children:"All scenarios"}),M.map(B=>s.jsx(ca,{value:B,onSelect:()=>{b(B),S(!1)},children:B},B))]})]})]})})]}),s.jsx(se,{variant:"outline",onClick:()=>{G()},disabled:i,children:i?"Refreshing...":"Refresh"})]})]}),r==="within-run"&&s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Within One Run Controls"})}),s.jsxs(ze,{className:"space-y-4",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(bn,{value:A,onValueChange:k,children:[s.jsx(hn,{children:s.jsx(wn,{placeholder:"Select run"})}),s.jsx(mn,{children:a.map(B=>s.jsx(Qe,{value:B.id,children:B.id},B.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Scenario filter"}),s.jsxs(Zc,{open:q,onOpenChange:F,children:[s.jsx(eu,{asChild:!0,children:s.jsxs(se,{type:"button",variant:"outline",role:"combobox","aria-expanded":q,className:"w-full justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:L==="all"?"All scenarios":L}),s.jsx(Kt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(rl,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:s.jsxs(sl,{children:[s.jsx(ol,{placeholder:"Search scenarios..."}),s.jsxs(il,{children:[s.jsx(ll,{children:"No scenarios found."}),s.jsxs(cl,{children:[s.jsx(ca,{value:"all scenarios",onSelect:()=>{z("all"),F(!1)},children:"All scenarios"}),oe.map(B=>s.jsx(ca,{value:B,onSelect:()=>{z(B),F(!1)},children:B},B))]})]})]})})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Agents (select 2+)"}),s.jsxs("div",{className:"flex flex-wrap gap-3 rounded-md border p-3",children:[U.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),U.map(B=>s.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[s.jsx(Gr,{checked:T.includes(B.id),onCheckedChange:()=>be(B.id)}),s.jsx("span",{children:B.name})]},B.id))]})]})]})]}),r==="runs"&&s.jsx(Be,{children:s.jsx(ze,{className:"p-0",children:s.jsxs(qr,{containerClassName:"max-h-[36rem] overflow-auto",children:[s.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Vt,{children:[s.jsx(tt,{className:"w-10"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>W("id"),children:["Run ID",J("id")]})}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>W("timestamp"),children:["Timestamp",J("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>W("passRate"),children:["Pass Rate",J("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>W("scenarios"),children:["Scenarios",J("scenarios")]})}),s.jsx(tt,{children:"Agents"}),s.jsx(tt,{className:"w-[140px] text-right",children:"Action"})]})}),s.jsx(Vr,{children:V.map(B=>s.jsxs(Vt,{children:[s.jsx(Fe,{children:s.jsx(Gr,{checked:d.has(B.id),onCheckedChange:()=>R(B.id),disabled:!d.has(B.id)&&d.size>=5})}),s.jsx(Fe,{className:"font-mono text-xs",children:B.id}),s.jsx(Fe,{className:"text-[11px] text-muted-foreground",children:(()=>{const ie=H.get(B.id)??{scenarioCount:0,agentCount:0,scenarioPreview:"n/a",modelSummary:""};return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",ie.scenarioCount," scenario",ie.scenarioCount===1?"":"s"," · ",ie.agentCount," agent",ie.agentCount===1?"":"s",ie.modelSummary?` · ${ie.modelSummary}`:""]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:ie.scenarioPreview})]})})()}),s.jsx(Fe,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(uo,{className:"h-3 w-3"}),new Date(B.timestamp).toLocaleString()]})}),s.jsx(Fe,{children:s.jsx(Xs,{rate:B.overallPassRate})}),s.jsx(Fe,{className:"font-mono text-sm",children:B.totalScenarios}),s.jsx(Fe,{className:"font-mono text-sm",children:H.get(B.id)?.agentCount??0}),s.jsx(Fe,{className:"text-right",children:(H.get(B.id)?.agentCount??0)>1?s.jsx(se,{type:"button",size:"sm",variant:"outline",onClick:()=>te(B),children:"Compare agents"}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},B.id))})]})})}),r==="runs"&&D.length===0&&s.jsx(Be,{children:s.jsxs(ze,{className:"py-12 text-center",children:[s.jsx("p",{className:"text-sm font-medium",children:"No runs selected"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Select 2–5 runs from the table above to start a comparison."})]})}),r==="runs"&&D.length>=2&&s.jsxs(s.Fragment,{children:[D.length===2&&s.jsx(Be,{children:s.jsx(ze,{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(Ct,{to:`/compare/results?left=${encodeURIComponent(D[0].id)}&right=${encodeURIComponent(D[1].id)}&leftConfig=${encodeURIComponent(D[0].configId)}&rightConfig=${encodeURIComponent(D[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Summary Comparison"})}),s.jsx(ze,{className:"max-h-[24rem] overflow-auto p-0",children:s.jsxs(qr,{className:"table-fixed",children:[s.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Vt,{children:[s.jsx(tt,{className:"w-[220px]",children:"Metric"}),D.map((B,ie)=>s.jsx(tt,{style:{color:Hj[ie]},className:"font-mono text-xs",children:B.id},B.id))]})}),s.jsxs(Vr,{children:[s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium",children:"Pass Rate"}),D.map(B=>s.jsx(Fe,{children:s.jsx(Xs,{rate:B.overallPassRate})},B.id))]}),s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium",children:"Total Runs"}),D.map(B=>s.jsx(Fe,{className:"font-mono",children:B.totalRuns},B.id))]}),s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium",children:"Tool Calls"}),D.map(B=>s.jsx(Fe,{className:"font-mono",children:B.avgToolCalls.toFixed(1)},B.id))]}),s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium",children:"Avg Latency"}),D.map(B=>s.jsxs(Fe,{className:"font-mono",children:[B.avgLatency,"ms"]},B.id))]})]})]})})]}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(ze,{className:"max-h-[26rem] overflow-auto p-0",children:s.jsxs(qr,{className:"table-fixed",children:[s.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Vt,{children:[s.jsx(tt,{className:"w-[220px]",children:"Scenario"}),D.map((B,ie)=>s.jsx(tt,{style:{color:Hj[ie]},className:"font-mono text-xs",children:B.id},B.id))]})}),s.jsx(Vr,{children:de.map(B=>s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium text-sm",children:fe.get(B)??B}),D.map(ie=>{const he=ie.scenarios.find(Te=>Te.scenarioId===B);return s.jsx(Fe,{children:he?s.jsx(Xs,{rate:he.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ie.id)})]},B))})]})})]})]}),r==="runs"&&D.length>=2&&s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(ze,{className:"h-72",children:s.jsx(tm,{width:"100%",height:"100%",children:s.jsxs(F1,{data:D.map((B,ie)=>({idx:ie+1,runId:B.id,passRate:Number((B.overallPassRate*100).toFixed(1))})),children:[s.jsx(Qo,{dataKey:"idx",tickFormatter:B=>String(B)}),s.jsx(Zo,{unit:"%",domain:[0,100]}),s.jsx(Br,{formatter:B=>[`${B}%`,"Pass Rate"],labelFormatter:B=>`Run ${B}`}),s.jsx(Fi,{}),s.jsx(Zi,{type:"monotone",dataKey:"passRate",stroke:Hj[0],strokeWidth:2.5,dot:!0})]})})})]}),r==="within-run"&&me&&ve.length<2&&s.jsx(Be,{children:s.jsx(ze,{className:"pt-6 text-sm text-muted-foreground",children:"Select at least 2 agents to compare side-by-side within this run."})}),r==="within-run"&&me&&ve.length>=2&&s.jsxs(s.Fragment,{children:[s.jsx(Be,{children:s.jsx(ze,{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 full result details?"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:le?"Open a side-by-side full result view filtered by the selected agents.":"Open the complete run result page for all details and trace navigation."})]}),s.jsx(se,{asChild:!0,size:"sm",children:le?s.jsx(Ct,{to:le.link,children:"Compare full results"}):s.jsx(Ct,{to:`/results/${encodeURIComponent(me.id)}${me.configId?`?configId=${encodeURIComponent(me.configId)}`:""}`,children:"Open full result"})})]})})}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Agent Summary"})}),s.jsx(ze,{className:"max-h-[24rem] overflow-auto p-0",children:s.jsxs(qr,{children:[s.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Vt,{children:[s.jsx(tt,{children:"Metric"}),Ae.map(B=>s.jsxs(tt,{children:[s.jsx("div",{className:"font-medium text-sm",children:B.agentName}),(B.provider||B.model)&&s.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[B.provider?Ym(B.provider):null,B.model].filter(Boolean).join(" · ")})]},B.agentId))]})}),s.jsxs(Vr,{children:[s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium",children:"Pass Rate"}),Ae.map(B=>s.jsx(Fe,{children:s.jsx(Xs,{rate:B.passRate})},B.agentId))]}),s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium",children:"Total Runs"}),Ae.map(B=>s.jsx(Fe,{className:"font-mono",children:B.totalRuns},B.agentId))]}),s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium",children:"Avg Tool Calls"}),Ae.map(B=>s.jsx(Fe,{className:"font-mono",children:B.avgToolCalls.toFixed(1)},B.agentId))]}),s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium",children:"Avg Latency"}),Ae.map(B=>s.jsxs(Fe,{className:"font-mono",children:[Math.round(B.avgLatency),"ms"]},B.agentId))]})]})]})})]}),s.jsxs(Be,{children:[s.jsx(St,{className:"pb-3",children:s.jsx(Nt,{className:"text-base",children:"Scenario × Agent Matrix"})}),s.jsx(ze,{className:"max-h-[34rem] overflow-auto p-0",children:s.jsxs(qr,{className:"table-fixed",children:[s.jsx(Wr,{className:"[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background",children:s.jsxs(Vt,{children:[s.jsx(tt,{className:"w-[260px]",children:"Scenario"}),ve.map(B=>{const ie=Ae.find(he=>he.agentId===B.id);return s.jsxs(tt,{children:[s.jsx("div",{className:"font-medium text-sm",children:B.name}),(ie?.provider||ie?.model)&&s.jsx("div",{className:"font-mono text-xs font-normal text-muted-foreground",children:[ie.provider?Ym(ie.provider):null,ie.model].filter(Boolean).join(" · ")})]},B.id)})]})}),s.jsx(Vr,{children:ne.map(B=>s.jsxs(Vt,{children:[s.jsx(Fe,{className:"font-medium text-sm",children:B.displayLabel}),ve.map(ie=>{const he=B.byAgent[ie.id];return he?s.jsx(Fe,{className:"min-w-0 align-top",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsx(Xs,{rate:he.passRate})," ",s.jsxs("span",{className:"ml-2",children:["runs: ",he.runs.length]})," ","· calls: ",he.avgToolCalls.toFixed(1)," · latency: ",Math.round(he.avgDuration),"ms"]}),he.runs.length>0?s.jsx("div",{className:"space-y-1.5",children:he.runs.map(Te=>We(Te))}):s.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},ie.id):s.jsx(Fe,{children:s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ie.id)})]},B.scenarioId))})]})})]})]})]})},y$=(e,t,n)=>{const r=new URLSearchParams;return t&&r.set("configId",t),n&&r.set("agent",n),r.set("embed","1"),`/results/${encodeURIComponent(e)}?${r.toString()}`},b$=(e,t,n)=>{const r=new URLSearchParams;t&&r.set("configId",t),n&&r.set("agent",n);const a=r.toString();return`/results/${encodeURIComponent(e)}${a?`?${a}`:""}`},Fxe=()=>{const[e]=ni(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),a=e.get("rightConfig"),o=e.get("leftAgent"),i=e.get("rightAgent"),c=o?`${t} · ${o}`:t,d=i?`${n} · ${i}`:n;return!t||!n?s.jsxs(Be,{children:[s.jsx(St,{children:s.jsx(Nt,{className:"text-base",children:"Full Result Compare"})}),s.jsxs(ze,{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(Ct,{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:o||i?"Side-by-side Result Detail views for deep inspection, filtered by selected agents.":"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(Ct,{to:"/compare",children:[s.jsx(Y$,{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:b$(t,r,o),target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(Ih,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(se,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:b$(n,a,i),target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(Ih,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsxs(Be,{className:"overflow-hidden",children:[s.jsx(St,{className:"py-3",children:s.jsx(Nt,{className:"text-sm font-mono",children:c})}),s.jsx(ze,{className:"p-0",children:s.jsx("iframe",{title:`Result ${c}`,src:y$(t,r,o),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(Be,{className:"overflow-hidden",children:[s.jsx(St,{className:"py-3",children:s.jsx(Nt,{className:"text-sm font-mono",children:d})}),s.jsx(ze,{className:"p-0",children:s.jsx("iframe",{title:`Result ${d}`,src:y$(n,a,i),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function Bxe(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function zxe(){const{source:e}=$n(),[t,n]=m.useState([]),[r,a]=m.useState(!0),[o,i]=m.useState(null),[c,d]=m.useState(!1),f=async()=>{a(!0);try{n(await e.listMarkdownReports())}catch(x){Pe({title:"Could not load markdown reports",description:x instanceof Error?x.message:String(x),variant:"destructive"})}finally{a(!1)}};m.useEffect(()=>{f()},[]);const h=m.useMemo(()=>t[0],[t]),p=m.useMemo(()=>t.find(x=>x.relativePath===o)??null,[t,o]),g=async()=>{if(o){d(!0);try{await e.deleteMarkdownReport(o),n(x=>x.filter(j=>j.relativePath!==o)),Pe({title:"Markdown report deleted"}),i(null)}catch(x){Pe({title:"Could not delete markdown report",description:x instanceof Error?x.message:String(x),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(oc,{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(Ct,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),s.jsx(Be,{children:s.jsx(ze,{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(qr,{children:[s.jsx(Wr,{children:s.jsxs(Vt,{children:[s.jsx(tt,{children:"Report"}),s.jsx(tt,{children:"Result"}),s.jsx(tt,{children:"Folder"}),s.jsx(tt,{children:"Timestamp"}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Vr,{children:t.map(x=>s.jsxs(Vt,{children:[s.jsx(Fe,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ct,{to:`/markdown-reports/view?path=${encodeURIComponent(x.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:x.name}),s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:x.relativePath})]})}),s.jsx(Fe,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=Bxe(x.relativePath);return j?s.jsx(Ct,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):s.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),s.jsx(Fe,{className:"text-xs text-muted-foreground font-mono",children:x.relativePath.includes("/")?x.relativePath.slice(0,x.relativePath.lastIndexOf("/")):"."}),s.jsx(Fe,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(uo,{className:"h-3 w-3"}),new Date(x.mtime).toLocaleString()]})}),s.jsx(Fe,{children:s.jsxs(Hf,{children:[s.jsx(Kf,{asChild:!0,children:s.jsx(se,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(nv,{className:"h-4 w-4"})})}),s.jsxs(bu,{align:"end",children:[s.jsx(Kr,{asChild:!0,children:s.jsx(Ct,{to:`/markdown-reports/view?path=${encodeURIComponent(x.relativePath)}`,children:"View"})}),s.jsxs(Kr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),i(x.relativePath)},children:[s.jsx(Oa,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},x.path))})]})})}),s.jsx(Ds,{open:!!o,onOpenChange:x=>!x&&i(null),children:s.jsxs(as,{children:[s.jsxs(ss,{children:[s.jsx(is,{children:"Delete markdown report?"}),s.jsx(ls,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(os,{children:[s.jsx(us,{disabled:c,children:"Cancel"}),s.jsx(cs,{onClick:x=>{x.preventDefault(),g()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function Uxe(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function qxe(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 Wxe(){const{source:e}=$n(),[t]=ni(),n=(t.get("path")??"").trim(),[r,a]=m.useState(null),[o,i]=m.useState(!0),[c,d]=m.useState(!1),[f,h]=m.useState(!1);if(m.useEffect(()=>{let g=!0;if(a(null),d(!1),!n){i(!1);return}return i(!0),e.getMarkdownReport(n).then(x=>{g&&a(x)}).catch(x=>{if(!g)return;const j=x instanceof Error?x.message:String(x);if(j.includes("(404)")){d(!0);return}Pe({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{g&&i(!1)}),()=>{g=!1}},[n,e]),!n)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Missing report path."}),s.jsx(se,{asChild:!0,variant:"outline",children:s.jsx(Ct,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(o)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(Ct,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=qxe(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.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[s.jsx("span",{className:"font-mono",children:r.relativePath}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsxs("span",{className:"inline-flex items-center gap-1 align-middle",children:[s.jsx(uo,{className:"h-3 w-3 shrink-0"}),new Date(r.mtime).toLocaleString()]}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:Uxe(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(Ct,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(Ct,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(Be,{children:s.jsx(ze,{className:"pt-6",children:s.jsx(Ta,{text:r.content,variant:"assistant"})})}),p?s.jsx(D5,{open:f,onOpenChange:h,children:s.jsxs(RN,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(F5,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(B5,{className:"text-base",children:["Result ",p]}),s.jsx(se,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(Ct,{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 Vxe=()=>{const e=Rs();return m.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"})]})})},Hxe=new pH;function Kxe(){const{scenarioId:e}=hl();return s.jsx(s5,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Gxe=()=>s.jsx(mH,{client:Hxe,children:s.jsx(su,{children:s.jsx(_Y,{children:s.jsx(kY,{children:s.jsxs(PY,{children:[s.jsx(y9,{}),s.jsx(J9,{}),s.jsx(vK,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:s.jsxs(iK,{children:[s.jsxs(dn,{element:s.jsx(EY,{}),children:[s.jsx(dn,{path:"/",element:s.jsx(rpe,{})}),s.jsx(dn,{path:"/mcp-evaluations",element:s.jsx(yme,{})}),s.jsx(dn,{path:"/mcp-evaluations/:id",element:s.jsx(HM,{})}),s.jsx(dn,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(HM,{})}),s.jsx(dn,{path:"/tool-analysis",element:s.jsx(vxe,{})}),s.jsx(dn,{path:"/tool-analysis-results",element:s.jsx(gxe,{})}),s.jsx(dn,{path:"/tool-analysis-results/:id",element:s.jsx(xxe,{})}),s.jsx(dn,{path:"/oauth-debugger",element:s.jsx(wxe,{})}),s.jsx(dn,{path:"/libraries/servers",element:s.jsx(Tve,{})}),s.jsx(dn,{path:"/libraries/servers/:serverId",element:s.jsx(Ove,{})}),s.jsx(dn,{path:"/libraries/agents",element:s.jsx(Rve,{})}),s.jsx(dn,{path:"/libraries/agents/:agentName",element:s.jsx(Uge,{})}),s.jsx(dn,{path:"/libraries/test-cases",element:s.jsx(n$,{})}),s.jsx(dn,{path:"/libraries/test-cases/:testCaseId",element:s.jsx(n$,{})}),s.jsx(dn,{path:"/libraries/scenarios",element:s.jsx(s5,{to:"/libraries/test-cases",replace:!0})}),s.jsx(dn,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Kxe,{})}),s.jsx(dn,{path:"/settings",element:s.jsx(qge,{})}),s.jsx(dn,{path:"/settings/mcp",element:s.jsx(Xge,{})}),s.jsx(dn,{path:"/run",element:s.jsx(jxe,{})}),s.jsx(dn,{path:"/results",element:s.jsx(Cxe,{})}),s.jsx(dn,{path:"/results/:id",element:s.jsx(Pxe,{})}),s.jsx(dn,{path:"/markdown-reports",element:s.jsx(zxe,{})}),s.jsx(dn,{path:"/markdown-reports/view",element:s.jsx(Wxe,{})}),s.jsx(dn,{path:"/compare",element:s.jsx(Lxe,{})}),s.jsx(dn,{path:"/compare/results",element:s.jsx(Fxe,{})})]}),s.jsx(dn,{path:"*",element:s.jsx(Vxe,{})})]})})]})})})})});xq.createRoot(document.getElementById("root")).render(s.jsx(Gxe,{}));
|