@inspectr/mcplab 1.30.0 → 1.31.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/README.md +2 -2
- package/dist/app/assets/index-Cwogc_kk.js +267 -0
- package/dist/app/assets/index-D5OYchKq.css +2 -0
- package/dist/app/index.html +2 -2
- package/dist/app-server/app-context.d.ts +6 -22
- package/dist/app-server/app-context.d.ts.map +1 -1
- package/dist/app-server/assistant-agent.d.ts +10 -0
- package/dist/app-server/assistant-agent.d.ts.map +1 -0
- package/dist/app-server/assistant-agent.js +29 -0
- package/dist/app-server/assistant-agent.js.map +1 -0
- package/dist/app-server/assistant-common.d.ts +7 -34
- package/dist/app-server/assistant-common.d.ts.map +1 -1
- package/dist/app-server/assistant-common.js +33 -194
- package/dist/app-server/assistant-common.js.map +1 -1
- package/dist/app-server/assistant-events.d.ts +10 -6
- package/dist/app-server/assistant-events.d.ts.map +1 -1
- package/dist/app-server/assistant-events.js +23 -11
- package/dist/app-server/assistant-events.js.map +1 -1
- package/dist/app-server/assistant-graph-nodes.d.ts +226 -0
- package/dist/app-server/assistant-graph-nodes.d.ts.map +1 -0
- package/dist/app-server/assistant-graph-nodes.js +365 -0
- package/dist/app-server/assistant-graph-nodes.js.map +1 -0
- package/dist/app-server/assistant-graph-state.d.ts +64 -0
- package/dist/app-server/assistant-graph-state.d.ts.map +1 -0
- package/dist/app-server/assistant-graph-state.js +137 -0
- package/dist/app-server/assistant-graph-state.js.map +1 -0
- package/dist/app-server/assistant-mcp-context-tools.d.ts +17 -0
- package/dist/app-server/assistant-mcp-context-tools.d.ts.map +1 -0
- package/dist/app-server/assistant-mcp-context-tools.js +149 -0
- package/dist/app-server/assistant-mcp-context-tools.js.map +1 -0
- package/dist/app-server/assistant-model.d.ts +24 -0
- package/dist/app-server/assistant-model.d.ts.map +1 -0
- package/dist/app-server/assistant-model.js +240 -0
- package/dist/app-server/assistant-model.js.map +1 -0
- package/dist/app-server/assistant-runtime-contract.d.ts +46 -0
- package/dist/app-server/assistant-runtime-contract.d.ts.map +1 -0
- package/dist/app-server/assistant-runtime-contract.js +2 -0
- package/dist/app-server/assistant-runtime-contract.js.map +1 -0
- package/dist/app-server/assistant-runtime-policy.d.ts +22 -0
- package/dist/app-server/assistant-runtime-policy.d.ts.map +1 -0
- package/dist/app-server/assistant-runtime-policy.js +71 -0
- package/dist/app-server/assistant-runtime-policy.js.map +1 -0
- package/dist/app-server/assistant-service.d.ts +23 -0
- package/dist/app-server/assistant-service.d.ts.map +1 -0
- package/dist/app-server/assistant-service.js +185 -0
- package/dist/app-server/assistant-service.js.map +1 -0
- package/dist/app-server/assistant-session-routes.d.ts +25 -0
- package/dist/app-server/assistant-session-routes.d.ts.map +1 -0
- package/dist/app-server/assistant-session-routes.js +210 -0
- package/dist/app-server/assistant-session-routes.js.map +1 -0
- package/dist/app-server/assistant-tracing.d.ts +5 -0
- package/dist/app-server/assistant-tracing.d.ts.map +1 -0
- package/dist/app-server/assistant-tracing.js +30 -0
- package/dist/app-server/assistant-tracing.js.map +1 -0
- package/dist/app-server/browser-provider-learning.js +1 -1
- package/dist/app-server/browser-provider-learning.js.map +1 -1
- package/dist/app-server/langchain-assistant-runtime.d.ts +11 -0
- package/dist/app-server/langchain-assistant-runtime.d.ts.map +1 -0
- package/dist/app-server/langchain-assistant-runtime.js +852 -0
- package/dist/app-server/langchain-assistant-runtime.js.map +1 -0
- package/dist/app-server/one-shot-json.d.ts +26 -0
- package/dist/app-server/one-shot-json.d.ts.map +1 -0
- package/dist/app-server/one-shot-json.js +168 -0
- package/dist/app-server/one-shot-json.js.map +1 -0
- package/dist/app-server/result-assistant-domain.d.ts +46 -48
- package/dist/app-server/result-assistant-domain.d.ts.map +1 -1
- package/dist/app-server/result-assistant-domain.js +148 -133
- package/dist/app-server/result-assistant-domain.js.map +1 -1
- package/dist/app-server/result-assistant.d.ts +2 -2
- package/dist/app-server/result-assistant.d.ts.map +1 -1
- package/dist/app-server/result-assistant.js +43 -311
- package/dist/app-server/result-assistant.js.map +1 -1
- package/dist/app-server/router.d.ts.map +1 -1
- package/dist/app-server/router.js +14 -16
- package/dist/app-server/router.js.map +1 -1
- package/dist/app-server/runs-routes.js +1 -1
- package/dist/app-server/runs-routes.js.map +1 -1
- package/dist/app-server/scenario-assistant-domain.d.ts +43 -136
- package/dist/app-server/scenario-assistant-domain.d.ts.map +1 -1
- package/dist/app-server/scenario-assistant-domain.js +377 -215
- package/dist/app-server/scenario-assistant-domain.js.map +1 -1
- package/dist/app-server/scenario-assistant.d.ts +3 -3
- package/dist/app-server/scenario-assistant.d.ts.map +1 -1
- package/dist/app-server/scenario-assistant.js +52 -406
- package/dist/app-server/scenario-assistant.js.map +1 -1
- package/dist/app-server/settings-store.d.ts.map +1 -1
- package/dist/app-server/settings-store.js +2 -5
- package/dist/app-server/settings-store.js.map +1 -1
- package/dist/app-server/tool-analysis-domain.d.ts +1 -1
- package/dist/app-server/tool-analysis-domain.d.ts.map +1 -1
- package/dist/app-server/tool-analysis-domain.js +5 -4
- package/dist/app-server/tool-analysis-domain.js.map +1 -1
- package/dist/app-server/types.d.ts +1 -1
- package/dist/app-server/types.d.ts.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/package.json +10 -4
- package/dist/app/assets/index-8I9ZyPIK.js +0 -243
- package/dist/app/assets/index-jX7LoIQP.css +0 -2
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=j(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=j(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P={current:null},F={transition:null},I={ReactCurrentDispatcher:P,ReactCurrentBatchConfig:F,ReactCurrentOwner:C};function L(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,e.act=L,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},e.unstable_act=L,e.useCallback=function(e,t){return P.current.useCallback(e,t)},e.useContext=function(e){return P.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return P.current.useDeferredValue(e)},e.useEffect=function(e,t){return P.current.useEffect(e,t)},e.useId=function(){return P.current.useId()},e.useImperativeHandle=function(e,t,n){return P.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return P.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return P.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return P.current.useMemo(e,t)},e.useReducer=function(e,t,n){return P.current.useReducer(e,t,n)},e.useRef=function(e){return P.current.useRef(e)},e.useState=function(e){return P.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return P.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return P.current.useTransition()},e.version=`18.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m){if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d(),n=p();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,f={},m={};function h(e){return l.call(m,e)?!0:l.call(f,e)?!1:u.test(e)?m[e]=!0:(f[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type!==3&&``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),N=Symbol.for(`react.suspense_list`),P=Symbol.for(`react.memo`),F=Symbol.for(`react.lazy`),I=Symbol.for(`react.offscreen`),L=Symbol.iterator;function R(e){return typeof e!=`object`||!e?null:(e=L&&e[L]||e[`@@iterator`],typeof e==`function`?e:null)}var z=Object.assign,B;function ee(e){if(B===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);B=t&&t[1]||``}return`
|
|
2
|
-
`+B+e}var te=!1;function ne(e,t){if(!e||te)return``;te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t){if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
3
|
-
`),a=r.stack.split(`
|
|
4
|
-
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
5
|
-
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{te=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ee(e):``}function re(e){switch(e.tag){case 5:return ee(e.type);case 16:return ee(`Lazy`);case 13:return ee(`Suspense`);case 19:return ee(`SuspenseList`);case 0:case 2:case 15:return e=ne(e.type,!1),e;case 11:return e=ne(e.type.render,!1),e;case 1:return e=ne(e.type,!0),e;default:return``}}function ie(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}function ae(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ie(t);case 8:return t===D?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function oe(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function se(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function V(e){var t=se(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ce(e){e._valueTracker||=V(e)}function le(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=se(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function ue(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function H(e,t){var n=t.checked;return z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function de(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=oe(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function fe(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function pe(e,t){fe(e,t);var n=oe(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?he(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&he(e,t.type,oe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function me(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function he(e,t,n){(t!==`number`||ue(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var ge=Array.isArray;function _e(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+oe(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ve(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return z({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function ye(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(ge(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:oe(n)}}function be(e,t){var n=oe(t.value),r=oe(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function xe(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function Se(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function Ce(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?Se(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var we,Te=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(we||=document.createElement(`div`),we.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=we.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ee(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var De={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},Oe=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(De).forEach(function(e){Oe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),De[t]=De[e]})});function ke(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||De.hasOwnProperty(e)&&De[e]?(``+t).trim():t+`px`}function Ae(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=ke(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var je=z({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 Me(e,t){if(t){if(je[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Ne(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Pe=null;function Fe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ie=null,Le=null,Re=null;function ze(e){if(e=U(e)){if(typeof Ie!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Vi(t),Ie(e.stateNode,e.type,t))}}function Be(e){Le?Re?Re.push(e):Re=[e]:Le=e}function Ve(){if(Le){var e=Le,t=Re;if(Re=Le=null,ze(e),t)for(e=0;e<t.length;e++)ze(t[e])}}function He(e,t){return e(t)}function Ue(){}var We=!1;function Ge(e,t,n){if(We)return e(t,n);We=!0;try{return He(e,t,n)}finally{We=!1,(Le!==null||Re!==null)&&(Ue(),Ve())}}function Ke(e,t){var n=e.stateNode;if(n===null)return null;var i=Vi(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var qe=!1;if(c)try{var Je={};Object.defineProperty(Je,"passive",{get:function(){qe=!0}}),window.addEventListener(`test`,Je,Je),window.removeEventListener(`test`,Je,Je)}catch{qe=!1}function Ye(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Xe=!1,Ze=null,Qe=!1,$e=null,et={onError:function(e){Xe=!0,Ze=e}};function tt(e,t,n,r,i,a,o,s,c){Xe=!1,Ze=null,Ye.apply(et,arguments)}function nt(e,t,n,i,a,o,s,c,l){if(tt.apply(this,arguments),Xe){if(Xe){var u=Ze;Xe=!1,Ze=null}else throw Error(r(198));Qe||(Qe=!0,$e=u)}}function rt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function it(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function at(e){if(rt(e)!==e)throw Error(r(188))}function ot(e){var t=e.alternate;if(!t){if(t=rt(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return at(a),e;if(o===i)return at(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function st(e){return e=ot(e),e===null?null:ct(e)}function ct(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ct(e);if(t!==null)return t;e=e.sibling}return null}var lt=n.unstable_scheduleCallback,ut=n.unstable_cancelCallback,dt=n.unstable_shouldYield,ft=n.unstable_requestPaint,pt=n.unstable_now,mt=n.unstable_getCurrentPriorityLevel,ht=n.unstable_ImmediatePriority,gt=n.unstable_UserBlockingPriority,_t=n.unstable_NormalPriority,vt=n.unstable_LowPriority,yt=n.unstable_IdlePriority,bt=null,xt=null;function St(e){if(xt&&typeof xt.onCommitFiberRoot==`function`)try{xt.onCommitFiberRoot(bt,e,void 0,(e.current.flags&128)==128)}catch{}}var Ct=Math.clz32?Math.clz32:Et,wt=Math.log,Tt=Math.LN2;function Et(e){return e>>>=0,e===0?32:31-(wt(e)/Tt|0)|0}var Dt=64,Ot=4194304;function kt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function At(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=kt(a))):r=kt(s)}else o=n&~i,o===0?a!==0&&(r=kt(a)):r=kt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Ct(t),i=1<<n,r|=e[n],t&=~i;return r}function jt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Ct(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=jt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Nt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Pt(){var e=Dt;return Dt<<=1,!(Dt&4194240)&&(Dt=64),e}function Ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function It(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ct(t),e[t]=n}function Lt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Ct(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Rt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ct(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var zt=0;function Bt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Vt,Ht,Ut,Wt,Gt,Kt=!1,qt=[],Jt=null,Yt=null,Xt=null,Zt=new Map,Qt=new Map,$t=[],en=`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 tn(e,t){switch(e){case`focusin`:case`focusout`:Jt=null;break;case`dragenter`:case`dragleave`:Yt=null;break;case`mouseover`:case`mouseout`:Xt=null;break;case`pointerover`:case`pointerout`:Zt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Qt.delete(t.pointerId)}}function nn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=U(t),t!==null&&Ht(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function rn(e,t,n,r,i){switch(t){case`focusin`:return Jt=nn(Jt,e,t,n,r,i),!0;case`dragenter`:return Yt=nn(Yt,e,t,n,r,i),!0;case`mouseover`:return Xt=nn(Xt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Zt.set(a,nn(Zt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Qt.set(a,nn(Qt.get(a)||null,e,t,n,r,i)),!0}return!1}function an(e){var t=zi(e.target);if(t!==null){var n=rt(t);if(n!==null){if(t=n.tag,t===13){if(t=it(n),t!==null){e.blockedOn=t,Gt(e.priority,function(){Ut(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function on(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_n(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Pe=r,n.target.dispatchEvent(r),Pe=null}else return t=U(n),t!==null&&Ht(t),e.blockedOn=n,!1;t.shift()}return!0}function sn(e,t,n){on(e)&&n.delete(t)}function cn(){Kt=!1,Jt!==null&&on(Jt)&&(Jt=null),Yt!==null&&on(Yt)&&(Yt=null),Xt!==null&&on(Xt)&&(Xt=null),Zt.forEach(sn),Qt.forEach(sn)}function ln(e,t){e.blockedOn===t&&(e.blockedOn=null,Kt||(Kt=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,cn)))}function un(e){function t(t){return ln(t,e)}if(0<qt.length){ln(qt[0],e);for(var n=1;n<qt.length;n++){var r=qt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Jt!==null&&ln(Jt,e),Yt!==null&&ln(Yt,e),Xt!==null&&ln(Xt,e),Zt.forEach(t),Qt.forEach(t),n=0;n<$t.length;n++)r=$t[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<$t.length&&(n=$t[0],n.blockedOn===null);)an(n),n.blockedOn===null&&$t.shift()}var dn=C.ReactCurrentBatchConfig,fn=!0;function pn(e,t,n,r){var i=zt,a=dn.transition;dn.transition=null;try{zt=1,hn(e,t,n,r)}finally{zt=i,dn.transition=a}}function mn(e,t,n,r){var i=zt,a=dn.transition;dn.transition=null;try{zt=4,hn(e,t,n,r)}finally{zt=i,dn.transition=a}}function hn(e,t,n,r){if(fn){var i=_n(e,t,n,r);if(i===null)di(e,t,r,gn,n),tn(e,r);else if(rn(i,e,t,n,r))r.stopPropagation();else if(tn(e,r),t&4&&-1<en.indexOf(e)){for(;i!==null;){var a=U(i);if(a!==null&&Vt(a),a=_n(e,t,n,r),a===null&&di(e,t,r,gn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else di(e,t,r,null,n)}}var gn=null;function _n(e,t,n,r){if(gn=null,e=Fe(r),e=zi(e),e!==null){if(t=rt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=it(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}return gn=e,null}function vn(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(mt()){case ht:return 1;case gt:return 4;case _t:case vt:return 16;case yt:return 536870912;default:return 16}default:return 16}}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return xn=i.slice(e,1<r?1-r:void 0)}function Cn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function wn(){return!0}function Tn(){return!1}function En(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?wn:Tn,this.isPropagationStopped=Tn,this}return z(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=wn)},persist:function(){},isPersistent:wn}),t}var Dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=En(Dn),kn=z({},Dn,{view:0,detail:0}),An=En(kn),jn,Mn,Nn,Pn=z({},kn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Nn&&(Nn&&e.type===`mousemove`?(jn=e.screenX-Nn.screenX,Mn=e.screenY-Nn.screenY):Mn=jn=0,Nn=e),jn)},movementY:function(e){return`movementY`in e?e.movementY:Mn}}),Fn=En(Pn),In=En(z({},Pn,{dataTransfer:0})),Ln=En(z({},kn,{relatedTarget:0})),Rn=En(z({},Dn,{animationName:0,elapsedTime:0,pseudoElement:0})),zn=En(z({},Dn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Bn=En(z({},Dn,{data:0})),Vn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Hn={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`},Un={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Un[e])?!!t[e]:!1}function Gn(){return Wn}var Kn=En(z({},kn,{key:function(e){if(e.key){var t=Vn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Hn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gn,charCode:function(e){return e.type===`keypress`?Cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),qn=En(z({},Pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Jn=En(z({},kn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gn})),Yn=En(z({},Dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Xn=En(z({},Pn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Zn=[9,13,27,32],Qn=c&&`CompositionEvent`in window,$n=null;c&&`documentMode`in document&&($n=document.documentMode);var er=c&&`TextEvent`in window&&!$n,tr=c&&(!Qn||$n&&8<$n&&11>=$n),nr=` `,rr=!1;function ir(e,t){switch(e){case`keyup`:return Zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function ar(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var or=!1;function sr(e,t){switch(e){case`compositionend`:return ar(t);case`keypress`:return t.which===32?(rr=!0,nr):null;case`textInput`:return e=t.data,e===nr&&rr?null:e;default:return null}}function cr(e,t){if(or)return e===`compositionend`||!Qn&&ir(e,t)?(e=Sn(),xn=bn=yn=null,or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return tr&&t.locale!==`ko`?null:t.data;default:return null}}var lr={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 ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!lr[e.type]:t===`textarea`}function dr(e,t,n,r){Be(r),t=pi(t,`onChange`),0<t.length&&(n=new On(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var fr=null,pr=null;function mr(e){ai(e,0)}function hr(e){if(le(Bi(e)))return e}function gr(e,t){if(e===`change`)return t}var _r=!1;if(c){var vr;if(c){var yr=`oninput`in document;if(!yr){var br=document.createElement(`div`);br.setAttribute(`oninput`,`return;`),yr=typeof br.oninput==`function`}vr=yr}else vr=!1;_r=vr&&(!document.documentMode||9<document.documentMode)}function xr(){fr&&(fr.detachEvent(`onpropertychange`,Sr),pr=fr=null)}function Sr(e){if(e.propertyName===`value`&&hr(pr)){var t=[];dr(t,pr,e,Fe(e)),Ge(mr,t)}}function Cr(e,t,n){e===`focusin`?(xr(),fr=t,pr=n,fr.attachEvent(`onpropertychange`,Sr)):e===`focusout`&&xr()}function wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return hr(pr)}function Tr(e,t){if(e===`click`)return hr(t)}function Er(e,t){if(e===`input`||e===`change`)return hr(t)}function Dr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Or=typeof Object.is==`function`?Object.is:Dr;function kr(e,t){if(Or(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!Or(e[i],t[i]))return!1}return!0}function Ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jr(e,t){var n=Ar(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Ar(n)}}function Mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nr(){for(var e=window,t=ue();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ue(e.document)}return t}function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Fr(e){var t=Nr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Mr(n.ownerDocument.documentElement,n)){if(r!==null&&Pr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=jr(n,a);var o=jr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ir=c&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==ue(r)||(r=Lr,`selectionStart`in r&&Pr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zr&&kr(zr,r)||(zr=r,r=pi(Rr,`onSelect`),0<r.length&&(t=new On(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Lr)))}function Hr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ur={animationend:Hr(`Animation`,`AnimationEnd`),animationiteration:Hr(`Animation`,`AnimationIteration`),animationstart:Hr(`Animation`,`AnimationStart`),transitionend:Hr(`Transition`,`TransitionEnd`)},Wr={},Gr={};c&&(Gr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),`TransitionEvent`in window||delete Ur.transitionend.transition);function Kr(e){if(Wr[e])return Wr[e];if(!Ur[e])return e;var t=Ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Gr)return Wr[e]=t[n];return e}var qr=Kr(`animationend`),Jr=Kr(`animationiteration`),Yr=Kr(`animationstart`),Xr=Kr(`transitionend`),Zr=new Map,Qr=`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 $r(e,t){Zr.set(e,t),o(t,[e])}for(var ei=0;ei<Qr.length;ei++){var ti=Qr[ei];$r(ti.toLowerCase(),`on`+(ti[0].toUpperCase()+ti.slice(1)))}$r(qr,`onAnimationEnd`),$r(Jr,`onAnimationIteration`),$r(Yr,`onAnimationStart`),$r(`dblclick`,`onDoubleClick`),$r(`focusin`,`onFocus`),$r(`focusout`,`onBlur`),$r(Xr,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`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 ni=`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(` `),ri=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ni));function ii(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,nt(r,t,void 0,e),e.currentTarget=null}function ai(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ii(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ii(i,s,l),a=c}}}if(Qe)throw e=$e,Qe=!1,$e=null,e}function oi(e,t){var n=t[Ii];n===void 0&&(n=t[Ii]=new Set);var r=e+`__bubble`;n.has(r)||(ui(t,e,2,!1),n.add(r))}function si(e,t,n){var r=0;t&&(r|=4),ui(n,e,r,t)}var ci=`_reactListening`+Math.random().toString(36).slice(2);function li(e){if(!e[ci]){e[ci]=!0,i.forEach(function(t){t!==`selectionchange`&&(ri.has(t)||si(t,!1,e),si(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ci]||(t[ci]=!0,si(`selectionchange`,!1,t))}}function ui(e,t,n,r){switch(vn(t)){case 1:var i=pn;break;case 4:i=mn;break;default:i=hn}n=i.bind(null,t,n,e),i=void 0,!qe||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function di(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=zi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Ge(function(){var r=a,i=Fe(n),o=[];a:{var s=Zr.get(e);if(s!==void 0){var c=On,l=e;switch(e){case`keypress`:if(Cn(n)===0)break a;case`keydown`:case`keyup`:c=Kn;break;case`focusin`:l=`focus`,c=Ln;break;case`focusout`:l=`blur`,c=Ln;break;case`beforeblur`:case`afterblur`:c=Ln;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Fn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=In;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Jn;break;case qr:case Jr:case Yr:c=Rn;break;case Xr:c=Yn;break;case`scroll`:c=An;break;case`wheel`:c=Xn;break;case`copy`:case`cut`:case`paste`:c=zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=qn}var u=!!(t&4),d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=Ke(p,f),h!=null&&u.push(fi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Pe&&(l=n.relatedTarget||n.fromElement)&&(zi(l)||l[Fi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?zi(l):null,l!==null&&(d=rt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Fn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=qn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Bi(c),m=l==null?s:Bi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,zi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=mi(m))p++;for(m=0,h=f;h;h=mi(h))m++;for(;0<p-m;)u=mi(u),p--;for(;0<m-p;)f=mi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=mi(u),f=mi(f)}u=null}else u=null;c!==null&&hi(o,s,c,u,!1),l!==null&&d!==null&&hi(o,d,l,u,!0)}}a:{if(s=r?Bi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=gr;else if(ur(s)){if(_r)g=Er;else{g=wr;var _=Cr}}else(c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Tr);if(g&&=g(e,r)){dr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&he(s,`number`,s.value)}switch(_=r?Bi(r):window,e){case`focusin`:(ur(_)||_.contentEditable===`true`)&&(Lr=_,Rr=r,zr=null);break;case`focusout`:zr=Rr=Lr=null;break;case`mousedown`:Br=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Br=!1,Vr(o,n,i);break;case`selectionchange`:if(Ir)break;case`keydown`:case`keyup`:Vr(o,n,i)}var v;if(Qn)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else or?ir(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(tr&&n.locale!==`ko`&&(or||y!==`onCompositionStart`?y===`onCompositionEnd`&&or&&(v=Sn()):(yn=i,bn=`value`in yn?yn.value:yn.textContent,or=!0)),_=pi(r,y),0<_.length&&(y=new Bn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=ar(n),v!==null&&(y.data=v)))),(v=er?sr(e,n):cr(e,n))&&(r=pi(r,`onBeforeInput`),0<r.length&&(i=new Bn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}ai(o,t)})}function fi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function pi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Ke(e,n),a!=null&&r.unshift(fi(e,a,i)),a=Ke(e,t),a!=null&&r.push(fi(e,a,i))),e=e.return}return r}function mi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hi(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=Ke(n,a),c!=null&&o.unshift(fi(n,c,s))):i||(c=Ke(n,a),c!=null&&o.push(fi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var gi=/\r\n?/g,_i=/\u0000|\uFFFD/g;function vi(e){return(typeof e==`string`?e:``+e).replace(gi,`
|
|
6
|
-
`).replace(_i,``)}function yi(e,t,n){if(t=vi(t),vi(e)!==t&&n)throw Error(r(425))}function bi(){}var xi=null,Si=null;function Ci(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wi=typeof setTimeout==`function`?setTimeout:void 0,Ti=typeof clearTimeout==`function`?clearTimeout:void 0,Ei=typeof Promise==`function`?Promise:void 0,Di=typeof queueMicrotask==`function`?queueMicrotask:Ei===void 0?wi:function(e){return Ei.resolve(null).then(e).catch(Oi)};function Oi(e){setTimeout(function(){throw e})}function ki(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),un(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++}n=i}while(n);un(t)}function Ai(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function ji(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Mi=Math.random().toString(36).slice(2),Ni=`__reactFiber$`+Mi,Pi=`__reactProps$`+Mi,Fi=`__reactContainer$`+Mi,Ii=`__reactEvents$`+Mi,Li=`__reactListeners$`+Mi,Ri=`__reactHandles$`+Mi;function zi(e){var t=e[Ni];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fi]||n[Ni]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ji(e);e!==null;){if(n=e[Ni])return n;e=ji(e)}return t}e=n,n=e.parentNode}return null}function U(e){return e=e[Ni]||e[Fi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Bi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Vi(e){return e[Pi]||null}var Hi=[],Ui=-1;function Wi(e){return{current:e}}function Gi(e){0>Ui||(e.current=Hi[Ui],Hi[Ui]=null,Ui--)}function Ki(e,t){Ui++,Hi[Ui]=e.current,e.current=t}var qi={},Ji=Wi(qi),Yi=Wi(!1),Xi=qi;function Zi(e,t){var n=e.type.contextTypes;if(!n)return qi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Qi(e){return e=e.childContextTypes,e!=null}function $i(){Gi(Yi),Gi(Ji)}function ea(e,t,n){if(Ji.current!==qi)throw Error(r(168));Ki(Ji,t),Ki(Yi,n)}function ta(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ae(e)||`Unknown`,a));return z({},n,i)}function na(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qi,Xi=Ji.current,Ki(Ji,e),Ki(Yi,Yi.current),!0}function ra(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ta(e,t,Xi),i.__reactInternalMemoizedMergedChildContext=e,Gi(Yi),Gi(Ji),Ki(Ji,e)):Gi(Yi),Ki(Yi,n)}var ia=null,aa=!1,oa=!1;function sa(e){ia===null?ia=[e]:ia.push(e)}function ca(e){aa=!0,sa(e)}function la(){if(!oa&&ia!==null){oa=!0;var e=0,t=zt;try{var n=ia;for(zt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ia=null,aa=!1}catch(t){throw ia!==null&&(ia=ia.slice(e+1)),lt(ht,la),t}finally{zt=t,oa=!1}}return null}var ua=[],da=0,fa=null,pa=0,ma=[],ha=0,ga=null,_a=1,va=``;function ya(e,t){ua[da++]=pa,ua[da++]=fa,fa=e,pa=t}function ba(e,t,n){ma[ha++]=_a,ma[ha++]=va,ma[ha++]=ga,ga=e;var r=_a;e=va;var i=32-Ct(r)-1;r&=~(1<<i),n+=1;var a=32-Ct(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_a=1<<32-Ct(t)+i|n<<i|r,va=a+e}else _a=1<<a|n<<i|r,va=e}function xa(e){e.return!==null&&(ya(e,1),ba(e,1,0))}function Sa(e){for(;e===fa;)fa=ua[--da],ua[da]=null,pa=ua[--da],ua[da]=null;for(;e===ga;)ga=ma[--ha],ma[ha]=null,va=ma[--ha],ma[ha]=null,_a=ma[--ha],ma[ha]=null}var Ca=null,wa=null,Ta=!1,Ea=null;function Da(e,t){var n=nu(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Oa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null&&(e.stateNode=t,Ca=e,wa=Ai(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t!==null&&(e.stateNode=t,Ca=e,wa=null,!0);case 13:return t=t.nodeType===8?t:null,t!==null&&(n=ga===null?null:{id:_a,overflow:va},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nu(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ca=e,wa=null,!0);default:return!1}}function ka(e){return!!(e.mode&1)&&!(e.flags&128)}function Aa(e){if(Ta){var t=wa;if(t){var n=t;if(!Oa(e,t)){if(ka(e))throw Error(r(418));t=Ai(n.nextSibling);var i=Ca;t&&Oa(e,t)?Da(i,n):(e.flags=e.flags&-4097|2,Ta=!1,Ca=e)}}else{if(ka(e))throw Error(r(418));e.flags=e.flags&-4097|2,Ta=!1,Ca=e}}}function ja(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ca=e}function Ma(e){if(e!==Ca)return!1;if(!Ta)return ja(e),Ta=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Ci(e.type,e.memoizedProps)),t&&=wa){if(ka(e))throw Na(),Error(r(418));for(;t;)Da(e,t),t=Ai(t.nextSibling)}if(ja(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){wa=Ai(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}wa=null}}else wa=Ca?Ai(e.stateNode.nextSibling):null;return!0}function Na(){for(var e=wa;e;)e=Ai(e.nextSibling)}function Pa(){wa=Ca=null,Ta=!1}function Fa(e){Ea===null?Ea=[e]:Ea.push(e)}var Ia=C.ReactCurrentBatchConfig;function La(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Ra(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function za(e){var t=e._init;return t(e._payload)}function Ba(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=au(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=lu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===F&&za(i)===t.type)?(r=a(t,n.props),r.ref=La(e,t,n),r.return=e,r):(r=ou(n.type,n.key,n.props,null,e.mode,r),r.ref=La(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=uu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=su(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=lu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=ou(t.type,t.key,t.props,null,e.mode,n),n.ref=La(e,null,t),n.return=e,n;case T:return t=uu(t,e.mode,n),t.return=e,t;case F:var r=t._init;return f(e,r(t._payload),n)}if(ge(t)||R(t))return t=su(t,e.mode,n,null),t.return=e,t;Ra(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case F:return i=n._init,p(e,t,i(n._payload),r)}if(ge(n)||R(n))return i===null?d(e,t,n,r,null):null;Ra(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case F:var a=r._init;return m(e,t,n,a(r._payload),i)}if(ge(r)||R(r))return e=e.get(n)||null,d(t,e,r,i,null);Ra(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Ta&&ya(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ta&&ya(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Ta&&ya(r,h),l}function g(a,s,c,l){var u=R(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ta&&ya(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ta&&ya(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ta&&ya(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&za(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=La(e,l,i),r.return=e,e=r;break a}n(e,l);break}t(e,l),l=l.sibling}i.type===E?(r=su(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=ou(i.type,i.key,i.props,null,e.mode,o),o.ref=La(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}n(e,r);break}t(e,r),r=r.sibling}r=uu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(ge(i))return h(e,r,i,o);if(R(i))return g(e,r,i,o);Ra(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=lu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Va=Ba(!0),Ha=Ba(!1),Ua=Wi(null),Wa=null,Ga=null,Ka=null;function qa(){Ka=Ga=Wa=null}function Ja(e){var t=Ua.current;Gi(Ua),e._currentValue=t}function Ya(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Xa(e,t){Wa=e,Ka=Ga=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Bs=!0),e.firstContext=null)}function Za(e){var t=e._currentValue;if(Ka!==e){if(e={context:e,memoizedValue:t,next:null},Ga===null){if(Wa===null)throw Error(r(308));Ga=e,Wa.dependencies={lanes:0,firstContext:e}}else Ga=Ga.next=e}return t}var Qa=null;function $a(e){Qa===null?Qa=[e]:Qa.push(e)}function eo(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,$a(t)):(n.next=i.next,i.next=n),t.interleaved=n,to(e,r)}function to(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var no=!1;function ro(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function io(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ao(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function oo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,to(e,n)}return i=r.interleaved,i===null?(t.next=t,$a(r)):(t.next=i.next,i.next=t),r.interleaved=t,to(e,n)}function so(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rt(e,n)}}function co(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function lo(e,t,n,r){var i=e.updateQueue;no=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=z({},d,f);break a;case 2:no=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);il|=o,e.lanes=o,e.memoizedState=d}}function uo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var fo={},po=Wi(fo),mo=Wi(fo),ho=Wi(fo);function go(e){if(e===fo)throw Error(r(174));return e}function _o(e,t){switch(Ki(ho,t),Ki(mo,e),Ki(po,fo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ce(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ce(t,e)}Gi(po),Ki(po,t)}function vo(){Gi(po),Gi(mo),Gi(ho)}function yo(e){go(ho.current);var t=go(po.current),n=Ce(t,e.type);t!==n&&(Ki(mo,e),Ki(po,n))}function bo(e){mo.current===e&&(Gi(po),Gi(mo))}var xo=Wi(0);function So(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Co=[];function wo(){for(var e=0;e<Co.length;e++)Co[e]._workInProgressVersionPrimary=null;Co.length=0}var To=C.ReactCurrentDispatcher,Eo=C.ReactCurrentBatchConfig,Do=0,Oo=null,ko=null,Ao=null,jo=!1,Mo=!1,No=0,Po=0;function Fo(){throw Error(r(321))}function Io(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function Lo(e,t,n,i,a,o){if(Do=o,Oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,To.current=e===null||e.memoizedState===null?bs:xs,e=n(i,a),Mo){o=0;do{if(Mo=!1,No=0,25<=o)throw Error(r(301));o+=1,Ao=ko=null,t.updateQueue=null,To.current=Ss,e=n(i,a)}while(Mo)}if(To.current=ys,t=ko!==null&&ko.next!==null,Do=0,Ao=ko=Oo=null,jo=!1,t)throw Error(r(300));return e}function Ro(){var e=No!==0;return No=0,e}function zo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ao===null?Oo.memoizedState=Ao=e:Ao=Ao.next=e,Ao}function Bo(){if(ko===null){var e=Oo.alternate;e=e===null?null:e.memoizedState}else e=ko.next;var t=Ao===null?Oo.memoizedState:Ao.next;if(t!==null)Ao=t,ko=e;else{if(e===null)throw Error(r(310));ko=e,e={memoizedState:ko.memoizedState,baseState:ko.baseState,baseQueue:ko.baseQueue,queue:ko.queue,next:null},Ao===null?Oo.memoizedState=Ao=e:Ao=Ao.next=e}return Ao}function Vo(e,t){return typeof t==`function`?t(e):t}function Ho(e){var t=Bo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=ko,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Do&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,Oo.lanes|=d,il|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Or(i,t.memoizedState)||(Bs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,Oo.lanes|=o,il|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Uo(e){var t=Bo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Or(o,t.memoizedState)||(Bs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Wo(){}function Go(e,t){var n=Oo,i=Bo(),a=t(),o=!Or(i.memoizedState,a);if(o&&(i.memoizedState=a,Bs=!0),i=i.queue,rs(Jo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Ao!==null&&Ao.memoizedState.tag&1){if(n.flags|=2048,Qo(9,qo.bind(null,n,i,a,t),void 0,null),Zc===null)throw Error(r(349));Do&30||Ko(n,t,a)}return a}function Ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Oo.updateQueue,t===null?(t={lastEffect:null,stores:null},Oo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qo(e,t,n,r){t.value=n,t.getSnapshot=r,Yo(t)&&Xo(e)}function Jo(e,t,n){return n(function(){Yo(t)&&Xo(e)})}function Yo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function Xo(e){var t=to(e,1);t!==null&&wl(t,e,1,-1)}function Zo(e){var t=zo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:e},t.queue=e,e=e.dispatch=hs.bind(null,Oo,e),[t.memoizedState,e]}function Qo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Oo.updateQueue,t===null?(t={lastEffect:null,stores:null},Oo.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function $o(){return Bo().memoizedState}function es(e,t,n,r){var i=zo();Oo.flags|=e,i.memoizedState=Qo(1|t,n,void 0,r===void 0?null:r)}function ts(e,t,n,r){var i=Bo();r=r===void 0?null:r;var a=void 0;if(ko!==null){var o=ko.memoizedState;if(a=o.destroy,r!==null&&Io(r,o.deps)){i.memoizedState=Qo(t,n,a,r);return}}Oo.flags|=e,i.memoizedState=Qo(1|t,n,a,r)}function ns(e,t){return es(8390656,8,e,t)}function rs(e,t){return ts(2048,8,e,t)}function is(e,t){return ts(4,2,e,t)}function as(e,t){return ts(4,4,e,t)}function os(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ss(e,t,n){return n=n==null?null:n.concat([e]),ts(4,4,os.bind(null,t,e),n)}function cs(){}function ls(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Io(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function us(e,t){var n=Bo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Io(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ds(e,t,n){return Do&21?(Or(n,t)||(n=Pt(),Oo.lanes|=n,il|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Bs=!0),e.memoizedState=n)}function fs(e,t){var n=zt;zt=n!==0&&4>n?n:4,e(!0);var r=Eo.transition;Eo.transition={};try{e(!1),t()}finally{zt=n,Eo.transition=r}}function ps(){return Bo().memoizedState}function ms(e,t,n){var r=Cl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gs(e))_s(t,n);else if(n=eo(e,t,n,r),n!==null){var i=Sl();wl(n,e,r,i),vs(n,t,r)}}function hs(e,t,n){var r=Cl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gs(e))_s(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Or(s,o)){var c=t.interleaved;c===null?(i.next=i,$a(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=eo(e,t,i,r),n!==null&&(i=Sl(),wl(n,e,r,i),vs(n,t,r))}}function gs(e){var t=e.alternate;return e===Oo||t!==null&&t===Oo}function _s(e,t){Mo=jo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rt(e,n)}}var ys={readContext:Za,useCallback:Fo,useContext:Fo,useEffect:Fo,useImperativeHandle:Fo,useInsertionEffect:Fo,useLayoutEffect:Fo,useMemo:Fo,useReducer:Fo,useRef:Fo,useState:Fo,useDebugValue:Fo,useDeferredValue:Fo,useTransition:Fo,useMutableSource:Fo,useSyncExternalStore:Fo,useId:Fo,unstable_isNewReconciler:!1},bs={readContext:Za,useCallback:function(e,t){return zo().memoizedState=[e,t===void 0?null:t],e},useContext:Za,useEffect:ns,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),es(4194308,4,os.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){return es(4,2,e,t)},useMemo:function(e,t){var n=zo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=zo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ms.bind(null,Oo,e),[r.memoizedState,e]},useRef:function(e){var t=zo();return e={current:e},t.memoizedState=e},useState:Zo,useDebugValue:cs,useDeferredValue:function(e){return zo().memoizedState=e},useTransition:function(){var e=Zo(!1),t=e[0];return e=fs.bind(null,e[1]),zo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Oo,a=zo();if(Ta){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Zc===null)throw Error(r(349));Do&30||Ko(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Jo.bind(null,i,o,e),[e]),i.flags|=2048,Qo(9,qo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=zo(),t=Zc.identifierPrefix;if(Ta){var n=va,r=_a;n=(r&~(1<<32-Ct(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=No++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Po++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},xs={readContext:Za,useCallback:ls,useContext:Za,useEffect:rs,useImperativeHandle:ss,useInsertionEffect:is,useLayoutEffect:as,useMemo:us,useReducer:Ho,useRef:$o,useState:function(){return Ho(Vo)},useDebugValue:cs,useDeferredValue:function(e){return ds(Bo(),ko.memoizedState,e)},useTransition:function(){return[Ho(Vo)[0],Bo().memoizedState]},useMutableSource:Wo,useSyncExternalStore:Go,useId:ps,unstable_isNewReconciler:!1},Ss={readContext:Za,useCallback:ls,useContext:Za,useEffect:rs,useImperativeHandle:ss,useInsertionEffect:is,useLayoutEffect:as,useMemo:us,useReducer:Uo,useRef:$o,useState:function(){return Uo(Vo)},useDebugValue:cs,useDeferredValue:function(e){var t=Bo();return ko===null?t.memoizedState=e:ds(t,ko.memoizedState,e)},useTransition:function(){return[Uo(Vo)[0],Bo().memoizedState]},useMutableSource:Wo,useSyncExternalStore:Go,useId:ps,unstable_isNewReconciler:!1};function Cs(e,t){if(e&&e.defaultProps){for(var n in t=z({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:z({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ts={isMounted:function(e){return(e=e._reactInternals)?rt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Sl(),i=Cl(e),a=ao(r,i);a.payload=t,n!=null&&(a.callback=n),t=oo(e,a,i),t!==null&&(wl(t,e,i,r),so(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Sl(),i=Cl(e),a=ao(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=oo(e,a,i),t!==null&&(wl(t,e,i,r),so(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Sl(),r=Cl(e),i=ao(n,r);i.tag=2,t!=null&&(i.callback=t),t=oo(e,i,r),t!==null&&(wl(t,e,r,n),so(t,e,r))}};function Es(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!kr(n,r)||!kr(i,a):!0}function Ds(e,t,n){var r=!1,i=qi,a=t.contextType;return typeof a==`object`&&a?a=Za(a):(i=Qi(t)?Xi:Ji.current,r=t.contextTypes,a=(r=r!=null)?Zi(e,i):qi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ts,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Os(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ts.enqueueReplaceState(t,t.state,null)}function ks(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},ro(e);var a=t.contextType;typeof a==`object`&&a?i.context=Za(a):(a=Qi(t)?Xi:Ji.current,i.context=Zi(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(ws(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Ts.enqueueReplaceState(i,i.state,null),lo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function As(e,t){try{var n=``,r=t;do n+=re(r),r=r.return;while(r);var i=n}catch(e){i=`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function js(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ms(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ns=typeof WeakMap==`function`?WeakMap:Map;function Ps(e,t,n){n=ao(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){fl||(fl=!0,pl=r),Ms(e,t)},n}function Fs(e,t,n){n=ao(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ms(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ms(e,t),typeof r!=`function`&&(ml===null?ml=new Set([this]):ml.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Is(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ns;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Yl.bind(null,e,t,n),t.then(e,e))}function Ls(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null||t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Rs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ao(-1,1),t.tag=2,oo(n,t,1))),n.lanes|=1),e)}var zs=C.ReactCurrentOwner,Bs=!1;function Vs(e,t,n,r){t.child=e===null?Ha(t,null,n,r):Va(t,e.child,n,r)}function Hs(e,t,n,r,i){n=n.render;var a=t.ref;return Xa(t,i),r=Lo(e,t,n,r,a,i),n=Ro(),e!==null&&!Bs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,cc(e,t,i)):(Ta&&n&&xa(t),t.flags|=1,Vs(e,t,r,i),t.child)}function Us(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ru(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Ws(e,t,a,r,i)):(e=ou(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?kr:n,n(o,r)&&e.ref===t.ref)return cc(e,t,i)}return t.flags|=1,e=au(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ws(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(kr(a,r)&&e.ref===t.ref){if(Bs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Bs=!0);else return t.lanes=e.lanes,cc(e,t,i)}}return qs(e,t,n,r,i)}function Gs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`){if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ki(tl,el),el|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ki(tl,el),el|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Ki(tl,el),el|=r}}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Ki(tl,el),el|=r;return Vs(e,t,i,n),t.child}function Ks(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function qs(e,t,n,r,i){var a=Qi(n)?Xi:Ji.current;return a=Zi(t,a),Xa(t,i),n=Lo(e,t,n,r,a,i),r=Ro(),e!==null&&!Bs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,cc(e,t,i)):(Ta&&r&&xa(t),t.flags|=1,Vs(e,t,n,i),t.child)}function Js(e,t,n,r,i){if(Qi(n)){var a=!0;na(t)}else a=!1;if(Xa(t,i),t.stateNode===null)sc(e,t),Ds(t,n,r),ks(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Za(l):(l=Qi(n)?Xi:Ji.current,l=Zi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Os(t,o,r,l),no=!1;var f=t.memoizedState;o.state=f,lo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Yi.current||no?(typeof u==`function`&&(ws(t,n,u,r),c=t.memoizedState),(s=no||Es(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,io(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:Cs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Za(c):(c=Qi(n)?Xi:Ji.current,c=Zi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Os(t,o,r,c),no=!1,f=t.memoizedState,o.state=f,lo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Yi.current||no?(typeof p==`function`&&(ws(t,n,p,r),m=t.memoizedState),(l=no||Es(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ys(e,t,n,r,a,i)}function Ys(e,t,n,r,i,a){Ks(e,t);var o=!!(t.flags&128);if(!r&&!o)return i&&ra(t,n,!1),cc(e,t,a);r=t.stateNode,zs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Va(t,e.child,null,a),t.child=Va(t,null,s,a)):Vs(e,t,s,a),t.memoizedState=r.state,i&&ra(t,n,!0),t.child}function Xs(e){var t=e.stateNode;t.pendingContext?ea(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ea(e,t.context,!1),_o(e,t.containerInfo)}function Zs(e,t,n,r,i){return Pa(),Fa(i),t.flags|=256,Vs(e,t,n,r),t.child}var Qs={dehydrated:null,treeContext:null,retryLane:0};function $s(e){return{baseLanes:e,cachePool:null,transitions:null}}function ec(e,t,n){var r=t.pendingProps,i=xo.current,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(i&2)),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ki(xo,i&1),e===null)return Aa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.lanes=t.mode&1?e.data===`$!`?8:1073741824:1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=cu(o,r,0,null),e=su(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=$s(n),t.memoizedState=Qs,e):tc(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return rc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=au(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=su(a,o,n,null),a.flags|=2):a=au(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?$s(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=Qs,r}return a=e.child,e=a.sibling,r=au(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function tc(e,t){return t=cu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function nc(e,t,n,r){return r!==null&&Fa(r),Va(t,e.child,null,n),e=tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=js(Error(r(422))),nc(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=cu({mode:`visible`,children:i.children},a,0,null),o=su(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Va(t,e.child,null,s),t.child.memoizedState=$s(s),t.memoizedState=Qs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return nc(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=js(o,i,void 0),nc(e,t,s,i)}if(c=(s&e.childLanes)!==0,Bs||c){if(i=Zc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,to(e,a),wl(i,e,a,-1))}return Rl(),i=js(Error(r(421))),nc(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Zl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,wa=Ai(a.nextSibling),Ca=t,Ta=!0,Ea=null,e!==null&&(ma[ha++]=_a,ma[ha++]=va,ma[ha++]=ga,_a=e.id,va=e.overflow,ga=t),t=tc(t,i.children),t.flags|=4096,t)}function ic(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ya(e.return,t,n)}function ac(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function oc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Vs(e,t,r.children,n),r=xo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ic(e,n,t);else if(e.tag===19)ic(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ki(xo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&So(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ac(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&So(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ac(t,!0,n,null,a);break;case`together`:ac(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function cc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),il|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=au(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=au(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function lc(e,t,n){switch(t.tag){case 3:Xs(t),Pa();break;case 5:yo(t);break;case 1:Qi(t.type)&&na(t);break;case 4:_o(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ki(Ua,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ki(xo,xo.current&1),e=cc(e,t,n),e===null?null:e.sibling):ec(e,t,n):(Ki(xo,xo.current&1),t.flags|=128,null);Ki(xo,xo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return oc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ki(xo,xo.current),r)break;return null;case 22:case 23:return t.lanes=0,Gs(e,t,n)}return cc(e,t,n)}var uc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},dc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,go(po.current);var o=null;switch(n){case`input`:i=H(e,i),r=H(e,r),o=[];break;case`select`:i=z({},i,{value:void 0}),r=z({},r,{value:void 0}),o=[];break;case`textarea`:i=ve(e,i),r=ve(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=bi)}Me(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null){if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null))}for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null)){if(u===`style`){if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l}else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&oi(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},fc=function(e,t,n,r){n!==r&&(t.flags|=4)};function pc(e,t){if(!Ta)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function mc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hc(e,t,n){var i=t.pendingProps;switch(Sa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mc(t),null;case 1:return Qi(t.type)&&$i(),mc(t),null;case 3:return i=t.stateNode,vo(),Gi(Yi),Gi(Ji),wo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ma(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ea!==null&&(Ol(Ea),Ea=null))),mc(t),null;case 5:bo(t);var o=go(ho.current);if(n=t.type,e!==null&&t.stateNode!=null)dc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return mc(t),null}if(e=go(po.current),Ma(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Ni]=t,i[Pi]=s,e=!!(t.mode&1),n){case`dialog`:oi(`cancel`,i),oi(`close`,i);break;case`iframe`:case`object`:case`embed`:oi(`load`,i);break;case`video`:case`audio`:for(o=0;o<ni.length;o++)oi(ni[o],i);break;case`source`:oi(`error`,i);break;case`img`:case`image`:case`link`:oi(`error`,i),oi(`load`,i);break;case`details`:oi(`toggle`,i);break;case`input`:de(i,s),oi(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},oi(`invalid`,i);break;case`textarea`:ye(i,s),oi(`invalid`,i)}for(var c in Me(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&yi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&oi(`scroll`,i)}switch(n){case`input`:ce(i),me(i,s,!0);break;case`textarea`:ce(i),xe(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=bi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Se(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ni]=t,e[Pi]=i,uc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ne(n,i),n){case`dialog`:oi(`cancel`,e),oi(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:oi(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ni.length;o++)oi(ni[o],e);o=i;break;case`source`:oi(`error`,e),o=i;break;case`img`:case`image`:case`link`:oi(`error`,e),oi(`load`,e),o=i;break;case`details`:oi(`toggle`,e),o=i;break;case`input`:de(e,i),o=H(e,i),oi(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=z({},i,{value:void 0}),oi(`invalid`,e);break;case`textarea`:ye(e,i),o=ve(e,i),oi(`invalid`,e);break;default:o=i}for(s in Me(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Ae(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Te(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Ee(e,u):typeof u==`number`&&Ee(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&oi(`scroll`,e):u!=null&&S(e,s,u,c))}switch(n){case`input`:ce(e),me(e,i,!1);break;case`textarea`:ce(e),xe(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+oe(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&_e(e,!!i.multiple,i.defaultValue,!0):_e(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=bi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return mc(t),null;case 6:if(e&&t.stateNode!=null)fc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=go(ho.current),go(po.current),Ma(t)){if(i=t.stateNode,n=t.memoizedProps,i[Ni]=t,(s=i.nodeValue!==n)&&(e=Ca,e!==null))switch(e.tag){case 3:yi(i.nodeValue,n,!!(e.mode&1));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&yi(i.nodeValue,n,!!(e.mode&1))}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Ni]=t,t.stateNode=i}return mc(t),null;case 13:if(Gi(xo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ta&&wa!==null&&t.mode&1&&!(t.flags&128))Na(),Pa(),t.flags|=98560,s=!1;else if(s=Ma(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Ni]=t}else Pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;mc(t),s=!1}else Ea!==null&&(Ol(Ea),Ea=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||xo.current&1?nl===0&&(nl=3):Rl())),t.updateQueue!==null&&(t.flags|=4),mc(t),null);case 4:return vo(),e===null&&li(t.stateNode.containerInfo),mc(t),null;case 10:return Ja(t.type._context),mc(t),null;case 17:return Qi(t.type)&&$i(),mc(t),null;case 19:if(Gi(xo),s=t.memoizedState,s===null)return mc(t),null;if(i=!!(t.flags&128),c=s.rendering,c===null){if(i)pc(s,!1);else{if(nl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=So(e),c!==null){for(t.flags|=128,pc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ki(xo,xo.current&1|2),t.child}e=e.sibling}s.tail!==null&&pt()>ul&&(t.flags|=128,i=!0,pc(s,!1),t.lanes=4194304)}}else{if(!i){if(e=So(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),pc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Ta)return mc(t),null}else 2*pt()-s.renderingStartTime>ul&&n!==1073741824&&(t.flags|=128,i=!0,pc(s,!1),t.lanes=4194304)}s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(mc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=pt(),t.sibling=null,n=xo.current,Ki(xo,i?n&1|2:n&1),t);case 22:case 23:return Pl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?el&1073741824&&(mc(t),t.subtreeFlags&6&&(t.flags|=8192)):mc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function gc(e,t){switch(Sa(t),t.tag){case 1:return Qi(t.type)&&$i(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vo(),Gi(Yi),Gi(Ji),wo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bo(t),null;case 13:if(Gi(xo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Gi(xo),null;case 4:return vo(),null;case 10:return Ja(t.type._context),null;case 22:case 23:return Pl(),null;case 24:return null;default:return null}}var _c=!1,vc=!1,yc=typeof WeakSet==`function`?WeakSet:Set,bc=null;function xc(e,t){var n=e.ref;if(n!==null){if(typeof n==`function`)try{n(null)}catch(n){Jl(e,t,n)}else n.current=null}}function Sc(e,t,n){try{n()}catch(n){Jl(e,t,n)}}var Cc=!1;function wc(e,t){if(xi=fn,e=Nr(),Pr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Si={focusedElem:e,selectionRange:n},fn=!1,bc=t;bc!==null;)if(t=bc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,bc=e;else for(;bc!==null;){t=bc;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Cs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Jl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,bc=e;break}bc=t.return}return h=Cc,Cc=!1,h}function Tc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Sc(t,n,a)}i=i.next}while(i!==r)}}function Ec(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Dc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Oc(e){var t=e.alternate;t!==null&&(e.alternate=null,Oc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ni],delete t[Pi],delete t[Ii],delete t[Li],delete t[Ri])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function kc(e){return e.tag===5||e.tag===3||e.tag===4}function Ac(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bi));else if(r!==4&&(e=e.child,e!==null))for(jc(e,t,n),e=e.sibling;e!==null;)jc(e,t,n),e=e.sibling}function Mc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Mc(e,t,n),e=e.sibling;e!==null;)Mc(e,t,n),e=e.sibling}var Nc=null,Pc=!1;function Fc(e,t,n){for(n=n.child;n!==null;)Ic(e,t,n),n=n.sibling}function Ic(e,t,n){if(xt&&typeof xt.onCommitFiberUnmount==`function`)try{xt.onCommitFiberUnmount(bt,n)}catch{}switch(n.tag){case 5:vc||xc(n,t);case 6:var r=Nc,i=Pc;Nc=null,Fc(e,t,n),Nc=r,Pc=i,Nc!==null&&(Pc?(e=Nc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nc.removeChild(n.stateNode));break;case 18:Nc!==null&&(Pc?(e=Nc,n=n.stateNode,e.nodeType===8?ki(e.parentNode,n):e.nodeType===1&&ki(e,n),un(e)):ki(Nc,n.stateNode));break;case 4:r=Nc,i=Pc,Nc=n.stateNode.containerInfo,Pc=!0,Fc(e,t,n),Nc=r,Pc=i;break;case 0:case 11:case 14:case 15:if(!vc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Sc(n,t,o),i=i.next}while(i!==r)}Fc(e,t,n);break;case 1:if(!vc&&(xc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Jl(n,t,e)}Fc(e,t,n);break;case 21:Fc(e,t,n);break;case 22:n.mode&1?(vc=(r=vc)||n.memoizedState!==null,Fc(e,t,n),vc=r):Fc(e,t,n);break;default:Fc(e,t,n)}}function Lc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yc),t.forEach(function(t){var r=Ql.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Rc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Nc=c.stateNode,Pc=!1;break a;case 3:Nc=c.stateNode.containerInfo,Pc=!0;break a;case 4:Nc=c.stateNode.containerInfo,Pc=!0;break a}c=c.return}if(Nc===null)throw Error(r(160));Ic(o,s,a),Nc=null,Pc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Jl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zc(t,e),t=t.sibling}function zc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rc(t,e),Bc(e),i&4){try{Tc(3,e,e.return),Ec(3,e)}catch(t){Jl(e,e.return,t)}try{Tc(5,e,e.return)}catch(t){Jl(e,e.return,t)}}break;case 1:Rc(t,e),Bc(e),i&512&&n!==null&&xc(n,n.return);break;case 5:if(Rc(t,e),Bc(e),i&512&&n!==null&&xc(n,n.return),e.flags&32){var a=e.stateNode;try{Ee(a,``)}catch(t){Jl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&fe(a,o),Ne(c,s);var u=Ne(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Ae(a,f):d===`dangerouslySetInnerHTML`?Te(a,f):d===`children`?Ee(a,f):S(a,d,f,u)}switch(c){case`input`:pe(a,o);break;case`textarea`:be(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?_e(a,!!o.multiple,o.multiple?[]:``,!1):_e(a,!!o.multiple,o.defaultValue,!0)):_e(a,!!o.multiple,m,!1)}a[Pi]=o}catch(t){Jl(e,e.return,t)}}break;case 6:if(Rc(t,e),Bc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Jl(e,e.return,t)}}break;case 3:if(Rc(t,e),Bc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{un(t.containerInfo)}catch(t){Jl(e,e.return,t)}break;case 4:Rc(t,e),Bc(e);break;case 13:Rc(t,e),Bc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(ll=pt())),i&4&&Lc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(vc=(u=vc)||d,Rc(t,e),vc=u):Rc(t,e),Bc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(bc=e,d=e.child;d!==null;){for(f=bc=d;bc!==null;){switch(p=bc,m=p.child,p.tag){case 0:case 11:case 14:case 15:Tc(4,p,p.return);break;case 1:xc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Jl(i,n,e)}}break;case 5:xc(p,p.return);break;case 22:if(p.memoizedState!==null){Wc(f);continue}}m===null?Wc(f):(m.return=p,bc=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=ke(`display`,s))}catch(t){Jl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Jl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Rc(t,e),Bc(e),i&4&&Lc(e);break;case 21:break;default:Rc(t,e),Bc(e)}}function Bc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(kc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Ee(a,``),i.flags&=-33),Mc(e,Ac(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;jc(e,Ac(e),o);break;default:throw Error(r(161))}}catch(t){Jl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vc(e,t,n){bc=e,Hc(e,t,n)}function Hc(e,t,n){for(var r=!!(e.mode&1);bc!==null;){var i=bc,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||_c;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||vc;s=_c;var l=vc;if(_c=o,(vc=c)&&!l)for(bc=i;bc!==null;)o=bc,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Gc(i):(c.return=o,bc=c);for(;a!==null;)bc=a,Hc(a,t,n),a=a.sibling;bc=i,_c=s,vc=l}Uc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,bc=a):Uc(e,t,n)}}function Uc(e){for(;bc!==null;){var t=bc;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:vc||Ec(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!vc){if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Cs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}}var o=t.updateQueue;o!==null&&uo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}uo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&un(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}vc||t.flags&512&&Dc(t)}catch(e){Jl(t,t.return,e)}}if(t===e){bc=null;break}if(n=t.sibling,n!==null){n.return=t.return,bc=n;break}bc=t.return}}function Wc(e){for(;bc!==null;){var t=bc;if(t===e){bc=null;break}var n=t.sibling;if(n!==null){n.return=t.return,bc=n;break}bc=t.return}}function Gc(e){for(;bc!==null;){var t=bc;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ec(4,t)}catch(e){Jl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Jl(t,i,e)}}var a=t.return;try{Dc(t)}catch(e){Jl(t,a,e)}break;case 5:var o=t.return;try{Dc(t)}catch(e){Jl(t,o,e)}}}catch(e){Jl(t,t.return,e)}if(t===e){bc=null;break}var s=t.sibling;if(s!==null){s.return=t.return,bc=s;break}bc=t.return}}var Kc=Math.ceil,qc=C.ReactCurrentDispatcher,Jc=C.ReactCurrentOwner,Yc=C.ReactCurrentBatchConfig,Xc=0,Zc=null,Qc=null,$c=0,el=0,tl=Wi(0),nl=0,rl=null,il=0,al=0,ol=0,sl=null,cl=null,ll=0,ul=1/0,dl=null,fl=!1,pl=null,ml=null,hl=!1,gl=null,_l=0,vl=0,yl=null,bl=-1,xl=0;function Sl(){return Xc&6?pt():bl===-1?bl=pt():bl}function Cl(e){return e.mode&1?Xc&2&&$c!==0?$c&-$c:Ia.transition===null?(e=zt,e===0&&(e=window.event,e=e===void 0?16:vn(e.type)),e):(xl===0&&(xl=Pt()),xl):1}function wl(e,t,n,i){if(50<vl)throw vl=0,yl=null,Error(r(185));It(e,n,i),(!(Xc&2)||e!==Zc)&&(e===Zc&&(!(Xc&2)&&(al|=n),nl===4&&Al(e,$c)),Tl(e,i),n===1&&Xc===0&&!(t.mode&1)&&(ul=pt()+500,aa&&la()))}function Tl(e,t){var n=e.callbackNode;Mt(e,t);var r=At(e,e===Zc?$c:0);if(r===0)n!==null&&ut(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ut(n),t===1)e.tag===0?ca(jl.bind(null,e)):sa(jl.bind(null,e)),Di(function(){!(Xc&6)&&la()}),n=null;else{switch(Bt(r)){case 1:n=ht;break;case 4:n=gt;break;case 16:n=_t;break;case 536870912:n=yt;break;default:n=_t}n=eu(n,El.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function El(e,t){if(bl=-1,xl=0,Xc&6)throw Error(r(327));var n=e.callbackNode;if(Kl()&&e.callbackNode!==n)return null;var i=At(e,e===Zc?$c:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=zl(e,i);else{t=i;var a=Xc;Xc|=2;var o=Ll();(Zc!==e||$c!==t)&&(dl=null,ul=pt()+500,Fl(e,t));do try{Vl();break}catch(t){Il(e,t)}while(1);qa(),qc.current=o,Xc=a,Qc===null?(Zc=null,$c=0,t=nl):t=0}if(t!==0){if(t===2&&(a=Nt(e),a!==0&&(i=a,t=Dl(e,a))),t===1)throw n=rl,Fl(e,0),Al(e,i),Tl(e,pt()),n;if(t===6)Al(e,i);else{if(a=e.current.alternate,!(i&30)&&!kl(a)&&(t=zl(e,i),t===2&&(o=Nt(e),o!==0&&(i=o,t=Dl(e,o))),t===1))throw n=rl,Fl(e,0),Al(e,i),Tl(e,pt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Wl(e,cl,dl);break;case 3:if(Al(e,i),(i&130023424)===i&&(t=ll+500-pt(),10<t)){if(At(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){Sl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=wi(Wl.bind(null,e,cl,dl),t);break}Wl(e,cl,dl);break;case 4:if(Al(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-Ct(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=pt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Kc(i/1960))-i,10<i){e.timeoutHandle=wi(Wl.bind(null,e,cl,dl),i);break}Wl(e,cl,dl);break;case 5:Wl(e,cl,dl);break;default:throw Error(r(329))}}}return Tl(e,pt()),e.callbackNode===n?El.bind(null,e):null}function Dl(e,t){var n=sl;return e.current.memoizedState.isDehydrated&&(Fl(e,t).flags|=256),e=zl(e,t),e!==2&&(t=cl,cl=n,t!==null&&Ol(t)),e}function Ol(e){cl===null?cl=e:cl.push.apply(cl,e)}function kl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Or(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Al(e,t){for(t&=~ol,t&=~al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ct(t),r=1<<n;e[n]=-1,t&=~r}}function jl(e){if(Xc&6)throw Error(r(327));Kl();var t=At(e,0);if(!(t&1))return Tl(e,pt()),null;var n=zl(e,t);if(e.tag!==0&&n===2){var i=Nt(e);i!==0&&(t=i,n=Dl(e,i))}if(n===1)throw n=rl,Fl(e,0),Al(e,t),Tl(e,pt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wl(e,cl,dl),Tl(e,pt()),null}function Ml(e,t){var n=Xc;Xc|=1;try{return e(t)}finally{Xc=n,Xc===0&&(ul=pt()+500,aa&&la())}}function Nl(e){gl!==null&&gl.tag===0&&!(Xc&6)&&Kl();var t=Xc;Xc|=1;var n=Yc.transition,r=zt;try{if(Yc.transition=null,zt=1,e)return e()}finally{zt=r,Yc.transition=n,Xc=t,!(Xc&6)&&la()}}function Pl(){el=tl.current,Gi(tl)}function Fl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ti(n)),Qc!==null)for(n=Qc.return;n!==null;){var r=n;switch(Sa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&$i();break;case 3:vo(),Gi(Yi),Gi(Ji),wo();break;case 5:bo(r);break;case 4:vo();break;case 13:Gi(xo);break;case 19:Gi(xo);break;case 10:Ja(r.type._context);break;case 22:case 23:Pl()}n=n.return}if(Zc=e,Qc=e=au(e.current,null),$c=el=t,nl=0,rl=null,ol=al=il=0,cl=sl=null,Qa!==null){for(t=0;t<Qa.length;t++)if(n=Qa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Qa=null}return e}function Il(e,t){do{var n=Qc;try{if(qa(),To.current=ys,jo){for(var i=Oo.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}jo=!1}if(Do=0,Ao=ko=Oo=null,Mo=!1,No=0,Jc.current=null,n===null||n.return===null){nl=1,rl=t,Qc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=$c,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ls(s);if(m!==null){m.flags&=-257,Rs(m,s,c,o,t),m.mode&1&&Is(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}if(!(t&1)){Is(o,u,t),Rl();break a}l=Error(r(426))}else if(Ta&&c.mode&1){var _=Ls(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Rs(_,s,c,o,t),Fa(As(l,c));break a}}o=l=As(l,c),nl!==4&&(nl=2),sl===null?sl=[o]:sl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Ps(o,l,t);co(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(ml===null||!ml.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Fs(o,c,t);co(o,x);break a}}o=o.return}while(o!==null)}Ul(n)}catch(e){t=e,Qc===n&&n!==null&&(Qc=n=n.return);continue}break}while(1)}function Ll(){var e=qc.current;return qc.current=ys,e===null?ys:e}function Rl(){(nl===0||nl===3||nl===2)&&(nl=4),Zc===null||!(il&268435455)&&!(al&268435455)||Al(Zc,$c)}function zl(e,t){var n=Xc;Xc|=2;var i=Ll();(Zc!==e||$c!==t)&&(dl=null,Fl(e,t));do try{Bl();break}catch(t){Il(e,t)}while(1);if(qa(),Xc=n,qc.current=i,Qc!==null)throw Error(r(261));return Zc=null,$c=0,nl}function Bl(){for(;Qc!==null;)Hl(Qc)}function Vl(){for(;Qc!==null&&!dt();)Hl(Qc)}function Hl(e){var t=$l(e.alternate,e,el);e.memoizedProps=e.pendingProps,t===null?Ul(e):Qc=t,Jc.current=null}function Ul(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=gc(n,t),n!==null){n.flags&=32767,Qc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{nl=6,Qc=null;return}}else if(n=hc(n,t,el),n!==null){Qc=n;return}if(t=t.sibling,t!==null){Qc=t;return}Qc=t=e}while(t!==null);nl===0&&(nl=5)}function Wl(e,t,n){var r=zt,i=Yc.transition;try{Yc.transition=null,zt=1,Gl(e,t,n,r)}finally{Yc.transition=i,zt=r}return null}function Gl(e,t,n,i){do Kl();while(gl!==null);if(Xc&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Lt(e,o),e===Zc&&(Qc=Zc=null,$c=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||hl||(hl=!0,eu(_t,function(){return Kl(),null})),o=!!(n.flags&15990),n.subtreeFlags&15990||o){o=Yc.transition,Yc.transition=null;var s=zt;zt=1;var c=Xc;Xc|=4,Jc.current=null,wc(e,n),zc(n,e),Fr(Si),fn=!!xi,Si=xi=null,e.current=n,Vc(n,e,a),ft(),Xc=c,zt=s,Yc.transition=o}else e.current=n;if(hl&&(hl=!1,gl=e,_l=a),o=e.pendingLanes,o===0&&(ml=null),St(n.stateNode,i),Tl(e,pt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(fl)throw fl=!1,e=pl,pl=null,e;return _l&1&&e.tag!==0&&Kl(),o=e.pendingLanes,o&1?e===yl?vl++:(vl=0,yl=e):vl=0,la(),null}function Kl(){if(gl!==null){var e=Bt(_l),t=Yc.transition,n=zt;try{if(Yc.transition=null,zt=16>e?16:e,gl===null)var i=!1;else{if(e=gl,gl=null,_l=0,Xc&6)throw Error(r(331));var a=Xc;for(Xc|=4,bc=e.current;bc!==null;){var o=bc,s=o.child;if(bc.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(bc=u;bc!==null;){var d=bc;switch(d.tag){case 0:case 11:case 15:Tc(8,d,o)}var f=d.child;if(f!==null)f.return=d,bc=f;else for(;bc!==null;){d=bc;var p=d.sibling,m=d.return;if(Oc(d),d===u){bc=null;break}if(p!==null){p.return=m,bc=p;break}bc=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}bc=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,bc=s;else b:for(;bc!==null;){if(o=bc,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Tc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,bc=v;break b}bc=o.return}}var y=e.current;for(bc=y;bc!==null;){s=bc;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,bc=b;else b:for(s=y;bc!==null;){if(c=bc,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Ec(9,c)}}catch(e){Jl(c,c.return,e)}if(c===s){bc=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,bc=x;break b}bc=c.return}}if(Xc=a,la(),xt&&typeof xt.onPostCommitFiberRoot==`function`)try{xt.onPostCommitFiberRoot(bt,e)}catch{}i=!0}return i}finally{zt=n,Yc.transition=t}}return!1}function ql(e,t,n){t=As(n,t),t=Ps(e,t,1),e=oo(e,t,1),t=Sl(),e!==null&&(It(e,1,t),Tl(e,t))}function Jl(e,t,n){if(e.tag===3)ql(e,e,n);else for(;t!==null;){if(t.tag===3){ql(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ml===null||!ml.has(r))){e=As(n,e),e=Fs(t,e,1),t=oo(t,e,1),e=Sl(),t!==null&&(It(t,1,e),Tl(t,e));break}}t=t.return}}function Yl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Sl(),e.pingedLanes|=e.suspendedLanes&n,Zc===e&&($c&n)===n&&(nl===4||nl===3&&($c&130023424)===$c&&500>pt()-ll?Fl(e,0):ol|=n),Tl(e,t)}function Xl(e,t){t===0&&(e.mode&1?(t=Ot,Ot<<=1,!(Ot&130023424)&&(Ot=4194304)):t=1);var n=Sl();e=to(e,t),e!==null&&(It(e,t,n),Tl(e,n))}function Zl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xl(e,n)}function Ql(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Xl(e,n)}var $l=function(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps||Yi.current)Bs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Bs=!1,lc(e,t,n);Bs=!!(e.flags&131072)}}else Bs=!1,Ta&&t.flags&1048576&&ba(t,pa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;sc(e,t),e=t.pendingProps;var a=Zi(t,Ji.current);Xa(t,n),a=Lo(null,t,i,e,a,n);var o=Ro();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qi(i)?(o=!0,na(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ro(t),a.updater=Ts,t.stateNode=a,a._reactInternals=t,ks(t,i,e,n),t=Ys(null,t,i,!0,o,n)):(t.tag=0,Ta&&o&&xa(t),Vs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(sc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=iu(i),e=Cs(i,e),a){case 0:t=qs(null,t,i,e,n);break a;case 1:t=Js(null,t,i,e,n);break a;case 11:t=Hs(null,t,i,e,n);break a;case 14:t=Us(null,t,i,Cs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),qs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),Js(e,t,i,a,n);case 3:a:{if(Xs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,io(e,t),lo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=As(Error(r(423)),t),t=Zs(e,t,i,n,a);break a}if(i!==a){a=As(Error(r(424)),t),t=Zs(e,t,i,n,a);break a}for(wa=Ai(t.stateNode.containerInfo.firstChild),Ca=t,Ta=!0,Ea=null,n=Ha(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pa(),i===a){t=cc(e,t,n);break a}Vs(e,t,i,n)}t=t.child}return t;case 5:return yo(t),e===null&&Aa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ci(i,a)?s=null:o!==null&&Ci(i,o)&&(t.flags|=32),Ks(e,t),Vs(e,t,s,n),t.child;case 6:return e===null&&Aa(t),null;case 13:return ec(e,t,n);case 4:return _o(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Va(t,null,i,n):Vs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),Hs(e,t,i,a,n);case 7:return Vs(e,t,t.pendingProps,n),t.child;case 8:return Vs(e,t,t.pendingProps.children,n),t.child;case 12:return Vs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ki(Ua,i._currentValue),i._currentValue=s,o!==null){if(Or(o.value,s)){if(o.children===a.children&&!Yi.current){t=cc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=ao(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ya(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ya(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}}Vs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Xa(t,n),a=Za(a),i=i(a),t.flags|=1,Vs(e,t,i,n),t.child;case 14:return i=t.type,a=Cs(i,t.pendingProps),a=Cs(i.type,a),Us(e,t,i,a,n);case 15:return Ws(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),sc(e,t),t.tag=1,Qi(i)?(e=!0,na(t)):e=!1,Xa(t,n),Ds(t,i,a),ks(t,i,a,n),Ys(null,t,i,!0,e,n);case 19:return oc(e,t,n);case 22:return Gs(e,t,n)}throw Error(r(156,t.tag))};function eu(e,t){return lt(e,t)}function tu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nu(e,t,n,r){return new tu(e,t,n,r)}function ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iu(e){if(typeof e==`function`)return+!!ru(e);if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function au(e,t){var n=e.alternate;return n===null?(n=nu(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ou(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ru(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return su(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=nu(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=nu(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=nu(19,n,t,a),e.elementType=N,e.lanes=o,e;case I:return cu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=nu(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function su(e,t,n,r){return e=nu(7,e,r,t),e.lanes=n,e}function cu(e,t,n,r){return e=nu(22,e,r,t),e.elementType=I,e.lanes=n,e.stateNode={isHidden:!1},e}function lu(e,t,n){return e=nu(6,e,null,t),e.lanes=n,e}function uu(e,t,n){return t=nu(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function du(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ft(0),this.expirationTimes=Ft(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fu(e,t,n,r,i,a,o,s,c){return e=new du(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=nu(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ro(a),e}function pu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function mu(e){if(!e)return qi;e=e._reactInternals;a:{if(rt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Qi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Qi(n))return ta(e,n,t)}return t}function hu(e,t,n,r,i,a,o,s,c){return e=fu(n,r,!0,e,i,a,o,s,c),e.context=mu(null),n=e.current,r=Sl(),i=Cl(n),a=ao(r,i),a.callback=t??null,oo(n,a,i),e.current.lanes=i,It(e,i,r),Tl(e,r),e}function gu(e,t,n,r){var i=t.current,a=Sl(),o=Cl(i);return n=mu(n),t.context===null?t.context=n:t.pendingContext=n,t=ao(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=oo(i,t,o),e!==null&&(wl(e,i,o,a),so(e,i,o)),o}function _u(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function vu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yu(e,t){vu(e,t),(e=e.alternate)&&vu(e,t)}function bu(){return null}var xu=typeof reportError==`function`?reportError:function(e){console.error(e)};function Su(e){this._internalRoot=e}Cu.prototype.render=Su.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));gu(e,t,null,null)},Cu.prototype.unmount=Su.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nl(function(){gu(null,e,null,null)}),t[Fi]=null}};function Cu(e){this._internalRoot=e}Cu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$t.length&&t!==0&&t<$t[n].priority;n++);$t.splice(n,0,e),n===0&&an(e)}};function wu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function Eu(){}function Du(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=_u(o);a.call(e)}}var o=hu(t,r,e,0,null,!1,!1,``,Eu);return e._reactRootContainer=o,e[Fi]=o.current,li(e.nodeType===8?e.parentNode:e),Nl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=_u(c);s.call(e)}}var c=fu(e,0,!1,null,null,!1,!1,``,Eu);return e._reactRootContainer=c,e[Fi]=c.current,li(e.nodeType===8?e.parentNode:e),Nl(function(){gu(t,c,n,r)}),c}function Ou(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=_u(o);s.call(e)}}gu(t,o,e,i)}else o=Du(n,t,e,i,r);return _u(o)}Vt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=kt(t.pendingLanes);n!==0&&(Rt(t,n|1),Tl(t,pt()),!(Xc&6)&&(ul=pt()+500,la()))}break;case 13:Nl(function(){var t=to(e,1);t!==null&&wl(t,e,1,Sl())}),yu(e,1)}},Ht=function(e){if(e.tag===13){var t=to(e,134217728);t!==null&&wl(t,e,134217728,Sl()),yu(e,134217728)}},Ut=function(e){if(e.tag===13){var t=Cl(e),n=to(e,t);n!==null&&wl(n,e,t,Sl()),yu(e,t)}},Wt=function(){return zt},Gt=function(e,t){var n=zt;try{return zt=e,t()}finally{zt=n}},Ie=function(e,t,n){switch(t){case`input`:if(pe(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Vi(i);if(!a)throw Error(r(90));le(i),pe(i,a)}}}break;case`textarea`:be(e,n);break;case`select`:t=n.value,t!=null&&_e(e,!!n.multiple,t,!1)}},He=Ml,Ue=Nl;var ku={usingClientEntryPoint:!1,Events:[U,Bi,Vi,Be,Ve,Ml]},Au={findFiberByHostInstance:zi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},ju={bundleType:Au.bundleType,version:Au.version,rendererPackageName:Au.rendererPackageName,rendererConfig:Au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=st(e),e===null?null:e.stateNode},findFiberByHostInstance:Au.findFiberByHostInstance||bu,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 Mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mu.isDisabled&&Mu.supportsFiber)try{bt=Mu.inject(ju),xt=Mu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ku,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wu(t))throw Error(r(200));return pu(e,t,null,n)},e.createRoot=function(e,t){if(!wu(e))throw Error(r(299));var n=!1,i=``,a=xu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=fu(e,1,!1,null,null,n,!1,i,a),e[Fi]=t.current,li(e.nodeType===8?e.parentNode:e),new Su(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=st(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Nl(e)},e.hydrate=function(e,t,n){if(!Tu(t))throw Error(r(200));return Ou(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!wu(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=xu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=hu(t,null,e,1,n??null,a,!1,o,s),e[Fi]=t.current,li(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Cu(t)},e.render=function(e,t,n){if(!Tu(t))throw Error(r(200));return Ou(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!Tu(e))throw Error(r(40));return e._reactRootContainer?(Nl(function(){Ou(null,null,e,!1,function(){e._reactRootContainer=null,e[Fi]=null})}),!0):!1},e.unstable_batchedUpdates=Ml,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Tu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Ou(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),h=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=h();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),_=l(d(),1),v=1,y=1e6,b=0;function x(){return b=(b+1)%(2**53-1),b.toString()}var S=new Map,C=e=>{if(S.has(e))return;let t=setTimeout(()=>{S.delete(e),D({type:`REMOVE_TOAST`,toastId:e})},y);S.set(e,t)},w=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,v)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?C(n):e.toasts.forEach(e=>{C(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},T=[],E={toasts:[]};function D(e){E=w(E,e),T.forEach(e=>{e(E)})}function O({...e}){let t=x(),n=e=>D({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>D({type:`DISMISS_TOAST`,toastId:t});return D({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function k(){let[e,t]=_.useState(E);return _.useEffect(()=>(T.push(t),()=>{let e=T.indexOf(t);e>-1&&T.splice(e,1)}),[e]),{...e,toast:O,dismiss:e=>D({type:`DISMISS_TOAST`,toastId:e})}}var A=l(h(),1);typeof window<`u`&&window.document&&window.document.createElement;function j(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function M(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function N(...e){return t=>{let n=!1,r=e.map(e=>{let r=M(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():M(e[t],null)}}}}function P(...e){return _.useCallback(N(...e),e)}var F=o((e=>{var t=d(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),I=o(((e,t)=>{t.exports=F()}))();function L(e,t){let n=_.createContext(t),r=e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,I.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=_.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function R(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,z(i,...t)]}function z(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function B(e){let t=ee(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(ne);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function ee(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=ie(n),i=re(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var te=Symbol(`radix.slottable`);function ne(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===te}function re(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ie(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 ae(e){let t=e+`CollectionProvider`,[n,r]=R(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,I.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=B(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=P(t,a(s,n).collectionRef);return(0,I.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=B(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=P(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,I.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}function oe(e){let t=se(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(ce);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function se(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=ue(n),i=le(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var V=Symbol(`radix.slottable`);function ce(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===V}function le(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ue(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 H=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=oe(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function de(e,t){e&&A.flushSync(()=>e.dispatchEvent(t))}function fe(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...e)=>t.current?.(...e),[])}function pe(e,t=globalThis?.document){let n=fe(e);_.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var me=`DismissableLayer`,he=`dismissableLayer.update`,ge=`dismissableLayer.pointerDownOutside`,_e=`dismissableLayer.focusOutside`,ve,ye=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),be=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=_.useContext(ye),[u,d]=_.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=_.useState({}),m=P(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=h.indexOf(g),y=u?h.indexOf(u):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=Ce(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));x&&!n&&(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),C=we(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return pe(e=>{y===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),_.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ve=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Te(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ve)}},[u,f,n,l]),_.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Te())},[u,l]),_.useEffect(()=>{let e=()=>p({});return document.addEventListener(he,e),()=>document.removeEventListener(he,e)},[]),(0,I.jsx)(H.div,{...c,ref:m,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:j(e.onFocusCapture,C.onFocusCapture),onBlurCapture:j(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,S.onPointerDownCapture)})});be.displayName=me;var xe=`DismissableLayerBranch`,Se=_.forwardRef((e,t)=>{let n=_.useContext(ye),r=_.useRef(null),i=P(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,I.jsx)(H.div,{...e,ref:i})});Se.displayName=xe;function Ce(e,t=globalThis?.document){let n=fe(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Ee(ge,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function we(e,t=globalThis?.document){let n=fe(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&Ee(_e,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Te(){let e=new CustomEvent(he);document.dispatchEvent(e)}function Ee(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?de(i,a):i.dispatchEvent(a)}var De=be,Oe=Se,ke=globalThis?.document?_.useLayoutEffect:()=>{},Ae=`Portal`,je=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);ke(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?A.createPortal((0,I.jsx)(H.div,{...r,ref:t}),o):null});je.displayName=Ae;function Me(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var Ne=e=>{let{present:t,children:n}=e,r=Pe(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=P(r.ref,Ie(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null};Ne.displayName=`Presence`;function Pe(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),[o,s]=Me(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{let e=Fe(r.current);a.current=o===`mounted`?e:`none`},[o]),ke(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Fe(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),ke(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Fe(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Fe(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Fe(e){return e?.animationName||`none`}function Ie(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 Le=_.useInsertionEffect||ke;function Re({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=ze({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`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.`),t.current=s},[s,r])}return[c,_.useCallback(t=>{if(s){let n=Be(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function ze({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Le(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Be(e){return typeof e==`function`}var Ve=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`}),He=`VisuallyHidden`,Ue=_.forwardRef((e,t)=>(0,I.jsx)(H.span,{...e,ref:t,style:{...Ve,...e.style}}));Ue.displayName=He;var We=Ue,Ge=`ToastProvider`,[Ke,qe,Je]=ae(`Toast`),[Ye,Xe]=R(`Toast`,[Je]),[Ze,Qe]=Ye(Ge),$e=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=_.useState(null),[l,u]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ge}\`. Expected non-empty \`string\`.`),(0,I.jsx)(Ke.Provider,{scope:t,children:(0,I.jsx)(Ze,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:_.useCallback(()=>u(e=>e+1),[]),onToastRemove:_.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};$e.displayName=Ge;var et=`ToastViewport`,tt=[`F8`],nt=`toast.viewportPause`,rt=`toast.viewportResume`,it=_.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=tt,label:i=`Notifications ({hotkey})`,...a}=e,o=Qe(et,n),s=qe(n),c=_.useRef(null),l=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=P(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;_.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),_.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(nt);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(rt);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=_.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...jt(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return _.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Mt(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,I.jsxs)(Oe,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,I.jsx)(ot,{ref:l,onFocusFromOutsideViewport:()=>{Mt(h({tabbingDirection:`forwards`}))}}),(0,I.jsx)(Ke.Slot,{scope:n,children:(0,I.jsx)(H.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,I.jsx)(ot,{ref:u,onFocusFromOutsideViewport:()=>{Mt(h({tabbingDirection:`backwards`}))}})]})});it.displayName=et;var at=`ToastFocusProxy`,ot=_.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Qe(at,n);return(0,I.jsx)(Ue,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});ot.displayName=at;var st=`Toast`,ct=`toast.swipeStart`,lt=`toast.swipeMove`,ut=`toast.swipeCancel`,dt=`toast.swipeEnd`,ft=_.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Re({prop:r,defaultProp:i??!0,onChange:a,caller:st});return(0,I.jsx)(Ne,{present:n||s,children:(0,I.jsx)(ht,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:fe(e.onPause),onResume:fe(e.onResume),onSwipeStart:j(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:j(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:j(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:j(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});ft.displayName=st;var[pt,mt]=Ye(st,{onClose(){}}),ht=_.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=Qe(st,n),[g,v]=_.useState(null),y=P(t,e=>v(e)),b=_.useRef(null),x=_.useRef(null),S=i||h.duration,C=_.useRef(0),w=_.useRef(S),T=_.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=fe(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),k=_.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);_.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{k(w.current),l?.()},n=()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()};return e.addEventListener(nt,n),e.addEventListener(rt,t),()=>{e.removeEventListener(nt,n),e.removeEventListener(rt,t)}}},[h.viewport,S,c,l,k]),_.useEffect(()=>{a&&!h.isClosePausedRef.current&&k(S)},[a,S,h.isClosePausedRef,k]),_.useEffect(()=>(E(),()=>D()),[E,D]);let M=_.useMemo(()=>g?Et(g):null,[g]);return h.viewport?(0,I.jsxs)(I.Fragment,{children:[M&&(0,I.jsx)(gt,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:M}),(0,I.jsx)(pt,{scope:n,onClose:O,children:A.createPortal((0,I.jsx)(Ke.ItemSlot,{scope:n,children:(0,I.jsx)(De,{asChild:!0,onEscapeKeyDown:j(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,I.jsx)(H.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:j(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:j(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:j(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,Dt(lt,d,f,{discrete:!1})):Ot(l,h.swipeDirection,c)?(x.current=l,Dt(ct,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:j(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Ot(t,h.swipeDirection,h.swipeThreshold)?Dt(dt,p,r,{discrete:!0}):Dt(ut,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),gt=e=>{let{__scopeToast:t,children:n,...r}=e,i=Qe(st,t),[a,o]=_.useState(!1),[s,c]=_.useState(!1);return kt(()=>o(!0)),_.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,I.jsx)(je,{asChild:!0,children:(0,I.jsx)(Ue,{...r,children:a&&(0,I.jsxs)(I.Fragment,{children:[i.label,` `,n]})})})},_t=`ToastTitle`,vt=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,I.jsx)(H.div,{...r,ref:t})});vt.displayName=_t;var yt=`ToastDescription`,bt=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,I.jsx)(H.div,{...r,ref:t})});bt.displayName=yt;var xt=`ToastAction`,St=_.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,I.jsx)(Tt,{altText:n,asChild:!0,children:(0,I.jsx)(wt,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${xt}\`. Expected non-empty \`string\`.`),null)});St.displayName=xt;var Ct=`ToastClose`,wt=_.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=mt(Ct,n);return(0,I.jsx)(Tt,{asChild:!0,children:(0,I.jsx)(H.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,i.onClose)})})});wt.displayName=Ct;var Tt=_.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,I.jsx)(H.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Et(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),At(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Et(e))}}}),t}function Dt(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?de(i,a):i.dispatchEvent(a)}var Ot=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function kt(e=()=>{}){let t=fe(e);ke(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function At(e){return e.nodeType===e.ELEMENT_NODE}function jt(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Mt(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}var Nt=$e,Pt=it,Ft=ft,It=vt,Lt=bt,Rt=St,zt=wt;function Bt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Bt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Vt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Bt(e))&&(r&&(r+=` `),r+=t);return r}var Ht=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ut=Vt,Wt=(e,t)=>n=>{if(t?.variants==null)return Ut(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ht(t)||Ht(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ut(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Gt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Kt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),qt={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`},Jt=(0,_.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,_.createElement)(`svg`,{ref:c,...qt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Kt(`lucide`,i),...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Yt=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(Jt,{ref:i,iconNode:t,className:Kt(`lucide-${Gt(e)}`,n),...r}));return n.displayName=`${e}`,n},Xt=Yt(`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`}]]),Zt=Yt(`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`}]]),Qt=Yt(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),$t=Yt(`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`}]]),en=Yt(`CalendarRange`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M17 14h-6`,key:`bkmgh3`}],[`path`,{d:`M13 18H7`,key:`bb0bb7`}],[`path`,{d:`M7 14h.01`,key:`1qa3f1`}],[`path`,{d:`M17 18h.01`,key:`1bdyru`}]]),tn=Yt(`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`}]]),nn=Yt(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),rn=Yt(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),an=Yt(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),on=Yt(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),sn=Yt(`ChevronsUpDown`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),cn=Yt(`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`}]]),ln=Yt(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),un=Yt(`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`}]]),dn=Yt(`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`}]]),fn=Yt(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),pn=Yt(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),mn=Yt(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),hn=Yt(`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`}]]),gn=Yt(`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`}]]),_n=Yt(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),vn=Yt(`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`}]]),yn=Yt(`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`}]]),bn=Yt(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),xn=Yt(`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`}]]),Sn=Yt(`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`}]]),Cn=Yt(`FileSpreadsheet`,[[`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:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),wn=Yt(`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`}]]),Tn=Yt(`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`}]]),En=Yt(`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`}]]),Dn=Yt(`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`}]]),On=Yt(`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`}]]),kn=Yt(`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`}]]),An=Yt(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),jn=Yt(`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`}]]),Mn=Yt(`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`}]]),Nn=Yt(`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`}]]),Pn=Yt(`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`}]]),Fn=Yt(`ListPlus`,[[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 6H3`,key:`1wxfjs`}],[`path`,{d:`M16 18H3`,key:`12xzn7`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),In=Yt(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Ln=Yt(`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`}]]),Rn=Yt(`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`}]]),zn=Yt(`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`}]]),Bn=Yt(`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`}]]),Vn=Yt(`PanelLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Hn=Yt(`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`}]]),Un=Yt(`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`}]]),Wn=Yt(`Paperclip`,[[`path`,{d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`,key:`1u3ebp`}]]),Gn=Yt(`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`}]]),Kn=Yt(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),qn=Yt(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Jn=Yt(`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`}]]),Yn=Yt(`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`}]]),Xn=Yt(`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`}]]),Zn=Yt(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Qn=Yt(`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`}]]),$n=Yt(`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`}]]),er=Yt(`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`}]]),tr=Yt(`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`}]]),nr=Yt(`SquarePen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),rr=Yt(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ir=Yt(`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`}]]),ar=Yt(`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`}]]),or=Yt(`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`}]]),sr=Yt(`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`}]]),cr=Yt(`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`}]]),lr=Yt(`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`}]]),ur=Yt(`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`}]]),dr=Yt(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),fr=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},pr=(e,t)=>({classGroupId:e,validator:t}),mr=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hr=`-`,gr=[],_r=`arbitrary..`,vr=e=>{let t=xr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return br(e);let n=e.split(hr);return yr(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?fr(i,t):t:i||gr}return n[e]||gr}}},yr=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=yr(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(hr):e.slice(t).join(hr),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},br=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?_r+r:void 0})(),xr=e=>{let{theme:t,classGroups:n}=e;return Sr(n,t)},Sr=(e,t)=>{let n=mr();for(let r in e){let i=e[r];Cr(i,n,r,t)}return n},Cr=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];wr(i,t,n,r)}},wr=(e,t,n,r)=>{typeof e==`string`?Tr(e,t,n):typeof e==`function`?Er(e,t,n,r):Dr(e,t,n,r)},Tr=(e,t,n)=>{let r=e===``?t:Or(t,e);r.classGroupId=n},Er=(e,t,n,r)=>{kr(e)?Cr(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(pr(n,e)))},Dr=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Cr(o,Or(t,a),n,r)}},Or=(e,t)=>{let n=e,r=t.split(hr),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=mr(),n.nextPart.set(t,i)),n=i}return n},kr=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Ar=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},jr=`!`,Mr=`:`,Nr=[],Pr=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Fr=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Mr){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(jr)?(c=s.slice(0,-1),l=!0):s.startsWith(jr)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Pr(t,l,c,u)};if(t){let e=t+Mr,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Pr(Nr,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Ir=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Lr=e=>({cache:Ar(e.cacheSize),parseClassName:Fr(e),sortModifiers:Ir(e),postfixLookupClassGroupIds:Rr(e),...vr(e)}),Rr=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},zr=/\s+/,Br=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(zr),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+jr:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Vr=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Hr(n))&&(i&&(i+=` `),i+=r);return i},Hr=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Hr(e[r]))&&(n&&(n+=` `),n+=t);return n},Ur=(e,...t)=>{let n,r,i,a,o=o=>(n=Lr(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Br(e,n);return i(e,a),a};return a=o,(...e)=>a(Vr(...e))},Wr=[],Gr=e=>{let t=t=>t[e]||Wr;return t.isThemeGetter=!0,t.themeKey=e,t},Kr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Jr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Yr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xr=/\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$/,Zr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Qr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$r=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ei=e=>Jr.test(e),ti=e=>!!e&&!Number.isNaN(Number(e)),ni=e=>!!e&&Number.isInteger(Number(e)),ri=e=>e.endsWith(`%`)&&ti(e.slice(0,-1)),ii=e=>Yr.test(e),ai=()=>!0,oi=e=>Xr.test(e)&&!Zr.test(e),si=()=>!1,ci=e=>Qr.test(e),li=e=>$r.test(e),ui=e=>!pi(e)&&!xi(e),di=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),fi=e=>ki(e,Ni,si),pi=e=>Kr.test(e),mi=e=>ki(e,Pi,oi),hi=e=>ki(e,Fi,ti),gi=e=>ki(e,Li,ai),_i=e=>ki(e,Ii,si),vi=e=>ki(e,ji,si),yi=e=>ki(e,Mi,li),bi=e=>ki(e,Ri,ci),xi=e=>qr.test(e),Si=e=>Ai(e,Pi),Ci=e=>Ai(e,Ii),wi=e=>Ai(e,ji),Ti=e=>Ai(e,Ni),Ei=e=>Ai(e,Mi),Di=e=>Ai(e,Ri,!0),Oi=e=>Ai(e,Li,!0),ki=(e,t,n)=>{let r=Kr.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ai=(e,t,n=!1)=>{let r=qr.exec(e);return r?r[1]?t(r[1]):n:!1},ji=e=>e===`position`||e===`percentage`,Mi=e=>e===`image`||e===`url`,Ni=e=>e===`length`||e===`size`||e===`bg-size`,Pi=e=>e===`length`,Fi=e=>e===`number`,Ii=e=>e===`family-name`,Li=e=>e===`number`||e===`weight`,Ri=e=>e===`shadow`,zi=Ur(()=>{let e=Gr(`color`),t=Gr(`font`),n=Gr(`text`),r=Gr(`font-weight`),i=Gr(`tracking`),a=Gr(`leading`),o=Gr(`breakpoint`),s=Gr(`container`),c=Gr(`spacing`),l=Gr(`radius`),u=Gr(`shadow`),d=Gr(`inset-shadow`),f=Gr(`text-shadow`),p=Gr(`drop-shadow`),m=Gr(`blur`),h=Gr(`perspective`),g=Gr(`aspect`),_=Gr(`ease`),v=Gr(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),xi,pi],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[xi,pi,c],T=()=>[ei,`full`,`auto`,...w()],E=()=>[ni,`none`,`subgrid`,xi,pi],D=()=>[`auto`,{span:[`full`,ni,xi,pi]},ni,xi,pi],O=()=>[ni,`auto`,xi,pi],k=()=>[`auto`,`min`,`max`,`fr`,xi,pi],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[ei,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[s,ei,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[ei,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,xi,pi],L=()=>[...b(),wi,vi,{position:[xi,pi]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],z=()=>[`auto`,`cover`,`contain`,Ti,fi,{size:[xi,pi]}],B=()=>[ri,Si,mi],ee=()=>[``,`none`,`full`,l,xi,pi],te=()=>[``,ti,Si,mi],ne=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[ti,ri,wi,vi],ae=()=>[``,`none`,m,xi,pi],oe=()=>[`none`,ti,xi,pi],se=()=>[`none`,ti,xi,pi],V=()=>[ti,xi,pi],ce=()=>[ei,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ii],breakpoint:[ii],color:[ai],container:[ii],"drop-shadow":[ii],ease:[`in`,`out`,`in-out`],font:[ui],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ii],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ii],shadow:[ii],spacing:[`px`,ti],text:[ii],"text-shadow":[ii],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,ei,pi,xi,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,xi,pi]}],"container-named":[di],columns:[{columns:[ti,`auto`,pi,xi,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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`],sr:[`sr-only`,`not-sr-only`],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:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[ni,`auto`,xi,pi]}],basis:[{basis:[ei,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[ti,ei,`auto`,`initial`,`none`,pi]}],grow:[{grow:[``,ti,xi,pi]}],shrink:[{shrink:[``,ti,xi,pi]}],order:[{order:[ni,`first`,`last`,`none`,xi,pi]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...N()]}],"font-size":[{text:[`base`,n,Si,mi]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Oi,gi]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ri,pi]}],"font-family":[{font:[Ci,_i,t]}],"font-features":[{"font-features":[pi]}],"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:[i,xi,pi]}],"line-clamp":[{"line-clamp":[ti,`none`,xi,hi]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,xi,pi]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,xi,pi]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ne(),`wavy`]}],"text-decoration-thickness":[{decoration:[ti,`from-font`,`auto`,xi,mi]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[ti,`auto`,xi,pi]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[ni,xi,pi]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,xi,pi]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,xi,pi]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:z()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},ni,xi,pi],radial:[``,xi,pi],conic:[``,ni,xi,pi]},Ei,yi]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":te()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ne(),`hidden`,`none`]}],"divide-style":[{divide:[...ne(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...ne(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[ti,xi,pi]}],"outline-w":[{outline:[``,ti,Si,mi]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`inner`,`none`,u,Di,bi]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Di,bi]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:te()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[ti,mi]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Di,bi]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[ti,xi,pi]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[ti]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[xi,pi]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[ti]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,xi,pi]}],filter:[{filter:[``,`none`,xi,pi]}],blur:[{blur:ae()}],brightness:[{brightness:[ti,xi,pi]}],contrast:[{contrast:[ti,xi,pi]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Di,bi]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,ti,xi,pi]}],"hue-rotate":[{"hue-rotate":[ti,xi,pi]}],invert:[{invert:[``,ti,xi,pi]}],saturate:[{saturate:[ti,xi,pi]}],sepia:[{sepia:[``,ti,xi,pi]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,xi,pi]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[ti,xi,pi]}],"backdrop-contrast":[{"backdrop-contrast":[ti,xi,pi]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,ti,xi,pi]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ti,xi,pi]}],"backdrop-invert":[{"backdrop-invert":[``,ti,xi,pi]}],"backdrop-opacity":[{"backdrop-opacity":[ti,xi,pi]}],"backdrop-saturate":[{"backdrop-saturate":[ti,xi,pi]}],"backdrop-sepia":[{"backdrop-sepia":[``,ti,xi,pi]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,xi,pi]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[ti,`initial`,xi,pi]}],ease:[{ease:[`linear`,`initial`,_,xi,pi]}],delay:[{delay:[ti,xi,pi]}],animate:[{animate:[`none`,v,xi,pi]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,xi,pi]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":[`scale-3d`],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[xi,pi,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ce()}],"translate-x":[{"translate-x":ce()}],"translate-y":[{"translate-y":ce()}],"translate-z":[{"translate-z":ce()}],"translate-none":[`translate-none`],zoom:[{zoom:[ni,xi,pi]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],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`,xi,pi]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,xi,pi]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[ti,Si,mi,hi]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`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-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function U(...e){return zi(Vt(e))}function Bi(e){return e===null?`–`:`${Math.round(e*100)}%`}function Vi(e,t=``){return typeof e==`string`&&e.trim().length>0?e.trim():t}var Hi=Nt,Ui=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Pt,{ref:n,className:U(`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}));Ui.displayName=Pt.displayName;var Wi=Wt(`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-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--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 sm:data-[state=open]: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`}}),Gi=_.forwardRef(({className:e,variant:t,...n},r)=>(0,I.jsx)(Ft,{ref:r,className:U(Wi({variant:t}),e),...n}));Gi.displayName=Ft.displayName;var Ki=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Rt,{ref:n,className:U(`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 hover:group-[.destructive]:border-destructive/30 hover:group-[.destructive]:bg-destructive hover:group-[.destructive]:text-destructive-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:group-[.destructive]:ring-destructive disabled:pointer-events-none disabled:opacity-50`,e),...t}));Ki.displayName=Rt.displayName;var qi=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(zt,{ref:n,className:U(`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 hover:group-[.destructive]:text-red-50 focus:opacity-100 focus:outline-hidden focus:ring-2 focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600`,e),"toast-close":``,...t,children:(0,I.jsx)(dr,{className:`h-4 w-4`})}));qi.displayName=zt.displayName;var Ji=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(It,{ref:n,className:U(`text-sm font-semibold`,e),...t}));Ji.displayName=It.displayName;var Yi=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Lt,{ref:n,className:U(`text-sm opacity-90`,e),...t}));Yi.displayName=Lt.displayName;function Xi(){let{toasts:e}=k();return(0,I.jsxs)(Hi,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,I.jsxs)(Gi,{...i,children:[(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,I.jsx)(Ji,{children:t}),n&&(0,I.jsx)(Yi,{children:n})]}),r,(0,I.jsx)(qi,{})]},e)}),(0,I.jsx)(Ui,{})]})}var Zi=[`light`,`dark`],Qi=`(prefers-color-scheme: dark)`,$i=_.createContext(void 0),ea={setTheme:e=>{},themes:[]},ta=()=>_.useContext($i)??ea;_.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,attrs:s,nonce:c})=>{let l=a===`system`,u=n===`class`?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(e=>`'${e}'`).join(`,`)})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,d=i?Zi.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:`if(e==='light'||e==='dark')d.style.colorScheme=e`:``,f=(e,t=!1,r=!0)=>{let a=o?o[e]:e,s=t?e+`|| ''`:`'${a}'`,c=``;return i&&r&&!t&&Zi.includes(e)&&(c+=`d.style.colorScheme = '${e}';`),n===`class`?c+=t||a?`c.add(${s})`:`null`:a&&(c+=`d[s](n,${s})`),c},p=e?`!function(){${u}${f(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${Qi}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f(`dark`)}}else{${f(`light`)}}}else if(e){${o?`var x=${JSON.stringify(o)};`:``}${f(o?`x[e]`:`e`,!0)}}${l?``:`else{`+f(a,!1,!1)+`}`}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:``}${f(o?`x[e]`:`e`,!0)}}else{${f(a,!1,!1)};}${d}}catch(t){}}();`;return _.createElement(`script`,{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var na=e=>{switch(e){case`success`:return aa;case`info`:return sa;case`warning`:return oa;case`error`:return ca;default:return null}},ra=Array(12).fill(0),ia=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},_.createElement(`div`,{className:`sonner-spinner`},ra.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),aa=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.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`})),oa=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},_.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`})),sa=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.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`})),ca=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},_.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`})),la=_.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`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ua=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},da=1,fa=new 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=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:da++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.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`?void 0:t.description}));let r=e instanceof Promise?e:e(),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ma(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:n,type:`error`,message:r,description:a})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`success`,message:r,description:a})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`error`,message:r,description:a})}}).finally(()=>{var e;i&&(this.dismiss(n),n=void 0),(e=t.finally)==null||e.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||da++;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}},pa=(e,t)=>{let n=t?.id||da++;return fa.addToast({title:e,...t,id:n}),n},ma=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(pa,{success:fa.success,info:fa.info,warning:fa.warning,error:fa.error,custom:fa.custom,message:fa.message,promise:fa.promise,dismiss:fa.dismiss,loading:fa.loading},{getHistory:()=>fa.toasts,getToasts:()=>fa.getActiveToasts()});function ha(e,{insertAt:t}={}){if(!e||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))}ha(`: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 ga(e){return e.label!==void 0}var _a=3,va=`32px`,ya=`16px`,ba=4e3,xa=356,Sa=14,Ca=20,wa=200;function Ta(...e){return e.filter(Boolean).join(` `)}function Ea(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Da=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,loadingIcon:C,expandByDefault:w,classNames:T,icons:E,closeButtonAriaLabel:D=`Close toast`,pauseWhenPageIsHidden:O}=e,[k,A]=_.useState(null),[j,M]=_.useState(null),[N,P]=_.useState(!1),[F,I]=_.useState(!1),[L,R]=_.useState(!1),[z,B]=_.useState(!1),[ee,te]=_.useState(!1),[ne,re]=_.useState(0),[ie,ae]=_.useState(0),oe=_.useRef(n.duration||b||ba),se=_.useRef(null),V=_.useRef(null),ce=c===0,le=c+1<=o,ue=n.type,H=n.dismissible!==!1,de=n.className||``,fe=n.descriptionClassName||``,pe=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),me=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),he=_.useMemo(()=>n.duration||b||ba,[n.duration,b]),ge=_.useRef(0),_e=_.useRef(0),ve=_.useRef(0),ye=_.useRef(null),[be,xe]=x.split(`-`),Se=_.useMemo(()=>s.reduce((e,t,n)=>n>=pe?e:e+t.height,0),[s,pe]),Ce=ua(),we=n.invert||t,Te=ue===`loading`;_e.current=_.useMemo(()=>pe*S+Se,[pe,Se]),_.useEffect(()=>{oe.current=he},[he]),_.useEffect(()=>{P(!0)},[]),_.useEffect(()=>{let e=V.current;if(e){let t=e.getBoundingClientRect().height;return ae(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!N)return;let e=V.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ae(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[N,n.title,n.description,a,n.id]);let Ee=_.useCallback(()=>{I(!0),re(_e.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},wa)},[n,d,a,_e]);_.useEffect(()=>{if(n.promise&&ue===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||O&&Ce?(()=>{if(ve.current<ge.current){let e=new Date().getTime()-ge.current;oe.current-=e}ve.current=new Date().getTime()})():oe.current!==1/0&&(ge.current=new Date().getTime(),e=setTimeout(()=>{var e;(e=n.onAutoClose)==null||e.call(n,n),Ee()},oe.current)),()=>clearTimeout(e)},[u,i,n,ue,O,Ce,Ee]),_.useEffect(()=>{n.delete&&Ee()},[Ee,n.delete]);function De(){return E!=null&&E.loading?_.createElement(`div`,{className:Ta(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ue===`loading`},E.loading):C?_.createElement(`div`,{className:Ta(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ue===`loading`},C):_.createElement(ia,{className:Ta(T?.loader,n?.classNames?.loader),visible:ue===`loading`})}return _.createElement(`li`,{tabIndex:0,ref:V,className:Ta(v,de,T?.toast,n?.classNames?.toast,T?.default,T?.[ue],n?.classNames?.[ue]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":N,"data-promise":!!n.promise,"data-swiped":ee,"data-removed":F,"data-visible":le,"data-y-position":be,"data-x-position":xe,"data-index":c,"data-front":ce,"data-swiping":L,"data-dismissible":H,"data-type":ue,"data-invert":we,"data-swipe-out":z,"data-swipe-direction":j,"data-expanded":!!(u||w&&N),style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${F?ne:_e.current}px`,"--initial-height":w?`auto`:`${ie}px`,...m,...n.style},onDragEnd:()=>{R(!1),A(null),ye.current=null},onPointerDown:e=>{Te||!H||(se.current=new Date,re(_e.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(R(!0),ye.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e;if(z||!H)return;ye.current=null;let t=Number(V.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),r=Number(V.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),i=new Date().getTime()-se.current?.getTime(),a=k===`x`?t:r,o=Math.abs(a)/i;Math.abs(a)>=Ca||o>.11?(re(_e.current),(e=n.onDismiss)==null||e.call(n,n),M(k===`x`?t>0?`right`:`left`:r>0?`down`:`up`),Ee(),B(!0),te(!1)):(R(!1),A(null))},onPointerMove:t=>{var n,r;if(!ye.current||!H||window.getSelection()?.toString().length>0)return;let i=t.clientY-ye.current.y,a=t.clientX-ye.current.x,o=e.swipeDirections??Ea(x);!k&&(Math.abs(a)>1||Math.abs(i)>1)&&A(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0};k===`y`?(o.includes(`top`)||o.includes(`bottom`))&&(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)&&(s.y=i):k===`x`&&(o.includes(`left`)||o.includes(`right`))&&(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)&&(s.x=a),(Math.abs(s.x)>0||Math.abs(s.y)>0)&&te(!0),(n=V.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=V.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},me&&!n.jsx?_.createElement(`button`,{"aria-label":D,"data-disabled":Te,"data-close-button":!0,onClick:Te||!H?()=>{}:()=>{var e;Ee(),(e=n.onDismiss)==null||e.call(n,n)},className:Ta(T?.closeButton,n?.classNames?.closeButton)},E?.close??la):null,n.jsx||(0,_.isValidElement)(n.title)?n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title:_.createElement(_.Fragment,null,ue||n.icon||n.promise?_.createElement(`div`,{"data-icon":``,className:Ta(T?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||De():null,n.type===`loading`?null:n.icon||E?.[ue]||na(ue)):null,_.createElement(`div`,{"data-content":``,className:Ta(T?.content,n?.classNames?.content)},_.createElement(`div`,{"data-title":``,className:Ta(T?.title,n?.classNames?.title)},typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{"data-description":``,className:Ta(y,fe,T?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),(0,_.isValidElement)(n.cancel)?n.cancel:n.cancel&&ga(n.cancel)?_.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{var t,r;ga(n.cancel)&&H&&((r=(t=n.cancel).onClick)==null||r.call(t,e),Ee())},className:Ta(T?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,(0,_.isValidElement)(n.action)?n.action:n.action&&ga(n.action)?_.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{var t,r;ga(n.action)&&((r=(t=n.action).onClick)==null||r.call(t,e),!e.defaultPrevented&&Ee())},className:Ta(T?.actionButton,n?.classNames?.actionButton)},n.action.label):null))};function Oa(){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 ka(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?ya:va;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Aa=(0,_.forwardRef)(function(e,t){let{invert:n,position:r=`bottom-right`,hotkey:i=[`altKey`,`KeyT`],expand:a,closeButton:o,className:s,offset:c,mobileOffset:l,theme:u=`light`,richColors:d,duration:f,style:p,visibleToasts:m=_a,toastOptions:h,dir:g=Oa(),gap:v=Sa,loadingIcon:y,icons:b,containerAriaLabel:x=`Notifications`,pauseWhenPageIsHidden:S}=e,[C,w]=_.useState([]),T=_.useMemo(()=>Array.from(new Set([r].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,r]),[E,D]=_.useState([]),[O,k]=_.useState(!1),[j,M]=_.useState(!1),[N,P]=_.useState(u===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:u),F=_.useRef(null),I=i.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=_.useRef(null),R=_.useRef(!1),z=_.useCallback(e=>{w(t=>{var n;return(n=t.find(t=>t.id===e.id))!=null&&n.delete||fa.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return _.useEffect(()=>fa.subscribe(e=>{e.dismiss?w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{A.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),_.useEffect(()=>{if(u!==`system`){P(u);return}if(u===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[u]),_.useEffect(()=>{C.length<=1&&k(!1)},[C]),_.useEffect(()=>{let e=e=>{var t,n;i.every(t=>e[t]||e.code===t)&&(k(!0),(t=F.current)==null||t.focus()),e.code===`Escape`&&(document.activeElement===F.current||(n=F.current)!=null&&n.contains(document.activeElement))&&k(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i]),_.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),_.createElement(`section`,{ref:t,"aria-label":`${x} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},T.map((t,r)=>{let[i,u]=t.split(`-`);return C.length?_.createElement(`ol`,{key:t,dir:g===`auto`?Oa():g,tabIndex:-1,ref:F,className:s,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":i,"data-lifted":O&&C.length>1&&!a,"data-x-position":u,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${xa}px`,"--gap":`${v}px`,...p,...ka(c,l)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{j||k(!1)},onDragEnd:()=>k(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},C.filter(e=>!e.position&&r===0||e.position===t).map((r,i)=>_.createElement(Da,{key:r.id,icons:b,index:i,toast:r,defaultRichColors:d,duration:h?.duration??f,className:h?.className,descriptionClassName:h?.descriptionClassName,invert:n,visibleToasts:m,closeButton:h?.closeButton??o,interacting:j,position:t,style:h?.style,unstyled:h?.unstyled,classNames:h?.classNames,cancelButtonStyle:h?.cancelButtonStyle,actionButtonStyle:h?.actionButtonStyle,removeToast:z,toasts:C.filter(e=>e.position==r.position),heights:E.filter(e=>e.position==r.position),setHeights:D,expandByDefault:a,gap:v,loadingIcon:y,expanded:O,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections}))):null}))}),ja=({...e})=>{let{theme:t=`system`}=ta();return(0,I.jsx)(Aa,{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})},Ma=_.useId||(()=>void 0),Na=0;function Pa(e){let[t,n]=_.useState(Ma());return ke(()=>{e||n(e=>e??String(Na++))},[e]),e||(t?`radix-${t}`:``)}var Fa=[`top`,`right`,`bottom`,`left`],Ia=Math.min,La=Math.max,Ra=Math.round,za=Math.floor,Ba=e=>({x:e,y:e}),Va={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Ha={start:`end`,end:`start`};function Ua(e,t,n){return La(e,Ia(t,n))}function Wa(e,t){return typeof e==`function`?e(t):e}function Ga(e){return e.split(`-`)[0]}function Ka(e){return e.split(`-`)[1]}function qa(e){return e===`x`?`y`:`x`}function Ja(e){return e===`y`?`height`:`width`}var Ya=new Set([`top`,`bottom`]);function Xa(e){return Ya.has(Ga(e))?`y`:`x`}function Za(e){return qa(Xa(e))}function Qa(e,t,n){n===void 0&&(n=!1);let r=Ka(e),i=Za(e),a=Ja(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=so(o)),[o,so(o)]}function $a(e){let t=so(e);return[eo(e),t,eo(t)]}function eo(e){return e.replace(/start|end/g,e=>Ha[e])}var to=[`left`,`right`],no=[`right`,`left`],ro=[`top`,`bottom`],io=[`bottom`,`top`];function ao(e,t,n){switch(e){case`top`:case`bottom`:return n?t?no:to:t?to:no;case`left`:case`right`:return t?ro:io;default:return[]}}function oo(e,t,n,r){let i=Ka(e),a=ao(Ga(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(eo)))),a}function so(e){return e.replace(/left|right|bottom|top/g,e=>Va[e])}function co(e){return{top:0,right:0,bottom:0,left:0,...e}}function lo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:co(e)}function uo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fo(e,t,n){let{reference:r,floating:i}=e,a=Xa(t),o=Za(t),s=Ja(o),c=Ga(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ka(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function po(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Wa(t,e),p=lo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=uo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=uo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var mo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=fo(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:{...o,detectOverflow:o.detectOverflow??po},elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=fo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}},ho=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Wa(e,t)||{};if(l==null)return{};let d=lo(u),f={x:n,y:r},p=Za(i),m=Ja(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ia(d[_],T),D=Ia(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Ua(O,A,k),M=!c.arrow&&Ka(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),go=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Wa(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ga(r),_=Xa(o),v=Ga(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[so(o)]:$a(o)),x=p!==`none`;!d&&x&&b.push(...oo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Qa(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Xa(t)||T.every(e=>Xa(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Xa(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function _o(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vo(e){return Fa.some(t=>e[t]>=0)}var yo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Wa(e,t);switch(i){case`referenceHidden`:{let e=_o(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:vo(e)}}}case`escaped`:{let e=_o(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:vo(e)}}}default:return{}}}}},bo=new Set([`left`,`top`]);async function xo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ga(n),s=Ka(n),c=Xa(n)===`y`,l=bo.has(o)?-1:1,u=a&&c?-1:1,d=Wa(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var So=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await xo(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Co=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Wa(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Xa(Ga(i)),p=qa(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ua(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ua(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},wo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Wa(e,t),u={x:n,y:r},d=Xa(i),f=qa(d),p=u[f],m=u[d],h=Wa(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=bo.has(Ga(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},To=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Wa(e,t),u=await o.detectOverflow(t,l),d=Ga(i),f=Ka(i),p=Xa(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ia(h-u[g],v),x=Ia(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=La(u.left,0),t=La(u.right,0),n=La(u.top,0),r=La(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:La(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:La(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Eo(){return typeof window<`u`}function Do(e){return Ao(e)?(e.nodeName||``).toLowerCase():`#document`}function Oo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ko(e){return((Ao(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ao(e){return Eo()?e instanceof Node||e instanceof Oo(e).Node:!1}function jo(e){return Eo()?e instanceof Element||e instanceof Oo(e).Element:!1}function Mo(e){return Eo()?e instanceof HTMLElement||e instanceof Oo(e).HTMLElement:!1}function No(e){return!Eo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Oo(e).ShadowRoot}var Po=new Set([`inline`,`contents`]);function Fo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Jo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Po.has(i)}var Io=new Set([`table`,`td`,`th`]);function Lo(e){return Io.has(Do(e))}var Ro=[`:popover-open`,`:modal`];function zo(e){return Ro.some(t=>{try{return e.matches(t)}catch{return!1}})}var Bo=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Vo=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Ho=[`paint`,`layout`,`strict`,`content`];function Uo(e){let t=Go(),n=jo(e)?Jo(e):e;return Bo.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Vo.some(e=>(n.willChange||``).includes(e))||Ho.some(e=>(n.contain||``).includes(e))}function Wo(e){let t=Xo(e);for(;Mo(t)&&!qo(t);){if(Uo(t))return t;if(zo(t))return null;t=Xo(t)}return null}function Go(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Ko=new Set([`html`,`body`,`#document`]);function qo(e){return Ko.has(Do(e))}function Jo(e){return Oo(e).getComputedStyle(e)}function Yo(e){return jo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xo(e){if(Do(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||No(e)&&e.host||ko(e);return No(t)?t.host:t}function Zo(e){let t=Xo(e);return qo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mo(t)&&Fo(t)?t:Zo(t)}function Qo(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Zo(e),i=r===e.ownerDocument?.body,a=Oo(r);if(i){let e=$o(a);return t.concat(a,a.visualViewport||[],Fo(r)?r:[],e&&n?Qo(e):[])}return t.concat(r,Qo(r,[],n))}function $o(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function es(e){let t=Jo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Mo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ra(n)!==a||Ra(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ts(e){return jo(e)?e:e.contextElement}function ns(e){let t=ts(e);if(!Mo(t))return Ba(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=es(t),o=(a?Ra(n.width):n.width)/r,s=(a?Ra(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var rs=Ba(0);function is(e){let t=Oo(e);return!Go()||!t.visualViewport?rs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function as(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Oo(e)?!1:t}function os(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ts(e),o=Ba(1);t&&(r?jo(r)&&(o=ns(r)):o=ns(e));let s=as(a,n,r)?is(a):Ba(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Oo(a),t=r&&jo(r)?Oo(r):r,n=e,i=$o(n);for(;i&&r&&t!==n;){let e=ns(i),t=i.getBoundingClientRect(),r=Jo(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Oo(i),i=$o(n)}}return uo({width:u,height:d,x:c,y:l})}function ss(e,t){let n=Yo(e).scrollLeft;return t?t.left+n:os(ko(e)).left+n}function cs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ss(e,n),y:n.top+t.scrollTop}}function ls(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ko(r),s=t?zo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ba(1),u=Ba(0),d=Mo(r);if((d||!d&&!a)&&((Do(r)!==`body`||Fo(o))&&(c=Yo(r)),Mo(r))){let e=os(r);l=ns(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?cs(o,c):Ba(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function us(e){return Array.from(e.getClientRects())}function ds(e){let t=ko(e),n=Yo(e),r=e.ownerDocument.body,i=La(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=La(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ss(e),s=-n.scrollTop;return Jo(r).direction===`rtl`&&(o+=La(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var fs=25;function ps(e,t){let n=Oo(e),r=ko(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Go();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ss(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=fs&&(a-=o)}else l<=fs&&(a+=l);return{width:a,height:o,x:s,y:c}}var ms=new Set([`absolute`,`fixed`]);function hs(e,t){let n=os(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Mo(e)?ns(e):Ba(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function gs(e,t,n){let r;if(t===`viewport`)r=ps(e,n);else if(t===`document`)r=ds(ko(e));else if(jo(t))r=hs(t,n);else{let n=is(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return uo(r)}function _s(e,t){let n=Xo(e);return n===t||!jo(n)||qo(n)?!1:Jo(n).position===`fixed`||_s(n,t)}function vs(e,t){let n=t.get(e);if(n)return n;let r=Qo(e,[],!1).filter(e=>jo(e)&&Do(e)!==`body`),i=null,a=Jo(e).position===`fixed`,o=a?Xo(e):e;for(;jo(o)&&!qo(o);){let t=Jo(o),n=Uo(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&ms.has(i.position)||Fo(o)&&!n&&_s(e,o))?r=r.filter(e=>e!==o):i=t,o=Xo(o)}return t.set(e,r),r}function ys(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?zo(t)?[]:vs(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=gs(t,n,i);return e.top=La(r.top,e.top),e.right=Ia(r.right,e.right),e.bottom=Ia(r.bottom,e.bottom),e.left=La(r.left,e.left),e},gs(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function bs(e){let{width:t,height:n}=es(e);return{width:t,height:n}}function xs(e,t,n){let r=Mo(t),i=ko(t),a=n===`fixed`,o=os(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ba(0);function l(){c.x=ss(i)}if(r||!r&&!a){if((Do(t)!==`body`||Fo(i))&&(s=Yo(t)),r){let e=os(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?cs(i,s):Ba(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ss(e){return Jo(e).position===`static`}function Cs(e,t){if(!Mo(e)||Jo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ko(e)===n&&(n=n.ownerDocument.body),n}function ws(e,t){let n=Oo(e);if(zo(e))return n;if(!Mo(e)){let t=Xo(e);for(;t&&!qo(t);){if(jo(t)&&!Ss(t))return t;t=Xo(t)}return n}let r=Cs(e,t);for(;r&&Lo(r)&&Ss(r);)r=Cs(r,t);return r&&qo(r)&&Ss(r)&&!Uo(r)?n:r||Wo(e)||n}var Ts=async function(e){let t=this.getOffsetParent||ws,n=this.getDimensions,r=await n(e.floating);return{reference:xs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Es(e){return Jo(e).direction===`rtl`}var Ds={convertOffsetParentRelativeRectToViewportRelativeRect:ls,getDocumentElement:ko,getClippingRect:ys,getOffsetParent:ws,getElementRects:Ts,getClientRects:us,getDimensions:bs,getScale:ns,isElement:jo,isRTL:Es};function Os(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ks(e,t){let n=null,r,i=ko(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=za(d),h=za(i.clientWidth-(u+f)),g=za(i.clientHeight-(d+p)),_=za(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:La(0,Ia(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Os(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function As(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ts(e),u=i||a?[...l?Qo(l):[],...Qo(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?ks(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?os(e):null;c&&g();function g(){let t=os(e);h&&!Os(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var js=So,Ms=Co,Ns=go,Ps=To,Fs=yo,Is=ho,Ls=wo,Rs=(e,t,n)=>{let r=new Map,i={platform:Ds,...n},a={...i.platform,_c:r};return mo(e,t,{...i,platform:a})},zs=typeof document<`u`?_.useLayoutEffect:function(){};function Bs(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,i;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(!Bs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Bs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Vs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hs(e,t){let n=Vs(e);return Math.round(t*n)/n}function Us(e){let t=_.useRef(e);return zs(()=>{t.current=e}),t}function Ws(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Bs(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Us(c),O=Us(i),k=Us(l),j=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Rs(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};M.current&&!Bs(T.current,t)&&(T.current=t,A.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);zs(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=_.useRef(!1);zs(()=>(M.current=!0,()=>{M.current=!1}),[]),zs(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,j);j()}},[x,S,j,D,E]);let N=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),P=_.useMemo(()=>({reference:x,floating:S}),[x,S]),F=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Hs(P.floating,u.x),r=Hs(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Vs(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Gs=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Is({element:r.current,padding:i}).fn(n):r?Is({element:r,padding:i}).fn(n):{}}}},Ks=(e,t)=>({...js(e),options:[e,t]}),qs=(e,t)=>({...Ms(e),options:[e,t]}),Js=(e,t)=>({...Ls(e),options:[e,t]}),Ys=(e,t)=>({...Ns(e),options:[e,t]}),Xs=(e,t)=>({...Ps(e),options:[e,t]}),Zs=(e,t)=>({...Fs(e),options:[e,t]}),Qs=(e,t)=>({...Gs(e),options:[e,t]}),$s=`Arrow`,ec=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(H.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ec.displayName=$s;var tc=ec;function nc(e){let[t,n]=_.useState(void 0);return ke(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}var rc=`Popper`,[ic,ac]=R(rc),[oc,sc]=ic(rc),cc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null);return(0,I.jsx)(oc,{scope:t,anchor:r,onAnchorChange:i,children:n})};cc.displayName=rc;var lc=`PopperAnchor`,uc=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=sc(lc,n),o=_.useRef(null),s=P(t,o),c=_.useRef(null);return _.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,I.jsx)(H.div,{...i,ref:s})});uc.displayName=lc;var dc=`PopperContent`,[fc,pc]=ic(dc),mc=_.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=sc(dc,n),[v,y]=_.useState(null),b=P(t,e=>y(e)),[x,S]=_.useState(null),C=nc(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(vc),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:F,middlewareData:L}=Ws({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>As(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Ks({mainAxis:i+T,alignmentAxis:o}),c&&qs({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Js():void 0,...A}),c&&Ys({...A}),Xs({...A,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Qs({element:x,padding:s}),yc({arrowWidth:w,arrowHeight:T}),f&&Zs({strategy:`referenceHidden`,...A})]}),[R,z]=bc(N),B=fe(m);ke(()=>{F&&B?.()},[F,B]);let ee=L.arrow?.x,te=L.arrow?.y,ne=L.arrow?.centerOffset!==0,[re,ie]=_.useState();return ke(()=>{v&&ie(window.getComputedStyle(v).zIndex)},[v]),(0,I.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:F?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:re,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(fc,{scope:n,placedSide:R,onArrowChange:S,arrowX:ee,arrowY:te,shouldHideArrow:ne,children:(0,I.jsx)(H.div,{"data-side":R,"data-align":z,...h,ref:b,style:{...h.style,animation:F?void 0:`none`}})})})});mc.displayName=dc;var hc=`PopperArrow`,gc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},_c=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=pc(hc,n),a=gc[i.placedSide];return(0,I.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,I.jsx)(tc,{...r,ref:t,style:{...r.style,display:`block`}})})});_c.displayName=hc;function vc(e){return e!==null}var yc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=bc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function bc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var xc=cc,Sc=uc,Cc=mc,wc=_c,Tc=Symbol(`radix.slottable`);function Ec(e){let t=({children:e})=>(0,I.jsx)(I.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Tc,t}var[Dc,Oc]=R(`Tooltip`,[ac]),kc=ac(),Ac=`TooltipProvider`,jc=700,Mc=`tooltip.open`,[Nc,Pc]=Dc(Ac),Fc=e=>{let{__scopeTooltip:t,delayDuration:n=jc,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,I.jsx)(Nc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};Fc.displayName=Ac;var Ic=`Tooltip`,[Lc,Rc]=Dc(Ic),zc=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Pc(Ic,e.__scopeTooltip),l=kc(t),[u,d]=_.useState(null),f=Pa(),p=_.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=_.useRef(!1),[v,y]=Re({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Mc))):c.onClose(),a?.(e)},caller:Ic}),b=_.useMemo(()=>v?g.current?`delayed-open`:`instant-open`:`closed`,[v]),x=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,y(!0)},[y]),S=_.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),C=_.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,y(!0),p.current=0},h)},[h,y]);return _.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,I.jsx)(xc,{...l,children:(0,I.jsx)(Lc,{scope:t,contentId:f,open:v,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:_.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:x,onClose:S,disableHoverableContent:m,children:n})})};zc.displayName=Ic;var Bc=`TooltipTrigger`,Vc=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Rc(Bc,n),a=Pc(Bc,n),o=kc(n),s=P(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,I.jsx)(Sc,{asChild:!0,...o,children:(0,I.jsx)(H.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:j(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:j(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:j(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:j(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:j(e.onBlur,i.onClose),onClick:j(e.onClick,i.onClose)})})});Vc.displayName=Bc;var Hc=`TooltipPortal`,[Uc,Wc]=Dc(Hc,{forceMount:void 0}),Gc=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Rc(Hc,t);return(0,I.jsx)(Uc,{scope:t,forceMount:n,children:(0,I.jsx)(Ne,{present:n||a.open,children:(0,I.jsx)(je,{asChild:!0,container:i,children:r})})})};Gc.displayName=Hc;var Kc=`TooltipContent`,qc=_.forwardRef((e,t)=>{let n=Wc(Kc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Rc(Kc,e.__scopeTooltip);return(0,I.jsx)(Ne,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(Qc,{side:i,...a,ref:t}):(0,I.jsx)(Jc,{side:i,...a,ref:t})})}),Jc=_.forwardRef((e,t)=>{let n=Rc(Kc,e.__scopeTooltip),r=Pc(Kc,e.__scopeTooltip),i=_.useRef(null),a=P(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=nl(r,tl(r,n.getBoundingClientRect())),a=rl(t.getBoundingClientRect()),o=al([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!il(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(Qc,{...e,ref:a})}),[Yc,Xc]=Dc(Ic,{isInside:!1}),Zc=Ec(`TooltipContent`),Qc=_.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Rc(Kc,n),l=kc(n),{onClose:u}=c;return _.useEffect(()=>(document.addEventListener(Mc,u),()=>document.removeEventListener(Mc,u)),[u]),_.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,I.jsx)(be,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,I.jsxs)(Cc,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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:[(0,I.jsx)(Zc,{children:r}),(0,I.jsx)(Yc,{scope:n,isInside:!0,children:(0,I.jsx)(We,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});qc.displayName=Kc;var $c=`TooltipArrow`,el=_.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=kc(n);return Xc($c,n).isInside?null:(0,I.jsx)(wc,{...i,...r,ref:t})});el.displayName=$c;function tl(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function nl(e,t,n=5){let 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})}return r}function rl(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function il(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function al(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),ol(t)}function ol(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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 sl=Fc,cl=zc,ll=Vc,ul=Gc,dl=qc,fl=sl,pl=cl,ml=ll,hl=_.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,I.jsx)(ul,{children:(0,I.jsx)(dl,{ref:r,sideOffset:t,className:U(`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})}));hl.displayName=dl.displayName;var gl=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(){}},_l=new class extends gl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},vl={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},yl=new class{#e=vl;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)}};function bl(e){setTimeout(e,0)}var xl=typeof window>`u`||`Deno`in globalThis;function Sl(){}function Cl(e,t){return typeof e==`function`?e(t):e}function wl(e){return typeof e==`number`&&e>=0&&e!==1/0}function Tl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function El(e,t){return typeof e==`function`?e(t):e}function Dl(e,t){return typeof e==`function`?e(t):e}function Ol(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Al(o,t.options))return!1}else if(!Ml(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function kl(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(jl(t.options.mutationKey)!==jl(a))return!1}else if(!Ml(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Al(e,t){return(t?.queryKeyHashFn||jl)(e)}function jl(e){return JSON.stringify(e,(e,t)=>Il(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Ml(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Ml(e[n],t[n])):!1}var Nl=Object.prototype.hasOwnProperty;function Pl(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Fl(e)&&Fl(t);if(!r&&!(Il(e)&&Il(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Nl.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Pl(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Fl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Il(e){if(!Ll(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ll(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ll(e){return Object.prototype.toString.call(e)===`[object Object]`}function Rl(e){return new Promise(t=>{yl.setTimeout(t,e)})}function zl(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Pl(e,t)}function Bl(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Vl(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Hl=Symbol();function Ul(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Hl?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Wl(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var Gl=(()=>{let e=()=>xl;return{isServer(){return e()},setIsServer(t){e=t}}})();function Kl(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var ql=bl;function Jl(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ql,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Yl=Jl(),Xl=new class extends gl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let 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.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Zl(e){return Math.min(1e3*2**e,3e4)}function Ql(e){return(e??`online`)!==`online`||Xl.isOnline()}var $l=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function eu(e){let t=!1,n=0,r,i=Kl(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new $l(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>_l.isFocused()&&(e.networkMode===`always`||Xl.isOnline())&&e.canRun(),u=()=>Ql(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Gl.isServer()?0:3),o=e.retryDelay??Zl,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!c?f(r):(n++,e.onFail?.(n,r),Rl(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()}))})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var tu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wl(this.gcTime)&&(this.#e=yl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Gl.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(yl.clearTimeout(this.#e),this.#e=void 0)}};function nu(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Wl(e,()=>t.signal,()=>n=!0)},u=Ul(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Vl:Bl;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?iu:ru,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:ru(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function ru(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function iu(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var au=class extends tu{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=cu(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=cu(this.options);e.data!==void 0&&(this.setState(su(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=zl(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Sl).catch(Sl):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Dl(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Hl||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>El(e.options.staleTime,this)===`static`)}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:!Tl(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.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.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Ul(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?nu(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=eu({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof $l&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof $l){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ou(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...su(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Yl.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ou(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ql(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function su(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function cu(e){let 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`}}var lu=class extends tu{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||uu(),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.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=eu({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,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{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Yl.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function uu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var du=class extends gl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new lu({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=fu(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=fu(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=fu(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=fu(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Yl.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>kl(t,e))}findAll(e={}){return this.getAll().filter(t=>kl(e,t))}notify(e){Yl.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Yl.batch(()=>Promise.all(e.map(e=>e.continue().catch(Sl))))}};function fu(e){return e.options.scope?.id}var pu=class extends gl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Al(r,t),a=this.get(i);return a||(a=new au({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Yl.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ol(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Ol(e,t)):t}notify(e){Yl.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Yl.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Yl.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},mu=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new pu,this.#t=e.mutationCache||new du,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=_l.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Xl.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let 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(El(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Cl(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Yl.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Yl.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Yl.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Yl.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Sl).catch(Sl)}invalidateQueries(e,t={}){return Yl.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Yl.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Sl)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Sl)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(El(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Sl).catch(Sl)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Sl).catch(Sl)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Xl.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(jl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ml(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(jl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ml(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Al(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===Hl&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},hu=_.createContext(void 0),gu=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(hu.Provider,{value:e,children:t})),_u=`modulepreload`,vu=function(e){return`/`+e},yu={},bu=function(e){return e.pathname.endsWith(`.css`)},xu=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Su=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=vu(t,n);let r=s(t),i=bu(r);return xu(yu,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:_u,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Cu=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,wu=/^[\\/]{2}/;function Tu(e,t){return t+e.replace(/\\/g,`/`)}var Eu=`popstate`;function Du(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Ou(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Nu(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Pu(t)}return Iu(t,n,null,e)}function ku(e,t){if(e===!1||e==null)throw Error(t)}function Au(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ju(){return Math.random().toString(36).substring(2,10)}function Mu(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Nu(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Fu(t):t,state:n,key:t&&t.key||r||ju(),mask:i}}function Pu({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Fu(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Iu(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Du(e)?e:Nu(h.location,e,t);n&&n(r,e),l=u()+1;let d=Mu(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Du(e)?e:Nu(h.location,e,t);n&&n(r,e),l=u();let i=Mu(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Lu(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Eu,d),c=e,()=>{i.removeEventListener(Eu,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Lu(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),ku(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Pu(t);return i=i.replace(/ $/,`%20`),!n&&wu.test(i)&&(i=r+i),new URL(i,r)}function Ru(e,t,n=`/`){return zu(e,t,n,!1)}function zu(e,t,n,r,i){let a=rd((typeof t==`string`?Fu(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Bu(e),s=null,c=nd(a);for(let e=0;s==null&&e<o.length;++e)s=Qu(o[e],c,r);return s}function Bu(e){let t=Vu(e);return Uu(t),t}function Vu(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;ku(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=dd([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(ku(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Vu(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Xu(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=td(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Hu(e.path))a(e,t,!0,n)}),t}function Hu(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Hu(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Uu(e){e.sort((e,t)=>e.score===t.score?Zu(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Wu=/^:[\w-]+$/,eee=3,Gu=2,Ku=1,qu=10,Ju=-2,Yu=e=>e===`*`;function Xu(e,t){let n=e.split(`/`),r=n.length;return n.some(Yu)&&(r+=Ju),t&&(r+=Gu),n.filter(e=>!Yu(e)).reduce((e,t)=>e+(Wu.test(t)?eee:t===``?Ku:qu),r)}function Zu(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Qu(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?ed(u,l,s.matcher,s.compiledParams):$u(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=$u({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:dd([a,d.pathname]),pathnameBase:pd(dd([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=dd([a,d.pathnameBase]))}return o}function $u(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=td(e.path,e.caseSensitive,e.end);return ed(e,t,n,r)}function ed(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function td(e,t=!1,n=!0){Au(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function nd(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Au(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function rd(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)||`/`}function id(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Fu(e):e,a;return n?(n=ud(n),a=n.startsWith(`/`)?ad(n.substring(1),`/`):ad(n,t)):a=t,{pathname:a,search:md(r),hash:hd(i)}}function ad(e,t){let n=fd(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function od(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 sd(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function cd(e){let t=sd(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function ld(e,t,n,r=!1){let i;typeof e==`string`?i=Fu(e):(i={...e},ku(!i.pathname||!i.pathname.includes(`?`),od(`?`,`pathname`,`search`,i)),ku(!i.pathname||!i.pathname.includes(`#`),od(`#`,`pathname`,`hash`,i)),ku(!i.search||!i.search.includes(`#`),od(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=id(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ud=e=>e.replace(/[\\/]{2,}/g,`/`),dd=e=>ud(e.join(`/`)),fd=e=>e.replace(/\/+$/,``),pd=e=>fd(e).replace(/^\/*/,`/`),md=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,hd=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,gd=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function _d(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function vd(e){return dd(e.map(e=>e.route.path).filter(Boolean))||`/`}var yd=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function bd(e,t){let n=e;if(typeof n!=`string`||!Cu.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(yd)try{let e=new URL(window.location.href),r=wu.test(n)?new URL(Tu(n,e.protocol)):new URL(n),a=rd(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Au(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var xd=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(xd);var Sd=[`GET`,...xd];new Set(Sd);var Cd=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function wd(e){try{return Cd.includes(new URL(e).protocol)}catch{return!1}}var Td=_.createContext(null);Td.displayName=`DataRouter`;var Ed=_.createContext(null);Ed.displayName=`DataRouterState`;var Dd=_.createContext(!1);function Od(){return _.useContext(Dd)}var kd=_.createContext({isTransitioning:!1});kd.displayName=`ViewTransition`;var Ad=_.createContext(new Map);Ad.displayName=`Fetchers`;var jd=_.createContext(null);jd.displayName=`Await`;var Md=_.createContext(null);Md.displayName=`Navigation`;var Nd=_.createContext(null);Nd.displayName=`Location`;var Pd=_.createContext({outlet:null,matches:[],isDataRoute:!1});Pd.displayName=`Route`;var Fd=_.createContext(null);Fd.displayName=`RouteError`;var Id=`REACT_ROUTER_ERROR`,Ld=`REDIRECT`,tee=`ROUTE_ERROR_RESPONSE`;function nee(e){if(e.startsWith(`${Id}:${Ld}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ree(e){if(e.startsWith(`${Id}:${tee}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new gd(t.status,t.statusText,t.data)}catch{}}function Rd(e,{relative:t}={}){ku(zd(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(Md),{hash:i,pathname:a,search:o}=Jd(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:dd([n,a])),r.createHref({pathname:s,search:o,hash:i})}function zd(){return _.useContext(Nd)!=null}function Bd(){return ku(zd(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(Nd).location}var Vd=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Hd(e){_.useContext(Md).static||_.useLayoutEffect(e)}function Ud(){let{isDataRoute:e}=_.useContext(Pd);return e?ff():Wd()}function Wd(){ku(zd(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(Td),{basename:t,navigator:n}=_.useContext(Md),{matches:r}=_.useContext(Pd),{pathname:i}=Bd(),a=JSON.stringify(cd(r)),o=_.useRef(!1);return Hd(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(Au(o.current,Vd),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=ld(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:dd([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Gd=_.createContext(null);function Kd(e){let t=_.useContext(Pd).outlet;return _.useMemo(()=>t&&_.createElement(Gd.Provider,{value:e},t),[t,e])}function qd(){let{matches:e}=_.useContext(Pd);return e[e.length-1]?.params??{}}function Jd(e,{relative:t}={}){let{matches:n}=_.useContext(Pd),{pathname:r}=Bd(),i=JSON.stringify(cd(n));return _.useMemo(()=>ld(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Yd(e,t){return Xd(e,t)}function Xd(e,t,n){ku(zd(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(Md),{matches:i}=_.useContext(Pd),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;mf(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
-
|
|
11
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Bd(),d;if(t){let e=typeof t==`string`?Fu(t):t;ku(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Ru(e,{pathname:p});Au(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Au(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=rf(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:dd([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:dd([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(Nd.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Zd(){let e=df(),t=_d(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var Qd=_.createElement(Zd,null),$d=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ree(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(Pd.Provider,{value:this.props.routeContext},_.createElement(Fd.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(tf,{error:e},t):t}};$d.contextType=Dd;var ef=new WeakMap;function tf({children:e,error:t}){let{basename:n}=_.useContext(Md);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=nee(t.digest);if(e){let r=ef.get(t);if(r)throw r;let i=bd(e.location,n),a=i.absoluteURL||i.to;if(wd(a))throw Error(`Invalid redirect location`);if(yd&&!ef.get(t)){if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ef.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function nf({routeContext:e,match:t,children:n}){let r=_.useContext(Td);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(Pd.Provider,{value:e},n)}function rf(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);ku(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:vd(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Qd,o&&(s<0&&c===0?(mf(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(nf,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement($d,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function af(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function of(e){let t=_.useContext(Td);return ku(t,af(e)),t}function sf(e){let t=_.useContext(Ed);return ku(t,af(e)),t}function cf(e){let t=_.useContext(Pd);return ku(t,af(e)),t}function lf(e){let t=cf(e),n=t.matches[t.matches.length-1];return ku(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function uf(){return lf(`useRouteId`)}function df(){let e=_.useContext(Fd),t=sf(`useRouteError`),n=lf(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ff(){let{router:e}=of(`useNavigate`),t=lf(`useNavigate`),n=_.useRef(!1);return Hd(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{Au(n.current,Vd),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var pf={};function mf(e,t,n){!t&&!pf[e]&&(pf[e]=!0,Au(!1,n))}_.memo(hf);function hf({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Xd(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function gf({to:e,replace:t,state:n,relative:r}){ku(zd(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=_.useContext(Md);Au(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=_.useContext(Pd),{pathname:o}=Bd(),s=Ud(),c=ld(e,cd(a),o,r===`path`),l=JSON.stringify(c);return _.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function _f(e){return Kd(e.context)}function vf(e){ku(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function yf({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){ku(!zd(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Fu(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=rd(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return Au(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement(Md.Provider,{value:c},_.createElement(Nd.Provider,{children:t,value:h}))}function bf({children:e,location:t}){return Yd(xf(e),t)}_.Component;function xf(e,t=[]){let n=[];return _.Children.forEach(e,(e,r)=>{if(!_.isValidElement(e))return;let i=[...t,r];if(e.type===_.Fragment){n.push.apply(n,xf(e.props.children,i));return}ku(e.type===vf,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ku(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=xf(e.props.children,i)),n.push(a)}),n}var Sf=`get`,Cf=`application/x-www-form-urlencoded`;function wf(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Tf(e){return wf(e)&&e.tagName.toLowerCase()===`button`}function Ef(e){return wf(e)&&e.tagName.toLowerCase()===`form`}function Df(e){return wf(e)&&e.tagName.toLowerCase()===`input`}function Of(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function kf(e,t){return e.button===0&&(!t||t===`_self`)&&!Of(e)}function Af(e=``){return 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(e=>[n,e]):[[n,r]])},[]))}function jf(e,t){let n=Af(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Mf=null;function Nf(){if(Mf===null)try{new FormData(document.createElement(`form`),0),Mf=!1}catch{Mf=!0}return Mf}var Pf=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Ff(e){return e!=null&&!Pf.has(e)?(Au(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Cf}"`),null):e}function If(e,t){let n,r,i,a,o;if(Ef(e)){let o=e.getAttribute(`action`);r=o?rd(o,t):null,n=e.getAttribute(`method`)||Sf,i=Ff(e.getAttribute(`enctype`))||Cf,a=new FormData(e)}else if(Tf(e)||Df(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?rd(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Sf,i=Ff(e.getAttribute(`formenctype`))||Ff(o.getAttribute(`enctype`))||Cf,a=new FormData(o,e),!Nf()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(wf(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Sf,r=null,i=Cf,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Lf(e,t){if(e===!1||e==null)throw Error(t)}function Rf(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&rd(i.pathname,t)===`/`?`${fd(t)}/_root.${r}`:`${fd(i.pathname)}.${r}`,i}async function zf(e,t){if(e.id in t)return t[e.id];try{let n=await Su(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Bf(e){return e!=null&&typeof e.page==`string`}function Vf(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Hf(e,t,n){return qf((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await zf(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Vf).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Uf(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Wf(e,t,{includeHydrateFallback:n}={}){return Gf(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Gf(e){return[...new Set(e)]}function Kf(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function qf(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Bf(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Kf(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Jf(){let e=_.useContext(Td);return Lf(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Yf(){let e=_.useContext(Ed);return Lf(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Xf=_.createContext(void 0);Xf.displayName=`FrameworkContext`;function Zf(){let e=_.useContext(Xf);return Lf(e,`You must render this element inside a <HydratedRouter> element`),e}function Qf(e,t){let n=_.useContext(Xf),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:$f(s,p),onBlur:$f(c,m),onMouseEnter:$f(l,p),onMouseLeave:$f(u,m),onTouchStart:$f(d,p)}]:[a,f,{}]:[!1,f,{}]}function $f(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ep({page:e,...t}){let n=Od(),{nonce:r}=Zf(),{router:i}=Jf(),a=_.useMemo(()=>Ru(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(np,{page:e,matches:a,...t}):_.createElement(rp,{page:e,matches:a,...t})):null}function tp(e){let{manifest:t,routeModules:n}=Zf(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return Hf(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function np({page:e,matches:t,...n}){let r=Bd(),{future:i}=Zf(),{basename:a}=Jf(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Rf(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function rp({page:e,matches:t,...n}){let r=Bd(),{future:i,manifest:a,routeModules:o}=Zf(),{basename:s}=Jf(),{loaderData:c,matches:l}=Yf(),u=_.useMemo(()=>Uf(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>Uf(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Rf(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>Wf(d,a),[d,a]),m=tp(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function ip(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var ap=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ap&&(window.__reactRouterVersion=`7.18.2`)}catch{}function op({basename:e,children:t,useTransitions:n,window:r}){let i=_.useRef();i.current??=Ou({window:r,v5Compat:!0});let a=i.current,[o,s]=_.useState({action:a.action,location:a.location}),c=_.useCallback(e=>{n===!1?s(e):_.startTransition(()=>s(e))},[n]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(yf,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var sp=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:v}=_.useContext(Md),y=typeof l==`string`&&Cu.test(l),b=bd(l,h);l=b.to;let x=Rd(l,{relative:r}),S=Bd(),C=null;if(o){let e=ld(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:dd([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=Qf(n,p),D=fp(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=_.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:ip(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?_.createElement(_.Fragment,null,A,_.createElement(ep,{page:x})):A});sp.displayName=`Link`;var cp=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Jd(a,{relative:c.relative}),d=Bd(),f=_.useContext(Ed),{navigator:p,basename:m}=_.useContext(Md),h=f!=null&&vp(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=rd(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(sp,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});cp.displayName=`NavLink`;var lp=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Sf,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(Md),g=gp(),v=_p(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&Cu.test(s);return _.createElement(`form`,{ref:m,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});lp.displayName=`Form`;function up(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dp(e){let t=_.useContext(Td);return ku(t,up(e)),t}function fp(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Ud(),d=Bd(),f=Jd(e,{relative:o});return _.useCallback(p=>{if(kf(p,t)){p.preventDefault();let t=n===void 0?Pu(d)===Pu(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function pp(e){Au(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(Af(e)),n=_.useRef(!1),r=Bd(),i=_.useMemo(()=>jf(r.search,n.current?null:t.current),[r.search]),a=Ud();return[i,_.useCallback((e,t)=>{let r=Af(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var mp=0,hp=()=>`__${String(++mp)}__`;function gp(){let{router:e}=dp(`useSubmit`),{basename:t}=_.useContext(Md),n=uf(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=If(e,t);if(a.navigate===!1){let e=a.fetcherKey||hp();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function _p(e,{relative:t}={}){let{basename:n}=_.useContext(Md),r=_.useContext(Pd);ku(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Jd(e||`.`,{relative:t})},o=Bd();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:dd([n,a.pathname])),Pu(a)}function vp(e,{relative:t}={}){let n=_.useContext(kd);ku(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=dp(`useViewTransitionState`),i=Jd(e,{relative:t});if(!n.isTransitioning)return!1;let a=rd(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=rd(n.nextLocation.pathname,r)||n.nextLocation.pathname;return $u(i.pathname,o)!=null||$u(i.pathname,a)!=null}var yp=Symbol.for(`react.lazy`),bp=_.use;function xp(e){return typeof e==`object`&&!!e&&`then`in e}function Sp(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===yp&&`_payload`in e&&xp(e._payload)}function Cp(e){let t=Tp(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e;Sp(r)&&typeof bp==`function`&&(r=bp(r._payload));let a=_.Children.toArray(r),o=a.find(Dp);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var wp=Cp(`Slot`);function Tp(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(Sp(n)&&typeof bp==`function`&&(n=bp(n._payload)),_.isValidElement(n)){let e=kp(n),i=Op(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ep=Symbol(`radix.slottable`);function Dp(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ep}function Op(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function kp(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 Ap=768;function jp(){let[e,t]=_.useState(void 0);return _.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<Ap)};return e.addEventListener(`change`,n),t(window.innerWidth<Ap),()=>e.removeEventListener(`change`,n)},[]),!!e}var Mp=Wt(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden 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`}}),W=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,I.jsx)(r?wp:`button`,{className:U(Mp({variant:t,size:n,className:e})),ref:a,...i}));W.displayName=`Button`;var Np=_.forwardRef(({className:e,type:t,...n},r)=>(0,I.jsx)(`input`,{type:t,className:U(`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-hidden 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}));Np.displayName=`Input`;var Pp=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Cp(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Fp=`Separator`,Ip=`horizontal`,Lp=[`horizontal`,`vertical`],Rp=_.forwardRef((e,t)=>{let{decorative:n,orientation:r=Ip,...i}=e,a=zp(r)?r:Ip,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,I.jsx)(Pp.div,{"data-orientation":a,...o,...i,ref:t})});Rp.displayName=Fp;function zp(e){return Lp.includes(e)}var Bp=Rp,Vp=_.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,I.jsx)(Bp,{ref:i,decorative:n,orientation:t,className:U(`shrink-0 bg-border`,t===`horizontal`?`h-px w-full`:`h-full w-px`,e),...r}));Vp.displayName=Bp.displayName;var Hp=`focusScope.autoFocusOnMount`,Up=`focusScope.autoFocusOnUnmount`,Wp={bubbles:!1,cancelable:!0},Gp=`FocusScope`,Kp=_.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=fe(i),u=fe(a),d=_.useRef(null),f=P(t,e=>c(e)),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Zp(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Zp(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Zp(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){Qp.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Hp,Wp);s.addEventListener(Hp,l),s.dispatchEvent(t),t.defaultPrevented||(qp(em(Yp(s)),{select:!0}),document.activeElement===e&&Zp(s))}return()=>{s.removeEventListener(Hp,l),setTimeout(()=>{let t=new CustomEvent(Up,Wp);s.addEventListener(Up,u),s.dispatchEvent(t),t.defaultPrevented||Zp(e??document.body,{select:!0}),s.removeEventListener(Up,u),Qp.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Jp(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Zp(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Zp(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(H.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Kp.displayName=Gp;function qp(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Zp(r,{select:t}),document.activeElement!==n)return}function Jp(e){let t=Yp(e);return[Xp(t,e),Xp(t.reverse(),e)]}function Yp(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xp(e,t){for(let n of e)if(!iee(n,{upTo:t}))return n}function iee(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 aee(e){return e instanceof HTMLInputElement&&`select`in e}function Zp(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aee(e)&&t&&e.select()}}var Qp=oee();function oee(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=$p(e,t),e.unshift(t)},remove(t){e=$p(e,t),e[0]?.resume()}}}function $p(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function em(e){return e.filter(e=>e.tagName!==`A`)}var tm=0;function nm(){_.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??rm()),document.body.insertAdjacentElement(`beforeend`,e[1]??rm()),tm++,()=>{tm===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),tm--}},[])}function rm(){let 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 im=function(){return im=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},im.apply(this,arguments)};function am(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function om(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var sm=`right-scroll-bar-position`,cm=`width-before-scroll-bar`,lm=`with-scroll-bars-hidden`,um=`--removed-body-scroll-bar-size`;function dm(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function fm(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var pm=typeof window<`u`?_.useLayoutEffect:_.useEffect,mm=new WeakMap;function hm(e,t){var n=fm(t||null,function(t){return e.forEach(function(e){return dm(e,t)})});return pm(function(){var t=mm.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||dm(e,null)}),i.forEach(function(e){r.has(e)||dm(e,a)})}mm.set(n,e)},[e]),n}function gm(e){return e}function _m(e,t){t===void 0&&(t=gm);var n=[],r=!1;return{read:function(){if(r)throw 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(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function vm(e){e===void 0&&(e={});var t=_m(null);return t.options=im({async:!0,ssr:!1},e),t}var ym=function(e){var t=e.sideCar,n=am(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,im({},n))};ym.isSideCarExport=!0;function bm(e,t){return e.useMedium(t),ym}var xm=vm(),Sm=function(){},Cm=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:Sm,onWheelCapture:Sm,onTouchMoveCapture:Sm}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=am(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=hm([n,t]),w=im(im({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:xm,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),im(im({},w),{ref:C})):_.createElement(y,im({},w,{className:c,ref:C}),s))});Cm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Cm.classNames={fullWidth:cm,zeroRight:sm};var wm=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Tm(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=wm();return t&&e.setAttribute(`nonce`,t),e}function Em(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Dm(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Om=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Tm())&&(Em(t,n),Dm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},km=function(){var e=Om();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Am=function(){var e=km();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},jm={left:0,top:0,right:0,gap:0},Mm=function(e){return parseInt(e||``,10)||0},Nm=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Mm(n),Mm(r),Mm(i)]},Pm=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return jm;var t=Nm(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])}},Fm=Am(),Im=`data-scroll-locked`,Lm=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
12
|
-
.${lm} {
|
|
13
|
-
overflow: hidden ${r};
|
|
14
|
-
padding-right: ${s}px ${r};
|
|
15
|
-
}
|
|
16
|
-
body[${Im}] {
|
|
17
|
-
overflow: hidden ${r};
|
|
18
|
-
overscroll-behavior: contain;
|
|
19
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
20
|
-
padding-left: ${i}px;
|
|
21
|
-
padding-top: ${a}px;
|
|
22
|
-
padding-right: ${o}px;
|
|
23
|
-
margin-left:0;
|
|
24
|
-
margin-top:0;
|
|
25
|
-
margin-right: ${s}px ${r};
|
|
26
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.${sm} {
|
|
30
|
-
right: ${s}px ${r};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.${cm} {
|
|
34
|
-
margin-right: ${s}px ${r};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.${sm} .${sm} {
|
|
38
|
-
right: 0 ${r};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.${cm} .${cm} {
|
|
42
|
-
margin-right: 0 ${r};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
body[${Im}] {
|
|
46
|
-
${um}: ${s}px;
|
|
47
|
-
}
|
|
48
|
-
`},Rm=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},zm=function(){_.useEffect(function(){return document.body.setAttribute(Im,(Rm()+1).toString()),function(){var e=Rm()-1;e<=0?document.body.removeAttribute(Im):document.body.setAttribute(Im,e.toString())}},[])},Bm=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;zm();var a=_.useMemo(function(){return Pm(i)},[i]);return _.createElement(Fm,{styles:Lm(a,!t,i,n?``:`!important`)})},Vm=!1;if(typeof window<`u`)try{var Hm=Object.defineProperty({},"passive",{get:function(){return Vm=!0,!0}});window.addEventListener(`test`,Hm,Hm),window.removeEventListener(`test`,Hm,Hm)}catch{Vm=!1}var Um=Vm?{passive:!1}:!1,Wm=function(e){return e.tagName===`TEXTAREA`},Gm=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Wm(e)&&n[t]===`visible`)},Km=function(e){return Gm(e,`overflowY`)},qm=function(e){return Gm(e,`overflowX`)},Jm=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Zm(e,r)){var i=Qm(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ym=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Xm=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Zm=function(e,t){return e===`v`?Km(t):qm(t)},Qm=function(e,t){return e===`v`?Ym(t):Xm(t)},$m=function(e,t){return e===`h`&&t===`rtl`?-1:1},eh=function(e,t,n,r,i){var a=$m(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Qm(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Zm(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},th=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nh=function(e){return[e.deltaX,e.deltaY]},rh=function(e){return e&&`current`in e?e.current:e},see=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cee=function(e){return`
|
|
49
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
50
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
51
|
-
`},lee=0,ih=[];function ah(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(lee++)[0],a=_.useState(Am)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=om([e.lockRef.current],(e.shards||[]).map(rh),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=th(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Jm(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Jm(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return eh(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(ih.length&&ih[ih.length-1]===a){var r=`deltaY`in n?nh(n):th(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&see(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(rh).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:oh(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=th(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,nh(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,th(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return ih.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Um),document.addEventListener(`touchmove`,c,Um),document.addEventListener(`touchstart`,u,Um),function(){ih=ih.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Um),document.removeEventListener(`touchmove`,c,Um),document.removeEventListener(`touchstart`,u,Um)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:cee(i)}):null,p?_.createElement(Bm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function oh(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var sh=bm(xm,ah),ch=_.forwardRef(function(e,t){return _.createElement(Cm,im({},e,{ref:t,sideCar:sh}))});ch.classNames=Cm.classNames;var lh=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},uh=new WeakMap,dh=new WeakMap,fh={},ph=0,mh=function(e){return e&&(e.host||mh(e.parentNode))},hh=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=mh(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},gh=function(e,t,n,r){var i=hh(t,Array.isArray(e)?e:[e]);fh[n]||(fh[n]=new WeakMap);var a=fh[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(uh.get(e)||0)+1,l=(a.get(e)||0)+1;uh.set(e,c),a.set(e,l),o.push(e),c===1&&i&&dh.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ph++,function(){o.forEach(function(e){var t=uh.get(e)-1,i=a.get(e)-1;uh.set(e,t),a.set(e,i),t||(dh.has(e)||e.removeAttribute(r),dh.delete(e)),i||e.removeAttribute(n)}),ph--,ph||(uh=new WeakMap,uh=new WeakMap,dh=new WeakMap,fh={})}},_h=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||lh(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),gh(r,i,n,`aria-hidden`)):function(){return null}};function vh(e){let t=yh(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(xh);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function yh(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=Ch(n),i=Sh(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bh=Symbol(`radix.slottable`);function xh(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===bh}function Sh(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ch(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 wh=`Dialog`,[Th,Eh]=R(wh),[Dh,Oh]=Th(wh),kh=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=Re({prop:r,defaultProp:i??!1,onChange:a,caller:wh});return(0,I.jsx)(Dh,{scope:t,triggerRef:s,contentRef:c,contentId:Pa(),titleId:Pa(),descriptionId:Pa(),open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};kh.displayName=wh;var Ah=`DialogTrigger`,jh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(Ah,n),a=P(t,i.triggerRef);return(0,I.jsx)(H.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Zh(i.open),...r,ref:a,onClick:j(e.onClick,i.onOpenToggle)})});jh.displayName=Ah;var Mh=`DialogPortal`,[Nh,Ph]=Th(Mh,{forceMount:void 0}),Fh=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Oh(Mh,t);return(0,I.jsx)(Nh,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,I.jsx)(Ne,{present:n||a.open,children:(0,I.jsx)(je,{asChild:!0,container:i,children:e})}))})};Fh.displayName=Mh;var Ih=`DialogOverlay`,Lh=_.forwardRef((e,t)=>{let n=Ph(Ih,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Oh(Ih,e.__scopeDialog);return a.modal?(0,I.jsx)(Ne,{present:r||a.open,children:(0,I.jsx)(zh,{...i,ref:t})}):null});Lh.displayName=Ih;var Rh=vh(`DialogOverlay.RemoveScroll`),zh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(Ih,n);return(0,I.jsx)(ch,{as:Rh,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(H.div,{"data-state":Zh(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Bh=`DialogContent`,Vh=_.forwardRef((e,t)=>{let n=Ph(Bh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Oh(Bh,e.__scopeDialog);return(0,I.jsx)(Ne,{present:r||a.open,children:a.modal?(0,I.jsx)(Hh,{...i,ref:t}):(0,I.jsx)(Uh,{...i,ref:t})})});Vh.displayName=Bh;var Hh=_.forwardRef((e,t)=>{let n=Oh(Bh,e.__scopeDialog),r=_.useRef(null),i=P(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return _h(e)},[]),(0,I.jsx)(Wh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault())})}),Uh=_.forwardRef((e,t)=>{let n=Oh(Bh,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,I.jsx)(Wh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Wh=_.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Oh(Bh,n),c=_.useRef(null),l=P(t,c);return nm(),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Kp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(be,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Zh(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(tg,{titleId:s.titleId}),(0,I.jsx)(rg,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Gh=`DialogTitle`,Kh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(Gh,n);return(0,I.jsx)(H.h2,{id:i.titleId,...r,ref:t})});Kh.displayName=Gh;var qh=`DialogDescription`,Jh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(qh,n);return(0,I.jsx)(H.p,{id:i.descriptionId,...r,ref:t})});Jh.displayName=qh;var Yh=`DialogClose`,Xh=_.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Oh(Yh,n);return(0,I.jsx)(H.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});Xh.displayName=Yh;function Zh(e){return e?`open`:`closed`}var Qh=`DialogTitleWarning`,[$h,eg]=L(Qh,{contentName:Bh,titleName:Gh,docsSlug:`dialog`}),tg=({titleId:e})=>{let t=eg(Qh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
52
|
-
|
|
53
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
54
|
-
|
|
55
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ng=`DialogDescriptionWarning`,rg=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eg(ng).contentName}}.`;return _.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},ig=kh,ag=jh,og=Fh,sg=Lh,cg=Vh,lg=Kh,ug=Jh,dg=Xh,fg=ig,pg=og,mg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(sg,{className:U(`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}));mg.displayName=sg.displayName;var hg=Wt(`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`}}),gg=_.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,I.jsxs)(pg,{children:[(0,I.jsx)(mg,{}),(0,I.jsxs)(cg,{ref:i,className:U(hg({side:e}),t),...r,children:[n,(0,I.jsxs)(dg,{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-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none`,children:[(0,I.jsx)(dr,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));gg.displayName=cg.displayName;var _g=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});_g.displayName=`SheetHeader`;var vg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(lg,{ref:n,className:U(`text-lg font-semibold text-foreground`,e),...t}));vg.displayName=lg.displayName;var yg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(ug,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));yg.displayName=ug.displayName;function bg({className:e,...t}){return(0,I.jsx)(`div`,{className:U(`animate-pulse rounded-md bg-muted`,e),...t})}var xg=`sidebar:state`,Sg=604800,Cg=`16rem`,wg=`18rem`,Tg=`3rem`,Eg=`b`,Dg=_.createContext(null);function Og(){let e=_.useContext(Dg);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var kg=_.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o},s)=>{let c=jp(),[l,u]=_.useState(!1),[d,f]=_.useState(e),p=t??d,m=_.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${xg}=${t}; path=/; max-age=${Sg}`},[n,p]),h=_.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);_.useEffect(()=>{let e=e=>{e.key===Eg&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,v=_.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,I.jsx)(Dg.Provider,{value:v,children:(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsx)(`div`,{style:{"--sidebar-width":Cg,"--sidebar-width-icon":Tg,...i},className:U(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),ref:s,...o,children:a})})})});kg.displayName=`SidebarProvider`;var Ag=_.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},o)=>{let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Og();return n===`none`?(0,I.jsx)(`div`,{className:U(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),ref:o,...a,children:i}):s?(0,I.jsx)(fg,{open:l,onOpenChange:u,...a,children:(0,I.jsx)(gg,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":wg},side:e,children:(0,I.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})})}):(0,I.jsxs)(`div`,{ref:o,className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,children:[(0,I.jsx)(`div`,{className:U(`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)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,I.jsx)(`div`,{className:U(`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-(--sidebar-width)`:`right-0 group-data-[collapsible=offcanvas]:-right-(--sidebar-width)`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,I.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-sm`,children:i})})]})});Ag.displayName=`Sidebar`;var jg=_.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=Og();return(0,I.jsxs)(W,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:U(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,I.jsx)(Vn,{}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});jg.displayName=`SidebarTrigger`;var Mg=_.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=Og();return(0,I.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:U(`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`,`in-data-[side=left]:cursor-w-resize in-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 hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});Mg.displayName=`SidebarRail`;var Ng=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`main`,{ref:n,className:U(`relative flex min-h-svh flex-1 flex-col bg-background`,`peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm`,e),...t}));Ng.displayName=`SidebarInset`;var Pg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Np,{ref:n,"data-sidebar":`input`,className:U(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));Pg.displayName=`SidebarInput`;var Fg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:U(`flex flex-col gap-2 p-2`,e),...t}));Fg.displayName=`SidebarHeader`;var Ig=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:U(`flex flex-col gap-2 p-2`,e),...t}));Ig.displayName=`SidebarFooter`;var Lg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(Vp,{ref:n,"data-sidebar":`separator`,className:U(`mx-2 w-auto bg-sidebar-border`,e),...t}));Lg.displayName=`SidebarSeparator`;var Rg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:U(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t}));Rg.displayName=`SidebarContent`;var zg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:U(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));zg.displayName=`SidebarGroup`;var Bg=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,I.jsx)(t?wp:`div`,{ref:r,"data-sidebar":`group-label`,className:U(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden 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}));Bg.displayName=`SidebarGroupLabel`;var Vg=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,I.jsx)(t?wp:`button`,{ref:r,"data-sidebar":`group-action`,className:U(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden 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 md:after:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n}));Vg.displayName=`SidebarGroupAction`;var Hg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:U(`w-full text-sm`,e),...t}));Hg.displayName=`SidebarGroupContent`;var Ug=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:U(`flex w-full min-w-0 flex-col gap-1`,e),...t}));Ug.displayName=`SidebarMenu`;var Wg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:U(`group/menu-item relative`,e),...t}));Wg.displayName=`SidebarMenuItem`;var Gg=Wt(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden 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`}}),Kg=_.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o},s)=>{let c=e?wp:`button`,{isMobile:l,state:u}=Og(),d=(0,I.jsx)(c,{ref:s,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:U(Gg({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:d}),(0,I.jsx)(hl,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...i})]})):d});Kg.displayName=`SidebarMenuButton`;var qg=_.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,I.jsx)(t?wp:`button`,{ref:i,"data-sidebar":`menu-action`,className:U(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden 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 md:after: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}));qg.displayName=`SidebarMenuAction`;var Jg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:U(`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}));Jg.displayName=`SidebarMenuBadge`;var Yg=_.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=_.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,I.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:U(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,I.jsx)(bg,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,I.jsx)(bg,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});Yg.displayName=`SidebarMenuSkeleton`;var Xg=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:U(`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}));Xg.displayName=`SidebarMenuSub`;var Zg=_.forwardRef(({...e},t)=>(0,I.jsx)(`li`,{ref:t,...e}));Zg.displayName=`SidebarMenuSubItem`;var Qg=_.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,I.jsx)(e?wp:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:U(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden 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),...i}));Qg.displayName=`SidebarMenuSubButton`;var $g=(0,_.forwardRef)(({className:e,activeClassName:t,pendingClassName:n,to:r,...i},a)=>(0,I.jsx)(cp,{ref:a,to:r,className:({isActive:r,isPending:i})=>U(e,r&&t,i&&n),...i}));$g.displayName=`NavLink`;function e_({width:e=24,height:t=24,from:n=`#53afba`,to:r=`#76fffb`,...i}){let a=`grad-${(0,_.useId)().slice(1)}`;return(0,I.jsxs)(`svg`,{className:`inline-block`,width:e,height:t,viewBox:`0 0 1648 1648`,xmlns:`http://www.w3.org/2000/svg`,...i,children:[(0,I.jsx)(`defs`,{children:(0,I.jsxs)(`linearGradient`,{id:a,x1:`0%`,y1:`0%`,x2:`100%`,y2:`0%`,children:[(0,I.jsx)(`stop`,{offset:`0%`,style:{stopColor:n}}),(0,I.jsx)(`stop`,{offset:`100%`,style:{stopColor:r}})]})}),(0,I.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(#${a})`,fillRule:`evenodd`})]})}function t_(e){return(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,...e})}var n_=[{title:`Home`,items:[{title:`Dashboard`,url:`/`,icon:Mn}]},{title:`Lab`,items:[{title:`MCP Evaluations`,url:`/mcp-evaluations`,icon:Tn},{title:`Analyze MCP`,url:`/tool-analysis`,icon:Ln},{title:`OAuth Debugger`,url:`/oauth-debugger`,icon:er}]},{title:`Libraries`,items:[{title:`Test Cases`,url:`/libraries/test-cases`,icon:Sn},{title:`MCP servers`,url:`/libraries/servers`,icon:t_},{title:`Agents`,url:`/libraries/agents`,icon:$t}]},{title:`Execution`,items:[{title:`Run Evaluation`,url:`/run`,icon:Kn},{title:`Evaluation Results`,url:`/results`,icon:tn},{title:`Compare Evaluations`,url:`/compare`,icon:Dn},{title:`MCP Analysis Results`,url:`/tool-analysis-results`,icon:zn},{title:`Custom Reports`,url:`/markdown-reports`,icon:Bn}]},{title:`Workspace`,items:[{title:`Settings`,url:`/settings`,icon:$n},{title:`MCPLab MCP server`,url:`/settings/mcp`,icon:Pn}]}];function r_(e={version:null}){let t=e.version??null,{state:n}=Og(),r=n===`collapsed`,i=Bd(),a=(0,_.useMemo)(()=>n_,[]);return(0,I.jsxs)(Ag,{collapsible:`icon`,children:[(0,I.jsx)(Fg,{className:`border-b border-sidebar-border py-3 ${r?`px-2`:`px-4`}`,children:(0,I.jsxs)(`div`,{className:`flex items-center ${r?`justify-center overflow-visible`:`gap-2.5 overflow-hidden`}`,children:[(0,I.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:(0,I.jsx)(e_,{width:22,height:22,from:`#f97316`,to:`#fb923c`})}),!r&&(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[(0,I.jsx)(`span`,{className:`text-sm font-semibold text-sidebar-foreground`,children:`MCPLab`}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`MCP Evaluation Lab`})]})]})}),(0,I.jsx)(Rg,{children:a.map((e,t)=>(0,I.jsxs)(`div`,{children:[t>0&&!r&&(0,I.jsx)(Lg,{className:`my-1.5`}),(0,I.jsxs)(zg,{className:r?`px-2`:`px-3 py-2`,children:[!r&&(0,I.jsx)(Bg,{className:`px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90`,children:e.title}),(0,I.jsx)(Hg,{children:(0,I.jsx)(Ug,{children:e.items.map(e=>(0,I.jsx)(Wg,{children:(0,I.jsx)(Kg,{asChild:!0,isActive:e.url===`/`?i.pathname===`/`:e.url===`/settings`?i.pathname===`/settings`:i.pathname.startsWith(e.url),tooltip:e.title,children:(0,I.jsxs)($g,{to:e.url,end:e.url===`/`||e.url===`/settings`,activeClassName:`bg-sidebar-accent text-sidebar-accent-foreground`,children:[(0,I.jsx)(e.icon,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{children:e.title})]})})},e.title))})})]})]},e.title))}),(0,I.jsxs)(Ig,{className:r?`px-2 py-2`:`px-3 py-3`,children:[(0,I.jsx)(Lg,{className:`my-1.5`}),(0,I.jsxs)(`div`,{className:`flex ${r?`justify-center`:`items-center justify-center gap-2`} w-full`,children:[(0,I.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:[(0,I.jsx)(On,{className:`h-4 w-4 shrink-0`}),!r&&(0,I.jsx)(`span`,{className:`text-xs text-sidebar-foreground/85`,children:`v${t??`unknown`}`})]}),!r&&(0,I.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 `,(0,I.jsx)(`span`,{className:`text-[#00e5ff] hover:text-[#00b8d4]`,children:`Inspectr`})]})]})]})]})}function i_({label:e=`Queue processing`}){return(0,I.jsx)(`span`,{role:`img`,"aria-label":e,className:`inline-block h-3 w-3 shrink-0 animate-spin rounded-full border-2 border-emerald-500 border-t-transparent motion-reduce:animate-none`})}var a_=_.forwardRef(({...e},t)=>(0,I.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));a_.displayName=`Breadcrumb`;var o_=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`ol`,{ref:n,className:U(`flex flex-wrap items-center gap-1.5 wrap-break-word text-sm text-muted-foreground sm:gap-2.5`,e),...t}));o_.displayName=`BreadcrumbList`;var s_=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`li`,{ref:n,className:U(`inline-flex items-center gap-1.5`,e),...t}));s_.displayName=`BreadcrumbItem`;var c_=_.forwardRef(({asChild:e,className:t,...n},r)=>(0,I.jsx)(e?wp:`a`,{ref:r,className:U(`transition-colors hover:text-foreground`,t),...n}));c_.displayName=`BreadcrumbLink`;var l_=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:U(`font-normal text-foreground`,e),...t}));l_.displayName=`BreadcrumbPage`;var u_=({children:e,className:t,...n})=>(0,I.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:U(`[&>svg]:size-3.5`,t),...n,children:e??(0,I.jsx)(an,{})});u_.displayName=`BreadcrumbSeparator`;function d_(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function f_(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 p_(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 m_(e){let t=d_();for(let n of e)f_(t,n);return p_(t)}var h_={png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,pdf:`application/pdf`,txt:`text/plain`,md:`text/markdown`,csv:`text/csv`};function g_(e){return e.startsWith(`image/`)?`image`:`document`}function __(e){return e?.split(`.`).pop()?.toLowerCase()??``}function v_(e){if(e.media_type)return e.media_type;if(e.path)return h_[__(e.path)]}function y_(e){let t={passed:0,failed:0,not_evaluated:0,not_executed:0,total:0};for(let n of e){if(n.status===`passed`)t.passed+=1;else if(n.status===`failed`)t.failed+=1;else if(n.status===`not_evaluated`||n.status===`not_applicable`)t.not_evaluated+=1;else if(n.status===`not_executed`)t.not_executed=(t.not_executed??0)+1;else continue;t.total+=1}return t}var b_={openai:{label:`OpenAI Decisions`,modelLabel:`Decision model`,defaultModel:`gpt-6-luna`,models:[`gpt-6-luna`],editableModel:!1,credentials:`Requires OPENAI_API_KEY on the MCPLab backend.`},cloudflare:{label:`Cloudflare Clef`,modelLabel:`Decision model`,defaultModel:`clef-flash`,models:[`clef-flash`,`clef`],editableModel:!1,credentials:`Requires CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_AUTH_TOKEN on the MCPLab backend.`},typesafe:{label:`TypeSafe Jev`,modelLabel:`Decision model`,defaultModel:`jev-1.13.0`,models:[`jev-1.13.0`],editableModel:!0,credentials:`Requires TYPESAFE_API_KEY on the MCPLab backend.`},ollama:{label:`Ollama`,modelLabel:`Ollama model name`,defaultModel:`clef-flash`,models:[`clef-flash`,`clef`,`nimble`,`tev1:4b`,`tev1:0.8b`],editableModel:!0,credentials:`Requests use the MCPLab backend. Install a supported decision model on your Ollama server; models are not downloaded automatically.`},azure_foundry:{label:`Azure Foundry`,modelLabel:`Deployment name`,defaultModel:`Microsoft-Decision-1`,models:[`Microsoft-Decision-1`],editableModel:!0,credentials:`Requires AZURE_FOUNDRY_ENDPOINT and AZURE_FOUNDRY_API_KEY (or AZURE_OPENAI_API_KEY for the same resource) on the MCPLab backend. Enter the name of your Microsoft-Decision-1 deployment, which may differ from the model name. Use the Foundry resource endpoint, not the project endpoint. If the deployment Target URI ends in /models, MCPLab removes that suffix.`}},x_={passThreshold:.9,failThreshold:.1,baseUrl:`http://localhost:11434`};function S_(e){return e!=null&&e.enabled!==!1}function C_(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Decision engine configuration must be an object.`);let t=e,n=t.enabled;if(n!==void 0&&typeof n!=`boolean`)throw Error(`Decision engine enabled must be a boolean.`);let r=t.provider;if(typeof r!=`string`||!Object.hasOwn(b_,r))throw Error(`Choose a supported decision engine provider.`);let i=r,a=b_[i];if(typeof t.model!=`string`||!t.model.trim())throw Error(`Decision engine model is required.`);let o=t.model.trim();if(!a.editableModel&&!a.models.includes(o))throw Error(`${a.label} supports ${a.models.join(` or `)}.`);let s=t.passThreshold===void 0?x_.passThreshold:t.passThreshold,c=t.failThreshold===void 0?x_.failThreshold:t.failThreshold;if(typeof s!=`number`||typeof c!=`number`||!Number.isFinite(s)||!Number.isFinite(c)||c<0||c>=s||s>1)throw Error(`Decision thresholds must satisfy 0 ≤ fail probability < pass probability ≤ 1.`);if(i!==`ollama`&&t.baseUrl!==void 0)throw Error(`A server URL can only be configured for Ollama.`);let l;if(i===`ollama`){if(t.baseUrl!==void 0&&typeof t.baseUrl!=`string`)throw Error(`Ollama server URL must be a string.`);let e=new URL(t.baseUrl?.trim()||x_.baseUrl);if(![`http:`,`https:`].includes(e.protocol)||e.username||e.password||e.search||e.hash)throw Error(`Ollama server URL must be HTTP or HTTPS without credentials, query, or fragment.`);l=e.toString().replace(/\/+$/,``)}return{provider:i,model:o,passThreshold:s,failThreshold:c,...l?{baseUrl:l}:{},...n===void 0?{}:{enabled:n}}}var w_=class{add(e,t,n){if(typeof arguments[0]!=`string`)for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?`unshift`:`push`](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},T_=class{constructor(e){this.jsep=e,this.registered={}}register(){[...arguments].forEach(e=>{if(typeof e!=`object`||!e.name||!e.init)throw Error(`Invalid JSEP plugin format`);this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}},E_=class e{static get version(){return`1.4.0`}static toString(){return`JavaScript Expression Parser (JSEP) v`+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,r){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,r?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(e){let t=Error(e+` at character `+this.index);throw t.index=this.index,t.description=e,t}runHook(t,n){if(e.hooks[t]){let r={context:this,node:n};return e.hooks.run(t,r),r.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(e){return e.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook(`gobble-spaces`)}parse(){this.runHook(`before-all`);let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook(`after-all`,n)}gobbleExpressions(t){let n=[],r,i;for(;this.index<this.expr.length;)if(r=this.code,r===e.SEMCOL_CODE||r===e.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())n.push(i);else if(this.index<this.expr.length){if(r===t)break;this.throwError(`Unexpected "`+this.char+`"`)}return n}gobbleExpression(){let e=this.searchHook(`gobble-expression`)||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook(`after-expression`,e)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,r,i,a,o,s,c,l;if(o=this.gobbleToken(),!o||(n=this.gobbleBinaryOp(),!n))return o;for(a={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},s=this.gobbleToken(),s||this.throwError(`Expected expression after `+n),i=[o,a,s];n=this.gobbleBinaryOp();){if(r=e.binaryPrecedence(n),r===0){this.index-=n.length;break}a={value:n,prec:r,right_a:e.right_associative.has(n)},l=n;let c=e=>a.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),n=i.pop().value,o=i.pop(),t={type:e.BINARY_EXP,operator:n,left:o,right:s},i.push(t);t=this.gobbleToken(),t||this.throwError(`Expected expression after `+l),i.push(a,t)}for(c=i.length-1,t=i[c];c>1;)t={type:e.BINARY_EXP,operator:i[c-1].value,left:i[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,r,i;if(this.gobbleSpaces(),i=this.searchHook(`gobble-token`),i)return this.runHook(`after-token`,i);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)i=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),r=n.length;r>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=r;let t=this.gobbleToken();return t||this.throwError(`missing unaryOp argument`),this.runHook(`after-token`,{type:e.UNARY_EXP,operator:n,argument:t,prefix:!0})}n=n.substr(0,--r)}e.isIdentifierStart(t)?(i=this.gobbleIdentifier(),e.literals.hasOwnProperty(i.name)?i={type:e.LITERAL,value:e.literals[i.name],raw:i.name}:i.name===e.this_str&&(i={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook(`after-token`,i)):this.runHook(`after-token`,!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let r;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError(`Unexpected "`+this.char+`"`),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError(`Unclosed [`),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),r&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t=``,n,r;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n===`e`||n===`E`){for(t+=this.expr.charAt(this.index++),n=this.char,(n===`+`||n===`-`)&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError(`Expected exponent (`+t+this.char+`)`)}return r=this.code,e.isIdentifierStart(r)?this.throwError(`Variable names cannot start with a number (`+t+this.char+`)`):(r===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError(`Unexpected period`),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t=``,n=this.index,r=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let e=this.expr.charAt(this.index++);if(e===r){i=!0;break}if(e===`\\`)switch(e=this.expr.charAt(this.index++),e){case`n`:t+=`
|
|
56
|
-
`;break;case`r`:t+=`\r`;break;case`t`:t+=` `;break;case`b`:t+=`\b`;break;case`f`:t+=`\f`;break;case`v`:t+=`\v`;break;default:t+=e}else t+=e}return i||this.throwError(`Unclosed quote after "`+t+`"`),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError(`Unexpected `+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],r=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let a=this.code;if(a===t){r=!0,this.index++,t===e.CPAREN_CODE&&i&&i>=n.length&&this.throwError(`Unexpected token `+String.fromCharCode(t));break}if(a===e.COMMA_CODE){if(this.index++,i++,i!==n.length){if(t===e.CPAREN_CODE)this.throwError(`Unexpected token ,`);else if(t===e.CBRACK_CODE)for(let e=n.length;e<i;e++)n.push(null)}}else if(n.length!==i&&i!==0)this.throwError(`Expected comma`);else{let t=this.gobbleExpression();(!t||t.type===e.COMPOUND)&&this.throwError(`Expected comma`),n.push(t)}}return r||this.throwError(`Expected `+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError(`Unclosed (`)}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},D_=new w_;Object.assign(E_,{hooks:D_,plugins:new T_(E_),COMPOUND:`Compound`,SEQUENCE_EXP:`SequenceExpression`,IDENTIFIER:`Identifier`,MEMBER_EXP:`MemberExpression`,LITERAL:`Literal`,THIS_EXP:`ThisExpression`,CALL_EXP:`CallExpression`,UNARY_EXP:`UnaryExpression`,BINARY_EXP:`BinaryExpression`,ARRAY_EXP:`ArrayExpression`,TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set([`**`]),additional_identifier_chars:new Set([`$`,`_`]),literals:{true:!0,false:!1,null:null},this_str:`this`}),E_.max_unop_len=E_.getMaxKeyLen(E_.unary_ops),E_.max_binop_len=E_.getMaxKeyLen(E_.binary_ops);var O_=e=>new E_(e).parse(),k_=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(E_).filter(e=>!k_.includes(e)&&O_[e]===void 0).forEach(e=>{O_[e]=E_[e]}),O_.Jsep=E_;var A_=`ConditionalExpression`;O_.plugins.register({name:`ternary`,init(e){e.hooks.add(`after-expression`,function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError(`Expected expression`),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError(`Expected expression`),t.node={type:A_,test:n,consequent:r,alternate:i},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError(`Expected :`)}})}});var j_=47,uee=92,dee={name:`regex`,init(e){e.hooks.add(`gobble-token`,function(t){if(this.code===j_){let n=++this.index,r=!1;for(;this.index<this.expr.length;){if(this.code===j_&&!r){let r=this.expr.slice(n,this.index),i=``;for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)i+=this.char;else break}let a;try{a=new RegExp(r,i)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:a,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=this.code===uee?2:1}this.throwError(`Unclosed Regex`)}})}},M_=43,N_={name:`assignment`,assignmentOperators:new Set([`=`,`*=`,`**=`,`/=`,`%=`,`+=`,`-=`,`<<=`,`>>=`,`>>>=`,`&=`,`^=`,`|=`,`||=`,`&&=`,`??=`]),updateOperators:[M_,45],assignmentPrecedence:.9,init(e){let t=[e.IDENTIFIER,e.MEMBER_EXP];N_.assignmentOperators.forEach(t=>e.addBinaryOp(t,N_.assignmentPrecedence,!0)),e.hooks.add(`gobble-token`,function(e){let n=this.code;N_.updateOperators.some(e=>e===n&&e===this.expr.charCodeAt(this.index+1))&&(this.index+=2,e.node={type:`UpdateExpression`,operator:n===M_?`++`:`--`,argument:this.gobbleTokenProperty(this.gobbleIdentifier()),prefix:!0},(!e.node.argument||!t.includes(e.node.argument.type))&&this.throwError(`Unexpected ${e.node.operator}`))}),e.hooks.add(`after-token`,function(e){if(e.node){let n=this.code;N_.updateOperators.some(e=>e===n&&e===this.expr.charCodeAt(this.index+1))&&(t.includes(e.node.type)||this.throwError(`Unexpected ${e.node.operator}`),this.index+=2,e.node={type:`UpdateExpression`,operator:n===M_?`++`:`--`,argument:e.node,prefix:!1})}}),e.hooks.add(`after-expression`,function(e){e.node&&n(e.node)});function n(e){N_.assignmentOperators.has(e.operator)?(e.type=`AssignmentExpression`,n(e.left),n(e.right)):e.operator||Object.values(e).forEach(e=>{e&&typeof e==`object`&&n(e)})}}};O_.plugins.register(dee,N_),O_.addUnaryOp(`typeof`),O_.addUnaryOp(`void`),O_.addLiteral(`null`,null),O_.addLiteral(`undefined`,void 0);var fee=new Set([`constructor`,`__proto__`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`]),P_={evalAst(e,t){switch(e.type){case`BinaryExpression`:case`LogicalExpression`:return P_.evalBinaryExpression(e,t);case`Compound`:return P_.evalCompound(e,t);case`ConditionalExpression`:return P_.evalConditionalExpression(e,t);case`Identifier`:return P_.evalIdentifier(e,t);case`Literal`:return P_.evalLiteral(e,t);case`MemberExpression`:return P_.evalMemberExpression(e,t);case`UnaryExpression`:return P_.evalUnaryExpression(e,t);case`ArrayExpression`:return P_.evalArrayExpression(e,t);case`CallExpression`:return P_.evalCallExpression(e,t);case`AssignmentExpression`:return P_.evalAssignmentExpression(e,t);default:throw SyntaxError(`Unexpected expression`,e)}},evalBinaryExpression(e,t){return{"||":(e,t)=>e||t(),"&&":(e,t)=>e&&t(),"|":(e,t)=>e|t(),"^":(e,t)=>e^t(),"&":(e,t)=>e&t(),"==":(e,t)=>e==t(),"!=":(e,t)=>e!=t(),"===":(e,t)=>e===t(),"!==":(e,t)=>e!==t(),"<":(e,t)=>e<t(),">":(e,t)=>e>t(),"<=":(e,t)=>e<=t(),">=":(e,t)=>e>=t(),"<<":(e,t)=>e<<t(),">>":(e,t)=>e>>t(),">>>":(e,t)=>e>>>t(),"+":(e,t)=>e+t(),"-":(e,t)=>e-t(),"*":(e,t)=>e*t(),"/":(e,t)=>e/t(),"%":(e,t)=>e%t()}[e.operator](P_.evalAst(e.left,t),()=>P_.evalAst(e.right,t))},evalCompound(e,t){let n;for(let r=0;r<e.body.length;r++){e.body[r].type===`Identifier`&&[`var`,`let`,`const`].includes(e.body[r].name)&&e.body[r+1]&&e.body[r+1].type===`AssignmentExpression`&&(r+=1);let i=e.body[r];n=P_.evalAst(i,t)}return n},evalConditionalExpression(e,t){return P_.evalAst(e.test,t)?P_.evalAst(e.consequent,t):P_.evalAst(e.alternate,t)},evalIdentifier(e,t){if(Object.hasOwn(t,e.name))return t[e.name];throw ReferenceError(`${e.name} is not defined`)},evalLiteral(e){return e.value},evalMemberExpression(e,t){let n=String(e.computed?P_.evalAst(e.property):e.property.name),r=P_.evalAst(e.object,t);if(r==null||!Object.hasOwn(r,n)&&fee.has(n))throw TypeError(`Cannot read properties of ${r} (reading '${n}')`);let i=r[n];return typeof i==`function`?i.bind(r):i},evalUnaryExpression(e,t){return{"-":e=>-P_.evalAst(e,t),"!":e=>!P_.evalAst(e,t),"~":e=>~P_.evalAst(e,t),"+":e=>+P_.evalAst(e,t),typeof:e=>typeof P_.evalAst(e,t),void:e=>void P_.evalAst(e,t)}[e.operator](e.argument)},evalArrayExpression(e,t){return e.elements.map(e=>P_.evalAst(e,t))},evalCallExpression(e,t){let n=e.arguments.map(e=>P_.evalAst(e,t)),r=P_.evalAst(e.callee,t);if(r===Function)throw Error(`Function constructor is disabled`);return r(...n)},evalAssignmentExpression(e,t){if(e.left.type!==`Identifier`)throw SyntaxError(`Invalid left-hand side in assignment`);let n=e.left.name;return t[n]=P_.evalAst(e.right,t),t[n]}},F_=class{constructor(e){this.code=e,this.ast=O_(this.code)}runInNewContext(e){let t=Object.assign(Object.create(null),e);return P_.evalAst(this.ast,t)}};function I_(e,t){return e=e.slice(),e.push(t),e}function L_(e,t){return t=t.slice(),t.unshift(e),t}var R_=class extends Error{constructor(e){super(`JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)`),this.avoidNew=!0,this.value=e,this.name=`NewError`}};function z_(e,t,n,r,i){if(!(this instanceof z_))try{return new z_(e,t,n,r,i)}catch(e){if(!e.avoidNew)throw e;return e.value}typeof e==`string`&&(i=r,r=n,n=t,t=e,e=null);let a=e&&typeof e==`object`;if(e||={},this.json=e.json||n,this.path=e.path||t,this.resultType=e.resultType||`value`,this.flatten=e.flatten||!1,this.wrap=!Object.hasOwn(e,`wrap`)||e.wrap,this.sandbox=e.sandbox||{},this.eval=e.eval===void 0?`safe`:e.eval,this.ignoreEvalErrors=e.ignoreEvalErrors!==void 0&&e.ignoreEvalErrors,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||r||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw TypeError(`You must supply an otherTypeCallback callback option with the @other() operator.`)},e.autostart!==!1){let r={path:a?e.path:t};a?`json`in e&&(r.json=e.json):r.json=n;let i=this.evaluate(r);if(!i||typeof i!=`object`)throw new R_(i);return i}}z_.prototype.evaluate=function(e,t,n,r){let i=this.parent,a=this.parentProperty,{flatten:o,wrap:s}=this;if(this.currResultType=this.resultType,this.currEval=this.eval,this.currSandbox=this.sandbox,n||=this.callback,this.currOtherTypeCallback=r||this.otherTypeCallback,t||=this.json,e||=this.path,e&&typeof e==`object`&&!Array.isArray(e)){if(!e.path&&e.path!==``)throw TypeError(`You must supply a "path" property when providing an object argument to JSONPath.evaluate().`);if(!Object.hasOwn(e,`json`))throw TypeError(`You must supply a "json" property when providing an object argument to JSONPath.evaluate().`);({json:t}=e),o=Object.hasOwn(e,`flatten`)?e.flatten:o,this.currResultType=Object.hasOwn(e,`resultType`)?e.resultType:this.currResultType,this.currSandbox=Object.hasOwn(e,`sandbox`)?e.sandbox:this.currSandbox,s=Object.hasOwn(e,`wrap`)?e.wrap:s,this.currEval=Object.hasOwn(e,`eval`)?e.eval:this.currEval,n=Object.hasOwn(e,`callback`)?e.callback:n,this.currOtherTypeCallback=Object.hasOwn(e,`otherTypeCallback`)?e.otherTypeCallback:this.currOtherTypeCallback,i=Object.hasOwn(e,`parent`)?e.parent:i,a=Object.hasOwn(e,`parentProperty`)?e.parentProperty:a,e=e.path}if(i||=null,a||=null,Array.isArray(e)&&(e=z_.toPathString(e)),!e&&e!==``||!t)return;let c=z_.toPathArray(e);c[0]===`$`&&c.length>1&&c.shift(),this._hasParentSelector=null;let l=this._trace(c,t,[`$`],i,a,n).filter(function(e){return e&&!e.isParentSelector});return l.length?!s&&l.length===1&&!l[0].hasArrExpr?this._getPreferredOutput(l[0]):l.reduce((e,t)=>{let n=this._getPreferredOutput(t);return o&&Array.isArray(n)?e=e.concat(n):e.push(n),e},[]):s?[]:void 0},z_.prototype._getPreferredOutput=function(e){let t=this.currResultType;switch(t){case`all`:{let t=Array.isArray(e.path)?e.path:z_.toPathArray(e.path);return e.pointer=z_.toPointer(t),e.path=typeof e.path==`string`?e.path:z_.toPathString(e.path),e}case`value`:case`parent`:case`parentProperty`:return e[t];case`path`:return z_.toPathString(e[t]);case`pointer`:return z_.toPointer(e.path);default:throw TypeError(`Unknown result type`)}},z_.prototype._handleCallback=function(e,t,n){if(t){let r=this._getPreferredOutput(e);e.path=typeof e.path==`string`?e.path:z_.toPathString(e.path),t(r,n,e)}},z_.prototype._trace=function(e,t,n,r,i,a,o,s){let c;if(!e.length)return c={path:n,value:t,parent:r,parentProperty:i,hasArrExpr:o},this._handleCallback(c,a,`value`),c;let l=e[0],u=e.slice(1),d=[];function f(e){Array.isArray(e)?e.forEach(e=>{d.push(e)}):d.push(e)}if((typeof l!=`string`||s)&&t&&Object.hasOwn(t,l))f(this._trace(u,t[l],I_(n,l),t,l,a,o));else if(l===`*`)this._walk(t,e=>{f(this._trace(u,t[e],I_(n,e),t,e,a,!0,!0))});else if(l===`..`)f(this._trace(u,t,n,r,i,a,o)),this._walk(t,r=>{typeof t[r]==`object`&&f(this._trace(e.slice(),t[r],I_(n,r),t,r,a,!0))});else if(l===`^`)return this._hasParentSelector=!0,{path:n.slice(0,-1),expr:u,isParentSelector:!0};else if(l===`~`)return c={path:I_(n,l),value:i,parent:r,parentProperty:null},this._handleCallback(c,a,`property`),c;else if(l===`$`)f(this._trace(u,t,n,null,null,a,o));else if(/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))f(this._slice(l,u,t,n,r,i,a));else if(l.indexOf(`?(`)===0){if(this.currEval===!1)throw Error(`Eval [?(expr)] prevented in JSONPath expression.`);let e=l.replace(/^\?\((.*?)\)$/u,`$1`),o=/@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(e);o?this._walk(t,e=>{let s=[o[2]],c=o[1]?t[e][o[1]]:t[e];this._trace(s,c,n,r,i,a,!0).length>0&&f(this._trace(u,t[e],I_(n,e),t,e,a,!0))}):this._walk(t,o=>{this._eval(e,t[o],o,n,r,i)&&f(this._trace(u,t[o],I_(n,o),t,o,a,!0))})}else if(l[0]===`(`){if(this.currEval===!1)throw Error(`Eval [(expr)] prevented in JSONPath expression.`);f(this._trace(L_(this._eval(l,t,n.at(-1),n.slice(0,-1),r,i),u),t,n,r,i,a,o))}else if(l[0]===`@`){let e=!1,o=l.slice(1,-2);switch(o){case`scalar`:(!t||![`object`,`function`].includes(typeof t))&&(e=!0);break;case`boolean`:case`string`:case`undefined`:case`function`:typeof t===o&&(e=!0);break;case`integer`:Number.isFinite(t)&&!(t%1)&&(e=!0);break;case`number`:Number.isFinite(t)&&(e=!0);break;case`nonFinite`:typeof t==`number`&&!Number.isFinite(t)&&(e=!0);break;case`object`:t&&typeof t===o&&(e=!0);break;case`array`:Array.isArray(t)&&(e=!0);break;case`other`:e=this.currOtherTypeCallback(t,n,r,i);break;case`null`:t===null&&(e=!0);break;default:throw TypeError(`Unknown value type `+o)}if(e)return c={path:n,value:t,parent:r,parentProperty:i},this._handleCallback(c,a,`value`),c}else if(l[0]==="`"&&t&&Object.hasOwn(t,l.slice(1))){let e=l.slice(1);f(this._trace(u,t[e],I_(n,e),t,e,a,o,!0))}else if(l.includes(`,`)){let e=l.split(`,`);for(let o of e)f(this._trace(L_(o,u),t,n,r,i,a,!0))}else!s&&t&&Object.hasOwn(t,l)&&f(this._trace(u,t[l],I_(n,l),t,l,a,o,!0));if(this._hasParentSelector)for(let e=0;e<d.length;e++){let n=d[e];if(n&&n.isParentSelector){let s=this._trace(n.expr,t,n.path,r,i,a,o);if(Array.isArray(s)){d[e]=s[0];let t=s.length;for(let n=1;n<t;n++)e++,d.splice(e,0,s[n])}else d[e]=s}}return d},z_.prototype._walk=function(e,t){if(Array.isArray(e)){let n=e.length;for(let e=0;e<n;e++)t(e)}else e&&typeof e==`object`&&Object.keys(e).forEach(e=>{t(e)})},z_.prototype._slice=function(e,t,n,r,i,a,o){if(!Array.isArray(n))return;let s=n.length,c=e.split(`:`),l=c[2]&&Number.parseInt(c[2])||1,u=c[0]&&Number.parseInt(c[0])||0,d=c[1]&&Number.parseInt(c[1])||s;u=u<0?Math.max(0,u+s):Math.min(s,u),d=d<0?Math.max(0,d+s):Math.min(s,d);let f=[];for(let e=u;e<d;e+=l)this._trace(L_(e,t),n,r,i,a,o,!0).forEach(e=>{f.push(e)});return f},z_.prototype._eval=function(e,t,n,r,i,a){this.currSandbox._$_parentProperty=a,this.currSandbox._$_parent=i,this.currSandbox._$_property=n,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;let o=e.includes(`@path`);o&&(this.currSandbox._$_path=z_.toPathString(r.concat([n])));let s=this.currEval+`Script:`+e;if(!z_.cache[s]){let t=e.replaceAll(`@parentProperty`,`_$_parentProperty`).replaceAll(`@parent`,`_$_parent`).replaceAll(`@property`,`_$_property`).replaceAll(`@root`,`_$_root`).replaceAll(/@([.\s)[])/gu,`_$_v$1`);if(o&&(t=t.replaceAll(`@path`,`_$_path`)),this.currEval===`safe`||this.currEval===!0||this.currEval===void 0)z_.cache[s]=new this.safeVm.Script(t);else if(this.currEval===`native`)z_.cache[s]=new this.vm.Script(t);else if(typeof this.currEval==`function`&&this.currEval.prototype&&Object.hasOwn(this.currEval.prototype,`runInNewContext`)){let e=this.currEval;z_.cache[s]=new e(t)}else if(typeof this.currEval==`function`)z_.cache[s]={runInNewContext:e=>this.currEval(t,e)};else throw TypeError(`Unknown "eval" property "${this.currEval}"`)}try{return z_.cache[s].runInNewContext(this.currSandbox)}catch(t){if(this.ignoreEvalErrors)return!1;throw Error(`jsonPath: `+t.message+`: `+e)}},z_.cache={},z_.toPathString=function(e){let t=e,n=t.length,r=`$`;for(let e=1;e<n;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(r+=/^[0-9*]+$/u.test(t[e])?`[`+t[e]+`]`:`['`+t[e]+`']`);return r},z_.toPointer=function(e){let t=e,n=t.length,r=``;for(let e=1;e<n;e++)/^(~|\^|@.*?\(\))$/u.test(t[e])||(r+=`/`+t[e].toString().replaceAll(`~`,`~0`).replaceAll(`/`,`~1`));return r},z_.toPathArray=function(e){let{cache:t}=z_;if(t[e])return t[e].concat();let n=[];return t[e]=e.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu,`;$&;`).replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu,function(e,t){return`[#`+(n.push(t)-1)+`]`}).replaceAll(/\[['"]([^'\]]*)['"]\]/gu,function(e,t){return`['`+t.replaceAll(`.`,`%@%`).replaceAll(`~`,`%%@@%%`)+`']`}).replaceAll(`~`,`;~;`).replaceAll(/['"]?\.['"]?(?![^[]*\])|\[['"]?/gu,`;`).replaceAll(`%@%`,`.`).replaceAll(`%%@@%%`,`~`).replaceAll(/(?:;)?(\^+)(?:;)?/gu,function(e,t){return`;`+t.split(``).join(`;`)+`;`}).replaceAll(/;;;|;;/gu,`;..;`).replaceAll(/;$|'?\]|'$/gu,``).split(`;`).map(function(e){let t=e.match(/#(\d+)/u);return!t||!t[1]?e:n[t[1]]}),t[e].concat()},z_.prototype.safeVm={Script:F_};var B_=function(e,t,n){let r=e.length;for(let i=0;i<r;i++){let r=e[i];n(r)&&t.push(e.splice(i--,1)[0])}},V_=class{constructor(e){this.code=e}runInNewContext(e){let t=this.code,n=Object.keys(e),r=[];B_(n,r,t=>typeof e[t]==`function`);let i=n.map(t=>e[t]);t=r.reduce((t,n)=>{let r=e[n].toString();return/function/u.test(r)||(r=`function `+r),`var `+n+`=`+r+`;`+t},``)+t,!/(['"])use strict\1/u.test(t)&&!n.includes(`arguments`)&&(t=`var arguments = undefined;`+t),t=t.replace(/;\s*$/u,``);let a=t.lastIndexOf(`;`),o=a===-1?` return `+t:t.slice(0,a+1)+` return `+t.slice(a+1);return Function(...n,o)(...i)}};z_.prototype.vm={Script:V_};function H_(e){let t=e.type===`contains`?`contains ${e.value}`:e.type===`regex`?`matches regex ${e.pattern}`:e.equals===void 0?`JSONPath ${e.path} exists`:`JSONPath ${e.path} == ${String(e.equals)}`;return`Tool input · ${e.tool} ${t}`}function U_(e){return e.type===`contains`||e.type===`regex`}function W_(e,t){if(t===`tool_not_used`)return`Tool input assertion failed: tool not used: ${e.tool}`;if(t===`invalid_regex`&&e.type===`regex`)return`Tool input assertion failed: invalid regex ${e.pattern}`;let n=e.type===`contains`?`contains ${e.value}`:e.type===`regex`?`regex ${e.pattern}`:e.equals===void 0?`JSONPath ${e.path} exists`:`JSONPath ${e.path} == ${String(e.equals)}`;return t===`invalid_jsonpath`&&e.type===`jsonpath`?`Tool input assertion failed: invalid JSONPath ${e.path} (expected: ${n})`:t===`serialization`&&U_(e)?`Tool input assertion failed: could not serialize tool input for ${e.tool} (expected: ${n})`:`Tool input assertion failed: ${e.tool} input did not match (expected: ${n})`}function G_(e){return e.length>0?`Tool sequence · ${e.join(` -> `)}`:`Tool sequence`}function K_(e,t,n=0){let r=t-n;return r<=0?null:e/r}function q_(e){return e==null?void 0:String(e)}var J_={openai:`openai`,anthropic:`anthropic`,azure:`azure_openai`,azure_foundry:`azure_foundry`,google:`openai`,custom:`openai`};function Y_(e,t){return`${e}-${t+1}`}function X_(e,t){return t.type===`browser`?{id:e,name:String(t.name||e),type:`browser`,provider:t.provider,model:``,maxTokens:0,url:t.url,newConversationBetweenScenarios:t.newConversationBetweenScenarios}:{id:e,name:String(t.name||e),type:`llm`,provider:t.provider===`azure_openai`?`azure`:t.provider,model:t.model,...$_(t.temperature),maxTokens:t.max_tokens??2048,maxTurns:t.max_turns,systemPrompt:t.system}}function Z_(e){return e.type===`browser`?{id:e.id,name:e.name,type:`browser`,provider:e.provider,url:e.url,...e.newConversationBetweenScenarios===void 0?{}:{new_conversation_between_scenarios:e.newConversationBetweenScenarios}}:{id:e.id,name:e.name,provider:J_[e.provider],model:e.model,...$_(e.temperature),max_tokens:e.maxTokens,max_turns:e.maxTurns,system:e.systemPrompt}}function Q_(e){return Vi(e)||void 0}function $_(e){return e===void 0?{}:{temperature:e}}function ev(e){let t=e.media_type??v_(e)??`application/octet-stream`;return{type:g_(t),media_type:t,data:e.data??``,...e.url?{url:e.url}:{},...e.name?{name:e.name}:{}}}function tv(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 Error(`Unsupported response assertion type in config: ${String(e?.type??`(missing type)`)}`)}}function nv(e){return{type:`tool_input_${e.type}`,tool:e.tool,...e.path?{path:e.path}:{},...e.equals===void 0?{}:{equals:e.equals},...e.value===void 0?{}:{value:e.value},...e.pattern===void 0?{}:{value:e.pattern}}}function rv(e){if(e.type===`required_tool`||e.type===`forbidden_tool`||e.type===`tool_sequence`||e.type.startsWith(`tool_input_`)||e.type===`agent_check`)return null;let t=q_(e.value);return e.type===`response_contains`?t?{type:`contains`,value:t}:null:e.type===`response_not_contains`?t?{type:`not_contains`,value:t}:null:e.type===`response_starts_with`?t?{type:`starts_with`,value:t}:null:e.type===`response_ends_with`?t?{type:`ends_with`,value:t}:null:e.type===`response_equals`?t?{type:`equals`,value:t}:null:e.type===`response_regex`?t?{type:`regex`,pattern:t}:null:e.type===`response_jsonpath`?e.path?.trim()?e.equals===void 0?{type:`jsonpath`,path:e.path.trim()}:{type:`jsonpath`,path:e.path.trim(),equals:e.equals}: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 iv(e,t){let n=e.filter(e=>e.type===`required_tool`).map(e=>e.value).filter(e=>typeof e==`string`&&e.length>0),r=e.filter(e=>e.type===`forbidden_tool`).map(e=>e.value).filter(e=>typeof e==`string`&&e.length>0),i=e.find(e=>e.type===`tool_sequence`)?.sequence?.map(e=>e.trim()).filter(e=>typeof e==`string`&&e.length>0),a=e.map(e=>rv(e)).filter(e=>!!e),o=e.filter(e=>e.type.startsWith(`tool_input_`)).flatMap(e=>{if(!e.tool)return[];let t=q_(e.value);return e.type===`tool_input_contains`&&t!==void 0?[{type:`contains`,tool:e.tool,value:t}]:e.type===`tool_input_regex`&&t!==void 0?[{type:`regex`,tool:e.tool,pattern:t}]:e.type===`tool_input_jsonpath`&&e.path?[{type:`jsonpath`,tool:e.tool,path:e.path,...e.equals===void 0?{}:{equals:e.equals}}]:[]}),s=e.filter(e=>e.type===`agent_check`).flatMap(e=>e.label?.trim()&&e.prompt?.trim()?[{label:e.label.trim(),prompt:e.prompt.trim()}]:[]),c=n.length>0||r.length>0?{...n.length>0?{required_tools:n}:{},...r.length>0?{forbidden_tools:r}:{}}:void 0,l={...t?.include_prompt?{include_prompt:!0}:{},...t?.include_tool_sequence?{include_tool_sequence:!0}:{},...t?.include_tool_inputs?{include_tool_inputs:!0}:{}},u=Object.keys(l).length>0;if(c||i?.length||o.length!==0||a.length!==0||s.length!==0||u)return{...c?{tool_constraints:c}:{},...i&&i.length>0?{tool_sequence:i}:{},...o.length>0?{tool_input_assertions:o}:{},...a.length>0?{response_assertions:a}:{},...s.length>0?{agent_assertions:s}:{},...u?{agent_context:l}:{}}}function av(e){if(e.length!==0)return e.map(e=>({name:e.name,from:`final_text`,regex:e.pattern}))}function ov(e,t){let n=iv(e.evalRules,e.agentContext),r=av(e.extractRules);return{id:e.id,name:Q_(e.name),mcp_servers:t,prompt:e.prompt,attachments:e.attachments,eval:n,extract:r}}function sv(e){if(!(`id`in e)||!e.id)return null;let t=String(e.id),n=e.auth;return{id:t,server:{id:t,name:String(e.name||t),transport:`streamable-http`,url:String(e.url||``),authType:n?.type===`bearer`?`bearer`:n?.type===`api_key`||n?.type===`oauth_client_credentials`?`api-key`:n?.type===`oauth_authorization_code`?`oauth2`:`none`,authValue:n?.type===`bearer`?String(n.token||``)||(n.env?`\${${n.env}}`:void 0):n?.type===`api_key`?String(n.value||``):void 0,apiKeyHeaderName:n?.type===`api_key`?String(n.header_name||``):void 0,oauthClientId:n?.type===`oauth_authorization_code`&&String(n.client_id||``)||void 0,oauthClientSecret:n?.type===`oauth_authorization_code`&&String(n.client_secret||``)||void 0,oauthRedirectUrl:n?.type===`oauth_authorization_code`&&String(n.redirect_url||``)||void 0,oauthScope:(n?.type===`oauth_authorization_code`||n?.type===`oauth_client_credentials`)&&String(n.scope||``)||void 0,oauthMode:n?.type===`oauth_authorization_code`?n.mode:void 0,oauthAuthorizationUrl:n?.type===`oauth_authorization_code`&&String(n.authorization_url||``)||void 0,oauthTokenEndpoint:n?.type===`oauth_authorization_code`&&String(n.token_url||``)||void 0,oauthTokenUrl:n?.type===`oauth_client_credentials`?String(n.token_url||``):void 0,oauthClientIdEnv:n?.type===`oauth_client_credentials`?String(n.client_id_env||``):void 0,oauthClientSecretEnv:n?.type===`oauth_client_credentials`?String(n.client_secret_env||``):void 0,oauthAudience:n?.type===`oauth_client_credentials`&&String(n.audience||``)||void 0}}}function cv(e){let 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:[],i=new Map,a=[],o=[];for(let e of n){if(`ref`in e){let t=String(e.ref||``).trim();if(!t)continue;i.set(t,t),o.push({kind:`referenced`,ref:t});continue}let t=String(e.id||e.name||``).trim();if(!t)continue;let n=t;i.set(t,n);let r=e.auth?.type===`bearer`?`bearer`:e.auth?.type===`api_key`||e.auth?.type===`oauth_client_credentials`?`api-key`:e.auth?.type===`oauth_authorization_code`?`oauth2`:`none`,s={id:n,name:String(e.name||t),transport:`streamable-http`,url:e.url,authType:r,authValue:e.auth?.type===`bearer`?e.auth.token??(e.auth.env?`\${${e.auth.env}}`:void 0):e.auth?.type===`api_key`?e.auth.value:void 0,apiKeyHeaderName:e.auth?.type===`api_key`?e.auth.header_name:void 0,oauthClientId:e.auth?.type===`oauth_authorization_code`?e.auth.client_id:void 0,oauthClientSecret:e.auth?.type===`oauth_authorization_code`?e.auth.client_secret:void 0,oauthRedirectUrl:e.auth?.type===`oauth_authorization_code`?e.auth.redirect_url:void 0,oauthScope:e.auth?.type===`oauth_authorization_code`||e.auth?.type===`oauth_client_credentials`?e.auth.scope:void 0,oauthMode:e.auth?.type===`oauth_authorization_code`?e.auth.mode:void 0,oauthAuthorizationUrl:e.auth?.type===`oauth_authorization_code`?e.auth.authorization_url:void 0,oauthTokenEndpoint:e.auth?.type===`oauth_authorization_code`?e.auth.token_url:void 0,oauthTokenUrl:e.auth?.type===`oauth_client_credentials`?e.auth.token_url:void 0,oauthClientIdEnv:e.auth?.type===`oauth_client_credentials`?e.auth.client_id_env:void 0,oauthClientSecretEnv:e.auth?.type===`oauth_client_credentials`?e.auth.client_secret_env:void 0,oauthAudience:e.auth?.type===`oauth_client_credentials`?e.auth.audience:void 0};a.push(s),o.push({kind:`inline`,server:s})}let s=[],c=[];for(let e of r){if(`ref`in e){let t=String(e.ref||``).trim();if(!t)continue;c.push({kind:`referenced`,ref:t});continue}let t=String(e.id||e.name||``).trim();if(!t)continue;let n=X_(t,e);s.push(n),c.push({kind:`inline`,agent:n})}let l=[],u=[];return e.config.scenarios.forEach((e,t)=>{if(`ref`in e){let t=String(e.ref||``).trim();if(!t)return;let n=e.mcp_servers,r=Array.isArray(n)?n.flatMap(e=>{let t=e;if(`ref`in t&&t.ref)return[{kind:`referenced`,ref:String(t.ref)}];let n=sv(t);return n?[{kind:`inline`,server:n.server}]:[]}):void 0;u.push({kind:`referenced`,ref:t,...r?{mcpServers:r}:{}});return}let n=[];for(let t of e.eval?.tool_constraints?.required_tools??[])n.push({type:`required_tool`,value:t});for(let t of e.eval?.tool_constraints?.forbidden_tools??[])n.push({type:`forbidden_tool`,value:t});e.eval?.tool_sequence?.length&&n.push({type:`tool_sequence`,sequence:[...e.eval.tool_sequence]});for(let t of e.eval?.response_assertions??[])n.push(tv(t));for(let t of e.eval?.tool_input_assertions??[])n.push(nv(t));for(let t of e.eval?.agent_assertions??[])n.push({type:`agent_check`,label:t.label,prompt:t.prompt});let r=e.eval?.agent_context&&(e.eval.agent_context.include_prompt||e.eval.agent_context.include_tool_sequence||e.eval.agent_context.include_tool_inputs)?{include_prompt:e.eval.agent_context.include_prompt,include_tool_sequence:e.eval.agent_context.include_tool_sequence,include_tool_inputs:e.eval.agent_context.include_tool_inputs}:void 0,s={id:e.id||Y_(`scn`,t),name:Q_(e.name)||e.id||`Scenario ${t+1}`,serverIds:(()=>{if((e.servers??[]).length>0)return e.servers.map(e=>i.get(e)??e).filter(Boolean);let t=e.mcp_servers;return Array.isArray(t)?t.flatMap(e=>{if(`ref`in e&&e.ref)return[String(e.ref)];let t=sv(e);if(t){let e=t.id;return i.has(e)||(i.set(e,e),a.push(t.server),o.push({kind:`inline`,server:a[a.length-1]})),[e]}return[]}):[]})(),prompt:e.prompt,attachments:e.attachments?.map(ev),evalRules:n,extractRules:(e.extract??[]).map(e=>({name:e.name,pattern:e.regex})),...r?{agentContext:r}:{}};l.push(s),u.push({kind:`inline`,scenario:s})}),{id:e.id,name:t||e.name,configName:t,configHash:e.hash,...typeof e.config.description==`string`&&e.config.description.trim()?{description:e.config.description.trim()}:{},...e.relativePath?{relativePath:e.relativePath}:{},...e.suitePath===void 0?{}:{suitePath:e.suitePath},loadError:e.error,loadWarnings:e.warnings,servers:a,serverEntries:o,agents:s,agentEntries:c,scenarios:l,scenarioEntries:u,runDefaults:e.config.run_defaults?.selected_agents&&e.config.run_defaults.selected_agents.length>0?{selectedAgentNames:[...e.config.run_defaults.selected_agents]}:void 0,createdAt:e.mtime,updatedAt:e.mtime,sourcePath:e.path}}function lv(e){let t=cv({id:`library`,name:`library`,path:`library`,mtime:new Date(0).toISOString(),hash:``,config:{servers:Object.entries(e.servers).map(([e,t])=>({id:e,name:Q_(t.name)||e,transport:t.transport,url:t.url,auth:t.auth})),agents:Object.entries(e.agents).map(([e,t])=>({id:e,...t})),scenarios:e.scenarios.map((e,t)=>({...e,name:Q_(e.name)||e.id||`Scenario ${t+1}`}))}});return{servers:t.servers,agents:t.agents,scenarios:t.scenarios,browserProviders:e.browserProviders??{}}}function uv(e){let t=new Map,n=e=>{let t=e.id,n=e.authValue?.trim()??``,r=e.apiKeyHeaderName?.trim()??``,i=e.authType===`bearer`?(()=>{if(!n)throw Error(`Server '${t}' is missing bearer token value`);return{type:`bearer`,token:n}})():e.authType===`api-key`&&!e.oauthTokenUrl?{type:`api_key`,...r?{header_name:r}:{},value:(()=>{if(!n)throw Error(`Server '${t}' is missing API key value`);return n})()}:e.authType===`api-key`?{type:`oauth_client_credentials`,token_url:e.oauthTokenUrl||``,client_id_env:e.oauthClientIdEnv||``,client_secret_env:e.oauthClientSecretEnv||``,...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAudience?{audience:e.oauthAudience}:{}}:e.authType===`oauth2`?{type:`oauth_authorization_code`,...e.oauthMode===`dcr`?{mode:`dcr`}:{},...e.oauthMode!==`dcr`&&e.oauthClientId?{client_id:e.oauthClientId}:{},...e.oauthClientSecret?{client_secret:e.oauthClientSecret}:{},...e.oauthRedirectUrl?{redirect_url:e.oauthRedirectUrl}:{},...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAuthorizationUrl?{authorization_url:e.oauthAuthorizationUrl}:{},...e.oauthTokenEndpoint?{token_url:e.oauthTokenEndpoint}:{}}:void 0;return{id:t,...e.name&&e.name!==t?{name:e.name}:{},transport:`http`,url:e.url||`http://localhost:3000/mcp`,...i===void 0?{}:{auth:i}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(e=>({kind:`inline`,server:e}))],i=new Set,a=new Map,o=r.flatMap(e=>{if(e.kind===`referenced`){let n=String(e.ref||``).trim();return!n||i.has(n)?[]:(i.add(n),t.set(n,n),[{ref:n}])}let r=n(e.server);return t.set(e.server.id,r.id),a.set(r.id,r),[r]}),s=e=>Z_(e),c=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(e=>({kind:`inline`,agent:e}))],l=new Set,u=c.flatMap(e=>{if(e.kind===`referenced`){let t=String(e.ref||``).trim();return!t||l.has(t)?[]:(l.add(t),[{ref:t}])}return[s(e.agent)]}),d=e=>ov(e,e.serverIds.length>0?e.serverIds.map(e=>{let n=t.get(e)??e;return a.get(n)??{ref:n}}):void 0),f=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(e=>e.kind===`referenced`?{ref:e.ref,...Array.isArray(e.mcpServers)?{mcp_servers:e.mcpServers.map(e=>e.kind===`referenced`?{ref:e.ref}:n(e.server))}:{}}:d(e.scenario)):[...e.scenarios.map(e=>d(e))];return{name:e.configName?.trim()||void 0,description:e.description?.trim()||void 0,servers:o,agents:u,scenarios:f,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0}}function dv(e){return{servers:Object.fromEntries((e.servers??[]).map(e=>[e.id,(()=>{let t=e.authValue?.trim()??``,n=e.apiKeyHeaderName?.trim()??``;return{...e.name&&e.name!==e.id?{name:e.name}:{},transport:`http`,url:e.url||`http://localhost:3000/mcp`,auth:e.authType===`bearer`?(()=>{if(!t)throw Error(`Server '${e.id}' is missing bearer token value`);return{type:`bearer`,token:t}})():e.authType===`api-key`&&!e.oauthTokenUrl?{type:`api_key`,...n?{header_name:n}:{},value:(()=>{if(!t)throw Error(`Server '${e.id}' is missing API key value`);return t})()}:e.authType===`api-key`?{type:`oauth_client_credentials`,token_url:e.oauthTokenUrl||``,client_id_env:e.oauthClientIdEnv||``,client_secret_env:e.oauthClientSecretEnv||``,...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAudience?{audience:e.oauthAudience}:{}}:e.authType===`oauth2`?{type:`oauth_authorization_code`,...e.oauthMode===`dcr`?{mode:`dcr`}:{},...e.oauthMode!==`dcr`&&e.oauthClientId?{client_id:e.oauthClientId}:{},...e.oauthClientSecret?{client_secret:e.oauthClientSecret}:{},...e.oauthRedirectUrl?{redirect_url:e.oauthRedirectUrl}:{},...e.oauthScope?{scope:e.oauthScope}:{},...e.oauthAuthorizationUrl?{authorization_url:e.oauthAuthorizationUrl}:{},...e.oauthTokenEndpoint?{token_url:e.oauthTokenEndpoint}:{}}:void 0}})()])),agents:Object.fromEntries(e.agents.map(e=>{let{id:t,...n}=Z_(e);return[e.id,n]})),scenarios:e.scenarios.map(e=>ov(e,e.serverIds.length>0?e.serverIds.map(e=>({ref:e})):void 0)),browserProviders:e.browserProviders}}function fv(e,t){if(e)return`${e}::${t??``}`}function pv(e){return e.type===`text`}function mv(e,t){if(!t)return e.tool_calls.map((t,n)=>({name:t,arguments:{},duration:e.tool_durations_ms[n]??0,timestamp:new Date().toISOString()}));let n=[],r=new Map;for(let e of t.messages)for(let t of e.content)t.type===`tool_use`?n.push({id:t.id,name:t.name,input:t.input??{},ts:e.ts}):t.type===`tool_result`&&r.set(t.tool_use_id,{durationMs:t.duration_ms,tsEnd:t.ts_end});return n.map((t,n)=>{let i=r.get(t.id);return{name:t.name,arguments:t.input,duration:i?.durationMs??e.tool_durations_ms[n]??0,timestamp:i?.tsEnd??t.ts??new Date().toISOString()}})}function hv(e,t){let n=[];if(!e)return t&&n.push({id:`user_prompt-0`,kind:`user_prompt`,text:t,timestamp:void 0}),n;let r,i=e.messages??[];for(let e=0;e<i.length;e+=1){let t=i[e];if(t.role===`user`)for(let e of t.content)e.type===`text`?n.push({id:`user_prompt-${n.length}`,kind:`user_prompt`,text:e.text,timestamp:t.ts}):e.type===`image`?n.push({id:`attachment-${n.length}`,kind:`user_prompt`,text:`[Attached image: ${e.name??`image`}]`,timestamp:t.ts}):e.type===`document`&&n.push({id:`attachment-${n.length}`,kind:`user_prompt`,text:`[Attached document: ${e.name??`document`} (${e.media_type})]`,timestamp:t.ts});else if(t.role===`assistant`){let a=t.content.filter(e=>e.type===`tool_use`);for(let e of t.content)e.type===`text`&&(n.push({id:`assistant_thought-${n.length}`,kind:`assistant_thought`,text:e.text,timestamp:t.ts}),r=n.length-1);let o=i[e+1],s=o?.role===`tool`;if(a.length>0&&s){let r=new Map,i=[];for(let e of o.content)e.type===`tool_result`&&(e.tool_use_id?r.set(e.tool_use_id,e):i.push(e));for(let e of a){n.push({id:`tool_call-${n.length}`,kind:`tool_call`,text:gv(e.input??{}),toolName:e.name,timestamp:t.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method});let i=r.get(e.id);if(!i)continue;let a=i.content.filter(pv).map(e=>e.text).join(`
|
|
57
|
-
`);n.push({id:`tool_result-${n.length}`,kind:`tool_result`,text:a,toolName:i.name,ok:!i.is_error,durationMs:i.duration_ms,timestamp:i.ts_end??o.ts,estimatedTokens:i.estimated_tokens?{inputTokens:i.estimated_tokens.input,outputTokens:i.estimated_tokens.output,totalTokens:i.estimated_tokens.total}:void 0,estimatedTokenMethod:i.estimated_tokens?.method}),r.delete(e.id)}for(let e of[...r.values(),...i]){let t=e.content.filter(pv).map(e=>e.text).join(`
|
|
58
|
-
`);n.push({id:`tool_result-${n.length}`,kind:`tool_result`,text:t,toolName:e.name,ok:!e.is_error,durationMs:e.duration_ms,timestamp:e.ts_end??o.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method})}e+=1}else for(let e of a)n.push({id:`tool_call-${n.length}`,kind:`tool_call`,text:gv(e.input??{}),toolName:e.name,timestamp:t.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method})}else if(t.role===`tool`)for(let e of t.content){if(e.type!==`tool_result`)continue;let r=e.content.filter(pv).map(e=>e.text).join(`
|
|
59
|
-
`);n.push({id:`tool_result-${n.length}`,kind:`tool_result`,text:r,toolName:e.name,ok:!e.is_error,durationMs:e.duration_ms,timestamp:e.ts_end??t.ts,estimatedTokens:e.estimated_tokens?{inputTokens:e.estimated_tokens.input,outputTokens:e.estimated_tokens.output,totalTokens:e.estimated_tokens.total}:void 0,estimatedTokenMethod:e.estimated_tokens?.method})}}return typeof r==`number`&&n[r]&&(n[r]={...n[r],kind:`assistant_final`}),n}function gv(e){try{return JSON.stringify(e)}catch{return String(e)}}function _v(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 vv(e,t){if(typeof e!=`number`||t<=0)return Array(t).fill(void 0);let n=Math.floor(e/t),r=e%t;return Array.from({length:t},(e,t)=>n+ +(t<r))}function yv(e){let t=d_(),n=d_(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(let i of e.messages??[]){if(i.role!==`assistant`)continue;_v(t,i.usage);let e=i.content.filter(e=>e.type===`tool_use`);if(e.length===0)continue;if(e.every(e=>!!e.estimated_tokens)){for(let t of e){let e=t.estimated_tokens;n.input+=e.input,n.hasInput=!0,n.output+=e.output,n.hasOutput=!0,n.total+=e.total,n.hasTotal=!0;let i=r.get(t.name)??d_();i.input+=e.input,i.hasInput=!0,i.output+=e.output,i.hasOutput=!0,i.total+=e.total,i.hasTotal=!0,r.set(t.name,i)}continue}_v(n,i.usage);let a=vv(i.usage?.input_tokens,e.length),o=vv(i.usage?.output_tokens,e.length),s=vv(i.usage?.total_tokens,e.length);for(let t=0;t<e.length;t+=1){let n=e[t].name,i=r.get(n)??d_(),c=a[t],l=o[t],u=s[t];typeof c==`number`&&(i.input+=c,i.hasInput=!0),typeof l==`number`&&(i.output+=l,i.hasOutput=!0),typeof u==`number`&&(i.total+=u,i.hasTotal=!0),r.set(n,i)}}let i={};for(let[e,t]of Array.from(r.entries()).sort((e,t)=>e[0].localeCompare(t[0]))){let n=p_(t);n&&(i[e]=n)}return{assistant:p_(t),tool:p_(n),perTool:i}}function bv(e,t){if(t){let e=Date.parse(t.ts_start),n=Date.parse(t.ts_end);if(Number.isFinite(e)&&Number.isFinite(n))return Math.max(0,n-e)}return e.tool_durations_ms.reduce((e,t)=>e+t,0)}function xv(e){return y_(e.flatMap(e=>e.checkResults??[]))}function Sv(e){return e?.map(e=>({...e,status:e.status===`not_applicable`?`not_evaluated`:e.status}))}function Cv(e,t=[],n){let r=new Map;for(let e of t){let t=fv(e.scenario_id,e.agent);if(!t)continue;let n=r.get(t)??[];n.push(e),r.set(t,n)}let i=e.scenarios.map(e=>{let t=r.get(`${e.scenario_id}::${e.agent}`)??[],n=new Map;for(let e of t)n.set(e.run_index,e);let i=e.runs.map((e,r)=>{let i=n.get(e.run_index)??t[r],a=yv(i);return{runIndex:e.run_index,passed:e.pass,outcome:e.outcome,error:e.error,stopReason:e.stop_reason,toolCalls:mv(e,i),assistantTokenUsage:a.assistant,toolTokenUsage:a.tool,toolTokenUsageByTool:a.perTool,finalAnswer:e.final_text,conversation:hv(i),duration:bv(e,i),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([e,t])=>[e,String(t??``)])),failureReasons:e.failures,checkResults:Sv(e.check_results)}}),a=d_(),o=d_(),s=new Map;for(let e of i){f_(a,e.assistantTokenUsage),f_(o,e.toolTokenUsage);for(let[t,n]of Object.entries(e.toolTokenUsageByTool??{})){let e=s.get(t)??d_();f_(e,n),s.set(t,e)}}let c={};for(let[e,t]of Array.from(s.entries()).sort((e,t)=>e[0].localeCompare(t[0]))){let n=p_(t);n&&(c[e]=n)}let l=i.length===0?0:Math.round(i.reduce((e,t)=>e+t.duration,0)/i.length),u=i.length===0?0:i.reduce((e,t)=>e+t.toolCalls.length,0)/i.length;return{scenarioId:e.scenario_id,scenarioName:e.scenario_name||e.scenario_id,agentId:e.agent,agentName:e.agent,provider:e.provider,model:e.model,runs:i,passRate:i.some(e=>e.outcome!==`stopped`)?e.pass_rate:null,avgToolCalls:u,avgDuration:l,checkCounts:xv(i),assistantTokenUsage:p_(a),toolTokenUsage:p_(o),toolTokenUsageByTool:c}}),a=d_(),o=d_();for(let e of i)f_(a,e.assistantTokenUsage),f_(o,e.toolTokenUsage);let s=i.reduce((e,t)=>(e.passed+=t.checkCounts?.passed??0,e.failed+=t.checkCounts?.failed??0,e.not_evaluated+=t.checkCounts?.not_evaluated??0,e.not_executed+=t.checkCounts?.not_executed??0,e.total+=t.checkCounts?.total??0,e),{passed:0,failed:0,not_evaluated:0,not_executed:0,total:0});return{id:n??e.metadata.run_id,configId:``,configHash:e.metadata.config_hash,configPath:e.metadata.config_path,configName:e.metadata.config_name,langsmithTraceUrls:e.metadata.langsmith_trace_urls,rerunAgents:e.metadata.rerun_agents,rerunScenarioIds:e.metadata.rerun_scenario_ids,rerunServerOverrideAll:e.metadata.rerun_server_override_all,rerunNewConversationBeforeStart:e.metadata.rerun_new_conversation_before_start,rerunNewConversationBetweenScenarios:e.metadata.rerun_new_conversation_between_scenarios,rerunScenarioServerOverrides:e.metadata.rerun_scenario_server_overrides,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:i,assistantTokenUsage:p_(a),toolTokenUsage:p_(o),overallPassRate:e.summary.total_runs<=(e.summary.outcomes?.stopped??i.flatMap(e=>e.runs).filter(e=>e.outcome===`stopped`).length)?null: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),checkCounts:s,totalToolDurationMs:typeof e.metadata.total_tool_duration_ms==`number`?Math.max(0,e.metadata.total_tool_duration_ms??0):0,outcomes:e.summary.outcomes,executionSource:e.metadata.execution_source,executionClient:e.metadata.execution_client,evaluationRunId:e.metadata.evaluation_run_id??e.metadata.evaluation_group_id}}function wv(e,t){let n=yv(t??void 0);return{runIndex:e.run_index,passed:e.pass,outcome:e.outcome,error:e.error,stopReason:e.stop_reason,toolCalls:mv(e,t??void 0),assistantTokenUsage:n.assistant,toolTokenUsage:n.tool,toolTokenUsageByTool:n.perTool,finalAnswer:e.final_text,conversation:hv(t??void 0),duration:bv(e,t??void 0),extractedValues:Object.fromEntries(Object.entries(e.extracted).map(([e,t])=>[e,String(t??``)])),failureReasons:e.failures,checkResults:Sv(e.check_results)}}function Tv(){return typeof window>`u`?``:window.location.port===`8685`?`http://127.0.0.1:8787`:``}var Ev=Tv(),Dv=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`ApiError`}};async function Ov(e,t){let n=await fetch(`${Ev}${e}`,{...t,headers:{"content-type":`application/json`,...t?.headers||{}}});if(!n.ok){let e=await n.text();throw new Dv(n.status,`Request failed (${n.status}): ${e}`)}return await n.json()}async function kv(e,t){let n=await fetch(`${Ev}${e}`,{...t,headers:{...t?.body?{"content-type":`application/json`}:{},...t?.headers||{}}});if(!n.ok){let e=await n.text();throw new Dv(n.status,`Request failed (${n.status}): ${e}`)}return n.text()}function Av(e,t){let n=new EventSource(`${Ev}${e}`),r=e.replace(/\/events$/,``),i=[`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`],a=!1,o=()=>{a||(a=!0,n.close())},s=e=>{if(!a&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);n.type===`session_finished`&&o(),t(n)}catch{}};for(let e of i)n.addEventListener(e,s);return n.onerror=()=>{a||(n.readyState===2?o():fetch(`${Ev}${r}`,{method:`GET`,cache:`no-store`,headers:{accept:`application/json`}}).then(e=>{(e.status===404||e.status===410)&&o()}).catch(()=>{}))},()=>o()}function jv(e,t,n){if(typeof n!=`number`||!Number.isFinite(n))return;let r=Math.floor(n);r<=0||e.set(t,String(r))}function Mv(e,t,n){if(typeof n!=`number`||!Number.isFinite(n))return;let r=Math.floor(n);r<0||e.set(t,String(r))}var G={health:()=>Ov(`/api/health`),getSettings:()=>Ov(`/api/settings`),testAgentConnection:(e,t)=>Ov(`/api/agents/test`,{method:`POST`,body:JSON.stringify(e),signal:t}),testDecisionConnection:(e,t)=>Ov(`/api/settings/decision/test`,{method:`POST`,body:JSON.stringify(e),signal:t}),updateSettings:e=>Ov(`/api/settings`,{method:`PUT`,body:JSON.stringify(e)}),listConfigs:()=>Ov(`/api/evals`),createConfig:(e,t)=>Ov(`/api/evals`,{method:`POST`,body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>Ov(`/api/evals/${e}`,{method:`PUT`,body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>Ov(`/api/evals/${e}`,{method:`DELETE`}),listRuns:e=>{let t=new URLSearchParams;return e?.since?.trim()&&t.set(`since`,e.since.trim()),e?.until?.trim()&&t.set(`until`,e.until.trim()),typeof e?.lastDays==`number`&&Number.isFinite(e.lastDays)&&e.lastDays>0&&t.set(`last_days`,String(Math.floor(e.lastDays))),e?.scenario?.trim()&&t.set(`scenario`,e.scenario.trim()),jv(t,`limit`,e?.limit),Mv(t,`offset`,e?.offset),Ov(`/api/runs${t.size>0?`?${t.toString()}`:``}`)},getLatestPassRatesByConfigIds:e=>Ov(`/api/runs/latest-pass-rates`,{method:`POST`,body:JSON.stringify(e)}).then(e=>e.byConfigId),listMarkdownReports:e=>{let t=new URLSearchParams;return jv(t,`limit`,e?.limit),Mv(t,`offset`,e?.offset),Ov(`/api/markdown-reports${t.size>0?`?${t.toString()}`:``}`)},listToolAnalysisServers:()=>Ov(`/api/tool-analysis-results/servers`).then(e=>e.data),getMarkdownReport:e=>Ov(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),getMarkdownReportById:e=>Ov(`/api/markdown-reports/${encodeURIComponent(e)}`),deleteMarkdownReport:e=>Ov(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:`DELETE`}).then(()=>void 0),getRun:e=>Ov(`/api/runs/${e}`),deleteRun:e=>Ov(`/api/runs/${e}`,{method:`DELETE`}),updateRunNote:(e,t)=>Ov(`/api/runs/${encodeURIComponent(e)}/note`,{method:`PATCH`,body:JSON.stringify({runNote:t??``})}).then(()=>void 0),getRunTrace:e=>Ov(`/api/runs/${e}/trace`),applyResultAssistantReport:e=>Ov(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:`POST`,body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:(e,t)=>Ov(`/api/result-assistant/sessions`,{method:`POST`,body:JSON.stringify(e),signal:t}),getResultAssistantSession:e=>Ov(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t,n)=>Ov(`/api/result-assistant/sessions/${e}/messages`,{method:`POST`,body:JSON.stringify({message:t}),signal:n}),approveResultAssistantToolCall:(e,t,n)=>Ov(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:`POST`,body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>Ov(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:`POST`,body:JSON.stringify({})}),closeResultAssistantSession:e=>Ov(`/api/result-assistant/sessions/${e}`,{method:`DELETE`}).then(()=>void 0),subscribeResultAssistantSessionEvents:(e,t)=>Av(`/api/result-assistant/sessions/${e}/events`,t),getLibraries:()=>Ov(`/api/libraries`),saveLibraries:e=>Ov(`/api/libraries`,{method:`PUT`,body:JSON.stringify(e)}),startRun:e=>Ov(`/api/runs`,{method:`POST`,body:JSON.stringify(e)}),runScenarioPreview:e=>Ov(`/api/runs/preview`,{method:`POST`,body:JSON.stringify(e)}),listProviderModels:e=>Ov(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:(e,t)=>Ov(`/api/scenario-assistant/sessions`,{method:`POST`,body:JSON.stringify(e),signal:t}),getScenarioAssistantSession:e=>Ov(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t,n)=>Ov(`/api/scenario-assistant/sessions/${e}/messages`,{method:`POST`,body:JSON.stringify({message:t}),signal:n}),approveScenarioAssistantToolCall:(e,t)=>Ov(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:`POST`,body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>Ov(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:`POST`,body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>Ov(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:`POST`,body:JSON.stringify({})}),closeScenarioAssistantSession:e=>Ov(`/api/scenario-assistant/sessions/${e}`,{method:`DELETE`}),subscribeScenarioAssistantSessionEvents:(e,t)=>Av(`/api/scenario-assistant/sessions/${e}/events`,t),discoverToolsForAnalysis:e=>Ov(`/api/tool-analysis/discover-tools`,{method:`POST`,body:JSON.stringify(e)}),startToolAnalysis:e=>Ov(`/api/tool-analysis/jobs`,{method:`POST`,body:JSON.stringify(e)}),getToolAnalysisResult:e=>Ov(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>Ov(`/api/tool-analysis/jobs/${e}/stop`,{method:`POST`}),subscribeToolAnalysisJob:(e,t)=>{let n=new EventSource(`${Ev}/api/tool-analysis/jobs/${e}/events`),r=!1,i=()=>{r||(r=!0,n.close())},a=e=>{if(!r&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);t(n),(n.type===`completed`||n.type===`error`)&&i()}catch{}};return n.addEventListener(`started`,a),n.addEventListener(`log`,a),n.addEventListener(`completed`,a),n.addEventListener(`error`,a),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>i()},listToolAnalysisResults:e=>{let t=new URLSearchParams;return jv(t,`limit`,e?.limit),Mv(t,`offset`,e?.offset),e?.server?.trim()&&t.set(`server`,e.server.trim()),Ov(`/api/tool-analysis-results${t.size>0?`?${t.toString()}`:``}`)},getToolAnalysisSavedResult:e=>Ov(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>Ov(`/api/tool-analysis-results/${e}`,{method:`DELETE`}).then(()=>void 0),createOAuthDebuggerSession:e=>Ov(`/api/oauth-debugger/sessions`,{method:`POST`,body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>Ov(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>Ov(`/api/oauth-debugger/sessions/${e}/start`,{method:`POST`,body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{let n=new EventSource(`${Ev}/api/oauth-debugger/sessions/${e}/events`),r=!1,i=()=>{r||(r=!0,n.close())},a=e=>{if(!r&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);t(n),(n.type===`completed`||n.type===`error`||n.type===`stopped`)&&i()}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(e=>n.addEventListener(e,a)),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>i()},submitOAuthDebuggerManualCallback:(e,t)=>Ov(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:`POST`,body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>Ov(`/api/oauth-debugger/sessions/${e}/stop`,{method:`POST`,body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t===`json`?Ov(`/api/oauth-debugger/sessions/${e}/export?format=json`):kv(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>Ov(`/api/oauth-runtime/sessions`,{method:`POST`,body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>Ov(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>Ov(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>Ov(`/api/oauth-runtime/sessions/${e}/callback`,{method:`POST`,body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>Ov(`/api/oauth-runtime/sessions/${e}/cancel`,{method:`POST`,body:JSON.stringify({})}),ensureOAuthServers:e=>Ov(`/api/oauth-runtime/servers/ensure`,{method:`POST`,body:JSON.stringify(e)}),stopRun:e=>Ov(`/api/runs/jobs/${e}/stop`,{method:`POST`}),stopEvaluationRun:e=>Ov(`/api/runs/evaluations/${encodeURIComponent(e)}/stop`,{method:`POST`}),stopScenario:(e,t,n)=>Ov(`/api/runs/jobs/${encodeURIComponent(e)}/scenarios/${encodeURIComponent(t)}/agents/${encodeURIComponent(n)}/stop`,{method:`POST`}),removeEvaluationRun:e=>Ov(`/api/runs/queue/evaluations/${encodeURIComponent(e)}`,{method:`DELETE`}),openRover:e=>Ov(`/api/rover/open`,{method:`POST`,body:JSON.stringify({jobId:e})}),resumeRover:e=>Ov(`/api/rover/jobs/${encodeURIComponent(e)}/resume`,{method:`POST`}),getRoverStatus:()=>Ov(`/api/rover/status`),getRunQueue:()=>Ov(`/api/runs/queue`),subscribeRunQueue:e=>{if(typeof SharedWorker>`u`){let t=new EventSource(`${Ev}/api/runs/queue/events`),n=!1;return t.onopen=()=>{n||e({type:`connected`,ts:new Date().toISOString(),payload:{message:`SSE connected`}})},t.addEventListener(`queue_event`,t=>{if(!n)try{e(JSON.parse(t.data))}catch{}}),t.onerror=()=>{n||(e({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`,reconnecting:t.readyState!==2}}),t.readyState===2&&(t.onerror=null,n=!0))},()=>{n||(n=!0,t.close())}}let t=new SharedWorker(new URL(`/assets/sse-queue-worker-Iwmqd2oW.js`,``+import.meta.url),{type:`module`}),n=!1;return t.onerror=()=>{n||e({type:`error`,ts:new Date().toISOString(),payload:{message:`Queue worker failed to load`}})},t.port.onmessage=r=>{n||typeof r.data==`object`&&r.data&&(r.data.type===`ping`?t.port.postMessage({type:`pong`}):e(r.data))},t.port.start(),t.port.postMessage({type:`init`,baseUrl:Ev}),()=>{n||(n=!0,t.port.postMessage({type:`close`}),t.port.onmessage=null,t.port.close())}},removeQueuedRun:e=>Ov(`/api/runs/queue/${e}`,{method:`DELETE`}).then(()=>void 0),resumeQueue:()=>Ov(`/api/runs/queue/resume`,{method:`POST`}),subscribeRunJob:(e,t)=>{let n=new EventSource(`${Ev}/api/runs/jobs/${e}/events`),r=!1,i=()=>{r||(r=!0,n.close())},a=e=>{if(!r&&typeof e.data==`string`&&e.data)try{let n=JSON.parse(e.data);t(n),(n.type===`completed`||n.type===`error`)&&i()}catch{}};return n.addEventListener(`queued`,a),n.addEventListener(`started`,a),n.addEventListener(`log`,a),n.addEventListener(`completed`,a),n.addEventListener(`error`,a),n.addEventListener(`oauth_required`,a),n.onerror=()=>{r||(t({type:`error`,ts:new Date().toISOString(),payload:{message:`SSE connection error`}}),i())},()=>{i()}}};function Nv(e){if(e.sourcePath){let t=e.sourcePath.split(`/`);return t[t.length-1].replace(/\.(yaml|yml)$/i,``)}return e.name||`config-${Date.now()}`}function Pv(e){return e||`config-${Date.now()}`}var Fv={async health(){return G.health()},async listConfigs(){return(await G.listConfigs()).map(cv)},async createConfig(e){return cv(await G.createConfig(Nv(e),uv(e)))},async updateConfig(e){return cv(await G.updateConfig(e.id,uv(e),Pv(e.name)))},async deleteConfig(e){await G.deleteConfig(e)},async listResults(e){let t=0,n=[];for(;;){let r=await G.listRuns({...e,limit:100,offset:t});if(n.push(...r.data),!r.has_more||r.next_offset===null)break;t=r.next_offset}let r=n.map(async e=>{let[{runId:t,results:n},r]=await Promise.all([G.getRun(e.runId),G.getRunTrace(e.runId)]);return Cv(n,r.records,t)});return Promise.all(r)},async listRunSummaries(e){let t=Math.max(1,Math.min(100,e?.limit??100)),n=Math.max(0,e?.offset??0),r=[];for(;;){let i=await G.listRuns({...e,limit:t,offset:n});if(r.push(...i.data),!i.has_more||i.next_offset===null)break;n=i.next_offset}return r},async listRunSummariesPage(e){return G.listRuns(e)},async getLatestPassRatesByConfigIds(e){return G.getLatestPassRatesByConfigIds(e)},async getResult(e){try{let[{runId:t,results:n},r]=await Promise.all([G.getRun(e),G.getRunTrace(e)]);return Cv(n,r.records,t)}catch{return}},async deleteResult(e){await G.deleteRun(e)},async updateRunNote(e,t){await G.updateRunNote(e,t)},async listMarkdownReports(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await G.listMarkdownReports(e)).data;let t=[],n=0;for(;;){let e=await G.listMarkdownReports({limit:100,offset:n});if(t.push(...e.data),!e.has_more||e.next_offset===null)break;n=e.next_offset}return t},async listMarkdownReportsPage(e){return G.listMarkdownReports(e)},async getMarkdownReport(e){return G.getMarkdownReport(e)},async getMarkdownReportById(e){return G.getMarkdownReportById(e)},async deleteMarkdownReport(e){await G.deleteMarkdownReport(e)},async startRun(e){let t=await G.startRun(e);return typeof window<`u`&&window.dispatchEvent(new Event(`mcplab:run-queue-changed`)),t},async runScenarioPreview(e){let t=await G.runScenarioPreview(e),n=t.scenario.run;if(!n)throw Error(`Preview run did not return a run result`);return{runId:t.runId,scenarioId:t.scenario.scenarioId,agentName:t.scenario.agent,run:wv(n,t.scenario.traceRecord)}},async stopRun(e){await G.stopRun(e)},async stopScenario(e,t,n){return G.stopScenario(e,t,n)},async stopEvaluationRun(e){await G.stopEvaluationRun(e)},async removeEvaluationRun(e){await G.removeEvaluationRun(e)},async openRover(e){return G.openRover(e)},async resumeRover(e){return G.resumeRover(e)},async getRoverStatus(){return G.getRoverStatus()},async getRunQueue(){return G.getRunQueue()},subscribeRunQueue(e){return G.subscribeRunQueue(e)},async removeQueuedRun(e){await G.removeQueuedRun(e)},async resumeQueue(){return G.resumeQueue()},subscribeRunJob(e,t){return G.subscribeRunJob(e,t)},async applyResultAssistantReport(e){return G.applyResultAssistantReport(e)},async createResultAssistantSession(e,t){return G.createResultAssistantSession(e,t)},async getResultAssistantSession(e){return G.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t,n){return G.sendResultAssistantMessage(e,t,n)},async approveResultAssistantToolCall(e,t,n){return G.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return G.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await G.closeResultAssistantSession(e)},subscribeResultAssistantSessionEvents(e,t){return G.subscribeResultAssistantSessionEvents(e,t)},async getLibraries(){return lv(await G.getLibraries())},async saveLibraries(e){await G.saveLibraries(dv(e))},async listProviderModels(e){return G.listProviderModels(e)},async testAgentConnection(e,t){return G.testAgentConnection(Z_(e),t)},async getWorkspaceSettings(){return G.getSettings()},async updateWorkspaceSettings(e){return G.updateSettings(e)},async testDecisionConnection(e,t){return G.testDecisionConnection(e,t)},async createScenarioAssistantSession(e,t){return G.createScenarioAssistantSession(e,t)},async getScenarioAssistantSession(e){return G.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t,n){return G.sendScenarioAssistantMessage(e,t,n)},async approveScenarioAssistantToolCall(e,t){return G.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return G.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return G.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await G.closeScenarioAssistantSession(e)},subscribeScenarioAssistantSessionEvents(e,t){return G.subscribeScenarioAssistantSessionEvents(e,t)},async discoverToolsForAnalysis(e){return G.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return G.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return G.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return G.getToolAnalysisResult(e)},async stopToolAnalysis(e){return G.stopToolAnalysis(e)},async listToolAnalysisResults(e){if(e?.limit!==void 0||e?.offset!==void 0)return(await G.listToolAnalysisResults(e)).data;let t=[],n=0;for(;;){let e=await G.listToolAnalysisResults({limit:100,offset:n});if(t.push(...e.data),!e.has_more||e.next_offset===null)break;n=e.next_offset}return t},async listToolAnalysisResultsPage(e){return G.listToolAnalysisResults(e)},async listToolAnalysisServers(){return G.listToolAnalysisServers()},async getToolAnalysisSavedResult(e){return G.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await G.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return G.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return G.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return G.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return G.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return G.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return G.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return G.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return G.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return G.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return G.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return G.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return G.cancelOAuthRuntimeSession(e)},async ensureOAuthServers(e){return G.ensureOAuthServers(e)}},Iv=(0,_.createContext)(null);function Lv({children:e}){let t=`workspace`,[n,r]=(0,_.useState)(`checking`),[i,a]=(0,_.useState)(null);(0,_.useEffect)(()=>{r(`checking`),G.health().then(e=>{r(`connected`),a(typeof e?.version==`string`?e.version:null)}).catch(()=>{r(`disconnected`),a(null)})},[t]);let o=(0,_.useMemo)(()=>Fv,[]);return(0,I.jsx)(Iv.Provider,{value:{mode:t,connection:n,version:i,source:o},children:e})}function Rv(){let e=(0,_.useContext)(Iv);if(!e)throw Error(`useDataSource must be used within DataSourceProvider`);return e}var zv=5,Bv=2e3;function Vv(e){return e.filter(e=>e.status===`blocked_auth`&&e.blockedReason===`oauth_required`).length}function Hv(e){let t=e?.active??null;return{active:t,active_jobs:Array.isArray(e?.active_jobs)?e.active_jobs:t?[t]:[],admitting_jobs:Array.isArray(e?.admitting_jobs)?e.admitting_jobs:[],queued:Array.isArray(e?.queued)?e.queued:[]}}function Uv(){let{source:e}=Rv(),[t,n]=(0,_.useState)({active:null,active_jobs:[],admitting_jobs:[],queued:[]}),[r,i]=(0,_.useState)(`connecting`),[a,o]=(0,_.useState)(0),[s,c]=(0,_.useState)(0),l=(0,_.useRef)(`connecting`),u=(0,_.useRef)(0),d=(0,_.useRef)(new Set);return(0,_.useEffect)(()=>{let t=!1,r=0,a=null,s=null,c=0,f=r=>{let i=u.current;e.getRunQueue().then(e=>{if(t||r!==c||i!==u.current)return;let a=Hv(e);d.current=new Set([...a.active_jobs,...a.admitting_jobs].map(e=>e.jobId)),n(a)}).catch(()=>{})},p=()=>{a!==null&&(window.clearTimeout(a),a=null)},m=()=>{if(t)return;p();let h=++c;i(`connecting`),l.current=`connecting`,s?.(),s=e.subscribeRunQueue(e=>{let t=e.payload.event;if(e.type===`connected`)r=0,i(`connected`),l.current=`connected`;else if(e.type===`queue_event`&&t){u.current+=1;let e=Hv(t),r=new Set([...e.active_jobs,...e.admitting_jobs,...e.queued].map(e=>e.jobId)),a=[...d.current].filter(e=>!r.has(e)).length;a>0&&o(e=>e+a),d.current=new Set([...e.active_jobs,...e.admitting_jobs].map(e=>e.jobId)),i(`connected`),l.current=`connected`,n(e)}else if(e.type===`error`){if(s?.(),s=null,r>=zv){i(`disconnected`),l.current=`disconnected`;return}r+=1,i(`connecting`),l.current=`connecting`;let e=Bv*2**(r-1);a=window.setTimeout(()=>{m()},e)}}),f(h)};m();let h=()=>f(c);window.addEventListener(`mcplab:run-queue-changed`,h);let g=()=>{l.current!==`connected`&&m()};return window.addEventListener(`focus`,g),()=>{t=!0,s?.(),p(),window.removeEventListener(`focus`,g),window.removeEventListener(`mcplab:run-queue-changed`,h)}},[e,s]),(0,_.useMemo)(()=>{let e=t.active_jobs.length>0||t.admitting_jobs.length>0,n=t.active_jobs.length+t.admitting_jobs.length,i=t.queued.length,o=Vv(t.queued);return{isRunning:e,runningCount:n,completionVersion:a,queuedCount:i,oauthBlockedCount:o,streamStatus:r,reconnectStream:()=>{c(e=>e+1)}}},[t,r])}var Wv=(e,t)=>{if(e===`/`)return[{label:`Dashboard`}];let n=[{label:`Dashboard`,to:`/`}];if($u(`/mcp-evaluations/:id/edit`,e))return n.push({label:`MCP Evaluations`,to:`/mcp-evaluations`},{label:`MCP Evaluation`,to:e.replace(/\/edit$/,``)},{label:`Edit`}),n;if($u(`/mcp-evaluations/:id`,e))return n.push({label:`MCP Evaluations`,to:`/mcp-evaluations`},{label:`MCP Evaluation`}),n;if($u(`/mcp-evaluations`,e))return n.push({label:`MCP Evaluations`}),n;if($u(`/settings/mcp`,e))return n.push({label:`Settings`,to:`/settings`},{label:`MCP Connection`}),n;if($u(`/settings`,e))return n.push({label:`Settings`}),n;if($u(`/tool-analysis`,e))return n.push({label:`Analyze MCP Tools`}),n;if($u(`/tool-analysis-results/:id`,e)){let t=$u(`/tool-analysis-results/:id`,e);return n.push({label:`Tool Analysis Results`,to:`/tool-analysis-results`},{label:t?.params.id??`Report`}),n}if($u(`/tool-analysis-results`,e))return n.push({label:`Tool Analysis Results`}),n;if($u(`/markdown-reports/view`,e))return n.push({label:`Markdown Reports`,to:`/markdown-reports`},{label:`View Report`}),n;if($u(`/markdown-reports`,e))return n.push({label:`Markdown Reports`}),n;if($u(`/oauth-debugger`,e))return n.push({label:`OAuth Debugger`}),n;if($u(`/results/:id`,e))return n.push({label:`Evaluation Results`,to:`/results`},{label:`Result`}),n;if($u(`/results`,e))return n.push({label:`Evaluation Results`}),n;if($u(`/run`,e))return n.push({label:`Run Evaluation`}),n;if($u(`/libraries/servers/:serverId`,e)){let t=$u(`/libraries/servers/:serverId`,e),r=t?.params.serverId?decodeURIComponent(t.params.serverId):`Server`;return n.push({label:`Libraries`,to:`/libraries/servers`},{label:`MCP servers`,to:`/libraries/servers`},{label:r===`new`?`New Server`:r}),n}if($u(`/libraries/servers`,e))return n.push({label:`Libraries`,to:`/libraries/servers`},{label:`MCP servers`}),n;if($u(`/libraries/agents/:agentName`,e)){let t=$u(`/libraries/agents/:agentName`,e),r=t?.params.agentName?decodeURIComponent(t.params.agentName):`Agent`;return n.push({label:`Libraries`,to:`/libraries/agents`},{label:`Agents`,to:`/libraries/agents`},{label:r===`new`?`New Agent`:r}),n}if($u(`/libraries/agents`,e))return n.push({label:`Libraries`,to:`/libraries/agents`},{label:`Agents`}),n;if($u(`/libraries/test-cases/:testCaseId`,e)){let t=$u(`/libraries/test-cases/:testCaseId`,e),r=t?.params.testCaseId?decodeURIComponent(t.params.testCaseId):`Test Case`;return n.push({label:`Libraries`,to:`/libraries/test-cases`},{label:`Test Cases`,to:`/libraries/test-cases`},{label:r}),n}if($u(`/libraries/test-cases`,e))return n.push({label:`Libraries`,to:`/libraries/test-cases`},{label:`Test Cases`}),n;if($u(`/compare/results`,e))return n.push({label:`Compare Evaluations`,to:`/compare`},{label:`Full Result Compare`}),n;if($u(`/compare`,e)){let e=new URLSearchParams(t).get(`mode`)===`within-run`?`Agents`:`Runs`;return n.push({label:`Compare Evaluations`,to:`/compare`},{label:e}),n}return n};function Gv(){let e=Bd(),t=new URLSearchParams(e.search).get(`embed`)===`1`,n=Wv(e.pathname,e.search),{version:r}=Rv(),{isRunning:i,runningCount:a,queuedCount:o,oauthBlockedCount:s,streamStatus:c,reconnectStream:l}=Uv(),u=o+a;return t?(0,I.jsx)(`main`,{className:`min-h-screen overflow-auto bg-background p-4`,children:(0,I.jsx)(_f,{})}):(0,I.jsx)(kg,{children:(0,I.jsxs)(`div`,{className:`flex min-h-screen w-full`,children:[(0,I.jsx)(r_,{version:r}),(0,I.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,I.jsxs)(`header`,{className:`flex h-12 items-center gap-2 border-b bg-card px-4`,children:[(0,I.jsx)(jg,{}),(0,I.jsx)(a_,{children:(0,I.jsx)(o_,{children:n.map((e,t)=>{let r=t===n.length-1;return(0,I.jsxs)(_.Fragment,{children:[(0,I.jsx)(s_,{children:e.to&&!r?(0,I.jsx)(c_,{asChild:!0,children:(0,I.jsx)(sp,{to:e.to,children:e.label})}):(0,I.jsx)(l_,{children:e.label})}),!r&&(0,I.jsx)(u_,{})]},`${e.label}-${t}`)})})}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(i||o>0||s>0)&&(0,I.jsxs)(sp,{to:`/run`,className:`inline-flex items-center gap-2 rounded-full border px-2.5 py-1 hover:bg-muted/50 transition-colors`,title:`Open Run Evaluation queue`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Run Queue`}),(0,I.jsx)(`span`,{className:`inline-flex min-w-5 items-center justify-center rounded-full px-1.5 py-0.5 text-xs font-semibold ${s>0?`bg-yellow-500/20 text-yellow-800 dark:text-yellow-300`:`bg-muted text-foreground`}`,children:u}),i&&(0,I.jsx)(i_,{}),s>0&&(0,I.jsx)(`span`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:`OAuth wait`})]}),(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-2 rounded-full border px-2.5 py-1 disabled:opacity-70`,onClick:()=>{c===`disconnected`&&l()},disabled:c===`connecting`,title:c===`disconnected`?`Retry queue connection`:c===`connecting`?`Connecting to queue stream...`:`Queue stream connected`,children:[(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${c===`connected`?`bg-emerald-500`:c===`connecting`?`bg-amber-400`:`bg-rose-500`}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-xs ${c===`connected`?`text-emerald-700`:c===`connecting`?`text-muted-foreground`:`text-destructive`}`,children:c})]})]})]}),(0,I.jsx)(`main`,{className:`flex-1 overflow-auto p-6`,children:(0,I.jsx)(_f,{})})]})]})})}var Kv=(0,_.createContext)(null);function qv({children:e}){let{source:t}=Rv(),[n,r]=(0,_.useState)([]),[i,a]=(0,_.useState)(!0),o=(0,_.useCallback)(async()=>{a(!0);try{let e=await t.listConfigs();r(e)}finally{a(!1)}},[t]);(0,_.useEffect)(()=>{o()},[o]);let s=(0,_.useCallback)(e=>n.find(t=>t.id===e),[n]),c=(0,_.useCallback)(async e=>{let n=await t.createConfig(e);return r(e=>[...e,n]),n},[t]),l=(0,_.useCallback)(async(e,n)=>{let i=await t.updateConfig({...n,id:e});return r(t=>t.map(t=>t.id===e?i:t)),i},[t]),u=(0,_.useCallback)(async e=>{await t.deleteConfig(e),r(t=>t.filter(t=>t.id!==e))},[t]),d=(0,_.useCallback)(async e=>{let i=n.find(t=>t.id===e);if(!i)throw Error(`Config not found`);let a={...structuredClone(i),id:`cfg-${Date.now()}`,name:`${i.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},o=await t.createConfig(a);return r(e=>[...e,o]),o},[n,t]);return(0,I.jsx)(Kv.Provider,{value:{configs:n,loading:i,getConfig:s,addConfig:c,updateConfig:l,deleteConfig:u,cloneConfig:d,reload:o},children:e})}function Jv(){let e=(0,_.useContext)(Kv);if(!e)throw Error(`useConfigs must be used within ConfigProvider`);return e}var Yv=(0,_.createContext)(null);function Xv({children:e}){let{source:t}=Rv(),[n,r]=(0,_.useState)({servers:[],agents:[],scenarios:[],browserProviders:{}}),[i,a]=(0,_.useState)(!0),o=(0,_.useCallback)(async()=>{a(!0);try{let e=await t.getLibraries();r(e)}finally{a(!1)}},[t]);(0,_.useEffect)(()=>{o()},[t]),(0,_.useEffect)(()=>{let e=()=>{o()};return window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[t]);let s=(0,_.useCallback)(async e=>{r(e),await t.saveLibraries(e)},[t]),c=(0,_.useMemo)(()=>({...n,loading:i,setServers:async e=>s({...n,servers:e}),setAgents:async e=>s({...n,agents:e}),setScenarios:async e=>s({...n,scenarios:e}),reload:o}),[n,i,o,s]);return(0,I.jsx)(Yv.Provider,{value:c,children:e})}function Zv(){let e=(0,_.useContext)(Yv);if(!e)throw Error(`useLibraries must be used within LibraryProvider`);return e}var K=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`rounded-lg border bg-card text-card-foreground shadow-xs`,e),...t}));K.displayName=`Card`;var Qv=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`flex flex-col space-y-1.5 p-6`,e),...t}));Qv.displayName=`CardHeader`;var $v=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`h3`,{ref:n,className:U(`text-2xl font-semibold leading-none tracking-tight`,e),...t}));$v.displayName=`CardTitle`;var ey=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`p`,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));ey.displayName=`CardDescription`;var q=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`p-6 pt-0`,e),...t}));q.displayName=`CardContent`;var ty=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`flex items-center p-6 pt-0`,e),...t}));ty.displayName=`CardFooter`;var ny=_.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,I.jsx)(`div`,{className:U(`relative w-full overflow-auto`,t),children:(0,I.jsx)(`table`,{ref:r,className:U(`w-full caption-bottom text-sm`,e),...n})}));ny.displayName=`Table`;var ry=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`thead`,{ref:n,className:U(`[&_tr]:border-b`,e),...t}));ry.displayName=`TableHeader`;var iy=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tbody`,{ref:n,className:U(`[&_tr:last-child]:border-0`,e),...t}));iy.displayName=`TableBody`;var ay=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tfoot`,{ref:n,className:U(`border-t bg-muted/50 font-medium last:[&>tr]:border-b-0`,e),...t}));ay.displayName=`TableFooter`;var oy=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`tr`,{ref:n,className:U(`border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50`,e),...t}));oy.displayName=`TableRow`;var sy=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`th`,{ref:n,className:U(`h-12 px-4 text-left align-middle font-medium text-muted-foreground has-[[role=checkbox]]:pr-0`,e),...t}));sy.displayName=`TableHead`;var J=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`td`,{ref:n,className:U(`p-4 align-middle has-[[role=checkbox]]:pr-0`,e),...t}));J.displayName=`TableCell`;var cy=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`caption`,{ref:n,className:U(`mt-4 text-sm text-muted-foreground`,e),...t}));cy.displayName=`TableCaption`;function ly({title:e,value:t,subtitle:n,icon:r,trend:i,compact:a=!1}){return(0,I.jsx)(K,{className:a?`h-fit self-start`:void 0,children:(0,I.jsx)(q,{className:a?`p-2`:`p-4`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,I.jsxs)(`div`,{className:a?`space-y-0.5`:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:e}),(0,I.jsx)(`p`,{className:a?`text-lg font-bold`:`text-2xl font-bold`,children:t}),n&&(0,I.jsxs)(`p`,{className:`text-xs ${i===`up`?`text-success`:i===`down`?`text-destructive`:`text-muted-foreground`}`,children:[i===`up`&&`↑ `,i===`down`&&`↓ `,n]})]}),(0,I.jsx)(`div`,{className:a?`rounded-lg bg-primary/10 p-0.5`:`rounded-lg bg-primary/10 p-2`,children:(0,I.jsx)(r,{className:`h-4 w-4 text-primary`})})]})})})}var uy=Wt(`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden 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`}}),Y=_.forwardRef(({className:e,variant:t,asChild:n,...r},i)=>(0,I.jsx)(n?wp:`div`,{ref:i,className:U(uy({variant:t}),e),...r}));Y.displayName=`Badge`;function dy({rate:e,className:t}){let n=e===null?null:Math.round(e*100);return n===null?(0,I.jsx)(Y,{variant:`secondary`,className:`font-mono text-xs text-muted-foreground ${t??``}`,title:`Nothing evaluated`,children:`–`}):(0,I.jsxs)(Y,{variant:n>=80?`default`:n>=50?`secondary`:`destructive`,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 fy=o(((e,t)=>{t.exports=Array.isArray})),py=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),my=o(((e,t)=>{var n=py(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),hy=o(((e,t)=>{t.exports=my().Symbol})),gy=o(((e,t)=>{var n=hy(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),_y=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),vy=o(((e,t)=>{var n=hy(),r=gy(),i=_y(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),yy=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),by=o(((e,t)=>{var n=vy(),r=yy(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),xy=o(((e,t)=>{var n=fy(),r=by(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Sy=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Cy=o(((e,t)=>{var n=vy(),r=Sy(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),wy=o(((e,t)=>{t.exports=my()[`__core-js_shared__`]})),Ty=o(((e,t)=>{var n=wy(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),Ey=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Dy=o(((e,t)=>{var n=Cy(),r=Ty(),i=Sy(),a=Ey(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Oy=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),ky=o(((e,t)=>{var n=Dy(),r=Oy();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Ay=o(((e,t)=>{t.exports=ky()(Object,`create`)})),jy=o(((e,t)=>{var n=Ay();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),My=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),Ny=o(((e,t)=>{var n=Ay(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Py=o(((e,t)=>{var n=Ay(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Fy=o(((e,t)=>{var n=Ay(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),Iy=o(((e,t)=>{var n=jy(),r=My(),i=Ny(),a=Py(),o=Fy();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Ly=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Ry=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),zy=o(((e,t)=>{var n=Ry();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),By=o(((e,t)=>{var n=zy(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Vy=o(((e,t)=>{var n=zy();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Hy=o(((e,t)=>{var n=zy();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Uy=o(((e,t)=>{var n=zy();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Wy=o(((e,t)=>{var n=Ly(),r=By(),i=Vy(),a=Hy(),o=Uy();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Gy=o(((e,t)=>{t.exports=ky()(my(),`Map`)})),Ky=o(((e,t)=>{var n=Iy(),r=Wy(),i=Gy();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),qy=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Jy=o(((e,t)=>{var n=qy();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),Yy=o(((e,t)=>{var n=Jy();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),Xy=o(((e,t)=>{var n=Jy();function r(e){return n(this,e).get(e)}t.exports=r})),Zy=o(((e,t)=>{var n=Jy();function r(e){return n(this,e).has(e)}t.exports=r})),Qy=o(((e,t)=>{var n=Jy();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),$y=o(((e,t)=>{var n=Ky(),r=Yy(),i=Xy(),a=Zy(),o=Qy();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),eb=o(((e,t)=>{var n=$y(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),tb=o(((e,t)=>{var n=eb(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),nb=o(((e,t)=>{var n=tb(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),rb=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),ib=o(((e,t)=>{var n=hy(),r=rb(),i=fy(),a=by(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),ab=o(((e,t)=>{var n=ib();function r(e){return e==null?``:n(e)}t.exports=r})),ob=o(((e,t)=>{var n=fy(),r=xy(),i=nb(),a=ab();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),sb=o(((e,t)=>{var n=by(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),cb=o(((e,t)=>{var n=ob(),r=sb();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),lb=o(((e,t)=>{var n=cb();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),ub=o(((e,t)=>{function n(e){return e==null}t.exports=n})),db=o(((e,t)=>{var n=vy(),r=fy(),i=yy(),a=`[object String]`;function o(e){return typeof e==`string`||!r(e)&&i(e)&&n(e)==a}t.exports=o})),fb=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.server_context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case u:case d:return e;default:switch(e&&=e.$$typeof,e){case c:case s:case l:case p:case f:case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),pb=o(((e,t)=>{t.exports=fb()})),mb=o(((e,t)=>{var n=vy(),r=yy(),i=`[object Number]`;function a(e){return typeof e==`number`||r(e)&&n(e)==i}t.exports=a})),hb=o(((e,t)=>{var n=mb();function r(e){return n(e)&&e!=+e}t.exports=r})),gb=l(db()),_b=l(hb()),vb=l(lb()),yb=l(mb()),bb=l(ub()),xb=function(e){return e===0?0:e>0?1:-1},Sb=function(e){return(0,gb.default)(e)&&e.indexOf(`%`)===e.length-1},X=function(e){return(0,yb.default)(e)&&!(0,_b.default)(e)},Cb=function(e){return(0,bb.default)(e)},wb=function(e){return X(e)||(0,gb.default)(e)},Tb=0,Eb=function(e){var t=++Tb;return`${e||``}${t}`},Db=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(!X(e)&&!(0,gb.default)(e))return n;var i;if(Sb(e)){var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return(0,_b.default)(i)&&(i=n),r&&i>t&&(i=t),i},Ob=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},kb=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[e[r]])n[e[r]]=!0;else return!0;return!1},Ab=function(e,t){return X(e)&&X(t)?function(n){return e+n*(t-e)}:function(){return t}};function jb(e,t,n){return!e||!e.length?null:e.find(function(e){return e&&(typeof t==`function`?t(e):(0,vb.default)(e,t))===n})}var Mb=function(e,t){return X(e)&&X(t)?e-t:(0,gb.default)(e)&&(0,gb.default)(t)?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():String(e).localeCompare(String(t))};function Nb(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}var Pb=l(Sy());function Fb(e){"@babel/helpers - typeof";return Fb=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Fb(e)}var Ib=[`viewBox`,`children`],Lb=`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`.split(`.`),Rb=[`points`,`pathLength`],zb={svg:Ib,polygon:Rb,polyline:Rb},Bb=`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`.split(`.`),Vb=function(e,t){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,_.isValidElement)(e)&&(n=e.props),!(0,Pb.default)(n))return null;var r={};return Object.keys(n).forEach(function(e){Bb.includes(e)&&(r[e]=t||function(t){return n[e](n,t)})}),r},Hb=function(e,t,n){return function(r){return e(t,n,r),null}},Ub=function(e,t,n){if(!(0,Pb.default)(e)||Fb(e)!==`object`)return null;var r=null;return Object.keys(e).forEach(function(i){var a=e[i];Bb.includes(i)&&typeof a==`function`&&(r||={},r[i]=Hb(a,t,n))}),r},Wb=l(Cy()),Gb=pb(),Kb=[`children`],qb=[`children`];function Jb(e,t){if(e==null)return{};var n=Yb(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yb(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 Xb(e){"@babel/helpers - typeof";return Xb=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Xb(e)}var Zb={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`},Qb=function(e){return typeof e==`string`?e:e?e.displayName||e.name||`Component`:``},$b=null,ex=null,tx=function e(t){if(t===$b&&Array.isArray(ex))return ex;var n=[];return _.Children.forEach(t,function(t){(0,bb.default)(t)||((0,Gb.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),ex=n,$b=t,n};function nx(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return Qb(e)}):[Qb(t)],tx(e).forEach(function(e){var t=(0,vb.default)(e,`type.displayName`)||(0,vb.default)(e,`type.name`);r.indexOf(t)!==-1&&n.push(e)}),n}function rx(e,t){var n=nx(e,t);return n&&n[0]}var ix=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!(!X(n)||n<=0||!X(r)||r<=0)},ax=`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`.split(`.`),ox=function(e){return e&&e.type&&(0,gb.default)(e.type)&&ax.indexOf(e.type)>=0},sx=function(e){return e&&Xb(e)===`object`&&`clipDot`in e},cx=function(e,t,n,r){var i=zb?.[r]??[];return t.startsWith(`data-`)||!(0,Wb.default)(e)&&(r&&i.includes(t)||Lb.includes(t))||n&&Bb.includes(t)},lx=function(e,t,n){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var r=e;if((0,_.isValidElement)(e)&&(r=e.props),!(0,Pb.default)(r))return null;var i={};return Object.keys(r).forEach(function(e){cx(r?.[e],e,t,n)&&(i[e]=r[e])}),i},ux=function e(t,n){if(t===n)return!0;var r=_.Children.count(t);if(r!==_.Children.count(n))return!1;if(r===0)return!0;if(r===1)return dx(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],o=n[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!dx(a,o))return!1}return!0},dx=function(e,t){if((0,bb.default)(e)&&(0,bb.default)(t))return!0;if(!(0,bb.default)(e)&&!(0,bb.default)(t)){var n=e.props||{},r=n.children,i=Jb(n,Kb),a=t.props||{},o=a.children,s=Jb(a,qb);return r&&o?Nb(i,s)&&ux(r,o):!r&&!o&&Nb(i,s)}return!1},fx=function(e,t){var n=[],r={};return tx(e).forEach(function(e,i){if(ox(e))n.push(e);else if(e){var a=Qb(e.type),o=t[a]||{},s=o.handler,c=o.once;if(s&&(!c||!r[a])){var l=s(e,a,i);n.push(l),r[a]=!0}}}),n},px=function(e){var t=e&&e.type;return t&&Zb[t]?Zb[t]:null},mx=function(e,t){return tx(t).indexOf(e)},hx=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function gx(){return gx=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},gx.apply(this,arguments)}function _x(e,t){if(e==null)return{};var n=vx(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vx(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 yx(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,c=e.desc,l=_x(e,hx),u=i||{width:n,height:r,x:0,y:0},d=Vt(`recharts-surface`,a);return _.createElement(`svg`,gx({},lx(l,!0,`svg`),{className:d,width:n,height:r,style:o,viewBox:`${u.x} ${u.y} ${u.width} ${u.height}`}),_.createElement(`title`,null,s),_.createElement(`desc`,null,c),t)}var bx=[`children`,`className`];function xx(){return xx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xx.apply(this,arguments)}function Sx(e,t){if(e==null)return{};var n=Cx(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cx(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 wx=_.forwardRef(function(e,t){var n=e.children,r=e.className,i=Sx(e,bx),a=Vt(`recharts-layer`,r);return _.createElement(`g`,xx({className:a},lx(i,!0),{ref:t}),n)}),Tx=o(((e,t)=>{function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=n})),Ex=o(((e,t)=>{var n=Tx();function r(e,t,r){var i=e.length;return r=r===void 0?i:r,!t&&r>=i?e:n(e,t,r)}t.exports=r})),Dx=o(((e,t)=>{var n=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function r(e){return n.test(e)}t.exports=r})),Ox=o(((e,t)=>{function n(e){return e.split(``)}t.exports=n})),kx=o(((e,t)=>{var n=`\\ud800-\\udfff`,r=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,i=`\\ufe0e\\ufe0f`,a=`[`+n+`]`,o=`[`+r+`]`,s=`\\ud83c[\\udffb-\\udfff]`,c=`(?:`+o+`|`+s+`)`,l=`[^`+n+`]`,u=`(?:\\ud83c[\\udde6-\\uddff]){2}`,d=`[\\ud800-\\udbff][\\udc00-\\udfff]`,f=`\\u200d`,p=c+`?`,m=`[`+i+`]?`,h=`(?:`+f+`(?:`+[l,u,d].join(`|`)+`)`+m+p+`)*`,g=m+p+h,_=`(?:`+[l+o+`?`,o,u,d,a].join(`|`)+`)`,v=RegExp(s+`(?=`+s+`)|`+_+g,`g`);function y(e){return e.match(v)||[]}t.exports=y})),Ax=o(((e,t)=>{var n=Ox(),r=Dx(),i=kx();function a(e){return r(e)?i(e):n(e)}t.exports=a})),jx=o(((e,t)=>{var n=Ex(),r=Dx(),i=Ax(),a=ab();function o(e){return function(t){t=a(t);var o=r(t)?i(t):void 0,s=o?o[0]:t.charAt(0),c=o?n(o,1).join(``):t.slice(1);return s[e]()+c}}t.exports=o})),Mx=o(((e,t)=>{t.exports=jx()(`toUpperCase`)}));function Nx(e){return function(){return e}}var Px=Math.cos,Fx=Math.sin,Ix=Math.sqrt,Lx=Math.PI;Lx/2;var Rx=2*Lx,zx=Math.PI,Bx=2*zx,Vx=1e-6,Hx=Bx-Vx;function Ux(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Wx(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return Ux;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var Gx=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?Ux:Wx(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>Vx){if(!(Math.abs(u*s-c*l)>Vx)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((zx-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>Vx&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Vx||Math.abs(this._y1-l)>Vx)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%Bx+Bx),d>Hx?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>Vx&&this._append`A${n},${n},0,${+(d>=zx)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};Gx.prototype;function Kx(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new Gx(t)}Array.prototype.slice;function qx(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Jx(e){this._context=e}Jx.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)}}};function Yx(e){return new Jx(e)}function Xx(e){return e[0]}function Zx(e){return e[1]}function Qx(e,t){var n=Nx(!0),r=null,i=Yx,a=null,o=Kx(s);e=typeof e==`function`?e:e===void 0?Xx:Nx(e),t=typeof t==`function`?t:t===void 0?Zx:Nx(t);function s(s){var c,l=(s=qx(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:Nx(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:Nx(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:Nx(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function $x(e,t,n){var r=null,i=Nx(!0),a=null,o=Yx,s=null,c=Kx(l);e=typeof e==`function`?e:e===void 0?Xx:Nx(+e),t=typeof t==`function`?t:Nx(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?Zx:Nx(+n);function l(l){var u,d,f,p=(l=qx(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h){if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return Qx().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:Nx(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:Nx(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Nx(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:Nx(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:Nx(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:Nx(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:Nx(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var eS=class{constructor(e,t){this._context=e,this._x=t}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(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._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}};function tS(e){return new eS(e,!0)}function nS(e){return new eS(e,!1)}var rS={draw(e,t){let n=Ix(t/Lx);e.moveTo(n,0),e.arc(0,0,n,0,Rx)}},iS={draw(e,t){let n=Ix(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()}},aS=Ix(1/3),oS=aS*2,sS={draw(e,t){let n=Ix(t/oS),r=n*aS;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},cS={draw(e,t){let n=Ix(t),r=-n/2;e.rect(r,r,n,n)}},lS=.8908130915292852,uS=Fx(Lx/10)/Fx(7*Lx/10),dS=Fx(Rx/10)*uS,fS=-Px(Rx/10)*uS,pS={draw(e,t){let n=Ix(t*lS),r=dS*n,i=fS*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=Rx*t/5,o=Px(a),s=Fx(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},mS=Ix(3),hS={draw(e,t){let n=-Ix(t/(mS*3));e.moveTo(0,n*2),e.lineTo(-mS*n,-n),e.lineTo(mS*n,-n),e.closePath()}},gS=-.5,_S=Ix(3)/2,vS=1/Ix(12),yS=(vS/2+1)*3,bS={draw(e,t){let n=Ix(t/yS),r=n/2,i=n*vS,a=r,o=n*vS+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(gS*r-_S*i,_S*r+gS*i),e.lineTo(gS*a-_S*o,_S*a+gS*o),e.lineTo(gS*s-_S*c,_S*s+gS*c),e.lineTo(gS*r+_S*i,gS*i-_S*r),e.lineTo(gS*a+_S*o,gS*o-_S*a),e.lineTo(gS*s+_S*c,gS*c-_S*s),e.closePath()}};function xS(e,t){let n=null,r=Kx(i);e=typeof e==`function`?e:Nx(e||rS),t=typeof t==`function`?t:Nx(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:Nx(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:Nx(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function SS(){}function CS(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 wS(e){this._context=e}wS.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:CS(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(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:CS(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TS(e){return new wS(e)}function ES(e){this._context=e}ES.prototype={areaStart:SS,areaEnd:SS,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)}},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:CS(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function DS(e){return new ES(e)}function OS(e){this._context=e}OS.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:CS(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function kS(e){return new OS(e)}function AS(e){this._context=e}AS.prototype={areaStart:SS,areaEnd:SS,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 jS(e){return new AS(e)}function MS(e){return e<0?-1:1}function NS(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(MS(a)+MS(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function PS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function FS(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function IS(e){this._context=e}IS.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:FS(this,this._t0,PS(this,this._t0))}(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,FS(this,PS(this,n=NS(this,e,t)),n);break;default:FS(this,this._t0,n=NS(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function LS(e){this._context=new RS(e)}(LS.prototype=Object.create(IS.prototype)).point=function(e,t){IS.prototype.point.call(this,t,e)};function RS(e){this._context=e}RS.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function zS(e){return new IS(e)}function BS(e){return new LS(e)}function VS(e){this._context=e}VS.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=HS(e),i=HS(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o])}(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function HS(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function US(e){return new VS(e)}function WS(e,t){this._context=e,this._t=t}WS.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)}}this._x=e,this._y=t}};function GS(e){return new WS(e,.5)}function KS(e){return new WS(e,0)}function qS(e){return new WS(e,1)}function JS(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function YS(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function XS(e,t){return e[t]}function ZS(e){let t=[];return t.key=e,t}function QS(){var e=Nx([]),t=YS,n=JS,r=XS;function i(i){var a=Array.from(e.apply(this,arguments),ZS),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=qx(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:Nx(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:Nx(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?YS:typeof e==`function`?e:Nx(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??JS,i):n},i}function $S(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}JS(e,t)}}function eC(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}JS(e,t)}}function tC(e,t){if((o=e.length)>0&&(a=(i=e[t[0]]).length)>0){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,JS(e,t)}}var nC=l(Mx());function rC(e){"@babel/helpers - typeof";return rC=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},rC(e)}var iC=[`type`,`size`,`sizeType`];function aC(){return aC=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},aC.apply(this,arguments)}function oC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oC(Object(n),!0).forEach(function(t){cC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cC(e,t,n){return t=lC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lC(e){var t=uC(e,`string`);return rC(t)==`symbol`?t:t+``}function uC(e,t){if(rC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(rC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dC(e,t){if(e==null)return{};var n=fC(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fC(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 pC={symbolCircle:rS,symbolCross:iS,symbolDiamond:sS,symbolSquare:cS,symbolStar:pS,symbolTriangle:hS,symbolWye:bS},mC=Math.PI/180,hC=function(e){return pC[`symbol${(0,nC.default)(e)}`]||rS},gC=function(e,t,n){if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*mC;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},_C=function(e,t){pC[`symbol${(0,nC.default)(e)}`]=t},vC=function(e){var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=sC(sC({},dC(e,iC)),{},{type:n,size:i,sizeType:o}),c=function(){var e=hC(n);return xS().type(e).size(gC(i,o,n))()},l=s.className,u=s.cx,d=s.cy,f=lx(s,!0);return u===+u&&d===+d&&i===+i?_.createElement(`path`,aC({},f,{className:Vt(`recharts-symbols`,l),transform:`translate(${u}, ${d})`,d:c()})):null};vC.registerSymbol=_C;function yC(e){"@babel/helpers - typeof";return yC=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},yC(e)}function bC(){return bC=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},bC.apply(this,arguments)}function xC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xC(Object(n),!0).forEach(function(t){NC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function CC(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function wC(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,PC(r.key),r)}}function TC(e,t,n){return t&&wC(e.prototype,t),n&&wC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function EC(e,t,n){return t=AC(t),DC(e,kC()?Reflect.construct(t,n||[],AC(e).constructor):t.apply(e,n))}function DC(e,t){if(t&&(yC(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return OC(e)}function OC(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function kC(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kC=function(){return!!e})()}function AC(e){return AC=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},AC(e)}function jC(e,t){if(typeof t!=`function`&&t!==null)throw 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&&MC(e,t)}function MC(e,t){return MC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},MC(e,t)}function NC(e,t,n){return t=PC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PC(e){var t=pee(e,`string`);return yC(t)==`symbol`?t:t+``}function pee(e,t){if(yC(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(yC(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var FC=32,IC=function(e){function t(){return CC(this,t),EC(this,t,arguments)}return jC(t,e),TC(t,[{key:`renderIcon`,value:function(e){var t=this.props.inactiveColor,n=FC/2,r=FC/6,i=FC/3,a=e.inactive?t:e.color;if(e.type===`plainline`)return _.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:n,x2:FC,y2:n,className:`recharts-legend-icon`});if(e.type===`line`)return _.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:a,d:`M0,${n}h${i}
|
|
60
|
-
A${r},${r},0,1,1,${2*i},${n}
|
|
61
|
-
H${FC}M${2*i},${n}
|
|
62
|
-
A${r},${r},0,1,1,${i},${n}`,className:`recharts-legend-icon`});if(e.type===`rect`)return _.createElement(`path`,{stroke:`none`,fill:a,d:`M0,${FC/8}h${FC}v${FC*3/4}h${-FC}z`,className:`recharts-legend-icon`});if(_.isValidElement(e.legendIcon)){var o=SC({},e);return delete o.legendIcon,_.cloneElement(e.legendIcon,o)}return _.createElement(vC,{fill:a,cx:n,cy:n,size:FC,sizeType:`diameter`,type:e.type})}},{key:`renderItems`,value:function(){var e=this,t=this.props,n=t.payload,r=t.iconSize,i=t.layout,a=t.formatter,o=t.inactiveColor,s={x:0,y:0,width:FC,height:FC},c={display:i===`horizontal`?`inline-block`:`block`,marginRight:10},l={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return n.map(function(t,n){var i=t.formatter||a,u=Vt(NC(NC({"recharts-legend-item":!0},`legend-item-${n}`,!0),`inactive`,t.inactive));if(t.type===`none`)return null;var d=(0,Wb.default)(t.value)?null:t.value;(0,Wb.default)(t.value);var f=t.inactive?o:t.color;return _.createElement(`li`,bC({className:u,style:c,key:`legend-item-${n}`},Ub(e.props,t,n)),_.createElement(yx,{width:r,height:r,viewBox:s,style:l},e.renderIcon(t)),_.createElement(`span`,{className:`recharts-legend-item-text`,style:{color:f}},i?i(d,t,n):d))})}},{key:`render`,value:function(){var e=this.props,t=e.payload,n=e.layout,r=e.align;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:n===`horizontal`?r:`left`};return _.createElement(`ul`,{className:`recharts-default-legend`,style:i},this.renderItems())}}])}(_.PureComponent);NC(IC,`displayName`,`Legend`),NC(IC,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`middle`,inactiveColor:`#ccc`});var mee=o(((e,t)=>{var n=Wy();function r(){this.__data__=new n,this.size=0}t.exports=r})),hee=o(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),gee=o(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),_ee=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),vee=o(((e,t)=>{var n=Wy(),r=Gy(),i=$y(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),LC=o(((e,t)=>{var n=Wy(),r=mee(),i=hee(),a=gee(),o=_ee(),s=vee();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),yee=o(((e,t)=>{function n(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this}t.exports=n})),bee=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),RC=o(((e,t)=>{var n=$y(),r=yee(),i=bee();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),zC=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),BC=o(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),VC=o(((e,t)=>{var n=RC(),r=zC(),i=BC(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),xee=o(((e,t)=>{t.exports=my().Uint8Array})),See=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),HC=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),Cee=o(((e,t)=>{var n=hy(),r=xee(),i=Ry(),a=VC(),o=See(),s=HC(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),UC=o(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),wee=o(((e,t)=>{var n=UC(),r=fy();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),Tee=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),Eee=o(((e,t)=>{function n(){return[]}t.exports=n})),Dee=o(((e,t)=>{var n=Tee(),r=Eee(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),Oee=o(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),kee=o(((e,t)=>{var n=vy(),r=yy(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),WC=o(((e,t)=>{var n=kee(),r=yy(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),Aee=o(((e,t)=>{function n(){return!1}t.exports=n})),GC=o(((e,t)=>{var n=my(),r=Aee(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),KC=o(((e,t)=>{var n=/^(?:0|[1-9]\d*)$/;function r(e,t){var r=typeof e;return t??=9007199254740991,!!t&&(r==`number`||r!=`symbol`&&n.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r})),qC=o(((e,t)=>{function n(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991}t.exports=n})),jee=o(((e,t)=>{var n=vy(),r=qC(),i=yy(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),JC=o(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),Mee=o(((e,t)=>{var n=py(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),YC=o(((e,t)=>{var n=jee(),r=JC(),i=Mee(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),Nee=o(((e,t)=>{var n=Oee(),r=WC(),i=fy(),a=GC(),o=KC(),s=YC(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),Pee=o(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),XC=o(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),Fee=o(((e,t)=>{t.exports=XC()(Object.keys,Object)})),Iee=o(((e,t)=>{var n=Pee(),r=Fee(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),ZC=o(((e,t)=>{var n=Cy(),r=qC();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),QC=o(((e,t)=>{var n=Nee(),r=Iee(),i=ZC();function a(e){return i(e)?n(e):r(e)}t.exports=a})),$C=o(((e,t)=>{var n=wee(),r=Dee(),i=QC();function a(e){return n(e,i,r)}t.exports=a})),ew=o(((e,t)=>{var n=$C(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),tw=o(((e,t)=>{t.exports=ky()(my(),`DataView`)})),nw=o(((e,t)=>{t.exports=ky()(my(),`Promise`)})),rw=o(((e,t)=>{t.exports=ky()(my(),`Set`)})),iw=o(((e,t)=>{t.exports=ky()(my(),`WeakMap`)})),aw=o(((e,t)=>{var n=tw(),r=Gy(),i=nw(),a=rw(),o=iw(),s=vy(),c=Ey(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),ow=o(((e,t)=>{var n=LC(),r=VC(),i=Cee(),a=ew(),o=aw(),s=fy(),c=GC(),l=YC(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),sw=o(((e,t)=>{var n=ow(),r=yy();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),cw=o(((e,t)=>{var n=LC(),r=sw(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),lw=o(((e,t)=>{var n=Sy();function r(e){return e===e&&!n(e)}t.exports=r})),uw=o(((e,t)=>{var n=lw(),r=QC();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),dw=o(((e,t)=>{function n(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),fw=o(((e,t)=>{var n=cw(),r=uw(),i=dw();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),pw=o(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),mw=o(((e,t)=>{var n=ob(),r=WC(),i=fy(),a=KC(),o=qC(),s=sb();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),hw=o(((e,t)=>{var n=pw(),r=mw();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),gw=o(((e,t)=>{var n=sw(),r=lb(),i=hw(),a=xy(),o=lw(),s=dw(),c=sb(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),_w=o(((e,t)=>{function n(e){return e}t.exports=n})),vw=o(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),yw=o(((e,t)=>{var n=cb();function r(e){return function(t){return n(t,e)}}t.exports=r})),bw=o(((e,t)=>{var n=vw(),r=yw(),i=xy(),a=sb();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),xw=o(((e,t)=>{var n=fw(),r=gw(),i=_w(),a=fy(),o=bw();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),Sw=o(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),Cw=o(((e,t)=>{function n(e){return e!==e}t.exports=n})),ww=o(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),Tw=o(((e,t)=>{var n=Sw(),r=Cw(),i=ww();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),Ew=o(((e,t)=>{var n=Tw();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),Dw=o(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),Ow=o(((e,t)=>{function n(){}t.exports=n})),kw=o(((e,t)=>{var n=rw(),r=Ow(),i=HC();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),Aw=o(((e,t)=>{var n=RC(),r=Ew(),i=Dw(),a=BC(),o=kw(),s=HC(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),jw=l(o(((e,t)=>{var n=xw(),r=Aw();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))());function Mw(e,t,n){return t===!0?(0,jw.default)(e,n):(0,Wb.default)(t)?(0,jw.default)(e,t):e}function Nw(e){"@babel/helpers - typeof";return Nw=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Nw(e)}var Pw=[`ref`];function Fw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Iw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Fw(Object(n),!0).forEach(function(t){qw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Lw(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Rw(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,Jw(r.key),r)}}function zw(e,t,n){return t&&Rw(e.prototype,t),n&&Rw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bw(e,t,n){return t=Ww(t),Vw(e,Uw()?Reflect.construct(t,n||[],Ww(e).constructor):t.apply(e,n))}function Vw(e,t){if(t&&(Nw(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Hw(e)}function Hw(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Uw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Uw=function(){return!!e})()}function Ww(e){return Ww=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ww(e)}function Gw(e,t){if(typeof t!=`function`&&t!==null)throw 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&&Kw(e,t)}function Kw(e,t){return Kw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kw(e,t)}function qw(e,t,n){return t=Jw(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jw(e){var t=Yw(e,`string`);return Nw(t)==`symbol`?t:t+``}function Yw(e,t){if(Nw(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Nw(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Xw(e,t){if(e==null)return{};var n=Zw(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zw(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 Qw(e){return e.value}function $w(e,t){if(_.isValidElement(e))return _.cloneElement(e,t);if(typeof e==`function`)return _.createElement(e,t);t.ref;var n=Xw(t,Pw);return _.createElement(IC,n)}var eT=1,tT=function(e){function t(){var e;Lw(this,t);var n=[...arguments];return e=Bw(this,t,[].concat(n)),qw(e,`lastBoundingBox`,{width:-1,height:-1}),e}return Gw(t,e),zw(t,[{key:`componentDidMount`,value:function(){this.updateBBox()}},{key:`componentDidUpdate`,value:function(){this.updateBBox()}},{key:`getBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();return e.height=this.wrapperNode.offsetHeight,e.width=this.wrapperNode.offsetWidth,e}return null}},{key:`updateBBox`,value:function(){var e=this.props.onBBoxUpdate,t=this.getBBox();t?(Math.abs(t.width-this.lastBoundingBox.width)>eT||Math.abs(t.height-this.lastBoundingBox.height)>eT)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:`getBBoxSnapshot`,value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Iw({},this.lastBoundingBox):{width:0,height:0}}},{key:`getDefaultPosition`,value:function(e){var t=this.props,n=t.layout,r=t.align,i=t.verticalAlign,a=t.margin,o=t.chartWidth,s=t.chartHeight,c,l;if(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null)){if(r===`center`&&n===`vertical`){var u=this.getBBoxSnapshot();c={left:((o||0)-u.width)/2}}else c=r===`right`?{right:a&&a.right||0}:{left:a&&a.left||0}}if(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null)){if(i===`middle`){var d=this.getBBoxSnapshot();l={top:((s||0)-d.height)/2}}else l=i===`bottom`?{bottom:a&&a.bottom||0}:{top:a&&a.top||0}}return Iw(Iw({},c),l)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.content,r=t.width,i=t.height,a=t.wrapperStyle,o=t.payloadUniqBy,s=t.payload,c=Iw(Iw({position:`absolute`,width:r||`auto`,height:i||`auto`},this.getDefaultPosition(a)),a);return _.createElement(`div`,{className:`recharts-legend-wrapper`,style:c,ref:function(t){e.wrapperNode=t}},$w(n,Iw(Iw({},this.props),{},{payload:Mw(s,o,Qw)})))}}],[{key:`getWithHeight`,value:function(e,t){var n=Iw(Iw({},this.defaultProps),e.props).layout;return n===`vertical`&&X(e.props.height)?{height:e.props.height}:n===`horizontal`?{width:e.props.width||t}:null}}])}(_.PureComponent);qw(tT,`displayName`,`Legend`),qw(tT,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`bottom`});var nT=o(((e,t)=>{var n=hy(),r=WC(),i=fy(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),rT=o(((e,t)=>{var n=UC(),r=nT();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),iT=o(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),aT=o(((e,t)=>{t.exports=iT()()})),oT=o(((e,t)=>{var n=aT(),r=QC();function i(e,t){return e&&n(e,t,r)}t.exports=i})),sT=o(((e,t)=>{var n=ZC();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),cT=o(((e,t)=>{var n=oT();t.exports=sT()(n)})),lT=o(((e,t)=>{var n=cT(),r=ZC();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),uT=o(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),dT=o(((e,t)=>{var n=by();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),fT=o(((e,t)=>{var n=dT();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),pT=o(((e,t)=>{var n=rb(),r=cb(),i=xw(),a=lT(),o=uT(),s=JC(),c=fT(),l=_w(),u=fy();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),mT=o(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),hT=o(((e,t)=>{var n=mT(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),gT=o(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),_T=o(((e,t)=>{var n=ky();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),Lee=o(((e,t)=>{var n=gT(),r=_T(),i=_w();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),Ree=o(((e,t)=>{var n=Date.now;function r(e){var t=0,r=0;return function(){var i=n(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=r})),zee=o(((e,t)=>{var n=Lee();t.exports=Ree()(n)})),Bee=o(((e,t)=>{var n=_w(),r=hT(),i=zee();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),vT=o(((e,t)=>{var n=Ry(),r=ZC(),i=KC(),a=Sy();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),yT=l(o(((e,t)=>{var n=rT(),r=pT(),i=Bee(),a=vT();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})}))());function bT(e){"@babel/helpers - typeof";return bT=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},bT(e)}function xT(){return xT=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},xT.apply(this,arguments)}function ST(e,t){return DT(e)||ET(e,t)||wT(e,t)||CT()}function CT(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
63
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wT(e,t){if(e){if(typeof e==`string`)return TT(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 TT(e,t)}}function TT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ET(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function DT(e){if(Array.isArray(e))return e}function OT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OT(Object(n),!0).forEach(function(t){AT(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AT(e,t,n){return t=jT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jT(e){var t=MT(e,`string`);return bT(t)==`symbol`?t:t+``}function MT(e,t){if(bT(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(bT(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function NT(e){return Array.isArray(e)&&wb(e[0])&&wb(e[1])?e.join(` ~ `):e}var PT=function(e){var t=e.separator,n=t===void 0?` : `:t,r=e.contentStyle,i=r===void 0?{}:r,a=e.itemStyle,o=a===void 0?{}:a,s=e.labelStyle,c=s===void 0?{}:s,l=e.payload,u=e.formatter,d=e.itemSorter,f=e.wrapperClassName,p=e.labelClassName,m=e.label,h=e.labelFormatter,g=e.accessibilityLayer,v=g!==void 0&&g,y=function(){if(l&&l.length){var e={padding:0,margin:0},t=(d?(0,yT.default)(l,d):l).map(function(e,t){if(e.type===`none`)return null;var r=kT({display:`block`,paddingTop:4,paddingBottom:4,color:e.color||`#000`},o),i=e.formatter||u||NT,a=e.value,s=e.name,c=a,d=s;if(i&&c!=null&&d!=null){var f=i(a,s,e,t,l);if(Array.isArray(f)){var p=ST(f,2);c=p[0],d=p[1]}else c=f}return _.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:r},wb(d)?_.createElement(`span`,{className:`recharts-tooltip-item-name`},d):null,wb(d)?_.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,_.createElement(`span`,{className:`recharts-tooltip-item-value`},c),_.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return _.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},b=kT({margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},i),x=kT({margin:0},c),S=!(0,bb.default)(m),C=S?m:``,w=Vt(`recharts-default-tooltip`,f),T=Vt(`recharts-tooltip-label`,p);S&&h&&l!=null&&(C=h(m,l));var E=v?{role:`status`,"aria-live":`assertive`}:{};return _.createElement(`div`,xT({className:w,style:b},E),_.createElement(`p`,{className:T,style:x},_.isValidElement(C)?C:`${C}`),y())};function FT(e){"@babel/helpers - typeof";return FT=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},FT(e)}function IT(e,t,n){return t=LT(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LT(e){var t=RT(e,`string`);return FT(t)==`symbol`?t:t+``}function RT(e,t){if(FT(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(FT(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var zT=`recharts-tooltip-wrapper`,BT={visibility:`hidden`};function VT(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Vt(zT,IT(IT(IT(IT({},`${zT}-right`,X(n)&&t&&X(t.x)&&n>=t.x),`${zT}-left`,X(n)&&t&&X(t.x)&&n<t.x),`${zT}-bottom`,X(r)&&t&&X(t.y)&&r>=t.y),`${zT}-top`,X(r)&&t&&X(t.y)&&r<t.y))}function HT(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,l=e.viewBoxDimension;if(a&&X(a[r]))return a[r];var u=n[r]-s-i,d=n[r]+i;return t[r]?o[r]?u:d:o[r]?u<c[r]?Math.max(d,c[r]):Math.max(u,c[r]):d+s>c[r]+l?Math.max(u,c[r]):Math.max(d,c[r])}function UT(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function WT(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,c=e.viewBox,l,u,d;return o.height>0&&o.width>0&&n?(u=HT({allowEscapeViewBox:t,coordinate:n,key:`x`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=HT({allowEscapeViewBox:t,coordinate:n,key:`y`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),l=UT({translateX:u,translateY:d,useTranslate3d:s})):l=BT,{cssProperties:l,cssClasses:VT({translateX:u,translateY:d,coordinate:n})}}function GT(e){"@babel/helpers - typeof";return GT=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},GT(e)}function KT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?KT(Object(n),!0).forEach(function(t){iE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function JT(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function YT(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,aE(r.key),r)}}function XT(e,t,n){return t&&YT(e.prototype,t),n&&YT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ZT(e,t,n){return t=tE(t),QT(e,eE()?Reflect.construct(t,n||[],tE(e).constructor):t.apply(e,n))}function QT(e,t){if(t&&(GT(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return $T(e)}function $T(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function eE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eE=function(){return!!e})()}function tE(e){return tE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tE(e)}function nE(e,t){if(typeof t!=`function`&&t!==null)throw 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&&rE(e,t)}function rE(e,t){return rE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rE(e,t)}function iE(e,t,n){return t=aE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aE(e){var t=oE(e,`string`);return GT(t)==`symbol`?t:t+``}function oE(e,t){if(GT(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(GT(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sE=1,cE=function(e){function t(){var e;JT(this,t);var n=[...arguments];return e=ZT(this,t,[].concat(n)),iE(e,`state`,{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),iE(e,`handleKeyDown`,function(t){t.key===`Escape`&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:e.props.coordinate?.x??0,y:e.props.coordinate?.y??0}})}),e}return nE(t,e),XT(t,[{key:`updateBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>sE||Math.abs(e.height-this.state.lastBoundingBox.height)>sE)&&this.setState({lastBoundingBox:{width:e.width,height:e.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(){this.props.active&&this.updateBBox(),this.state.dismissed&&(this.props.coordinate?.x!==this.state.dismissedAtCoordinate.x||this.props.coordinate?.y!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.children,s=t.coordinate,c=t.hasPayload,l=t.isAnimationActive,u=t.offset,d=t.position,f=t.reverseDirection,p=t.useTranslate3d,m=t.viewBox,h=t.wrapperStyle,g=WT({allowEscapeViewBox:r,coordinate:s,offsetTopLeft:u,position:d,reverseDirection:f,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:m}),v=g.cssClasses,y=g.cssProperties,b=qT(qT({transition:l&&n?`transform ${i}ms ${a}`:void 0},y),{},{pointerEvents:`none`,visibility:!this.state.dismissed&&n&&c?`visible`:`hidden`,position:`absolute`,top:0,left:0},h);return _.createElement(`div`,{tabIndex:-1,className:v,style:b,ref:function(t){e.wrapperNode=t}},o)}}])}(_.PureComponent),lE={isSsr:function(){return!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)}(),get:function(e){return lE[e]},set:function(e,t){if(typeof e==`string`)lE[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){lE[t]=e[t]})}}};function uE(e){"@babel/helpers - typeof";return uE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},uE(e)}function dE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dE(Object(n),!0).forEach(function(t){CE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pE(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mE(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,wE(r.key),r)}}function hE(e,t,n){return t&&mE(e.prototype,t),n&&mE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gE(e,t,n){return t=bE(t),_E(e,yE()?Reflect.construct(t,n||[],bE(e).constructor):t.apply(e,n))}function _E(e,t){if(t&&(uE(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return vE(e)}function vE(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function yE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yE=function(){return!!e})()}function bE(e){return bE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bE(e)}function xE(e,t){if(typeof t!=`function`&&t!==null)throw 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&&SE(e,t)}function SE(e,t){return SE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},SE(e,t)}function CE(e,t,n){return t=wE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wE(e){var t=TE(e,`string`);return uE(t)==`symbol`?t:t+``}function TE(e,t){if(uE(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(uE(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function EE(e){return e.dataKey}function DE(e,t){return _.isValidElement(e)?_.cloneElement(e,t):typeof e==`function`?_.createElement(e,t):_.createElement(PT,t)}var OE=function(e){function t(){return pE(this,t),gE(this,t,arguments)}return xE(t,e),hE(t,[{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.content,s=t.coordinate,c=t.filterNull,l=t.isAnimationActive,u=t.offset,d=t.payload,f=t.payloadUniqBy,p=t.position,m=t.reverseDirection,h=t.useTranslate3d,g=t.viewBox,v=t.wrapperStyle,y=d??[];c&&y.length&&(y=Mw(d.filter(function(t){return t.value!=null&&(t.hide!==!0||e.props.includeHidden)}),f,EE));var b=y.length>0;return _.createElement(cE,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:l,active:n,coordinate:s,hasPayload:b,offset:u,position:p,reverseDirection:m,useTranslate3d:h,viewBox:g,wrapperStyle:v},DE(o,fE(fE({},this.props),{},{payload:y})))}}])}(_.PureComponent);CE(OE,`displayName`,`Tooltip`),CE(OE,`defaultProps`,{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!lE.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 kE=o(((e,t)=>{var n=my();t.exports=function(){return n.Date.now()}})),AE=o(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),jE=o(((e,t)=>{var n=AE(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),ME=o(((e,t)=>{var n=jE(),r=Sy(),i=by(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),NE=o(((e,t)=>{var n=Sy(),r=kE(),i=ME(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),PE=l(o(((e,t)=>{var n=NE(),r=Sy(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))());function FE(e){"@babel/helpers - typeof";return FE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},FE(e)}function IE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?IE(Object(n),!0).forEach(function(t){RE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function RE(e,t,n){return t=zE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zE(e){var t=BE(e,`string`);return FE(t)==`symbol`?t:t+``}function BE(e,t){if(FE(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(FE(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function VE(e,t){return KE(e)||GE(e,t)||UE(e,t)||HE()}function HE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
64
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UE(e,t){if(e){if(typeof e==`string`)return WE(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 WE(e,t)}}function WE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function GE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function KE(e){if(Array.isArray(e))return e}var qE=(0,_.forwardRef)(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?`100%`:a,s=e.height,c=s===void 0?`100%`:s,l=e.minWidth,u=l===void 0?0:l,d=e.minHeight,f=e.maxHeight,p=e.children,m=e.debounce,h=m===void 0?0:m,g=e.id,v=e.className,y=e.onResize,b=e.style,x=b===void 0?{}:b,S=(0,_.useRef)(null),C=(0,_.useRef)();C.current=y,(0,_.useImperativeHandle)(t,function(){return Object.defineProperty(S.current,"current",{get:function(){return console.warn(`The usage of ref.current.current is deprecated and will no longer be supported.`),S.current},configurable:!0})});var w=VE((0,_.useState)({containerWidth:i.width,containerHeight:i.height}),2),T=w[0],E=w[1],D=(0,_.useCallback)(function(e,t){E(function(n){var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,_.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,i=n.height;D(r,i),(t=C.current)==null||t.call(C,r,i)};h>0&&(e=(0,PE.default)(e,h,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=S.current.getBoundingClientRect(),r=n.width,i=n.height;return D(r,i),t.observe(S.current),function(){t.disconnect()}},[D,h]);var O=(0,_.useMemo)(function(){var e=T.containerWidth,t=T.containerHeight;if(e<0||t<0)return null;Sb(o)||Sb(c);var r=Sb(o)?e:o,i=Sb(c)?t:c;n&&n>0&&(r?i=r/n:i&&(r=i*n),f&&i>f&&(i=f));var a=!Array.isArray(p)&&Qb(p.type).endsWith(`Chart`);return _.Children.map(p,function(e){return _.isValidElement(e)?(0,_.cloneElement)(e,LE({width:r,height:i},a?{style:LE({height:`100%`,width:`100%`,maxHeight:i,maxWidth:r},e.props.style)}:{})):e})},[n,p,c,f,d,u,T,o]);return _.createElement(`div`,{id:g?`${g}`:void 0,className:Vt(`recharts-responsive-container`,v),style:LE(LE({},x),{},{width:o,height:c,minWidth:u,minHeight:d,maxHeight:f}),ref:S},O)}),JE=function(e){return null};JE.displayName=`Cell`;function YE(e){"@babel/helpers - typeof";return YE=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},YE(e)}function XE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ZE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?XE(Object(n),!0).forEach(function(t){QE(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XE(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function QE(e,t,n){return t=$E(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $E(e){var t=eD(e,`string`);return YE(t)==`symbol`?t:t+``}function eD(e,t){if(YE(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(YE(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var tD={widthCache:{},cacheCount:0},nD=2e3,rD={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},iD=`recharts_measurement_span`;function aD(e){var t=ZE({},e);return Object.keys(t).forEach(function(e){t[e]||delete t[e]}),t}var oD=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||lE.isSsr)return{width:0,height:0};var n=aD(t),r=JSON.stringify({text:e,copyStyle:n});if(tD.widthCache[r])return tD.widthCache[r];try{var i=document.getElementById(iD);i||(i=document.createElement(`span`),i.setAttribute(`id`,iD),i.setAttribute(`aria-hidden`,`true`),document.body.appendChild(i));var a=ZE(ZE({},rD),n);Object.assign(i.style,a),i.textContent=`${e}`;var o=i.getBoundingClientRect(),s={width:o.width,height:o.height};return tD.widthCache[r]=s,++tD.cacheCount>nD&&(tD.cacheCount=0,tD.widthCache={}),s}catch{return{width:0,height:0}}},sD=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function cD(e){"@babel/helpers - typeof";return cD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},cD(e)}function lD(e,t){return mD(e)||pD(e,t)||dD(e,t)||uD()}function uD(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
65
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dD(e,t){if(e){if(typeof e==`string`)return fD(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 fD(e,t)}}function fD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pD(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function mD(e){if(Array.isArray(e))return e}function hD(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function gD(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,vD(r.key),r)}}function _D(e,t,n){return t&&gD(e.prototype,t),n&&gD(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vD(e){var t=yD(e,`string`);return cD(t)==`symbol`?t:t+``}function yD(e,t){if(cD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(cD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,xD=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,SD=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,CD=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,wD={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},TD=Object.keys(wD),ED=`NaN`;function DD(e,t){return e*wD[t]}var OD=function(){function e(t,n){hD(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=``),n!==``&&!SD.test(n)&&(this.num=NaN,this.unit=``),TD.includes(n)&&(this.num=DD(t,n),this.unit=`px`)}return _D(e,[{key:`add`,value:function(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}},{key:`subtract`,value:function(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}},{key:`multiply`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}},{key:`divide`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}},{key:`toString`,value:function(){return`${this.num}${this.unit}`}},{key:`isNaN`,value:function(){return Number.isNaN(this.num)}}],[{key:`parse`,value:function(t){var n=lD(CD.exec(t)??[],3),r=n[1],i=n[2];return new e(parseFloat(r),i??``)}}])}();function kD(e){if(e.includes(ED))return ED;for(var t=e;t.includes(`*`)||t.includes(`/`);){var n=lD(bD.exec(t)??[],4),r=n[1],i=n[2],a=n[3],o=OD.parse(r??``),s=OD.parse(a??``),c=i===`*`?o.multiply(s):o.divide(s);if(c.isNaN())return ED;t=t.replace(bD,c.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var l=lD(xD.exec(t)??[],4),u=l[1],d=l[2],f=l[3],p=OD.parse(u??``),m=OD.parse(f??``),h=d===`+`?p.add(m):p.subtract(m);if(h.isNaN())return ED;t=t.replace(xD,h.toString())}return t}var AD=/\(([^()]*)\)/;function jD(e){for(var t=e;t.includes(`(`);){var n=lD(AD.exec(t),2)[1];t=t.replace(AD,kD(n))}return t}function MD(e){var t=e.replace(/\s+/g,``);return t=jD(t),t=kD(t),t}function ND(e){try{return MD(e)}catch{return ED}}function PD(e){var t=ND(e.slice(5,-1));return t===ED?``:t}var FD=[`x`,`y`,`lineHeight`,`capHeight`,`scaleToFit`,`textAnchor`,`verticalAnchor`,`fill`],ID=[`dx`,`dy`,`angle`,`className`,`breakAll`];function LD(){return LD=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},LD.apply(this,arguments)}function RD(e,t){if(e==null)return{};var n=zD(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zD(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 BD(e,t){return GD(e)||WD(e,t)||HD(e,t)||VD()}function VD(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
66
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HD(e,t){if(e){if(typeof e==`string`)return UD(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 UD(e,t)}}function UD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function WD(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function GD(e){if(Array.isArray(e))return e}var KD=/[ \f\n\r\t\v\u2028\u2029]+/,qD=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return(0,bb.default)(t)||(i=n?t.toString().split(``):t.toString().split(KD)),{wordsWithComputedWidth:i.map(function(e){return{word:e,width:oD(e,r).width}}),spaceWidth:n?0:oD(`\xA0`,r).width}}catch{return null}},JD=function(e,t,n,r,i){var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=X(a),u=o,d=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).reduce(function(e,t){var a=t.word,o=t.width,s=e[e.length-1];if(s&&(r==null||i||s.width+o+n<Number(r)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[])},f=d(t),p=function(e){return e.reduce(function(e,t){return e.width>t.width?e:t})};if(!l)return f;for(var m=`…`,h=function(e){var t=qD({breakAll:c,style:s,children:u.slice(0,e)+m}).wordsWithComputedWidth,n=d(t);return[n.length>a||p(n).width>Number(r),n]},g=0,_=u.length-1,v=0,y;g<=_&&v<=u.length-1;){var b=Math.floor((g+_)/2),x=BD(h(b-1),2),S=x[0],C=x[1],w=BD(h(b),1)[0];if(!S&&!w&&(g=b+1),S&&w&&(_=b-1),!S&&w){y=C;break}v++}return y||f},YD=function(e){return[{words:(0,bb.default)(e)?[]:e.toString().split(KD)}]},XD=function(e){var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!lE.isSsr){var s,c,l=qD({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return YD(r);return JD({breakAll:a,children:r,maxLines:o,style:i},s,c,t,n)}return YD(r)},ZD=`#808080`,QD=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.lineHeight,o=a===void 0?`1em`:a,s=e.capHeight,c=s===void 0?`0.71em`:s,l=e.scaleToFit,u=l!==void 0&&l,d=e.textAnchor,f=d===void 0?`start`:d,p=e.verticalAnchor,m=p===void 0?`end`:p,h=e.fill,g=h===void 0?ZD:h,v=RD(e,FD),y=(0,_.useMemo)(function(){return XD({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:u,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,u,v.style,v.width]),b=v.dx,x=v.dy,S=v.angle,C=v.className,w=v.breakAll,T=RD(v,ID);if(!wb(n)||!wb(i))return null;var E=n+(X(b)?b:0),D=i+(X(x)?x:0),O;switch(m){case`start`:O=PD(`calc(${c})`);break;case`middle`:O=PD(`calc(${(y.length-1)/2} * -${o} + (${c} / 2))`);break;default:O=PD(`calc(${y.length-1} * -${o})`)}var k=[];if(u){var A=y[0].width,j=v.width;k.push(`scale(${(X(j)?j/A:1)/A})`)}return S&&k.push(`rotate(${S}, ${E}, ${D})`),k.length&&(T.transform=k.join(` `)),_.createElement(`text`,LD({},lx(T,!0),{x:E,y:D,className:Vt(`recharts-text`,C),textAnchor:f,fill:g.includes(`url`)?ZD:g}),y.map(function(e,t){var n=e.words.join(w?``:` `);return _.createElement(`tspan`,{x:E,dy:t===0?O:o,key:`${n}-${t}`},n)}))};function $D(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function eO(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function tO(e){let t,n,r;e.length===2?(t=e===$D||e===eO?e:nO,n=e,r=e):(t=$D,n=(t,n)=>$D(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function nO(){return 0}function rO(e){return e===null?NaN:+e}function*iO(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var aO=tO($D),oO=aO.right;aO.left,tO(rO).center;var sO=class extends Map{constructor(e,t=dO){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(cO(this,e))}has(e){return super.has(cO(this,e))}set(e,t){return super.set(lO(this,e),t)}delete(e){return super.delete(uO(this,e))}};function cO({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function lO({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function uO({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function dO(e){return typeof e==`object`&&e?e.valueOf():e}function fO(e=$D){if(e===$D)return pO;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function pO(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:+(e>t))}var mO=Math.sqrt(50),hO=Math.sqrt(10),gO=Math.sqrt(2);function _O(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=mO?10:a>=hO?5:a>=gO?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?_O(e,t,n*2):[s,c,l]}function vO(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?_O(t,e,n):_O(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function yO(e,t,n){return t=+t,e=+e,n=+n,_O(e,t,n)[2]}function bO(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?yO(t,e,n):yO(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function xO(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function SO(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function CO(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?pO:fO(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));CO(e,t,u,d,i)}let a=e[t],o=n,s=r;for(wO(e,n,t),i(e[r],a)>0&&wO(e,n,r);o<s;){for(wO(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?wO(e,n,s):(++s,wO(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function wO(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function TO(e,t,n){if(e=Float64Array.from(iO(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return SO(e);if(t>=1)return xO(e);var r,i=(r-1)*t,a=Math.floor(i),o=xO(CO(e,a).subarray(0,a+1));return o+(SO(e.subarray(a+1))-o)*(i-a)}}function EO(e,t,n=rO){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function DO(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function OO(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function kO(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)}return this}var AO=Symbol(`implicit`);function jO(){var e=new sO,t=[],n=[],r=AO;function i(i){let a=e.get(i);if(a===void 0){if(r!==AO)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new sO;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return jO(t,n).unknown(r)},OO.apply(i,arguments),i}function MO(){var e=jO().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=DO(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return MO(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},OO.apply(d(),arguments)}function NO(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return NO(t())},e}function PO(){return NO(MO.apply(null,arguments).paddingInner(1))}function FO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function IO(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function LO(){}var RO=.7,zO=1/RO,BO=`\\s*([+-]?\\d+)\\s*`,VO=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,HO=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,UO=/^#([0-9a-f]{3,8})$/,WO=RegExp(`^rgb\\(${BO},${BO},${BO}\\)$`),GO=RegExp(`^rgb\\(${HO},${HO},${HO}\\)$`),KO=RegExp(`^rgba\\(${BO},${BO},${BO},${VO}\\)$`),qO=RegExp(`^rgba\\(${HO},${HO},${HO},${VO}\\)$`),JO=RegExp(`^hsl\\(${VO},${HO},${HO}\\)$`),YO=RegExp(`^hsla\\(${VO},${HO},${HO},${VO}\\)$`),XO={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};FO(LO,tk,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ZO,formatHex:ZO,formatHex8:QO,formatHsl:$O,formatRgb:ek,toString:ek});function ZO(){return this.rgb().formatHex()}function QO(){return this.rgb().formatHex8()}function $O(){return mk(this).formatHsl()}function ek(){return this.rgb().formatRgb()}function tk(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=UO.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?nk(t):n===3?new ok(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rk(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rk(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=WO.exec(e))?new ok(t[1],t[2],t[3],1):(t=GO.exec(e))?new ok(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=KO.exec(e))?rk(t[1],t[2],t[3],t[4]):(t=qO.exec(e))?rk(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=JO.exec(e))?pk(t[1],t[2]/100,t[3]/100,1):(t=YO.exec(e))?pk(t[1],t[2]/100,t[3]/100,t[4]):XO.hasOwnProperty(e)?nk(XO[e]):e===`transparent`?new ok(NaN,NaN,NaN,0):null}function nk(e){return new ok(e>>16&255,e>>8&255,e&255,1)}function rk(e,t,n,r){return r<=0&&(e=t=n=NaN),new ok(e,t,n,r)}function ik(e){return e instanceof LO||(e=tk(e)),e?(e=e.rgb(),new ok(e.r,e.g,e.b,e.opacity)):new ok}function ak(e,t,n,r){return arguments.length===1?ik(e):new ok(e,t,n,r??1)}function ok(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}FO(ok,ak,IO(LO,{brighter(e){return e=e==null?zO:zO**+e,new ok(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?RO:RO**+e,new ok(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ok(dk(this.r),dk(this.g),dk(this.b),uk(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:sk,formatHex:sk,formatHex8:ck,formatRgb:lk,toString:lk}));function sk(){return`#${fk(this.r)}${fk(this.g)}${fk(this.b)}`}function ck(){return`#${fk(this.r)}${fk(this.g)}${fk(this.b)}${fk((isNaN(this.opacity)?1:this.opacity)*255)}`}function lk(){let e=uk(this.opacity);return`${e===1?`rgb(`:`rgba(`}${dk(this.r)}, ${dk(this.g)}, ${dk(this.b)}${e===1?`)`:`, ${e})`}`}function uk(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dk(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function fk(e){return e=dk(e),(e<16?`0`:``)+e.toString(16)}function pk(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new gk(e,t,n,r)}function mk(e){if(e instanceof gk)return new gk(e.h,e.s,e.l,e.opacity);if(e instanceof LO||(e=tk(e)),!e)return new gk;if(e instanceof gk)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new gk(o,s,c,e.opacity)}function hk(e,t,n,r){return arguments.length===1?mk(e):new gk(e,t,n,r??1)}function gk(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}FO(gk,hk,IO(LO,{brighter(e){return e=e==null?zO:zO**+e,new gk(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?RO:RO**+e,new gk(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ok(yk(e>=240?e-240:e+120,i,r),yk(e,i,r),yk(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new gk(_k(this.h),vk(this.s),vk(this.l),uk(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(){let e=uk(this.opacity);return`${e===1?`hsl(`:`hsla(`}${_k(this.h)}, ${vk(this.s)*100}%, ${vk(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function _k(e){return e=(e||0)%360,e<0?e+360:e}function vk(e){return Math.max(0,Math.min(1,e||0))}function yk(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var bk=e=>()=>e;function xk(e,t){return function(n){return e+n*t}}function Sk(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Ck(e){return(e=+e)==1?wk:function(t,n){return n-t?Sk(t,n,e):bk(isNaN(t)?n:t)}}function wk(e,t){var n=t-e;return n?xk(e,n):bk(isNaN(e)?t:e)}var Tk=(function e(t){var n=Ck(t);function r(e,t){var r=n((e=ak(e)).r,(t=ak(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=wk(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Ek(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Dk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ok(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=Lk(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function kk(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ak(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function jk(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=Lk(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Mk=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Nk=new RegExp(Mk.source,`g`);function Pk(e){return function(){return e}}function Fk(e){return function(t){return e(t)+``}}function Ik(e,t){var n=Mk.lastIndex=Nk.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Mk.exec(e))&&(i=Nk.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Ak(r,i)})),n=Nk.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Fk(c[0].x):Pk(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Lk(e,t){var n=typeof t,r;return t==null||n===`boolean`?bk(t):(n===`number`?Ak:n===`string`?(r=tk(t))?(t=r,Tk):Ik:t instanceof tk?Tk:t instanceof Date?kk:Dk(t)?Ek:Array.isArray(t)?Ok:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?jk:Ak)(e,t)}function Rk(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function zk(e,t){t===void 0&&(t=e,e=Lk);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function Bk(e){return function(){return e}}function Vk(e){return+e}var Hk=[0,1];function Uk(e){return e}function Wk(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Bk(isNaN(t)?NaN:.5)}function Gk(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Kk(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Wk(i,r),a=n(o,a)):(r=Wk(r,i),a=n(a,o)),function(e){return a(r(e))}}function qk(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Wk(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=oO(e,t,1,r)-1;return a[n](i[n](t))}}function Jk(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Yk(){var e=Hk,t=Hk,n=Lk,r,i,a,o=Uk,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Uk&&(o=Gk(e[0],e[n-1])),s=n>2?qk:Kk,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),Ak))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,Vk),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=Rk,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Uk,u()):o!==Uk},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Xk(){return Yk()(Uk,Uk)}function Zk(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function Qk(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 $k(e){return e=Qk(Math.abs(e)),e?e[1]:NaN}function eA(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function tA(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var nA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function rA(e){if(!(t=nA.exec(e)))throw Error(`invalid format: `+e);var t;return new iA({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]})}rA.prototype=iA.prototype;function iA(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+``}iA.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 aA(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var oA;function sA(e,t){var n=Qk(e,t);if(!n)return oA=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(oA=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+Qk(e,Math.max(0,t+a-1))[0]}function cA(e,t){var n=Qk(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var lA={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Zk,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)=>cA(e*100,t),r:cA,s:sA,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function uA(e){return e}var dA=Array.prototype.map,fA=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function pA(e){var t=e.grouping===void 0||e.thousands===void 0?uA:eA(dA.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?uA:tA(dA.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=rA(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):lA[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=lA[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=aA(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&oA!==void 0?fA[8+oA/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor($k(t)/3)))*3,r=10**-n,i=l((e=rA(e),e.type=`f`,e),{suffix:fA[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var mA,hA,gA;_A({thousands:`,`,grouping:[3],currency:[`$`,``]});function _A(e){return mA=pA(e),hA=mA.format,gA=mA.formatPrefix,mA}function vA(e){return Math.max(0,-$k(Math.abs(e)))}function yA(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($k(t)/3)))*3-$k(Math.abs(e)))}function bA(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,$k(t)-$k(e))+1}function xA(e,t,n,r){var i=bO(e,t,n),a;switch(r=rA(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=yA(i,o))&&(r.precision=a),gA(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=bA(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=vA(i))&&(r.precision=a-(r.type===`%`)*2)}return hA(r)}function SA(e){var t=e.domain;return e.ticks=function(e){var n=t();return vO(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return xA(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=yO(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function CA(){var e=Xk();return e.copy=function(){return Jk(e,CA())},OO.apply(e,arguments),SA(e)}function wA(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,Vk),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return wA(e).unknown(t)},e=arguments.length?Array.from(e,Vk):[0,1],SA(n)}function TA(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function EA(e){return Math.log(e)}function DA(e){return Math.exp(e)}function OA(e){return-Math.log(-e)}function kA(e){return-Math.exp(-e)}function AA(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function jA(e){return e===10?AA:e===Math.E?Math.exp:t=>e**+t}function MA(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 NA(e){return(t,n)=>-e(-t,n)}function PA(e){let t=e(EA,DA),n=t.domain,r=10,i,a;function o(){return i=MA(r),a=jA(r),n()[0]<0?(i=NA(i),a=NA(a),e(OA,kA)):e(EA,DA),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=vO(o,s,p))}else m=vO(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=rA(n)).precision==null&&(n.trim=!0),n=hA(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(TA(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function FA(){let e=PA(Yk()).domain([1,10]);return e.copy=()=>Jk(e,FA()).base(e.base()),OO.apply(e,arguments),e}function IA(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function LA(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function RA(e){var t=1,n=e(IA(t),LA(t));return n.constant=function(n){return arguments.length?e(IA(t=+n),LA(t)):t},SA(n)}function zA(){var e=RA(Yk());return e.copy=function(){return Jk(e,zA()).constant(e.constant())},OO.apply(e,arguments)}function BA(e){return function(t){return t<0?-((-t)**+e):t**+e}}function VA(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function HA(e){return e<0?-e*e:e*e}function UA(e){var t=e(Uk,Uk),n=1;function r(){return n===1?e(Uk,Uk):n===.5?e(VA,HA):e(BA(n),BA(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},SA(t)}function WA(){var e=UA(Yk());return e.copy=function(){return Jk(e,WA()).exponent(e.exponent())},OO.apply(e,arguments),e}function GA(){return WA.apply(null,arguments).exponent(.5)}function KA(e){return Math.sign(e)*e*e}function qA(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function JA(){var e=Xk(),t=[0,1],n=!1,r;function i(t){var i=qA(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(KA(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,Vk)).map(KA)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return JA(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},OO.apply(i,arguments),SA(i)}function YA(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=EO(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[oO(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort($D),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return YA().domain(e).range(t).unknown(r)},OO.apply(a,arguments)}function XA(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[oO(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return XA().domain([e,t]).range(i).unknown(a)},OO.apply(SA(o),arguments)}function ZA(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[oO(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return ZA().domain(e).range(t).unknown(n)},OO.apply(i,arguments)}var QA=new Date,$A=new Date;function ej(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>ej(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e){if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}}),n&&(i.count=(t,r)=>(QA.setTime(+t),$A.setTime(+r),e(QA),e($A),Math.floor(n(QA,$A))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var tj=ej(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);tj.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ej(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):tj),tj.range;var nj=1e3,rj=nj*60,ij=rj*60,aj=ij*24,oj=aj*7,sj=aj*30,cj=aj*365,lj=ej(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*nj)},(e,t)=>(t-e)/nj,e=>e.getUTCSeconds());lj.range;var uj=ej(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*nj)},(e,t)=>{e.setTime(+e+t*rj)},(e,t)=>(t-e)/rj,e=>e.getMinutes());uj.range;var dj=ej(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*rj)},(e,t)=>(t-e)/rj,e=>e.getUTCMinutes());dj.range;var fj=ej(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*nj-e.getMinutes()*rj)},(e,t)=>{e.setTime(+e+t*ij)},(e,t)=>(t-e)/ij,e=>e.getHours());fj.range;var pj=ej(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ij)},(e,t)=>(t-e)/ij,e=>e.getUTCHours());pj.range;var mj=ej(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*rj)/aj,e=>e.getDate()-1);mj.range;var hj=ej(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/aj,e=>e.getUTCDate()-1);hj.range;var gj=ej(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/aj,e=>Math.floor(e/aj));gj.range;function _j(e){return ej(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*rj)/oj)}var vj=_j(0),yj=_j(1),bj=_j(2),xj=_j(3),Sj=_j(4),Cj=_j(5),wj=_j(6);vj.range,yj.range,bj.range,xj.range,Sj.range,Cj.range,wj.range;function Tj(e){return ej(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/oj)}var Ej=Tj(0),Dj=Tj(1),Oj=Tj(2),kj=Tj(3),Aj=Tj(4),jj=Tj(5),Mj=Tj(6);Ej.range,Dj.range,Oj.range,kj.range,Aj.range,jj.range,Mj.range;var Nj=ej(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());Nj.range;var Pj=ej(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());Pj.range;var Fj=ej(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());Fj.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ej(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)}),Fj.range;var Ij=ej(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());Ij.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ej(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)}),Ij.range;function Lj(e,t,n,r,i,a){let o=[[lj,1,nj],[lj,5,5*nj],[lj,15,15*nj],[lj,30,30*nj],[a,1,rj],[a,5,5*rj],[a,15,15*rj],[a,30,30*rj],[i,1,ij],[i,3,3*ij],[i,6,6*ij],[i,12,12*ij],[r,1,aj],[r,2,2*aj],[n,1,oj],[t,1,sj],[t,3,3*sj],[e,1,cj]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=tO(([,,e])=>e).right(o,i);if(a===o.length)return e.every(bO(t/cj,n/cj,r));if(a===0)return tj.every(Math.max(bO(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[Rj,zj]=Lj(Ij,Pj,Ej,gj,pj,dj),[Bj,Vj]=Lj(Fj,Nj,vj,mj,fj,uj);function Hj(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 Uj(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 Wj(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Gj(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=Qj(i),u=$j(i),d=Qj(a),f=$j(a),p=Qj(o),m=$j(o),h=Qj(s),g=$j(s),_=Qj(c),v=$j(c),y={a:N,A:P,b:F,B:I,c:null,d:bM,e:bM,f:TM,g:IM,G:RM,H:xM,I:SM,j:CM,L:wM,m:EM,M:DM,p:L,q:R,Q:sN,s:cN,S:OM,u:kM,U:AM,V:MM,w:NM,W:PM,x:null,X:null,y:FM,Y:LM,Z:zM,"%":oN},b={a:z,A:B,b:ee,B:te,c:null,d:BM,e:BM,f:GM,g:nN,G:iN,H:VM,I:HM,j:UM,L:WM,m:KM,M:qM,p:ne,q:re,Q:sN,s:cN,S:JM,u:YM,U:XM,V:QM,w:$M,W:eN,x:null,X:null,y:tN,Y:rN,Z:aN,"%":oN},x={a:E,A:D,b:O,B:k,c:A,d:uM,e:uM,f:gM,g:oM,G:aM,H:fM,I:fM,j:dM,L:hM,m:lM,M:pM,p:T,q:cM,Q:vM,s:yM,S:mM,u:tM,U:nM,V:rM,w:eM,W:iM,x:j,X:M,y:oM,Y:aM,Z:sM,"%":_M};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=Kj[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=Wj(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=Uj(Wj(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?Dj.ceil(a):Dj(a),a=hj.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=Hj(Wj(r.y,0,1)),o=a.getDay(),a=o>4||o===0?yj.ceil(a):yj(a),a=mj.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else(`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?Uj(Wj(r.y,0,1)).getUTCDay():Hj(Wj(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Uj(r)):Hj(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in Kj?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function I(e){return s[e.getMonth()]}function L(e){return i[+(e.getHours()>=12)]}function R(e){return 1+~~(e.getMonth()/3)}function z(e){return o[e.getUTCDay()]}function B(e){return a[e.getUTCDay()]}function ee(e){return c[e.getUTCMonth()]}function te(e){return s[e.getUTCMonth()]}function ne(e){return i[+(e.getUTCHours()>=12)]}function re(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var Kj={"-":``,_:` `,0:`0`},qj=/^\s*\d+/,Jj=/^%/,Yj=/[\\^$*+?|[\]().{}]/g;function Xj(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function Zj(e){return e.replace(Yj,`\\$&`)}function Qj(e){return RegExp(`^(?:`+e.map(Zj).join(`|`)+`)`,`i`)}function $j(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function eM(e,t,n){var r=qj.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function tM(e,t,n){var r=qj.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function nM(e,t,n){var r=qj.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function rM(e,t,n){var r=qj.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function iM(e,t,n){var r=qj.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function aM(e,t,n){var r=qj.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function oM(e,t,n){var r=qj.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function sM(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 cM(e,t,n){var r=qj.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function lM(e,t,n){var r=qj.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function uM(e,t,n){var r=qj.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function dM(e,t,n){var r=qj.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function fM(e,t,n){var r=qj.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function pM(e,t,n){var r=qj.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function mM(e,t,n){var r=qj.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function hM(e,t,n){var r=qj.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function gM(e,t,n){var r=qj.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function _M(e,t,n){var r=Jj.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function vM(e,t,n){var r=qj.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function yM(e,t,n){var r=qj.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function bM(e,t){return Xj(e.getDate(),t,2)}function xM(e,t){return Xj(e.getHours(),t,2)}function SM(e,t){return Xj(e.getHours()%12||12,t,2)}function CM(e,t){return Xj(1+mj.count(Fj(e),e),t,3)}function wM(e,t){return Xj(e.getMilliseconds(),t,3)}function TM(e,t){return wM(e,t)+`000`}function EM(e,t){return Xj(e.getMonth()+1,t,2)}function DM(e,t){return Xj(e.getMinutes(),t,2)}function OM(e,t){return Xj(e.getSeconds(),t,2)}function kM(e){var t=e.getDay();return t===0?7:t}function AM(e,t){return Xj(vj.count(Fj(e)-1,e),t,2)}function jM(e){var t=e.getDay();return t>=4||t===0?Sj(e):Sj.ceil(e)}function MM(e,t){return e=jM(e),Xj(Sj.count(Fj(e),e)+(Fj(e).getDay()===4),t,2)}function NM(e){return e.getDay()}function PM(e,t){return Xj(yj.count(Fj(e)-1,e),t,2)}function FM(e,t){return Xj(e.getFullYear()%100,t,2)}function IM(e,t){return e=jM(e),Xj(e.getFullYear()%100,t,2)}function LM(e,t){return Xj(e.getFullYear()%1e4,t,4)}function RM(e,t){var n=e.getDay();return e=n>=4||n===0?Sj(e):Sj.ceil(e),Xj(e.getFullYear()%1e4,t,4)}function zM(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Xj(t/60|0,`0`,2)+Xj(t%60,`0`,2)}function BM(e,t){return Xj(e.getUTCDate(),t,2)}function VM(e,t){return Xj(e.getUTCHours(),t,2)}function HM(e,t){return Xj(e.getUTCHours()%12||12,t,2)}function UM(e,t){return Xj(1+hj.count(Ij(e),e),t,3)}function WM(e,t){return Xj(e.getUTCMilliseconds(),t,3)}function GM(e,t){return WM(e,t)+`000`}function KM(e,t){return Xj(e.getUTCMonth()+1,t,2)}function qM(e,t){return Xj(e.getUTCMinutes(),t,2)}function JM(e,t){return Xj(e.getUTCSeconds(),t,2)}function YM(e){var t=e.getUTCDay();return t===0?7:t}function XM(e,t){return Xj(Ej.count(Ij(e)-1,e),t,2)}function ZM(e){var t=e.getUTCDay();return t>=4||t===0?Aj(e):Aj.ceil(e)}function QM(e,t){return e=ZM(e),Xj(Aj.count(Ij(e),e)+(Ij(e).getUTCDay()===4),t,2)}function $M(e){return e.getUTCDay()}function eN(e,t){return Xj(Dj.count(Ij(e)-1,e),t,2)}function tN(e,t){return Xj(e.getUTCFullYear()%100,t,2)}function nN(e,t){return e=ZM(e),Xj(e.getUTCFullYear()%100,t,2)}function rN(e,t){return Xj(e.getUTCFullYear()%1e4,t,4)}function iN(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Aj(e):Aj.ceil(e),Xj(e.getUTCFullYear()%1e4,t,4)}function aN(){return`+0000`}function oN(){return`%`}function sN(e){return+e}function cN(e){return Math.floor(e/1e3)}var lN,uN,dN;fN({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 fN(e){return lN=Gj(e),uN=lN.format,lN.parse,dN=lN.utcFormat,lN.utcParse,lN}function pN(e){return new Date(e)}function mN(e){return e instanceof Date?+e:+new Date(+e)}function hN(e,t,n,r,i,a,o,s,c,l){var u=Xk(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,mN)):f().map(pN)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(TA(n,e)):u},u.copy=function(){return Jk(u,hN(e,t,n,r,i,a,o,s,c,l))},u}function gN(){return OO.apply(hN(Bj,Vj,Fj,Nj,vj,mj,fj,uj,lj,uN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function _N(){return OO.apply(hN(Rj,zj,Ij,Pj,Ej,hj,pj,dj,lj,dN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function vN(){var e=0,t=1,n,r,i,a,o=Uk,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(Lk),l.rangeRound=u(Rk),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function yN(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function bN(){var e=SA(vN()(Uk));return e.copy=function(){return yN(e,bN())},kO.apply(e,arguments)}function xN(){var e=PA(vN()).domain([1,10]);return e.copy=function(){return yN(e,xN()).base(e.base())},kO.apply(e,arguments)}function SN(){var e=RA(vN());return e.copy=function(){return yN(e,SN()).constant(e.constant())},kO.apply(e,arguments)}function CN(){var e=UA(vN());return e.copy=function(){return yN(e,CN()).exponent(e.exponent())},kO.apply(e,arguments)}function wN(){return CN.apply(null,arguments).exponent(.5)}function TN(){var e=[],t=Uk;function n(n){if(n!=null&&!isNaN(n=+n))return t((oO(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort($D),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>TO(e,r/t))},n.copy=function(){return TN(t).domain(e)},kO.apply(n,arguments)}function EN(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=Uk,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=zk(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m(Lk),p.rangeRound=m(Rk),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function DN(){var e=SA(EN()(Uk));return e.copy=function(){return yN(e,DN())},kO.apply(e,arguments)}function ON(){var e=PA(EN()).domain([.1,1,10]);return e.copy=function(){return yN(e,ON()).base(e.base())},kO.apply(e,arguments)}function kN(){var e=RA(EN());return e.copy=function(){return yN(e,kN()).constant(e.constant())},kO.apply(e,arguments)}function AN(){var e=UA(EN());return e.copy=function(){return yN(e,AN()).exponent(e.exponent())},kO.apply(e,arguments)}function jN(){return AN.apply(null,arguments).exponent(.5)}var MN=s({scaleBand:()=>MO,scaleDiverging:()=>DN,scaleDivergingLog:()=>ON,scaleDivergingPow:()=>AN,scaleDivergingSqrt:()=>jN,scaleDivergingSymlog:()=>kN,scaleIdentity:()=>wA,scaleImplicit:()=>AO,scaleLinear:()=>CA,scaleLog:()=>FA,scaleOrdinal:()=>jO,scalePoint:()=>PO,scalePow:()=>WA,scaleQuantile:()=>YA,scaleQuantize:()=>XA,scaleRadial:()=>JA,scaleSequential:()=>bN,scaleSequentialLog:()=>xN,scaleSequentialPow:()=>CN,scaleSequentialQuantile:()=>TN,scaleSequentialSqrt:()=>wN,scaleSequentialSymlog:()=>SN,scaleSqrt:()=>GA,scaleSymlog:()=>zA,scaleThreshold:()=>ZA,scaleTime:()=>gN,scaleUtc:()=>_N,tickFormat:()=>xA}),NN=o(((e,t)=>{var n=by();function r(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===void 0?s===s&&!n(s):r(s,c)))var c=s,l=o}return l}t.exports=r})),PN=o(((e,t)=>{function n(e,t){return e>t}t.exports=n})),FN=o(((e,t)=>{var n=NN(),r=PN(),i=_w();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),IN=o(((e,t)=>{function n(e,t){return e<t}t.exports=n})),LN=o(((e,t)=>{var n=NN(),r=IN(),i=_w();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),RN=o(((e,t)=>{var n=rb(),r=xw(),i=lT(),a=fy();function o(e,t){return(a(e)?n:i)(e,r(t,3))}t.exports=o})),zN=o(((e,t)=>{var n=rT(),r=RN();function i(e,t){return n(r(e,t),1)}t.exports=i})),BN=o(((e,t)=>{var n=sw();function r(e,t){return n(e,t)}t.exports=r})),VN=o(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=+(e[n]<t[n]),e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(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=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i)t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;else{if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,e===void 0&&(e={}),e)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`LN10`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0){if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i)}if((i=e[r=`LN10`])!==void 0){if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i)}return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}));function HN(e){return KN(e)||GN(e)||WN(e)||UN()}function UN(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
67
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WN(e,t){if(e){if(typeof e==`string`)return qN(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 qN(e,t)}}function GN(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function KN(e){if(Array.isArray(e))return qN(e)}function qN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var JN=function(e){return e},YN={"@@functional/placeholder":!0},XN=function(e){return e===YN},ZN=function(e){return function t(){return arguments.length===0||arguments.length===1&&XN(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},QN=function e(t,n){return t===1?n:ZN(function(){var r=[...arguments],i=r.filter(function(e){return e!==YN}).length;return i>=t?n.apply(void 0,r):e(t-i,ZN(function(){var e=[...arguments],t=r.map(function(t){return XN(t)?e.shift():t});return n.apply(void 0,HN(t).concat(e))}))})},$N=function(e){return QN(e.length,e)},eP=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},tP=$N(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),nP=function(){var e=[...arguments];if(!e.length)return JN;var t=e.reverse(),n=t[0],r=t.slice(1);return function(){return r.reduce(function(e,t){return t(e)},n.apply(void 0,arguments))}},rP=function(e){return Array.isArray(e)?e.reverse():e.split(``).reverse.join(``)},iP=function(e){var t=null,n=null;return function(){var r=[...arguments];return t&&r.every(function(e,n){return e===t[n]})||(t=r,n=e.apply(void 0,r)),n}},aP=l(VN());function oP(e){return e===0?1:Math.floor(new aP.default(e).abs().log(10).toNumber())+1}function sP(e,t,n){for(var r=new aP.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var cP={rangeStep:sP,getDigitCount:oP,interpolateNumber:$N(function(e,t,n){var r=+e;return r+n*(+t-r)}),uninterpolateNumber:$N(function(e,t,n){var r=t-+e;return r||=1/0,(n-e)/r}),uninterpolateTruncation:$N(function(e,t,n){var r=t-+e;return r||=1/0,Math.max(0,Math.min(1,(n-e)/r))})};function lP(e){return fP(e)||dP(e)||hP(e)||uP()}function uP(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
68
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dP(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function fP(e){if(Array.isArray(e))return gP(e)}function pP(e,t){return vP(e)||_P(e,t)||hP(e,t)||mP()}function mP(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
69
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hP(e,t){if(e){if(typeof e==`string`)return gP(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 gP(e,t)}}function gP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _P(e,t){if(typeof Symbol<`u`&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function vP(e){if(Array.isArray(e))return e}function yP(e){var t=pP(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function bP(e,t,n){if(e.lte(0))return new aP.default(0);var r=cP.getDigitCount(e.toNumber()),i=new aP.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new aP.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?s:new aP.default(Math.ceil(s))}function xP(e,t,n){var r=1,i=new aP.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new aP.default(10).pow(cP.getDigitCount(e)-1),i=new aP.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new aP.default(Math.floor(e)))}else e===0?i=new aP.default(Math.floor((t-1)/2)):n||(i=new aP.default(Math.floor(e)));var o=Math.floor((t-1)/2);return nP(tP(function(e){return i.add(new aP.default(e-o).mul(r)).toNumber()}),eP)(0,t)}function SP(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new aP.default(0),tickMin:new aP.default(0),tickMax:new aP.default(0)};var a=bP(new aP.default(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new aP.default(0):(o=new aP.default(e).add(t).div(2),o=o.sub(new aP.default(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new aP.default(t).sub(o).div(a).toNumber()),l=s+c+1;return l>n?SP(e,t,n,r,i+1):(l<n&&(c=t>0?c+(n-l):c,s=t>0?s:s+(n-l)),{step:a,tickMin:o.sub(new aP.default(s).mul(a)),tickMax:o.add(new aP.default(c).mul(a))})}function CP(e){var t=pP(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=pP(yP([n,r]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0){var u=l===1/0?[c].concat(lP(eP(0,i-1).map(function(){return 1/0}))):[].concat(lP(eP(0,i-1).map(function(){return-1/0})),[l]);return n>r?rP(u):u}if(c===l)return xP(c,i,a);var d=SP(c,l,o,a),f=d.step,p=d.tickMin,m=d.tickMax,h=cP.rangeStep(p,m.add(new aP.default(.1).mul(f)),f);return n>r?rP(h):h}function wP(e,t){var n=pP(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=pP(yP([r,i]),2),s=o[0],c=o[1];if(s===-1/0||c===1/0)return[r,i];if(s===c)return[s];var l=Math.max(t,2),u=bP(new aP.default(c).sub(s).div(l-1),a,0),d=[].concat(lP(cP.rangeStep(new aP.default(s),new aP.default(c).sub(new aP.default(.99).mul(u)),u)),[c]);return r>i?rP(d):d}var TP=iP(CP),EP=iP(wP),DP=`Invariant failed`;function OP(e,t){if(!e)throw Error(DP)}var kP=[`offset`,`layout`,`width`,`dataKey`,`data`,`dataPointFormatter`,`xAxis`,`yAxis`];function AP(e){"@babel/helpers - typeof";return AP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},AP(e)}function jP(){return jP=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},jP.apply(this,arguments)}function MP(e,t){return LP(e)||IP(e,t)||PP(e,t)||NP()}function NP(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PP(e,t){if(e){if(typeof e==`string`)return FP(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 FP(e,t)}}function FP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function IP(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function LP(e){if(Array.isArray(e))return e}function RP(e,t){if(e==null)return{};var n=zP(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zP(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 BP(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function VP(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,ZP(r.key),r)}}function HP(e,t,n){return t&&VP(e.prototype,t),n&&VP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function UP(e,t,n){return t=qP(t),WP(e,KP()?Reflect.construct(t,n||[],qP(e).constructor):t.apply(e,n))}function WP(e,t){if(t&&(AP(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return GP(e)}function GP(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function KP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KP=function(){return!!e})()}function qP(e){return qP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qP(e)}function JP(e,t){if(typeof t!=`function`&&t!==null)throw 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&&YP(e,t)}function YP(e,t){return YP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},YP(e,t)}function XP(e,t,n){return t=ZP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZP(e){var t=QP(e,`string`);return AP(t)==`symbol`?t:t+``}function QP(e,t){if(AP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(AP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $P=function(e){function t(){return BP(this,t),UP(this,t,arguments)}return JP(t,e),HP(t,[{key:`render`,value:function(){var e=this.props,t=e.offset,n=e.layout,r=e.width,i=e.dataKey,a=e.data,o=e.dataPointFormatter,s=e.xAxis,c=e.yAxis,l=lx(RP(e,kP),!1);this.props.direction===`x`&&s.type!==`number`&&OP(!1);var u=a.map(function(e){var a=o(e,i),u=a.x,d=a.y,f=a.value,p=a.errorVal;if(!p)return null;var m=[],h,g;if(Array.isArray(p)){var v=MP(p,2);h=v[0],g=v[1]}else h=g=p;if(n===`vertical`){var y=s.scale,b=d+t,x=b+r,S=b-r,C=y(f-h),w=y(f+g);m.push({x1:w,y1:x,x2:w,y2:S}),m.push({x1:C,y1:b,x2:w,y2:b}),m.push({x1:C,y1:x,x2:C,y2:S})}else if(n===`horizontal`){var T=c.scale,E=u+t,D=E-r,O=E+r,k=T(f-h),A=T(f+g);m.push({x1:D,y1:A,x2:O,y2:A}),m.push({x1:E,y1:k,x2:E,y2:A}),m.push({x1:D,y1:k,x2:O,y2:k})}return _.createElement(wx,jP({className:`recharts-errorBar`,key:`bar-${m.map(function(e){return`${e.x1}-${e.x2}-${e.y1}-${e.y2}`})}`},l),m.map(function(e){return _.createElement(`line`,jP({},e,{key:`line-${e.x1}-${e.x2}-${e.y1}-${e.y2}`}))}))});return _.createElement(wx,{className:`recharts-errorBars`},u)}}])}(_.Component);XP($P,`defaultProps`,{stroke:`black`,strokeWidth:1.5,width:5,offset:0,layout:`horizontal`}),XP($P,`displayName`,`ErrorBar`);function eF(e){"@babel/helpers - typeof";return eF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},eF(e)}function tF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tF(Object(n),!0).forEach(function(t){rF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rF(e,t,n){return t=iF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iF(e){var t=aF(e,`string`);return eF(t)==`symbol`?t:t+``}function aF(e,t){if(eF(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(eF(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var oF=function(e){var t=e.children,n=e.formattedGraphicalItems,r=e.legendWidth,i=e.legendContent,a=rx(t,tT);if(!a)return null;var o=tT.defaultProps,s=o===void 0?{}:nF(nF({},o),a.props),c=a.props&&a.props.payload?a.props&&a.props.payload:i===`children`?(n||[]).reduce(function(e,t){var n=t.item,r=t.props,i=r.sectors||r.data||[];return e.concat(i.map(function(e){return{type:a.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(n||[]).map(function(e){var t=e.item,n=t.type.defaultProps,r=n===void 0?{}:nF(nF({},n),t.props),i=r.dataKey,a=r.name,o=r.legendType;return{inactive:r.hide,dataKey:i,type:s.iconType||o||`square`,color:EF(t),value:a||i,payload:r}});return nF(nF(nF({},s),tT.getWithHeight(a,r)),{},{payload:c,item:a})},sF=l(FN()),cF=l(LN()),lF=l(zN()),uF=l(BN());function dF(e){"@babel/helpers - typeof";return dF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},dF(e)}function fF(e){return gF(e)||hF(e)||mF(e)||pF()}function pF(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
71
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mF(e,t){if(e){if(typeof e==`string`)return _F(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 _F(e,t)}}function hF(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function gF(e){if(Array.isArray(e))return _F(e)}function _F(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vF(Object(n),!0).forEach(function(t){bF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bF(e,t,n){return t=xF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xF(e){var t=SF(e,`string`);return dF(t)==`symbol`?t:t+``}function SF(e,t){if(dF(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(dF(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function CF(e,t,n){return(0,bb.default)(e)||(0,bb.default)(t)?n:wb(t)?(0,vb.default)(e,t,n):(0,Wb.default)(t)?t(e):n}function wF(e,t,n,r){var i=(0,lF.default)(e,function(e){return CF(e,t)});if(n===`number`){var a=i.filter(function(e){return X(e)||parseFloat(e)});return a.length?[(0,cF.default)(a),(0,sF.default)(a)]:[1/0,-1/0]}return(r?i.filter(function(e){return!(0,bb.default)(e)}):i).map(function(e){return wb(e)||e instanceof Date?e:``})}var TF=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=-1,a=t?.length??0;if(a<=1)return 0;if(r&&r.axisType===`angleAxis`&&Math.abs(Math.abs(r.range[1]-r.range[0])-360)<=1e-6)for(var o=r.range,s=0;s<a;s++){var c=s>0?n[s-1].coordinate:n[a-1].coordinate,l=n[s].coordinate,u=s>=a-1?n[0].coordinate:n[s+1].coordinate,d=void 0;if(xb(l-c)!==xb(u-l)){var f=[];if(xb(u-l)===xb(o[1]-o[0])){d=u;var p=l+o[1]-o[0];f[0]=Math.min(p,(p+c)/2),f[1]=Math.max(p,(p+c)/2)}else{d=c;var m=u+o[1]-o[0];f[0]=Math.min(l,(m+l)/2),f[1]=Math.max(l,(m+l)/2)}var h=[Math.min(l,(d+l)/2),Math.max(l,(d+l)/2)];if(e>h[0]&&e<=h[1]||e>=f[0]&&e<=f[1]){i=n[s].index;break}}else{var g=Math.min(c,u),_=Math.max(c,u);if(e>(g+l)/2&&e<=(_+l)/2){i=n[s].index;break}}}else for(var v=0;v<a;v++)if(v===0&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v>0&&v<a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v===a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2){i=t[v].index;break}return i},EF=function(e){var t,n=e.type.displayName,r=(t=e.type)!=null&&t.defaultProps?yF(yF({},e.type.defaultProps),e.props):e.props,i=r.stroke,a=r.fill,o;switch(n){case`Line`:o=i;break;case`Area`:case`Radar`:o=i&&i!==`none`?i:a;break;default:o=a}return o},DF=function(e){var t=e.barSize,n=e.totalSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},o=Object.keys(i),s=0,c=o.length;s<c;s++)for(var l=i[o[s]].stackGroups,u=Object.keys(l),d=0,f=u.length;d<f;d++){var p=l[u[d]],m=p.items,h=p.cateAxisId,g=m.filter(function(e){return Qb(e.type).indexOf(`Bar`)>=0});if(g&&g.length){var _=g[0].type.defaultProps,v=_===void 0?g[0].props:yF(yF({},_),g[0].props),y=v.barSize,b=v[h];a[b]||(a[b]=[]);var x=(0,bb.default)(y)?t:y;a[b].push({item:g[0],stackList:g.slice(1),barSize:(0,bb.default)(x)?void 0:Db(x,n,0)})}}return a},OF=function(e){var t=e.barGap,n=e.barCategoryGap,r=e.bandSize,i=e.sizeList,a=i===void 0?[]:i,o=e.maxBarSize,s=a.length;if(s<1)return null;var c=Db(t,r,0,!0),l,u=[];if(a[0].barSize===+a[0].barSize){var d=!1,f=r/s,p=a.reduce(function(e,t){return e+t.barSize||0},0);p+=(s-1)*c,p>=r&&(p-=(s-1)*c,c=0),p>=r&&f>0&&(d=!0,f*=.9,p=s*f);var m={offset:((r-p)/2|0)-c,size:0};l=a.reduce(function(e,t){var n={item:t.item,position:{offset:m.offset+m.size+c,size:d?f:t.barSize}},r=[].concat(fF(e),[n]);return m=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:m})}),r},u)}else{var h=Db(n,r,0,!0);r-2*h-(s-1)*c<=0&&(c=0);var g=(r-2*h-(s-1)*c)/s;g>1&&(g>>=0);var _=o===+o?Math.min(g,o):g;l=a.reduce(function(e,t,n){var r=[].concat(fF(e),[{item:t.item,position:{offset:h+(g+c)*n+(g-_)/2,size:_}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return l},kF=function(e,t,n,r){var i=n.children,a=n.width,o=n.margin,s=oF({children:i,legendWidth:a-(o.left||0)-(o.right||0)});if(s){var c=r||{},l=c.width,u=c.height,d=s.align,f=s.verticalAlign,p=s.layout;if((p===`vertical`||p===`horizontal`&&f===`middle`)&&d!==`center`&&X(e[d]))return yF(yF({},e),{},bF({},d,e[d]+(l||0)));if((p===`horizontal`||p===`vertical`&&d===`center`)&&f!==`middle`&&X(e[f]))return yF(yF({},e),{},bF({},f,e[f]+(u||0)))}return e},AF=function(e,t,n){return(0,bb.default)(t)?!0:e===`horizontal`?t===`yAxis`:e===`vertical`||n===`x`?t===`xAxis`:n!==`y`||t===`yAxis`},jF=function(e,t,n,r,i){var a=t.props.children,o=nx(a,$P).filter(function(e){return AF(r,i,e.props.direction)});if(o&&o.length){var s=o.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=CF(t,n);if((0,bb.default)(r))return e;var i=Array.isArray(r)?[(0,cF.default)(r),(0,sF.default)(r)]:[r,r],a=s.reduce(function(e,n){var r=CF(t,n,0),a=i[0]-Math.abs(Array.isArray(r)?r[0]:r),o=i[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(a,e[0]),Math.max(o,e[1])]},[1/0,-1/0]);return[Math.min(a[0],e[0]),Math.max(a[1],e[1])]},[1/0,-1/0])}return null},MF=function(e,t,n,r,i){var a=t.map(function(t){return jF(e,t,n,i,r)}).filter(function(e){return!(0,bb.default)(e)});return a&&a.length?a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},NF=function(e,t,n,r,i){var a=t.map(function(t){var a=t.props.dataKey;return n===`number`&&a&&jF(e,t,a,r)||wF(e,a,n,i)});if(n===`number`)return a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var o={};return a.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)o[t[n]]||(o[t[n]]=!0,e.push(t[n]));return e},[])},PF=function(e,t){return e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`},FF=function(e,t,n){if(!e)return null;var r=e.scale,i=e.duplicateDomain,a=e.type,o=e.range,s=e.realScaleType===`scaleBand`?r.bandwidth()/2:2,c=(t||n)&&a===`category`&&r.bandwidth?r.bandwidth()/s:0;return c=e.axisType===`angleAxis`&&o?.length>=2?xb(o[0]-o[1])*2*c:c,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(i?i.indexOf(e):e)+c,value:e,offset:c}}).filter(function(e){return!(0,_b.default)(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+c,value:e,index:t,offset:c}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+c,value:e,offset:c}}):r.domain().map(function(e,t){return{coordinate:r(e)+c,value:i?i[e]:e,index:t,offset:c}})},IF=new WeakMap,LF=function(e,t){if(typeof t!=`function`)return e;IF.has(e)||IF.set(e,new WeakMap);var n=IF.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},RF=function(e,t,n){var r=e.scale,i=e.type,a=e.layout,o=e.axisType;if(r===`auto`)return a===`radial`&&o===`radiusAxis`?{scale:MO(),realScaleType:`band`}:a===`radial`&&o===`angleAxis`?{scale:CA(),realScaleType:`linear`}:i===`category`&&t&&(t.indexOf(`LineChart`)>=0||t.indexOf(`AreaChart`)>=0||t.indexOf(`ComposedChart`)>=0&&!n)?{scale:PO(),realScaleType:`point`}:i===`category`?{scale:MO(),realScaleType:`band`}:{scale:CA(),realScaleType:`linear`};if((0,gb.default)(r)){var s=`scale${(0,nC.default)(r)}`;return{scale:(MN[s]||PO)(),realScaleType:MN[s]?s:`point`}}return(0,Wb.default)(r)?{scale:r}:{scale:PO(),realScaleType:`point`}},zF=1e-4,BF=function(e){var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,r=e.range(),i=Math.min(r[0],r[1])-zF,a=Math.max(r[0],r[1])+zF,o=e(t[0]),s=e(t[n-1]);(o<i||o>a||s<i||s>a)&&e.domain([t[0],t[n-1]])}},VF=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},HF=function(e,t){if(!t||t.length!==2||!X(t[0])||!X(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!X(e[0])||e[0]<n)&&(i[0]=n),(!X(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},UF={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0,o=0;o<t;++o){var s=(0,_b.default)(e[o][n][1])?e[o][n][0]:e[o][n][1];s>=0?(e[o][n][0]=i,e[o][n][1]=i+s,i=e[o][n][1]):(e[o][n][0]=a,e[o][n][1]=a+s,a=e[o][n][1])}},expand:$S,none:JS,silhouette:eC,wiggle:tC,positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0;a<t;++a){var o=(0,_b.default)(e[a][n][1])?e[a][n][0]:e[a][n][1];o>=0?(e[a][n][0]=i,e[a][n][1]=i+o,i=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}}},WF=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),i=UF[n];return QS().keys(r).value(function(e,t){return+CF(e,t,0)}).order(YS).offset(i)(e)},GF=function(e,t,n,r,i,a){if(!e)return null;var o=(a?t.reverse():t).reduce(function(e,t){var i,a=(i=t.type)!=null&&i.defaultProps?yF(yF({},t.type.defaultProps),t.props):t.props,o=a.stackId;if(a.hide)return e;var s=a[n],c=e[s]||{hasStack:!1,stackGroups:{}};if(wb(o)){var l=c.stackGroups[o]||{numericAxisId:n,cateAxisId:r,items:[]};l.items.push(t),c.hasStack=!0,c.stackGroups[o]=l}else c.stackGroups[Eb(`_stackId_`)]={numericAxisId:n,cateAxisId:r,items:[t]};return yF(yF({},e),{},bF({},s,c))},{});return Object.keys(o).reduce(function(t,a){var s=o[a];return s.hasStack&&(s.stackGroups=Object.keys(s.stackGroups).reduce(function(t,a){var o=s.stackGroups[a];return yF(yF({},t),{},bF({},a,{numericAxisId:n,cateAxisId:r,items:o.items,stackedData:WF(e,o.items,i)}))},{})),yF(yF({},t),{},bF({},a,s))},{})},KF=function(e,t){var n=t.realScaleType,r=t.type,i=t.tickCount,a=t.originalDomain,o=t.allowDecimals,s=n||t.scale;if(s!==`auto`&&s!==`linear`)return null;if(i&&r===`number`&&a&&(a[0]===`auto`||a[1]===`auto`)){var c=e.domain();if(!c.length)return null;var l=TP(c,i,o);return e.domain([(0,cF.default)(l),(0,sF.default)(l)]),{niceTicks:l}}return i&&r===`number`?{niceTicks:EP(e.domain(),i,o)}:null};function qF(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!(0,bb.default)(i[t.dataKey])){var s=jb(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=CF(i,(0,bb.default)(o)?t.dataKey:o);return(0,bb.default)(c)?null:t.scale(c)}var JF=function(e){var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=CF(a,t.dataKey,t.domain[o]);return(0,bb.default)(s)?null:t.scale(s)-i/2+r},YF=function(e){var t=e.numericAxis,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},XF=function(e,t){var n,r=((n=e.type)!=null&&n.defaultProps?yF(yF({},e.type.defaultProps),e.props):e.props).stackId;if(wb(r)){var i=t[r];if(i){var a=i.items.indexOf(e);return a>=0?i.stackedData[a]:null}}return null},ZF=function(e){return e.reduce(function(e,t){return[(0,cF.default)(t.concat([e[0]]).filter(X)),(0,sF.default)(t.concat([e[1]]).filter(X))]},[1/0,-1/0])},QF=function(e,t,n){return Object.keys(e).reduce(function(r,i){var a=e[i].stackedData.reduce(function(e,r){var i=ZF(r.slice(t,n+1));return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(a[0],r[0]),Math.max(a[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},$F=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,eI=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,tI=function(e,t,n){if((0,Wb.default)(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if(X(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if($F.test(e[0])){var i=+$F.exec(e[0])[1];r[0]=t[0]-i}else r[0]=(0,Wb.default)(e[0])?e[0](t[0]):t[0];if(X(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(eI.test(e[1])){var a=+eI.exec(e[1])[1];r[1]=t[1]+a}else r[1]=(0,Wb.default)(e[1])?e[1](t[1]):t[1];return r},nI=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,yT.default)(t,function(e){return e.coordinate}),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c.coordinate||0)-(l.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},rI=function(e,t,n){return!e||!e.length||(0,uF.default)(e,(0,vb.default)(n,`type.defaultProps.domain`))?t:e},iI=function(e,t){var n=e.type.defaultProps?yF(yF({},e.type.defaultProps),e.props):e.props,r=n.dataKey,i=n.name,a=n.unit,o=n.formatter,s=n.tooltipType,c=n.chartType,l=n.hide;return yF(yF({},lx(e,!1)),{},{dataKey:r,unit:a,formatter:o,name:i||r,color:EF(e),value:CF(t,r),type:s,payload:t,chartType:c,hide:l})};function aI(e){"@babel/helpers - typeof";return aI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},aI(e)}function oI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oI(Object(n),!0).forEach(function(t){cI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cI(e,t,n){return t=lI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lI(e){var t=uI(e,`string`);return aI(t)==`symbol`?t:t+``}function uI(e,t){if(aI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(aI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dI(e,t){return gI(e)||hI(e,t)||pI(e,t)||fI()}function fI(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
72
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pI(e,t){if(e){if(typeof e==`string`)return mI(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 mI(e,t)}}function mI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hI(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function gI(e){if(Array.isArray(e))return e}var _I=Math.PI/180,vI=function(e){return e*180/Math.PI},yI=function(e,t,n,r){return{x:e+Math.cos(-_I*r)*n,y:t+Math.sin(-_I*r)*n}},bI=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},xI=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.startAngle,c=e.endAngle,l=Db(e.cx,a,a/2),u=Db(e.cy,o,o/2),d=bI(a,o,n),f=Db(e.innerRadius,d,0),p=Db(e.outerRadius,d,d*.8);return Object.keys(t).reduce(function(e,n){var a=t[n],o=a.domain,d=a.reversed,m;if((0,bb.default)(a.range))r===`angleAxis`?m=[s,c]:r===`radiusAxis`&&(m=[f,p]),d&&(m=[m[1],m[0]]);else{m=a.range;var h=dI(m,2);s=h[0],c=h[1]}var g=RF(a,i),_=g.realScaleType,v=g.scale;v.domain(o).range(m),BF(v);var y=KF(v,sI(sI({},a),{},{realScaleType:_})),b=sI(sI(sI({},a),y),{},{range:m,radius:p,realScaleType:_,scale:v,cx:l,cy:u,innerRadius:f,outerRadius:p,startAngle:s,endAngle:c});return sI(sI({},e),{},cI({},n,b))},{})},SI=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},CI=function(e,t){var n=e.x,r=e.y,i=t.cx,a=t.cy,o=SI({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:vI(c),angleInRadian:c}},wI=function(e){var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},TI=function(e,t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},EI=function(e,t){var n=e.x,r=e.y,i=CI({x:n,y:r},t),a=i.radius,o=i.angle,s=t.innerRadius,c=t.outerRadius;if(a<s||a>c)return!1;if(a===0)return!0;var l=wI(t),u=l.startAngle,d=l.endAngle,f=o,p;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;p=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;p=f>=d&&f<=u}return p?sI(sI({},t),{},{radius:a,angle:TI(f,t)}):null},DI=function(e){return!(0,_.isValidElement)(e)&&!(0,Wb.default)(e)&&typeof e!=`boolean`?e.className:``};function OI(e){"@babel/helpers - typeof";return OI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},OI(e)}var kI=[`offset`];function AI(e){return PI(e)||NI(e)||MI(e)||jI()}function jI(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
73
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MI(e,t){if(e){if(typeof e==`string`)return FI(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 FI(e,t)}}function NI(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function PI(e){if(Array.isArray(e))return FI(e)}function FI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function II(e,t){if(e==null)return{};var n=LI(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function LI(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 RI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?RI(Object(n),!0).forEach(function(t){BI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function BI(e,t,n){return t=VI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VI(e){var t=HI(e,`string`);return OI(t)==`symbol`?t:t+``}function HI(e,t){if(OI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(OI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function UI(){return UI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UI.apply(this,arguments)}var WI=function(e){var t=e.value,n=e.formatter,r=(0,bb.default)(e.children)?t:e.children;return(0,Wb.default)(n)?n(r):r},GI=function(e,t){return xb(t-e)*Math.min(Math.abs(t-e),360)},KI=function(e,t,n){var r=e.position,i=e.viewBox,a=e.offset,o=e.className,s=i,c=s.cx,l=s.cy,u=s.innerRadius,d=s.outerRadius,f=s.startAngle,p=s.endAngle,m=s.clockWise,h=(u+d)/2,g=GI(f,p),v=g>=0?1:-1,y,b;r===`insideStart`?(y=f+v*a,b=m):r===`insideEnd`?(y=p-v*a,b=!m):r===`end`&&(y=p+v*a,b=m),b=g<=0?b:!b;var x=yI(c,l,h,y),S=yI(c,l,h,y+(b?1:-1)*359),C=`M${x.x},${x.y}
|
|
74
|
-
A${h},${h},0,1,${+!b},
|
|
75
|
-
${S.x},${S.y}`,w=(0,bb.default)(e.id)?Eb(`recharts-radial-line-`):e.id;return _.createElement(`text`,UI({},n,{dominantBaseline:`central`,className:Vt(`recharts-radial-bar-label`,o)}),_.createElement(`defs`,null,_.createElement(`path`,{id:w,d:C})),_.createElement(`textPath`,{xlinkHref:`#${w}`},t))},qI=function(e){var t=e.viewBox,n=e.offset,r=e.position,i=t,a=i.cx,o=i.cy,s=i.innerRadius,c=i.outerRadius,l=(i.startAngle+i.endAngle)/2;if(r===`outside`){var u=yI(a,o,c+n,l),d=u.x;return{x:d,y:u.y,textAnchor:d>=a?`start`:`end`,verticalAnchor:`middle`}}if(r===`center`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`middle`};if(r===`centerTop`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`start`};if(r===`centerBottom`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`end`};var f=yI(a,o,(s+c)/2,l);return{x:f.x,y:f.y,textAnchor:`middle`,verticalAnchor:`middle`}},JI=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,i=e.position,a=t,o=a.x,s=a.y,c=a.width,l=a.height,u=l>=0?1:-1,d=u*r,f=u>0?`end`:`start`,p=u>0?`start`:`end`,m=c>=0?1:-1,h=m*r,g=m>0?`end`:`start`,_=m>0?`start`:`end`;if(i===`top`)return zI(zI({},{x:o+c/2,y:s-u*r,textAnchor:`middle`,verticalAnchor:f}),n?{height:Math.max(s-n.y,0),width:c}:{});if(i===`bottom`)return zI(zI({},{x:o+c/2,y:s+l+d,textAnchor:`middle`,verticalAnchor:p}),n?{height:Math.max(n.y+n.height-(s+l),0),width:c}:{});if(i===`left`){var v={x:o-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`};return zI(zI({},v),n?{width:Math.max(v.x-n.x,0),height:l}:{})}if(i===`right`){var y={x:o+c+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`};return zI(zI({},y),n?{width:Math.max(n.x+n.width-y.x,0),height:l}:{})}var b=n?{width:c,height:l}:{};return i===`insideLeft`?zI({x:o+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`},b):i===`insideRight`?zI({x:o+c-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`},b):i===`insideTop`?zI({x:o+c/2,y:s+d,textAnchor:`middle`,verticalAnchor:p},b):i===`insideBottom`?zI({x:o+c/2,y:s+l-d,textAnchor:`middle`,verticalAnchor:f},b):i===`insideTopLeft`?zI({x:o+h,y:s+d,textAnchor:_,verticalAnchor:p},b):i===`insideTopRight`?zI({x:o+c-h,y:s+d,textAnchor:g,verticalAnchor:p},b):i===`insideBottomLeft`?zI({x:o+h,y:s+l-d,textAnchor:_,verticalAnchor:f},b):i===`insideBottomRight`?zI({x:o+c-h,y:s+l-d,textAnchor:g,verticalAnchor:f},b):(0,Pb.default)(i)&&(X(i.x)||Sb(i.x))&&(X(i.y)||Sb(i.y))?zI({x:o+Db(i.x,c),y:s+Db(i.y,l),textAnchor:`end`,verticalAnchor:`end`},b):zI({x:o+c/2,y:s+l/2,textAnchor:`middle`,verticalAnchor:`middle`},b)},YI=function(e){return`cx`in e&&X(e.cx)};function XI(e){var t=e.offset,n=t===void 0?5:t,r=II(e,kI),i=zI({offset:n},r),a=i.viewBox,o=i.position,s=i.value,c=i.children,l=i.content,u=i.className,d=u===void 0?``:u,f=i.textBreakAll;if(!a||(0,bb.default)(s)&&(0,bb.default)(c)&&!(0,_.isValidElement)(l)&&!(0,Wb.default)(l))return null;if((0,_.isValidElement)(l))return(0,_.cloneElement)(l,i);var p;if((0,Wb.default)(l)){if(p=(0,_.createElement)(l,i),(0,_.isValidElement)(p))return p}else p=WI(i);var m=YI(a),h=lx(i,!0);if(m&&(o===`insideStart`||o===`insideEnd`||o===`end`))return KI(i,p,h);var g=m?qI(i):JI(i);return _.createElement(QD,UI({className:Vt(`recharts-label`,d)},h,g,{breakAll:f}),p)}XI.displayName=`Label`;var ZI=function(e){var t=e.cx,n=e.cy,r=e.angle,i=e.startAngle,a=e.endAngle,o=e.r,s=e.radius,c=e.innerRadius,l=e.outerRadius,u=e.x,d=e.y,f=e.top,p=e.left,m=e.width,h=e.height,g=e.clockWise,_=e.labelViewBox;if(_)return _;if(X(m)&&X(h)){if(X(u)&&X(d))return{x:u,y:d,width:m,height:h};if(X(f)&&X(p))return{x:f,y:p,width:m,height:h}}return X(u)&&X(d)?{x:u,y:d,width:0,height:0}:X(t)&&X(n)?{cx:t,cy:n,startAngle:i||r||0,endAngle:a||r||0,innerRadius:c||0,outerRadius:l||s||o||0,clockWise:g}:e.viewBox?e.viewBox:{}},QI=function(e,t){return e?e===!0?_.createElement(XI,{key:`label-implicit`,viewBox:t}):wb(e)?_.createElement(XI,{key:`label-implicit`,viewBox:t,value:e}):(0,_.isValidElement)(e)?e.type===XI?(0,_.cloneElement)(e,{key:`label-implicit`,viewBox:t}):_.createElement(XI,{key:`label-implicit`,content:e,viewBox:t}):(0,Wb.default)(e)?_.createElement(XI,{key:`label-implicit`,content:e,viewBox:t}):(0,Pb.default)(e)?_.createElement(XI,UI({viewBox:t},e,{key:`label-implicit`})):null:null};XI.parseViewBox=ZI,XI.renderCallByParent=function(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,i=ZI(e),a=nx(r,XI).map(function(e,n){return(0,_.cloneElement)(e,{viewBox:t||i,key:`label-${n}`})});return n?[QI(e.label,t||i)].concat(AI(a)):a};var $I=l(o(((e,t)=>{function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}t.exports=n}))());function eL(e){"@babel/helpers - typeof";return eL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},eL(e)}var tL=[`valueAccessor`],nL=[`data`,`dataKey`,`clockWise`,`id`,`textBreakAll`];function rL(e){return sL(e)||oL(e)||aL(e)||iL()}function iL(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
76
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aL(e,t){if(e){if(typeof e==`string`)return cL(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 cL(e,t)}}function oL(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function sL(e){if(Array.isArray(e))return cL(e)}function cL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lL(){return lL=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},lL.apply(this,arguments)}function uL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function dL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?uL(Object(n),!0).forEach(function(t){fL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fL(e,t,n){return t=pL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pL(e){var t=mL(e,`string`);return eL(t)==`symbol`?t:t+``}function mL(e,t){if(eL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(eL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hL(e,t){if(e==null)return{};var n=gL(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gL(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 _L=function(e){return Array.isArray(e.value)?(0,$I.default)(e.value):e.value};function vL(e){var t=e.valueAccessor,n=t===void 0?_L:t,r=hL(e,tL),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,c=r.textBreakAll,l=hL(r,nL);return!i||!i.length?null:_.createElement(wx,{className:`recharts-label-list`},i.map(function(e,t){var r=(0,bb.default)(a)?n(e,t):CF(e&&e.payload,a),i=(0,bb.default)(s)?{}:{id:`${s}-${t}`};return _.createElement(XI,lL({},lx(e,!0),l,i,{parentViewBox:e.parentViewBox,value:r,textBreakAll:c,viewBox:XI.parseViewBox((0,bb.default)(o)?e:dL(dL({},e),{},{clockWise:o})),key:`label-${t}`,index:t}))}))}vL.displayName=`LabelList`;function yL(e,t){return e?e===!0?_.createElement(vL,{key:`labelList-implicit`,data:t}):_.isValidElement(e)||(0,Wb.default)(e)?_.createElement(vL,{key:`labelList-implicit`,data:t,content:e}):(0,Pb.default)(e)?_.createElement(vL,lL({data:t},e,{key:`labelList-implicit`})):null:null}function bL(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,i=nx(r,vL).map(function(e,n){return(0,_.cloneElement)(e,{data:t,key:`labelList-${n}`})});return n?[yL(e.label,t)].concat(rL(i)):i}vL.renderCallByParent=bL;function xL(e){"@babel/helpers - typeof";return xL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},xL(e)}function SL(){return SL=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},SL.apply(this,arguments)}function CL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?CL(Object(n),!0).forEach(function(t){TL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TL(e,t,n){return t=EL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EL(e){var t=DL(e,`string`);return xL(t)==`symbol`?t:t+``}function DL(e,t){if(xL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(xL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var OL=function(e,t){return xb(t-e)*Math.min(Math.abs(t-e),359.999)},kL=function(e){var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,o=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,l=s*(o?1:-1)+r,u=Math.asin(s/l)/_I,d=c?i:i+a*u,f=yI(t,n,l,d),p=yI(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:yI(t,n,l*Math.cos(u*_I),m),theta:u}},AL=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=OL(a,o),c=a+s,l=yI(t,n,i,a),u=yI(t,n,i,c),d=`M ${l.x},${l.y}
|
|
77
|
-
A ${i},${i},0,
|
|
78
|
-
${+(Math.abs(s)>180)},${+(a>c)},
|
|
79
|
-
${u.x},${u.y}
|
|
80
|
-
`;if(r>0){var f=yI(t,n,r,a),p=yI(t,n,r,c);d+=`L ${p.x},${p.y}
|
|
81
|
-
A ${r},${r},0,
|
|
82
|
-
${+(Math.abs(s)>180)},${+(a<=c)},
|
|
83
|
-
${f.x},${f.y} Z`}else d+=`L ${t},${n} Z`;return d},jL=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,l=e.endAngle,u=xb(l-c),d=kL({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=kL({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),g=h.circleTangency,_=h.lineTangency,v=h.theta,y=s?Math.abs(c-l):Math.abs(c-l)-m-v;if(y<0)return o?`M ${p.x},${p.y}
|
|
84
|
-
a${a},${a},0,0,1,${a*2},0
|
|
85
|
-
a${a},${a},0,0,1,${-a*2},0
|
|
86
|
-
`:AL({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var b=`M ${p.x},${p.y}
|
|
87
|
-
A${a},${a},0,0,${+(u<0)},${f.x},${f.y}
|
|
88
|
-
A${i},${i},0,${+(y>180)},${+(u<0)},${g.x},${g.y}
|
|
89
|
-
A${a},${a},0,0,${+(u<0)},${_.x},${_.y}
|
|
90
|
-
`;if(r>0){var x=kL({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),S=x.circleTangency,C=x.lineTangency,w=x.theta,T=kL({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),E=T.circleTangency,D=T.lineTangency,O=T.theta,k=s?Math.abs(c-l):Math.abs(c-l)-w-O;if(k<0&&a===0)return`${b}L${t},${n}Z`;b+=`L${D.x},${D.y}
|
|
91
|
-
A${a},${a},0,0,${+(u<0)},${E.x},${E.y}
|
|
92
|
-
A${r},${r},0,${+(k>180)},${+(u>0)},${S.x},${S.y}
|
|
93
|
-
A${a},${a},0,0,${+(u<0)},${C.x},${C.y}Z`}else b+=`L${t},${n}Z`;return b},ML={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},NL=function(e){var t=wL(wL({},ML),e),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,u=t.endAngle,d=t.className;if(a<i||l===u)return null;var f=Vt(`recharts-sector`,d),p=a-i,m=Db(o,p,0,!0),h=m>0&&Math.abs(l-u)<360?jL({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:u}):AL({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:u});return _.createElement(`path`,SL({},lx(t,!0),{className:f,d:h,role:`img`}))};function PL(e){"@babel/helpers - typeof";return PL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},PL(e)}function FL(){return FL=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},FL.apply(this,arguments)}function IL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function LL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?IL(Object(n),!0).forEach(function(t){RL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function RL(e,t,n){return t=zL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zL(e){var t=BL(e,`string`);return PL(t)==`symbol`?t:t+``}function BL(e,t){if(PL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(PL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var VL={curveBasisClosed:DS,curveBasisOpen:kS,curveBasis:TS,curveBumpX:tS,curveBumpY:nS,curveLinearClosed:jS,curveLinear:Yx,curveMonotoneX:zS,curveMonotoneY:BS,curveNatural:US,curveStep:GS,curveStepAfter:qS,curveStepBefore:KS},HL=function(e){return e.x===+e.x&&e.y===+e.y},UL=function(e){return e.x},WL=function(e){return e.y},Vee=function(e,t){if((0,Wb.default)(e))return e;var n=`curve${(0,nC.default)(e)}`;return(n===`curveMonotone`||n===`curveBump`)&&t?VL[`${n}${t===`vertical`?`Y`:`X`}`]:VL[n]||Yx},Hee=function(e){var t=e.type,n=t===void 0?`linear`:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s!==void 0&&s,l=Vee(n,o),u=c?i.filter(function(e){return HL(e)}):i,d;if(Array.isArray(a)){var f=c?a.filter(function(e){return HL(e)}):a,p=u.map(function(e,t){return LL(LL({},e),{},{base:f[t]})});return d=o===`vertical`?$x().y(WL).x1(UL).x0(function(e){return e.base.x}):$x().x(UL).y1(WL).y0(function(e){return e.base.y}),d.defined(HL).curve(l),d(p)}return d=o===`vertical`&&X(a)?$x().y(WL).x1(UL).x0(a):X(a)?$x().x(UL).y1(WL).y0(a):Qx().x(UL).y(WL),d.defined(HL).curve(l),d(u)},GL=function(e){var t=e.className,n=e.points,r=e.path,i=e.pathRef;if((!n||!n.length)&&!r)return null;var a=n&&n.length?Hee(e):r;return _.createElement(`path`,FL({},lx(e,!1),Vb(e),{className:Vt(`recharts-curve`,t),d:a,ref:i}))},Uee=o(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Wee=o(((e,t)=>{var n=Uee();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Gee=o(((e,t)=>{t.exports=Wee()()})),{getOwnPropertyNames:Kee,getOwnPropertySymbols:qee}=Object,{hasOwnProperty:Jee}=Object.prototype;function KL(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function qL(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Yee(e){return e?.[Symbol.toStringTag]}function JL(e){return Kee(e).concat(qee(e))}var Xee=Object.hasOwn||((e,t)=>Jee.call(e,t));function YL(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Zee=`__v`,Qee=`__o`,$ee=`_owner`,{getOwnPropertyDescriptor:XL,keys:ZL}=Object;function ete(e,t){return e.byteLength===t.byteLength&&tR(new Uint8Array(e),new Uint8Array(t))}function tte(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 nte(e,t){return e.byteLength===t.byteLength&&tR(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function rte(e,t){return YL(e.getTime(),t.getTime())}function ite(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function ate(e,t){return e===t}function QL(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var ote=YL;function ste(e,t,n){let r=ZL(e),i=r.length;if(ZL(t).length!==i)return!1;for(;i-->0;)if(!nR(e,t,n,r[i]))return!1;return!0}function $L(e,t,n){let r=JL(e),i=r.length;if(JL(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!nR(e,t,n,a)||(o=XL(e,a),s=XL(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function cte(e,t){return YL(e.valueOf(),t.valueOf())}function lte(e,t){return e.source===t.source&&e.flags===t.flags}function eR(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function tR(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 ute(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 nR(e,t,n,r){return(r===$ee||r===Qee||r===Zee)&&(e.$$typeof||t.$$typeof)?!0:Xee(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var dte=`[object ArrayBuffer]`,fte=`[object Arguments]`,pte=`[object Boolean]`,rR=`[object DataView]`,iR=`[object Date]`,aR=`[object Error]`,oR=`[object Map]`,sR=`[object Number]`,cR=`[object Object]`,lR=`[object RegExp]`,uR=`[object Set]`,dR=`[object String]`,fR={"[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},pR=`[object URL]`,mR=Object.prototype.toString;function hR({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=mR.call(h);if(b===iR)return r(h,g,_);if(b===lR)return u(h,g,_);if(b===oR)return o(h,g,_);if(b===uR)return d(h,g,_);if(b===cR)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===pR)return p(h,g,_);if(b===aR)return i(h,g,_);if(b===fte)return c(h,g,_);if(fR[b])return f(h,g,_);if(b===dte)return e(h,g,_);if(b===rR)return n(h,g,_);if(b===pte||b===sR||b===dR)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Yee(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function gR({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ete,areArraysEqual:n?$L:tte,areDataViewsEqual:nte,areDatesEqual:rte,areErrorsEqual:ite,areFunctionsEqual:ate,areMapsEqual:n?KL(QL,$L):QL,areNumbersEqual:ote,areObjectsEqual:n?$L:ste,arePrimitiveWrappersEqual:cte,areRegExpsEqual:lte,areSetsEqual:n?KL(eR,$L):eR,areTypedArraysEqual:n?KL(tR,$L):tR,areUrlsEqual:ute,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=qL(r.areArraysEqual),t=qL(r.areMapsEqual),n=qL(r.areObjectsEqual),i=qL(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function _R(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function vR({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var yR=bR();bR({strict:!0}),bR({circular:!0}),bR({circular:!0,strict:!0}),bR({createInternalComparator:()=>YL}),bR({strict:!0,createInternalComparator:()=>YL}),bR({circular:!0,createInternalComparator:()=>YL}),bR({circular:!0,createInternalComparator:()=>YL,strict:!0});function bR(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=hR(gR(e));return vR({circular:t,comparator:a,createState:r,equals:n?n(a):_R(a),strict:i})}function xR(e){typeof requestAnimationFrame<`u`&&requestAnimationFrame(e)}function SR(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1;requestAnimationFrame(function r(i){n<0&&(n=i),i-n>t?(e(i),n=-1):xR(r)})}function CR(e){"@babel/helpers - typeof";return CR=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},CR(e)}function wR(e){return kR(e)||OR(e)||ER(e)||TR()}function TR(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
94
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ER(e,t){if(e){if(typeof e==`string`)return DR(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 DR(e,t)}}function DR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function OR(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function kR(e){if(Array.isArray(e))return e}function AR(){var e={},t=function(){return null},n=!1,r=function r(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var a=wR(i),o=a[0],s=a.slice(1);if(typeof o==`number`){SR(r.bind(null,s),o);return}r(o),SR(r.bind(null,s))}else CR(i)===`object`&&(e=i,t(e)),typeof i==`function`&&i()}};return{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}}}function jR(e){"@babel/helpers - typeof";return jR=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},jR(e)}function MR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MR(Object(n),!0).forEach(function(t){PR(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MR(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PR(e,t,n){return t=FR(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FR(e){var t=IR(e,`string`);return jR(t)===`symbol`?t:String(t)}function IR(e,t){if(jR(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(jR(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var LR=function(e,t){return[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})})},RR=function(e){return e},zR=function(e){return e.replace(/([A-Z])/g,function(e){return`-${e.toLowerCase()}`})},BR=function(e,t){return Object.keys(t).reduce(function(n,r){return NR(NR({},n),{},PR({},r,e(r,t[r])))},{})},VR=function(e,t,n){return e.map(function(e){return`${zR(e)} ${t}ms ${n}`}).join(`,`)};function HR(e,t){return GR(e)||WR(e,t)||JR(e,t)||UR()}function UR(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
95
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WR(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function GR(e){if(Array.isArray(e))return e}function KR(e){return XR(e)||YR(e)||JR(e)||qR()}function qR(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
96
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JR(e,t){if(e){if(typeof e==`string`)return ZR(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 ZR(e,t)}}function YR(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function XR(e){if(Array.isArray(e))return ZR(e)}function ZR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var QR=1e-4,$R=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},ez=function(e,t){return e.map(function(e,n){return e*t**+n}).reduce(function(e,t){return e+t})},tz=function(e,t){return function(n){return ez($R(e,t),n)}},nz=function(e,t){return function(n){var r=$R(e,t);return ez([].concat(KR(r.map(function(e,t){return e*t}).slice(1)),[0]),n)}},rz=function(){var e=[...arguments],t=e[0],n=e[1],r=e[2],i=e[3];if(e.length===1)switch(e[0]){case`linear`:t=0,n=0,r=1,i=1;break;case`ease`:t=.25,n=.1,r=.25,i=1;break;case`ease-in`:t=.42,n=0,r=1,i=1;break;case`ease-out`:t=.42,n=0,r=.58,i=1;break;case`ease-in-out`:t=0,n=0,r=.58,i=1;break;default:var a=e[0].split(`(`);if(a[0]===`cubic-bezier`&&a[1].split(`)`)[0].split(`,`).length===4){var o=HR(a[1].split(`)`)[0].split(`,`).map(function(e){return parseFloat(e)}),4);t=o[0],n=o[1],r=o[2],i=o[3]}}[t,r,n,i].every(function(e){return typeof e==`number`&&e>=0&&e<=1});var s=tz(t,r),c=tz(n,i),l=nz(t,r),u=function(e){return e>1?1:e<0?0:e},d=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var i=s(n)-t,a=l(n);if(Math.abs(i-t)<QR||a<QR)return c(n);n=u(n-i/a)}return c(n)};return d.isStepper=!1,d},iz=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?17:a,s=function(e,t,r){var a=r+(-(e-t)*n-r*i)*o/1e3,s=r*o/1e3+e;return Math.abs(s-t)<QR&&Math.abs(a)<QR?[t,0]:[s,a]};return s.isStepper=!0,s.dt=o,s},az=function(){var e=[...arguments][0];if(typeof e==`string`)switch(e){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return rz(e);case`spring`:return iz();default:if(e.split(`(`)[0]===`cubic-bezier`)return rz(e)}return typeof e==`function`?e:null};function oz(e){"@babel/helpers - typeof";return oz=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},oz(e)}function sz(e){return uz(e)||lz(e)||vz(e)||cz()}function cz(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
97
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lz(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function uz(e){if(Array.isArray(e))return yz(e)}function dz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dz(Object(n),!0).forEach(function(t){pz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pz(e,t,n){return t=mz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mz(e){var t=hz(e,`string`);return oz(t)===`symbol`?t:String(t)}function hz(e,t){if(oz(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(oz(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gz(e,t){return xz(e)||bz(e,t)||vz(e,t)||_z()}function _z(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
98
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vz(e,t){if(e){if(typeof e==`string`)return yz(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 yz(e,t)}}function yz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bz(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function xz(e){if(Array.isArray(e))return e}var Sz=function(e,t,n){return e+(t-e)*n},Cz=function(e){return e.from!==e.to},wz=function e(t,n,r){var i=BR(function(e,n){if(Cz(n)){var r=gz(t(n.from,n.to,n.velocity),2),i=r[0],a=r[1];return fz(fz({},n),{},{from:i,velocity:a})}return n},n);return r<1?BR(function(e,t){return Cz(t)?fz(fz({},t),{},{velocity:Sz(t.velocity,i[e].velocity,r),from:Sz(t.from,i[e].from,r)}):t},n):e(t,i,r-1)},Tz=(function(e,t,n,r,i){var a=LR(e,t),o=a.reduce(function(n,r){return fz(fz({},n),{},pz({},r,[e[r],t[r]]))},{}),s=a.reduce(function(n,r){return fz(fz({},n),{},pz({},r,{from:e[r],velocity:0,to:t[r]}))},{}),c=-1,l,u,d=function(){return null},f=function(){return BR(function(e,t){return t.from},s)},p=function(){return!Object.values(s).filter(Cz).length};return d=n.isStepper?function(r){l||=r;var a=(r-l)/n.dt;s=wz(n,s,a),i(fz(fz(fz({},e),t),f(s))),l=r,p()||(c=requestAnimationFrame(d))}:function(a){u||=a;var s=(a-u)/r,l=BR(function(e,t){return Sz.apply(void 0,sz(t).concat([n(s)]))},o);if(i(fz(fz(fz({},e),t),l)),s<1)c=requestAnimationFrame(d);else{var f=BR(function(e,t){return Sz.apply(void 0,sz(t).concat([n(1)]))},o);i(fz(fz(fz({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}}),Ez=l(Gee());function Dz(e){"@babel/helpers - typeof";return Dz=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Dz(e)}var Oz=[`children`,`begin`,`duration`,`attributeName`,`easing`,`isActive`,`steps`,`from`,`to`,`canBegin`,`onAnimationEnd`,`shouldReAnimate`,`onAnimationReStart`];function kz(e,t){if(e==null)return{};var n=Az(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Az(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function jz(e){return Fz(e)||Pz(e)||Nz(e)||Mz()}function Mz(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
99
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nz(e,t){if(e){if(typeof e==`string`)return Iz(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 Iz(e,t)}}function Pz(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Fz(e){if(Array.isArray(e))return Iz(e)}function Iz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Lz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Lz(Object(n),!0).forEach(function(t){zz(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lz(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zz(e,t,n){return t=Uz(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bz(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Vz(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,Uz(r.key),r)}}function Hz(e,t,n){return t&&Vz(e.prototype,t),n&&Vz(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uz(e){var t=Wz(e,`string`);return Dz(t)===`symbol`?t:String(t)}function Wz(e,t){if(Dz(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Dz(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Gz(e,t){if(typeof t!=`function`&&t!==null)throw 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&&Kz(e,t)}function Kz(e,t){return Kz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kz(e,t)}function qz(e){var t=Xz();return function(){var n=Zz(e),r;if(t){var i=Zz(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Jz(this,r)}}function Jz(e,t){if(t&&(Dz(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Yz(e)}function Yz(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Xz(){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 Zz(e){return Zz=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zz(e)}var Qz=function(e){Gz(n,e);var t=qz(n);function n(e,r){var i;Bz(this,n),i=t.call(this,e,r);var a=i.props,o=a.isActive,s=a.attributeName,c=a.from,l=a.to,u=a.steps,d=a.children,f=a.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Yz(i)),i.changeStyle=i.changeStyle.bind(Yz(i)),!o||f<=0)return i.state={style:{}},typeof d==`function`&&(i.state={style:l}),Jz(i);if(u&&u.length)i.state={style:u[0].style};else if(c){if(typeof d==`function`)return i.state={style:c},Jz(i);i.state={style:s?zz({},s,c):c}}else i.state={style:{}};return i}return Hz(n,[{key:`componentDidMount`,value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,t&&n&&this.runAnimation(this.props)}},{key:`componentDidUpdate`,value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,i=t.attributeName,a=t.shouldReAnimate,o=t.to,s=t.from,c=this.state.style;if(r){if(!n){var l={style:i?zz({},i,o):o};this.state&&c&&(i&&c[i]!==o||!i&&c!==o)&&this.setState(l)}else if(!(yR(e.to,o)&&e.canBegin&&e.isActive)){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||a?s:e.to;if(this.state&&c){var f={style:i?zz({},i,d):d};(i&&c[i]!==d||!i&&c!==d)&&this.setState(f)}this.runAnimation(Rz(Rz({},this.props),{},{from:d,begin:0}))}}}},{key:`componentWillUnmount`,value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&=(this.manager.stop(),null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:`handleStyleChange`,value:function(e){this.changeStyle(e)}},{key:`changeStyle`,value:function(e){this.mounted&&this.setState({style:e})}},{key:`runJSAnimation`,value:function(e){var t=this,n=e.from,r=e.to,i=e.duration,a=e.easing,o=e.begin,s=e.onAnimationEnd,c=e.onAnimationStart,l=Tz(n,r,az(a),i,this.changeStyle);this.manager.start([c,o,function(){t.stopJSAnimation=l()},i,s])}},{key:`runStepAnimation`,value:function(e){var t=this,n=e.steps,r=e.begin,i=e.onAnimationStart,a=n[0],o=a.style,s=a.duration,c=s===void 0?0:s;return this.manager.start([i].concat(jz(n.reduce(function(e,r,i){if(i===0)return e;var a=r.duration,o=r.easing,s=o===void 0?`ease`:o,c=r.style,l=r.properties,u=r.onAnimationEnd,d=i>0?n[i-1]:r,f=l||Object.keys(c);if(typeof s==`function`||s===`spring`)return[].concat(jz(e),[t.runJSAnimation.bind(t,{from:d.style,to:c,duration:a,easing:s}),a]);var p=VR(f,a,s),m=Rz(Rz(Rz({},d.style),c),{},{transition:p});return[].concat(jz(e),[m,a,u]).filter(RR)},[o,Math.max(c,r)])),[e.onAnimationEnd]))}},{key:`runAnimation`,value:function(e){this.manager||=AR();var t=e.begin,n=e.duration,r=e.attributeName,i=e.to,a=e.easing,o=e.onAnimationStart,s=e.onAnimationEnd,c=e.steps,l=e.children,u=this.manager;if(this.unSubscribe=u.subscribe(this.handleStyleChange),typeof a==`function`||typeof l==`function`||a===`spring`)this.runJSAnimation(e);else if(c.length>1)this.runStepAnimation(e);else{var d=r?zz({},r,i):i,f=VR(Object.keys(d),n,a);u.start([o,t,Rz(Rz({},d),{},{transition:f}),n,s])}}},{key:`render`,value:function(){var e=this.props,t=e.children;e.begin;var n=e.duration;e.attributeName,e.easing;var r=e.isActive;e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart;var i=kz(e,Oz),a=_.Children.count(t),o=this.state.style;if(typeof t==`function`)return t(o);if(!r||a===0||n<=0)return t;var s=function(e){var t=e.props,n=t.style,r=n===void 0?{}:n,a=t.className;return(0,_.cloneElement)(e,Rz(Rz({},i),{},{style:Rz(Rz({},r),o),className:a}))};return a===1?s(_.Children.only(t)):_.createElement(`div`,null,_.Children.map(t,function(e){return s(e)}))}}]),n}(_.PureComponent);Qz.displayName=`Animate`,Qz.defaultProps={begin:0,duration:1e3,from:``,to:``,attributeName:``,easing:`ease`,isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},Qz.propTypes={from:Ez.default.oneOfType([Ez.default.object,Ez.default.string]),to:Ez.default.oneOfType([Ez.default.object,Ez.default.string]),attributeName:Ez.default.string,duration:Ez.default.number,begin:Ez.default.number,easing:Ez.default.oneOfType([Ez.default.string,Ez.default.func]),steps:Ez.default.arrayOf(Ez.default.shape({duration:Ez.default.number.isRequired,style:Ez.default.object.isRequired,easing:Ez.default.oneOfType([Ez.default.oneOf([`ease`,`ease-in`,`ease-out`,`ease-in-out`,`linear`]),Ez.default.func]),properties:Ez.default.arrayOf(`string`),onAnimationEnd:Ez.default.func})),children:Ez.default.oneOfType([Ez.default.node,Ez.default.func]),isActive:Ez.default.bool,canBegin:Ez.default.bool,onAnimationEnd:Ez.default.func,shouldReAnimate:Ez.default.bool,onAnimationStart:Ez.default.func,onAnimationReStart:Ez.default.func};var $z=Qz;function eB(e){"@babel/helpers - typeof";return eB=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},eB(e)}function tB(){return tB=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},tB.apply(this,arguments)}function nB(e,t){return sB(e)||oB(e,t)||iB(e,t)||rB()}function rB(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
100
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iB(e,t){if(e){if(typeof e==`string`)return aB(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 aB(e,t)}}function aB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oB(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function sB(e){if(Array.isArray(e))return e}function cB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?cB(Object(n),!0).forEach(function(t){uB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uB(e,t,n){return t=dB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dB(e){var t=fB(e,`string`);return eB(t)==`symbol`?t:t+``}function fB(e,t){if(eB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(eB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pB=function(e,t,n,r,i){var a=Math.min(Math.abs(n)/2,Math.abs(r)/2),o=r>=0?1:-1,s=n>=0?1:-1,c=+(r>=0&&n>=0||r<0&&n<0),l;if(a>0&&i instanceof Array){for(var u=[0,0,0,0],d=0,f=4;d<f;d++)u[d]=i[d]>a?a:i[d];l=`M${e},${t+o*u[0]}`,u[0]>0&&(l+=`A ${u[0]},${u[0]},0,0,${c},${e+s*u[0]},${t}`),l+=`L ${e+n-s*u[1]},${t}`,u[1]>0&&(l+=`A ${u[1]},${u[1]},0,0,${c},
|
|
101
|
-
${e+n},${t+o*u[1]}`),l+=`L ${e+n},${t+r-o*u[2]}`,u[2]>0&&(l+=`A ${u[2]},${u[2]},0,0,${c},
|
|
102
|
-
${e+n-s*u[2]},${t+r}`),l+=`L ${e+s*u[3]},${t+r}`,u[3]>0&&(l+=`A ${u[3]},${u[3]},0,0,${c},
|
|
103
|
-
${e},${t+r-o*u[3]}`),l+=`Z`}else if(a>0&&i===+i&&i>0){var p=Math.min(a,i);l=`M ${e},${t+o*p}
|
|
104
|
-
A ${p},${p},0,0,${c},${e+s*p},${t}
|
|
105
|
-
L ${e+n-s*p},${t}
|
|
106
|
-
A ${p},${p},0,0,${c},${e+n},${t+o*p}
|
|
107
|
-
L ${e+n},${t+r-o*p}
|
|
108
|
-
A ${p},${p},0,0,${c},${e+n-s*p},${t+r}
|
|
109
|
-
L ${e+s*p},${t+r}
|
|
110
|
-
A ${p},${p},0,0,${c},${e},${t+r-o*p} Z`}else l=`M ${e},${t} h ${n} v ${r} h ${-n} Z`;return l},mB=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,i=t.x,a=t.y,o=t.width,s=t.height;if(Math.abs(o)>0&&Math.abs(s)>0){var c=Math.min(i,i+o),l=Math.max(i,i+o),u=Math.min(a,a+s),d=Math.max(a,a+s);return n>=c&&n<=l&&r>=u&&r<=d}return!1},hB={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},gB=function(e){var t=lB(lB({},hB),e),n=(0,_.useRef)(),r=nB((0,_.useState)(-1),2),i=r[0],a=r[1];(0,_.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,l=t.height,u=t.radius,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isAnimationActive,g=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||c===0||l===0)return null;var v=Vt(`recharts-rectangle`,d);return g?_.createElement($z,{canBegin:i>0,from:{width:c,height:l,x:o,y:s},to:{width:c,height:l,x:o,y:s},duration:p,animationEasing:f,isActive:g},function(e){var r=e.width,a=e.height,o=e.x,s=e.y;return _.createElement($z,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:m,duration:p,isActive:h,easing:f},_.createElement(`path`,tB({},lx(t,!0),{className:v,d:pB(o,s,r,a,u),ref:n})))}):_.createElement(`path`,tB({},lx(t,!0),{className:v,d:pB(o,s,c,l,u)}))},_B=[`points`,`className`,`baseLinePoints`,`connectNulls`];function vB(){return vB=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},vB.apply(this,arguments)}function yB(e,t){if(e==null)return{};var n=bB(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bB(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 xB(e){return TB(e)||wB(e)||CB(e)||SB()}function SB(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
111
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CB(e,t){if(e){if(typeof e==`string`)return EB(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 EB(e,t)}}function wB(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function TB(e){if(Array.isArray(e))return EB(e)}function EB(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var DB=function(e){return e&&e.x===+e.x&&e.y===+e.y},OB=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];return e.forEach(function(e){DB(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),DB(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},kB=function(e,t){var n=OB(e);t&&(n=[n.reduce(function(e,t){return[].concat(xB(e),xB(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return`${e}${n===0?`M`:`L`}${t.x},${t.y}`},``)}).join(``);return n.length===1?`${r}Z`:r},AB=function(e,t,n){var r=kB(e,n);return`${r.slice(-1)===`Z`?r.slice(0,-1):r}L${kB(t.reverse(),n).slice(1)}`},jB=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,i=e.connectNulls,a=yB(e,_B);if(!t||!t.length)return null;var o=Vt(`recharts-polygon`,n);if(r&&r.length){var s=a.stroke&&a.stroke!==`none`,c=AB(t,r,i);return _.createElement(`g`,{className:o},_.createElement(`path`,vB({},lx(a,!0),{fill:c.slice(-1)===`Z`?a.fill:`none`,stroke:`none`,d:c})),s?_.createElement(`path`,vB({},lx(a,!0),{fill:`none`,d:kB(t,i)})):null,s?_.createElement(`path`,vB({},lx(a,!0),{fill:`none`,d:kB(r,i)})):null)}var l=kB(t,i);return _.createElement(`path`,vB({},lx(a,!0),{fill:l.slice(-1)===`Z`?a.fill:`none`,className:o,d:l}))};function MB(){return MB=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},MB.apply(this,arguments)}var NB=function(e){var t=e.cx,n=e.cy,r=e.r,i=e.className,a=Vt(`recharts-dot`,i);return t===+t&&n===+n&&r===+r?_.createElement(`circle`,MB({},lx(e,!1),Vb(e),{className:a,cx:t,cy:n,r})):null};function PB(e){"@babel/helpers - typeof";return PB=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},PB(e)}var FB=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function IB(){return IB=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},IB.apply(this,arguments)}function LB(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?LB(Object(n),!0).forEach(function(t){zB(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LB(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zB(e,t,n){return t=BB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BB(e){var t=VB(e,`string`);return PB(t)==`symbol`?t:t+``}function VB(e,t){if(PB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(PB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function HB(e,t){if(e==null)return{};var n=UB(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UB(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 WB=function(e,t,n,r,i,a){return`M${e},${i}v${r}M${a},${t}h${n}`},GB=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,l=e.width,u=l===void 0?0:l,d=e.height,f=d===void 0?0:d,p=e.className,m=HB(e,FB),h=RB({x:n,y:i,top:o,left:c,width:u,height:f},m);return!X(n)||!X(i)||!X(u)||!X(f)||!X(o)||!X(c)?null:_.createElement(`path`,IB({},lx(h,!0),{className:Vt(`recharts-cross`,p),d:WB(n,i,u,f,o,c)}))},KB=o(((e,t)=>{var n=NN(),r=PN(),i=xw();function a(e,t){return e&&e.length?n(e,i(t,2),r):void 0}t.exports=a})),qB=o(((e,t)=>{var n=NN(),r=xw(),i=IN();function a(e,t){return e&&e.length?n(e,r(t,2),i):void 0}t.exports=a})),JB=l(KB()),YB=l(qB()),XB=[`cx`,`cy`,`angle`,`ticks`,`axisLine`],ZB=[`ticks`,`tick`,`angle`,`tickFormatter`,`stroke`];function QB(e){"@babel/helpers - typeof";return QB=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QB(e)}function $B(){return $B=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},$B.apply(this,arguments)}function eV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?eV(Object(n),!0).forEach(function(t){mV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nV(e,t){if(e==null)return{};var n=rV(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rV(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 iV(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function aV(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,hV(r.key),r)}}function oV(e,t,n){return t&&aV(e.prototype,t),n&&aV(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sV(e,t,n){return t=dV(t),cV(e,uV()?Reflect.construct(t,n||[],dV(e).constructor):t.apply(e,n))}function cV(e,t){if(t&&(QB(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return lV(e)}function lV(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function uV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uV=function(){return!!e})()}function dV(e){return dV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dV(e)}function fV(e,t){if(typeof t!=`function`&&t!==null)throw 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&&pV(e,t)}function pV(e,t){return pV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pV(e,t)}function mV(e,t,n){return t=hV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hV(e){var t=gV(e,`string`);return QB(t)==`symbol`?t:t+``}function gV(e,t){if(QB(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QB(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var _V=function(e){function t(){return iV(this,t),sV(this,t,arguments)}return fV(t,e),oV(t,[{key:`getTickValueCoord`,value:function(e){var t=e.coordinate,n=this.props,r=n.angle,i=n.cx,a=n.cy;return yI(i,a,t,r)}},{key:`getTickTextAnchor`,value:function(){var e=this.props.orientation,t;switch(e){case`left`:t=`end`;break;case`right`:t=`start`;break;default:t=`middle`}return t}},{key:`getViewBox`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=(0,JB.default)(i,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:(0,YB.default)(i,function(e){return e.coordinate||0}).coordinate||0,outerRadius:a.coordinate||0}}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=e.axisLine,o=nV(e,XB),s=i.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=yI(t,n,s[0],r),l=yI(t,n,s[1],r),u=tV(tV(tV({},lx(o,!1)),{},{fill:`none`},lx(a,!1)),{},{x1:c.x,y1:c.y,x2:l.x,y2:l.y});return _.createElement(`line`,$B({className:`recharts-polar-radius-axis-line`},u))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.angle,o=n.tickFormatter,s=n.stroke,c=nV(n,ZB),l=this.getTickTextAnchor(),u=lx(c,!1),d=lx(i,!1),f=r.map(function(n,r){var c=e.getTickValueCoord(n),f=tV(tV(tV(tV({textAnchor:l,transform:`rotate(${90-a}, ${c.x}, ${c.y})`},u),{},{stroke:`none`,fill:s},d),{},{index:r},c),{},{payload:n});return _.createElement(wx,$B({className:Vt(`recharts-polar-radius-axis-tick`,DI(i)),key:`tick-${n.coordinate}`},Ub(e.props,n,r)),t.renderTickItem(i,f,o?o(n.value,r):n.value))});return _.createElement(wx,{className:`recharts-polar-radius-axis-ticks`},f)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.axisLine,r=e.tick;return!t||!t.length?null:_.createElement(wx,{className:Vt(`recharts-polar-radius-axis`,this.props.className)},n&&this.renderAxisLine(),r&&this.renderTicks(),XI.renderCallByParent(this.props,this.getViewBox()))}}],[{key:`renderTickItem`,value:function(e,t,n){return _.isValidElement(e)?_.cloneElement(e,t):(0,Wb.default)(e)?e(t):_.createElement(QD,$B({},t,{className:`recharts-polar-radius-axis-tick-value`}),n)}}])}(_.PureComponent);mV(_V,`displayName`,`PolarRadiusAxis`),mV(_V,`axisType`,`radiusAxis`),mV(_V,`defaultProps`,{type:`number`,radiusAxisId:0,cx:0,cy:0,angle:0,orientation:`right`,stroke:`#ccc`,axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:`auto`,allowDuplicatedCategory:!0});function vV(e){"@babel/helpers - typeof";return vV=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},vV(e)}function yV(){return yV=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},yV.apply(this,arguments)}function bV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?bV(Object(n),!0).forEach(function(t){MV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SV(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function CV(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,NV(r.key),r)}}function wV(e,t,n){return t&&CV(e.prototype,t),n&&CV(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function TV(e,t,n){return t=kV(t),EV(e,OV()?Reflect.construct(t,n||[],kV(e).constructor):t.apply(e,n))}function EV(e,t){if(t&&(vV(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return DV(e)}function DV(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function OV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OV=function(){return!!e})()}function kV(e){return kV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kV(e)}function AV(e,t){if(typeof t!=`function`&&t!==null)throw 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&&jV(e,t)}function jV(e,t){return jV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jV(e,t)}function MV(e,t,n){return t=NV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NV(e){var t=PV(e,`string`);return vV(t)==`symbol`?t:t+``}function PV(e,t){if(vV(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vV(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var FV=Math.PI/180,IV=1e-5,LV=function(e){function t(){return SV(this,t),TV(this,t,arguments)}return AV(t,e),wV(t,[{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.cx,r=t.cy,i=t.radius,a=t.orientation,o=t.tickSize||8,s=yI(n,r,i,e.coordinate),c=yI(n,r,i+(a===`inner`?-1:1)*o,e.coordinate);return{x1:s.x,y1:s.y,x2:c.x,y2:c.y}}},{key:`getTickTextAnchor`,value:function(e){var t=this.props.orientation,n=Math.cos(-e.coordinate*FV);return n>IV?t===`outer`?`start`:`end`:n<-IV?t===`outer`?`end`:`start`:`middle`}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,i=e.axisLine,a=e.axisLineType,o=xV(xV({},lx(this.props,!1)),{},{fill:`none`},lx(i,!1));if(a===`circle`)return _.createElement(NB,yV({className:`recharts-polar-angle-axis-line`},o,{cx:t,cy:n,r}));var s=this.props.ticks.map(function(e){return yI(t,n,r,e.coordinate)});return _.createElement(jB,yV({className:`recharts-polar-angle-axis-line`},o,{points:s}))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.tickLine,o=n.tickFormatter,s=n.stroke,c=lx(this.props,!1),l=lx(i,!1),u=xV(xV({},c),{},{fill:`none`},lx(a,!1)),d=r.map(function(n,r){var d=e.getTickLineCoord(n),f=xV(xV(xV({textAnchor:e.getTickTextAnchor(n)},c),{},{stroke:`none`,fill:s},l),{},{index:r,payload:n,x:d.x2,y:d.y2});return _.createElement(wx,yV({className:Vt(`recharts-polar-angle-axis-tick`,DI(i)),key:`tick-${n.coordinate}`},Ub(e.props,n,r)),a&&_.createElement(`line`,yV({className:`recharts-polar-angle-axis-tick-line`},u,d)),i&&t.renderTickItem(i,f,o?o(n.value,r):n.value))});return _.createElement(wx,{className:`recharts-polar-angle-axis-ticks`},d)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return n<=0||!t||!t.length?null:_.createElement(wx,{className:Vt(`recharts-polar-angle-axis`,this.props.className)},r&&this.renderAxisLine(),this.renderTicks())}}],[{key:`renderTickItem`,value:function(e,t,n){return _.isValidElement(e)?_.cloneElement(e,t):(0,Wb.default)(e)?e(t):_.createElement(QD,yV({},t,{className:`recharts-polar-angle-axis-tick-value`}),n)}}])}(_.PureComponent);MV(LV,`displayName`,`PolarAngleAxis`),MV(LV,`axisType`,`angleAxis`),MV(LV,`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 RV=o(((e,t)=>{t.exports=XC()(Object.getPrototypeOf,Object)})),zV=o(((e,t)=>{var n=vy(),r=RV(),i=yy(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),BV=o(((e,t)=>{var n=vy(),r=yy(),i=`[object Boolean]`;function a(e){return e===!0||e===!1||r(e)&&n(e)==i}t.exports=a}));function VV(e){"@babel/helpers - typeof";return VV=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},VV(e)}function HV(){return HV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},HV.apply(this,arguments)}function UV(e,t){return JV(e)||qV(e,t)||GV(e,t)||WV()}function WV(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
112
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GV(e,t){if(e){if(typeof e==`string`)return KV(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 KV(e,t)}}function KV(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qV(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function JV(e){if(Array.isArray(e))return e}function YV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function XV(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?YV(Object(n),!0).forEach(function(t){ZV(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YV(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ZV(e,t,n){return t=QV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QV(e){var t=$V(e,`string`);return VV(t)==`symbol`?t:t+``}function $V(e,t){if(VV(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(VV(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var eH=function(e,t,n,r,i){var a=n-r,o=`M ${e},${t}`;return o+=`L ${e+n},${t}`,o+=`L ${e+n-a/2},${t+i}`,o+=`L ${e+n-a/2-r},${t+i}`,o+=`L ${e},${t} Z`,o},tH={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},nH=function(e){var t=XV(XV({},tH),e),n=(0,_.useRef)(),r=UV((0,_.useState)(-1),2),i=r[0],a=r[1];(0,_.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.upperWidth,l=t.lowerWidth,u=t.height,d=t.className,f=t.animationEasing,p=t.animationDuration,m=t.animationBegin,h=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||u!==+u||c===0&&l===0||u===0)return null;var g=Vt(`recharts-trapezoid`,d);return h?_.createElement($z,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:u,x:o,y:s},to:{upperWidth:c,lowerWidth:l,height:u,x:o,y:s},duration:p,animationEasing:f,isActive:h},function(e){var r=e.upperWidth,a=e.lowerWidth,o=e.height,s=e.x,c=e.y;return _.createElement($z,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:m,duration:p,easing:f},_.createElement(`path`,HV({},lx(t,!0),{className:g,d:eH(s,c,r,a,o),ref:n})))}):_.createElement(`g`,null,_.createElement(`path`,HV({},lx(t,!0),{className:g,d:eH(o,s,c,l,u)})))},rH=l(zV()),iH=l(BV()),aH=[`option`,`shapeType`,`propTransformer`,`activeClassName`,`isActive`];function oH(e){"@babel/helpers - typeof";return oH=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},oH(e)}function sH(e,t){if(e==null)return{};var n=cH(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cH(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 lH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lH(Object(n),!0).forEach(function(t){dH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dH(e,t,n){return t=fH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fH(e){var t=pH(e,`string`);return oH(t)==`symbol`?t:t+``}function pH(e,t){if(oH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(oH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function mH(e,t){return uH(uH({},t),e)}function hH(e,t){return e===`symbols`}function gH(e){var t=e.shapeType,n=e.elementProps;switch(t){case`rectangle`:return _.createElement(gB,n);case`trapezoid`:return _.createElement(nH,n);case`sector`:return _.createElement(NL,n);case`symbols`:if(hH(t,n))return _.createElement(vC,n);break;default:return null}}function _H(e){return(0,_.isValidElement)(e)?e.props:e}function vH(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?mH:r,a=e.activeClassName,o=a===void 0?`recharts-active-shape`:a,s=e.isActive,c=sH(e,aH),l;if((0,_.isValidElement)(t))l=(0,_.cloneElement)(t,uH(uH({},c),_H(t)));else if((0,Wb.default)(t))l=t(c);else if((0,rH.default)(t)&&!(0,iH.default)(t)){var u=i(t,c);l=_.createElement(gH,{shapeType:n,elementProps:u})}else{var d=c;l=_.createElement(gH,{shapeType:n,elementProps:d})}return s?_.createElement(wx,{className:o},l):l}function yH(e,t){return t!=null&&`trapezoids`in e.props}function bH(e,t){return t!=null&&`sectors`in e.props}function xH(e,t){return t!=null&&`points`in e.props}function SH(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)==null?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)==null?void 0:r.y)||e.y===t.y;return i&&a}function CH(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function wH(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function TH(e,t){var n;return yH(e,t)?n=SH:bH(e,t)?n=CH:xH(e,t)&&(n=wH),n}function EH(e,t){var n;return yH(e,t)?n=`trapezoids`:bH(e,t)?n=`sectors`:xH(e,t)&&(n=`points`),n}function DH(e,t){if(yH(e,t)){var n;return(n=t.tooltipPayload)==null||(n=n[0])==null||(n=n.payload)==null?void 0:n.payload}if(bH(e,t)){var r;return(r=t.tooltipPayload)==null||(r=r[0])==null||(r=r.payload)==null?void 0:r.payload}return xH(e,t)?t.payload:{}}function OH(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=EH(n,t),a=DH(n,t),o=r.filter(function(e,r){var o=(0,uF.default)(a,e),s=n.props[i].filter(function(e){return TH(n,t)(e,t)}),c=r===n.props[i].indexOf(s[s.length-1]);return o&&c});return r.indexOf(o[o.length-1])}var kH;function AH(e){"@babel/helpers - typeof";return AH=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},AH(e)}function jH(){return jH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jH.apply(this,arguments)}function MH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MH(Object(n),!0).forEach(function(t){WH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function PH(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function FH(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,GH(r.key),r)}}function IH(e,t,n){return t&&FH(e.prototype,t),n&&FH(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LH(e,t,n){return t=VH(t),RH(e,BH()?Reflect.construct(t,n||[],VH(e).constructor):t.apply(e,n))}function RH(e,t){if(t&&(AH(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return zH(e)}function zH(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function BH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BH=function(){return!!e})()}function VH(e){return VH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},VH(e)}function HH(e,t){if(typeof t!=`function`&&t!==null)throw 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&&UH(e,t)}function UH(e,t){return UH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},UH(e,t)}function WH(e,t,n){return t=GH(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GH(e){var t=KH(e,`string`);return AH(t)==`symbol`?t:t+``}function KH(e,t){if(AH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(AH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var qH=function(e){function t(e){var n;return PH(this,t),n=LH(this,t,[e]),WH(n,`pieRef`,null),WH(n,`sectorRefs`,[]),WH(n,`id`,Eb(`recharts-pie-`)),WH(n,`handleAnimationEnd`,function(){var e=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),(0,Wb.default)(e)&&e()}),WH(n,`handleAnimationStart`,function(){var e=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),(0,Wb.default)(e)&&e()}),n.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},n}return HH(t,e),IH(t,[{key:`isActiveIndex`,value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?t.indexOf(e)!==-1:e===t}},{key:`hasActiveIndex`,value:function(){var e=this.props.activeIndex;return Array.isArray(e)?e.length!==0:e||e===0}},{key:`renderLabels`,value:function(e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.label,i=n.labelLine,a=n.dataKey,o=n.valueKey,s=lx(this.props,!1),c=lx(r,!1),l=lx(i,!1),u=r&&r.offsetRadius||20,d=e.map(function(e,n){var d=(e.startAngle+e.endAngle)/2,f=yI(e.cx,e.cy,e.outerRadius+u,d),p=NH(NH(NH(NH({},s),e),{},{stroke:`none`},c),{},{index:n,textAnchor:t.getTextAnchor(f.x,e.cx)},f),m=NH(NH(NH(NH({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:n,points:[yI(e.cx,e.cy,e.outerRadius,d),f]}),h=a;return(0,bb.default)(a)&&(0,bb.default)(o)?h=`value`:(0,bb.default)(a)&&(h=o),_.createElement(wx,{key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${n}`},i&&t.renderLabelLineItem(i,m,`line`),t.renderLabelItem(r,p,CF(e,h)))});return _.createElement(wx,{className:`recharts-pie-labels`},d)}},{key:`renderSectorsStatically`,value:function(e){var t=this,n=this.props,r=n.activeShape,i=n.blendStroke,a=n.inactiveShape;return e.map(function(n,o){if(n?.startAngle===0&&n?.endAngle===0&&e.length!==1)return null;var s=t.isActiveIndex(o),c=a&&t.hasActiveIndex()?a:null,l=s?r:c,u=NH(NH({},n),{},{stroke:i?n.fill:n.stroke,tabIndex:-1});return _.createElement(wx,jH({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:`recharts-pie-sector`},Ub(t.props,n,o),{key:`sector-${n?.startAngle}-${n?.endAngle}-${n.midAngle}-${o}`}),_.createElement(vH,jH({option:l,isActive:s,shapeType:`sector`},u)))})}},{key:`renderSectorsWithAnimation`,value:function(){var e=this,t=this.props,n=t.sectors,r=t.isAnimationActive,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.animationId,c=this.state,l=c.prevSectors,u=c.prevIsAnimationActive;return _.createElement($z,{begin:i,duration:a,isActive:r,easing:o,from:{t:0},to:{t:1},key:`pie-${s}-${u}`,onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(t){var r=t.t,i=[],a=(n&&n[0]).startAngle;return n.forEach(function(e,t){var n=l&&l[t],o=t>0?(0,vb.default)(e,`paddingAngle`,0):0;if(n){var s=Ab(n.endAngle-n.startAngle,e.endAngle-e.startAngle),c=NH(NH({},e),{},{startAngle:a+o,endAngle:a+s(r)+o});i.push(c),a=c.endAngle}else{var u=e.endAngle,d=e.startAngle,f=Ab(0,u-d)(r),p=NH(NH({},e),{},{startAngle:a+o,endAngle:a+f+o});i.push(p),a=p.endAngle}}),_.createElement(wx,null,e.renderSectorsStatically(i))})}},{key:`attachKeyboardHandlers`,value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case`ArrowLeft`:var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case`ArrowRight`:var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case`Escape`:t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:`renderSectors`,value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!(0,uF.default)(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:`componentDidMount`,value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,i=t.className,a=t.label,o=t.cx,s=t.cy,c=t.innerRadius,l=t.outerRadius,u=t.isAnimationActive,d=this.state.isAnimationFinished;if(n||!r||!r.length||!X(o)||!X(s)||!X(c)||!X(l))return null;var f=Vt(`recharts-pie`,i);return _.createElement(wx,{tabIndex:this.props.rootTabIndex,className:f,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),XI.renderCallByParent(this.props,null,!1),(!u||d)&&vL.renderCallByParent(this.props,r,!1))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return t.prevIsAnimationActive===e.isAnimationActive?e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors===t.curSectors?null:{curSectors:e.sectors,isAnimationFinished:!0}:{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}}},{key:`getTextAnchor`,value:function(e,t){return e>t?`start`:e<t?`end`:`middle`}},{key:`renderLabelLineItem`,value:function(e,t,n){if(_.isValidElement(e))return _.cloneElement(e,t);if((0,Wb.default)(e))return e(t);var r=Vt(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className);return _.createElement(GL,jH({},t,{key:n,type:`linear`,className:r}))}},{key:`renderLabelItem`,value:function(e,t,n){if(_.isValidElement(e))return _.cloneElement(e,t);var r=n;if((0,Wb.default)(e)&&(r=e(t),_.isValidElement(r)))return r;var i=Vt(`recharts-pie-label-text`,typeof e!=`boolean`&&!(0,Wb.default)(e)?e.className:``);return _.createElement(QD,jH({},t,{alignmentBaseline:`middle`,className:i}),r)}}])}(_.PureComponent);kH=qH,WH(qH,`displayName`,`Pie`),WH(qH,`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:!lE.isSsr,animationBegin:400,animationDuration:1500,animationEasing:`ease`,nameKey:`name`,blendStroke:!1,rootTabIndex:0}),WH(qH,`parseDeltaAngle`,function(e,t){return xb(t-e)*Math.min(Math.abs(t-e),360)}),WH(qH,`getRealPieData`,function(e){var t=e.data,n=e.children,r=lx(e,!1),i=nx(n,JE);return t&&t.length?t.map(function(e,t){return NH(NH(NH({payload:e},r),e),i&&i[t]&&i[t].props)}):i&&i.length?i.map(function(e){return NH(NH({},r),e.props)}):[]}),WH(qH,`parseCoordinateOfPie`,function(e,t){var n=t.top,r=t.left,i=t.width,a=t.height,o=bI(i,a);return{cx:r+Db(e.cx,i,i/2),cy:n+Db(e.cy,a,a/2),innerRadius:Db(e.innerRadius,o,0),outerRadius:Db(e.outerRadius,o,o*.8),maxRadius:e.maxRadius||Math.sqrt(i*i+a*a)/2}}),WH(qH,`getComposedData`,function(e){var t=e.item,n=e.offset,r=t.type.defaultProps===void 0?t.props:NH(NH({},t.type.defaultProps),t.props),i=kH.getRealPieData(r);if(!i||!i.length)return null;var a=r.cornerRadius,o=r.startAngle,s=r.endAngle,c=r.paddingAngle,l=r.dataKey,u=r.nameKey,d=r.valueKey,f=r.tooltipType,p=Math.abs(r.minAngle),m=kH.parseCoordinateOfPie(r,n),h=kH.parseDeltaAngle(o,s),g=Math.abs(h),_=l;(0,bb.default)(l)&&(0,bb.default)(d)?_=`value`:(0,bb.default)(l)&&(_=d);var v=i.filter(function(e){return CF(e,_,0)!==0}).length,y=(g>=360?v:v-1)*c,b=g-v*p-y,x=i.reduce(function(e,t){var n=CF(t,_,0);return e+(X(n)?n:0)},0),S;if(x>0){var C;S=i.map(function(e,t){var n=CF(e,_,0),r=CF(e,u,t),i=(X(n)?n:0)/x,s=t?C.endAngle+xb(h)*c*(n===0?0:1):o,l=s+xb(h)*((n===0?0:p)+i*b),d=(s+l)/2,g=(m.innerRadius+m.outerRadius)/2;return C=NH(NH(NH({percent:i,cornerRadius:a,name:r,tooltipPayload:[{name:r,value:n,payload:e,dataKey:_,type:f}],midAngle:d,middleRadius:g,tooltipPosition:yI(m.cx,m.cy,g,d)},e),m),{},{value:CF(e,_),startAngle:s,endAngle:l,payload:e,paddingAngle:xb(h)*c}),C})}return NH(NH({},m),{},{sectors:S,data:i})});var JH=o(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),YH=o(((e,t)=>{var n=ME(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),XH=o(((e,t)=>{var n=JH(),r=vT(),i=YH();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t<a?1:-1:i(o),n(t,a,o,e)}}t.exports=a})),ZH=o(((e,t)=>{t.exports=XH()()}));function QH(e){"@babel/helpers - typeof";return QH=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QH(e)}function $H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$H(Object(n),!0).forEach(function(t){tU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tU(e,t,n){return t=nU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nU(e){var t=rU(e,`string`);return QH(t)==`symbol`?t:t+``}function rU(e,t){if(QH(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QH(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var iU=[`Webkit`,`Moz`,`O`,`ms`],aU=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=iU.reduce(function(e,r){return eU(eU({},e),{},tU({},r+n,t))},{});return r[e]=t,r},oU=l(ZH());function sU(e){"@babel/helpers - typeof";return sU=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},sU(e)}function cU(){return cU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cU.apply(this,arguments)}function lU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lU(Object(n),!0).forEach(function(t){xU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dU(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function fU(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,SU(r.key),r)}}function pU(e,t,n){return t&&fU(e.prototype,t),n&&fU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mU(e,t,n){return t=vU(t),hU(e,_U()?Reflect.construct(t,n||[],vU(e).constructor):t.apply(e,n))}function hU(e,t){if(t&&(sU(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return gU(e)}function gU(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function _U(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_U=function(){return!!e})()}function vU(e){return vU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vU(e)}function yU(e,t){if(typeof t!=`function`&&t!==null)throw 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&&bU(e,t)}function bU(e,t){return bU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bU(e,t)}function xU(e,t,n){return t=SU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SU(e){var t=CU(e,`string`);return sU(t)==`symbol`?t:t+``}function CU(e,t){if(sU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(sU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var wU=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,i=e.x,a=e.width,o=e.travellerWidth;if(!t||!t.length)return{};var s=t.length,c=PO().domain((0,oU.default)(0,s)).range([i,i+a-o]),l=c.domain().map(function(e){return c(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(n),endX:c(r),scale:c,scaleValues:l}},TU=function(e){return e.changedTouches&&!!e.changedTouches.length},EU=function(e){function t(e){var n;return dU(this,t),n=mU(this,t,[e]),xU(n,`handleDrag`,function(e){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(e):n.state.isSlideMoving&&n.handleSlideDrag(e)}),xU(n,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&n.handleDrag(e.changedTouches[0])}),xU(n,`handleDragEnd`,function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=n.props,t=e.endIndex,r=e.onDragEnd,i=e.startIndex;r?.({endIndex:t,startIndex:i})}),n.detachDragEndListener()}),xU(n,`handleLeaveWrapper`,function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),xU(n,`handleEnterSlideOrTraveller`,function(){n.setState({isTextActive:!0})}),xU(n,`handleLeaveSlideOrTraveller`,function(){n.setState({isTextActive:!1})}),xU(n,`handleSlideDragStart`,function(e){var t=TU(e)?e.changedTouches[0]:e;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:t.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,`startX`),endX:n.handleTravellerDragStart.bind(n,`endX`)},n.state={},n}return yU(t,e),pU(t,[{key:`componentWillUnmount`,value:function(){this.leaveTimer&&=(clearTimeout(this.leaveTimer),null),this.detachDragEndListener()}},{key:`getIndex`,value:function(e){var n=e.startX,r=e.endX,i=this.state.scaleValues,a=this.props,o=a.gap,s=a.data.length-1,c=Math.min(n,r),l=Math.max(n,r),u=t.getIndexInRange(i,c),d=t.getIndexInRange(i,l);return{startIndex:u-u%o,endIndex:d===s?s:d-d%o}}},{key:`getTextOfTick`,value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,i=t.dataKey,a=CF(n[e],i,e);return(0,Wb.default)(r)?r(a,e):a}},{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(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,i=t.endX,a=this.props,o=a.x,s=a.width,c=a.travellerWidth,l=a.startIndex,u=a.endIndex,d=a.onChange,f=e.pageX-n;f>0?f=Math.min(f,o+s-c-i,o+s-c-r):f<0&&(f=Math.max(f,o-r,o-i));var p=this.getIndex({startX:r+f,endX:i+f});(p.startIndex!==l||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:i+f,slideMoveStartX:e.pageX})}},{key:`handleTravellerDragStart`,value:function(e,t){var n=TU(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:`handleTravellerMove`,value:function(e){var t=this.state,n=t.brushMoveStartX,r=t.movingTravellerId,i=t.endX,a=t.startX,o=this.state[r],s=this.props,c=s.x,l=s.width,u=s.travellerWidth,d=s.onChange,f=s.gap,p=s.data,m={startX:this.state.startX,endX:this.state.endX},h=e.pageX-n;h>0?h=Math.min(h,c+l-u-o):h<0&&(h=Math.max(h,c-o)),m[r]=o+h;var g=this.getIndex(m),_=g.startIndex,v=g.endIndex,y=function(){var e=p.length-1;return r===`startX`&&(i>a?_%f===0:v%f===0)||i<a&&v===e||r===`endX`&&(i>a?v%f===0:_%f===0)||i>a&&v===e};this.setState(xU(xU({},r,o+h),`brushMoveStartX`,e.pageX),function(){d&&y()&&d(g)})}},{key:`handleTravellerMoveKeyboard`,value:function(e,t){var n=this,r=this.state,i=r.scaleValues,a=r.startX,o=r.endX,s=this.state[t],c=i.indexOf(s);if(c!==-1){var l=c+e;if(!(l===-1||l>=i.length)){var u=i[l];t===`startX`&&u>=o||t===`endX`&&u<=a||this.setState(xU({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:`renderBackground`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.fill,o=e.stroke;return _.createElement(`rect`,{stroke:o,fill:a,x:t,y:n,width:r,height:i})}},{key:`renderPanorama`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.data,o=e.children,s=e.padding,c=_.Children.only(o);return c?_.cloneElement(c,{x:t,y:n,width:r,height:i,margin:s,compact:!0,data:a}):null}},{key:`renderTravellerLayer`,value:function(e,n){var r=this,i=this.props,a=i.y,o=i.travellerWidth,s=i.height,c=i.traveller,l=i.ariaLabel,u=i.data,d=i.startIndex,f=i.endIndex,p=Math.max(e,this.props.x),m=uU(uU({},lx(this.props,!1)),{},{x:p,y:a,width:o,height:s}),h=l||`Min value: ${u[d]?.name}, Max value: ${u[f]?.name}`;return _.createElement(wx,{tabIndex:0,role:`slider`,"aria-label":h,"aria-valuenow":e,className:`recharts-brush-traveller`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[n],onTouchStart:this.travellerDragStartHandlers[n],onKeyDown:function(e){[`ArrowLeft`,`ArrowRight`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),r.handleTravellerMoveKeyboard(e.key===`ArrowRight`?1:-1,n))},onFocus:function(){r.setState({isTravellerFocused:!0})},onBlur:function(){r.setState({isTravellerFocused:!1})},style:{cursor:`col-resize`}},t.renderTraveller(c,m))}},{key:`renderSlide`,value:function(e,t){var n=this.props,r=n.y,i=n.height,a=n.stroke,o=n.travellerWidth,s=Math.min(e,t)+o,c=Math.max(Math.abs(t-e)-o,0);return _.createElement(`rect`,{className:`recharts-brush-slide`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:`move`},stroke:`none`,fill:a,fillOpacity:.2,x:s,y:r,width:c,height:i})}},{key:`renderText`,value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,r=e.y,i=e.height,a=e.travellerWidth,o=e.stroke,s=this.state,c=s.startX,l=s.endX,u=5,d={pointerEvents:`none`,fill:o};return _.createElement(wx,{className:`recharts-brush-texts`},_.createElement(QD,cU({textAnchor:`end`,verticalAnchor:`middle`,x:Math.min(c,l)-u,y:r+i/2},d),this.getTextOfTick(t)),_.createElement(QD,cU({textAnchor:`start`,verticalAnchor:`middle`,x:Math.max(c,l)+a+u,y:r+i/2},d),this.getTextOfTick(n)))}},{key:`render`,value:function(){var e=this.props,t=e.data,n=e.className,r=e.children,i=e.x,a=e.y,o=e.width,s=e.height,c=e.alwaysShowText,l=this.state,u=l.startX,d=l.endX,f=l.isTextActive,p=l.isSlideMoving,m=l.isTravellerMoving,h=l.isTravellerFocused;if(!t||!t.length||!X(i)||!X(a)||!X(o)||!X(s)||o<=0||s<=0)return null;var g=Vt(`recharts-brush`,n),v=_.Children.count(r)===1,y=aU(`userSelect`,`none`);return _.createElement(wx,{className:g,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:y},this.renderBackground(),v&&this.renderPanorama(),this.renderSlide(u,d),this.renderTravellerLayer(u,`startX`),this.renderTravellerLayer(d,`endX`),(f||p||m||h||c)&&this.renderText())}}],[{key:`renderDefaultTraveller`,value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.stroke,o=Math.floor(n+i/2)-1;return _.createElement(_.Fragment,null,_.createElement(`rect`,{x:t,y:n,width:r,height:i,fill:a,stroke:`none`}),_.createElement(`line`,{x1:t+1,y1:o,x2:t+r-1,y2:o,fill:`none`,stroke:`#fff`}),_.createElement(`line`,{x1:t+1,y1:o+2,x2:t+r-1,y2:o+2,fill:`none`,stroke:`#fff`}))}},{key:`renderTraveller`,value:function(e,n){return _.isValidElement(e)?_.cloneElement(e,n):(0,Wb.default)(e)?e(n):t.renderDefaultTraveller(n)}},{key:`getDerivedStateFromProps`,value:function(e,t){var n=e.data,r=e.width,i=e.x,a=e.travellerWidth,o=e.updateId,s=e.startIndex,c=e.endIndex;if(n!==t.prevData||o!==t.prevUpdateId)return uU({prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r},n&&n.length?wU({data:n,width:r,x:i,travellerWidth:a,startIndex:s,endIndex:c}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||i!==t.prevX||a!==t.prevTravellerWidth)){t.scale.range([i,i+r-a]);var l=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:l}}return null}},{key:`getIndexInRange`,value:function(e,t){for(var n=e.length,r=0,i=n-1;i-r>1;){var a=Math.floor((r+i)/2);e[a]>t?i=a:r=a}return t>=e[i]?i:r}}])}(_.PureComponent);xU(EU,`displayName`,`Brush`),xU(EU,`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 DU=o(((e,t)=>{var n=cT();function r(e,t){var r;return n(e,function(e,n,i){return r=t(e,n,i),!r}),!!r}t.exports=r})),OU=o(((e,t)=>{var n=zC(),r=xw(),i=DU(),a=fy(),o=vT();function s(e,t,s){var c=a(e)?n:i;return s&&o(e,t,s)&&(t=void 0),c(e,r(t,3))}t.exports=s})),kU=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r=`extendDomain`),r===t},AU=o(((e,t)=>{var n=_T();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),jU=o(((e,t)=>{var n=AU(),r=oT(),i=xw();function a(e,t){var a={};return t=i(t,3),r(e,function(e,r,i){n(a,r,t(e,r,i))}),a}t.exports=a})),MU=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}t.exports=n})),NU=o(((e,t)=>{var n=cT();function r(e,t){var r=!0;return n(e,function(e,n,i){return r=!!t(e,n,i),r}),r}t.exports=r})),PU=o(((e,t)=>{var n=MU(),r=NU(),i=xw(),a=fy(),o=vT();function s(e,t,s){var c=a(e)?n:r;return s&&o(e,t,s)&&(t=void 0),c(e,i(t,3))}t.exports=s})),FU=[`x`,`y`];function IU(e){"@babel/helpers - typeof";return IU=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},IU(e)}function LU(){return LU=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},LU.apply(this,arguments)}function RU(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zU(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?RU(Object(n),!0).forEach(function(t){BU(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RU(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function BU(e,t,n){return t=VU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VU(e){var t=HU(e,`string`);return IU(t)==`symbol`?t:t+``}function HU(e,t){if(IU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(IU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function UU(e,t){if(e==null)return{};var n=WU(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WU(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 GU(e,t){var n=e.x,r=e.y,i=UU(e,FU),a=`${n}`,o=parseInt(a,10),s=`${r}`,c=parseInt(s,10),l=`${t.height||i.height}`,u=parseInt(l,10),d=`${t.width||i.width}`,f=parseInt(d,10);return zU(zU(zU(zU(zU({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function KU(e){return _.createElement(vH,LU({shapeType:`rectangle`,propTransformer:GU,activeClassName:`recharts-active-bar`},e))}var qU=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,r){if(typeof e==`number`)return e;var i=X(n)||Cb(n);return i?e(n,r):(!i&&OP(!1),t)}},JU=[`value`,`background`],YU;function XU(e){"@babel/helpers - typeof";return XU=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},XU(e)}function ZU(e,t){if(e==null)return{};var n=QU(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QU(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 $U(){return $U=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},$U.apply(this,arguments)}function eW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?eW(Object(n),!0).forEach(function(t){fW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nW(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function rW(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,pW(r.key),r)}}function iW(e,t,n){return t&&rW(e.prototype,t),n&&rW(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function aW(e,t,n){return t=lW(t),oW(e,cW()?Reflect.construct(t,n||[],lW(e).constructor):t.apply(e,n))}function oW(e,t){if(t&&(XU(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return sW(e)}function sW(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function cW(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cW=function(){return!!e})()}function lW(e){return lW=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lW(e)}function uW(e,t){if(typeof t!=`function`&&t!==null)throw 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&&dW(e,t)}function dW(e,t){return dW=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dW(e,t)}function fW(e,t,n){return t=pW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pW(e){var t=mW(e,`string`);return XU(t)==`symbol`?t:t+``}function mW(e,t){if(XU(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(XU(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var hW=function(e){function t(){var e;nW(this,t);var n=[...arguments];return e=aW(this,t,[].concat(n)),fW(e,`state`,{isAnimationFinished:!1}),fW(e,`id`,Eb(`recharts-bar-`)),fW(e,`handleAnimationEnd`,function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),fW(e,`handleAnimationStart`,function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return uW(t,e),iW(t,[{key:`renderRectanglesStatically`,value:function(e){var t=this,n=this.props,r=n.shape,i=n.dataKey,a=n.activeIndex,o=n.activeBar,s=lx(this.props,!1);return e&&e.map(function(e,n){var c=n===a,l=c?o:r,u=tW(tW(tW({},s),e),{},{isActive:c,option:l,index:n,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return _.createElement(wx,$U({className:`recharts-bar-rectangle`},Ub(t.props,e,n),{key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${n}`}),_.createElement(KU,u))})}},{key:`renderRectanglesWithAnimation`,value:function(){var e=this,t=this.props,n=t.data,r=t.layout,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,s=t.animationEasing,c=t.animationId,l=this.state.prevData;return _.createElement($z,{begin:a,duration:o,isActive:i,easing:s,from:{t:0},to:{t:1},key:`bar-${c}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var i=t.t,a=n.map(function(e,t){var n=l&&l[t];if(n){var a=Ab(n.x,e.x),o=Ab(n.y,e.y),s=Ab(n.width,e.width),c=Ab(n.height,e.height);return tW(tW({},e),{},{x:a(i),y:o(i),width:s(i),height:c(i)})}if(r===`horizontal`){var u=Ab(0,e.height)(i);return tW(tW({},e),{},{y:e.y+e.height-u,height:u})}var d=Ab(0,e.width)(i);return tW(tW({},e),{},{width:d})});return _.createElement(wx,null,e.renderRectanglesStatically(a))})}},{key:`renderRectangles`,value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!(0,uF.default)(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:`renderBackground`,value:function(){var e=this,t=this.props,n=t.data,r=t.dataKey,i=t.activeIndex,a=lx(this.props.background,!1);return n.map(function(t,n){t.value;var o=t.background,s=ZU(t,JU);if(!o)return null;var c=tW(tW(tW(tW(tW({},s),{},{fill:`#eee`},o),a),Ub(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return _.createElement(KU,$U({key:`background-bar-${n}`,option:e.props.background,isActive:n===i},c))})}},{key:`renderErrorBar`,value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.data,i=n.xAxis,a=n.yAxis,o=n.layout,s=n.children,c=nx(s,$P);if(!c)return null;var l=o===`vertical`?r[0].height/2:r[0].width/2,u=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:CF(e,t)}},d={clipPath:e?`url(#clipPath-${t})`:null};return _.createElement(wx,d,c.map(function(e){return _.cloneElement(e,{key:`error-bar-${t}-${e.props.dataKey}`,data:r,xAxis:i,yAxis:a,layout:o,offset:l,dataPointFormatter:u})}))}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.data,r=e.className,i=e.xAxis,a=e.yAxis,o=e.left,s=e.top,c=e.width,l=e.height,u=e.isAnimationActive,d=e.background,f=e.id;if(t||!n||!n.length)return null;var p=this.state.isAnimationFinished,m=Vt(`recharts-bar`,r),h=i&&i.allowDataOverflow,g=a&&a.allowDataOverflow,v=h||g,y=(0,bb.default)(f)?this.id:f;return _.createElement(wx,{className:m},h||g?_.createElement(`defs`,null,_.createElement(`clipPath`,{id:`clipPath-${y}`},_.createElement(`rect`,{x:h?o:o-c/2,y:g?s:s-l/2,width:h?c:c*2,height:g?l:l*2}))):null,_.createElement(wx,{className:`recharts-bar-rectangles`,clipPath:v?`url(#clipPath-${y})`:null},d?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(v,y),(!u||p)&&vL.renderCallByParent(this.props,n))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.data===t.curData?null:{curData:e.data}:{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}}}])}(_.PureComponent);YU=hW,fW(hW,`displayName`,`Bar`),fW(hW,`defaultProps`,{xAxisId:0,yAxisId:0,legendType:`rect`,minPointSize:0,hide:!1,data:[],layout:`vertical`,activeBar:!1,isAnimationActive:!lE.isSsr,animationBegin:0,animationDuration:400,animationEasing:`ease`}),fW(hW,`getComposedData`,function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,s=e.xAxisTicks,c=e.yAxisTicks,l=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,p=VF(r,n);if(!p)return null;var m=t.layout,h=n.type.defaultProps,g=h===void 0?n.props:tW(tW({},h),n.props),_=g.dataKey,v=g.children,y=g.minPointSize,b=m===`horizontal`?o:a,x=l?b.scale.domain():null,S=YF({numericAxis:b}),C=nx(v,JE);return tW({data:d.map(function(e,t){var r,d,f,h,g,v;l?r=HF(l[u+t],x):(r=CF(e,_),Array.isArray(r)||(r=[S,r]));var b=qU(y,YU.defaultProps.minPointSize)(r[1],t);if(m===`horizontal`){var w=[o.scale(r[0]),o.scale(r[1])],T=w[0],E=w[1];d=JF({axis:a,ticks:s,bandSize:i,offset:p.offset,entry:e,index:t}),f=E??T??void 0,h=p.size;var D=T-E;if(g=Number.isNaN(D)?0:D,v={x:d,y:o.y,width:h,height:o.height},Math.abs(b)>0&&Math.abs(g)<Math.abs(b)){var O=xb(g||b)*(Math.abs(b)-Math.abs(g));f-=O,g+=O}}else{var k=[a.scale(r[0]),a.scale(r[1])],A=k[0],j=k[1];if(d=A,f=JF({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:e,index:t}),h=j-A,g=p.size,v={x:a.x,y:f,width:a.width,height:g},Math.abs(b)>0&&Math.abs(h)<Math.abs(b)){var M=xb(h||b)*(Math.abs(b)-Math.abs(h));h+=M}}return tW(tW(tW({},e),{},{x:d,y:f,width:h,height:g,value:l?r:r[1],payload:e,background:v},C&&C[t]&&C[t].props),{},{tooltipPayload:[iI(n,e)],tooltipPosition:{x:d+h/2,y:f+g/2}})}),layout:m},f)});var gW=l(jU()),_W=l(PU());function vW(e){"@babel/helpers - typeof";return vW=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},vW(e)}function yW(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function bW(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,TW(r.key),r)}}function xW(e,t,n){return t&&bW(e.prototype,t),n&&bW(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function SW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?SW(Object(n),!0).forEach(function(t){wW(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SW(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wW(e,t,n){return t=TW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TW(e){var t=EW(e,`string`);return vW(t)==`symbol`?t:t+``}function EW(e,t){if(vW(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(vW(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var DW=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.layout,c=e.children,l=Object.keys(t),u={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:o-n.bottom,bottomMirror:o-n.bottom},d=!!rx(c,hW);return l.reduce(function(a,o){var c=t[o],l=c.orientation,f=c.domain,p=c.padding,m=p===void 0?{}:p,h=c.mirror,g=c.reversed,_=`${l}${h?`Mirror`:``}`,v,y,b,x,S;if(c.type===`number`&&(c.padding===`gap`||c.padding===`no-gap`)){var C=f[1]-f[0],w=1/0,T=c.categoricalDomain.sort(Mb);if(T.forEach(function(e,t){t>0&&(w=Math.min((e||0)-(T[t-1]||0),w))}),Number.isFinite(w)){var E=w/C,D=c.layout===`vertical`?n.height:n.width;if(c.padding===`gap`&&(v=E*D/2),c.padding===`no-gap`){var O=Db(e.barCategoryGap,E*D),k=E*D/2;v=k-O-(k-O)/D*O}}}y=r===`xAxis`?[n.left+(m.left||0)+(v||0),n.left+n.width-(m.right||0)-(v||0)]:r===`yAxis`?s===`horizontal`?[n.top+n.height-(m.bottom||0),n.top+(m.top||0)]:[n.top+(m.top||0)+(v||0),n.top+n.height-(m.bottom||0)-(v||0)]:c.range,g&&(y=[y[1],y[0]]);var A=RF(c,i,d),j=A.scale,M=A.realScaleType;j.domain(f).range(y),BF(j);var N=KF(j,CW(CW({},c),{},{realScaleType:M}));r===`xAxis`?(S=l===`top`&&!h||l===`bottom`&&h,b=n.left,x=u[_]-S*c.height):r===`yAxis`&&(S=l===`left`&&!h||l===`right`&&h,b=u[_]-S*c.width,x=n.top);var P=CW(CW(CW({},c),N),{},{realScaleType:M,x:b,y:x,scale:j,width:r===`xAxis`?n.width:c.width,height:r===`yAxis`?n.height:c.height});return P.bandSize=nI(P,N),!c.hide&&r===`xAxis`?u[_]+=(S?-1:1)*P.height:c.hide||(u[_]+=(S?-1:1)*P.width),CW(CW({},a),{},wW({},o,P))},{})},OW=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},kW=function(e){var t=e.x1,n=e.y1,r=e.x2,i=e.y2;return OW({x:t,y:n},{x:r,y:i})},AW=function(){function e(t){yW(this,e),this.scale=t}return xW(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(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.bandAware,r=t.position;if(e!==void 0){if(r)switch(r){case`start`:return this.scale(e);case`middle`:var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case`end`:var a=this.bandwidth?this.bandwidth():0;return this.scale(e)+a;default:return this.scale(e)}if(n){var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o}return this.scale(e)}}},{key:`isInRange`,value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],[{key:`create`,value:function(t){return new e(t)}}])}();wW(AW,`EPS`,1e-4);var jW=function(e){var t=Object.keys(e).reduce(function(t,n){return CW(CW({},t),{},wW({},n,AW.create(e[n])))},{});return CW(CW({},t),{},{apply:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.bandAware,i=n.position;return(0,gW.default)(e,function(e,n){return t[n].apply(e,{bandAware:r,position:i})})},isInRange:function(e){return(0,_W.default)(e,function(e,n){return t[n].isInRange(e)})}})};function MW(e){return(e%180+180)%180}var NW=function(e){var t=e.width,n=e.height,r=MW(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},PW=o(((e,t)=>{var n=xw(),r=ZC(),i=QC();function a(e){return function(t,a,o){var s=Object(t);if(!r(t)){var c=n(a,3);t=i(t),a=function(e){return c(s[e],e,s)}}var l=e(t,a,o);return l>-1?s[c?t[l]:l]:void 0}}t.exports=a})),FW=o(((e,t)=>{var n=YH();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),IW=o(((e,t)=>{var n=Sw(),r=xw(),i=FW(),a=Math.max;function o(e,t,o){var s=e==null?0:e.length;if(!s)return-1;var c=o==null?0:i(o);return c<0&&(c=a(s+c,0)),n(e,r(t,3),c)}t.exports=o})),LW=o(((e,t)=>{t.exports=PW()(IW())})),RW=(0,l(eb()).default)(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(``)});LW();var zW=(0,_.createContext)(void 0),BW=(0,_.createContext)(void 0),VW=(0,_.createContext)(void 0),HW=(0,_.createContext)({}),UW=(0,_.createContext)(void 0),WW=(0,_.createContext)(0),GW=(0,_.createContext)(0),KW=function(e){var t=e.state,n=t.xAxisMap,r=t.yAxisMap,i=t.offset,a=e.clipPathId,o=e.children,s=e.width,c=e.height,l=RW(i);return _.createElement(zW.Provider,{value:n},_.createElement(BW.Provider,{value:r},_.createElement(HW.Provider,{value:i},_.createElement(VW.Provider,{value:l},_.createElement(UW.Provider,{value:a},_.createElement(WW.Provider,{value:c},_.createElement(GW.Provider,{value:s},o)))))))},qW=function(){return(0,_.useContext)(UW)},JW=function(e){var t=(0,_.useContext)(zW);t??OP(!1);var n=t[e];return n??OP(!1),n},YW=function(e){var t=(0,_.useContext)(BW);t??OP(!1);var n=t[e];return n??OP(!1),n},XW=function(){return(0,_.useContext)(VW)},ZW=function(){return(0,_.useContext)(GW)},QW=function(){return(0,_.useContext)(WW)},$W=l(OU());function eG(e){"@babel/helpers - typeof";return eG=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},eG(e)}function tG(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function nG(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,mG(r.key),r)}}function rG(e,t,n){return t&&nG(e.prototype,t),n&&nG(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function iG(e,t,n){return t=cG(t),aG(e,sG()?Reflect.construct(t,n||[],cG(e).constructor):t.apply(e,n))}function aG(e,t){if(t&&(eG(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return oG(e)}function oG(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function sG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sG=function(){return!!e})()}function cG(e){return cG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cG(e)}function lG(e,t){if(typeof t!=`function`&&t!==null)throw 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&&uG(e,t)}function uG(e,t){return uG=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},uG(e,t)}function dG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dG(Object(n),!0).forEach(function(t){pG(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pG(e,t,n){return t=mG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mG(e){var t=hG(e,`string`);return eG(t)==`symbol`?t:t+``}function hG(e,t){if(eG(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(eG(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gG(e,t){return xG(e)||bG(e,t)||vG(e,t)||_G()}function _G(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vG(e,t){if(e){if(typeof e==`string`)return yG(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 yG(e,t)}}function yG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bG(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function xG(e){if(Array.isArray(e))return e}function SG(){return SG=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},SG.apply(this,arguments)}var CG=function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,Wb.default)(e)?e(t):_.createElement(`line`,SG({},t,{className:`recharts-reference-line-line`}))},wG=function(e,t,n,r,i,a,o,s,c){var l=i.x,u=i.y,d=i.width,f=i.height;if(n){var p=c.y,m=e.y.apply(p,{position:a});if(kU(c,`discard`)&&!e.y.isInRange(m))return null;var h=[{x:l+d,y:m},{x:l,y:m}];return s===`left`?h.reverse():h}if(t){var g=c.x,_=e.x.apply(g,{position:a});if(kU(c,`discard`)&&!e.x.isInRange(_))return null;var v=[{x:_,y:u+f},{x:_,y:u}];return o===`top`?v.reverse():v}if(r){var y=c.segment.map(function(t){return e.apply(t,{position:a})});return kU(c,`discard`)&&(0,$W.default)(y,function(t){return!e.isInRange(t)})?null:y}return null};function TG(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,s=e.className;e.alwaysShow;var c=qW(),l=JW(i),u=YW(a),d=XW();if(!c||!d)return null;var f=wG(jW({x:l.scale,y:u.scale}),wb(t),wb(n),r&&r.length===2,d,e.position,l.orientation,u.orientation,e);if(!f)return null;var p=gG(f,2),m=p[0],h=m.x,g=m.y,v=p[1],y=v.x,b=v.y,x=fG(fG({clipPath:kU(e,`hidden`)?`url(#${c})`:void 0},lx(e,!0)),{},{x1:h,y1:g,x2:y,y2:b});return _.createElement(wx,{className:Vt(`recharts-reference-line`,s)},CG(o,x),XI.renderCallByParent(e,kW({x1:h,y1:g,x2:y,y2:b})))}var EG=function(e){function t(){return tG(this,t),iG(this,t,arguments)}return lG(t,e),rG(t,[{key:`render`,value:function(){return _.createElement(TG,this.props)}}])}(_.Component);pG(EG,`displayName`,`ReferenceLine`),pG(EG,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,fill:`none`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1,position:`middle`});function DG(){return DG=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},DG.apply(this,arguments)}function OG(e){"@babel/helpers - typeof";return OG=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},OG(e)}function kG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kG(Object(n),!0).forEach(function(t){VG(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jG(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function MG(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,HG(r.key),r)}}function NG(e,t,n){return t&&MG(e.prototype,t),n&&MG(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function PG(e,t,n){return t=RG(t),FG(e,LG()?Reflect.construct(t,n||[],RG(e).constructor):t.apply(e,n))}function FG(e,t){if(t&&(OG(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return IG(e)}function IG(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function LG(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LG=function(){return!!e})()}function RG(e){return RG=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},RG(e)}function zG(e,t){if(typeof t!=`function`&&t!==null)throw 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&&BG(e,t)}function BG(e,t){return BG=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},BG(e,t)}function VG(e,t,n){return t=HG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HG(e){var t=UG(e,`string`);return OG(t)==`symbol`?t:t+``}function UG(e,t){if(OG(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(OG(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var WG=function(e){var t=e.x,n=e.y,r=e.xAxis,i=e.yAxis,a=jW({x:r.scale,y:i.scale}),o=a.apply({x:t,y:n},{bandAware:!0});return kU(e,`discard`)&&!a.isInRange(o)?null:o},GG=function(e){function t(){return jG(this,t),PG(this,t,arguments)}return zG(t,e),NG(t,[{key:`render`,value:function(){var e=this.props,n=e.x,r=e.y,i=e.r;e.alwaysShow;var a=e.clipPathId,o=wb(n),s=wb(r);if(!o||!s)return null;var c=WG(this.props);if(!c)return null;var l=c.x,u=c.y,d=this.props,f=d.shape,p=d.className,m=AG(AG({clipPath:kU(this.props,`hidden`)?`url(#${a})`:void 0},lx(this.props,!0)),{},{cx:l,cy:u});return _.createElement(wx,{className:Vt(`recharts-reference-dot`,p)},t.renderDot(f,m),XI.renderCallByParent(this.props,{x:l-i,y:u-i,width:2*i,height:2*i}))}}])}(_.Component);VG(GG,`displayName`,`ReferenceDot`),VG(GG,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#fff`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1}),VG(GG,`renderDot`,function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,Wb.default)(e)?e(t):_.createElement(NB,DG({},t,{cx:t.cx,cy:t.cy,className:`recharts-reference-dot-dot`}))});function KG(){return KG=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},KG.apply(this,arguments)}function qG(e){"@babel/helpers - typeof";return qG=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},qG(e)}function JG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?JG(Object(n),!0).forEach(function(t){oK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JG(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function XG(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ZG(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,sK(r.key),r)}}function QG(e,t,n){return t&&ZG(e.prototype,t),n&&ZG(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $G(e,t,n){return t=rK(t),eK(e,nK()?Reflect.construct(t,n||[],rK(e).constructor):t.apply(e,n))}function eK(e,t){if(t&&(qG(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return tK(e)}function tK(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function nK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nK=function(){return!!e})()}function rK(e){return rK=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rK(e)}function iK(e,t){if(typeof t!=`function`&&t!==null)throw 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&&aK(e,t)}function aK(e,t){return aK=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aK(e,t)}function oK(e,t,n){return t=sK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sK(e){var t=cK(e,`string`);return qG(t)==`symbol`?t:t+``}function cK(e,t){if(qG(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(qG(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var lK=function(e,t,n,r,i){var a=i.x1,o=i.x2,s=i.y1,c=i.y2,l=i.xAxis,u=i.yAxis;if(!l||!u)return null;var d=jW({x:l.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:`start`}):d.x.rangeMin,y:n?d.y.apply(s,{position:`start`}):d.y.rangeMin},p={x:t?d.x.apply(o,{position:`end`}):d.x.rangeMax,y:r?d.y.apply(c,{position:`end`}):d.y.rangeMax};return kU(i,`discard`)&&(!d.isInRange(f)||!d.isInRange(p))?null:OW(f,p)},uK=function(e){function t(){return XG(this,t),$G(this,t,arguments)}return iK(t,e),QG(t,[{key:`render`,value:function(){var e=this.props,n=e.x1,r=e.x2,i=e.y1,a=e.y2,o=e.className;e.alwaysShow;var s=e.clipPathId,c=wb(n),l=wb(r),u=wb(i),d=wb(a),f=this.props.shape;if(!c&&!l&&!u&&!d&&!f)return null;var p=lK(c,l,u,d,this.props);if(!p&&!f)return null;var m=kU(this.props,`hidden`)?`url(#${s})`:void 0;return _.createElement(wx,{className:Vt(`recharts-reference-area`,o)},t.renderRect(f,YG(YG({clipPath:m},lx(this.props,!0)),p)),XI.renderCallByParent(this.props,p))}}])}(_.Component);oK(uK,`displayName`,`ReferenceArea`),oK(uK,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#ccc`,fillOpacity:.5,stroke:`none`,strokeWidth:1}),oK(uK,`renderRect`,function(e,t){return _.isValidElement(e)?_.cloneElement(e,t):(0,Wb.default)(e)?e(t):_.createElement(gB,KG({},t,{className:`recharts-reference-area-rect`}))});function dK(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)if(n===void 0||n(e[i])===!0)r.push(e[i]);else return;return r}function fK(e,t,n){return NW({width:e.width+t.width,height:e.height+t.height},n)}function pK(e,t,n){var r=n===`width`,i=e.x,a=e.y,o=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function mK(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function hK(e,t){return dK(e,t+1)}function gK(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:dK(r,l)};var a=c,d,f=function(){return d===void 0&&(d=n(t,a)),d},p=t.coordinate,m=c===0||mK(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function _K(e){"@babel/helpers - typeof";return _K=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},_K(e)}function vK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vK(Object(n),!0).forEach(function(t){bK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bK(e,t,n){return t=xK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xK(e){var t=SK(e,`string`);return _K(t)==`symbol`?t:t+``}function SK(e,t){if(_K(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_K(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function CK(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,s=t.start,c=t.end,l=function(t){var r=a[t],l,u=function(){return l===void 0&&(l=n(r,t)),l};if(t===o-1){var d=e*(r.coordinate+e*u()/2-c);a[t]=r=yK(yK({},r),{},{tickCoord:d>0?r.coordinate-d*e:r.coordinate})}else a[t]=r=yK(yK({},r),{},{tickCoord:r.coordinate});mK(e,r.tickCoord,u,s,c)&&(c=r.tickCoord-e*(u()/2+i),a[t]=yK(yK({},r),{},{isShow:!0}))},u=o-1;u>=0;u--)l(u);return a}function wK(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var u=r[s-1],d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=yK(yK({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),mK(e,u.tickCoord,function(){return d},c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=yK(yK({},u),{},{isShow:!0}))}for(var p=a?s-1:s,m=function(t){var r=o[t],a,s=function(){return a===void 0&&(a=n(r,t)),a};if(t===0){var u=e*(r.coordinate-e*s()/2-c);o[t]=r=yK(yK({},r),{},{tickCoord:u<0?r.coordinate-u*e:r.coordinate})}else o[t]=r=yK(yK({},r),{},{tickCoord:r.coordinate});mK(e,r.tickCoord,s,c,l)&&(c=r.tickCoord+e*(s()/2+i),o[t]=yK(yK({},r),{},{isShow:!0}))},h=0;h<p;h++)m(h);return o}function TK(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,s=e.orientation,c=e.interval,l=e.tickFormatter,u=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(X(c)||lE.isSsr)return hK(i,typeof c==`number`&&X(c)?c:0);var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?oD(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=function(e,r){var i=(0,Wb.default)(l)?l(e.value,r):e.value;return p===`width`?fK(oD(i,{fontSize:t,letterSpacing:n}),m,d):oD(i,{fontSize:t,letterSpacing:n})[p]},g=i.length>=2?xb(i[1].coordinate-i[0].coordinate):1,_=pK(a,g,p);return c===`equidistantPreserveStart`?gK(g,_,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?wK(g,_,h,i,o,c===`preserveStartEnd`):CK(g,_,h,i,o),f.filter(function(e){return e.isShow}))}var EK=[`viewBox`],DK=[`viewBox`],OK=[`ticks`];function kK(e){"@babel/helpers - typeof";return kK=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},kK(e)}function AK(){return AK=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},AK.apply(this,arguments)}function jK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function MK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jK(Object(n),!0).forEach(function(t){GK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function NK(e,t){if(e==null)return{};var n=PK(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function PK(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 FK(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function IK(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,KK(r.key),r)}}function LK(e,t,n){return t&&IK(e.prototype,t),n&&IK(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function RK(e,t,n){return t=HK(t),zK(e,VK()?Reflect.construct(t,n||[],HK(e).constructor):t.apply(e,n))}function zK(e,t){if(t&&(kK(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return BK(e)}function BK(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function VK(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VK=function(){return!!e})()}function HK(e){return HK=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},HK(e)}function UK(e,t){if(typeof t!=`function`&&t!==null)throw 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&&WK(e,t)}function WK(e,t){return WK=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},WK(e,t)}function GK(e,t,n){return t=KK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KK(e){var t=qK(e,`string`);return kK(t)==`symbol`?t:t+``}function qK(e,t){if(kK(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kK(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var JK=function(e){function t(e){var n;return FK(this,t),n=RK(this,t,[e]),n.state={fontSize:``,letterSpacing:``},n}return UK(t,e),LK(t,[{key:`shouldComponentUpdate`,value:function(e,t){var n=e.viewBox,r=NK(e,EK),i=this.props,a=i.viewBox,o=NK(i,DK);return!Nb(n,a)||!Nb(r,o)||!Nb(t,this.state)}},{key:`componentDidMount`,value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`)[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.x,r=t.y,i=t.width,a=t.height,o=t.orientation,s=t.tickSize,c=t.mirror,l=t.tickMargin,u,d,f,p,m,h,g=c?-1:1,_=e.tickSize||s,v=X(e.tickCoord)?e.tickCoord:e.coordinate;switch(o){case`top`:u=d=e.coordinate,p=r+ +!c*a,f=p-g*_,h=f-g*l,m=v;break;case`left`:f=p=e.coordinate,d=n+ +!c*i,u=d-g*_,m=u-g*l,h=v;break;case`right`:f=p=e.coordinate,d=n+ +c*i,u=d+g*_,m=u+g*l,h=v;break;default:u=d=e.coordinate,p=r+ +c*a,f=p+g*_,h=f+g*l,m=v}return{line:{x1:u,y1:f,x2:d,y2:p},tick:{x:m,y:h}}}},{key:`getTickTextAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r;switch(t){case`left`:r=n?`start`:`end`;break;case`right`:r=n?`end`:`start`;break;default:r=`middle`}return r}},{key:`getTickVerticalAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r=`end`;switch(t){case`left`:case`right`:r=`middle`;break;case`top`:r=n?`start`:`end`;break;default:r=n?`end`:`start`}return r}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,o=e.mirror,s=e.axisLine,c=MK(MK(MK({},lx(this.props,!1)),lx(s,!1)),{},{fill:`none`});if(a===`top`||a===`bottom`){var l=+(a===`top`&&!o||a===`bottom`&&o);c=MK(MK({},c),{},{x1:t,y1:n+l*i,x2:t+r,y2:n+l*i})}else{var u=+(a===`left`&&!o||a===`right`&&o);c=MK(MK({},c),{},{x1:t+u*r,y1:n,x2:t+u*r,y2:n+i})}return _.createElement(`line`,AK({},c,{className:Vt(`recharts-cartesian-axis-line`,(0,vb.default)(s,`className`))}))}},{key:`renderTicks`,value:function(e,n,r){var i=this,a=this.props,o=a.tickLine,s=a.stroke,c=a.tick,l=a.tickFormatter,u=a.unit,d=TK(MK(MK({},this.props),{},{ticks:e}),n,r),f=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),m=lx(this.props,!1),h=lx(c,!1),g=MK(MK({},m),{},{fill:`none`},lx(o,!1)),v=d.map(function(e,n){var r=i.getTickLineCoord(e),a=r.line,v=r.tick,y=MK(MK(MK(MK({textAnchor:f,verticalAnchor:p},m),{},{stroke:`none`,fill:s},h),v),{},{index:n,payload:e,visibleTicksCount:d.length,tickFormatter:l});return _.createElement(wx,AK({className:`recharts-cartesian-axis-tick`,key:`tick-${e.value}-${e.coordinate}-${e.tickCoord}`},Ub(i.props,e,n)),o&&_.createElement(`line`,AK({},g,a,{className:Vt(`recharts-cartesian-axis-tick-line`,(0,vb.default)(o,`className`))})),c&&t.renderTickItem(c,y,`${(0,Wb.default)(l)?l(e.value,n):e.value}${u||``}`))});return _.createElement(`g`,{className:`recharts-cartesian-axis-ticks`},v)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.axisLine,r=t.width,i=t.height,a=t.ticksGenerator,o=t.className;if(t.hide)return null;var s=this.props,c=s.ticks,l=NK(s,OK),u=c;return(0,Wb.default)(a)&&(u=c&&c.length>0?a(this.props):a(l)),r<=0||i<=0||!u||!u.length?null:_.createElement(wx,{className:Vt(`recharts-cartesian-axis`,o),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(u,this.state.fontSize,this.state.letterSpacing),XI.renderCallByParent(this.props))}}],[{key:`renderTickItem`,value:function(e,t,n){var r,i=Vt(t.className,`recharts-cartesian-axis-tick-value`);return r=_.isValidElement(e)?_.cloneElement(e,MK(MK({},t),{},{className:i})):(0,Wb.default)(e)?e(MK(MK({},t),{},{className:i})):_.createElement(QD,AK({},t,{className:`recharts-cartesian-axis-tick-value`}),n),r}}])}(_.Component);GK(JK,`displayName`,`CartesianAxis`),GK(JK,`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 YK=[`type`,`layout`,`connectNulls`,`ref`],XK=[`key`];function ZK(e){"@babel/helpers - typeof";return ZK=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ZK(e)}function QK(e,t){if(e==null)return{};var n=$K(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $K(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 eq(){return eq=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},eq.apply(this,arguments)}function tq(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tq(Object(n),!0).forEach(function(t){yq(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rq(e){return sq(e)||oq(e)||aq(e)||iq()}function iq(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
114
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aq(e,t){if(e){if(typeof e==`string`)return cq(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 cq(e,t)}}function oq(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function sq(e){if(Array.isArray(e))return cq(e)}function cq(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lq(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function uq(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,bq(r.key),r)}}function dq(e,t,n){return t&&uq(e.prototype,t),n&&uq(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fq(e,t,n){return t=gq(t),pq(e,hq()?Reflect.construct(t,n||[],gq(e).constructor):t.apply(e,n))}function pq(e,t){if(t&&(ZK(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return mq(e)}function mq(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function hq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hq=function(){return!!e})()}function gq(e){return gq=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gq(e)}function _q(e,t){if(typeof t!=`function`&&t!==null)throw 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&&vq(e,t)}function vq(e,t){return vq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vq(e,t)}function yq(e,t,n){return t=bq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bq(e){var t=xq(e,`string`);return ZK(t)==`symbol`?t:t+``}function xq(e,t){if(ZK(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ZK(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Sq=function(e){function t(){var e;lq(this,t);var n=[...arguments];return e=fq(this,t,[].concat(n)),yq(e,`state`,{isAnimationFinished:!0,totalLength:0}),yq(e,`generateSimpleStrokeDasharray`,function(e,t){return`${t}px ${e-t}px`}),yq(e,`getStrokeDasharray`,function(n,r,i){var a=i.reduce(function(e,t){return e+t});if(!a)return e.generateSimpleStrokeDasharray(r,n);for(var o=Math.floor(n/a),s=n%a,c=r-n,l=[],u=0,d=0;u<i.length;d+=i[u],++u)if(d+i[u]>s){l=[].concat(rq(i.slice(0,u)),[s-d]);break}var f=l.length%2==0?[0,c]:[c];return[].concat(rq(t.repeat(i,o)),rq(l),f).map(function(e){return`${e}px`}).join(`, `)}),yq(e,`id`,Eb(`recharts-line-`)),yq(e,`pathRef`,function(t){e.mainCurve=t}),yq(e,`handleAnimationEnd`,function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),yq(e,`handleAnimationStart`,function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return _q(t,e),dq(t,[{key:`componentDidMount`,value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:`componentDidUpdate`,value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:`getTotalLength`,value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}},{key:`renderErrorBar`,value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.points,i=n.xAxis,a=n.yAxis,o=n.layout,s=n.children,c=nx(s,$P);if(!c)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:CF(e.payload,t)}},u={clipPath:e?`url(#clipPath-${t})`:null};return _.createElement(wx,u,c.map(function(e){return _.cloneElement(e,{key:`bar-${e.props.dataKey}`,data:r,xAxis:i,yAxis:a,layout:o,dataPointFormatter:l})}))}},{key:`renderDots`,value:function(e,n,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,a=i.dot,o=i.points,s=i.dataKey,c=lx(this.props,!1),l=lx(a,!0),u=o.map(function(e,n){var r=nq(nq(nq({key:`dot-${n}`,r:3},c),l),{},{index:n,cx:e.x,cy:e.y,value:e.value,dataKey:s,payload:e.payload,points:o});return t.renderDotItem(a,r)}),d={clipPath:e?`url(#clipPath-${n?``:`dots-`}${r})`:null};return _.createElement(wx,eq({className:`recharts-line-dots`,key:`dots`},d),u)}},{key:`renderCurveStatically`,value:function(e,t,n,r){var i=this.props,a=i.type,o=i.layout,s=i.connectNulls;i.ref;var c=nq(nq(nq({},lx(QK(i,YK),!0)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:t?`url(#clipPath-${n})`:null,points:e},r),{},{type:a,layout:o,connectNulls:s});return _.createElement(GL,eq({},c,{pathRef:this.pathRef}))}},{key:`renderCurveWithAnimation`,value:function(e,t){var n=this,r=this.props,i=r.points,a=r.strokeDasharray,o=r.isAnimationActive,s=r.animationBegin,c=r.animationDuration,l=r.animationEasing,u=r.animationId,d=r.animateNewValues,f=r.width,p=r.height,m=this.state,h=m.prevPoints,g=m.totalLength;return _.createElement($z,{begin:s,duration:c,isActive:o,easing:l,from:{t:0},to:{t:1},key:`line-${u}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o=r.t;if(h){var s=h.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(h[n]){var r=h[n],i=Ab(r.x,e.x),a=Ab(r.y,e.y);return nq(nq({},e),{},{x:i(o),y:a(o)})}if(d){var c=Ab(f*2,e.x),l=Ab(p/2,e.y);return nq(nq({},e),{},{x:c(o),y:l(o)})}return nq(nq({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var l=Ab(0,g)(o),u;if(a){var m=`${a}`.split(/[,\s]+/gim).map(function(e){return parseFloat(e)});u=n.getStrokeDasharray(l,g,m)}else u=n.generateSimpleStrokeDasharray(g,l);return n.renderCurveStatically(i,e,t,{strokeDasharray:u})})}},{key:`renderCurve`,value:function(e,t){var n=this.props,r=n.points,i=n.isAnimationActive,a=this.state,o=a.prevPoints,s=a.totalLength;return i&&r&&r.length&&(!o&&s>0||!(0,uF.default)(o,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxis,o=e.yAxis,s=e.top,c=e.left,l=e.width,u=e.height,d=e.isAnimationActive,f=e.id;if(t||!r||!r.length)return null;var p=this.state.isAnimationFinished,m=r.length===1,h=Vt(`recharts-line`,i),g=a&&a.allowDataOverflow,v=o&&o.allowDataOverflow,y=g||v,b=(0,bb.default)(f)?this.id:f,x=lx(n,!1)??{r:3,strokeWidth:2},S=x.r,C=S===void 0?3:S,w=x.strokeWidth,T=w===void 0?2:w,E=(sx(n)?n:{}).clipDot,D=E===void 0||E,O=C*2+T;return _.createElement(wx,{className:h},g||v?_.createElement(`defs`,null,_.createElement(`clipPath`,{id:`clipPath-${b}`},_.createElement(`rect`,{x:g?c:c-l/2,y:v?s:s-u/2,width:g?l:l*2,height:v?u:u*2})),!D&&_.createElement(`clipPath`,{id:`clipPath-dots-${b}`},_.createElement(`rect`,{x:c-O/2,y:s-O/2,width:l+O,height:u+O}))):null,!m&&this.renderCurve(y,b),this.renderErrorBar(y,b),(m||n)&&this.renderDots(y,D,b),(!d||p)&&vL.renderCallByParent(this.props,r))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.points===t.curPoints?null:{curPoints:e.points}:{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}}},{key:`repeat`,value:function(e,t){for(var n=e.length%2==0?e:[].concat(rq(e),[0]),r=[],i=0;i<t;++i)r=[].concat(rq(r),rq(n));return r}},{key:`renderDotItem`,value:function(e,t){var n;if(_.isValidElement(e))n=_.cloneElement(e,t);else if((0,Wb.default)(e))n=e(t);else{var r=t.key,i=QK(t,XK),a=Vt(`recharts-line-dot`,typeof e==`boolean`?``:e.className);n=_.createElement(NB,eq({key:r},i,{className:a}))}return n}}])}(_.PureComponent);yq(Sq,`displayName`,`Line`),yq(Sq,`defaultProps`,{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,fill:`#fff`,points:[],isAnimationActive:!lE.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,hide:!1,label:!1}),yq(Sq,`getComposedData`,function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize,c=e.displayedData,l=e.offset,u=t.layout;return nq({points:c.map(function(e,t){var c=CF(e,o);return u===`horizontal`?{x:qF({axis:n,ticks:i,bandSize:s,entry:e,index:t}),y:(0,bb.default)(c)?null:r.scale(c),value:c,payload:e}:{x:(0,bb.default)(c)?null:n.scale(c),y:qF({axis:r,ticks:a,bandSize:s,entry:e,index:t}),value:c,payload:e}}),layout:u},l)});function Cq(e){"@babel/helpers - typeof";return Cq=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Cq(e)}function wq(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Tq(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,Fq(r.key),r)}}function Eq(e,t,n){return t&&Tq(e.prototype,t),n&&Tq(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dq(e,t,n){return t=jq(t),Oq(e,Aq()?Reflect.construct(t,n||[],jq(e).constructor):t.apply(e,n))}function Oq(e,t){if(t&&(Cq(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return kq(e)}function kq(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Aq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Aq=function(){return!!e})()}function jq(e){return jq=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jq(e)}function Mq(e,t){if(typeof t!=`function`&&t!==null)throw 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&&Nq(e,t)}function Nq(e,t){return Nq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nq(e,t)}function Pq(e,t,n){return t=Fq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fq(e){var t=Iq(e,`string`);return Cq(t)==`symbol`?t:t+``}function Iq(e,t){if(Cq(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Cq(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Lq(){return Lq=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},Lq.apply(this,arguments)}function Rq(e){var t=e.xAxisId,n=ZW(),r=QW(),i=JW(t);return i==null?null:_.createElement(JK,Lq({},i,{className:Vt(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return FF(e,!0)}}))}var zq=function(e){function t(){return wq(this,t),Dq(this,t,arguments)}return Mq(t,e),Eq(t,[{key:`render`,value:function(){return _.createElement(Rq,this.props)}}])}(_.Component);Pq(zq,`displayName`,`XAxis`),Pq(zq,`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 Bq(e){"@babel/helpers - typeof";return Bq=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Bq(e)}function Vq(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Hq(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,Qq(r.key),r)}}function Uq(e,t,n){return t&&Hq(e.prototype,t),n&&Hq(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wq(e,t,n){return t=Jq(t),Gq(e,qq()?Reflect.construct(t,n||[],Jq(e).constructor):t.apply(e,n))}function Gq(e,t){if(t&&(Bq(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Kq(e)}function Kq(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function qq(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qq=function(){return!!e})()}function Jq(e){return Jq=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Jq(e)}function Yq(e,t){if(typeof t!=`function`&&t!==null)throw 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&&Xq(e,t)}function Xq(e,t){return Xq=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Xq(e,t)}function Zq(e,t,n){return t=Qq(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qq(e){var t=$q(e,`string`);return Bq(t)==`symbol`?t:t+``}function $q(e,t){if(Bq(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Bq(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function eJ(){return eJ=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},eJ.apply(this,arguments)}var tJ=function(e){var t=e.yAxisId,n=ZW(),r=QW(),i=YW(t);return i==null?null:_.createElement(JK,eJ({},i,{className:Vt(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return FF(e,!0)}}))},nJ=function(e){function t(){return Vq(this,t),Wq(this,t,arguments)}return Yq(t,e),Uq(t,[{key:`render`,value:function(){return _.createElement(tJ,this.props)}}])}(_.Component);Zq(nJ,`displayName`,`YAxis`),Zq(nJ,`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 rJ(e){return sJ(e)||oJ(e)||aJ(e)||iJ()}function iJ(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
115
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aJ(e,t){if(e){if(typeof e==`string`)return cJ(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cJ(e,t)}}function oJ(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function sJ(e){if(Array.isArray(e))return cJ(e)}function cJ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var lJ=function(e,t,n,r,i){var a=nx(e,EG),o=nx(e,GG),s=[].concat(rJ(a),rJ(o)),c=nx(e,uK),l=`${r}Id`,u=r[0],d=t;if(s.length&&(d=s.reduce(function(e,t){if(t.props[l]===n&&kU(t.props,`extendDomain`)&&X(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),c.length){var f=`${u}1`,p=`${u}2`;d=c.reduce(function(e,t){if(t.props[l]===n&&kU(t.props,`extendDomain`)&&X(t.props[f])&&X(t.props[p])){var r=t.props[f],i=t.props[p];return[Math.min(e[0],r,i),Math.max(e[1],r,i)]}return e},d)}return i&&i.length&&(d=i.reduce(function(e,t){return X(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},uJ=new(l(o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))())).default,dJ=`recharts.syncMouseEvents`;function fJ(e){"@babel/helpers - typeof";return fJ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fJ(e)}function pJ(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function mJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,_J(r.key),r)}}function hJ(e,t,n){return t&&mJ(e.prototype,t),n&&mJ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function gJ(e,t,n){return t=_J(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _J(e){var t=vJ(e,`string`);return fJ(t)==`symbol`?t:t+``}function vJ(e,t){if(fJ(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fJ(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var yJ=function(){function e(){pJ(this,e),gJ(this,`activeIndex`,0),gJ(this,`coordinateList`,[]),gJ(this,`layout`,`horizontal`)}return hJ(e,[{key:`setDetails`,value:function(e){var t=e.coordinateList,n=t===void 0?null:t,r=e.container,i=r===void 0?null:r,a=e.layout,o=a===void 0?null:a,s=e.offset,c=s===void 0?null:s,l=e.mouseHandlerCallback,u=l===void 0?null:l;this.coordinateList=n??this.coordinateList??[],this.container=i??this.container,this.layout=o??this.layout,this.offset=c??this.offset,this.mouseHandlerCallback=u??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(e){if(this.coordinateList.length!==0)switch(e.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()}}},{key:`setIndex`,value:function(e){this.activeIndex=e}},{key:`spoofMouse`,value:function(){if(this.layout===`horizontal`&&this.coordinateList.length!==0){var e=this.container.getBoundingClientRect(),t=e.x,n=e.y,r=e.height,i=this.coordinateList[this.activeIndex].coordinate,a=window?.scrollX||0,o=window?.scrollY||0,s=t+i+a,c=n+this.offset.top+r/2+o;this.mouseHandlerCallback({pageX:s,pageY:c})}}}])}();function bJ(e,t,n){if(n===`number`&&t===!0&&Array.isArray(e)){var r=e?.[0],i=e?.[1];if(r&&i&&X(r)&&X(i))return!0}return!1}function xJ(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function SJ(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[yI(t,n,r,i),yI(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function CJ(e,t,n){var r,i,a,o;if(e===`horizontal`)r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e===`vertical`)i=t.y,o=i,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null){if(e===`centric`){var s=t.cx,c=t.cy,l=t.innerRadius,u=t.outerRadius,d=t.angle,f=yI(s,c,l,d),p=yI(s,c,u,d);r=f.x,i=f.y,a=p.x,o=p.y}else return SJ(t)}return[{x:r,y:i},{x:a,y:o}]}function wJ(e){"@babel/helpers - typeof";return wJ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},wJ(e)}function TJ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function EJ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?TJ(Object(n),!0).forEach(function(t){DJ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function DJ(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=kJ(e,`string`);return wJ(t)==`symbol`?t:t+``}function kJ(e,t){if(wJ(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(wJ(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function AJ(e){var t=e.element,n=e.tooltipEventType,r=e.isActive,i=e.activeCoordinate,a=e.activePayload,o=e.offset,s=e.activeTooltipIndex,c=e.tooltipAxisBandSize,l=e.layout,u=e.chartName,d=t.props.cursor??t.type.defaultProps?.cursor;if(!t||!d||!r||!i||u!==`ScatterChart`&&n!==`axis`)return null;var f,p=GL;if(u===`ScatterChart`)f=i,p=GB;else if(u===`BarChart`)f=xJ(l,i,o,c),p=gB;else if(l===`radial`){var m=SJ(i),h=m.cx,g=m.cy,v=m.radius;f={cx:h,cy:g,startAngle:m.startAngle,endAngle:m.endAngle,innerRadius:v,outerRadius:v},p=NL}else f={points:CJ(l,i,o)},p=GL;var y=EJ(EJ(EJ(EJ({stroke:`#ccc`,pointerEvents:`none`},o),f),lx(d,!1)),{},{payload:a,payloadIndex:s,className:Vt(`recharts-tooltip-cursor`,d.className)});return(0,_.isValidElement)(d)?(0,_.cloneElement)(d,y):(0,_.createElement)(p,y)}var jJ=[`item`],MJ=[`children`,`className`,`width`,`height`,`style`,`compact`,`title`,`desc`];function NJ(e){"@babel/helpers - typeof";return NJ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},NJ(e)}function PJ(){return PJ=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},PJ.apply(this,arguments)}function FJ(e,t){return RJ(e)||LJ(e,t)||$J(e,t)||IJ()}function IJ(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
116
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LJ(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function RJ(e){if(Array.isArray(e))return e}function zJ(e,t){if(e==null)return{};var n=BJ(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BJ(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 VJ(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function HJ(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,aY(r.key),r)}}function UJ(e,t,n){return t&&HJ(e.prototype,t),n&&HJ(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function WJ(e,t,n){return t=JJ(t),GJ(e,qJ()?Reflect.construct(t,n||[],JJ(e).constructor):t.apply(e,n))}function GJ(e,t){if(t&&(NJ(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return KJ(e)}function KJ(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function qJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qJ=function(){return!!e})()}function JJ(e){return JJ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JJ(e)}function YJ(e,t){if(typeof t!=`function`&&t!==null)throw 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&&XJ(e,t)}function XJ(e,t){return XJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},XJ(e,t)}function ZJ(e){return tY(e)||eY(e)||$J(e)||QJ()}function QJ(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
117
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $J(e,t){if(e){if(typeof e==`string`)return nY(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 nY(e,t)}}function eY(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function tY(e){if(Array.isArray(e))return nY(e)}function nY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?rY(Object(n),!0).forEach(function(t){iY(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rY(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iY(e,t,n){return t=aY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aY(e){var t=oY(e,`string`);return NJ(t)==`symbol`?t:t+``}function oY(e,t){if(NJ(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(NJ(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sY={xAxis:[`bottom`,`top`],yAxis:[`left`,`right`]},cY={width:`100%`,height:`100%`},lY={x:0,y:0};function uY(e){return e}var dY=function(e,t){return t===`horizontal`?e.x:t===`vertical`?e.y:t===`centric`?e.angle:e.radius},fY=function(e,t,n,r){var i=t.find(function(e){return e&&e.index===n});if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.y};if(e===`vertical`)return{x:r.x,y:i.coordinate};if(e===`centric`){var a=i.coordinate,o=r.radius;return Z(Z(Z({},r),yI(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return Z(Z(Z({},r),yI(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return lY},pY=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,i=t.dataEndIndex,a=(n??[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(ZJ(e),ZJ(n)):e},[]);return a.length>0?a:e&&e.length&&X(r)&&X(i)?e.slice(r,i+1):[]};function mY(e){return e===`number`?[0,`auto`]:void 0}var hY=function(e,t,n,r){var i=e.graphicalItems,a=e.tooltipAxis,o=pY(t,e);return n<0||!i||!i.length||n>=o.length?null:i.reduce(function(i,s){var c=s.props.data??t;c&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(c=c.slice(e.dataStartIndex,e.dataEndIndex+1));var l=a.dataKey&&!a.allowDuplicatedCategory?jb(c===void 0?o:c,a.dataKey,r):c&&c[n]||o[n];return l?[].concat(ZJ(i),[iI(s,l)]):i},[])},gY=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},a=dY(i,n),o=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,l=TF(a,o,c,s);if(l>=0&&c){var u=c[l]&&c[l].value;return{activeTooltipIndex:l,activeLabel:u,activePayload:hY(e,t,l,u),activeCoordinate:fY(n,o,l,i)}}return null},_Y=function(e,t){var n=t.axes,r=t.graphicalItems,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=e.stackOffset,f=PF(l,i);return n.reduce(function(t,n){var p=n.type.defaultProps===void 0?n.props:Z(Z({},n.type.defaultProps),n.props),m=p.type,h=p.dataKey,g=p.allowDataOverflow,_=p.allowDuplicatedCategory,v=p.scale,y=p.ticks,b=p.includeHidden,x=p[a];if(t[x])return t;var S=pY(e.data,{graphicalItems:r.filter(function(e){return(a in e.props?e.props[a]:e.type.defaultProps?.[a])===x}),dataStartIndex:s,dataEndIndex:c}),C=S.length,w,T,E;bJ(p.domain,g,m)&&(w=tI(p.domain,null,g),f&&(m===`number`||v!==`auto`)&&(E=wF(S,h,`category`)));var D=mY(m);if(!w||w.length===0){var O=p.domain??D;if(h){if(w=wF(S,h,m),m===`category`&&f){var k=kb(w);_&&k?(T=w,w=(0,oU.default)(0,C)):_||(w=rI(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(ZJ(e),[t])},[]))}else if(m===`category`)w=_?w.filter(function(e){return e!==``&&!(0,bb.default)(e)}):rI(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0||t===``||(0,bb.default)(t)?e:[].concat(ZJ(e),[t])},[]);else if(m===`number`){var A=MF(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===x&&(b||!n)}),h,i,l);A&&(w=A)}f&&(m===`number`||v!==`auto`)&&(E=wF(S,h,`category`))}else w=f?(0,oU.default)(0,C):o&&o[x]&&o[x].hasStack&&m===`number`?d===`expand`?[0,1]:QF(o[x].stackGroups,s,c):NF(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps.hide;return t===x&&(b||!n)}),m,l,!0);if(m===`number`)w=lJ(u,w,x,i,y),O&&(w=tI(O,w,g));else if(m===`category`&&O){var j=O;w.every(function(e){return j.indexOf(e)>=0})&&(w=j)}}return Z(Z({},t),{},iY({},x,Z(Z({},p),{},{axisType:i,domain:w,categoricalDomain:E,duplicateDomain:T,originalDomain:p.domain??D,isCategorical:f,layout:l})))},{})},vY=function(e,t){var n=t.graphicalItems,r=t.Axis,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=pY(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:c}),f=d.length,p=PF(l,i),m=-1;return n.reduce(function(e,t){var h=(t.type.defaultProps===void 0?t.props:Z(Z({},t.type.defaultProps),t.props))[a],g=mY(`number`);if(!e[h]){m++;var _;return p?_=(0,oU.default)(0,f):o&&o[h]&&o[h].hasStack?(_=QF(o[h].stackGroups,s,c),_=lJ(u,_,h,i)):(_=tI(g,NF(d,n.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===h&&!n}),`number`,l),r.defaultProps.allowDataOverflow),_=lJ(u,_,h,i)),Z(Z({},e),{},iY({},h,Z(Z({axisType:i},r.defaultProps),{},{hide:!0,orientation:(0,vb.default)(sY,`${i}.${m%2}`,null),domain:_,originalDomain:g,isCategorical:p,layout:l})))}return e},{})},yY=function(e,t){var n=t.axisType,r=n===void 0?`xAxis`:n,i=t.AxisComp,a=t.graphicalItems,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.children,u=`${r}Id`,d=nx(l,i),f={};return d&&d.length?f=_Y(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(f=vY(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c})),f},bY=function(e){var t=Ob(e),n=FF(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:(0,yT.default)(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:nI(t,n)}},xY=function(e){var t=e.children,n=e.defaultShowTooltip,r=rx(t,EU),i=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},SY=function(e){return!e||!e.length?!1:e.some(function(e){var t=Qb(e&&e.type);return t&&t.indexOf(`Bar`)>=0})},CY=function(e){return e===`horizontal`?{numericAxisName:`yAxis`,cateAxisName:`xAxis`}:e===`vertical`?{numericAxisName:`xAxis`,cateAxisName:`yAxis`}:e===`centric`?{numericAxisName:`radiusAxis`,cateAxisName:`angleAxis`}:{numericAxisName:`angleAxis`,cateAxisName:`radiusAxis`}},wY=function(e,t){var n=e.props,r=e.graphicalItems,i=e.xAxisMap,a=i===void 0?{}:i,o=e.yAxisMap,s=o===void 0?{}:o,c=n.width,l=n.height,u=n.children,d=n.margin||{},f=rx(u,EU),p=rx(u,tT),m=Object.keys(s).reduce(function(e,t){var n=s[t],r=n.orientation;return!n.mirror&&!n.hide?Z(Z({},e),{},iY({},r,e[r]+n.width)):e},{left:d.left||0,right:d.right||0}),h=Z(Z({},Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return!n.mirror&&!n.hide?Z(Z({},e),{},iY({},r,(0,vb.default)(e,`${r}`)+n.height)):e},{top:d.top||0,bottom:d.bottom||0})),m),g=h.bottom;f&&(h.bottom+=f.props.height||EU.defaultProps.height),p&&t&&(h=kF(h,r,n,t));var _=c-h.left-h.right,v=l-h.top-h.bottom;return Z(Z({brushBottom:g},h),{},{width:Math.max(_,0),height:Math.max(v,0)})},TY=function(e,t){if(t===`xAxis`)return e[t].width;if(t===`yAxis`)return e[t].height},EY=function(e){var t=e.chartName,n=e.GraphicalChild,r=e.defaultTooltipEventType,i=r===void 0?`axis`:r,a=e.validateTooltipEventTypes,o=a===void 0?[`axis`]:a,s=e.axisComponents,c=e.legendContent,l=e.formatAxisMap,u=e.defaultProps,d=function(e,t){var n=t.graphicalItems,r=t.stackGroups,i=t.offset,a=t.updateId,o=t.dataStartIndex,c=t.dataEndIndex,l=e.barSize,u=e.layout,d=e.barGap,f=e.barCategoryGap,p=e.maxBarSize,m=CY(u),h=m.numericAxisName,g=m.cateAxisName,_=SY(n),v=[];return n.forEach(function(n,m){var y=pY(e.data,{graphicalItems:[n],dataStartIndex:o,dataEndIndex:c}),b=n.type.defaultProps===void 0?n.props:Z(Z({},n.type.defaultProps),n.props),x=b.dataKey,S=b.maxBarSize,C=b[`${h}Id`],w=b[`${g}Id`],T=s.reduce(function(e,n){var r=t[`${n.axisType}Map`],i=b[`${n.axisType}Id`];!(r&&r[i]||n.axisType===`zAxis`)&&OP(!1);var a=r[i];return Z(Z({},e),{},iY(iY({},n.axisType,a),`${n.axisType}Ticks`,FF(a)))},{}),E=T[g],D=T[`${g}Ticks`],O=r&&r[C]&&r[C].hasStack&&XF(n,r[C].stackGroups),k=Qb(n.type).indexOf(`Bar`)>=0,A=nI(E,D),j=[],M=_&&DF({barSize:l,stackGroups:r,totalSize:TY(T,g)});if(k){var N=(0,bb.default)(S)?p:S,P=nI(E,D,!0)??N??0;j=OF({barGap:d,barCategoryGap:f,bandSize:P===A?A:P,sizeList:M[w],maxBarSize:N}),P!==A&&(j=j.map(function(e){return Z(Z({},e),{},{position:Z(Z({},e.position),{},{offset:e.position.offset-P/2})})}))}var F=n&&n.type&&n.type.getComposedData;F&&v.push({props:Z(Z({},F(Z(Z({},T),{},{displayedData:y,props:e,dataKey:x,item:n,bandSize:A,barPosition:j,offset:i,stackedData:O,layout:u,dataStartIndex:o,dataEndIndex:c}))),{},iY(iY(iY({key:n.key||`item-${m}`},h,T[h]),g,T[g]),`animationId`,a)),childIndex:mx(n,e.children),item:n})}),v},f=function(e,r){var i=e.props,a=e.dataStartIndex,o=e.dataEndIndex,c=e.updateId;if(!ix({props:i}))return null;var u=i.children,f=i.layout,p=i.stackOffset,m=i.data,h=i.reverseStackOrder,g=CY(f),_=g.numericAxisName,v=g.cateAxisName,y=nx(u,n),b=GF(m,y,`${_}Id`,`${v}Id`,p,h),x=s.reduce(function(e,t){var n=`${t.axisType}Map`;return Z(Z({},e),{},iY({},n,yY(i,Z(Z({},t),{},{graphicalItems:y,stackGroups:t.axisType===_&&b,dataStartIndex:a,dataEndIndex:o}))))},{}),S=wY(Z(Z({},x),{},{props:i,graphicalItems:y}),r?.legendBBox);Object.keys(x).forEach(function(e){x[e]=l(i,x[e],S,e.replace(`Map`,``),t)});var C=x[`${v}Map`],w=bY(C);return Z(Z({formattedGraphicalItems:d(i,Z(Z({},x),{},{dataStartIndex:a,dataEndIndex:o,updateId:c,graphicalItems:y,stackGroups:b,offset:S})),graphicalItems:y,offset:S,stackGroups:b},w),x)},p=function(e){function n(e){var r;return VJ(this,n),r=WJ(this,n,[e]),iY(r,`eventEmitterSymbol`,Symbol(`rechartsEventEmitter`)),iY(r,`accessibilityManager`,new yJ),iY(r,`handleLegendBBoxUpdate`,function(e){if(e){var t=r.state,n=t.dataStartIndex,i=t.dataEndIndex,a=t.updateId;r.setState(Z({legendBBox:e},f({props:r.props,dataStartIndex:n,dataEndIndex:i,updateId:a},Z(Z({},r.state),{},{legendBBox:e}))))}}),iY(r,`handleReceiveSyncEvent`,function(e,t,n){if(r.props.syncId===e){if(n===r.eventEmitterSymbol&&typeof r.props.syncMethod!=`function`)return;r.applySyncEvent(t)}}),iY(r,`handleBrushChange`,function(e){var t=e.startIndex,n=e.endIndex;if(t!==r.state.dataStartIndex||n!==r.state.dataEndIndex){var i=r.state.updateId;r.setState(function(){return Z({dataStartIndex:t,dataEndIndex:n},f({props:r.props,dataStartIndex:t,dataEndIndex:n,updateId:i},r.state))}),r.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),iY(r,`handleMouseEnter`,function(e){var t=r.getMouseInfo(e);if(t){var n=Z(Z({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseEnter;(0,Wb.default)(i)&&i(n,e)}}),iY(r,`triggeredAfterMouseMove`,function(e){var t=r.getMouseInfo(e),n=t?Z(Z({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseMove;(0,Wb.default)(i)&&i(n,e)}),iY(r,`handleItemMouseEnter`,function(e){r.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),iY(r,`handleItemMouseLeave`,function(){r.setState(function(){return{isTooltipActive:!1}})}),iY(r,`handleMouseMove`,function(e){e.persist(),r.throttleTriggeredAfterMouseMove(e)}),iY(r,`handleMouseLeave`,function(e){r.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};r.setState(t),r.triggerSyncEvent(t);var n=r.props.onMouseLeave;(0,Wb.default)(n)&&n(t,e)}),iY(r,`handleOuterEvent`,function(e){var t=px(e),n=(0,vb.default)(r.props,`${t}`);t&&(0,Wb.default)(n)&&n((/.*touch.*/i.test(t)?r.getMouseInfo(e.changedTouches[0]):r.getMouseInfo(e))??{},e)}),iY(r,`handleClick`,function(e){var t=r.getMouseInfo(e);if(t){var n=Z(Z({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onClick;(0,Wb.default)(i)&&i(n,e)}}),iY(r,`handleMouseDown`,function(e){var t=r.props.onMouseDown;(0,Wb.default)(t)&&t(r.getMouseInfo(e),e)}),iY(r,`handleMouseUp`,function(e){var t=r.props.onMouseUp;(0,Wb.default)(t)&&t(r.getMouseInfo(e),e)}),iY(r,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),iY(r,`handleTouchStart`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseDown(e.changedTouches[0])}),iY(r,`handleTouchEnd`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseUp(e.changedTouches[0])}),iY(r,`handleDoubleClick`,function(e){var t=r.props.onDoubleClick;(0,Wb.default)(t)&&t(r.getMouseInfo(e),e)}),iY(r,`handleContextMenu`,function(e){var t=r.props.onContextMenu;(0,Wb.default)(t)&&t(r.getMouseInfo(e),e)}),iY(r,`triggerSyncEvent`,function(e){r.props.syncId!==void 0&&uJ.emit(dJ,r.props.syncId,e,r.eventEmitterSymbol)}),iY(r,`applySyncEvent`,function(e){var t=r.props,n=t.layout,i=t.syncMethod,a=r.state.updateId,o=e.dataStartIndex,s=e.dataEndIndex;if(e.dataStartIndex!==void 0||e.dataEndIndex!==void 0)r.setState(Z({dataStartIndex:o,dataEndIndex:s},f({props:r.props,dataStartIndex:o,dataEndIndex:s,updateId:a},r.state)));else if(e.activeTooltipIndex!==void 0){var c=e.chartX,l=e.chartY,u=e.activeTooltipIndex,d=r.state,p=d.offset,m=d.tooltipTicks;if(!p)return;if(typeof i==`function`)u=i(m,e);else if(i===`value`){u=-1;for(var h=0;h<m.length;h++)if(m[h].value===e.activeLabel){u=h;break}}var g=Z(Z({},p),{},{x:p.left,y:p.top}),_=Math.min(c,g.x+g.width),v=Math.min(l,g.y+g.height),y=m[u]&&m[u].value,b=hY(r.state,r.props.data,u),x=m[u]?{x:n===`horizontal`?m[u].coordinate:_,y:n===`horizontal`?v:m[u].coordinate}:lY;r.setState(Z(Z({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else r.setState(e)}),iY(r,`renderCursor`,function(e){var n=r.state,i=n.isTooltipActive,a=n.activeCoordinate,o=n.activePayload,s=n.offset,c=n.activeTooltipIndex,l=n.tooltipAxisBandSize,u=r.getTooltipEventType(),d=e.props.active??i,f=r.props.layout,p=e.key||`_recharts-cursor`;return _.createElement(AJ,{key:p,activeCoordinate:a,activePayload:o,activeTooltipIndex:c,chartName:t,element:e,isActive:d,layout:f,offset:s,tooltipAxisBandSize:l,tooltipEventType:u})}),iY(r,`renderPolarAxis`,function(e,t,n){var i=(0,vb.default)(e,`type.axisType`),a=(0,vb.default)(r.state,`${i}Map`),o=e.type.defaultProps,s=o===void 0?e.props:Z(Z({},o),e.props),c=a&&a[s[`${i}Id`]];return(0,_.cloneElement)(e,Z(Z({},c),{},{className:Vt(i,c.className),key:e.key||`${t}-${n}`,ticks:FF(c,!0)}))}),iY(r,`renderPolarGrid`,function(e){var t=e.props,n=t.radialLines,i=t.polarAngles,a=t.polarRadius,o=r.state,s=o.radiusAxisMap,c=o.angleAxisMap,l=Ob(s),u=Ob(c),d=u.cx,f=u.cy,p=u.innerRadius,m=u.outerRadius;return(0,_.cloneElement)(e,{polarAngles:Array.isArray(i)?i:FF(u,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:FF(l,!0).map(function(e){return e.coordinate}),cx:d,cy:f,innerRadius:p,outerRadius:m,key:e.key||`polar-grid`,radialLines:n})}),iY(r,`renderLegend`,function(){var e=r.state.formattedGraphicalItems,t=r.props,n=t.children,i=t.width,a=t.height,o=r.props.margin||{},s=oF({children:n,formattedGraphicalItems:e,legendWidth:i-(o.left||0)-(o.right||0),legendContent:c});if(!s)return null;var l=s.item,u=zJ(s,jJ);return(0,_.cloneElement)(l,Z(Z({},u),{},{chartWidth:i,chartHeight:a,margin:o,onBBoxUpdate:r.handleLegendBBoxUpdate}))}),iY(r,`renderTooltip`,function(){var e=r.props,t=e.children,n=e.accessibilityLayer,i=rx(t,OE);if(!i)return null;var a=r.state,o=a.isTooltipActive,s=a.activeCoordinate,c=a.activePayload,l=a.activeLabel,u=a.offset,d=i.props.active??o;return(0,_.cloneElement)(i,{viewBox:Z(Z({},u),{},{x:u.left,y:u.top}),active:d,label:l,payload:d?c:[],coordinate:s,accessibilityLayer:n})}),iY(r,`renderBrush`,function(e){var t=r.props,n=t.margin,i=t.data,a=r.state,o=a.offset,s=a.dataStartIndex,c=a.dataEndIndex,l=a.updateId;return(0,_.cloneElement)(e,{key:e.key||`_recharts-brush`,onChange:LF(r.handleBrushChange,e.props.onChange),data:i,x:X(e.props.x)?e.props.x:o.left,y:X(e.props.y)?e.props.y:o.top+o.height+o.brushBottom-(n.bottom||0),width:X(e.props.width)?e.props.width:o.width,startIndex:s,endIndex:c,updateId:`brush-${l}`})}),iY(r,`renderReferenceElement`,function(e,t,n){if(!e)return null;var i=r.clipPathId,a=r.state,o=a.xAxisMap,s=a.yAxisMap,c=a.offset,l=e.type.defaultProps||{},u=e.props,d=u.xAxisId,f=d===void 0?l.xAxisId:d,p=u.yAxisId,m=p===void 0?l.yAxisId:p;return(0,_.cloneElement)(e,{key:e.key||`${t}-${n}`,xAxis:o[f],yAxis:s[m],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:i})}),iY(r,`renderActivePoints`,function(e){var t=e.item,r=e.activePoint,i=e.basePoint,a=e.childIndex,o=e.isRange,s=[],c=t.props.key,l=t.item.type.defaultProps===void 0?t.item.props:Z(Z({},t.item.type.defaultProps),t.item.props),u=l.activeDot,d=l.dataKey,f=Z(Z({index:a,dataKey:d,cx:r.x,cy:r.y,r:4,fill:EF(t.item),strokeWidth:2,stroke:`#fff`,payload:r.payload,value:r.value},lx(u,!1)),Vb(u));return s.push(n.renderActiveDot(u,f,`${c}-activePoint-${a}`)),i?s.push(n.renderActiveDot(u,Z(Z({},f),{},{cx:i.x,cy:i.y}),`${c}-basePoint-${a}`)):o&&s.push(null),s}),iY(r,`renderGraphicChild`,function(e,t,n){var i=r.filterFormatItem(e,t,n);if(!i)return null;var a=r.getTooltipEventType(),o=r.state,s=o.isTooltipActive,c=o.tooltipAxis,l=o.activeTooltipIndex,u=o.activeLabel,d=r.props.children,f=rx(d,OE),p=i.props,m=p.points,h=p.isRange,g=p.baseLine,v=i.item.type.defaultProps===void 0?i.item.props:Z(Z({},i.item.type.defaultProps),i.item.props),y=v.activeDot,b=v.hide,x=v.activeBar,S=v.activeShape,C=!!(!b&&s&&f&&(y||x||S)),w={};a!==`axis`&&f&&f.props.trigger===`click`?w={onClick:LF(r.handleItemMouseEnter,e.props.onClick)}:a!==`axis`&&(w={onMouseLeave:LF(r.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:LF(r.handleItemMouseEnter,e.props.onMouseEnter)});var T=(0,_.cloneElement)(e,Z(Z({},i.props),w));function E(e){return typeof c.dataKey==`function`?c.dataKey(e.payload):null}if(C){if(l>=0){var D,O;if(c.dataKey&&!c.allowDuplicatedCategory){var k=typeof c.dataKey==`function`?E:`payload.${c.dataKey.toString()}`;D=jb(m,k,u),O=h&&g&&jb(g,k,u)}else D=m?.[l],O=h&&g&&g[l];if(S||x){var A=e.props.activeIndex===void 0?l:e.props.activeIndex;return[(0,_.cloneElement)(e,Z(Z(Z({},i.props),w),{},{activeIndex:A})),null,null]}if(!(0,bb.default)(D))return[T].concat(ZJ(r.renderActivePoints({item:i,activePoint:D,basePoint:O,childIndex:l,isRange:h})))}else{var j=(r.getItemByXY(r.state.activeCoordinate)??{graphicalItem:T}).graphicalItem,M=j.item,N=M===void 0?e:M,P=j.childIndex,F=Z(Z(Z({},i.props),w),{},{activeIndex:P});return[(0,_.cloneElement)(N,F),null,null]}}return h?[T,null,null]:[T,null]}),iY(r,`renderCustomized`,function(e,t,n){return(0,_.cloneElement)(e,Z(Z({key:`recharts-customized-${n}`},r.props),r.state))}),iY(r,`renderMap`,{CartesianGrid:{handler:uY,once:!0},ReferenceArea:{handler:r.renderReferenceElement},ReferenceLine:{handler:uY},ReferenceDot:{handler:r.renderReferenceElement},XAxis:{handler:uY},YAxis:{handler:uY},Brush:{handler:r.renderBrush,once:!0},Bar:{handler:r.renderGraphicChild},Line:{handler:r.renderGraphicChild},Area:{handler:r.renderGraphicChild},Radar:{handler:r.renderGraphicChild},RadialBar:{handler:r.renderGraphicChild},Scatter:{handler:r.renderGraphicChild},Pie:{handler:r.renderGraphicChild},Funnel:{handler:r.renderGraphicChild},Tooltip:{handler:r.renderCursor,once:!0},PolarGrid:{handler:r.renderPolarGrid,once:!0},PolarAngleAxis:{handler:r.renderPolarAxis},PolarRadiusAxis:{handler:r.renderPolarAxis},Customized:{handler:r.renderCustomized}}),r.clipPathId=`${e.id??Eb(`recharts`)}-clip`,r.throttleTriggeredAfterMouseMove=(0,PE.default)(r.triggeredAfterMouseMove,e.throttleDelay??1e3/60),r.state={},r}return YJ(n,e),UJ(n,[{key:`componentDidMount`,value:function(){this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:this.props.margin.left??0,top:this.props.margin.top??0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:`displayDefaultTooltip`,value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,i=e.layout,a=rx(t,OE);if(a){var o=a.props.defaultIndex;if(!(typeof o!=`number`||o<0||o>this.state.tooltipTicks.length-1)){var s=this.state.tooltipTicks[o]&&this.state.tooltipTicks[o].value,c=hY(this.state,n,o,s),l=this.state.tooltipTicks[o].coordinate,u=(this.state.offset.top+r)/2,d=i===`horizontal`?{x:l,y:u}:{y:l,x:u},f=this.state.formattedGraphicalItems.find(function(e){return e.item.type.name===`Scatter`});f&&(d=Z(Z({},d),f.props.points[o].tooltipPosition),c=f.props.points[o].tooltipPayload);var p={activeTooltipIndex:o,isTooltipActive:!0,activeLabel:s,activePayload:c,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(o)}}}},{key:`getSnapshotBeforeUpdate`,value:function(e,t){return this.props.accessibilityLayer&&(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:this.props.margin.left??0,top:this.props.margin.top??0}})),null}},{key:`componentDidUpdate`,value:function(e){ux([rx(e.children,OE)],[rx(this.props.children,OE)])||this.displayDefaultTooltip()}},{key:`componentWillUnmount`,value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:`getTooltipEventType`,value:function(){var e=rx(this.props.children,OE);if(e&&typeof e.props.shared==`boolean`){var t=e.props.shared?`axis`:`item`;return o.indexOf(t)>=0?t:i}return i}},{key:`getMouseInfo`,value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=sD(n),i={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,o=this.inRange(i.chartX,i.chartY,a);if(!o)return null;var s=this.state,c=s.xAxisMap,l=s.yAxisMap,u=this.getTooltipEventType(),d=gY(this.state,this.props.data,this.props.layout,o);if(u!==`axis`&&c&&l){var f=Ob(c).scale,p=Ob(l).scale,m=f&&f.invert?f.invert(i.chartX):null,h=p&&p.invert?p.invert(i.chartY):null;return Z(Z({},i),{},{xValue:m,yValue:h},d)}return d?Z(Z({},i),d):null}},{key:`inRange`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=this.props.layout,i=e/n,a=t/n;if(r===`horizontal`||r===`vertical`){var o=this.state.offset;return i>=o.left&&i<=o.left+o.width&&a>=o.top&&a<=o.top+o.height?{x:i,y:a}:null}var s=this.state,c=s.angleAxisMap,l=s.radiusAxisMap;if(c&&l){var u=Ob(c);return EI({x:i,y:a},u)}return null}},{key:`parseEventsOfWrapper`,value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=rx(e,OE),r={};return n&&t===`axis`&&(r=n.props.trigger===`click`?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),Z(Z({},Vb(this.props,this.handleOuterEvent)),r)}},{key:`addListener`,value:function(){uJ.on(dJ,this.handleReceiveSyncEvent)}},{key:`removeListener`,value:function(){uJ.removeListener(dJ,this.handleReceiveSyncEvent)}},{key:`filterFormatItem`,value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,i=0,a=r.length;i<a;i++){var o=r[i];if(o.item===e||o.props.key===e.key||t===Qb(o.item.type)&&n===o.childIndex)return o}return null}},{key:`renderClipPath`,value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,r=t.top,i=t.height,a=t.width;return _.createElement(`defs`,null,_.createElement(`clipPath`,{id:e},_.createElement(`rect`,{x:n,y:r,height:i,width:a})))}},{key:`getXScales`,value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=FJ(t,2),r=n[0],i=n[1];return Z(Z({},e),{},iY({},r,i.scale))},{}):null}},{key:`getYScales`,value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=FJ(t,2),r=n[0],i=n[1];return Z(Z({},e),{},iY({},r,i.scale))},{}):null}},{key:`getXScaleByAxisId`,value:function(e){var t;return(t=this.state.xAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getYScaleByAxisId`,value:function(e){var t;return(t=this.state.yAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getItemByXY`,value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var i=0,a=n.length;i<a;i++){var o=n[i],s=o.props,c=o.item,l=c.type.defaultProps===void 0?c.props:Z(Z({},c.type.defaultProps),c.props),u=Qb(c.type);if(u===`Bar`){var d=(s.data||[]).find(function(t){return mB(e,t)});if(d)return{graphicalItem:o,payload:d}}else if(u===`RadialBar`){var f=(s.data||[]).find(function(t){return EI(e,t)});if(f)return{graphicalItem:o,payload:f}}else if(yH(o,r)||bH(o,r)||xH(o,r)){var p=OH({graphicalItem:o,activeTooltipItem:r,itemData:l.data}),m=l.activeIndex===void 0?p:l.activeIndex;return{graphicalItem:Z(Z({},o),{},{childIndex:m}),payload:xH(o,r)?l.data[p]:o.props.data[p]}}}return null}},{key:`render`,value:function(){var e=this;if(!ix(this))return null;var t=this.props,n=t.children,r=t.className,i=t.width,a=t.height,o=t.style,s=t.compact,c=t.title,l=t.desc,u=lx(zJ(t,MJ),!1);if(s)return _.createElement(KW,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},_.createElement(yx,PJ({},u,{width:i,height:a,title:c,desc:l}),this.renderClipPath(),fx(n,this.renderMap)));this.props.accessibilityLayer&&(u.tabIndex=this.props.tabIndex??0,u.role=this.props.role??`application`,u.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},u.onFocus=function(){e.accessibilityManager.focus()});var d=this.parseEventsOfWrapper();return _.createElement(KW,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},_.createElement(`div`,PJ({className:Vt(`recharts-wrapper`,r),style:Z({position:`relative`,cursor:`default`,width:i,height:a},o)},d,{ref:function(t){e.container=t}}),_.createElement(yx,PJ({},u,{width:i,height:a,title:c,desc:l,style:cY}),this.renderClipPath(),fx(n,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(_.Component);iY(p,`displayName`,t),iY(p,`defaultProps`,Z({layout:`horizontal`,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`},u)),iY(p,`getDerivedStateFromProps`,function(e,t){var n=e.dataKey,r=e.data,i=e.children,a=e.width,o=e.height,s=e.layout,c=e.stackOffset,l=e.margin,u=t.dataStartIndex,d=t.dataEndIndex;if(t.updateId===void 0){var p=xY(e);return Z(Z(Z({},p),{},{updateId:0},f(Z(Z({props:e},p),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(n!==t.prevDataKey||r!==t.prevData||a!==t.prevWidth||o!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!Nb(l,t.prevMargin)){var m=xY(e),h={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=Z(Z({},gY(t,r,s)),{},{updateId:t.updateId+1}),_=Z(Z(Z({},m),h),g);return Z(Z(Z({},_),f(Z({props:e},_),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(!ux(i,t.prevChildren)){var v=rx(i,EU),y=v?v.props?.startIndex??u:u,b=v?v.props?.endIndex??d:d,x=y!==u||b!==d,S=!(0,bb.default)(r)&&!x?t.updateId:t.updateId+1;return Z(Z({updateId:S},f(Z(Z({props:e},t),{},{updateId:S,dataStartIndex:y,dataEndIndex:b}),t)),{},{prevChildren:i,dataStartIndex:y,dataEndIndex:b})}return null}),iY(p,`renderActiveDot`,function(e,t,n){var r=(0,_.isValidElement)(e)?(0,_.cloneElement)(e,t):(0,Wb.default)(e)?e(t):_.createElement(NB,t);return _.createElement(wx,{className:`recharts-active-dot`,key:n},r)});var m=(0,_.forwardRef)(function(e,t){return _.createElement(p,PJ({},e,{ref:t}))});return m.displayName=p.displayName,m},DY=EY({chartName:`LineChart`,GraphicalChild:Sq,axisComponents:[{axisType:`xAxis`,AxisComp:zq},{axisType:`yAxis`,AxisComp:nJ}],formatAxisMap:DW}),OY=EY({chartName:`BarChart`,GraphicalChild:hW,defaultTooltipEventType:`axis`,validateTooltipEventTypes:[`axis`,`item`],axisComponents:[{axisType:`xAxis`,AxisComp:zq},{axisType:`yAxis`,AxisComp:nJ}],formatAxisMap:DW}),kY=EY({chartName:`PieChart`,GraphicalChild:qH,validateTooltipEventTypes:[`item`],defaultTooltipEventType:`item`,legendContent:`children`,axisComponents:[{axisType:`angleAxis`,AxisComp:LV},{axisType:`radiusAxis`,AxisComp:_V}],formatAxisMap:xI,defaultProps:{layout:`centric`,startAngle:0,endAngle:360,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`}});function AY(e){return Array.from(new Map(e.scenarios.map(e=>{let t=String(e.scenarioId??``).trim(),n=String(e.scenarioName??``).trim();return!t&&!n?null:[t||n,n||t]}).filter(e=>!!e)).values())}function jY(e){let t=AY(e),n=e.scenarios.map(e=>e.agentName||e.agentId).filter(Boolean),r=Array.from(new Set(n.length>0?n:e.rerunAgents??[])),i=Array.from(new Set(e.scenarios.map(e=>e.model).filter(e=>!!e))),a=t.slice(0,2).join(`, `),o=t.length>2?` +${t.length-2}`:``,s=i.slice(0,2).join(`, `),c=i.length>2?` +${i.length-2}`:``,l=e.configName?.trim()||``,u=e.configPath?.trim()||``,d=l||u;return{scenarioCount:t.length,agentCount:r.length,scopePreview:d||(a?`${a}${o}`:`n/a`),modelSummary:s?`${s}${c}`:``}}function MY(e){let t=typeof e.toolTokensTotal==`number`?e.toolTokensTotal:null;return{id:e.runId,evaluationRunId:e.evaluationRunId,configId:``,configHash:e.configHash,configPath:e.configPath,configName:e.configName,langsmithTraceUrls:e.langsmithTraceUrls,rerunAgents:e.rerunAgents,rerunScenarioIds:e.rerunScenarioIds,rerunServerOverrideAll:e.rerunServerOverrideAll,rerunScenarioServerOverrides:e.rerunScenarioServerOverrides,timestamp:e.timestamp,runNote:e.runNote,mcpServerVersions:e.mcpServerVersions??{},scenarios:(e.scenarioIds??[]).map((t,n)=>({scenarioId:t,scenarioName:e.scenarioNames?.[n]??t,agentId:e.agentIds?.[n]??``,agentName:e.agentIds?.[n]??``,runs:[],passRate:null,avgToolCalls:0,avgDuration:0})),assistantTokenUsage:null,toolTokenUsage:t===null?null:{inputTokens:null,outputTokens:null,totalTokens:t},overallPassRate:e.passRate,totalScenarios:e.totalScenarios,totalRuns:e.totalRuns,avgToolCalls:e.avgToolCalls,avgLatency:Math.round(e.avgLatencyMs??0),totalDurationMs:typeof e.totalDurationMs==`number`?Math.max(0,e.totalDurationMs):void 0,totalToolDurationMs:typeof e.totalToolDurationMs==`number`?Math.max(0,e.totalToolDurationMs):void 0,outcomes:e.outcomes,executionSource:e.executionSource,executionClient:e.executionClient,checkCounts:e.checkCounts}}var NY=6048e5;function PY(e){return e.length===0?0:e.reduce((e,t)=>e+t,0)/e.length}function FY(e,t=0){let n=Number(e.toFixed(t));return`${n>0?`+`:``}${n.toFixed(t)}`}var IY=()=>{let{configs:e}=Jv(),{source:t}=Rv(),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(`timestamp`),[f,p]=(0,_.useState)(`desc`),m=e=>{u===e?p(e=>e===`asc`?`desc`:`asc`):(d(e),p(`desc`))};(0,_.useEffect)(()=>{let e=!0;r(!0);let n=Date.now(),i=n-2592e6,o=n-NY,c=o-NY,u=new Date(i).toISOString(),d=new Date(o).toISOString(),f=new Date(c).toISOString(),p=new Date(o-1).toISOString(),m=new Date(n).toISOString(),h=async(e,n)=>t.listRunSummaries?(await t.listRunSummaries({since:e,until:n})).map(MY):t.listResults({since:e,until:n});return Promise.all([h(u,m),h(d,m),h(f,p)]).then(([t,n,r])=>{e&&(a(t),s(n),l(r))}).finally(()=>{e&&r(!1)}),()=>{e=!1}},[t]);let h=e.length,g=i.length,v=o.map(e=>e.overallPassRate).filter(e=>e!==null),y=v.length>0?PY(v):null,b=o.length===0?0:Math.round(o.reduce((e,t)=>e+t.avgLatency,0)/o.length),x=c.map(e=>e.overallPassRate).filter(e=>e!==null),S=x.length>0?PY(x):null,C=PY(c.map(e=>e.avgLatency)),w=y===null||S===null?null:(y-S)*100,T=b-C,E=c.length>0,D=w===null?`No prior-week baseline`:`${FY(w,1)}% from last week`,O=E?`${FY(T,0)}ms from last week`:`No prior-week baseline`,k=w===null?`neutral`:w>0?`up`:w<0?`down`:`neutral`,A=E?T<0?`up`:T>0?`down`:`neutral`:`neutral`,j=(0,_.useMemo)(()=>[...i].sort((e,t)=>{let n=0;return u===`timestamp`&&(n=new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),u===`passRate`&&(n=(e.overallPassRate??-1)-(t.overallPassRate??-1)),u===`latency`&&(n=e.avgLatency-t.avgLatency),u===`scenarios`&&(n=e.totalScenarios-t.totalScenarios),f===`asc`?n:-n}),[i,u,f]),M=j.slice(0,20),N=e=>{let t=e.toolTokenUsage?.totalTokens;return typeof t==`number`?t.toLocaleString():`n/a`},P=[...j].reverse().map(e=>({date:new Date(e.timestamp).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`}),passRate:e.overallPassRate===null?null:Math.round(e.overallPassRate*100),latency:e.avgLatency}));return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Mn,{className:`h-6 w-6`}),`Dashboard`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Overview of your MCP evaluation runs`})]}),(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(W,{asChild:!0,children:(0,I.jsxs)(sp,{to:`/mcp-evaluations/new`,children:[(0,I.jsx)($n,{className:`mr-2 h-4 w-4`}),`New MCP Evaluation`]})}),(0,I.jsx)(W,{variant:`outline`,asChild:!0,children:(0,I.jsxs)(sp,{to:`/run`,children:[(0,I.jsx)(Kn,{className:`mr-2 h-4 w-4`}),`Run Evaluation`]})}),(0,I.jsx)(W,{variant:`outline`,asChild:!0,children:(0,I.jsxs)(sp,{to:`/results`,children:[(0,I.jsx)(tn,{className:`mr-2 h-4 w-4`}),`Browse Results`]})})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,I.jsx)(ly,{title:`MCP Evaluations`,value:h,icon:jn,subtitle:`${h} active`}),(0,I.jsx)(ly,{title:`Total Runs`,value:g,icon:Xt,subtitle:`Last 30 days`}),(0,I.jsx)(ly,{title:`Pass Rate`,value:n?`–`:Bi(y),icon:tn,subtitle:n?`Loading...`:D,trend:n?`neutral`:k}),(0,I.jsx)(ly,{title:`Avg Latency`,value:n?`—`:`${b}ms`,icon:ir,subtitle:n?`Loading...`:O,trend:n?`neutral`:A})]}),(0,I.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-2`,children:[(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Pass Rate Trend`})}),(0,I.jsx)(q,{children:(0,I.jsx)(qE,{width:`100%`,height:200,children:(0,I.jsxs)(DY,{data:P,children:[(0,I.jsx)(zq,{dataKey:`date`,tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(nJ,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:e=>`${e}%`}),(0,I.jsx)(OE,{formatter:e=>[`${e}%`,`Pass Rate`]}),(0,I.jsx)(Sq,{type:`monotone`,dataKey:`passRate`,stroke:`hsl(38, 92%, 50%)`,strokeWidth:2,dot:{r:3,fill:`hsl(38, 92%, 50%)`}})]})})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Recent Tool Latency (ms)`})}),(0,I.jsx)(q,{children:(0,I.jsx)(qE,{width:`100%`,height:200,children:(0,I.jsxs)(DY,{data:P,children:[(0,I.jsx)(zq,{dataKey:`date`,tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(nJ,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),(0,I.jsx)(OE,{formatter:e=>[`${e}ms`,`Latency`]}),(0,I.jsx)(Sq,{type:`monotone`,dataKey:`latency`,stroke:`hsl(200, 80%, 50%)`,strokeWidth:2,dot:{r:3,fill:`hsl(200, 80%, 50%)`}})]})})})]})]}),(0,I.jsx)(`div`,{className:`grid gap-6`,children:(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Recent Runs`})}),(0,I.jsxs)(q,{className:`p-0`,children:[(0,I.jsxs)(ny,{children:[(0,I.jsx)(ry,{children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{children:`Run ID`}),(0,I.jsx)(sy,{children:`Evaluated`}),(0,I.jsx)(sy,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>m(`timestamp`),children:[`Timestamp`,u===`timestamp`?f===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,I.jsx)(sy,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex w-full items-center justify-end gap-1 hover:text-foreground`,onClick:()=>m(`passRate`),children:[`Pass Rate`,u===`passRate`?f===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,I.jsx)(sy,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>m(`scenarios`),children:[`Scenarios`,u===`scenarios`?f===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`})]})}),(0,I.jsx)(sy,{className:`text-right`,children:`Avg Tools`}),(0,I.jsx)(sy,{className:`text-right`,children:`Tool Tokens`})]})}),(0,I.jsxs)(iy,{children:[M.length===0&&(0,I.jsx)(oy,{children:(0,I.jsx)(J,{colSpan:7,className:`py-8 text-center text-sm text-muted-foreground`,children:`No runs in the past 30 days.`})}),M.map(e=>(0,I.jsxs)(oy,{className:`cursor-pointer`,children:[(0,I.jsx)(J,{children:(0,I.jsx)(sp,{to:`/results/${e.id}`,className:`font-mono text-xs text-primary hover:underline`,children:e.id})}),(0,I.jsx)(J,{className:`text-[11px] text-muted-foreground`,children:(()=>{let t=jY(e);return(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{children:[`Evaluated: `,t.scenarioCount,` scenario`,t.scenarioCount===1?``:`s`,` · `,t.agentCount,` agent`,t.agentCount===1?``:`s`,t.modelSummary?` · ${t.modelSummary}`:``]}),(0,I.jsx)(`div`,{className:`font-mono text-xs text-foreground/80`,children:t.scopePreview})]})})()}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.timestamp).toLocaleString()]})}),(0,I.jsx)(J,{className:`text-right`,children:(0,I.jsx)(dy,{rate:e.overallPassRate})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:e.totalScenarios}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:e.avgToolCalls.toFixed(0)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:N(e)})]},e.id))]})]}),j.length>20&&(0,I.jsx)(`div`,{className:`border-t p-4 text-center`,children:(0,I.jsx)(W,{variant:`outline`,asChild:!0,children:(0,I.jsx)(sp,{to:`/results`,children:`Show more`})})})]})]})})]})};function LY({value:e,onValueChange:t,placeholder:n=`Search...`,className:r,inputClassName:i,clearAriaLabel:a=`Clear search`}){return(0,I.jsxs)(`div`,{className:U(`relative`,r),children:[(0,I.jsx)(Np,{value:e,onChange:e=>t(e.target.value),placeholder:n,className:U(`h-9 w-[240px] pr-8`,i)}),e&&(0,I.jsx)(W,{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":a,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]})}var RY=_.createContext(void 0);function zY(e){let t=_.useContext(RY);return e||t||`ltr`}var BY=`rovingFocusGroup.onEntryFocus`,VY={bubbles:!1,cancelable:!0},HY=`RovingFocusGroup`,[UY,WY,GY]=ae(HY),[KY,qY]=R(HY,[GY]),[JY,YY]=KY(HY),XY=_.forwardRef((e,t)=>(0,I.jsx)(UY.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(UY.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,I.jsx)(ZY,{...e,ref:t})})}));XY.displayName=HY;var ZY=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=_.useRef(null),p=P(t,f),m=zY(a),[h,g]=Re({prop:o,defaultProp:s??null,onChange:c,caller:HY}),[v,y]=_.useState(!1),b=fe(l),x=WY(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(BY,b),()=>e.removeEventListener(BY,b)},[b]),(0,I.jsx)(JY,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,I.jsx)(H.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:j(e.onMouseDown,()=>{S.current=!0}),onFocus:j(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(BY,VY);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);rX([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:j(e.onBlur,()=>y(!1))})})}),QY=`RovingFocusGroupItem`,$Y=_.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Pa(),l=a||c,u=YY(QY,n),d=u.currentTabStopId===l,f=WY(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return _.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,I.jsx)(UY.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,I.jsx)(H.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:j(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:j(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:j(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=nX(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?iX(n,r+1):n.slice(r+1)}setTimeout(()=>rX(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});$Y.displayName=QY;var eX={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function tX(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function nX(e,t,n){let r=tX(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return eX[r]}function rX(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function iX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aX=XY,oX=$Y;function sX(e){let t=cX(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(uX);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function cX(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=fX(n),i=dX(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lX=Symbol(`radix.slottable`);function uX(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===lX}function dX(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function fX(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 pX=[`Enter`,` `],mX=[`ArrowDown`,`PageUp`,`Home`],hX=[`ArrowUp`,`PageDown`,`End`],gX=[...mX,...hX],_X={ltr:[...pX,`ArrowRight`],rtl:[...pX,`ArrowLeft`]},vX={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},yX=`Menu`,[bX,xX,SX]=ae(yX),[CX,wX]=R(yX,[SX,ac,qY]),TX=ac(),EX=qY(),[DX,OX]=CX(yX),[kX,AX]=CX(yX),jX=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=TX(t),[c,l]=_.useState(null),u=_.useRef(!1),d=fe(a),f=zY(i);return _.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,I.jsx)(xc,{...s,children:(0,I.jsx)(DX,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,I.jsx)(kX,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};jX.displayName=yX;var MX=`MenuAnchor`,NX=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=TX(n);return(0,I.jsx)(Sc,{...i,...r,ref:t})});NX.displayName=MX;var PX=`MenuPortal`,[FX,IX]=CX(PX,{forceMount:void 0}),LX=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=OX(PX,t);return(0,I.jsx)(FX,{scope:t,forceMount:n,children:(0,I.jsx)(Ne,{present:n||a.open,children:(0,I.jsx)(je,{asChild:!0,container:i,children:r})})})};LX.displayName=PX;var RX=`MenuContent`,[zX,BX]=CX(RX),VX=_.forwardRef((e,t)=>{let n=IX(RX,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=OX(RX,e.__scopeMenu),o=AX(RX,e.__scopeMenu);return(0,I.jsx)(bX.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(Ne,{present:r||a.open,children:(0,I.jsx)(bX.Slot,{scope:e.__scopeMenu,children:o.modal?(0,I.jsx)(HX,{...i,ref:t}):(0,I.jsx)(UX,{...i,ref:t})})})})}),HX=_.forwardRef((e,t)=>{let n=OX(RX,e.__scopeMenu),r=_.useRef(null),i=P(t,r);return _.useEffect(()=>{let e=r.current;if(e)return _h(e)},[]),(0,I.jsx)(GX,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),UX=_.forwardRef((e,t)=>{let n=OX(RX,e.__scopeMenu);return(0,I.jsx)(GX,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),WX=sX(`MenuContent.ScrollLock`),GX=_.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=OX(RX,n),v=AX(RX,n),y=TX(n),b=EX(n),x=xX(n),[S,C]=_.useState(null),w=_.useRef(null),T=P(t,w,g.onContentChange),E=_.useRef(0),D=_.useRef(``),O=_.useRef(0),k=_.useRef(null),A=_.useRef(`right`),M=_.useRef(0),N=m?ch:_.Fragment,F=m?{as:WX,allowPinchZoom:!0}:void 0,L=e=>{let t=D.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=EZ(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){D.current=t,window.clearTimeout(E.current),t!==``&&(E.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};_.useEffect(()=>()=>window.clearTimeout(E.current),[]),nm();let R=_.useCallback(e=>A.current===k.current?.side&&OZ(e,k.current?.area),[]);return(0,I.jsx)(zX,{scope:n,searchRef:D,onItemEnter:_.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:_.useCallback(e=>{R(e)||(w.current?.focus(),C(null))},[R]),onTriggerLeave:_.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(e=>{k.current=e},[]),children:(0,I.jsx)(N,{...F,children:(0,I.jsx)(Kp,{asChild:!0,trapped:i,onMountAutoFocus:j(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,I.jsx)(be,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,I.jsx)(aX,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:j(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,I.jsx)(Cc,{role:`menu`,"aria-orientation":`vertical`,"data-state":xZ(g.open),"data-radix-menu-content":``,dir:v.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:j(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&L(e.key));let i=w.current;if(e.target!==i||!gX.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);hX.includes(e.key)&&a.reverse(),wZ(a)}),onBlur:j(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current=``)}),onPointerMove:j(e.onPointerMove,kZ(e=>{let t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>M.current?`right`:`left`;A.current=t,M.current=e.clientX}}))})})})})})})});VX.displayName=RX;var KX=`MenuGroup`,qX=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(H.div,{role:`group`,...r,ref:t})});qX.displayName=KX;var JX=`MenuLabel`,YX=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(H.div,{...r,ref:t})});YX.displayName=JX;var XX=`MenuItem`,ZX=`menu.itemSelect`,QX=_.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=AX(XX,e.__scopeMenu),s=BX(XX,e.__scopeMenu),c=P(t,a),l=_.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(ZX,{bubbles:!0,cancelable:!0});e.addEventListener(ZX,e=>r?.(e),{once:!0}),de(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,I.jsx)($X,{...i,ref:c,disabled:n,onClick:j(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:j(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:j(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||pX.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});QX.displayName=XX;var $X=_.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=BX(XX,n),s=EX(n),c=_.useRef(null),l=P(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(``);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,I.jsx)(bX.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,I.jsx)(oX,{asChild:!0,...s,focusable:!r,children:(0,I.jsx)(H.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:j(e.onPointerMove,kZ(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:j(e.onPointerLeave,kZ(e=>o.onItemLeave(e))),onFocus:j(e.onFocus,()=>d(!0)),onBlur:j(e.onBlur,()=>d(!1))})})})}),eZ=`MenuCheckboxItem`,tZ=_.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,I.jsx)(lZ,{scope:e.__scopeMenu,checked:n,children:(0,I.jsx)(QX,{role:`menuitemcheckbox`,"aria-checked":SZ(n)?`mixed`:n,...i,ref:t,"data-state":CZ(n),onSelect:j(i.onSelect,()=>r?.(SZ(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tZ.displayName=eZ;var nZ=`MenuRadioGroup`,[rZ,iZ]=CX(nZ,{value:void 0,onValueChange:()=>{}}),aZ=_.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=fe(r);return(0,I.jsx)(rZ,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,I.jsx)(qX,{...i,ref:t})})});aZ.displayName=nZ;var oZ=`MenuRadioItem`,sZ=_.forwardRef((e,t)=>{let{value:n,...r}=e,i=iZ(oZ,e.__scopeMenu),a=n===i.value;return(0,I.jsx)(lZ,{scope:e.__scopeMenu,checked:a,children:(0,I.jsx)(QX,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":CZ(a),onSelect:j(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});sZ.displayName=oZ;var cZ=`MenuItemIndicator`,[lZ,uZ]=CX(cZ,{checked:!1}),dZ=_.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=uZ(cZ,n);return(0,I.jsx)(Ne,{present:r||SZ(a.checked)||a.checked===!0,children:(0,I.jsx)(H.span,{...i,ref:t,"data-state":CZ(a.checked)})})});dZ.displayName=cZ;var fZ=`MenuSeparator`,pZ=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,I.jsx)(H.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});pZ.displayName=fZ;var mZ=`MenuArrow`,hZ=_.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=TX(n);return(0,I.jsx)(wc,{...i,...r,ref:t})});hZ.displayName=mZ;var[mte,gZ]=CX(`MenuSub`),_Z=`MenuSubTrigger`,vZ=_.forwardRef((e,t)=>{let n=OX(_Z,e.__scopeMenu),r=AX(_Z,e.__scopeMenu),i=gZ(_Z,e.__scopeMenu),a=BX(_Z,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return _.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,I.jsx)(NX,{asChild:!0,...l,children:(0,I.jsx)($X,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":xZ(n.open),...e,ref:N(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:j(e.onPointerMove,kZ(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:j(e.onPointerLeave,kZ(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:j(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||_X[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});vZ.displayName=_Z;var yZ=`MenuSubContent`,bZ=_.forwardRef((e,t)=>{let n=IX(RX,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=OX(RX,e.__scopeMenu),o=AX(RX,e.__scopeMenu),s=gZ(yZ,e.__scopeMenu),c=_.useRef(null),l=P(t,c);return(0,I.jsx)(bX.Provider,{scope:e.__scopeMenu,children:(0,I.jsx)(Ne,{present:r||a.open,children:(0,I.jsx)(bX.Slot,{scope:e.__scopeMenu,children:(0,I.jsx)(GX,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:j(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:j(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:j(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=vX[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});bZ.displayName=yZ;function xZ(e){return e?`open`:`closed`}function SZ(e){return e===`indeterminate`}function CZ(e){return SZ(e)?`indeterminate`:e?`checked`:`unchecked`}function wZ(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function TZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function EZ(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=TZ(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function DZ(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function OZ(e,t){return t?DZ({x:e.clientX,y:e.clientY},t):!1}function kZ(e){return t=>t.pointerType===`mouse`?e(t):void 0}var AZ=jX,jZ=NX,MZ=LX,NZ=VX,PZ=qX,FZ=YX,IZ=QX,LZ=tZ,RZ=aZ,zZ=sZ,BZ=dZ,VZ=pZ,HZ=hZ,UZ=vZ,WZ=bZ,GZ=`DropdownMenu`,[KZ,hte]=R(GZ,[wX]),qZ=wX(),[JZ,YZ]=KZ(GZ),XZ=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=qZ(t),l=_.useRef(null),[u,d]=Re({prop:i,defaultProp:a??!1,onChange:o,caller:GZ});return(0,I.jsx)(JZ,{scope:t,triggerId:Pa(),triggerRef:l,contentId:Pa(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,I.jsx)(AZ,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};XZ.displayName=GZ;var ZZ=`DropdownMenuTrigger`,QZ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=YZ(ZZ,n),o=qZ(n);return(0,I.jsx)(jZ,{asChild:!0,...o,children:(0,I.jsx)(H.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:N(t,a.triggerRef),onPointerDown:j(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:j(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});QZ.displayName=ZZ;var $Z=`DropdownMenuPortal`,eQ=e=>{let{__scopeDropdownMenu:t,...n}=e,r=qZ(t);return(0,I.jsx)(MZ,{...r,...n})};eQ.displayName=$Z;var tQ=`DropdownMenuContent`,nQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=YZ(tQ,n),a=qZ(n),o=_.useRef(!1);return(0,I.jsx)(NZ,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:j(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});nQ.displayName=tQ;var rQ=`DropdownMenuGroup`,iQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(PZ,{...i,...r,ref:t})});iQ.displayName=rQ;var aQ=`DropdownMenuLabel`,oQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(FZ,{...i,...r,ref:t})});oQ.displayName=aQ;var sQ=`DropdownMenuItem`,cQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(IZ,{...i,...r,ref:t})});cQ.displayName=sQ;var lQ=`DropdownMenuCheckboxItem`,uQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(LZ,{...i,...r,ref:t})});uQ.displayName=lQ;var dQ=`DropdownMenuRadioGroup`,fQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(RZ,{...i,...r,ref:t})});fQ.displayName=dQ;var pQ=`DropdownMenuRadioItem`,mQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(zZ,{...i,...r,ref:t})});mQ.displayName=pQ;var hQ=`DropdownMenuItemIndicator`,gQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(BZ,{...i,...r,ref:t})});gQ.displayName=hQ;var _Q=`DropdownMenuSeparator`,vQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(VZ,{...i,...r,ref:t})});vQ.displayName=_Q;var yQ=`DropdownMenuArrow`,bQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(HZ,{...i,...r,ref:t})});bQ.displayName=yQ;var xQ=`DropdownMenuSubTrigger`,SQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(UZ,{...i,...r,ref:t})});SQ.displayName=xQ;var CQ=`DropdownMenuSubContent`,wQ=_.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=qZ(n);return(0,I.jsx)(WZ,{...i,...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)`}})});wQ.displayName=CQ;var TQ=XZ,EQ=QZ,DQ=eQ,OQ=nQ,kQ=oQ,AQ=cQ,jQ=uQ,MQ=mQ,NQ=gQ,PQ=vQ,FQ=SQ,IQ=wQ,LQ=TQ,RQ=EQ,zQ=_.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,I.jsxs)(FQ,{ref:i,className:U(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[state=open]:bg-accent focus:bg-accent`,t&&`pl-8`,e),...r,children:[n,(0,I.jsx)(an,{className:`ml-auto h-4 w-4`})]}));zQ.displayName=FQ.displayName;var BQ=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(IQ,{ref:n,className:U(`z-50 min-w-32 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}));BQ.displayName=IQ.displayName;var VQ=_.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,I.jsx)(DQ,{children:(0,I.jsx)(OQ,{ref:r,sideOffset:t,className:U(`z-50 min-w-32 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})}));VQ.displayName=OQ.displayName;var HQ=_.forwardRef(({className:e,inset:t,...n},r)=>(0,I.jsx)(AQ,{ref:r,className:U(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,t&&`pl-8`,e),...n}));HQ.displayName=AQ.displayName;var UQ=_.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,I.jsxs)(jQ,{ref:i,className:U(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),checked:n,...r,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,I.jsx)(NQ,{children:(0,I.jsx)(nn,{className:`h-4 w-4`})})}),t]}));UQ.displayName=jQ.displayName;var WQ=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(MQ,{ref:r,className:U(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),...n,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,I.jsx)(NQ,{children:(0,I.jsx)(fn,{className:`h-2 w-2 fill-current`})})}),t]}));WQ.displayName=MQ.displayName;var GQ=_.forwardRef(({className:e,inset:t,...n},r)=>(0,I.jsx)(kQ,{ref:r,className:U(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));GQ.displayName=kQ.displayName;var KQ=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(PQ,{ref:n,className:U(`-mx-1 my-1 h-px bg-muted`,e),...t}));KQ.displayName=PQ.displayName;function qQ(e,[t,n]){return Math.min(n,Math.max(t,e))}function JQ(e){let t=YQ(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(ZQ);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function YQ(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=$Q(n),i=QQ(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var XQ=Symbol(`radix.slottable`);function ZQ(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===XQ}function QQ(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].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)}function e$(e){let t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var t$=[` `,`Enter`,`ArrowUp`,`ArrowDown`],n$=[` `,`Enter`],r$=`Select`,[i$,a$,o$]=ae(r$),[s$,gte]=R(r$,[o$,ac]),c$=ac(),[l$,u$]=s$(r$),[d$,f$]=s$(r$),p$=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=c$(t),[g,v]=_.useState(null),[y,b]=_.useState(null),[x,S]=_.useState(!1),C=zY(l),[w,T]=Re({prop:r,defaultProp:i??!1,onChange:a,caller:r$}),[E,D]=Re({prop:o,defaultProp:s,onChange:c,caller:r$}),O=_.useRef(null),k=!g||m||!!g.closest(`form`),[A,j]=_.useState(new Set),M=Array.from(A).map(e=>e.props.value).join(`;`);return(0,I.jsx)(xc,{...h,children:(0,I.jsxs)(l$,{required:p,scope:t,trigger:g,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:Pa(),value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,children:[(0,I.jsx)(i$.Provider,{scope:t,children:(0,I.jsx)(d$,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(e=>{j(t=>new Set(t).add(e))},[]),onNativeOptionRemove:_.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),k?(0,I.jsxs)(s1,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:E,onChange:e=>D(e.target.value),disabled:f,form:m,children:[E===void 0?(0,I.jsx)(`option`,{value:``}):null,Array.from(A)]},M):null]})})};p$.displayName=r$;var m$=`SelectTrigger`,h$=_.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=c$(n),o=u$(m$,n),s=o.disabled||r,c=P(t,o.onTriggerChange),l=a$(n),u=_.useRef(`touch`),[d,f,p]=l1(e=>{let t=l().filter(e=>!e.disabled),n=u1(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(Sc,{asChild:!0,...a,children:(0,I.jsx)(H.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":c1(o.value)?``:void 0,...i,ref:c,onClick:j(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:j(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:j(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&t$.includes(e.key)&&(m(),e.preventDefault())})})})});h$.displayName=m$;var g$=`SelectValue`,_$=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=u$(g$,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=P(t,c.onValueNodeChange);return ke(()=>{l(u)},[l,u]),(0,I.jsx)(H.span,{...s,ref:d,style:{pointerEvents:`none`},children:c1(c.value)?(0,I.jsx)(I.Fragment,{children:o}):a})});_$.displayName=g$;var v$=`SelectIcon`,y$=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(H.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});y$.displayName=v$;var b$=`SelectPortal`,x$=e=>(0,I.jsx)(je,{asChild:!0,...e});x$.displayName=b$;var S$=`SelectContent`,C$=_.forwardRef((e,t)=>{let n=u$(S$,e.__scopeSelect),[r,i]=_.useState();if(ke(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?A.createPortal((0,I.jsx)(T$,{scope:e.__scopeSelect,children:(0,I.jsx)(i$.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(O$,{...e,ref:t})});C$.displayName=S$;var w$=10,[T$,E$]=s$(S$),D$=`SelectContentImpl`,_te=JQ(`SelectContent.RemoveScroll`),O$=_.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,...v}=e,y=u$(S$,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=P(t,e=>x(e)),[T,E]=_.useState(null),[D,O]=_.useState(null),k=a$(n),[A,M]=_.useState(!1),N=_.useRef(!1);_.useEffect(()=>{if(b)return _h(b)},[b]),nm();let F=_.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),L=_.useCallback(()=>F([T,b]),[F,T,b]);_.useEffect(()=>{A&&L()},[A,L]);let{onOpenChange:R,triggerPointerDownPosRef:z}=y;_.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():b.contains(n.target)||R(!1),document.removeEventListener(`pointermove`,t),z.current=null};return z.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,R,z]),_.useEffect(()=>{let e=()=>R(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[R]);let[B,ee]=l1(e=>{let t=k().filter(e=>!e.disabled),n=u1(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),te=_.useCallback((e,t,n)=>{let r=!N.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(N.current=!0))},[y.value]),ne=_.useCallback(()=>b?.focus(),[b]),re=_.useCallback((e,t,n)=>{let r=!N.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ie=r===`popper`?M$:A$,ae=ie===M$?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,I.jsx)(T$,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:te,selectedItem:T,onItemLeave:ne,itemTextRefCallback:re,focusSelectedItem:L,selectedItemText:D,position:r,isPositioned:A,searchRef:B,children:(0,I.jsx)(ch,{as:_te,allowPinchZoom:!0,children:(0,I.jsx)(Kp,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:j(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(be,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,I.jsx)(ie,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...ae,onPlaced:()=>M(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:j(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ee(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});O$.displayName=D$;var k$=`SelectItemAlignedPosition`,A$=_.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=u$(S$,n),o=E$(S$,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=P(t,e=>u(e)),f=a$(n),p=_.useRef(!1),m=_.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=_.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-w$,d=qQ(a,[w$,Math.max(w$,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-w$,d=qQ(a,[w$,Math.max(w$,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-w$*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),_=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+_+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-w$,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+_+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${w$}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,v,a.dir,r]);ke(()=>b(),[b]);let[x,S]=_.useState();ke(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=_.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]);return(0,I.jsx)(N$,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,I.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,I.jsx)(H.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});A$.displayName=k$;var j$=`SelectPopperPosition`,M$=_.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=w$,...a}=e,o=c$(n);return(0,I.jsx)(Cc,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})});M$.displayName=j$;var[N$,P$]=s$(S$,{}),F$=`SelectViewport`,I$=_.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=E$(F$,n),o=P$(F$,n),s=P(t,a.onViewportChange),c=_.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.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}),(0,I.jsx)(i$.Slot,{scope:n,children:(0,I.jsx)(H.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:j(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-w$*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});I$.displayName=F$;var L$=`SelectGroup`,[R$,z$]=s$(L$),B$=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Pa();return(0,I.jsx)(R$,{scope:n,id:i,children:(0,I.jsx)(H.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});B$.displayName=L$;var V$=`SelectLabel`,H$=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=z$(V$,n);return(0,I.jsx)(H.div,{id:i.id,...r,ref:t})});H$.displayName=V$;var U$=`SelectItem`,[W$,G$]=s$(U$),K$=_.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=u$(U$,n),c=E$(U$,n),l=s.value===r,[u,d]=_.useState(a??``),[f,p]=_.useState(!1),m=P(t,e=>c.itemRefCallback?.(e,r,i)),h=Pa(),g=_.useRef(`touch`),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw 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(0,I.jsx)(W$,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(i$.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,I.jsx)(H.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:j(o.onFocus,()=>p(!0)),onBlur:j(o.onBlur,()=>p(!1)),onClick:j(o.onClick,()=>{g.current!==`mouse`&&v()}),onPointerUp:j(o.onPointerUp,()=>{g.current===`mouse`&&v()}),onPointerDown:j(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:j(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:j(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:j(o.onKeyDown,e=>{(c.searchRef?.current===``||e.key!==` `)&&(n$.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});K$.displayName=U$;var q$=`SelectItemText`,J$=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=u$(q$,n),s=E$(q$,n),c=G$(q$,n),l=f$(q$,n),[u,d]=_.useState(null),f=P(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=_.useMemo(()=>(0,I.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return ke(()=>(h(m),()=>g(m)),[h,g,m]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(H.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?A.createPortal(a.children,o.valueNode):null]})});J$.displayName=q$;var Y$=`SelectItemIndicator`,X$=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return G$(Y$,n).isSelected?(0,I.jsx)(H.span,{"aria-hidden":!0,...r,ref:t}):null});X$.displayName=Y$;var Z$=`SelectScrollUpButton`,Q$=_.forwardRef((e,t)=>{let n=E$(Z$,e.__scopeSelect),r=P$(Z$,e.__scopeSelect),[i,a]=_.useState(!1),o=P(t,r.onScrollButtonChange);return ke(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(t1,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Q$.displayName=Z$;var $$=`SelectScrollDownButton`,e1=_.forwardRef((e,t)=>{let n=E$($$,e.__scopeSelect),r=P$($$,e.__scopeSelect),[i,a]=_.useState(!1),o=P(t,r.onScrollButtonChange);return ke(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(t1,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});e1.displayName=$$;var t1=_.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=E$(`SelectScrollButton`,n),o=_.useRef(null),s=a$(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),ke(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,I.jsx)(H.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:j(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:j(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:j(i.onPointerLeave,()=>{c()})})}),n1=`SelectSeparator`,r1=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(H.div,{"aria-hidden":!0,...r,ref:t})});r1.displayName=n1;var i1=`SelectArrow`,a1=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=c$(n),a=u$(i1,n),o=E$(i1,n);return a.open&&o.position===`popper`?(0,I.jsx)(wc,{...i,...r,ref:t}):null});a1.displayName=i1;var o1=`SelectBubbleInput`,s1=_.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=_.useRef(null),a=P(r,i),o=e$(t);return _.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,I.jsx)(H.select,{...n,style:{...Ve,...n.style},ref:a,defaultValue:t})});s1.displayName=o1;function c1(e){return e===``||e===void 0}function l1(e){let t=fe(e),n=_.useRef(``),r=_.useRef(0),i=_.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=_.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function u1(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=d1(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function d1(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var f1=p$,p1=h$,m1=_$,h1=y$,g1=x$,_1=C$,v1=I$,y1=H$,b1=K$,x1=J$,S1=X$,C1=Q$,w1=e1,T1=r1,E1=f1,D1=m1,O1=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(p1,{ref:r,className:U(`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-hidden 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,(0,I.jsx)(h1,{asChild:!0,children:(0,I.jsx)(rn,{className:`h-4 w-4 opacity-50`})})]}));O1.displayName=p1.displayName;var k1=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(C1,{ref:n,className:U(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(on,{className:`h-4 w-4`})}));k1.displayName=C1.displayName;var A1=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(w1,{ref:n,className:U(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(rn,{className:`h-4 w-4`})}));A1.displayName=w1.displayName;var j1=_.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,I.jsx)(g1,{children:(0,I.jsxs)(_1,{ref:i,className:U(`relative z-50 max-h-96 min-w-32 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:[(0,I.jsx)(k1,{}),(0,I.jsx)(v1,{className:U(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)`),children:t}),(0,I.jsx)(A1,{})]})}));j1.displayName=_1.displayName;var M1=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(y1,{ref:n,className:U(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));M1.displayName=y1.displayName;var Q=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(b1,{ref:r,className:U(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50 focus:bg-accent focus:text-accent-foreground`,e),...n,children:[(0,I.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,I.jsx)(S1,{children:(0,I.jsx)(nn,{className:`h-4 w-4`})})}),(0,I.jsx)(x1,{children:t})]}));Q.displayName=b1.displayName;var N1=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(T1,{ref:n,className:U(`-mx-1 my-1 h-px bg-muted`,e),...t}));N1.displayName=T1.displayName;function P1(e){let t=(e.agentEntries&&e.agentEntries.length>0?e.agentEntries:e.agents.map(e=>({kind:`inline`,agent:e}))).map(e=>e.kind===`inline`?e.agent.id:e.ref).map(e=>e.trim()).filter(Boolean),n=(e.runDefaults?.selectedAgentNames??[]).filter(e=>t.includes(e));return n.length>0?n:t}function F1(e){return e.relativePath?.trim()||e.sourcePath?.trim()||void 0}var I1=e=>e.configName?.trim()||e.name,L1=`(root)`,R1=`__ROOT__`,z1=`mcplab.configurations.collapsedSuites`,B1=e=>e.suitePath&&e.suitePath.trim().length>0?e.suitePath.trim():null,V1=e=>e??L1,H1=e=>e===null?R1:`suite:${e}`,U1=e=>e===R1?null:e.startsWith(`suite:`)?e.slice(6):null,W1=(e,t)=>t===null?e===null:e===null?!1:e===t||e.startsWith(`${t}/`),G1=e=>{for(let t of e){let e=t.scenarioEntries??[];for(let t of e){if(t.kind===`inline`&&t.scenario?.id)return String(t.scenario.id);if(t.kind===`referenced`&&t.ref)return String(t.ref)}let n=t.scenarios??[];for(let e of n)if(e?.id)return String(e.id)}return null},K1=e=>G1([e]),q1=e=>{let t=K1(e);return t?{href:`/results?scenario=${encodeURIComponent(t)}`,tooltipLabel:`Open results filtered by scenario ${t}`}:{href:`/results`,tooltipLabel:`Open results`}},J1=`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`.split(`.`);function Y1(e){return e===null?`bg-slate-400`:J1[e.split(``).reduce((e,t)=>(e+t.charCodeAt(0))%J1.length,0)]??`bg-slate-400`}var X1=()=>{let{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:i}=Jv(),{source:a}=Rv(),o=Ud(),[s,c]=(0,_.useState)(`name`),[l,u]=(0,_.useState)(`asc`),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(`all`),[h,g]=(0,_.useState)(()=>{try{let e=window.localStorage.getItem(z1);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch(e){return console.warn(`Failed to restore collapsed suites from localStorage`,e),new Set}}),[v,y]=(0,_.useState)(new Set),[b,x]=(0,_.useState)(new Set),[S,C]=(0,_.useState)(new Set),[w,T]=(0,_.useState)({}),E=d.trim().toLowerCase(),D=e=>{s===e?u(e=>e===`asc`?`desc`:`asc`):(c(e),u(e===`updatedAt`?`desc`:`asc`))};(0,_.useEffect)(()=>{i();let e=()=>{i()};return window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[i]),(0,_.useEffect)(()=>{let t=!1;return(async()=>{try{if(a.getLatestPassRatesByConfigIds){let n=await a.getLatestPassRatesByConfigIds({lastDays:365,configs:e.map(e=>({id:e.id,sourcePath:e.sourcePath,relativePath:e.relativePath,configHash:e.configHash}))});t||T(n);return}T({})}catch{t||T({})}})(),()=>{t=!0}},[e,a]);let k=async(e,n)=>{await t(e),O({title:`Deleted`,description:`"${n}" has been removed.`})},A=async e=>{let t=await n(e);O({title:`Cloned`,description:`Created "${I1(t)}".`}),o(`/mcp-evaluations/${t.id}`)},j=e=>e.agentEntries?.length??e.agents?.length??0,M=e=>e.scenarioEntries?.length??e.scenarios?.length??0,N=(0,_.useMemo)(()=>{let t=new Set;for(let n of e){let e=B1(n);if(t.add(e),!e)continue;let r=e.split(`/`).filter(Boolean);for(let e=1;e<r.length;e+=1)t.add(r.slice(0,e).join(`/`))}return Array.from(t).sort((e,t)=>V1(e).localeCompare(V1(t)))},[e]),P=(0,_.useMemo)(()=>e.filter(e=>{let t=B1(e),n=p===`all`?void 0:U1(p),r=V1(t);return n!==void 0&&!W1(t,n)?!1:E.length===0||[I1(e),e.id,e.description??``,e.loadError??``,r,e.relativePath??``].join(` `).toLowerCase().includes(E)}),[e,E,p]),F=(0,_.useMemo)(()=>[...P].sort((e,t)=>{let n=0;return s===`name`&&(n=I1(e).localeCompare(I1(t))),s===`scenarios`&&(n=M(e)-M(t)),s===`agents`&&(n=j(e)-j(t)),s===`updatedAt`&&(n=new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()),l===`asc`?n:-n}),[P,s,l]),L=e=>s===e?l===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`}),R=e=>{g(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},z=async(t,n,r)=>{if(b.has(t))return;let i=e.find(e=>e.id===t),o=i?P1(i):[];x(e=>new Set(e).add(t));try{await a.startRun({configPath:n,runsPerScenario:1,...o.length>0?{agents:o}:{}}),y(e=>new Set(e).add(t)),window.setTimeout(()=>{y(e=>{let n=new Set(e);return n.delete(t),n})},2e3),O({title:`Queued`,description:`"${r}" added to run queue.`})}catch(e){O({title:`Could not queue evaluation`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{x(e=>{let n=new Set(e);return n.delete(t),n})}};(0,_.useEffect)(()=>{try{window.localStorage.setItem(z1,JSON.stringify(Array.from(h)))}catch(e){console.warn(`Failed to persist collapsed suites to localStorage (quota/private mode?)`,e)}},[h]);let B=async(e,t,n)=>{if(!S.has(e)){C(t=>new Set(t).add(e));try{let e=n.filter(e=>typeof e.sourcePath==`string`&&e.sourcePath.trim().length>0);if(e.length===0){O({title:`No runnable evaluations`,description:`Suite "${t}" has no evaluation files with a source path.`,variant:`destructive`});return}let r=await Promise.allSettled(e.map(e=>{let t=P1(e);return a.startRun({configPath:String(e.sourcePath),runsPerScenario:1,...t.length>0?{agents:t}:{}})})),i=r.filter(e=>e.status===`fulfilled`).length,o=r.length-i,s=r.find(e=>e.status===`rejected`),c=s?s.reason instanceof Error?s.reason.message:String(s.reason):void 0;O({title:o===0?`Suite queued`:`Suite queued with errors`,description:o===0?`Queued ${i} evaluation${i===1?``:`s`} for suite "${t}".`:`Queued ${i}/${e.length} evaluations for suite "${t}" (${o} failed${c?`: ${c}`:``}).`,variant:o===0?`default`:`destructive`})}catch(e){O({title:`Could not queue suite`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{C(t=>{let n=new Set(t);return n.delete(e),n})}}},ee=(0,_.useMemo)(()=>{let e=new Map;for(let t of F){let n=B1(t),r=e.get(n);r?r.push(t):e.set(n,[t])}return Array.from(e.entries()).sort((e,t)=>V1(e[0]).localeCompare(V1(t[0])))},[F]);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Tn,{className:`h-6 w-6`}),`MCP Evaluations`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Manage your MCP evaluation suites`})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(LY,{value:d,onValueChange:f,placeholder:`Search evaluations...`}),(0,I.jsxs)(E1,{value:p,onValueChange:m,children:[(0,I.jsx)(O1,{className:`h-9 w-[200px]`,children:(0,I.jsx)(D1,{placeholder:`All suites`})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`all`,children:`All suites`}),N.map(e=>(0,I.jsx)(Q,{value:H1(e),children:V1(e)},H1(e)))]})]}),(0,I.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>void i(),children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),(0,I.jsxs)(W,{variant:`outline`,size:`sm`,children:[(0,I.jsx)(sr,{className:`mr-2 h-4 w-4`}),`Import YAML`]}),(0,I.jsx)(W,{size:`sm`,asChild:!0,children:(0,I.jsxs)(sp,{to:`/mcp-evaluations/new`,children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Create New`]})})]})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(ny,{children:[(0,I.jsx)(ry,{children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`name`),children:[`Name`,L(`name`)]})}),(0,I.jsx)(sy,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`scenarios`),children:[`Scenarios`,L(`scenarios`)]})}),(0,I.jsx)(sy,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`agents`),children:[`Agents`,L(`agents`)]})}),(0,I.jsx)(sy,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>D(`updatedAt`),children:[`Last Updated`,L(`updatedAt`)]})}),(0,I.jsx)(sy,{className:`text-right`,children:`Last Run`}),(0,I.jsx)(sy,{className:`w-[220px] text-right`})]})}),(0,I.jsxs)(iy,{children:[ee.map(([e,t])=>{let n=V1(e),r=H1(e),i=h.has(r),a=S.has(r);return(0,I.jsxs)(_.Fragment,{children:[(0,I.jsx)(oy,{className:`bg-muted/40 hover:bg-muted/40`,children:(0,I.jsx)(J,{colSpan:6,className:`py-2`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 items-center gap-2 text-xs leading-none hover:text-foreground`,onClick:()=>R(r),"aria-expanded":!i,"aria-label":`${i?`Expand`:`Collapse`} suite ${n}`,children:[(0,I.jsx)(an,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${i?``:`rotate-90`}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`h-2 w-2 rounded-full ${Y1(e)}`,"aria-hidden":`true`}),e===null?(0,I.jsx)(kn,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}):(0,I.jsx)(En,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`font-medium`,children:n}),(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,t.length,`)`]})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:a,onClick:()=>void B(r,n,t),children:[(0,I.jsx)(Kn,{className:`mr-1 h-3.5 w-3.5`}),a?`Queueing...`:`Run Suite`]})]})})},`suite-${r}`),!i&&t.map(e=>{let t=q1(e),n=F1(e);return(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(sp,{to:`/mcp-evaluations/${e.id}`,className:`font-medium text-sm hover:text-primary`,children:I1(e)}),e.loadError&&(0,I.jsxs)(Y,{variant:`destructive`,className:`ml-2 align-middle text-[10px]`,children:[(0,I.jsx)(or,{className:`mr-1 h-3 w-3`}),`Broken`]}),n&&(0,I.jsx)(`div`,{className:`mt-0.5`,children:(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground font-mono`,children:n})}),e.loadError&&(0,I.jsx)(`p`,{className:`text-xs text-destructive mt-0.5 break-all`,children:e.loadError})]})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:M(e)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:j(e)}),(0,I.jsx)(J,{className:`text-right text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.updatedAt).toLocaleDateString()]})}),(0,I.jsx)(J,{className:`text-right`,children:Object.hasOwn(w,e.id)?(0,I.jsx)(`div`,{className:`inline-flex justify-end`,children:(0,I.jsx)(dy,{rate:w[e.id]})}):``}),(0,I.jsx)(J,{className:`w-[220px] whitespace-nowrap`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(LQ,{children:[(0,I.jsx)(RQ,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,I.jsx)(vn,{className:`h-4 w-4`})})}),(0,I.jsxs)(VQ,{align:`end`,children:[(0,I.jsxs)(HQ,{onClick:()=>o(`/mcp-evaluations/${e.id}`),children:[(0,I.jsx)(Gn,{className:`mr-2 h-3.5 w-3.5`}),`Edit`]}),(0,I.jsxs)(HQ,{onClick:()=>void A(e.id),children:[(0,I.jsx)(hn,{className:`mr-2 h-3.5 w-3.5`}),`Clone`]}),(0,I.jsxs)(HQ,{className:`text-destructive`,onClick:()=>void k(e.id,I1(e)),children:[(0,I.jsx)(ar,{className:`mr-2 h-3.5 w-3.5`}),`Delete`]})]})]}),(0,I.jsx)(fl,{children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(W,{size:`icon`,variant:`outline`,className:`h-8 w-8`,asChild:!0,"aria-label":t.tooltipLabel,children:(0,I.jsxs)(sp,{to:t.href,children:[(0,I.jsx)(tn,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{className:`sr-only`,children:t.tooltipLabel})]})})}),(0,I.jsx)(hl,{children:t.tooltipLabel})]})}),(0,I.jsx)(fl,{children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-8 px-2 text-xs ${v.has(e.id)?`border-green-600 bg-green-600 text-white hover:bg-green-700 hover:text-white`:``}`,disabled:b.has(e.id)||!e.sourcePath,onClick:()=>e.sourcePath&&void z(e.id,e.sourcePath,I1(e)),"aria-label":`Queue ${I1(e)}`,children:v.has(e.id)?`Queued`:b.has(e.id)?`Queueing...`:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Fn,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Queue evaluation`})]})})}),(0,I.jsx)(hl,{children:`Queue evaluation run`})]})}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)(sp,{to:`/run?configId=${encodeURIComponent(e.id)}`,children:[(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),`Run`]})})]})})]},e.id)})]},`suite-group-${r}`)}),!r&&e.length===0&&(0,I.jsx)(oy,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`No MCP evaluations yet. Create your first one to get started.`})}),!r&&e.length>0&&F.length===0&&(0,I.jsx)(oy,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`No MCP evaluations match this filter.`})}),r&&(0,I.jsx)(oy,{children:(0,I.jsx)(J,{colSpan:6,className:`text-center py-12 text-muted-foreground`,children:`Loading MCP evaluations...`})})]})]})})})]})},Z1=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Cp(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Q1=`Label`,$1=_.forwardRef((e,t)=>(0,I.jsx)(Z1.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));$1.displayName=Q1;var e0=$1,t0=Wt(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),$=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(e0,{ref:n,className:U(t0(),e),...t}));$.displayName=e0.displayName;var n0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`textarea`,{className:U(`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-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));n0.displayName=`Textarea`;var r0=`Tabs`,[i0,vte]=R(r0,[qY]),a0=qY(),[o0,s0]=i0(r0),c0=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=zY(s),[d,f]=Re({prop:r,onChange:i,defaultProp:a??``,caller:r0});return(0,I.jsx)(o0,{scope:n,baseId:Pa(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,I.jsx)(H.div,{dir:u,"data-orientation":o,...l,ref:t})})});c0.displayName=r0;var l0=`TabsList`,u0=_.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=s0(l0,n),o=a0(n);return(0,I.jsx)(aX,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,I.jsx)(H.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});u0.displayName=l0;var d0=`TabsTrigger`,f0=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=s0(d0,n),s=a0(n),c=h0(o.baseId,r),l=g0(o.baseId,r),u=r===o.value;return(0,I.jsx)(oX,{asChild:!0,...s,focusable:!i,active:u,children:(0,I.jsx)(H.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:j(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:j(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:j(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});f0.displayName=d0;var p0=`TabsContent`,m0=_.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=s0(p0,n),c=h0(s.baseId,r),l=g0(s.baseId,r),u=r===s.value,d=_.useRef(u);return _.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.jsx)(Ne,{present:i||u,children:({present:n})=>(0,I.jsx)(H.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});m0.displayName=p0;function h0(e,t){return`${e}-trigger-${t}`}function g0(e,t){return`${e}-content-${t}`}var _0=c0,v0=u0,y0=f0,b0=m0,x0=_0,S0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(v0,{ref:n,className:U(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));S0.displayName=v0.displayName;var C0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(y0,{ref:n,className:U(`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-xs focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,e),...t}));C0.displayName=y0.displayName;var w0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(b0,{ref:n,className:U(`mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));w0.displayName=b0.displayName;var T0={openai:`OpenAI`,anthropic:`Anthropic`,azure:`Azure OpenAI`,azure_openai:`Azure OpenAI`,azure_foundry:`Azure Foundry`,google:`Google`};function E0(e){return T0[e]??e}var D0={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`,azure_foundry:`bg-blue-100 text-blue-800`,google:`bg-yellow-100 text-yellow-800`,custom:`bg-gray-100 text-gray-800`};function O0({provider:e}){return(0,I.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${D0[e]??D0.custom}`,children:E0(e)})}var k0=`Checkbox`,[A0,yte]=R(k0),[j0,M0]=A0(k0);function N0(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Re({prop:n,defaultProp:i??!1,onChange:c,caller:k0}),[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useRef(!1),b=!m||!!o||!!m.closest(`form`),x={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:!H0(i)&&i,isFormControl:b,bubbleInput:g,setBubbleInput:v};return(0,I.jsx)(j0,{scope:t,...x,children:V0(d)?d(x):r})}var P0=`CheckboxTrigger`,F0=_.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=M0(P0,e),h=P(i,u),g=_.useRef(c);return _.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,I.jsx)(H.button,{type:`button`,role:`checkbox`,"aria-checked":H0(c)?`mixed`:c,"aria-required":l,"data-state":U0(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:j(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:j(n,e=>{d(e=>H0(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});F0.displayName=P0;var I0=_.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,I.jsx)(N0,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(F0,{...d,ref:t,__scopeCheckbox:n}),e&&(0,I.jsx)(B0,{__scopeCheckbox:n})]})})});I0.displayName=k0;var L0=`CheckboxIndicator`,R0=_.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=M0(L0,n);return(0,I.jsx)(Ne,{present:r||H0(a.checked)||a.checked===!0,children:(0,I.jsx)(H.span,{"data-state":U0(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});R0.displayName=L0;var z0=`CheckboxBubbleInput`,B0=_.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=M0(z0,e),m=P(n,p),h=e$(a),g=nc(r);_.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=H0(a),n.call(e,!H0(a)&&a),e.dispatchEvent(t)}},[f,h,a,i]);let v=_.useRef(!H0(a)&&a);return(0,I.jsx)(H.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??v.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});B0.displayName=z0;function V0(e){return typeof e==`function`}function H0(e){return e===`indeterminate`}function U0(e){return H0(e)?`indeterminate`:e?`checked`:`unchecked`}var W0=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(I0,{ref:n,className:U(`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-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,I.jsx)(R0,{className:U(`flex items-center justify-center text-current`),children:(0,I.jsx)(nn,{className:`h-4 w-4`})})}));W0.displayName=I0.displayName;var G0=`Collapsible`,[K0,bte]=R(G0),[q0,J0]=K0(G0),Y0=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Re({prop:r,defaultProp:i??!1,onChange:o,caller:G0});return(0,I.jsx)(q0,{scope:n,disabled:a,contentId:Pa(),open:c,onOpenToggle:_.useCallback(()=>l(e=>!e),[l]),children:(0,I.jsx)(H.div,{"data-state":t2(c),"data-disabled":a?``:void 0,...s,ref:t})})});Y0.displayName=G0;var X0=`CollapsibleTrigger`,Z0=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=J0(X0,n);return(0,I.jsx)(H.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":t2(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:j(e.onClick,i.onOpenToggle)})});Z0.displayName=X0;var Q0=`CollapsibleContent`,$0=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=J0(Q0,e.__scopeCollapsible);return(0,I.jsx)(Ne,{present:n||i.open,children:({present:e})=>(0,I.jsx)(e2,{...r,ref:t,present:e})})});$0.displayName=Q0;var e2=_.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=J0(Q0,n),[s,c]=_.useState(r),l=_.useRef(null),u=P(t,l),d=_.useRef(0),f=d.current,p=_.useRef(0),m=p.current,h=o.open||s,g=_.useRef(h),v=_.useRef(void 0);return _.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),ke(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,I.jsx)(H.div,{"data-state":t2(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function t2(e){return e?`open`:`closed`}var n2=Y0,r2=Z0,i2=$0;function a2(e){return e.length>0?`Tool sequence · ${e.join(` -> `)}`:`Tool sequence`}function o2({text:e,variant:t=`assistant`,className:n}){let r=s2(e);return(0,I.jsx)(`div`,{className:U(`space-y-2`,t===`system`&&`text-xs`,n),children:r.map((e,n)=>(0,I.jsx)(_.Fragment,{children:u2(e,n,t)},`md-${n}`))})}function s2(e){let t=e.replace(/\r\n/g,`
|
|
118
|
-
`).split(`
|
|
119
|
-
`),n=[],r=0,i=e=>e.trim()===``,a=e=>e.trimStart().startsWith("```");for(;r<t.length;){let e=t[r],o=e.trim();if(i(e)){r+=1;continue}if(a(e)){let e=o.replace(/^```/,``).trim()||void 0;r+=1;let i=[];for(;r<t.length&&!a(t[r]);)i.push(t[r]),r+=1;r<t.length&&a(t[r])&&(r+=1),n.push({type:`code`,lang:e,code:i.join(`
|
|
120
|
-
`)});continue}if(/^---+$/.test(o)||/^\*\*\*+$/.test(o)){n.push({type:`hr`}),r+=1;continue}if(o.startsWith(`>`)){let e=[];for(;r<t.length&&t[r].trim().startsWith(`>`);)e.push(t[r].trim().replace(/^>\s?/,``)),r+=1;n.push({type:`blockquote`,text:e.join(`
|
|
121
|
-
`)});continue}let s=o.match(/^(#{1,4})\s+(.+)$/);if(s){n.push({type:`heading`,level:s[1].length,text:s[2].trim()}),r+=1;continue}if(c2(t,r)){let e=l2(t[r]);r+=2;let a=[];for(;r<t.length&&t[r].includes(`|`)&&!i(t[r]);)a.push(l2(t[r])),r+=1;n.push({type:`table`,headers:e,rows:a});continue}let c=o.match(/^\d+\.\s+/),l=o.match(/^[-*+]\s+/);if(c||l){let e=!!c,a=[];for(;r<t.length;){let n=t[r].trim();if(e?/^\d+\.\s+/.test(n):/^[-*+]\s+/.test(n))a.push(n.replace(e?/^\d+\.\s+/:/^[-*+]\s+/,``)),r+=1;else{i(t[r])&&(r+=1);break}}n.push({type:`list`,ordered:e,items:a});continue}let u=[e];for(r+=1;r<t.length;){let e=t[r],n=e.trim();if(i(e)||a(e)||/^---+$/.test(n)||/^#{1,4}\s+/.test(n)||n.startsWith(`>`)||c2(t,r)||/^\d+\.\s+/.test(n)||/^[-*+]\s+/.test(n))break;u.push(e),r+=1}n.push({type:`paragraph`,text:u.join(`
|
|
122
|
-
`)})}return n}function c2(e,t){if(t+1>=e.length)return!1;let n=e[t].trim(),r=e[t+1].trim();return n.includes(`|`)?/^\|?(\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?$/.test(r):!1}function l2(e){return e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim())}function u2(e,t,n){if(e.type===`hr`)return(0,I.jsx)(`hr`,{className:`border-border/60`});if(e.type===`heading`){let n=e.level===1?`text-base font-semibold`:e.level===2?`text-sm font-semibold`:`text-sm font-medium`;return(0,I.jsx)(`h4`,{className:n,children:d2(e.text,`${t}-h`)})}if(e.type===`paragraph`)return(0,I.jsx)(`p`,{className:U(`whitespace-pre-wrap leading-relaxed`,n===`system`&&`leading-normal`),children:d2(e.text,`${t}-p`)});if(e.type===`blockquote`)return(0,I.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground italic`,children:d2(e.text,`${t}-bq`)});if(e.type===`code`)return(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/70`,children:[e.lang&&(0,I.jsx)(`div`,{className:`border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground`,children:e.lang}),(0,I.jsx)(`pre`,{className:`max-h-72 overflow-auto p-2 text-xs`,children:(0,I.jsx)(`code`,{children:e.code})})]});if(e.type===`list`){let n=e.ordered?`ol`:`ul`;return(0,I.jsx)(n,{className:U(`space-y-1 pl-5`,e.ordered?`list-decimal`:`list-disc`),children:e.items.map((e,n)=>(0,I.jsx)(`li`,{className:`leading-relaxed`,children:d2(e,`${t}-li-${n}`)},`${t}-li-${n}`))})}return e.type===`table`?(0,I.jsx)(`div`,{className:`overflow-x-auto rounded-md border`,children:(0,I.jsxs)(`table`,{className:`w-full min-w-[480px] border-collapse text-xs`,children:[(0,I.jsx)(`thead`,{className:`bg-muted/40`,children:(0,I.jsx)(`tr`,{children:e.headers.map((e,n)=>(0,I.jsx)(`th`,{className:`border-b px-2 py-1.5 text-left font-semibold align-top`,children:d2(e,`${t}-thc-${n}`)},`${t}-th-${n}`))})}),(0,I.jsx)(`tbody`,{children:e.rows.map((e,n)=>(0,I.jsx)(`tr`,{className:`border-t`,children:e.map((e,r)=>(0,I.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:d2(e,`${t}-tdc-${n}-${r}`)},`${t}-td-${n}-${r}`))},`${t}-row-${n}`))})]})}):null}function d2(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|\*[^*\n]+\*|_[^_\n]+_|~~[^~\n]+~~|\[[^\]]+\]\([^)]+\))/g).filter(Boolean).map((e,n)=>{if(e.startsWith("`")&&e.endsWith("`"))return(0,I.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]`,children:e.slice(1,-1)},`${t}-${n}`);if(e.startsWith(`**`)&&e.endsWith(`**`))return(0,I.jsx)(`strong`,{children:e.slice(2,-2)},`${t}-${n}`);if(e.startsWith(`*`)&&e.endsWith(`*`)||e.startsWith(`_`)&&e.endsWith(`_`))return(0,I.jsx)(`em`,{children:e.slice(1,-1)},`${t}-${n}`);if(e.startsWith(`~~`)&&e.endsWith(`~~`))return(0,I.jsx)(`s`,{children:e.slice(2,-2)},`${t}-${n}`);let r=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return r?(0,I.jsx)(`a`,{href:r[2],target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:r[1]},`${t}-${n}`):(0,I.jsx)(_.Fragment,{children:e},`${t}-${n}`)})}function f2({message:e,className:t,assistantLabel:n,renderActions:r}){let i=e.role;if(i===`tool`){let n=String(e.text??``).trim();return/^(Approved|Denied) tool call\b/i.test(n)?null:(0,I.jsxs)(`div`,{className:U(`rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm`,t),children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wide text-sky-700`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),`Tool`,(0,I.jsx)(`span`,{className:`font-normal normal-case text-sky-700/80`,children:new Date(e.createdAt).toLocaleTimeString()})]}),(0,I.jsx)(`p`,{className:`whitespace-pre-wrap text-sky-900`,children:e.text})]})}if(i===`system`)return(0,I.jsxs)(`div`,{className:U(`flex items-start gap-2 text-xs`,t),children:[(0,I.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:(0,I.jsx)(Jn,{className:`h-3 w-3`})}),(0,I.jsx)(`div`,{className:`max-w-[92%] rounded-md border border-amber-400/30 bg-amber-50/70 p-3 text-sm`,children:(0,I.jsx)(o2,{text:e.text,variant:`assistant`})})]});let a=i===`user`,o=a?cr:$t;return(0,I.jsxs)(`div`,{className:U(`flex items-start gap-2 text-xs ${a?`justify-end`:`justify-start`}`,t),children:[!a&&(0,I.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:(0,I.jsx)(o,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`relative max-w-[92%]`,children:[(0,I.jsxs)(`div`,{className:`max-w-full wrap-break-word rounded-md border px-3 py-2 text-sm ${a?`border-primary/20 bg-primary/10`:`border-border/80 bg-background shadow-xs`}`,children:[!a&&n&&(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold text-muted-foreground`,children:n}),a?(0,I.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.text}):(0,I.jsx)(o2,{text:e.text,variant:`assistant`,className:`text-sm`})]}),r]}),a&&(0,I.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:(0,I.jsx)(cr,{className:`h-3 w-3`})})]})}function p2({call:e,loading:t=!1,onApprove:n,onDeny:r,defaultOpen:i,className:a,description:o}){let s=e.status===`pending`,c=e.tool||e.publicToolName||`unknown_tool`;return(0,I.jsxs)(`details`,{open:i??s,className:U(`group overflow-hidden rounded-md border border-border/60 bg-background`,a),children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:`Tool call ${c}`}),(0,I.jsx)(`span`,{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${s?`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:s?`Needs approval`:e.status===`error`?`Error`:e.status===`denied`?`Denied`:`Approved`})]})}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,I.jsxs)(`div`,{className:`space-y-2 border-t border-border/50 px-3 py-2`,children:[o&&(0,I.jsx)(o2,{text:o,variant:`assistant`,className:`text-sm`}),(0,I.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:(0,I.jsx)(`code`,{children:JSON.stringify(e.arguments??{},null,2)})}),e.error&&(0,I.jsx)(`p`,{className:`text-xs text-destructive`,children:e.error}),s&&(0,I.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:t,onClick:()=>r?.(e.id),children:`Deny`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:t,onClick:()=>n?.(e.id),children:`Approve`})]})]})]})}function m2(){return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.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:(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),`Thinking...`]})]})}function h2({snippets:e,snippetsLabel:t,onSnippetSelect:n,disabled:r=!1,contentClassName:i=`w-[360px]`}){return(0,I.jsxs)(LQ,{children:[(0,I.jsx)(RQ,{asChild:!0,children:(0,I.jsxs)(W,{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:[(0,I.jsx)(qn,{className:`h-3 w-3`}),`Snippets`,(0,I.jsx)(rn,{className:`h-3 w-3`})]})}),(0,I.jsxs)(VQ,{align:`start`,className:i,children:[(0,I.jsx)(GQ,{children:t}),(0,I.jsx)(KQ,{}),e.map(e=>(0,I.jsx)(HQ,{className:`items-start whitespace-normal px-2 py-2`,onSelect:()=>n(e.prompt),children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium leading-tight`,children:e.label}),(0,I.jsx)(`div`,{className:`text-[11px] leading-snug text-muted-foreground`,children:e.description})]})},e.label))]})]})}function g2({input:e,onInputChange:t,onSend:n,onCancel:r,inputPlaceholder:i,snippets:a,snippetsLabel:o,onSnippetSelect:s,loading:c=!1,disabled:l=!1,inputRef:u,snippetContentClassName:d}){let f=l||c;return(0,I.jsxs)(`div`,{className:`rounded-xl border bg-background p-2 shadow-xs`,children:[(0,I.jsx)(n0,{ref:u,value:e,onChange:e=>t(e.target.value),placeholder:i,disabled:l,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:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f||n())}}),(0,I.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-2 px-1 pt-1`,children:[(0,I.jsx)(h2,{snippets:a,snippetsLabel:o,onSnippetSelect:s,disabled:f,contentClassName:d}),c&&r?(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`relative h-8 w-8 shrink-0 overflow-hidden rounded-full`,onClick:r,"aria-label":`Cancel assistant message`,title:`Cancel assistant message`,children:[(0,I.jsx)(`span`,{className:`pointer-events-none absolute inset-[2px] rounded-full border border-primary/20 border-t-primary/70 motion-reduce:animate-none animate-[spin_2.2s_linear_infinite]`}),(0,I.jsx)(`span`,{className:`pointer-events-none absolute inset-[4px] rounded-full border border-primary/10 motion-reduce:animate-none animate-pulse`}),(0,I.jsx)(rr,{className:`relative z-10 h-4 w-4`})]}):c?(0,I.jsx)(W,{type:`button`,size:`icon`,className:`h-8 w-8 shrink-0 rounded-full`,disabled:!0,"aria-label":`Assistant is loading`,title:`Assistant is loading`,children:(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`})}):(0,I.jsx)(W,{type:`button`,size:`icon`,className:`h-8 w-8 shrink-0 rounded-full pr-0.5`,onClick:n,disabled:f||!e.trim(),"aria-label":`Send assistant message`,title:`Send assistant message`,children:(0,I.jsx)(Qn,{className:`h-4 w-4`})})]})]})}var _2=ig,v2=og,y2=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(sg,{ref:n,className:U(`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}));y2.displayName=sg.displayName;var b2=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(v2,{children:[(0,I.jsx)(y2,{}),(0,I.jsxs)(cg,{ref:r,className:U(`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,(0,I.jsxs)(dg,{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-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none`,children:[(0,I.jsx)(dr,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));b2.displayName=cg.displayName;var x2=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});x2.displayName=`DialogHeader`;var S2=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(lg,{ref:n,className:U(`text-lg font-semibold leading-none tracking-tight`,e),...t}));S2.displayName=lg.displayName;var C2=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(ug,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));C2.displayName=ug.displayName;function w2(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var T2=`ScrollArea`,[E2,xte]=R(T2),[D2,O2]=E2(T2),k2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=_.useState(null),[l,u]=_.useState(null),[d,f]=_.useState(null),[p,m]=_.useState(null),[h,g]=_.useState(null),[v,y]=_.useState(0),[b,x]=_.useState(0),[S,C]=_.useState(!1),[w,T]=_.useState(!1),E=P(t,e=>c(e)),D=zY(i);return(0,I.jsx)(D2,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,I.jsx)(H.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":v+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})});k2.displayName=T2;var A2=`ScrollAreaViewport`,j2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=O2(A2,n),s=P(t,_.useRef(null),o.onViewportChange);return(0,I.jsxs)(I.Fragment,{children:[(0,I.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:i}),(0,I.jsx)(H.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,I.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});j2.displayName=A2;var M2=`ScrollAreaScrollbar`,N2=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=O2(M2,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return _.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,I.jsx)(P2,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,I.jsx)(F2,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,I.jsx)(I2,{...r,ref:t,forceMount:n}):i.type===`always`?(0,I.jsx)(L2,{...r,ref:t}):null});N2.displayName=M2;var P2=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=O2(M2,e.__scopeScrollArea),[a,o]=_.useState(!1);return _.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,I.jsx)(Ne,{present:n||a,children:(0,I.jsx)(I2,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),F2=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=O2(M2,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=r4(()=>c(`SCROLL_END`),100),[s,c]=w2(`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 _.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),_.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,I.jsx)(Ne,{present:n||s!==`hidden`,children:(0,I.jsx)(L2,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:j(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:j(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),I2=_.forwardRef((e,t)=>{let n=O2(M2,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=_.useState(!1),s=e.orientation===`horizontal`,c=r4(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return i4(n.viewport,c),i4(n.content,c),(0,I.jsx)(Ne,{present:r||a,children:(0,I.jsx)(L2,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),L2=_.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=O2(M2,e.__scopeScrollArea),a=_.useRef(null),o=_.useRef(0),[s,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=X2(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return Q2(e,o.current,s,t)}return n===`horizontal`?(0,I.jsx)(R2,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=$2(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,I.jsx)(z2,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=$2(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),R2=_.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=O2(M2,e.__scopeScrollArea),[o,s]=_.useState(),c=_.useRef(null),l=P(t,c,a.onScrollbarXChange);return _.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,I.jsx)(H2,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":Z2(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),t4(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Y2(o.paddingLeft),paddingEnd:Y2(o.paddingRight)}})}})}),z2=_.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=O2(M2,e.__scopeScrollArea),[o,s]=_.useState(),c=_.useRef(null),l=P(t,c,a.onScrollbarYChange);return _.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,I.jsx)(H2,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":Z2(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),t4(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Y2(o.paddingTop),paddingEnd:Y2(o.paddingBottom)}})}})}),[B2,V2]=E2(M2),H2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=O2(M2,n),[m,h]=_.useState(null),g=P(t,e=>h(e)),v=_.useRef(null),y=_.useRef(``),b=p.viewport,x=r.content-r.viewport,S=fe(u),C=fe(c),w=r4(d,10);function T(e){if(v.current){let t=e.clientX-v.current.left,n=e.clientY-v.current.top;l({x:t,y:n})}}return _.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&S(e,x)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),_.useEffect(C,[r,C]),i4(m,w),i4(p.content,w),(0,I.jsx)(B2,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:fe(a),onThumbPointerUp:fe(o),onThumbPositionChange:C,onThumbPointerDown:fe(s),children:(0,I.jsx)(H.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:j(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),v.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:j(e.onPointerMove,T),onPointerUp:j(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=``),v.current=null})})})}),U2=`ScrollAreaThumb`,W2=_.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=V2(U2,e.__scopeScrollArea);return(0,I.jsx)(Ne,{present:n||i.hasThumb,children:(0,I.jsx)(G2,{ref:t,...r})})}),G2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=O2(U2,n),o=V2(U2,n),{onThumbPositionChange:s}=o,c=P(t,e=>o.onThumbChange(e)),l=_.useRef(void 0),u=r4(()=>{l.current&&=(l.current(),void 0)},100);return _.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{if(u(),!l.current){let t=n4(e,s);l.current=t,s()}};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,I.jsx)(H.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:j(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:j(e.onPointerUp,o.onThumbPointerUp)})});W2.displayName=U2;var K2=`ScrollAreaCorner`,q2=_.forwardRef((e,t)=>{let n=O2(K2,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,I.jsx)(J2,{...e,ref:t}):null});q2.displayName=K2;var J2=_.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=O2(K2,n),[a,o]=_.useState(0),[s,c]=_.useState(0),l=!!(a&&s);return i4(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),i4(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,I.jsx)(H.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function Y2(e){return e?parseInt(e,10):0}function X2(e,t){let n=e/t;return isNaN(n)?0:n}function Z2(e){let t=X2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Q2(e,t,n,r=`ltr`){let i=Z2(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return e4([c,l],d)(e)}function $2(e,t,n=`ltr`){let r=Z2(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=qQ(e,n===`ltr`?[0,o]:[o*-1,0]);return e4([0,o],[0,s])(c)}function e4(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function t4(e,t){return e>0&&e<t}var n4=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function r4(e,t){let n=fe(e),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function i4(e,t){let n=fe(t);ke(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var a4=k2,o4=j2,s4=q2,c4=_.forwardRef(({className:e,children:t,...n},r)=>(0,I.jsxs)(a4,{ref:r,className:U(`relative overflow-hidden`,e),...n,children:[(0,I.jsx)(o4,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,I.jsx)(l4,{}),(0,I.jsx)(s4,{})]}));c4.displayName=a4.displayName;var l4=_.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,I.jsx)(N2,{ref:r,orientation:t,className:U(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-px`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-px`,e),...n,children:(0,I.jsx)(W2,{className:`relative flex-1 rounded-full bg-border`})}));l4.displayName=N2.displayName;function u4(e){return e instanceof Error&&e.name===`AbortError`||typeof e==`object`&&!!e&&`name`in e&&e.name===`AbortError`}function d4(e,t,n){if(e.type===`agent_check`){let n=String(e.label??``).trim();return n?t.find(e=>e.type===`agent_check`&&e.label===n):void 0}if(e.type===`tool_input_contains`||e.type===`tool_input_regex`||e.type===`tool_input_jsonpath`)return t.filter(t=>t.type===e.type&&t.metadata?.tool===e.tool).find(t=>e.type===`tool_input_contains`?q_(e.value)!==void 0&&q_(t.metadata?.value)===q_(e.value):e.type===`tool_input_regex`?q_(e.value)!==void 0&&q_(t.metadata?.pattern)===q_(e.value):t.metadata?.path===e.path&&e.equals===void 0==(t.metadata?.equals===void 0)&&(e.equals===void 0||t.metadata?.equals===e.equals))??t.find(t=>t.type===e.type&&t.label===n(e));let r=n(e);return t.find(t=>t.type===e.type&&t.label===r)}var f4={openai:`OpenAI`,anthropic:`Anthropic`,azure_openai:`Azure OpenAI`,azure_foundry:`Azure Foundry`};function p4(e){if(typeof e?.decision_provider==`string`&&(typeof e.decision_fallback==`string`||e.evaluator===`judge`)){let t=[`Evaluated by LLM judge`];return typeof e.judge_provider==`string`&&t.push(f4[e.judge_provider]??e.judge_provider),typeof e.judge_model==`string`&&t.push(e.judge_model),t.join(` · `)}if(typeof e?.decision_provider!=`string`){if(typeof e?.judge_provider!=`string`)return;let t=[`Evaluation Judge`,f4[e.judge_provider]??e.judge_provider];return typeof e.judge_model==`string`&&t.push(e.judge_model),t.join(` · `)}let t=[`Decision Engine · ${e.decision_provider}`],n=e.decision_requested_model??e.decision_model;typeof n==`string`&&t.push(n);for(let[n,r]of[[`decision_probability`,`probability`],[`decision_pass_threshold`,`pass ≥`],[`decision_fail_threshold`,`fail ≤`]]){let i=e[n];typeof i==`number`&&Number.isFinite(i)&&i>=0&&i<=1&&t.push(`${r} ${i.toFixed(3)}`)}return typeof e.decision_duration_ms==`number`&&Number.isFinite(e.decision_duration_ms)&&t.push(`${Math.round(e.decision_duration_ms)} ms`),t.join(` · `)}function m4(e){return e===`not_evaluated`?`Not evaluated`:e===`not_executed`?`Not executed`:e===`passed`?`Passed`:`Failed`}function h4({evalRules:e,failureReasons:t,runError:n,checkResults:r}){return n||t.find(e=>e.startsWith(`Scenario error:`))?e.map(e=>({rule:e,status:`not_executed`,failureReason:void 0})):r?.length?e.map(e=>{let t=d4(e,r,g4),n=e.type===`agent_check`?p4(t?.metadata):void 0,i=e.type===`agent_check`&&t?.metadata?.evaluator===`decision`?(typeof t.metadata.decision_prompt==`string`?t.metadata.decision_prompt:e.prompt)?.trim():void 0;return{rule:e,status:t?.status??`not_executed`,failureReason:t?.reason,...i?{decisionInput:i}:{},...n?{decisionDetails:n}:{}}}):e.map(e=>{let n=v4(e,t);return{rule:e,status:n?`failed`:`passed`,failureReason:n}})}function g4(e){return e.type===`required_tool`?`Required tool · ${e.value}`:e.type===`forbidden_tool`?`Forbidden tool · ${e.value}`:e.type===`tool_sequence`?G_(e.sequence??[]):e.type===`tool_input_contains`?H_({type:`contains`,tool:String(e.tool??``),value:String(e.value??``)}):e.type===`tool_input_regex`?H_({type:`regex`,tool:String(e.tool??``),pattern:String(e.value??``)}):e.type===`tool_input_jsonpath`?H_({type:`jsonpath`,tool:String(e.tool??``),path:String(e.path??``),...e.equals===void 0?{}:{equals:e.equals}}):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 exists · ${e.path}`:`JSONPath equals · ${e.path} == ${String(e.equals)}`:e.type===`response_jsonpath_exists`?`JSONPath exists · ${e.path}`:e.type===`response_jsonpath_not_exists`?`JSONPath not exists · ${e.path}`:e.type===`agent_check`?`Agent check · ${e.label}`:`${e.type} · ${e.value}`}function _4(e){return G_(e).replace(/^Tool sequence · /,``)}function v4(e,t){if(e.type===`tool_input_contains`||e.type===`tool_input_regex`||e.type===`tool_input_jsonpath`){let n=e.type===`tool_input_contains`?{type:`contains`,tool:String(e.tool??``),value:String(e.value??``)}:e.type===`tool_input_regex`?{type:`regex`,tool:String(e.tool??``),pattern:String(e.value??``)}:{type:`jsonpath`,tool:String(e.tool??``),path:String(e.path??``),...e.equals===void 0?{}:{equals:e.equals}},r=[W_(n,`tool_not_used`),W_(n,`input_mismatch`),W_(n,`invalid_regex`),W_(n,`invalid_jsonpath`),W_(n,`serialization`)];return t.find(e=>r.includes(e))}if(e.type===`response_jsonpath_exists`){let n=String(e.path??``).trim();return n?t.find(e=>e.startsWith(`JSONPath assertion failed: ${n}`)||e.startsWith(`JSONPath assertion failed: invalid JSON for path ${n}`)):void 0}let n=q_(e.value);if((e.type===`response_contains`||e.type===`response_not_contains`||e.type===`response_starts_with`||e.type===`response_ends_with`||e.type===`response_equals`||e.type===`response_regex`)&&n===void 0)return;let r=e.type===`required_tool`?`Required tool not used: ${e.value}`:e.type===`forbidden_tool`?`Forbidden tool used: ${e.value}`:e.type===`tool_sequence`?`Tool sequence order was not satisfied: ${(e.sequence??[]).join(` -> `)}`:e.type===`response_contains`?`Contains assertion failed: ${n}`:e.type===`response_not_contains`?`Not-contains assertion failed: ${n}`:e.type===`response_starts_with`?`Starts-with assertion failed: ${n}`:e.type===`response_ends_with`?`Ends-with assertion failed: ${n}`:e.type===`response_equals`?`Equals assertion failed: ${n}`:e.type===`response_regex`?`Regex assertion failed: ${n}`:e.type===`response_jsonpath`?e.equals===void 0?`JSONPath assertion failed: ${e.path}`:`JSONPath equals assertion failed: ${e.path}`:e.type===`response_jsonpath_not_exists`?`JSONPath not-exists assertion failed: ${e.path}`:e.type===`agent_check`?String(e.label??``):``;if(!r)return;let i=t.find(e=>e===r);if(i)return i;if(e.type===`response_regex`){let e=n??``;return e?t.find(t=>t.startsWith(`Regex assertion failed:`)&&t.includes(e)):void 0}return e.type===`response_jsonpath`||e.type===`response_jsonpath_not_exists`?t.find(t=>t.includes(e.path??``)):e.type===`tool_sequence`?t.find(t=>t.startsWith(`Tool sequence order was not satisfied: ${_4(e.sequence??[])}`)||t.startsWith(`Required tool in sequence not used:`)):t.find(e=>e.startsWith(r))}async function y4(e){let{sessionId:t,source:n,serverName:r,onLaunchUrl:i,timeoutMs:a=3e5}=e,o=Date.now()+a,s=!1;for(;Date.now()<o;){let{session:e}=await n.getOAuthRuntimeSession(t),a=e.authorizeLaunchUrl||e.authorizationUrl||``;if(a&&i&&i(a),e.status===`completed`&&e.hasAccessToken){s=!0;break}if(e.status===`error`||e.status===`stopped`)throw Error(`OAuth login failed for '${r}' (${e.status}). ${e.lastError||``}`.trim());await new Promise(e=>setTimeout(e,1500))}if(!s)throw Error(`OAuth login timed out for '${r}'. Authorization was not completed within 5 minutes.`)}var b4=250;async function x4(e){let{serverNames:t,source:n,onServerAuthStart:r,onServerStatus:i,timeoutMs:a=3e5}=e,o=Array.from(new Set(t.filter(Boolean)));if(o.length===0)return;let s=Date.now()+a,c=new Set,l=new Map;for(;Date.now()<s;){let e=await n.ensureOAuthServers({serverNames:o});for(let t of e.servers){let e=`${t.status}:${t.debugState??``}:${t.runtimeSessionId??``}`;l.get(t.serverName)!==e&&(l.set(t.serverName,e),i?.({serverName:t.serverName,status:t.status,debugState:t.debugState,tokenExpiresAt:t.tokenExpiresAt,tokenExpiresInSeconds:t.tokenExpiresInSeconds,message:t.message}))}let t=e.servers.filter(e=>e.status===`auth_required`);if(t.length===0&&e.allReady)return;for(let e of t){let t=e.runtimeSessionId;if(!t)throw Error(e.message||`OAuth login required for '${e.serverName}'.`);c.has(t)||(c.add(t),r?.(e.serverName));let i=(()=>{let e=!1;return t=>{if(e||!t)return;e=!0;let n=t.startsWith(`http`)?t:`${window.location.origin}${t}`;window.open(n,`_blank`,`noopener,noreferrer`)}})();i(e.authorizeLaunchUrl||e.authorizationUrl||``),await y4({sessionId:t,source:n,serverName:e.serverName,onLaunchUrl:i,timeoutMs:Math.max(1e4,s-Date.now())})}await new Promise(e=>{window.setTimeout(e,b4)})}throw Error(`OAuth login timed out before all required servers were authorized.`)}var S4=[{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:`Generate Structured Updates`,description:`Return apply-ready Checks and Value Capture suggestions.`,prompt:[`Propose concrete scenario updates and include structured suggestions that can be applied directly.`,`Return ONLY valid JSON envelope and no markdown.`,`Required shape:`,`{"type":"assistant_message","text":"short rationale","suggestions":{"evalRules":{"replacement":[...]}, "extractRules":{"replacement":[...]}}}`,`If tool usage is clear, include at least one required_tool check.`,`For argument validation, use tool_input_contains with tool and value, tool_input_regex with tool and value, or tool_input_jsonpath with tool and path plus optional equals.`,`Prefer deterministic checks and concise capture patterns.`].join(`
|
|
123
|
-
`)},{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 C4(e){if(Array.isArray(e.sequence))return e.sequence.map(e=>e.trim()).filter(Boolean);let t=typeof e.value==`string`?e.value.trim():``;return!t||t.toLowerCase()===`tool sequence`?[]:t.split(/\s*(?:->|,|\n)\s*/).map(e=>e.trim()).filter(Boolean)}function w4(e){let t=[],n=0;for(let r of e)if(r.type===`tool_sequence`){let e=C4(r);e.length>0?t.push({type:`tool_sequence`,sequence:e}):n+=1}else t.push(r);return{rules:t,skippedToolSequences:n}}function T4(e){if(e.type===`tool_sequence`){let t=C4(e);return t.length>0?`Tool sequence · ${t.join(` -> `)}`:`Tool sequence · No tool steps`}return g4(e)}function E4({open:e,onOpenChange:t,configId:n,configPath:r,scenario:i,agents:a,servers:o,defaultAssistantAgentName:s,initialUserMessage:c,onApplyPatch:l}){let{source:u}=Rv(),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(new Set),w=(0,_.useRef)(null),T=(0,_.useRef)(null),E=(0,_.useRef)(null),D=(0,_.useRef)(null),k=(0,_.useRef)(0),[A,j]=(0,_.useState)(!1),M=(0,_.useRef)(!1),N=s||a[0]?.id||``,P=(0,_.useCallback)(()=>{let e=D.current;e&&e.controller.abort()},[]);(0,_.useEffect)(()=>{if(!e||!N||d)return;let t=!1;return y(!0),(async()=>{await x4({serverNames:Array.from(new Set(i.serverIds.filter(e=>o.find(t=>t.id===e)?.authType===`oauth2`))),source:u});let e=await u.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:i.id,selectedAssistantAgentName:N,context:{scenario:{id:i.id,name:i.name,prompt:i.prompt,serverNames:i.serverIds,evalRules:i.evalRules,extractRules:i.extractRules},availableServers:o.map(e=>({name:e.name||e.id,url:e.url})),availableAgents:a.map(e=>({name:e.name||e.id,provider:e.provider,model:e.model}))}});t||(f(e.sessionId),L(e.session),y(!1))})().catch(e=>{t||O({title:`Could not start Scenario Assistant`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}).finally(()=>{t||y(!1)}),()=>{t=!0}},[e,u,d,n,r,i,a,o,N]);let F=()=>{P(),f(null),m(null),g(``),C(new Set),E.current=null},L=(0,_.useCallback)(e=>{m(t=>t&&t.messages.length>e.messages.length?t:e)},[]),R=(0,_.useCallback)(()=>{let e=D.current;e&&(P(),g(e.prompt),y(!1),x(!1))},[P]),z=e=>{F(),u.closeScenarioAssistantSession(e).catch(()=>{})};(0,_.useEffect)(()=>{e||d&&(M.current||A||z(d))},[e,d,u,A]),(0,_.useEffect)(()=>()=>{P(),d&&u.closeScenarioAssistantSession(d).catch(()=>{})},[P,d,u]),(0,_.useEffect)(()=>{if(!e)return;A&&j(!1),M.current&&=!1;let t=window.setTimeout(()=>{w.current?.scrollIntoView({behavior:`smooth`,block:`end`})},0);return()=>window.clearTimeout(t)},[e,v,p?.messages.length,p?.pendingToolCalls.length,p?.warnings.length]),(0,_.useEffect)(()=>{let e=T.current;if(!e)return;e.style.height=`0px`;let t=Math.min(e.scrollHeight,160);e.style.height=`${Math.max(40,t)}px`},[h,e]);let B=a.length>0&&i.serverIds.length>0&&!!N,ee=async e=>{if(!d)return;let t=e.trim();if(!t)return;let n=++k.current,r=new AbortController,i=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,a={id:i,role:`user`,text:t,createdAt:new Date().toISOString()};D.current={id:n,controller:r,prompt:t},x(!0),m(e=>e&&{...e,messages:[...e.messages,a]}),g(``),y(!0);try{let e=await u.sendScenarioAssistantMessage(d,t,r.signal);if(r.signal.aborted||D.current?.id!==n)return;L(e.session)}catch(e){if(u4(e)||r.signal.aborted||D.current?.id!==n)return;m(e=>e&&{...e,messages:e.messages.filter(e=>e.id!==i)}),g(e=>e.trim()?e:t),O({title:`Scenario Assistant error`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{D.current?.id===n&&(D.current=null,y(!1),x(!1))}},te=e=>{g(e),requestAnimationFrame(()=>T.current?.focus())};(0,_.useEffect)(()=>{if(!e||!d||!p||!B||D.current)return;let t=String(c??``).trim();t&&E.current!==t&&(E.current=t,ee(t))},[e,d,p,B,c]),(0,_.useEffect)(()=>{if(e&&d&&p)return u.subscribeScenarioAssistantSessionEvents(d,e=>{L(e.payload.session)})},[e,d,u,L]);let ne=async e=>{if(d){y(!0);try{let t=await u.approveScenarioAssistantToolCall(d,e);L(t.session)}catch(e){O({title:`Tool call failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{y(!1)}}},re=async e=>{if(d){y(!0);try{let t=await u.denyScenarioAssistantToolCall(d,e);L(t.session)}catch(e){O({title:`Could not deny tool call`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{y(!1)}}},ie=async()=>{if(d){y(!0);try{let e=await u.approveAllScenarioAssistantToolCalls(d);L(e.session)}catch(e){O({title:`Could not approve all tool calls`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{y(!1)}}},ae=(e,t,n,r,a=`replace`)=>{if(t){if(n===`prompt`&&t.prompt&&l({prompt:t.prompt.replacement}),n===`evalRules`&&t.evalRules){let e=w4(r??t.evalRules.replacement);l({evalRules:a===`append`?[...i.evalRules,...e.rules]:e.rules}),e.skippedToolSequences>0&&O({title:`Skipped invalid tool sequence`,description:`The assistant suggested a sequence check without any tool steps.`,variant:`destructive`})}if(n===`extractRules`&&t.extractRules&&l({extractRules:t.extractRules.replacement}),e){let t=`${e}:${n}`;C(e=>new Set([...e,t]))}O({title:`Applied suggestion`,description:`Updated ${{prompt:`Prompt`,evalRules:`Checks`,extractRules:`Value Capture Rules`}[n]}`})}},oe=(e,t,n,r)=>{if(t?.extractRules){if(l({extractRules:r===`append`?[...i.extractRules,...n]:n}),e){let t=`${e}:extractRules`;C(e=>new Set([...e,t]))}O({title:`Applied suggestion`,description:`Updated Value Capture Rules`})}},se=()=>{let e=document.activeElement;e instanceof HTMLElement&&e.blur()};return(0,I.jsxs)(I.Fragment,{children:[!e&&d&&(0,I.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Scenario Assistant (session active)`}),(0,I.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[`Resume conversation for `,(0,I.jsx)(`span`,{className:`font-mono`,children:i.id}),p?` · ${p.messages.length} messages`:``]})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>t(!0),children:[(0,I.jsx)(tr,{className:`mr-1.5 h-3.5 w-3.5`}),`Resume`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-8 px-2 text-muted-foreground`,onClick:()=>{se(),M.current=!1,j(!1),d&&z(d)},"aria-label":`Discard assistant session`,title:`Discard assistant session`,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]})]}),(0,I.jsx)(_2,{open:e,onOpenChange:e=>{e||(se(),j(!1),M.current=!1),t(e)},children:(0,I.jsxs)(b2,{className:`max-w-6xl h-[85vh] flex flex-col`,children:[d&&(0,I.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-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2`,onClick:()=>{se(),M.current=!0,j(!0),t(!1)},"aria-label":`Minimize assistant`,title:`Minimize assistant`,children:[(0,I.jsx)(Rn,{className:`h-4 w-4`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Minimize`})]}),(0,I.jsx)(x2,{className:`pr-20`,children:(0,I.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(S2,{className:`flex items-center gap-2`,children:[(0,I.jsx)(tr,{className:`h-4 w-4`}),`Scenario Assistant`]}),(0,I.jsx)(C2,{children:`LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval.`})]})})}),B?(0,I.jsxs)(`div`,{className:`min-h-0 flex flex-1 flex-col gap-3`,children:[(0,I.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-1`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`MCP Context`}),(0,I.jsxs)(`div`,{className:`h-8 rounded-md border px-2 text-xs flex items-center gap-2`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),p?`Loaded ${p.toolsLoaded} tools`:`Preparing...`]})]})}),(0,I.jsx)(c4,{className:`min-h-0 flex-1 rounded-md border p-3`,children:(0,I.jsxs)(`div`,{className:`space-y-3`,children:[p?.warnings?.map((e,t)=>(0,I.jsx)(`div`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900`,children:e},`${e}-${t}`)),p?.messages.map(e=>(0,I.jsxs)(_.Fragment,{children:[(()=>{let t=e.pendingToolCallIds??(e.pendingToolCallId?[e.pendingToolCallId]:[]),n=t.map(e=>(p?.pendingToolCalls??[]).find(t=>t.id===e)).filter(e=>!!e),r=t.map(e=>p.pendingToolCalls.find(t=>t.id===e)??p.pendingToolCalls.find(t=>t.id===e)).filter(Boolean);if(!(e.role===`assistant`&&t.length>0))return(0,I.jsx)(`div`,{className:`space-y-2`,children:(0,I.jsx)(A4,{message:e})});let i=n.length,a=r.length-i;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.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:(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`w-full max-w-[92%] space-y-2`,children:[r.length>1&&i>0&&(0,I.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:[(0,I.jsxs)(`span`,{className:`text-xs text-amber-900`,children:[a,` of `,r.length,` tool calls resolved`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:i===0,onClick:()=>void ie(),children:[`Approve All (`,i,`)`]})]}),r.map((t,n)=>(0,I.jsx)(p2,{call:t,loading:v,description:n===0?e.text:void 0,onApprove:e=>void ne(e),onDeny:e=>void re(e)},t.id))]})]})})(),e.suggestions&&(0,I.jsxs)(`div`,{className:`ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5`}),`Structured Suggestions`]}),e.suggestions.prompt&&(0,I.jsx)(D4,{title:`Prompt`,rationale:e.suggestions.prompt.rationale,preview:e.suggestions.prompt.replacement,applied:S.has(`${e.id}:prompt`),onApply:()=>ae(e.id,e.suggestions,`prompt`)}),e.suggestions.evalRules&&(0,I.jsx)(O4,{rationale:e.suggestions.evalRules.rationale,rules:e.suggestions.evalRules.replacement,applied:S.has(`${e.id}:evalRules`),onApply:t=>ae(e.id,e.suggestions,`evalRules`,t,`append`),onReplace:t=>ae(e.id,e.suggestions,`evalRules`,t,`replace`)}),e.suggestions.extractRules&&(0,I.jsx)(k4,{rationale:e.suggestions.extractRules.rationale,rules:e.suggestions.extractRules.replacement,applied:S.has(`${e.id}:extractRules`),onApply:t=>oe(e.id,e.suggestions,t,`append`),onReplace:t=>oe(e.id,e.suggestions,t,`replace`)}),(()=>{let t=e.suggestions?.notes,n=Array.isArray(t)?t:typeof t==`string`?[t]:[];return n.length===0?null:(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,children:[(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:`Notes`}),(0,I.jsx)(`ul`,{className:`space-y-1 text-xs text-muted-foreground list-disc pl-4`,children:n.map((t,n)=>(0,I.jsx)(`li`,{children:t},`${e.id}-note-${n}`))})]})})()]})]},e.id)),(p?.pendingToolCalls??[]).filter(e=>!(p?.messages??[]).some(t=>t.pendingToolCallId===e.id||t.pendingToolCallIds?.includes(e.id))).map(e=>(0,I.jsx)(p2,{call:e,loading:v,onApprove:e=>void ne(e),onDeny:e=>void re(e)},e.id)),!p&&v&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),`Starting assistant session...`]}),p&&v&&(0,I.jsx)(m2,{}),(0,I.jsx)(`div`,{ref:w})]})}),(0,I.jsx)(g2,{input:h,onInputChange:g,onSend:()=>void ee(h),onCancel:d&&b?R:void 0,inputPlaceholder:`Get assistance with creating or refining this scenario ...`,snippets:S4,snippetsLabel:`Scenario Assistant Snippets`,onSnippetSelect:te,loading:v,disabled:!d,inputRef:T,snippetContentClassName:`w-[320px]`})]}):(0,I.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 D4({title:e,rationale:t,preview:n,applied:r=!1,onApply:i}){return(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 ${r?`border-emerald-300 bg-emerald-50/40`:``}`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:e})}),t&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),(0,I.jsx)(`pre`,{className:`max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap`,children:n}),(0,I.jsx)(`div`,{className:`flex justify-end`,children:(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,variant:r?`secondary`:`default`,onClick:i,disabled:r,children:r?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(ln,{className:`mr-1.5 h-3.5 w-3.5`}),`Applied`]}):`Apply`})})]})}function O4({rationale:e,rules:t,applied:n=!1,onApply:r,onReplace:i}){let[a,o]=(0,_.useState)(()=>new Set(t.map((e,t)=>t))),s=a.size,c=t.filter((e,t)=>a.has(t)),l=s===t.length,u=(e,t)=>{o(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 ${n?`border-emerald-300 bg-emerald-50/40`:``}`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:`Checks`})}),e&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`space-y-2 rounded bg-muted/60 p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[(0,I.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[s,` of `,t.length,` selected`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-6 px-2 text-[11px]`,disabled:n||t.length===0,onClick:()=>o(l?new Set:new Set(t.map((e,t)=>t))),children:l?`Unselect all`:`Select all`})]}),t.map((e,t)=>{let r=T4(e),i=`scenario-assistant-check-${t}-${e.type}`;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 rounded bg-background p-2`,children:[(0,I.jsx)(W0,{id:i,checked:a.has(t),disabled:n,onCheckedChange:e=>u(t,e===!0),"aria-label":`Select ${r}`}),(0,I.jsxs)(`label`,{htmlFor:i,className:`min-w-0 flex-1 cursor-pointer space-y-1`,children:[(0,I.jsx)(`span`,{className:`block text-xs font-medium`,children:r}),(0,I.jsx)(`code`,{className:`block wrap-break-word rounded bg-muted px-1.5 py-1 text-[11px] text-muted-foreground`,children:JSON.stringify(e)})]})]},`${e.type}-${t}`)})]}),(0,I.jsx)(`div`,{className:`flex justify-end gap-2`,children:n?(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`secondary`,disabled:!0,children:[(0,I.jsx)(ln,{className:`mr-1.5 h-3.5 w-3.5`}),`Applied`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,variant:`outline`,onClick:()=>i(c),disabled:s===0,children:`Replace all`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,onClick:()=>r(c),disabled:s===0,children:`Add selected`})]})})]})}function k4({rationale:e,rules:t,applied:n=!1,onApply:r,onReplace:i}){let[a,o]=(0,_.useState)(()=>new Set(t.map((e,t)=>t))),s=a.size,c=t.filter((e,t)=>a.has(t)),l=s===t.length,u=(e,t)=>{o(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})};return(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 ${n?`border-emerald-300 bg-emerald-50/40`:``}`,children:[(0,I.jsx)(`div`,{className:`flex items-center justify-between gap-2`,children:(0,I.jsx)(`h5`,{className:`text-sm font-medium`,children:`Value Capture Rules`})}),e&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`space-y-2 rounded bg-muted/60 p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-1`,children:[(0,I.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[s,` of `,t.length,` selected`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-6 px-2 text-[11px]`,disabled:n||t.length===0,onClick:()=>o(l?new Set:new Set(t.map((e,t)=>t))),children:l?`Unselect all`:`Select all`})]}),t.map((e,t)=>{let r=`${e.name} · ${e.pattern}`,i=`scenario-assistant-extract-${t}-${e.name}`;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 rounded bg-background p-2`,children:[(0,I.jsx)(W0,{id:i,checked:a.has(t),disabled:n,onCheckedChange:e=>u(t,e===!0),"aria-label":`Select ${r}`}),(0,I.jsxs)(`label`,{htmlFor:i,className:`min-w-0 flex-1 cursor-pointer space-y-1`,children:[(0,I.jsx)(`span`,{className:`block text-xs font-medium`,children:r}),(0,I.jsx)(`code`,{className:`block wrap-break-word rounded bg-muted px-1.5 py-1 text-[11px] text-muted-foreground`,children:JSON.stringify(e)})]})]},`${e.name}-${t}`)})]}),(0,I.jsx)(`div`,{className:`flex justify-end gap-2`,children:n?(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`secondary`,disabled:!0,children:[(0,I.jsx)(ln,{className:`mr-1.5 h-3.5 w-3.5`}),`Applied`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,variant:`outline`,onClick:()=>i(c),disabled:s===0,children:`Replace all`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-8`,onClick:()=>r(c),disabled:s===0,children:`Add selected`})]})})]})}function A4({message:e}){let t=async e=>{try{await navigator.clipboard.writeText(e),O({title:`Copied`})}catch(e){O({title:`Could not copy`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},n=e.role===`user`||e.role===`assistant`,r=e.role===`user`;return(0,I.jsx)(f2,{message:e,assistantLabel:e.role===`assistant`?`Assistant`:void 0,renderActions:n?(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute bottom-1 h-6 w-6 text-muted-foreground ${r?`-left-8`:`-right-8`}`,onClick:()=>void t(e.text),"aria-label":`Copy message`,title:`Copy message`,children:(0,I.jsx)(hn,{className:`h-3.5 w-3.5`})}):void 0})}function j4(e){return typeof e==`number`?e.toLocaleString():`n/a`}function M4(e,t){let n=t?.nonPositiveLabel??`0s`;if(!Number.isFinite(e)||e<=0)return n;let r=Math.floor(e),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return i>0?`${i}h ${a}m ${o}s`:a>0?`${a}m ${o}s`:`${o}s`}function N4({run:e,fallbackUserPrompt:t}){let[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(!1);return(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(n2,{open:n,onOpenChange:r,children:(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-card p-2`,children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`mb-2 flex w-full items-center justify-between gap-2 text-left`,children:(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${n?`rotate-180`:``}`}),(0,I.jsx)($t,{className:`h-3.5 w-3.5`}),`Final answer`]})})}),(0,I.jsx)(i2,{children:(0,I.jsx)(R4,{text:e.finalAnswer||`No final answer captured.`,maxLength:1200,className:`text-xs text-foreground`})})]})}),(0,I.jsx)(n2,{open:i,onOpenChange:a,children:(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-card p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${i?`rotate-180`:``}`}),(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Conversation trace`})]})}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:[e.toolCalls.length,` tool calls`]})]}),(0,I.jsx)(i2,{children:(0,I.jsx)(`div`,{className:`space-y-2 rounded-md border bg-muted/20 p-2`,children:e.conversation.length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No conversation trace captured.`}):e.conversation.map(e=>(0,I.jsx)(P4,{item:e,fallbackUserPrompt:t},e.id))})})]})})]})}function P4({item:e,fallbackUserPrompt:t}){if(e.kind===`tool_call`){let t=F4(e,`input`);return(0,I.jsx)(L4,{variant:`call`,title:`Tool call · ${e.toolName||`unknown`}${t}`,text:e.text})}if(e.kind===`tool_result`){let t=F4(e,`output`),n=e.ok?(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300`}):(0,I.jsx)(dn,{className:`h-3.5 w-3.5 text-rose-700 dark:text-rose-300`});return(0,I.jsx)(L4,{variant:e.ok?`result_ok`:`result_error`,title:`Tool result · ${e.toolName||`unknown`} · ${e.ok?`ok`:`error`}${typeof e.durationMs==`number`?` · ${e.durationMs}ms`:``}${t}`,text:e.text,icon:n})}let n=e.kind===`user_prompt`,r=I4(e.text,e.kind),i=t?I4(t,`user_prompt`):``,a=n&&!r&&i?i:r,o=n?`User prompt`:e.kind===`assistant_final`?`Agent final`:`Agent`,s=n?cr:$t;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 text-xs ${n?`justify-end`:`justify-start`}`,children:[!n&&(0,I.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:(0,I.jsx)(s,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`max-w-[90%] rounded-md p-2 ${n?`bg-primary/10`:`bg-muted/50`}`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?`text-right`:``}`,children:o}),n?(0,I.jsx)(R4,{text:a,maxLength:280,className:`text-xs`}):(0,I.jsx)(R4,{text:a,maxLength:500,className:`text-xs`})]}),n&&(0,I.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:(0,I.jsx)(s,{className:`h-3 w-3`})})]})}function F4(e,t){let n=t===`input`?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n==`number`?` · estimated ${j4(n)} tokens`:``}function I4(e,t){let n=String(e??``).replace(/^\s+/,``);return t===`user_prompt`?n.replace(/^user:\s*/i,``):t===`assistant_final`||t===`assistant_thought`?n.replace(/^assistant:\s*/i,``):n}function L4({variant:e,title:t,text:n,icon:r}){let[i,a]=(0,_.useState)(!1);return(0,I.jsx)(n2,{open:i,onOpenChange:a,children:(0,I.jsxs)(`div`,{className:`rounded-md border p-2 text-xs ${{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`}[e]}`,children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-[11px]`,children:[r??(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{children:t})]}),(0,I.jsx)(`span`,{className:`text-[11px] font-semibold`,children:i?`Hide content`:`Show content`})]})}),(0,I.jsx)(i2,{children:(0,I.jsx)(`p`,{className:`mt-2 font-mono whitespace-pre-wrap text-foreground`,children:n})})]})})}function R4({text:e,maxLength:t,className:n}){let[r,i]=(0,_.useState)(!1),a=e.length>t,o=r||!a?e:`${e.slice(0,t)}...`;return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(o2,{text:o,className:n}),a&&(0,I.jsx)(`button`,{type:`button`,className:`mt-1 text-[11px] font-medium text-primary hover:underline`,onClick:()=>i(e=>!e),children:r?`Show less`:`Show all`})]})}var z4=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`],B4=[`application/pdf`,`text/plain`,`text/markdown`,`text/csv`];function V4(e){return z4.includes(e)||B4.includes(e)}function H4({value:e,onValueChange:t,className:n,hideToolSequence:r=!1}){return(0,I.jsxs)(E1,{value:e,onValueChange:e=>t(e),children:[(0,I.jsx)(O1,{className:n,children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`required_tool`,children:`Required Tool`}),(0,I.jsx)(Q,{value:`forbidden_tool`,children:`Forbidden Tool`}),!r&&(0,I.jsx)(Q,{value:`tool_sequence`,children:`Tool Sequence`}),(0,I.jsx)(Q,{value:`agent_check`,children:`Judge Agent`}),(0,I.jsx)(Q,{value:`response_contains`,children:`Text contains`}),(0,I.jsx)(Q,{value:`response_not_contains`,children:`Text does not contain`}),(0,I.jsx)(Q,{value:`response_starts_with`,children:`Text starts with`}),(0,I.jsx)(Q,{value:`response_ends_with`,children:`Text ends with`}),(0,I.jsx)(Q,{value:`response_equals`,children:`Text equals`}),(0,I.jsx)(Q,{value:`response_regex`,children:`Text matches regex`}),(0,I.jsx)(Q,{value:`tool_input_contains`,children:`Tool input contains`}),(0,I.jsx)(Q,{value:`tool_input_regex`,children:`Tool input regex`}),(0,I.jsx)(Q,{value:`tool_input_jsonpath`,children:`Tool input JSONPath`}),(0,I.jsx)(Q,{value:`response_jsonpath`,children:`JSONPath (optional equals)`}),(0,I.jsx)(Q,{value:`response_jsonpath_exists`,children:`JSONPath exists`}),(0,I.jsx)(Q,{value:`response_jsonpath_not_exists`,children:`JSONPath not exists`})]})]})}var U4=()=>({id:`scn-${Date.now()}`,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]});function W4(e){return a2(e).replace(/^Tool sequence · /,``)}function G4(e){return e.startsWith(`tool_input_`)}function K4(e){let t=e.trim();if(t)return t===`true`?!0:t===`false`?!1:Number.isNaN(Number(t))?t:Number(t)}function q4({scenarios:e,scenarioOrigins:t,scenarioOverrides:n,agents:r,servers:i,configId:a,configPath:o,defaultAssistantAgentName:s,assistantInitialPromptByScenarioId:c,assistantAutoOpenNonceByScenarioId:l,testCaseReturnToPath:u,onChange:d,readOnly:f,allowAdd:p=!f,allowStructureEdits:m=!f}){let h=(t,n)=>{d(e.map((e,r)=>r===t?{...e,...n}:e))},g=t=>d(e.filter((e,n)=>n!==t)),_=()=>d([...e,U4()]),v=(t,n)=>{let r=t+n;if(r<0||r>=e.length)return;let i=[...e],[a]=i.splice(t,1);i.splice(r,0,a),d(i)};return(0,I.jsxs)(`div`,{className:f?`space-y-2`:`space-y-4`,children:[!f&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Scenarios`}),p&&m&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:_,children:[(0,I.jsx)(qn,{className:`mr-1.5 h-3.5 w-3.5`}),`Add Scenario`]})]}),e.map((d,p)=>(0,I.jsx)(J4,{scenario:d,scenarioOrigin:t?.[p],hasMcpServerOverride:n?.[p],index:p,total:e.length,agents:r,servers:i,configId:a,configPath:o,defaultAssistantAgentName:s,assistantInitialPrompt:c?.[d.id],assistantAutoOpenNonce:l?.[d.id],testCaseReturnToPath:u,onUpdate:e=>h(p,e),onMoveUp:()=>v(p,-1),onMoveDown:()=>v(p,1),onRemove:()=>g(p),readOnly:f,allowStructureEdits:m},d.id)),e.length===0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-6`,children:`No scenarios configured. Add one to get started.`})]})}function J4({scenario:e,scenarioOrigin:t,hasMcpServerOverride:n,index:r,total:i,agents:a,servers:o,configId:s,configPath:c,defaultAssistantAgentName:l,assistantInitialPrompt:u,assistantAutoOpenNonce:d,testCaseReturnToPath:f,onUpdate:p,onMoveUp:m,onMoveDown:h,onRemove:g,readOnly:v,allowStructureEdits:y}){let{source:b}=Rv(),[x,S]=(0,_.useState)(`required_tool`),[C,w]=(0,_.useState)(``),[T,E]=(0,_.useState)(``),[D,k]=(0,_.useState)(``),[A,j]=(0,_.useState)(``),[M,N]=(0,_.useState)(``),[P,F]=(0,_.useState)(``),[L,R]=(0,_.useState)(``),[z,B]=(0,_.useState)([]),[ee,te]=(0,_.useState)(!1),[ne,re]=(0,_.useState)(null),[ie,ae]=(0,_.useState)(null),[oe,se]=(0,_.useState)(!1),[V,ce]=(0,_.useState)(null),[le,ue]=(0,_.useState)(``),[H,de]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(!1),[me,he]=(0,_.useState)(null),[ge,_e]=(0,_.useState)(``),[ve,ye]=(0,_.useState)(``),[be,xe]=(0,_.useState)(!1),[Se,Ce]=(0,_.useState)(l||a[0]?.id||``),[we,Te]=(0,_.useState)(!1),[Ee,De]=(0,_.useState)(null),[Oe,ke]=(0,_.useState)(``),Ae=(0,_.useRef)(null);function je(t){if(!t)return;let n=Array.from(t),r=Array(n.length).fill(null),i=0,a=0,o=()=>{let t=r.filter(e=>e!==null);t.length>0?(p({attachments:[...e.attachments??[],...t]}),a>0&&O({title:`${a} file${a>1?`s`:``} skipped`,description:`Unsupported file type. Images must be JPEG/PNG/GIF/WebP; documents must be PDF, TXT, MD, or CSV.`,variant:`destructive`})):n.length>0&&O({title:`Could not attach files`,description:a>0?`Unsupported file type. Images must be JPEG/PNG/GIF/WebP; documents must be PDF, TXT, MD, or CSV.`:`Files could not be read.`,variant:`destructive`})};n.forEach((e,t)=>{let s=new FileReader;s.onload=()=>{let c=s.result,l=c.indexOf(`,`),u=l>=0?c.slice(l+1):``;if(u){let n=c.slice(0,l).replace(`data:`,``).replace(`;base64`,``),i=n.startsWith(`image/`);V4(n)?r[t]={type:i?`image`:`document`,media_type:n,data:u,name:e.name}:a++}++i===n.length&&o()},s.onerror=()=>{++i===n.length&&o()},s.readAsDataURL(e)})}function Me(t){p({attachments:(e.attachments??[]).filter((e,n)=>n!==t)})}let[Ne,Pe]=(0,_.useState)(null),[Fe,Ie]=(0,_.useState)(!v),Le=e=>{let t=e.target;t&&(t.closest(`button, a, input, select, textarea, [role='button']`)||Ie(e=>!e))},Re=t=>t?e.evalRules.findIndex(e=>e===t):-1,ze=()=>{if(G4(x)){let t=T.trim();if(!t)return;let n;if(x===`tool_input_jsonpath`){let e=D.trim();if(!e)return;let r=K4(A);n={type:x,tool:t,path:e,...r===void 0?{}:{equals:r}}}else{let e=C.trim();if(!e)return;n={type:x,tool:t,value:e}}let r=[...e.evalRules],i=Re(V);i>=0?r[i]=n:r.push(n),p({evalRules:r}),E(``),k(``),w(``),j(``),ce(null),S(`required_tool`);return}if(x===`response_jsonpath`||x===`response_jsonpath_exists`||x===`response_jsonpath_not_exists`){let t=D.trim();if(!t)return;if(x===`response_jsonpath`){let n=K4(A);p({evalRules:[...e.evalRules,{type:x,path:t,...n===void 0?{}:{equals:n}}]})}else p({evalRules:[...e.evalRules,{type:x,path:t}]});k(``),j(``);return}if(x===`agent_check`){let t=M.trim(),n=P.trim();if(!t||!n)return;let r=[...e.evalRules],i={type:`agent_check`,label:t,prompt:n},a=Re(ie);a>=0?r[a]=i:r.push(i),p({evalRules:r}),N(``),F(``),ae(null),se(!1),S(`required_tool`);return}if(x===`tool_sequence`){let e=z.map(e=>e.trim()).filter(e=>typeof e==`string`&&e.length>0);if(e.length===0)return;qe(e);return}if(!C.trim())return;let t=[...e.evalRules],n={type:x,value:C.trim()},r=Re(V);r>=0?t[r]=n:t.push(n),p({evalRules:t}),w(``),ue(``),ce(null),S(`required_tool`)},Be=()=>{let e=L.trim();e&&(B(t=>[...t,e]),R(``))},Ve=(e,t)=>{let n=e+t;B(t=>{if(n<0||n>=t.length)return t;let r=[...t],[i]=r.splice(e,1);return r.splice(n,0,i),r})},He=e=>{B(t=>t.filter((t,n)=>n!==e))},Ue=e.evalRules.findIndex(e=>e.type===`tool_sequence`),We=Ue>=0?e.evalRules[Ue]:void 0,Ge=We?.type===`tool_sequence`?We.sequence??[]:[],Ke=Ue>=0,qe=t=>{let n=[...e.evalRules],r=t.length>0?{type:`tool_sequence`,sequence:t}:null,i=Re(ne),a=i>=0?i:Ue;a>=0?r?n[a]=r:n.splice(a,1):r&&n.push(r),p({evalRules:n}),te(!1),B([]),R(``),re(null),x===`tool_sequence`&&S(`required_tool`)};(0,_.useEffect)(()=>{ee&&B(Ge)},[ee,Ue,Ge.join(`|`)]),(0,_.useEffect)(()=>{te(x===`tool_sequence`)},[x]),(0,_.useEffect)(()=>{se(x===`agent_check`)},[x]),(0,_.useEffect)(()=>{ne&&Re(ne)<0&&re(null),ie&&Re(ie)<0&&ae(null),V&&Re(V)<0&&ce(null)},[e.evalRules,ne,ie,V]),(0,_.useEffect)(()=>{ne&&x!==`tool_sequence`&&re(null),ie&&x!==`agent_check`&&ae(null),V&&V.type!==x&&ce(null)},[x,ne,ie,V]);let Je=t=>{let n=e.evalRules.filter((e,n)=>n!==t);p({evalRules:n,agentContext:n.some(e=>e.type===`agent_check`)?e.agentContext:void 0})},Ye=[`response_contains`,`response_not_contains`,`response_starts_with`,`response_ends_with`,`response_equals`,`response_regex`,`tool_input_contains`,`tool_input_regex`,`tool_input_jsonpath`],Xe=()=>{ge.trim()&&ve.trim()&&(p({extractRules:[...e.extractRules,{name:ge.trim(),pattern:ve.trim()}]}),_e(``),ye(``))},Ze=t=>{p({extractRules:e.extractRules.filter((e,n)=>n!==t)})},Qe=t=>{p({serverIds:e.serverIds.includes(t)?e.serverIds.filter(e=>e!==t):[...e.serverIds,t]})},$e={required_tool:`Required`,forbidden_tool:`Forbidden`,tool_sequence:`Sequence`,tool_input_contains:`Input Contains`,tool_input_regex:`Input Regex`,tool_input_jsonpath:`Input JSONPath`,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`,agent_check:`Agent`},et={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`,tool_sequence:`border-teal-300/60 bg-teal-500/10 text-teal-700`,tool_input_contains:`border-blue-300/60 bg-blue-500/10 text-blue-700`,tool_input_regex:`border-blue-300/60 bg-blue-500/10 text-blue-700`,tool_input_jsonpath:`border-blue-300/60 bg-blue-500/10 text-blue-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`,agent_check:`border-teal-300/60 bg-teal-500/10 text-teal-700`},tt=x===`required_tool`||x===`forbidden_tool`,nt=G4(x),rt=x===`response_jsonpath`||x===`response_jsonpath_exists`||x===`response_jsonpath_not_exists`,it=x===`tool_sequence`&&ee,at=x===`agent_check`&&oe,ot=e.serverIds.filter(e=>o.some(t=>t.id===e)),st=a.map(e=>e.id).filter(Boolean),ct=ot.length>0,[lt,ut]=(0,_.useState)(``),[dt,ft]=(0,_.useState)(0);(0,_.useEffect)(()=>{let e=(u??``).trim();e&<!==e&&(xe(!0),ut(e))},[u,lt]),(0,_.useEffect)(()=>{d&&d!==dt&&(xe(!0),ft(d))},[d,dt]),(0,_.useEffect)(()=>{de(null),he(null),ue(``)},[e.serverIds.join(`|`)]),(0,_.useEffect)(()=>{ue(``),k(``),j(``),R(``)},[x]),(0,_.useEffect)(()=>{Se&&st.includes(Se)||Ce(l||a[0]?.id||``)},[Se,l,a,st]);let pt=async()=>{if(Se){Te(!0),De(null);try{await x4({serverNames:e.serverIds.filter(e=>o.find(t=>t.id===e)?.authType===`oauth2`),source:b});let t=await b.runScenarioPreview({selectedAgentName:Se,scenario:{id:e.id,name:e.name,prompt:e.prompt,serverNames:e.serverIds,attachments:e.attachments??[],evalRules:e.evalRules,extractRules:e.extractRules}});Pe(t)}catch(e){De(e instanceof Error?e.message:String(e))}finally{Te(!1)}}},mt=()=>{if(!Ne)return;let t=Y4(e.evalRules,Ne.run.failureReasons,Ne.run.checkResults),n=t.length?t.map(e=>`${e.status.toUpperCase()} - ${X4(e.rule)}${e.failureReason?` (${e.failureReason})`:``}`).join(`
|
|
124
|
-
`):`No checks configured.`,r=Object.keys(Ne.run.extractedValues).length>0?Object.entries(Ne.run.extractedValues).map(([e,t])=>`${e}: ${String(t)}`).join(`
|
|
125
|
-
`):`No extracted values.`,i=Ne.run.toolCalls.length>0?Ne.run.toolCalls.map((e,t)=>`${t+1}. ${e.name} (${e.duration}ms)`).join(`
|
|
126
|
-
`):`No tool calls.`,a=[`I ran a prompt preview for scenario '${e.id}' and want you to suggest concrete updates.`,`Run ID: ${Ne.runId}`,`Agent: ${Ne.agentName}`,`Outcome: ${Ne.run.passed?`passed`:`failed`}`,`Duration: ${Ne.run.duration}ms`,``,`Current check outcomes:`,n,``,`Tool sequence:`,i,``,`Extracted values:`,r,``,`Final answer:`,Ne.run.finalAnswer||`(empty)`,``,`If the run has a meaningful ordered tool path, suggest a tool_sequence check using the raw tool names in the tool sequence order, even if other tools appear between them.`,`Use agent_check only for semantic or fuzzy validation;`,`Please propose concrete updates to the Prompt, Checks, and/or Value Capture Rules based on this preview.`].join(`
|
|
127
|
-
`);ke(a),xe(!0)},ht=async()=>{if(ct&&!v){pe(!0),he(null);try{await x4({serverNames:ot.filter(e=>o.find(t=>t.id===e)?.authType===`oauth2`),source:b});let e=new Set;for(let t of ot){let n=await b.discoverToolsForAnalysis({serverNames:[t]});for(let t of n.servers)for(let n of t.tools)e.add(n.name)}de(Array.from(e).sort((e,t)=>e.localeCompare(t)))}catch(e){he(e instanceof Error?e.message:`Failed to load tools`)}finally{pe(!1)}}};return(0,I.jsx)(n2,{open:Fe,onOpenChange:Ie,children:(0,I.jsxs)(K,{className:v?`rounded-md border shadow-none`:`border-dashed`,children:[(0,I.jsxs)(Qv,{className:`${v?`px-3 py-3`:`pb-3`} flex-row items-center justify-between space-y-0 cursor-pointer`,onClick:Le,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[!v&&(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,children:(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${Fe?`rotate-0`:`-rotate-90`}`})})}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[r+1,`.`]}),(0,I.jsx)($v,{className:`truncate text-sm font-medium`,children:e.name||`Scenario ${r+1}`}),v&&t===`referenced`&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-6 px-2 text-xs`,asChild:!0,children:(0,I.jsx)(sp,{to:`/libraries/test-cases/${encodeURIComponent(e.id)}${f?`?returnTo=${encodeURIComponent(f)}`:``}`,children:`Edit test`})})]}),v?(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t&&(0,I.jsx)(Y,{variant:t===`inline`?`secondary`:`outline-solid`,children:t===`referenced`?`Referenced`:`Inline`}),n&&(0,I.jsx)(Y,{variant:`secondary`,children:`Override`}),(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-8 w-8`,"aria-label":Fe?`Collapse scenario details`:`Expand scenario details`,children:(0,I.jsx)(rn,{className:`h-4 w-4 transition-transform ${Fe?`rotate-180`:``}`})})})]}):y&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>xe(!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:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5 text-amber-500`}),`Ask Assistant`]}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:m,disabled:r===0,"aria-label":`Move scenario up`,children:(0,I.jsx)(on,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:h,disabled:r===i-1,"aria-label":`Move scenario down`,children:(0,I.jsx)(rn,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:g,children:(0,I.jsx)(ar,{className:`h-3.5 w-3.5 text-destructive`})})]})]}),(0,I.jsx)(i2,{children:(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(E4,{open:be,onOpenChange:e=>{xe(e),e||ke(``)},configId:s,configPath:c,scenario:e,agents:a,servers:o,defaultAssistantAgentName:l,initialUserMessage:Oe||u,onApplyPatch:e=>p({...e.prompt===void 0?{}:{prompt:e.prompt},...e.evalRules===void 0?{}:{evalRules:e.evalRules},...e.extractRules===void 0?{}:{extractRules:e.extractRules}})}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Name`}),(0,I.jsx)(Np,{value:e.name,onChange:e=>p({name:e.target.value}),disabled:v,placeholder:`e.g. List directory`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Servers`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[o.map(t=>(0,I.jsx)(Y,{variant:e.serverIds.includes(t.id)?`default`:`outline-solid`,className:`cursor-pointer text-xs ${e.serverIds.includes(t.id)?``:`opacity-50`}`,onClick:()=>!v&&Qe(t.id),children:t.name||t.id},t.id)),o.length===0&&(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Add servers above first`})]})]}),(0,I.jsxs)(K,{className:`border bg-card`,children:[(0,I.jsxs)(Qv,{className:`pb-2`,children:[(0,I.jsx)($v,{className:`text-sm`,children:`Prompt`}),(0,I.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.`})]}),(0,I.jsxs)(q,{className:`space-y-3 pt-0`,children:[(0,I.jsx)(n0,{value:e.prompt,onChange:e=>p({prompt:e.target.value}),disabled:v,placeholder:`The prompt to send to the agent...`,rows:4,className:`text-xs`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`input`,{ref:Ae,type:`file`,accept:[...z4,...B4,`.md`].join(`,`),multiple:!0,className:`hidden`,onChange:e=>je(e.target.files)}),(e.attachments?.length??0)>0?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[e.attachments?.map((e,t)=>(0,I.jsxs)(`div`,{className:`group relative`,title:`${e.name??`attachment ${t+1}`}`,children:[(0,I.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center overflow-hidden rounded border bg-muted`,children:e.type===`image`?(0,I.jsx)(`img`,{src:`data:${e.media_type};base64,${e.data}`,alt:e.name??`attachment ${t+1}`,className:`h-full w-full object-cover`}):(0,I.jsx)(wn,{className:`h-6 w-6 text-muted-foreground`})}),e.name&&(0,I.jsx)(`p`,{className:`mt-0.5 max-w-[64px] truncate text-center text-xs text-muted-foreground`,children:e.name}),!v&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>Me(t),className:`absolute -right-1 -top-1 hidden h-4 w-4 items-center justify-center rounded-full bg-destructive text-destructive-foreground group-hover:flex`,"aria-label":`Remove attachment`,children:(0,I.jsx)(dr,{className:`h-2.5 w-2.5`})})]},t)),!v&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>Ae.current?.click(),className:`flex h-16 w-16 items-center justify-center self-start rounded border border-dashed text-muted-foreground hover:border-foreground hover:text-foreground`,"aria-label":`Attach file`,title:`Attach file (image or document)`,children:(0,I.jsx)(Wn,{className:`h-4 w-4`})})]}):!v&&(0,I.jsxs)(`button`,{type:`button`,onClick:()=>Ae.current?.click(),className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Wn,{className:`h-3.5 w-3.5`}),`Attach file`]})]})]})]}),!v&&(0,I.jsxs)(K,{className:`border bg-muted/20`,children:[(0,I.jsxs)(Qv,{className:`pb-2`,children:[(0,I.jsx)($v,{className:`text-sm`,children:`Run Prompt Preview`}),(0,I.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.`})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Agent`}),(0,I.jsxs)(E1,{value:Se,onValueChange:Ce,children:[(0,I.jsx)(O1,{className:`h-8 text-xs`,children:(0,I.jsx)(D1,{placeholder:`Select agent`})}),(0,I.jsx)(j1,{children:a.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.name||e.id},e.id))})]})]}),(0,I.jsx)(`div`,{className:`flex items-end`,children:(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 gap-1.5 px-2 text-xs`,onClick:()=>void pt(),disabled:we||!Se||!e.prompt.trim()||e.serverIds.length===0,children:we?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(In,{className:`h-3.5 w-3.5 animate-spin`}),`Running...`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),`Run Prompt`]})})})]}),!e.prompt.trim()&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Add a prompt to run preview.`}),e.serverIds.length===0&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Select at least one server to run preview.`}),Ee&&(0,I.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:Ee}),Ne&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,I.jsx)(Y,{variant:Ne.run.passed?`default`:`destructive`,children:Ne.run.passed?`Passed`:`Failed`}),(0,I.jsxs)(Y,{variant:`outline`,children:[Ne.run.duration,`ms`]}),(0,I.jsxs)(Y,{variant:`outline`,children:[Ne.run.toolCalls.length,` tool calls`]}),(0,I.jsx)(Y,{variant:`outline`,className:`font-mono`,children:Ne.agentName}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto h-6 gap-1.5 px-2 text-[11px]`,onClick:mt,children:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5 text-amber-500`}),`Send to Assistant`]})]}),e.evalRules.length===0?(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-2`,children:[(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Check results`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No checks configured for this scenario.`})]}):(()=>{let t=Y4(e.evalRules,Ne.run.failureReasons,Ne.run.checkResults),n=t.filter(e=>e.status===`passed`),r=t.filter(e=>e.status===`failed`);return(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Checks`}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-success/30 bg-success/10 text-success text-[10px]`,children:[n.length,` passed`]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px] ${r.length>0?`border-destructive/30 bg-destructive/10 text-destructive`:``}`,children:[r.length,` failed`]})]}),(0,I.jsx)(`div`,{className:`space-y-1`,children:t.map((t,n)=>(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${t.status===`failed`?`border-destructive/20 bg-destructive/5`:t.status===`not_executed`?`border-amber-500/20 bg-amber-500/5`:t.status===`not_evaluated`?`border-muted-foreground/20 bg-muted/40`:`border-success/20 bg-success/5`}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t.status===`failed`?(0,I.jsx)(dn,{className:`h-3.5 w-3.5 shrink-0 text-destructive`}):t.status===`not_executed`?(0,I.jsx)(pn,{className:`h-3.5 w-3.5 shrink-0 text-amber-600`}):t.status===`not_evaluated`?(0,I.jsx)(pn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 shrink-0 text-success`}),(0,I.jsx)(`span`,{className:`font-medium`,children:Q4(t.rule)})]}),t.failureReason&&(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-[11px] text-muted-foreground`,children:$4(t.failureReason)})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${t.status===`failed`?`border-destructive/30 text-destructive`:t.status===`not_executed`?`border-amber-500/30 text-amber-600`:t.status===`not_evaluated`?`border-muted-foreground/30 text-muted-foreground`:`border-success/30 text-success`}`,children:m4(t.status)})]},`${e.id}-preview-check-${n}`))})]})})(),Ne.run.failureReasons.length>0&&(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-wide text-destructive`,children:`Check failures`}),(0,I.jsx)(`ul`,{className:`list-disc space-y-1 pl-4 text-xs text-destructive`,children:Ne.run.failureReasons.map((e,t)=>(0,I.jsx)(`li`,{children:e},`${Ne.runId}-failure-${t}`))})]}),Object.keys(Ne.run.extractedValues).length>0&&(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-2`,children:[(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Extracted values`}),(0,I.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:Object.entries(Ne.run.extractedValues).map(([e,t])=>(0,I.jsxs)(`div`,{className:`rounded border bg-muted/20 px-2 py-1 text-xs`,children:[(0,I.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:e}),(0,I.jsx)(`div`,{className:`break-all`,children:String(t)})]},e))})]}),(0,I.jsx)(N4,{run:Ne.run,fallbackUserPrompt:e.prompt})]})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[(0,I.jsxs)(K,{className:`border bg-muted/20`,children:[(0,I.jsx)(Qv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)($v,{className:`text-sm`,children:`Checks`}),(0,I.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.`})]}),!v&&(0,I.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs shrink-0`,onClick:()=>xe(!0),title:`Ask for help improving checks`,children:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5 text-amber-500`}),`Ask Assistant`]})})]})}),(0,I.jsx)(q,{className:`space-y-2`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Checks (pass / fail)`}),(0,I.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.`}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:e.evalRules.length===0?(0,I.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((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`min-w-0`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${et[e.type]}`,children:$e[e.type]}),e.type===`agent_check`?(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium leading-tight`,children:e.label||`Unnamed check`}),e.prompt&&(0,I.jsx)(`div`,{className:`mt-0.5 wrap-break-word text-[11px] leading-snug text-muted-foreground`,children:e.prompt})]}):e.type===`tool_sequence`?(0,I.jsx)(`span`,{className:`font-mono break-all`,children:W4(e.sequence??[])}):G4(e.type)?(0,I.jsx)(`span`,{className:`font-mono break-all`,children:e.type===`tool_input_contains`?`${e.tool} contains ${String(e.value)}`:e.type===`tool_input_regex`?`${e.tool} matches ${String(e.value)}`:`${e.tool} · ${e.path} · ${e.equals===void 0?`exists`:`== ${String(e.equals)}`}`}):(0,I.jsx)(`span`,{className:`font-mono break-all`,children:e.path?e.equals===void 0?e.path:`${e.path} == ${String(e.equals)}`:e.value})]})}),!v&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(e.type===`tool_sequence`||e.type===`agent_check`||Ye.includes(e.type))&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 px-2 text-[11px]`,onClick:()=>{e.type===`tool_sequence`?(S(`tool_sequence`),B(e.sequence??[]),re(e),te(!0)):e.type===`agent_check`?(S(`agent_check`),ae(e),N(e.label??``),F(e.prompt??``),se(!0)):(S(e.type),ce(e),w(String(e.value??``)),E(e.tool??``),k(e.path??``),j(e.equals===void 0?``:String(e.equals)))},"aria-label":`Edit check ${t+1}`,children:(0,I.jsx)(nr,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:()=>Je(t),"aria-label":`Remove check ${t+1}`,children:(0,I.jsx)(dr,{className:`h-3.5 w-3.5`})})]})]},t))}),!v&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[at?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,I.jsx)(H4,{value:x,onValueChange:S,className:`h-8 w-58 shrink-0 text-xs`}),(0,I.jsx)(Np,{value:M,onChange:e=>N(e.target.value),placeholder:`Prompt name`,className:`h-8 text-xs`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:ze,children:ie===null?`Add check`:`Update check`})]}),(0,I.jsx)(n0,{value:P,onChange:e=>F(e.target.value),placeholder:`Judge prompt. Example: Confirm the answer includes a valid earliest and latest timestamp range, and that neither is 'Not available'.`,className:`min-h-[64px] text-xs`})]}):(0,I.jsxs)(`div`,{className:`flex gap-2 items-end`,children:[(0,I.jsx)(H4,{value:x,onValueChange:S,className:`h-8 w-58 shrink-0 text-xs`,hideToolSequence:Ke&&x!==`tool_sequence`}),rt?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Np,{value:D,onChange:e=>k(e.target.value),placeholder:`JSONPath (e.g. $.status)`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),ze())}),x===`response_jsonpath`&&(0,I.jsx)(Np,{value:A,onChange:e=>j(e.target.value),placeholder:`Equals (optional)`,className:`h-8 w-48 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),ze())})]}):nt?(0,I.jsxs)(I.Fragment,{children:[H&&H.length>0?(0,I.jsxs)(E1,{value:T,onValueChange:E,children:[(0,I.jsx)(O1,{className:`h-8 text-xs font-mono`,children:(0,I.jsx)(D1,{placeholder:`Select tool`})}),(0,I.jsx)(j1,{children:H.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))})]}):(0,I.jsx)(Np,{value:T,onChange:e=>E(e.target.value),placeholder:`Tool name`,className:`h-8 text-xs font-mono`}),x===`tool_input_jsonpath`&&(0,I.jsx)(Np,{value:D,onChange:e=>k(e.target.value),placeholder:`JSONPath (e.g. $.query)`,className:`h-8 text-xs font-mono`}),x===`tool_input_jsonpath`?(0,I.jsx)(Np,{value:A,onChange:e=>j(e.target.value),placeholder:`Equals (optional)`,className:`h-8 w-40 text-xs font-mono`}):(0,I.jsx)(Np,{value:C,onChange:e=>w(e.target.value),placeholder:x===`tool_input_regex`?`Regex pattern`:`Text present in input`,className:`h-8 w-40 text-xs font-mono`})]}):it?(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-end gap-2`,children:[(0,I.jsx)(Np,{value:L,onChange:e=>R(e.target.value),placeholder:`Tool name`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),Be())}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:Be,children:`Add step`})]}):(0,I.jsx)(Np,{value:C,onChange:e=>w(e.target.value),placeholder:`Value`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),ze())}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:ze,children:V===null?`Add`:`Update check`})]}),it&&(0,I.jsxs)(`div`,{className:`space-y-2 rounded-md border bg-background px-2 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Sequence steps`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Require these tools in order. Other tools may appear between them.`})]}),!v&&z.length>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-[11px]`,onClick:()=>B([]),children:`Clear`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-[11px]`,onClick:()=>qe(z),children:Ke?`Update sequence`:`Add sequence`})]})]}),z.length===0?(0,I.jsx)(`p`,{className:`rounded-md border border-dashed bg-muted/20 px-2 py-2 text-xs text-muted-foreground`,children:`No ordered tool sequence yet.`}):(0,I.jsx)(`div`,{className:`space-y-1.5`,children:z.map((t,n)=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-muted/10 px-2 py-1.5`,children:[(0,I.jsxs)(`span`,{className:`text-xs font-medium`,children:[n+1,`.`]}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 font-mono text-xs break-all`,children:t}),!v&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>Ve(n,-1),disabled:n===0,"aria-label":`Move tool ${n+1} up`,children:(0,I.jsx)(on,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>Ve(n,1),disabled:n===z.length-1,"aria-label":`Move tool ${n+1} down`,children:(0,I.jsx)(rn,{className:`h-3.5 w-3.5`})}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>He(n),"aria-label":`Remove tool ${n+1}`,children:(0,I.jsx)(dr,{className:`h-3.5 w-3.5`})})]})]},`${e.id}-tool-sequence-draft-${n}`))})]}),tt&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)($,{className:`mb-1 block text-[11px] text-muted-foreground`,children:`Pick from selected server tools (optional)`}),(0,I.jsxs)(E1,{value:le,onValueChange:e=>{ue(e),w(e)},disabled:fe||!H||H.length===0,children:[(0,I.jsx)(O1,{className:`h-8 text-xs`,children:(0,I.jsx)(D1,{placeholder:fe?`Loading tools...`:H&&H.length>0?`Select tool to insert in value field`:`Load tools first`})}),(0,I.jsx)(j1,{children:(H??[]).map(e=>(0,I.jsx)(Q,{value:e,children:e},e))})]})]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:ht,disabled:!ct||fe,children:fe?`Loading...`:H?`Refresh tools`:`Load tools`})]}),!ct&&(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Select at least one server in this scenario to load tool names.`}),me&&(0,I.jsxs)(`p`,{className:`text-[11px] text-destructive`,children:[`Could not load tools: `,me]})]})]})]})})]}),(0,I.jsxs)(K,{className:`border bg-muted/10`,children:[(0,I.jsx)(Qv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)($v,{className:`text-sm`,children:`Value Capture Rules`}),(0,I.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 and comparisons.`})]}),!v&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs shrink-0`,onClick:()=>xe(!0),title:`Ask for help improving value capture rules`,children:[(0,I.jsx)(tr,{className:`h-3.5 w-3.5 text-amber-500`}),`Ask Assistant`]})]})}),(0,I.jsx)(q,{className:`space-y-2`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Value Capture Rules`}),(0,I.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.`}),(0,I.jsx)(`div`,{className:`space-y-1.5`,children:e.extractRules.length===0?(0,I.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((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`min-w-0`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.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:e.name}),(0,I.jsx)(`span`,{className:`text-[11px] font-semibold text-muted-foreground`,children:`regex:`}),(0,I.jsx)(`code`,{className:`font-mono break-all text-foreground`,children:e.pattern})]})}),!v&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`h-6 w-6 shrink-0`,onClick:()=>Ze(t),"aria-label":`Remove value capture rule ${t+1}`,children:(0,I.jsx)(dr,{className:`h-3.5 w-3.5`})})]},t))}),!v&&(0,I.jsxs)(`div`,{className:`flex gap-2 items-end`,children:[(0,I.jsx)(Np,{value:ge,onChange:e=>_e(e.target.value),placeholder:`Field name`,className:`h-8 text-xs w-36`}),(0,I.jsx)(Np,{value:ve,onChange:e=>ye(e.target.value),placeholder:`Regex pattern`,className:`h-8 text-xs font-mono`,onKeyDown:e=>e.key===`Enter`&&(e.preventDefault(),Xe())}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 shrink-0`,onClick:Xe,children:`Add`})]})]})})]})]}),e.evalRules.some(e=>e.type===`agent_check`)&&(0,I.jsxs)(K,{className:`border bg-muted/10`,children:[(0,I.jsx)(Qv,{className:`pb-2`,children:(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)($v,{className:`text-sm`,children:`Judge context`}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Extra context is shared across all judge checks in this scenario and sent once in the batched judge request.`})]})}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(W0,{id:`judge-ctx-prompt-${e.id}`,checked:e.agentContext?.include_prompt??!1,disabled:v,className:`mt-0.5`,onCheckedChange:t=>{p({agentContext:{...e.agentContext,include_prompt:t===!0}})}}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{htmlFor:`judge-ctx-prompt-${e.id}`,className:`cursor-pointer text-xs font-medium`,children:`Include prompt`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Sends the scenario prompt so the judge can verify the answer addresses the original question.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(W0,{id:`judge-ctx-tools-${e.id}`,checked:e.agentContext?.include_tool_sequence??!1,disabled:v,className:`mt-0.5`,onCheckedChange:t=>{p({agentContext:{...e.agentContext,include_tool_sequence:t===!0}})}}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{htmlFor:`judge-ctx-tools-${e.id}`,className:`cursor-pointer text-xs font-medium`,children:`Include tool sequence`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Sends the list of called tool names so the judge can reason about which tools were used.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(W0,{id:`judge-ctx-inputs-${e.id}`,checked:e.agentContext?.include_tool_inputs??!1,disabled:v,className:`mt-0.5`,onCheckedChange:t=>{p({agentContext:{...e.agentContext,include_tool_inputs:t===!0}})}}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{htmlFor:`judge-ctx-inputs-${e.id}`,className:`cursor-pointer text-xs font-medium`,children:`Include tool inputs`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Sends the called MCP tools and their arguments so the judge can verify how the tools were used.`})]})]})]})]})]})})]})})}function Y4(e,t,n){return h4({evalRules:e,failureReasons:t,checkResults:n})}function X4(e){return e.type===`agent_check`?`${e.type}: ${e.label??``} — ${e.prompt??``}`:e.type===`tool_sequence`?`${e.type}: ${W4(e.sequence??[])}`:G4(e.type)?`${e.type}: ${e.tool??``}: ${Z4(e)}`:e.path?`${e.type}: ${Z4(e)}`:`${e.type}: ${e.value??``}`}function Z4(e){return e.path?e.equals===void 0?e.path:`${e.path} == ${String(e.equals)}`:String(e.value??``)}var Q4=g4;function $4(e){let t=String(e??``).trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}function e3(e){let 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}function t3(e){return e??0}function n3(e=`llm`){return e===`browser`?{id:`agt-${Date.now()}`,name:``,type:`browser`,provider:`claude`,model:``,maxTokens:0,url:``,newConversationBetweenScenarios:!0}:{id:`agt-${Date.now()}`,name:``,type:`llm`,provider:`openai`,model:`gpt-4o`,temperature:0,maxTokens:4096}}var r3=()=>({id:`cfg-${Date.now()}`,name:``,configName:``,description:``,servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),i3=()=>{let{id:e,tab:t}=qd(),n=Bd(),r=Ud(),[i,a]=pp(),{getConfig:o,addConfig:s,updateConfig:c,loading:l}=Jv(),{source:u}=Rv(),{servers:d,agents:f,scenarios:p}=Zv(),m=e===`new`,h=!m&&!!e,g=h?o(e):void 0,[v,y]=(0,_.useState)(m||t===`edit`),[b,x]=(0,_.useState)(()=>g?structuredClone(g):r3()),[S,C]=(0,_.useState)(``),[w,T]=(0,_.useState)(``),[E,D]=(0,_.useState)({}),[k,A]=(0,_.useState)({}),[j,M]=(0,_.useState)({}),N=(0,_.useMemo)(()=>{let e=t||i.get(`tab`);return e===`agents`||e===`scenarios`?e:`scenarios`},[t,i]),P=`${n.pathname}${n.search}`;(0,_.useEffect)(()=>{g&&!v&&x(structuredClone(g))},[g,v]),(0,_.useEffect)(()=>{t===`edit`&&!m&&y(!0)},[t,m]);let F=e=>x(t=>({...t,...e})),L=(0,_.useMemo)(()=>b.serverEntries&&b.serverEntries.length>0?b.serverEntries:(b.servers??[]).map(e=>({kind:`inline`,server:e})),[b.serverEntries,b.servers]),R=(0,_.useMemo)(()=>b.scenarioEntries&&b.scenarioEntries.length>0?b.scenarioEntries:b.scenarios.map(e=>({kind:`inline`,scenario:e})),[b.scenarioEntries,b.scenarios]),z=e=>{F({scenarioEntries:e,scenarios:e.filter(e=>e.kind===`inline`).map(e=>e.scenario)})},B=(0,_.useMemo)(()=>b.agentEntries&&b.agentEntries.length>0?b.agentEntries:b.agents.map(e=>({kind:`inline`,agent:e})),[b.agentEntries,b.agents]),ee=e=>{F({agentEntries:e,agents:e.filter(e=>e.kind===`inline`).map(e=>e.agent)})},te=!v,ne=b.runDefaults?.selectedAgentNames??[],re=async()=>{if(!b.name.trim()){O({title:`Validation Error`,description:`Config ID is required.`,variant:`destructive`});return}let e=L.map(e=>e.kind===`referenced`?{kind:`referenced`,ref:d.find(t=>t.id===e.ref)?.id||e.ref}:e),t=B.map(e=>e.kind===`referenced`?{kind:`referenced`,ref:f.find(t=>t.id===e.ref)?.id||e.ref}:e),n=R.map(e=>{if(e.kind===`referenced`){let t=p.find(t=>t.id===e.ref),n=(e.mcpServers??[]).map(e=>e.kind===`referenced`?{kind:`referenced`,ref:d.find(t=>t.id===e.ref)?.id||e.ref}:e);return{kind:`referenced`,ref:t?.id||e.ref,...e.mcpServers===void 0?{}:{mcpServers:n}}}return e}),i=e.filter(e=>e.kind===`inline`).map(e=>({server:e.server,error:e3(e.server)})).find(e=>!!e.error);if(i?.error){O({title:`Validation Error`,description:i.error,variant:`destructive`});return}if(n.filter(e=>e.kind===`inline`).some(e=>!e.scenario.name?.trim())){O({title:`Validation Error`,description:`Inline scenarios must have a name before saving.`,variant:`destructive`});return}let a=new Set(t.map(e=>e.kind===`inline`?e.agent.id:e.ref)),o=(b.runDefaults?.selectedAgentNames??[]).filter(e=>a.has(e)),l={...b,serverEntries:e,servers:e.filter(e=>e.kind===`inline`).map(e=>e.server),agentEntries:t,agents:t.filter(e=>e.kind===`inline`).map(e=>e.agent),scenarioEntries:n,scenarios:n.filter(e=>e.kind===`inline`).map(e=>e.scenario),runDefaults:o.length>0?{...b.runDefaults??{},selectedAgentNames:o}:void 0,updatedAt:new Date().toISOString()};if(m){let e=await s(l);x(e),O({title:`MCP Evaluation Created`,description:`"${Vi(e.configName,Vi(e.name,e.id))}" has been saved.`}),r(`/mcp-evaluations/${e.id}`)}else{let e=await c(b.id,l);x(e),O({title:`MCP Evaluation Updated`,description:`"${Vi(e.configName,Vi(e.name,e.id))}" has been updated.`}),y(!1),r(`/mcp-evaluations/${e.id}`,{replace:!0})}},ie=Vi(b.configName,Vi(b.name,b.id)),ae=m?`New MCP Evaluation`:v?`Editing: ${ie}`:ie,oe=m?`/mcp-evaluations/new`:`/mcp-evaluations/${encodeURIComponent(b.id||e||``)}`,se=!!g?.loadError,V=(0,_.useMemo)(()=>f.map(e=>({id:e.id,ref:e.id,label:Vi(e.name,e.id),model:e.model})).sort((e,t)=>e.label.localeCompare(t.label)),[f]),ce=(e,t)=>{let n=t?Array.from(new Set([...ne,e])):ne.filter(t=>t!==e);F({runDefaults:{...b.runDefaults??{},selectedAgentNames:n}})},le=e=>{let t=new Set([...B.filter(e=>e.kind===`inline`).map(e=>Vi(e.agent.name,e.agent.id)),...f.map(e=>Vi(e.name,e.id))]),n=`${e}-custom`,r=n,i=2;for(;t.has(r);)r=`${n}-${i}`,i+=1;return r},ue=()=>{let e=n3(`llm`);ee([{kind:`inline`,agent:e},...B]),D(t=>({...t,[e.id]:!0}))},H=()=>{let e=f.find(e=>e.id===w);if(!e)return;let t=e.id;new Set(B.filter(e=>e.kind===`referenced`).map(e=>e.ref)).has(t)||ee([...B,{kind:`referenced`,ref:t}]),T(``)},de=()=>{let e=new Set(B.filter(e=>e.kind===`referenced`).map(e=>e.ref)),t=f.filter(t=>!e.has(t.id)).map(e=>({kind:`referenced`,ref:e.id}));t.length>0&&ee([...B,...t])},fe=()=>{let e=f.find(e=>e.id===w);if(!e)return;let t=Vi(e.name,e.id),n=le(t),r={...structuredClone(e),id:`agt-${Date.now()}`,name:n};ee([...B,{kind:`inline`,agent:r}]),D(e=>({...e,[r.id]:!0})),T(``),O({title:`Imported agent as inline`,description:n})},pe=e=>{let t=B[e];if(!t)return;let n=t.kind===`inline`?t.agent.id:t.ref,r=ne.filter(e=>e!==n);F({runDefaults:{...b.runDefaults??{},selectedAgentNames:r}}),t.kind===`inline`&&D(e=>{let n={...e};return delete n[t.agent.id],n}),ee(B.filter((t,n)=>n!==e))},me=(e,t)=>{let n=e+t;if(n<0||n>=B.length)return;let r=[...B],[i]=r.splice(e,1);r.splice(n,0,i),ee(r)},he=e=>{let t=B[e];if(!t||t.kind!==`referenced`)return;let n=Ce(t.ref);if(!n){O({title:`Referenced agent not found`,variant:`destructive`});return}let r=Vi(n.name,n.id),i=le(r),a={...structuredClone(n),id:`agt-${Date.now()}`,name:i},o=[...B];if(o[e]={kind:`inline`,agent:a},ee(o),ne.includes(t.ref)){let e=ne.map(e=>e===t.ref?a.id:e);F({runDefaults:{...b.runDefaults??{},selectedAgentNames:Array.from(new Set(e))}})}D(e=>({...e,[a.id]:!0})),O({title:`Referenced agent converted to inline`,description:i})},ge=()=>{let e=p.find(e=>e.id===S);if(!e)return;let t={...structuredClone(e),id:`scn-${Date.now()}`,serverIds:[...e.serverIds]};z([...R,{kind:`inline`,scenario:t}]),M(e=>({...e,[t.id]:!0})),C(``)},_e=()=>{let e={id:`scn-${Date.now()}`,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]};z([{kind:`inline`,scenario:e},...R]),M(t=>({...t,[e.id]:!0}))},ve=()=>{let e=p.find(e=>e.id===S);if(!e)return;let t=e.id;new Set(R.filter(e=>e.kind===`referenced`).map(e=>e.ref)).has(t)||z([...R,{kind:`referenced`,ref:t}]),C(``)},ye=e=>{let t=R[e];t?.kind===`inline`&&M(e=>{let n={...e};return delete n[t.scenario.id],n}),z(R.filter((t,n)=>n!==e))},be=(e,t)=>{let n=e+t;if(n<0||n>=R.length)return;let r=[...R],[i]=r.splice(e,1);r.splice(n,0,i),z(r)},xe=e=>{let t=R[e];if(!t||t.kind!==`referenced`)return;let n=we(t.ref);if(!n){O({title:`Referenced scenario not found`,variant:`destructive`});return}let r=new Set(R.filter(e=>e.kind===`inline`).map(e=>e.scenario.name?.trim().toLowerCase()).filter(Boolean)),i=`${Vi(n.name,n.id)}-custom`,a=i,o=2;for(;r.has(a.toLowerCase());)a=`${i}-${o}`,o+=1;let s=Date.now(),c={...structuredClone(n),id:`scn-${s}`,name:a,serverIds:t.mcpServers&&t.mcpServers.length>0?t.mcpServers.map(e=>e.kind===`referenced`?e.ref:e.server.id):[...n.serverIds]},l=[...R];l[e]={kind:`inline`,scenario:c},z(l),M(e=>({...e,[c.id]:!0})),O({title:`Referenced scenario converted to inline`,description:a})},Se=e=>d.find(t=>t.id===e),Ce=e=>f.find(t=>t.id===e),we=e=>p.find(t=>t.id===e),Te=L.filter(e=>e.kind===`referenced`).map(e=>e.ref),Ee=Te.map(Se).filter(e=>!!e),De=B.filter(e=>e.kind===`referenced`).map(e=>e.ref),Oe=De.map(Ce).filter(e=>!!e);B.filter(e=>e.kind===`inline`);let ke=B.flatMap(e=>{if(e.kind===`referenced`){let t=Ce(e.ref);return t?[{agent:t,origin:`referenced`,ref:e.ref}]:[]}return[{agent:e.agent,origin:`inline`,ref:void 0}]}),Ae=R.filter(e=>e.kind===`referenced`).map(e=>e.ref),je=R.flatMap(e=>{if(e.kind===`referenced`){let t=we(e.ref);if(!t)return[];if(e.mcpServers===void 0)return[{scenario:t,origin:`referenced`,hasMcpServerOverride:!1}];let n=e.mcpServers.flatMap(e=>e.kind===`referenced`?[e.ref]:[e.server.id]);return[{scenario:{...t,serverIds:n},origin:`referenced`,hasMcpServerOverride:!0}]}return[{scenario:e.scenario,origin:`inline`,hasMcpServerOverride:!1}]}),Me=Array.from(new Map([...f,...b.agents,...Oe].map(e=>[e.id,e])).values()),Ne=Array.from(new Map([...d,...b.servers??[],...Ee].map(e=>[e.id,e])).values()),Pe=R.filter(e=>e.kind===`referenced`).flatMap(e=>(e.mcpServers??[]).filter(e=>e.kind===`referenced`).map(e=>e.ref)),Fe=Array.from(new Set([...Te,...Pe].filter(e=>!Se(e)))),Ie=De.filter(e=>!Ce(e)),Le=Ae.filter(e=>!we(e));new Set(Fe);let Re=new Set(Le),ze=B.length,Be=R.length,Ve=[...d],He=(e,t)=>{let n=R[e];if(!n||n.kind!==`referenced`)return;let r=[...R];r[e]={kind:`referenced`,ref:n.ref,mcpServers:t.map(e=>({kind:`referenced`,ref:e}))},z(r)},Ue=e=>{let t=R[e];if(!t||t.kind!==`referenced`)return;let n=[...R];n[e]={kind:`referenced`,ref:t.ref},z(n)};return(0,_.useEffect)(()=>{w&&(f.some(e=>e.id===w)||T(``))},[f,w]),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(W,{variant:`ghost`,size:`icon`,asChild:!0,className:`h-8 w-8`,children:(0,I.jsx)(sp,{to:`/mcp-evaluations`,children:(0,I.jsx)(Qt,{className:`h-4 w-4`})})}),(0,I.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold truncate`,children:ae}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground flex flex-wrap items-center gap-x-2 gap-y-1`,children:[m?`Create a new MCP evaluation`:l?`Loading configuration...`:g?g.loadError?`MCP evaluation could not be fully loaded`:(0,I.jsxs)(I.Fragment,{children:[`Last updated `,(0,I.jsx)(`span`,{children:new Date(b.updatedAt).toLocaleDateString()})]}):`MCP evaluation not found`,!m&&F1(b)&&(0,I.jsxs)(`span`,{"aria-label":`Evaluation file`,className:`inline-flex min-w-0 items-center gap-1 text-xs font-mono`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,I.jsx)(Cn,{className:`h-3 w-3 shrink-0`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`truncate`,children:F1(b)})]})]})]}),(0,I.jsxs)(`div`,{className:`flex gap-2 shrink-0`,children:[h&&!v&&(0,I.jsx)(W,{size:`sm`,onClick:()=>{y(!0),r(`${oe}/edit`)},children:`Edit`}),h&&!v&&g&&!se&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)(sp,{to:`/run?configId=${encodeURIComponent(g.id)}`,children:[(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),`Run Evaluation`]})}),h&&!v&&se&&(0,I.jsxs)(Y,{variant:`destructive`,className:`py-1 px-3 text-xs`,children:[(0,I.jsx)(or,{className:`mr-1 h-3 w-3`}),`Broken config`]}),v&&(0,I.jsxs)(I.Fragment,{children:[!m&&(0,I.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>{x(structuredClone(g)),y(!1),r(oe)},children:`Cancel`}),(0,I.jsxs)(W,{size:`sm`,onClick:()=>void re(),children:[(0,I.jsx)(Xn,{className:`mr-1.5 h-3.5 w-3.5`}),`Save`]})]})]})]}),se&&!v&&(0,I.jsx)(K,{className:`border-destructive/40`,children:(0,I.jsxs)(q,{className:`pt-6 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(or,{className:`mt-0.5 h-5 w-5 text-destructive`}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-sm font-semibold`,children:`This configuration is broken`}),(0,I.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.`})]})]}),(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium mb-1`,children:`File`}),(0,I.jsx)(`p`,{className:`text-xs font-mono break-all`,children:g&&F1(g)})]}),(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-3`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium mb-1 text-destructive`,children:`Load Error`}),(0,I.jsx)(`p`,{className:`text-xs break-all text-destructive`,children:g?.loadError})]}),(Fe.length>0||Ie.length>0||Le.length>0)&&(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-background p-3 space-y-1.5`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium`,children:`Broken references`}),Fe.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Servers:`,` `,(0,I.jsx)(`span`,{className:`text-destructive`,children:Fe.join(`, `)})]}),Ie.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Agents: `,(0,I.jsx)(`span`,{className:`text-destructive`,children:Ie.join(`, `)})]}),Le.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Scenarios:`,` `,(0,I.jsx)(`span`,{className:`text-destructive`,children:Le.join(`, `)})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Valid items still render below. Only the missing references are marked as broken.`})]})}),!se&&(b.loadWarnings?.length??0)>0&&(0,I.jsx)(K,{className:`border-amber-500/30`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300`,children:[(0,I.jsx)(or,{className:`h-4 w-4`}),`Migration warnings`]}),b.loadWarnings?.map((e,t)=>(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},`${e}-${t}`))]})}),(0,I.jsxs)(`div`,{className:`flex gap-4`,children:[(0,I.jsx)(Y,{variant:N===`scenarios`?`default`:`outline-solid`,className:`py-1 px-3 text-xs`,children:(0,I.jsxs)(sp,{to:`${oe}/scenarios`,className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,I.jsx)(wn,{className:`h-3 w-3`}),Be,` scenario`,Be===1?``:`s`]})}),(0,I.jsx)(Y,{variant:N===`agents`?`default`:`outline-solid`,className:`py-1 px-3 text-xs`,children:(0,I.jsxs)(sp,{to:`${oe}/agents`,className:`inline-flex items-center gap-1.5 whitespace-nowrap`,children:[(0,I.jsx)($t,{className:`h-3 w-3`}),ze,` agent`,ze===1?``:`s`]})})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6 space-y-3`,children:(0,I.jsxs)(`div`,{className:`grid gap-4 ${te||!m?`sm:grid-cols-2`:`sm:grid-cols-3`}`,children:[!te&&m&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Config ID`}),(0,I.jsx)(Np,{value:b.name,onChange:e=>F({name:e.target.value}),disabled:te,placeholder:`e.g. check-weather`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Name`}),(0,I.jsx)(Np,{value:b.configName||``,onChange:e=>F({configName:e.target.value}),disabled:te,placeholder:`e.g. Weather checks baseline`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Description`}),(0,I.jsx)(Np,{value:b.description||``,onChange:e=>F({description:e.target.value}),disabled:te,placeholder:`Brief description...`})]})]})})}),(0,I.jsxs)(x0,{value:N,onValueChange:t=>{if(t!==`servers`&&t!==`agents`&&t!==`scenarios`)return;let n=new URLSearchParams(i);n.delete(`tab`),a(n,{replace:!0}),r(e&&e!==`new`?`/mcp-evaluations/${encodeURIComponent(e)}/${t}`:`/mcp-evaluations/${e??`new`}/${t}`,{replace:!0})},className:`space-y-4`,children:[(0,I.jsxs)(S0,{children:[(0,I.jsxs)(C0,{value:`scenarios`,className:`gap-1.5`,children:[(0,I.jsx)(wn,{className:`h-3.5 w-3.5`}),`Scenarios`]}),(0,I.jsxs)(C0,{value:`agents`,className:`gap-1.5`,children:[(0,I.jsx)($t,{className:`h-3.5 w-3.5`}),`Agents`]})]}),(0,I.jsxs)(w0,{value:`agents`,children:[!te&&(0,I.jsx)(K,{className:`mb-4`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(E1,{value:w,onValueChange:T,children:[(0,I.jsx)(O1,{className:`h-8`,children:(0,I.jsx)(D1,{placeholder:`Select agent from library`})}),(0,I.jsx)(j1,{children:V.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.label},e.id))})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!w,onClick:H,children:`Add Ref`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!w,onClick:fe,children:`Import Inline`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:f.length===0||f.every(e=>B.some(t=>t.kind===`referenced`&&t.ref===e.id)),onClick:de,children:`Add All Refs`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,onClick:ue,children:`Add agent`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[B.map((e,t)=>{let n=e.kind===`referenced`?Ce(e.ref):null,r=e.kind===`inline`?Vi(e.agent.name,e.agent.id):Vi(n?.name,e.ref),i=e.kind===`inline`?e.agent.model:n?.model||`unknown`,a=e.kind===`inline`?e.agent.id:e.ref,o=e.kind===`referenced`&&!n,s=e.kind===`inline`?e.agent.id:e.ref,c=ne.includes(s),l=e.kind===`inline`&&!!E[e.agent.id];return(0,I.jsxs)(`div`,{className:`rounded-md border text-sm`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>me(t,-1),disabled:t===0,"aria-label":`Move agent up`,children:(0,I.jsx)(on,{className:`h-3 w-3`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>me(t,1),disabled:t===B.length-1,"aria-label":`Move agent down`,children:(0,I.jsx)(rn,{className:`h-3 w-3`})})]}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t+1,`.`]}),(0,I.jsx)(`span`,{className:`truncate font-medium`,children:r}),(0,I.jsx)(Y,{variant:e.kind===`inline`?`secondary`:`outline-solid`,children:e.kind===`inline`?`Inline`:`Referenced`}),(0,I.jsx)(Y,{variant:`outline`,className:`font-mono text-[10px]`,children:i}),c&&(0,I.jsx)(Y,{variant:`outline`,className:`text-xs border-emerald-300 text-emerald-700 bg-emerald-50`,children:`Default`}),o&&(0,I.jsx)(Y,{variant:`destructive`,children:`Missing`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsxs)(`label`,{className:`mx-2 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>ce(s,e.target.checked)}),(0,I.jsx)(`span`,{children:`Default`})]}),e.kind===`inline`&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>D(t=>({...t,[e.agent.id]:!t[e.agent.id]})),children:l?`Collapse`:`Expand`}),e.kind===`referenced`&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>he(t),disabled:o,children:`Convert to inline`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`ghost`,className:`h-7 w-7 text-destructive hover:text-destructive`,onClick:()=>pe(t),"aria-label":`Remove agent entry`,children:(0,I.jsx)(ar,{className:`h-3.5 w-3.5`})})]})]}),e.kind===`inline`&&e.agent.type!==`browser`&&l&&(0,I.jsxs)(`div`,{className:`border-t px-3 py-3 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Name`}),(0,I.jsx)(Np,{value:e.agent.name,onChange:n=>{let r=[...B];r[t]={kind:`inline`,agent:{...e.agent,name:n.target.value}},ee(r)},placeholder:`e.g. GPT-5 Mini custom`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Provider`}),(0,I.jsxs)(E1,{value:e.agent.provider,onValueChange:n=>{let r=e.agent;if(r.type===`browser`)return;let i=[...B];i[t]={kind:`inline`,agent:{...r,provider:n}},ee(i)},children:[(0,I.jsx)(O1,{children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`openai`,children:`OpenAI`}),(0,I.jsx)(Q,{value:`anthropic`,children:`Anthropic`}),(0,I.jsx)(Q,{value:`azure`,children:`Azure OpenAI`}),(0,I.jsx)(Q,{value:`azure_foundry`,children:`Azure Foundry`}),(0,I.jsx)(Q,{value:`google`,children:`Google`}),(0,I.jsx)(Q,{value:`custom`,children:`Custom`})]})]})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Model`}),(0,I.jsx)(Np,{value:e.agent.model,onChange:n=>{let r=[...B];r[t]={kind:`inline`,agent:{...e.agent,model:n.target.value}},ee(r)},className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Max Tokens`}),(0,I.jsx)(Np,{type:`number`,min:1,max:128e3,value:e.agent.maxTokens,onChange:n=>{let r=[...B];r[t]={kind:`inline`,agent:{...e.agent,maxTokens:parseInt(n.target.value)||0}},ee(r)},className:`font-mono text-xs`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Temperature`}),(0,I.jsx)(Np,{type:`number`,min:0,max:2,step:.01,value:t3(e.agent.temperature),onChange:n=>{let r=e.agent;if(r.type===`browser`)return;let i=[...B];i[t]={kind:`inline`,agent:{...r,temperature:Number(n.target.value)||0}},ee(i)},className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`System Prompt`}),(0,I.jsx)(n0,{value:e.agent.systemPrompt||``,onChange:n=>{let r=e.agent;if(r.type!==`llm`)return;let i=[...B];i[t]={kind:`inline`,agent:{...r,systemPrompt:n.target.value}},ee(i)},rows:3,className:`text-xs`})]})]})]},`agent-entry-${t}-${a}`)}),B.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agents configured yet. Add inline agents or references.`})]}),Ie.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Missing agent refs: `,Ie.join(`, `)]})]})}),te?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-4`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[ke.map((e,t)=>{let n=Vi(e.agent.name,e.agent.id),r=ne.includes(e.origin===`inline`?e.agent.id:e.ref||e.agent.id),i=e.ref??e.agent.id,a=!!k[i];return(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t+1,`.`]}),(0,I.jsx)(`div`,{className:`truncate font-medium text-sm`,children:n})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r&&(0,I.jsx)(Y,{variant:`outline`,className:`text-xs border-emerald-300 text-emerald-700 bg-emerald-50`,children:`Default`}),(0,I.jsx)(Y,{variant:e.origin===`inline`?`secondary`:`outline-solid`,children:e.origin===`inline`?`Inline`:`Referenced`}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-8 w-8`,onClick:()=>A(e=>({...e,[i]:!e[i]})),"aria-label":a?`Collapse agent details`:`Expand agent details`,children:(0,I.jsx)(rn,{className:`h-4 w-4 transition-transform ${a?`rotate-180`:``}`})})]})]}),a&&(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2`,children:[(0,I.jsx)(O0,{provider:e.agent.provider}),(0,I.jsx)(Y,{variant:`outline`,className:`text-xs font-mono`,children:e.agent.model}),(0,I.jsxs)(Y,{variant:`outline`,className:`text-xs font-mono`,children:[`max_tokens: `,e.agent.maxTokens]}),e.agent.type!==`browser`&&(0,I.jsxs)(Y,{variant:`outline`,className:`text-xs font-mono`,children:[`temperature: `,t3(e.agent.temperature)]})]})]},`agent-view-${t}-${e.ref??e.agent.id}`)}),ke.length===0&&(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-6`,children:`No agents configured.`})]})})}):null]}),(0,I.jsxs)(w0,{value:`scenarios`,children:[!te&&(0,I.jsx)(K,{className:`mb-4`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_auto]`,children:[(0,I.jsxs)(E1,{value:S,onValueChange:C,children:[(0,I.jsx)(O1,{className:`h-8`,children:(0,I.jsx)(D1,{placeholder:`Select scenario from library`})}),(0,I.jsx)(j1,{children:[...p].sort((e,t)=>Vi(e.name,e.id).localeCompare(Vi(t.name,t.id))).map(e=>(0,I.jsx)(Q,{value:e.id,children:Vi(e.name,e.id)},e.id))})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!S,onClick:ve,children:`Add Ref`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,disabled:!S,onClick:ge,children:`Import Inline`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-8`,onClick:_e,children:`Add scenario`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[R.map((e,t)=>{let n=e.kind===`referenced`?we(e.ref):null,r=e.kind===`inline`?Vi(e.scenario.name,e.scenario.id):Vi(n?.name,e.ref),i=e.kind===`inline`&&Vi(e.scenario.name).length===0,a=e.kind===`referenced`&&Re.has(e.ref),o=e.kind===`referenced`&&Array.isArray(e.mcpServers),s=e.kind===`inline`&&!!j[e.scenario.id];return(0,I.jsxs)(`div`,{className:`rounded-md border text-sm`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>be(t,-1),disabled:t===0,"aria-label":`Move scenario up`,children:(0,I.jsx)(on,{className:`h-3 w-3`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-6 w-6`,onClick:()=>be(t,1),disabled:t===R.length-1,"aria-label":`Move scenario down`,children:(0,I.jsx)(rn,{className:`h-3 w-3`})})]}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[t+1,`.`]}),(0,I.jsx)(`span`,{className:`truncate font-medium`,children:r}),(0,I.jsx)(Y,{variant:e.kind===`inline`?`secondary`:`outline-solid`,children:e.kind===`inline`?`Inline`:`Referenced`}),o&&(0,I.jsx)(Y,{variant:`secondary`,children:`Override`}),i&&(0,I.jsx)(Y,{variant:`destructive`,children:`Name required`}),a&&(0,I.jsx)(Y,{variant:`destructive`,children:`Missing`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.kind===`inline`&&(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`outline`,className:`h-7 w-7`,onClick:()=>M(t=>({...t,[e.scenario.id]:!t[e.scenario.id]})),"aria-label":s?`Collapse scenario details`:`Expand scenario details`,children:(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${s?`rotate-180`:``}`})}),e.kind===`referenced`&&(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>xe(t),disabled:a,children:`Convert to inline`})}),(0,I.jsx)(W,{type:`button`,size:`icon`,variant:`ghost`,className:`h-7 w-7 text-destructive hover:text-destructive`,onClick:()=>ye(t),"aria-label":`Remove scenario entry`,children:(0,I.jsx)(ar,{className:`h-3.5 w-3.5`})})]})]}),e.kind===`inline`&&s&&(0,I.jsx)(`div`,{className:`border-t px-3 py-3`,children:(0,I.jsx)(q4,{scenarios:[e.scenario],scenarioOrigins:[`inline`],agents:[...b.agents,...Oe],servers:Ne,configId:b.id,configPath:b.sourcePath,defaultAssistantAgentName:b.runDefaults?.selectedAgentNames?.[0],onChange:e=>{let n=e[0];if(!n)return;let r=[...R];r[t]={kind:`inline`,scenario:n},z(r)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})}),e.kind===`referenced`&&!a&&(0,I.jsxs)(`div`,{className:`border-t px-3 py-3 space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Optional MCP server override for this referenced scenario.`}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Ve.map(n=>{let r=(e.mcpServers??[]).some(e=>e.kind===`referenced`&&e.ref===n.id);return(0,I.jsx)(W,{type:`button`,size:`sm`,variant:r?`default`:`outline-solid`,className:`h-7 text-xs ${r?``:`opacity-70`}`,onClick:()=>{let r=(e.mcpServers??[]).filter(e=>e.kind===`referenced`).map(e=>e.ref),i=r.includes(n.id)?r.filter(e=>e!==n.id):[...r,n.id];He(t,i)},children:Vi(n.name,n.id)},`${e.ref}-override-server-${n.id}`)})}),o&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 text-xs`,onClick:()=>Ue(t),children:`Reset override`})]})]},`scenario-entry-${t}-${e.kind===`inline`?e.scenario.id:e.ref}`)}),R.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No scenarios configured yet. Add inline scenarios or references.`})]}),Le.length>0&&(0,I.jsxs)(`p`,{className:`text-xs text-destructive`,children:[`Missing scenario refs: `,Le.join(`, `)]})]})}),te?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-4`,children:(0,I.jsx)(q4,{scenarios:je.map(e=>e.scenario),scenarioOrigins:je.map(e=>e.origin),scenarioOverrides:je.map(e=>e.hasMcpServerOverride),agents:Me,servers:Ne,configId:b.id,configPath:b.sourcePath,defaultAssistantAgentName:b.runDefaults?.selectedAgentNames?.[0],testCaseReturnToPath:P,onChange:()=>{},readOnly:!0})})}):null]})]})]})},a3=Symbol(`radix.slottable`);function o3(e){let t=({children:e})=>(0,I.jsx)(I.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=a3,t}var s3=`AlertDialog`,[c3,Ste]=R(s3,[Eh]),l3=Eh(),u3=e=>{let{__scopeAlertDialog:t,...n}=e,r=l3(t);return(0,I.jsx)(ig,{...r,...n,modal:!0})};u3.displayName=s3;var d3=`AlertDialogTrigger`,f3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=l3(n);return(0,I.jsx)(ag,{...i,...r,ref:t})});f3.displayName=d3;var p3=`AlertDialogPortal`,m3=e=>{let{__scopeAlertDialog:t,...n}=e,r=l3(t);return(0,I.jsx)(og,{...r,...n})};m3.displayName=p3;var h3=`AlertDialogOverlay`,g3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=l3(n);return(0,I.jsx)(sg,{...i,...r,ref:t})});g3.displayName=h3;var _3=`AlertDialogContent`,[v3,y3]=c3(_3),b3=o3(`AlertDialogContent`),x3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=l3(n),o=_.useRef(null),s=P(t,o),c=_.useRef(null);return(0,I.jsx)($h,{contentName:_3,titleName:S3,docsSlug:`alert-dialog`,children:(0,I.jsx)(v3,{scope:n,cancelRef:c,children:(0,I.jsxs)(cg,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:j(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,I.jsx)(b3,{children:r}),(0,I.jsx)(A3,{contentRef:o})]})})})});x3.displayName=_3;var S3=`AlertDialogTitle`,C3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=l3(n);return(0,I.jsx)(lg,{...i,...r,ref:t})});C3.displayName=S3;var w3=`AlertDialogDescription`,T3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=l3(n);return(0,I.jsx)(ug,{...i,...r,ref:t})});T3.displayName=w3;var E3=`AlertDialogAction`,D3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=l3(n);return(0,I.jsx)(dg,{...i,...r,ref:t})});D3.displayName=E3;var O3=`AlertDialogCancel`,k3=_.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=y3(O3,n),a=l3(n),o=P(t,i);return(0,I.jsx)(dg,{...a,...r,ref:o})});k3.displayName=O3;var A3=({contentRef:e})=>{let t=`\`${_3}\` requires a description for the component to be accessible for screen reader users.
|
|
128
|
-
|
|
129
|
-
You can add a description to the \`${_3}\` by passing a \`${w3}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
130
|
-
|
|
131
|
-
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 \`${_3}\`. 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.
|
|
132
|
-
|
|
133
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return _.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},j3=u3,M3=m3,N3=g3,P3=x3,F3=D3,I3=k3,L3=C3,R3=T3,z3=j3,B3=M3,V3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(N3,{className:U(`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}));V3.displayName=N3.displayName;var H3=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(B3,{children:[(0,I.jsx)(V3,{}),(0,I.jsx)(P3,{ref:n,className:U(`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})]}));H3.displayName=P3.displayName;var U3=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});U3.displayName=`AlertDialogHeader`;var W3=({className:e,...t})=>(0,I.jsx)(`div`,{className:U(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});W3.displayName=`AlertDialogFooter`;var G3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(L3,{ref:n,className:U(`text-lg font-semibold`,e),...t}));G3.displayName=L3.displayName;var K3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(R3,{ref:n,className:U(`text-sm text-muted-foreground`,e),...t}));K3.displayName=R3.displayName;var q3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(F3,{ref:n,className:U(Mp(),e),...t}));q3.displayName=F3.displayName;var J3=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(I3,{ref:n,className:U(Mp({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));J3.displayName=I3.displayName;var Y3=()=>{let{servers:e,setServers:t,reload:n,loading:r}=Zv(),i=Ud(),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(``),l=s.trim().toLowerCase(),u=e=>e.name?.trim()||e.id,d=async n=>{let r=`${u(n)}-copy`,i=r,a=1;for(;e.some(e=>(e.name?.trim()||e.id)===i);)i=`${r}-${a}`,a+=1;let o={...structuredClone(n),id:`srv-${Date.now()}`,name:i};await t([...e,o]),O({title:`Server duplicated`,description:`Created ${i}.`})},f=async n=>{await t(e.filter(e=>e.id!==n.id)),O({title:`Server deleted`,description:`${u(n)} was removed.`}),o(null)},p=e=>e.transport===`stdio`?[e.command,...e.args||[]].filter(Boolean).join(` `):e.url||``,m=(0,_.useMemo)(()=>[...l.length===0?e:e.filter(e=>[u(e),e.id,e.transport,p(e),e.authType??``].join(` `).toLowerCase().includes(l))].sort((e,t)=>u(e).localeCompare(u(t),void 0,{sensitivity:`base`})),[e,l]);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,className:`h-6 w-6`}),`MCP Servers`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reusable MCP server definitions shared across configurations.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(LY,{value:s,onValueChange:c,placeholder:`Search MCP servers...`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void n(),disabled:r,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>i(`/libraries/servers/new`),children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Add Server`]})]})]}),e.length===0?(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No servers configured. Add one to get started.`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,className:`mt-4`,onClick:()=>i(`/libraries/servers/new`),children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Add Server`]})]}):m.length===0?(0,I.jsx)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center`,children:(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No servers match this filter.`})}):(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(ny,{children:[(0,I.jsx)(ry,{children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{children:`Name`}),(0,I.jsx)(sy,{children:`Transport`}),(0,I.jsx)(sy,{children:`Endpoint`}),(0,I.jsx)(sy,{children:`Auth`}),(0,I.jsx)(sy,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(iy,{children:m.map(e=>(0,I.jsxs)(oy,{className:`cursor-pointer hover:bg-muted/50`,onClick:()=>i(`/libraries/servers/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(J,{className:`font-medium`,children:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,className:`h-4 w-4`}),u(e)]})}),(0,I.jsx)(J,{children:(0,I.jsx)(Y,{variant:`secondary`,className:`font-mono text-xs`,children:e.transport})}),(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:p(e)})}),(0,I.jsx)(J,{children:!e.authType||e.authType===`none`?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`}):(0,I.jsx)(Y,{variant:`outline`,className:`text-xs`,children:e.authType})}),(0,I.jsx)(J,{className:`text-right`,onClick:e=>e.stopPropagation(),children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>o(e),children:[(0,I.jsx)(ar,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void d(e),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>i(`/libraries/servers/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(Gn,{className:`mr-1.5 h-3.5 w-3.5`}),`Edit`]})]})})]},e.id))})]})})}),(0,I.jsx)(z3,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete server?`}),(0,I.jsxs)(K3,{children:[`This will permanently remove`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:a?u(a):``}),` `,`from the library. This action cannot be undone.`]})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{children:`Cancel`}),(0,I.jsx)(q3,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{a&&f(a)},children:`Delete Server`})]})]})})]})};function X3({className:e,disabled:t,...n}){let[r,i]=(0,_.useState)(!1);return(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(Np,{...n,disabled:t,type:r?`text`:`password`,className:[e,`pr-9`].filter(Boolean).join(` `)}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,disabled:t,"aria-label":r?`Hide value`:`Show value`,"aria-pressed":r,title:r?`Hide value`:`Show value`,className:`absolute right-0 top-0 h-full w-9 rounded-l-none`,onClick:()=>i(e=>!e),children:r?(0,I.jsx)(bn,{className:`h-4 w-4`}):(0,I.jsx)(xn,{className:`h-4 w-4`})})]})}var Z3={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`},Q3=()=>({id:`srv-${Date.now()}`,name:``,transport:`stdio`,authType:`none`}),$3=()=>{let{serverId:e}=qd(),t=Ud(),{servers:n,setServers:r}=Zv(),{source:i}=Rv(),a=e===`new`,o=e?decodeURIComponent(e):``,s=a?null:n.find(e=>e.id===o||e.name===o),c=e=>e.name?.trim()||e.id,[l,u]=(0,_.useState)(()=>s??Q3()),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)({status:`idle`}),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)([]),[w,T]=(0,_.useState)(!1),E=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=a?`new:${o||`new`}`:`srv:${o}`;E.current!==e&&(a?(u(Q3()),T(!1),E.current=e):s&&(u(s),T(!1),E.current=e))},[a,o,s]);let D=e=>{T(!1),u(t=>({...t,authType:e,...e!==`bearer`&&e!==`api-key`?{authValue:void 0}:{},...e===`api-key`?{apiKeyHeaderName:t.apiKeyHeaderName||`X-API-Key`}:{apiKeyHeaderName:void 0},...e===`oauth2`?{oauthRedirectUrl:t.oauthRedirectUrl||void 0}:{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0,oauthMode:void 0,oauthAuthorizationUrl:void 0,oauthTokenEndpoint:void 0}}))},k=async()=>{if(y(!0),g({status:`loading`}),C([]),l.authType===`oauth2`)try{x(!0),await x4({serverNames:[l.id],source:i,onServerStatus:e=>{let t=new Date().toLocaleTimeString(),n=typeof e.tokenExpiresInSeconds==`number`?` (valid ${M4(e.tokenExpiresInSeconds,{nonPositiveLabel:`expired`})}; until ${new Date(e.tokenExpiresAt||Date.now()).toLocaleTimeString()})`:``;e.status===`auth_required`?C(n=>[...n,`[${t}] OAuth debug: callback required for '${e.serverName}'`]):e.status===`ready`&&(e.debugState===`refreshed`?C(e=>[...e,`[${t}] OAuth debug: token refreshed (no callback)${n}`]):e.debugState===`reused`?C(e=>[...e,`[${t}] OAuth debug: session/token reused${n}`]):C(e=>[...e,`[${t}] OAuth debug: authorized${n}`]))}})}catch(e){g({status:`error`,message:`OAuth login failed: ${e instanceof Error?e.message:String(e)}`,testedAt:new Date().toISOString()}),x(!1);return}finally{x(!1)}try{let e=(await i.discoverToolsForAnalysis({serverNames:[l.id]})).servers[0];e&&e.warnings.length===0?g({status:`success`,toolNames:e.tools.map(e=>e.name),toolCount:e.tools.length,mcpServerVersion:e.mcpServerVersion,mcpServerImplementation:e.mcpServerImplementation,testedAt:new Date().toISOString()}):g({status:`error`,message:e?.warnings[0]??`Connection failed`,testedAt:new Date().toISOString()})}catch(e){g({status:`error`,message:e instanceof Error?e.message:String(e),testedAt:new Date().toISOString()})}},A=async()=>{if(!l.name.trim()){O({title:`Name is required`,variant:`destructive`});return}let e=e3(l);if(e){O({title:`Validation Error`,description:e,variant:`destructive`});return}let i={...l,authValue:l.authValue?.trim(),apiKeyHeaderName:l.apiKeyHeaderName?.trim()||void 0};m(!0);try{if(a)await r([...n,i]),O({title:`Server created`}),t(`/libraries/servers/${encodeURIComponent(i.id)}`);else{let e=n.map(e=>e.id===s?.id?i:e);await r(e),O({title:`Server saved`}),i.id!==o&&t(`/libraries/servers/${encodeURIComponent(i.id)}`,{replace:!0})}}finally{m(!1)}},j=async()=>{let e=n.filter(e=>e.id!==s?.id);await r(e),O({title:`Server deleted`}),t(`/libraries/servers`)},M=()=>l.transport===`stdio`?[l.command,...l.args||[]].filter(Boolean).join(` `):l.url||``;return!a&&!s?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(sp,{to:`/libraries/servers`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Servers`]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Server "`,o,`" not found.`]})]}):(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(sp,{to:`/libraries/servers`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Servers`]}),(0,I.jsxs)(`h1`,{className:`flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(`img`,{src:`/mcp.svg`,alt:``,"aria-hidden":`true`,className:`h-6 w-6`}),a?`New Server`:c(l)]})]}),!a&&(0,I.jsxs)(W,{type:`button`,onClick:()=>void k(),disabled:h.status===`loading`||b,children:[(0,I.jsx)(lr,{className:`mr-2 h-4 w-4`}),`Test Connection`]})]}),v&&(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`flex-row items-center justify-between space-y-0`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Connection Test`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>y(!1),className:`rounded-sm opacity-70 hover:opacity-100`,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:`Server:`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:c(l)}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsx)(`span`,{children:`Transport:`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:l.transport}),M()&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsx)(`span`,{children:`Endpoint:`}),(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:M()})]})]}),h.status===`loading`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),b?`Waiting for OAuth login in browser…`:`Connecting to MCP server…`]}),S.length>0&&(0,I.jsx)(`div`,{className:`space-y-0.5`,children:S.map((e,t)=>(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},t))})]}),h.status===`success`&&(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-emerald-700`,children:[(0,I.jsx)(nn,{className:`h-4 w-4 shrink-0`}),`Connected — discovered `,h.toolCount,` tool`,h.toolCount===1?``:`s`]}),h.toolNames.length>0&&(0,I.jsxs)(`div`,{className:`rounded-md bg-muted p-3`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`First 5 tools:`}),(0,I.jsx)(`ul`,{className:`space-y-0.5`,children:h.toolNames.slice(0,5).map(e=>(0,I.jsx)(`li`,{className:`font-mono text-xs`,children:e},e))})]}),(h.mcpServerImplementation||h.mcpServerVersion)&&(0,I.jsx)(`div`,{className:`rounded-md border bg-muted/40 p-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[h.mcpServerImplementation?.icons?.[0]?.src?(0,I.jsx)(`img`,{src:h.mcpServerImplementation.icons[0].src,alt:h.mcpServerImplementation.title||h.mcpServerImplementation.name,className:`h-7 w-7 rounded-sm border bg-background object-contain`}):null,(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`MCP server`}),(0,I.jsx)(`p`,{className:`truncate text-sm`,children:h.mcpServerImplementation?h.mcpServerImplementation.title||h.mcpServerImplementation.name:`Unknown MCP server`}),h.mcpServerVersion?(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Version:`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:h.mcpServerVersion})]}):null,h.mcpServerImplementation?.description?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h.mcpServerImplementation.description}):null]})]})}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(h.testedAt).toLocaleString()]}),S.length>0&&(0,I.jsx)(`div`,{className:`space-y-0.5`,children:S.map((e,t)=>(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e},t))})]}),h.status===`error`&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:`✗ Connection failed`}),` — `,h.message]}),Z3[l.transport]&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`,children:[`Hint: `,Z3[l.transport]]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(h.testedAt).toLocaleString()]})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{children:(0,I.jsx)($v,{className:`text-base`,children:`Configuration`})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Name`}),(0,I.jsx)(Np,{value:l.name,onChange:e=>u(t=>({...t,name:e.target.value})),placeholder:`e.g. Filesystem MCP`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Transport`}),(0,I.jsxs)(E1,{value:l.transport,onValueChange:e=>u(t=>({...t,transport:e})),children:[(0,I.jsx)(O1,{children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`stdio`,children:`stdio`}),(0,I.jsx)(Q,{value:`sse`,children:`SSE`}),(0,I.jsx)(Q,{value:`streamable-http`,children:`Streamable HTTP`})]})]})]})]}),l.transport===`stdio`?(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Command`}),(0,I.jsx)(Np,{value:l.command||``,onChange:e=>u(t=>({...t,command:e.target.value})),placeholder:`npx`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Args (comma-separated)`}),(0,I.jsx)(Np,{value:(l.args||[]).join(`, `),onChange:e=>u(t=>({...t,args:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})),placeholder:`-y, @mcp/server`,className:`font-mono text-xs`})]})]}):(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`URL`}),(0,I.jsx)(Np,{value:l.url||``,onChange:e=>u(t=>({...t,url:e.target.value})),placeholder:`http://localhost:3001/sse`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Auth Type`}),(0,I.jsxs)(E1,{value:l.authType||`none`,onValueChange:e=>D(e),children:[(0,I.jsx)(O1,{children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`none`,children:`None`}),(0,I.jsx)(Q,{value:`bearer`,children:`Bearer Token`}),(0,I.jsx)(Q,{value:`api-key`,children:`API Key`}),(0,I.jsx)(Q,{value:`oauth2`,children:`OAuth 2.0`})]})]})]}),l.authType===`bearer`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Token`}),(0,I.jsx)(Np,{value:l.authValue||``,onChange:e=>u(t=>({...t,authValue:e.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:`font-mono text-xs`})]})]}),l.authType===`bearer`&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground -mt-1`,children:[`Use `,(0,I.jsx)(`code`,{className:`rounded bg-muted px-1`,children:"${VAR_NAME}"}),` to reference an environment variable, or enter a token directly.`]}),l.authType===`api-key`&&(0,I.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`API Key`}),(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Header Name`}),(0,I.jsx)(Np,{value:l.apiKeyHeaderName||`X-API-Key`,onChange:e=>u(t=>({...t,apiKeyHeaderName:e.target.value})),placeholder:`X-API-Key`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Value`}),(0,I.jsx)(X3,{value:l.authValue||``,onChange:e=>u(t=>({...t,authValue:e.target.value})),placeholder:"${MY_API_KEY}",className:`font-mono text-xs`})]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Use `,(0,I.jsx)(`code`,{className:`rounded bg-muted px-1`,children:"${VAR_NAME}"}),` to reference an environment variable, or enter a value directly.`]})]}),l.authType===`oauth2`&&(0,I.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`OAuth 2.0 Flow`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:!l.oauthMode||l.oauthMode===`pre_registered`?`default`:`outline-solid`,size:`sm`,onClick:()=>u(e=>({...e,oauthMode:`pre_registered`})),children:`Pre-registered`}),(0,I.jsx)(W,{type:`button`,variant:l.oauthMode===`dcr`?`default`:`outline-solid`,size:`sm`,onClick:()=>u(e=>({...e,oauthMode:`dcr`,oauthClientId:void 0,oauthClientSecret:void 0})),children:`DCR (Dynamic)`})]}),(!l.oauthMode||l.oauthMode===`pre_registered`)&&(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Client ID`}),(0,I.jsx)(Np,{value:l.oauthClientId||``,onChange:e=>u(t=>({...t,oauthClientId:e.target.value})),placeholder:`your-client-id`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Client Secret (optional)`}),(0,I.jsx)(X3,{value:l.oauthClientSecret||``,onChange:e=>u(t=>({...t,oauthClientSecret:e.target.value})),placeholder:`••••••••`,className:`font-mono text-xs`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Scope (optional, space-separated)`}),(0,I.jsx)(Np,{value:l.oauthScope||``,onChange:e=>u(t=>({...t,oauthScope:e.target.value})),placeholder:`openid profile mcp`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>T(e=>!e),children:[(0,I.jsx)(`span`,{children:w?`▾`:`▸`}),`Advanced — manual endpoint overrides`]}),w&&(0,I.jsxs)(`div`,{className:`mt-2 grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Authorization URL`}),(0,I.jsx)(Np,{value:l.oauthAuthorizationUrl||``,onChange:e=>u(t=>({...t,oauthAuthorizationUrl:e.target.value||void 0})),placeholder:`leave blank to use .well-known discovery`,className:`font-mono text-xs`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Token URL`}),(0,I.jsx)(Np,{value:l.oauthTokenEndpoint||``,onChange:e=>u(t=>({...t,oauthTokenEndpoint:e.target.value||void 0})),placeholder:`leave blank to use .well-known discovery`,className:`font-mono text-xs`})]})]})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between pt-2`,children:[(0,I.jsx)(`div`,{children:!a&&(0,I.jsx)(W,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>f(!0),children:`Delete`})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>t(`/libraries/servers`),children:`Cancel`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void A(),disabled:p,children:[p&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),a?`Create Server`:`Save`]})]})]})]})]}),(0,I.jsx)(z3,{open:d,onOpenChange:f,children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete server?`}),(0,I.jsxs)(K3,{children:[`This will permanently remove the server `,(0,I.jsx)(`span`,{className:`font-mono`,children:l.name}),`. This action cannot be undone.`]})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{children:`Cancel`}),(0,I.jsx)(q3,{onClick:()=>void j(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`Delete`})]})]})})]})},e6=({defaultType:e=`llm`})=>{let{agents:t,setAgents:n,reload:r,loading:i}=Zv(),a=Ud(),[o]=pp(),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(``),d=o.get(`type`)===`browser`?`browser`:e,[f,p]=(0,_.useState)(d),m=l.trim().toLowerCase();(0,_.useEffect)(()=>{p(d)},[d]);let h=e=>{let t=e;p(t),a(`/libraries/agents?type=${t}`)},g=(0,_.useMemo)(()=>({llm:t.filter(e=>(e.type??`llm`)===`llm`).length,browser:t.filter(e=>e.type===`browser`).length}),[t]),v=(0,_.useMemo)(()=>t.filter(e=>(e.type??`llm`)===f?m.length===0||[e.name,e.provider,e.model,e.type===`browser`?e.url:void 0].filter(Boolean).join(` `).toLowerCase().includes(m):!1),[t,m,f]),y=async e=>{let r=`${e.name}-copy`,i=r,a=1;for(;t.some(e=>e.name===i);)i=`${r}-${a}`,a+=1;let o={...structuredClone(e),id:`agt-${Date.now()}`,name:i};await n([...t,o]),O({title:`Agent duplicated`,description:`Created ${i}.`})},b=async e=>{await n(t.filter(t=>t.id!==e.id)),O({title:`Agent deleted`,description:`${e.name} was removed.`}),c(null)};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)($t,{className:`h-6 w-6`}),`Agents`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reusable agent profiles shared across configurations.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(LY,{value:l,onValueChange:u,placeholder:`Search agents...`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void r(),disabled:i,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>a(`/libraries/agents/new?type=${f}`),children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Add Agent`]})]})]}),t.length===0?(0,I.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No agents configured. Add one to get started.`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,className:`mt-4`,onClick:()=>a(`/libraries/agents/new?type=${f}`),children:[(0,I.jsx)(qn,{className:`mr-2 h-4 w-4`}),`Add Agent`]})]}):(0,I.jsxs)(x0,{value:f,onValueChange:h,className:`space-y-4`,children:[(0,I.jsxs)(S0,{className:`grid w-full max-w-md grid-cols-2`,"aria-label":`Agent type`,children:[(0,I.jsxs)(C0,{value:`llm`,children:[`LLM (`,g.llm,`)`]}),(0,I.jsxs)(C0,{value:`browser`,children:[`Browser (`,g.browser,`)`]})]}),v.length===0?(0,I.jsx)(`div`,{className:`flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center`,children:(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No agents match this filter.`})}):(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(ny,{children:[(0,I.jsx)(ry,{children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{children:`Name`}),(0,I.jsx)(sy,{children:`Provider`}),f===`browser`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(sy,{children:`URL`}),(0,I.jsx)(sy,{children:`Conversation`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(sy,{children:`Model`}),(0,I.jsx)(sy,{children:`Max Tokens`}),(0,I.jsx)(sy,{children:`Temperature`})]}),(0,I.jsx)(sy,{className:`text-right`,children:`Actions`})]})}),(0,I.jsx)(iy,{children:v.map(e=>(0,I.jsxs)(oy,{className:`cursor-pointer hover:bg-muted/50`,onClick:()=>a(`/libraries/agents/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(J,{className:`font-medium`,children:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-2`,title:e.type===`browser`?`Browser agent`:`LLM agent`,children:[e.type===`browser`?(0,I.jsx)(_n,{className:`h-4 w-4 text-sky-600`,"aria-hidden":`true`}):(0,I.jsx)($t,{className:`h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),e.name]})}),(0,I.jsx)(J,{children:(0,I.jsx)(O0,{provider:e.provider})}),e.type===`browser`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`max-w-xs truncate font-mono text-xs`,title:e.url,children:e.url||`Not configured`})}),(0,I.jsx)(J,{className:`text-xs`,children:e.newConversationBetweenScenarios===!1?`Continue same conversation`:`New conversation per scenario`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:e.model})}),(0,I.jsx)(J,{className:`font-mono text-xs`,children:e.maxTokens}),(0,I.jsx)(J,{className:`font-mono text-xs`,children:t3(e.temperature).toFixed(2)})]}),(0,I.jsx)(J,{className:`text-right`,onClick:e=>e.stopPropagation(),children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>c(e),children:[(0,I.jsx)(ar,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void y(e),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>a(`/libraries/agents/${encodeURIComponent(e.id)}`),children:[(0,I.jsx)(Gn,{className:`mr-1.5 h-3.5 w-3.5`}),`Edit`]})]})})]},e.id))})]})})})]}),(0,I.jsx)(z3,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete agent?`}),(0,I.jsxs)(K3,{children:[`This will permanently remove `,(0,I.jsx)(`span`,{className:`font-mono`,children:s?.name}),` `,`from the library. This action cannot be undone.`]})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{children:`Cancel`}),(0,I.jsx)(q3,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{s&&b(s)},children:`Delete Agent`})]})]})})]})},t6=[`PageUp`,`PageDown`],n6=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],r6={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},i6=`Slider`,[a6,o6,s6]=ae(i6),[c6,Cte]=R(i6,[s6]),[l6,u6]=c6(i6),d6=_.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...h}=e,g=_.useRef(new Set),v=_.useRef(0),y=o===`horizontal`?m6:h6,[b=[],x]=Re({prop:u,defaultProp:l,onChange:e=>{[...g.current][v.current]?.focus(),d(e)}}),S=_.useRef(b);function C(e){E(e,k6(b,e))}function w(e){E(e,v.current)}function T(){let e=S.current[v.current];b[v.current]!==e&&f(b)}function E(e,t,{commit:n}={commit:!1}){let o=P6(a),s=qQ(F6(Math.round((e-r)/a)*a+r,o),[r,i]);x((e=[])=>{let r=E6(e,s,t);if(M6(r,c*a)){v.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e})}return(0,I.jsx)(l6,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:v,thumbs:g.current,values:b,orientation:o,form:m,children:(0,I.jsx)(a6.Provider,{scope:e.__scopeSlider,children:(0,I.jsx)(a6.Slot,{scope:e.__scopeSlider,children:(0,I.jsx)(y,{"aria-disabled":s,"data-disabled":s?``:void 0,...h,ref:t,onPointerDown:j(h.onPointerDown,()=>{s||(S.current=b)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:C,onSlideMove:s?void 0:w,onSlideEnd:s?void 0:T,onHomeKeyDown:()=>!s&&E(r,0,{commit:!0}),onEndKeyDown:()=>!s&&E(i,b.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){let n=t6.includes(e.key)||e.shiftKey&&n6.includes(e.key)?10:1,r=v.current,i=b[r];E(i+a*n*t,r,{commit:!0})}}})})})})});d6.displayName=i6;var[f6,p6]=c6(i6,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),m6=_.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=_.useState(null),p=P(t,e=>f(e)),m=_.useRef(void 0),h=zY(i),g=h===`ltr`,v=g&&!a||!g&&a;function y(e){let t=m.current||d.getBoundingClientRect(),i=N6([0,t.width],v?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return(0,I.jsx)(f6,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:(0,I.jsx)(g6,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=y(e.clientX);o?.(t)},onSlideMove:e=>{let t=y(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=r6[v?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),h6=_.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=_.useRef(null),d=P(t,u),f=_.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=N6([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return(0,I.jsx)(f6,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,I.jsx)(g6,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=r6[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),g6=_.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=u6(i6,n);return(0,I.jsx)(H.span,{...l,ref:t,onKeyDown:j(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):t6.concat(n6).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:j(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:j(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:j(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),_6=`SliderTrack`,v6=_.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=u6(_6,n);return(0,I.jsx)(H.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});v6.displayName=_6;var y6=`SliderRange`,b6=_.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=u6(y6,n),a=p6(y6,n),o=P(t,_.useRef(null)),s=i.values.length,c=i.values.map(e=>D6(e,i.min,i.max)),l=s>1?Math.min(...c):0,u=100-Math.max(...c);return(0,I.jsx)(H.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:u+`%`}})});b6.displayName=y6;var x6=`SliderThumb`,S6=_.forwardRef((e,t)=>{let n=o6(e.__scopeSlider),[r,i]=_.useState(null),a=P(t,e=>i(e)),o=_.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,I.jsx)(C6,{...e,ref:a,index:o})}),C6=_.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=u6(x6,n),s=p6(x6,n),[c,l]=_.useState(null),u=P(t,e=>l(e)),d=!c||o.form||!!c.closest(`form`),f=nc(c),p=o.values[r],m=p===void 0?0:D6(p,o.min,o.max),h=O6(r,o.values.length),g=f?.[s.size],v=g?A6(g,m,s.direction):0;return _.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,I.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${m}% + ${v}px)`},children:[(0,I.jsx)(a6.ItemSlot,{scope:e.__scopeSlider,children:(0,I.jsx)(H.span,{role:`slider`,"aria-label":e[`aria-label`]||h,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,tabIndex:o.disabled?void 0:0,...a,ref:u,style:p===void 0?{display:`none`}:e.style,onFocus:j(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&(0,I.jsx)(T6,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:p},r)]})});S6.displayName=x6;var w6=`RadioBubbleInput`,T6=_.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=_.useRef(null),a=P(i,r),o=e$(t);return _.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`input`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,I.jsx)(H.input,{style:{display:`none`},...n,ref:a,defaultValue:t})});T6.displayName=w6;function E6(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function D6(e,t,n){return qQ(100/(n-t)*(e-t),[0,100])}function O6(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function k6(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function A6(e,t,n){let r=e/2;return(r-N6([0,50],[0,r])(t)*n)*n}function j6(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function M6(e,t){if(t>0){let n=j6(e);return Math.min(...n)>=t}return!0}function N6(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function P6(e){return(String(e).split(`.`)[1]||``).length}function F6(e,t){let n=10**t;return Math.round(e*n)/n}var I6=d6,L6=v6,R6=b6,z6=S6,B6=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(I6,{ref:n,className:U(`relative flex w-full touch-none select-none items-center`,e),...t,children:[(0,I.jsx)(L6,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,I.jsx)(R6,{className:`absolute h-full bg-primary`})}),(0,I.jsx)(z6,{className:`block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`})]}));B6.displayName=I6.displayName;function V6(e){let t=H6(e),n=_.forwardRef((e,n)=>{let{children:r,...i}=e,a=_.Children.toArray(r),o=a.find(W6);if(o){let e=o.props.children,r=a.map(t=>t===o?_.Children.count(e)>1?_.Children.only(null):_.isValidElement(e)?e.props.children:null:t);return(0,I.jsx)(t,{...i,ref:n,children:_.isValidElement(e)?_.cloneElement(e,void 0,r):null})}return(0,I.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function H6(e){let t=_.forwardRef((e,t)=>{let{children:n,...r}=e;if(_.isValidElement(n)){let e=K6(n),i=G6(r,n.props);return n.type!==_.Fragment&&(i.ref=t?N(t,e):e),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var U6=Symbol(`radix.slottable`);function W6(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===U6}function G6(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function K6(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 q6=`Popover`,[J6,wte]=R(q6,[ac]),Y6=ac(),[X6,Z6]=J6(q6),Q6=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Y6(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=Re({prop:r,defaultProp:i??!1,onChange:a,caller:q6});return(0,I.jsx)(xc,{...s,children:(0,I.jsx)(X6,{scope:t,contentId:Pa(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o,children:n})})};Q6.displayName=q6;var $6=`PopoverAnchor`,e8=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Z6($6,n),a=Y6(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(o(),()=>s()),[o,s]),(0,I.jsx)(Sc,{...a,...r,ref:t})});e8.displayName=$6;var t8=`PopoverTrigger`,n8=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Z6(t8,n),a=Y6(n),o=P(t,i.triggerRef),s=(0,I.jsx)(H.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":_8(i.open),...r,ref:o,onClick:j(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(Sc,{asChild:!0,...a,children:s})});n8.displayName=t8;var r8=`PopoverPortal`,[i8,a8]=J6(r8,{forceMount:void 0}),o8=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Z6(r8,t);return(0,I.jsx)(i8,{scope:t,forceMount:n,children:(0,I.jsx)(Ne,{present:n||a.open,children:(0,I.jsx)(je,{asChild:!0,container:i,children:r})})})};o8.displayName=r8;var s8=`PopoverContent`,c8=_.forwardRef((e,t)=>{let n=a8(s8,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Z6(s8,e.__scopePopover);return(0,I.jsx)(Ne,{present:r||a.open,children:a.modal?(0,I.jsx)(u8,{...i,ref:t}):(0,I.jsx)(d8,{...i,ref:t})})});c8.displayName=s8;var l8=V6(`PopoverContent.RemoveScroll`),u8=_.forwardRef((e,t)=>{let n=Z6(s8,e.__scopePopover),r=_.useRef(null),i=P(t,r),a=_.useRef(!1);return _.useEffect(()=>{let e=r.current;if(e)return _h(e)},[]),(0,I.jsx)(ch,{as:l8,allowPinchZoom:!0,children:(0,I.jsx)(f8,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:j(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),d8=_.forwardRef((e,t)=>{let n=Z6(s8,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return(0,I.jsx)(f8,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),f8=_.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=Z6(s8,n),p=Y6(n);return nm(),(0,I.jsx)(Kp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(be,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,I.jsx)(Cc,{"data-state":_8(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.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)`}})})})}),p8=`PopoverClose`,m8=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Z6(p8,n);return(0,I.jsx)(H.button,{type:`button`,...r,ref:t,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});m8.displayName=p8;var h8=`PopoverArrow`,g8=_.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Y6(n);return(0,I.jsx)(wc,{...i,...r,ref:t})});g8.displayName=h8;function _8(e){return e?`open`:`closed`}var v8=Q6,y8=n8,b8=o8,x8=c8,S8=v8,C8=y8,w8=_.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,I.jsx)(b8,{children:(0,I.jsx)(x8,{ref:i,align:t,sideOffset:n,className:U(`z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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})}));w8.displayName=x8.displayName;var T8=1,E8=.9,D8=.8,O8=.17,k8=.1,A8=.999,j8=.9999,M8=.99,N8=/[\\\/_+.#"@\[\(\{&]/,P8=/[\\\/_+.#"@\[\(\{&]/g,F8=/[\s-]/,I8=/[\s-]/g;function L8(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?T8:M8;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=L8(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=T8:N8.test(e.charAt(l-1))?(d*=D8,p=e.slice(i,l-1).match(P8),p&&i>0&&(d*=A8**+p.length)):F8.test(e.charAt(l-1))?(d*=E8,m=e.slice(i,l-1).match(I8),m&&i>0&&(d*=A8**+m.length)):(d*=O8,i>0&&(d*=A8**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=j8)),(d<k8&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=L8(e,t,n,r,l+1,a+2,o),f*k8>d&&(d=f*k8)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function R8(e){return e.toLowerCase().replace(I8,` `)}function z8(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,L8(e,t,R8(e),R8(t),0,0,{})}var B8=`[cmdk-group=""]`,V8=`[cmdk-group-items=""]`,H8=`[cmdk-group-heading=""]`,U8=`[cmdk-item=""]`,W8=`${U8}:not([aria-disabled="true"])`,G8=`cmdk-item-select`,K8=`data-value`,q8=(e,t,n)=>z8(e,t,n),J8=_.createContext(void 0),Y8=()=>_.useContext(J8),X8=_.createContext(void 0),Z8=()=>_.useContext(X8),Q8=_.createContext(void 0),$8=_.forwardRef((e,t)=>{let n=p5(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=p5(()=>new Set),i=p5(()=>new Map),a=p5(()=>new Map),o=p5(()=>new Set),s=d5(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...v}=e,y=Pa(),b=Pa(),x=Pa(),S=_.useRef(null),C=g5();f5(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),f5(()=>{C(6,A)},[]);let w=_.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=_.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??q8;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(V8);t?t.appendChild(e.parentElement===t?e:e.closest(`${V8} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${V8} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${B8}[${K8}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(K8);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(B8)?.querySelector(H8))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${U8}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(W8)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(K8))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(K8))}function F(e){let t=j()?.closest(B8),n;for(;t&&!n;)t=e>0?l5(t,B8):u5(t,B8),n=t?.querySelector(W8);n?w.setState(`value`,n.getAttribute(K8)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return _.createElement(H.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:g&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(G8);t.dispatchEvent(e)}}}}},_.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:y5},c),v5(e,e=>_.createElement(X8.Provider,{value:w},_.createElement(J8.Provider,{value:T},e))))}),e5=_.forwardRef((e,t)=>{let n=Pa(),r=_.useRef(null),i=_.useContext(Q8),a=Y8(),o=d5(e),s=o.current?.forceMount??i?.forceMount;f5(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=h5(n,r,[e.value,e.children,r],e.keywords),l=Z8(),u=m5(e=>e.value&&e.value===c.current),d=m5(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);_.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(G8,f),()=>t.removeEventListener(G8,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:v,keywords:y,...b}=e;return _.createElement(H.div,{ref:N(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),t5=_.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Pa(),s=_.useRef(null),c=_.useRef(null),l=Pa(),u=Y8(),d=m5(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));f5(()=>u.group(o),[]),h5(o,s,[e.value,e.heading,c]);let f=_.useMemo(()=>({id:o,forceMount:i}),[i]);return _.createElement(H.div,{ref:N(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&_.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),v5(e,e=>_.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},_.createElement(Q8.Provider,{value:f},e))))}),n5=_.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=_.useRef(null),a=m5(e=>!e.search);return!n&&!a?null:_.createElement(H.div,{ref:N(i,t),...r,"cmdk-separator":``,role:`separator`})}),r5=_.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=Z8(),o=m5(e=>e.search),s=m5(e=>e.selectedItemId),c=Y8();return _.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),_.createElement(H.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),i5=_.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=_.useRef(null),o=_.useRef(null),s=m5(e=>e.selectedItemId),c=Y8();return _.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),_.createElement(H.div,{ref:N(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},v5(e,e=>_.createElement(`div`,{ref:N(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),a5=_.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return _.createElement(ig,{open:n,onOpenChange:r},_.createElement(og,{container:o},_.createElement(sg,{"cmdk-overlay":``,className:i}),_.createElement(cg,{"aria-label":e.label,"cmdk-dialog":``,className:a},_.createElement($8,{ref:t,...s}))))}),o5=_.forwardRef((e,t)=>m5(e=>e.filtered.count===0)?_.createElement(H.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),s5=_.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return _.createElement(H.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},v5(e,e=>_.createElement(`div`,{"aria-hidden":!0},e)))}),c5=Object.assign($8,{List:i5,Item:e5,Input:r5,Group:t5,Separator:n5,Dialog:a5,Empty:o5,Loading:s5});function l5(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function u5(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function d5(e){let t=_.useRef(e);return f5(()=>{t.current=e}),t}var f5=typeof window>`u`?_.useEffect:_.useLayoutEffect;function p5(e){let t=_.useRef();return t.current===void 0&&(t.current=e()),t}function m5(e){let t=Z8(),n=()=>e(t.snapshot());return _.useSyncExternalStore(t.subscribe,n,n)}function h5(e,t,n,r=[]){let i=_.useRef(),a=Y8();return f5(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(K8,s),i.current=s}),i}var g5=()=>{let[e,t]=_.useState(),n=p5(()=>new Map);return f5(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function _5(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function v5({asChild:e,children:t},n){return e&&_.isValidElement(t)?_.cloneElement(_5(t),{ref:t.ref},n(t.props.children)):n(t)}var y5={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},b5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(c5,{ref:n,className:U(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));b5.displayName=c5.displayName;var x5=_.forwardRef(({className:e,...t},n)=>(0,I.jsxs)(`div`,{className:`flex items-center border-b px-3`,"data-cmdk-input-wrapper":``,children:[(0,I.jsx)(Zn,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,I.jsx)(c5.Input,{ref:n,className:U(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));x5.displayName=c5.Input.displayName;var S5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(c5.List,{ref:n,className:U(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));S5.displayName=c5.List.displayName;var C5=_.forwardRef((e,t)=>(0,I.jsx)(c5.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));C5.displayName=c5.Empty.displayName;var w5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(c5.Group,{ref:n,className:U(`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}));w5.displayName=c5.Group.displayName;var T5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(c5.Separator,{ref:n,className:U(`-mx-1 h-px bg-border`,e),...t}));T5.displayName=c5.Separator.displayName;var E5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(c5.Item,{ref:n,className:U(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50`,e),...t}));E5.displayName=c5.Item.displayName;function D5(){let{source:e}=Rv(),[t,n]=(0,_.useState)({connected:!1});return(0,_.useEffect)(()=>{let t=!1,r=0,i=()=>{if(typeof e.getRoverStatus!=`function`)return;let i=++r;e.getRoverStatus().then(e=>{!t&&i===r&&n({connected:e.connected,provider:e.provider,pageUrl:e.pageUrl,activeJobId:e.activeJobId})}).catch(()=>{!t&&i===r&&n({connected:!1})})};i();let a=window.setInterval(i,3e3);return()=>{t=!0,window.clearInterval(a)}},[e]),t}var O5={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`],azure_foundry:[],google:[`gemini-2.0-flash`,`gemini-1.5-pro`],custom:[]},k5={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`,azure_foundry:`Set AZURE_FOUNDRY_ENDPOINT and AZURE_FOUNDRY_API_KEY, or reuse AZURE_OPENAI_API_KEY for the same resource.`},A5=()=>{let{agentName:e}=qd(),[t]=pp(),n=Ud(),{agents:r,setAgents:i,browserProviders:a}=Zv(),{source:o}=Rv(),s=D5(),c=e===`new`,l=e?decodeURIComponent(e):``,u=c?null:r.find(e=>e.id===l)??r.find(e=>e.name===l),d=t.get(`type`)===`browser`?`browser`:`llm`,[f,p]=(0,_.useState)(()=>u??n3(d)),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)({status:`idle`}),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(null),[T,E]=(0,_.useState)(!1),[D,k]=(0,_.useState)(!1),[A,j]=(0,_.useState)(!1),M=(0,_.useRef)(null),N=(0,_.useRef)({revision:0}),P=(0,_.useRef)(null),F=Object.values(a).map(e=>({id:e.id,name:e.name}));(0,_.useEffect)(()=>{let e=c?`new:${d}:${l||`new`}`:`agt:${l}`;P.current!==e&&(c?(p(n3(d)),P.current=e):u&&(p(u),P.current=e))},[c,l,u,d]),(0,_.useEffect)(()=>(M.current?.abort(),M.current=null,b({status:`idle`}),S(!1),()=>M.current?.abort()),[f]),(0,_.useEffect)(()=>{let e=N.current;return e.revision++,w(null),E(!1),()=>{e.revision++}},[f.provider]);let L=f.provider===`azure`||f.provider===`azure_foundry`,R=f.provider===`anthropic`||f.provider===`openai`||L,z=Array.from(new Set([...O5[f.provider]||[],...C??[]])),B=z.includes(f.model),ee=L||A||!!f.model&&!B,te=async()=>{if(S(!0),f.type===`browser`){b({status:`unsupported`}),O({title:`Browser Agent connection is handled by Rover`,description:`Open Rover and connect the configured browser provider.`});return}if(f.provider===`google`||f.provider===`custom`){b({status:`unsupported`});return}let e=new AbortController;M.current?.abort(),M.current=e,b({status:`loading`});try{let t=await o.testAgentConnection(f,e.signal);if(e.signal.aborted)return;b(t.ok?{status:`success`,result:t,testedAt:new Date().toISOString()}:{status:`error`,message:t.message,testedAt:new Date().toISOString()})}catch(t){e.signal.aborted||b({status:`error`,message:t instanceof Error?t.message:String(t),testedAt:new Date().toISOString()})}finally{M.current===e&&(M.current=null)}},ne=async()=>{if(!R){O({title:`Provider discovery not supported`,description:`Model lists are available for Anthropic and OpenAI. Azure deployments use configured suggestions.`});return}let e=N.current,t=++e.revision;E(!0);try{let n=await o.listProviderModels(f.provider);if(t!==e.revision)return;w(n.items),O({title:n.kind===`deployments`?`Deployments loaded`:`Models loaded`,description:`${n.items.length} ${n.kind} from ${n.source}`})}catch(n){if(t!==e.revision)return;O({title:`Could not load provider models`,description:String(n instanceof Error?n.message:n),variant:`destructive`})}finally{t===e.revision&&E(!1)}},re=async()=>{if(!f.name.trim())O({title:`Name is required`,variant:`destructive`});else if(f.type!==`browser`&&!f.model.trim())O({title:L?`Deployment name is required`:`Model is required`,variant:`destructive`});else if(f.type===`browser`&&!f.url?.trim())O({title:`Browser agent URL is required`,variant:`destructive`});else{v(!0);try{if(c)await i([...r,f]),O({title:`Agent created`}),n(`/libraries/agents/${encodeURIComponent(f.id)}`);else{let e=r.map(e=>e.id===u?.id?f:e);await i(e),O({title:`Agent saved`}),f.id!==l&&n(`/libraries/agents/${encodeURIComponent(f.id)}`,{replace:!0})}}finally{v(!1)}}},ie=async()=>{let e=r.filter(e=>e.id!==u?.id);await i(e),O({title:`Agent deleted`}),n(`/libraries/agents`)};if(!c&&!u)return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(sp,{to:`/libraries/agents`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Agents`]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Agent "`,l,`" not found.`]})]});let ae=s.connected&&s.provider===f.provider;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(sp,{to:`/libraries/agents`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,I.jsx)(Qt,{className:`h-4 w-4`}),` Agents`]}),(0,I.jsxs)(`h1`,{className:`flex items-center gap-2 text-2xl font-bold`,children:[f.type===`browser`?(0,I.jsx)(_n,{className:`h-6 w-6 text-sky-600`,"aria-hidden":`true`}):(0,I.jsx)($t,{className:`h-6 w-6 text-muted-foreground`,"aria-hidden":`true`}),c?`New Agent`:f.name]})]}),f.type===`browser`?(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[ae&&s.pageUrl?(0,I.jsx)(`a`,{href:s.pageUrl,target:`_blank`,rel:`noreferrer`,className:`max-w-xs rounded-md border px-3 py-2 text-xs text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Open ${s.pageUrl}`,children:(0,I.jsx)(`span`,{className:`block truncate`,children:s.pageUrl})}):null,(0,I.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,I.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full ${ae?`bg-emerald-500`:`bg-muted-foreground/40`}`}),(0,I.jsx)(`span`,{children:ae?`Rover connected`:`Rover not connected`})]})]}):(0,I.jsxs)(W,{type:`button`,onClick:()=>void te(),disabled:y.status===`loading`,children:[(0,I.jsx)(lr,{className:`mr-2 h-4 w-4`}),`Test Connection`]})]}),f.type!==`browser`&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Test Connection sends a small inference request to the configured model or deployment using backend credentials. It does not save the agent.`}),x&&(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`flex-row items-center justify-between space-y-0`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Connection Test`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{M.current?.abort(),b({status:`idle`}),S(!1)},"aria-label":`Close connection test`,className:`rounded-sm opacity-70 hover:opacity-100`,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:`Provider:`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:E0(f.provider)}),(0,I.jsx)(`span`,{children:`·`}),(0,I.jsxs)(`span`,{children:[L?`Deployment`:`Model`,`:`]}),(0,I.jsx)(`code`,{className:`font-mono text-xs`,children:f.model})]}),y.status===`loading`&&(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),`Testing connection...`]}),y.status===`success`&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-emerald-700`,children:[(0,I.jsx)(nn,{className:`h-4 w-4 shrink-0`}),y.result.message]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[y.result.model&&(0,I.jsxs)(I.Fragment,{children:[`Returned model: `,y.result.model,` · `]}),y.result.durationMs,` ms · Tested at`,` `,new Date(y.testedAt).toLocaleString()]})]}),y.status===`error`&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:`✗ Connection failed`}),`. `,y.message]}),k5[f.provider]&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`,children:[`Hint: `,k5[f.provider]]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Tested at `,new Date(y.testedAt).toLocaleString()]})]}),y.status===`unsupported`&&(0,I.jsxs)(`p`,{className:`rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground`,children:[`Connection testing is not supported for the`,` `,(0,I.jsx)(`span`,{className:`font-medium`,children:f.provider}),` provider. Supported providers: Anthropic, OpenAI, Azure OpenAI, Azure Foundry.`]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{children:(0,I.jsx)($v,{className:`text-base`,children:`Configuration`})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Name`}),(0,I.jsx)(Np,{value:f.name,onChange:e=>p(t=>({...t,name:e.target.value})),placeholder:`e.g. GPT-4o`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Agent type`}),(0,I.jsxs)(E1,{value:f.type??`llm`,onValueChange:e=>p(t=>e===`browser`?{id:t.id,name:t.name,type:`browser`,provider:`claude`,model:``,maxTokens:0,url:t.type===`browser`?t.url:``,newConversationBetweenScenarios:t.type!==`browser`||t.newConversationBetweenScenarios}:{id:t.id,name:t.name,type:`llm`,provider:`openai`,model:t.model||`gpt-4o`,maxTokens:t.maxTokens||4096,temperature:t.type===`llm`?t.temperature:0,maxTurns:t.type===`llm`?t.maxTurns:void 0,systemPrompt:t.type===`llm`?t.systemPrompt:void 0}),children:[(0,I.jsx)(O1,{children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`llm`,children:`LLM Agent`}),(0,I.jsx)(Q,{value:`browser`,children:`Browser Agent`})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`agent-provider`,children:`Provider`}),(0,I.jsxs)(E1,{value:f.provider,onValueChange:e=>p(t=>t.type===`browser`?{...t,provider:e}:{...t,provider:e,model:O5[e]?.[0]||``}),children:[(0,I.jsx)(O1,{id:`agent-provider`,children:(0,I.jsx)(D1,{})}),(0,I.jsx)(j1,{children:f.type===`browser`?F.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.name},e.id)):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Q,{value:`openai`,children:`OpenAI`}),(0,I.jsx)(Q,{value:`anthropic`,children:`Anthropic`}),(0,I.jsx)(Q,{value:`azure`,children:`Azure OpenAI`}),(0,I.jsx)(Q,{value:`azure_foundry`,children:`Azure Foundry`}),(0,I.jsx)(Q,{value:`google`,children:`Google`}),(0,I.jsx)(Q,{value:`custom`,children:`Custom`})]})})]})]}),f.type===`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`agent-conversation-behavior`,children:`Conversation behavior`}),(0,I.jsxs)(E1,{value:f.newConversationBetweenScenarios===!1?`same`:`new`,onValueChange:e=>p(t=>t.type===`browser`?{...t,newConversationBetweenScenarios:e!==`same`}:t),children:[(0,I.jsx)(O1,{id:`agent-conversation-behavior`,children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`new`,children:`Start a new conversation between scenarios`}),(0,I.jsx)(Q,{value:`same`,children:`Continue the same conversation`})]})]}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Default for queue runs. It can be overridden when starting an evaluation.`})]})]}),f.type===`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Browser agent URL`}),(0,I.jsx)(Np,{value:f.url??``,onChange:e=>p(t=>({...t,url:e.target.value})),placeholder:`https://provider.example`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Rover opens this URL when the queued Browser Agent needs attention.`})]}),f.type!==`browser`&&(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`agent-model`,children:L?`Deployment name`:`Model`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[L?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Np,{id:`agent-model`,value:f.model,onChange:e=>p(t=>({...t,model:e.target.value})),placeholder:`Type deployment name manually`,list:`agent-deployment-suggestions`,className:`h-9 min-w-0 flex-1 font-mono text-xs`}),(0,I.jsx)(`datalist`,{id:`agent-deployment-suggestions`,children:z.map(e=>(0,I.jsx)(`option`,{value:e},e))})]}):(0,I.jsxs)(S8,{open:D,onOpenChange:k,children:[(0,I.jsx)(C8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,id:ee?void 0:`agent-model`,"aria-expanded":D,"aria-controls":`agent-model-command-list`,className:`h-9 flex-1 justify-between font-mono text-xs`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:f.model||(L?`Select deployment...`:`Select model...`)}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(w8,{className:`w-[420px] p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search ${L?`deployments`:`models`}...`}),(0,I.jsxs)(S5,{id:`agent-model-command-list`,children:[(0,I.jsxs)(C5,{children:[`No `,L?`deployments`:`models`,` found.`]}),(0,I.jsxs)(w5,{heading:L?`Deployments`:`Models`,children:[z.map(e=>(0,I.jsxs)(E5,{value:e,onSelect:e=>{p(t=>({...t,model:e})),j(!1),k(!1)},children:[(0,I.jsx)(nn,{className:U(`mr-2 h-4 w-4`,f.model===e?`opacity-100`:`opacity-0`)}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:e})]},e)),(0,I.jsx)(E5,{value:`__custom_model_id__`,onSelect:()=>{j(!0),k(!1)},children:(0,I.jsx)(`span`,{className:`font-medium`,children:L?`Custom deployment ID...`:`Custom model ID...`})})]})]})]})})]}),R&&(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-9 shrink-0 text-xs`,onClick:()=>void ne(),disabled:T,title:L?`Load deployment suggestions from backend environment variables`:`Fetch ${f.provider} models`,children:[T?(0,I.jsx)(In,{className:`mr-1 h-3 w-3 animate-spin`}):(0,I.jsx)(Yn,{className:`mr-1 h-3 w-3`}),L?`Load configured deployments`:`Fetch Models`]})]}),ee&&!L&&(0,I.jsx)(Np,{id:`agent-model`,value:f.model,onChange:e=>p(t=>({...t,model:e.target.value})),placeholder:L?`Type deployment name manually`:`Type model name manually`,className:`font-mono text-xs`}),f.provider===`azure_foundry`&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Set AZURE_FOUNDRY_ENDPOINT on the backend and AZURE_FOUNDRY_API_KEY, or reuse AZURE_OPENAI_API_KEY for the same resource. Enter the exact deployment name. Suggestions come from AZURE_FOUNDRY_DEPLOYMENTS; they do not query Azure.`}),f.provider===`azure`&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Uses the selected deployment when it matches configured deployment suggestions; otherwise falls back to AZURE_OPENAI_DEPLOYMENT. Azure Foundry uses the deployment selected for each agent.`}),C!==null&&(C.length>0?(0,I.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Loaded `,C.length,` `,L?`deployment names from configuration`:`models from provider discovery`,`.`]}):f.provider===`azure`?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Set AZURE_OPENAI_DEPLOYMENT on the MCPLab backend as the fallback. AZURE_OPENAI_DEPLOYMENTS and AZURE_OPENAI_DEPLOYMENT_NAME add selectable deployment suggestions.`}):null)]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Max Tokens`}),(0,I.jsx)(Np,{type:`number`,min:1,max:128e3,value:f.maxTokens,onChange:e=>p(t=>({...t,maxTokens:parseInt(e.target.value)||0})),className:`font-mono text-xs`})]})]}),f.type!==`browser`&&(0,I.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`Max Turns`}),(0,I.jsx)(Np,{type:`number`,min:1,max:50,value:f.maxTurns??``,onChange:e=>{let t=e.target.value.trim();p(e=>({...e,maxTurns:t&&parseInt(t)||void 0}))},placeholder:`30 (default)`,className:`font-mono text-xs`}),(0,I.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Maximum number of LLM round-trips (tool calls + final answer) per eval run.`})]})}),f.type!==`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{children:`Temperature`}),(0,I.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t3(f.temperature).toFixed(2)})]}),(0,I.jsx)(B6,{value:[t3(f.temperature)],onValueChange:([e])=>p(t=>({...t,temperature:e})),min:0,max:2,step:.01})]}),f.type!==`browser`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{children:`System Prompt`}),(0,I.jsx)(n0,{value:f.systemPrompt||``,onChange:e=>p(t=>({...t,systemPrompt:e.target.value})),placeholder:`Optional system prompt...`,rows:3,className:`text-xs`})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between pt-2`,children:[(0,I.jsx)(`div`,{children:!c&&(0,I.jsx)(W,{type:`button`,variant:`destructive`,size:`sm`,onClick:()=>h(!0),children:`Delete`})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>n(`/libraries/agents`),children:`Cancel`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void re(),disabled:g,children:[g&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),c?`Create Agent`:`Save`]})]})]})]})]}),(0,I.jsx)(z3,{open:m,onOpenChange:h,children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete agent?`}),(0,I.jsxs)(K3,{children:[`This will permanently remove the agent `,(0,I.jsx)(`span`,{className:`font-mono`,children:f.name}),`. This action cannot be undone.`]})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{children:`Cancel`}),(0,I.jsx)(q3,{onClick:()=>void ie(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`Delete`})]})]})})]})},j5=`mcplab.resultAssistantScenarioHandoff`,M5=()=>{let{testCaseId:e}=qd(),[t,n]=pp(),r=Ud(),{source:i}=Rv(),{scenarios:a,setScenarios:o,agents:s,servers:c,reload:l,loading:u}=Zv(),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(`all`),[h,g]=(0,_.useState)(`name`),[v,y]=(0,_.useState)(`asc`),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)(`idle`),[E,D]=(0,_.useState)(``),[k,A]=(0,_.useState)(``),[j,M]=(0,_.useState)(0),[N,P]=(0,_.useState)(null),F=(0,_.useRef)(null),L=(0,_.useRef)(!1),R=(0,_.useRef)(!1),z=(0,_.useRef)(null),B=(0,_.useRef)(0),ee=(0,_.useRef)(a);ee.current=a;let te=(0,_.useRef)(o);te.current=o;let ne=e?decodeURIComponent(e):void 0,re=t.get(`returnTo`)?.trim()||``,ie=re.startsWith(`/`)?re:``,ae=ne?a.findIndex(e=>e.id===ne):-1,oe=ae>=0?a[ae]:void 0,se=async e=>{if(!oe||ae<0||!e)return;let t=[...a];t[ae]=e,await o(t)},V=async()=>{let e=z.current;if(!e||!oe)return;if(L.current){R.current=!0;return}L.current=!0,R.current=!1;let t=++B.current;T(`saving`),D(``);try{await se(e),t===B.current&&T(`saved`)}catch(e){let n=e instanceof Error?e.message:String(e);t===B.current&&(T(`error`),D(n)),O({title:`Could not save scenario`,description:n,variant:`destructive`})}finally{L.current=!1,R.current&&(R.current=!1,V())}},ce=e=>{z.current=e,T(`dirty`),D(``),F.current&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>{F.current=null,V()},700)},le=async()=>{let e=`scn-${Date.now()}`,t=e,n=1;for(;a.some(e=>e.id===t);)t=`${e}-${n}`,n+=1;let i={id:t,name:``,serverIds:[],prompt:``,evalRules:[],extractRules:[]};await o([...a,i]),r(`/libraries/test-cases/${encodeURIComponent(t)}`),O({title:`Test case created`,description:`Opened ${t} for editing.`})},ue=e=>{let t=(e||`scn-${Date.now()}`).trim().replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9_-]/g,``).replace(/-+/g,`-`).replace(/^-|-$/g,``)||`scn-${Date.now()}`,n=t,r=1;for(;a.some(e=>e.id===n);)n=`${t}-${r}`,r+=1;return n},H=async(e,t=!1)=>{let n=ue(`${e.id}-copy`),i={...structuredClone(e),id:n,name:e.name?`${e.name} (Copy)`:``};await o([...a,i]),O({title:`Test case duplicated`,description:`Created ${i.id}.`}),t&&r(`/libraries/test-cases/${encodeURIComponent(i.id)}`)},de=async e=>{F.current&&=(window.clearTimeout(F.current),null);let t=a.filter(t=>t.id!==e.id);await o(t),O({title:`Test case deleted`,description:`${e.id} was removed.`}),oe?.id===e.id&&(C(null),z.current=null,T(`idle`),D(``),r(`/libraries/test-cases`))},fe=e=>e.map(e=>c.find(t=>t.id===e)).filter(Boolean).map(e=>e?.name||e?.id).filter(Boolean),pe=(0,_.useMemo)(()=>{let e=new Set;for(let t of a)for(let n of fe(t.serverIds))e.add(n);return Array.from(e).sort((e,t)=>e.localeCompare(t))},[a,c]),me=(0,_.useMemo)(()=>{let e=d.trim().toLowerCase(),t=a.filter(t=>{let n=(t.name||``).toLowerCase(),r=t.id.toLowerCase(),i=(t.prompt||``).toLowerCase(),a=fe(t.serverIds);return p!==`all`&&!a.includes(p)?!1:!e||n.includes(e)||r.includes(e)||i.includes(e)||a.some(t=>t.toLowerCase().includes(e))});return t.sort((e,t)=>{let n=fe(e.serverIds),r=fe(t.serverIds),i=0;switch(h){case`id`:i=e.id.localeCompare(t.id);break;case`servers`:i=n.length-r.length;break;case`evalRules`:i=e.evalRules.length-t.evalRules.length;break;case`extractRules`:i=e.extractRules.length-t.extractRules.length;break;default:i=(e.name||e.id).localeCompare(t.name||t.id)}return i===0&&(i=e.id.localeCompare(t.id)),v===`asc`?i:-i}),t},[a,d,p,h,v,c]);(0,_.useEffect)(()=>{let e=!0;return i.getWorkspaceSettings().then(t=>{e&&t&&x(t.scenarioAssistantAgentName??``)}).catch(()=>{e&&x(``)}),()=>{e=!1}},[i]),(0,_.useEffect)(()=>{if(ne&&t.get(`assistantHandoff`)===`1`)try{let e=window.sessionStorage.getItem(j5);if(!e)return;let r=JSON.parse(e);if(!r||r.scenarioId!==ne||!r.prompt)return;A(String(r.prompt)),M(Date.now()),window.sessionStorage.removeItem(j5);let i=new URLSearchParams(t);i.delete(`assistantHandoff`),n(i,{replace:!0}),O({title:`Suggestion sent to Scenario Assistant`,description:`Review the suggestion and apply changes in the scenario editor.`})}catch{}},[ne,t,n]),(0,_.useEffect)(()=>{let e=F.current!==null||L.current,t=z.current;if(!(oe&&t?.id===oe.id&&e)){if(t&&t.id!==oe?.id&&(F.current!==null||R.current)){F.current!==null&&(window.clearTimeout(F.current),F.current=null),R.current=!1;let e=ee.current,n=e.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e];r[n]=t,te.current(r)}}F.current&&=(window.clearTimeout(F.current),null),L.current=!1,R.current=!1,oe?(C(structuredClone(oe)),z.current=structuredClone(oe),T(`idle`),D(``)):(C(null),z.current=null,T(`idle`),D(``))}},[oe]),(0,_.useEffect)(()=>()=>{F.current&&window.clearTimeout(F.current)},[]);let he=b||s[0]?.name||``;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Sn,{className:`h-6 w-6`}),`Manage Test Cases`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Reusable test case templates shared across configurations.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[oe&&(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>r(`/libraries/test-cases`),children:[(0,I.jsx)(Qt,{className:`mr-2 h-4 w-4`}),`Back to Overview`]}),oe&&ie&&(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,asChild:!0,children:(0,I.jsxs)(sp,{to:ie,children:[(0,I.jsx)(Qt,{className:`mr-2 h-4 w-4`}),`Back to evaluation`]})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void l(),disabled:u,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]}),!oe&&(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void le(),children:[(0,I.jsx)(qn,{className:`mr-1.5 h-3.5 w-3.5`}),`Add Test Case`]})]})]}),!oe&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`grid gap-3 rounded-md border bg-muted/30 p-3 md:grid-cols-[1.6fr_1fr_1fr_auto]`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Search`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(Zn,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,I.jsx)(Np,{value:d,onChange:e=>f(e.target.value),placeholder:`Search by name, id, prompt, server...`,className:`h-8 pl-8 text-xs`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Server Filter`}),(0,I.jsxs)(E1,{value:p,onValueChange:m,children:[(0,I.jsx)(O1,{className:`h-8 text-xs`,children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`all`,children:`All servers`}),pe.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Sort By`}),(0,I.jsxs)(E1,{value:h,onValueChange:e=>g(e),children:[(0,I.jsx)(O1,{className:`h-8 text-xs`,children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`name`,children:`Name`}),(0,I.jsx)(Q,{value:`id`,children:`ID`}),(0,I.jsx)(Q,{value:`servers`,children:`# Servers`}),(0,I.jsx)(Q,{value:`evalRules`,children:`# Eval Rules`}),(0,I.jsx)(Q,{value:`extractRules`,children:`# Extract Rules`})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Direction`}),(0,I.jsxs)(E1,{value:v,onValueChange:e=>y(e),children:[(0,I.jsx)(O1,{className:`h-8 w-28 text-xs`,children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`asc`,children:`Ascending`}),(0,I.jsx)(Q,{value:`desc`,children:`Descending`})]})]})]})]}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`space-y-3 pt-6`,children:[(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Showing `,me.length,` of `,a.length,` test case`,a.length===1?``:`s`,`.`]}),ne&&!oe&&(0,I.jsxs)(`div`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900`,children:[`Test case `,(0,I.jsx)(`code`,{className:`font-mono`,children:ne}),` was not found.`]}),a.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No library test cases yet.`}):me.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No test cases match the current filters.`}):(0,I.jsx)(`div`,{className:`grid gap-3`,children:me.map(e=>{let t=ne===e.id,n=`/libraries/test-cases/${encodeURIComponent(e.id)}`,r=fe(e.serverIds);return(0,I.jsx)(`div`,{className:`rounded-lg border p-3 ${t?`border-primary bg-primary/5`:``}`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(sp,{to:n,className:`font-medium truncate hover:underline`,children:e.name||e.id}),(0,I.jsx)(Y,{variant:`outline`,className:`font-mono text-[10px]`,children:e.id}),t&&(0,I.jsx)(Y,{children:`Selected`})]}),(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1`,children:[(0,I.jsxs)(`span`,{children:[r.length,` server`,r.length===1?``:`s`]}),(0,I.jsxs)(`span`,{children:[e.evalRules.length,` eval rule`,e.evalRules.length===1?``:`s`]}),(0,I.jsxs)(`span`,{children:[e.extractRules.length,` extract rule`,e.extractRules.length===1?``:`s`]})]}),r.length>0&&(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map(t=>(0,I.jsx)(Y,{variant:`secondary`,className:`text-[10px]`,children:t},`${e.id}-${t}`))})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>P(e),children:[(0,I.jsx)(ar,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void H(e),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:t?`default`:`outline-solid`,asChild:!0,children:(0,I.jsxs)(sp,{to:n,children:[(0,I.jsx)(Gn,{className:`mr-1.5 h-3.5 w-3.5`}),`Edit`]})})]})]})},e.id)})})]})})]}),oe&&S?(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)($v,{className:`text-base`,children:[`Edit Test Case ·`,` `,(0,I.jsx)(`code`,{className:`font-mono text-muted-foreground`,children:oe.id})]}),(0,I.jsx)(Y,{variant:`outline`,className:`text-[10px] ${w===`saving`?`border-amber-300 text-amber-700`:w===`saved`?`border-emerald-300 text-emerald-700`:w===`error`?`border-destructive/40 text-destructive`:w===`dirty`?`border-sky-300 text-sky-700`:``}`,children:w===`saving`?`Saving...`:w===`saved`?`Saved`:w===`error`?`Save failed`:w===`dirty`?`Unsaved changes`:`Ready`})]}),w===`error`&&E&&(0,I.jsx)(`div`,{className:`text-[11px] text-destructive`,children:E})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void H(S,!0),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Duplicate`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`text-destructive hover:text-destructive`,onClick:()=>P(S),children:[(0,I.jsx)(ar,{className:`mr-1.5 h-3.5 w-3.5`}),`Delete`]})]})]})}),(0,I.jsx)(q,{className:`pt-3`,children:(0,I.jsx)(q4,{scenarios:[S],agents:s,servers:c,defaultAssistantAgentName:he,assistantInitialPromptByScenarioId:k&&S?.id?{[S.id]:k}:void 0,assistantAutoOpenNonceByScenarioId:S?.id&&j?{[S.id]:j}:void 0,onChange:e=>{let t=e[0];t&&(C(t),ce(t))},allowAdd:!1})})]}):null,(0,I.jsx)(z3,{open:!!N,onOpenChange:e=>!e&&P(null),children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete test case?`}),(0,I.jsxs)(K3,{children:[`This will permanently remove`,` `,(0,I.jsx)(`span`,{className:`font-medium`,children:N?.name||N?.id}),` `,`from the library. This action cannot be undone.`]})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{children:`Cancel`}),(0,I.jsx)(q3,{className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,onClick:()=>{N&&(de(N),P(null))},children:`Delete Test Case`})]})]})})]})},N5=`Switch`,[P5,Tte]=R(N5),[F5,I5]=P5(N5),L5=_.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=_.useState(null),m=P(t,e=>p(e)),h=_.useRef(!1),g=!f||u||!!f.closest(`form`),[v,y]=Re({prop:i,defaultProp:a??!1,onChange:l,caller:N5});return(0,I.jsxs)(F5,{scope:n,checked:v,disabled:s,children:[(0,I.jsx)(H.button,{type:`button`,role:`switch`,"aria-checked":v,"aria-required":o,"data-state":H5(v),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:j(e.onClick,e=>{y(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,I.jsx)(V5,{control:f,bubbles:!h.current,name:r,value:c,checked:v,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});L5.displayName=N5;var R5=`SwitchThumb`,z5=_.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=I5(R5,n);return(0,I.jsx)(H.span,{"data-state":H5(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});z5.displayName=R5;var B5=`SwitchBubbleInput`,V5=_.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=_.useRef(null),s=P(o,a),c=e$(n),l=nc(t);return _.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,I.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});V5.displayName=B5;function H5(e){return e?`checked`:`unchecked`}var U5=L5,W5=z5,G5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(U5,{className:U(`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-hidden 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:(0,I.jsx)(W5,{className:U(`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`)})}));G5.displayName=U5.displayName;var K5=({evaluationJudgeAgentName:e,llmAgents:t,savedDecision:n,decisionError:r,loadingSettings:i,savingSettings:a,librariesLoading:o,onDecisionSaved:s,onDecisionError:c,onSavingChange:l,onTestingChange:u})=>{let{source:d}=Rv(),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)(x_.baseUrl),[x,S]=(0,_.useState)(String(x_.passThreshold)),[C,w]=(0,_.useState)(String(x_.failThreshold)),[T,E]=(0,_.useState)(``),[D,k]=(0,_.useState)(!1),[A,j]=(0,_.useState)(),M=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e,t=``;try{e=n?C_(n):void 0}catch{t=`Saved Decision Engine configuration is invalid. Select a provider to replace it, or save None to clear it. Semantic checks fall back to the Evaluation Judge.`}p(e?.provider??``),v(S_(e)),h(e?.model??``),b(e?.baseUrl??x_.baseUrl),S(String(e?.passThreshold??x_.passThreshold)),w(String(e?.failThreshold??x_.failThreshold)),E(t)},[n]),(0,_.useEffect)(()=>(k(!1),u(!1),j(void 0),()=>{M.current?.abort(),M.current=null}),[f,m,y,d,u]);let N=()=>{if(!f)return null;if(!x.trim()||!C.trim())throw Error(`Enter both pass and fail probability thresholds.`);return C_({provider:f,model:m,passThreshold:Number(x),failThreshold:Number(C),...g?{}:{enabled:!1},...f===`ollama`?{baseUrl:y}:{}})},P=async()=>{let e;try{if(e=N(),!e)throw Error(`Select a Decision Engine before testing the connection.`)}catch(e){c(e instanceof Error?e.message:String(e));return}let t=new AbortController;M.current=t,k(!0),u(!0),c(``),j(void 0);try{let n=await d.testDecisionConnection(e,t.signal);t.signal.aborted||j(n)}catch(e){t.signal.aborted||c(e instanceof Error?e.message:String(e))}finally{M.current===t&&(M.current=null,k(!1),u(!1))}},F=async()=>{let n=null;try{if(n=N(),S_(n)&&!t.some(t=>t.id===e||t.name===e))throw Error(`Select an LLM evaluation judge as backup before enabling the Decision Engine.`)}catch(e){c(e instanceof Error?e.message:String(e));return}l(!0),c(``);try{await d.updateWorkspaceSettings({evaluationDecision:n}),s(n??void 0),E(``),O({title:`Settings updated`,description:n?`Decision Engine configuration saved.`:`Decision Engine cleared. Semantic checks use the Evaluation Judge.`})}catch(e){c(e instanceof Error?e.message:String(e))}finally{l(!1)}};return(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Decision Engine`}),(0,I.jsx)(G5,{id:`decision-enabled`,className:`shrink-0`,checked:g,onCheckedChange:v,disabled:!f||a||i,"aria-label":`Use Decision Engine`,"aria-describedby":`decision-enabled-help`})]}),(0,I.jsx)(ey,{children:`Optionally evaluate semantic checks with a decision model. The Evaluation Judge handles uncertain decisions and unavailable engines.`})]}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`p`,{id:`decision-enabled-help`,className:`text-xs text-muted-foreground`,children:[g?`On: semantic checks use the Decision Engine with judge fallback.`:`Off: semantic checks use the Evaluation Judge. Your decision configuration is kept.`,` `,`Click Save Decision Engine to apply changes.`]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`decision-provider`,className:`text-xs`,children:`Decision provider`}),(0,I.jsxs)(E1,{value:f||`__none__`,disabled:a||i,onValueChange:e=>{let t=e===`__none__`?``:e;p(t),t?f||v(!0):v(!1),h(t?b_[t].defaultModel:``),c(``)},children:[(0,I.jsx)(O1,{id:`decision-provider`,className:`h-9 text-sm`,children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`__none__`,children:`None`}),Object.entries(b_).map(([e,{label:t}])=>(0,I.jsx)(Q,{value:e,children:t},e))]})]})]}),f&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`decision-model`,className:`text-xs`,children:b_[f].modelLabel}),!b_[f].editableModel&&b_[f].models.length>1?(0,I.jsxs)(E1,{value:m,onValueChange:h,disabled:a||i,children:[(0,I.jsx)(O1,{id:`decision-model`,className:`h-9 text-sm`,children:(0,I.jsx)(D1,{})}),(0,I.jsx)(j1,{children:b_[f].models.map(e=>(0,I.jsx)(Q,{value:e,children:e},e))})]}):(0,I.jsx)(Np,{id:`decision-model`,className:`h-9 text-sm`,value:m,onChange:e=>h(e.target.value),disabled:a||i,readOnly:!b_[f].editableModel,list:`decision-model-suggestions`,"aria-describedby":[f===`ollama`?`ollama-model-help`:void 0,r?`decision-error`:void 0,T?`decision-config-error`:void 0].filter(Boolean).join(` `)||void 0}),(0,I.jsx)(`datalist`,{id:`decision-model-suggestions`,children:b_[f].models.map(e=>(0,I.jsx)(`option`,{value:e},e))})]})]}),f===`ollama`&&(0,I.jsxs)(`p`,{id:`ollama-model-help`,className:`text-xs text-muted-foreground`,children:[`Enter the exact model name from `,(0,I.jsx)(`code`,{children:`ollama list`}),`, including its tag (for example `,(0,I.jsx)(`code`,{children:`tev1:4b`}),` or `,(0,I.jsx)(`code`,{children:`tev1:0.8b`}),`). Suggestions do not show which models are installed.`]})]}),f&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:b_[f].credentials}),f===`ollama`&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`decision-url`,className:`text-xs`,children:`Ollama server URL`}),(0,I.jsx)(Np,{id:`decision-url`,type:`url`,value:y,onChange:e=>b(e.target.value),disabled:a||i,"aria-describedby":[r?`decision-error`:void 0,T?`decision-config-error`:void 0].filter(Boolean).join(` `)||void 0}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Use a URL reachable from the MCPLab backend. Ollama fallback uses the configured judge, which may be hosted.`})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`decision-pass`,className:`text-xs`,children:`Pass probability threshold`}),(0,I.jsx)(Np,{id:`decision-pass`,type:`number`,min:`0`,max:`1`,step:`0.01`,value:x,onChange:e=>S(e.target.value),disabled:a||i,"aria-invalid":!!r,"aria-describedby":`decision-threshold-help${r?` decision-error`:``}${T?` decision-config-error`:``}`})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`decision-fail`,className:`text-xs`,children:`Fail probability threshold`}),(0,I.jsx)(Np,{id:`decision-fail`,type:`number`,min:`0`,max:`1`,step:`0.01`,value:C,onChange:e=>w(e.target.value),disabled:a||i,"aria-invalid":!!r,"aria-describedby":`decision-threshold-help${r?` decision-error`:``}${T?` decision-config-error`:``}`})]})]}),(0,I.jsx)(`p`,{id:`decision-threshold-help`,className:`text-xs text-muted-foreground`,children:`Both thresholds describe the probability that the assertion is satisfied. Pass at or above the pass threshold; fail at or below the fail threshold. Between them, the Evaluation Judge decides. Use 0 ≤ fail threshold < pass threshold ≤ 1.`})]}),T&&(0,I.jsx)(`p`,{id:`decision-config-error`,role:`alert`,className:`text-sm text-destructive`,children:T}),r&&(0,I.jsx)(`p`,{id:`decision-error`,role:`alert`,className:`text-sm text-destructive`,children:r}),A&&(0,I.jsx)(`p`,{role:A.ok?`status`:`alert`,className:`text-sm ${A.ok?`text-success`:`text-destructive`}`,children:A.message}),f&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Test connection sends one small decision request using the current values without saving them.`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(W,{type:`button`,onClick:()=>void F(),disabled:a||i||o||D,children:a?`Saving...`:`Save Decision Engine`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,onClick:()=>void P(),disabled:!f||a||i||D,children:D?`Testing...`:`Test connection`})]})]})]})},q5=()=>{let{source:e}=Rv(),{agents:t,reload:n,loading:r}=Zv(),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(`1`),[m,h]=(0,_.useState)(),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(!1),x=t.filter(e=>e.type!==`browser`),S=(0,_.useMemo)(()=>c||t[0]?.name||``,[c,t]),C=(0,_.useCallback)(async()=>{a(!0);try{let t=await e.getWorkspaceSettings();l(t?.scenarioAssistantAgentName??``),d(t?.evaluationJudgeAgentName??``),p(String(t?.defaultQueueWorkers??1)),h(t?.evaluationDecision)}catch(e){l(``),d(``),p(`1`),h(void 0),O({title:`Could not load settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{a(!1)}},[e]);(0,_.useEffect)(()=>{C()},[C]);let w=async t=>{let n=c;l(t),s(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:t||void 0}),O({title:`Settings updated`,description:t?`Default assistant agent set to ${t}.`:`Default assistant agent cleared (will use first available agent by default).`})}catch(e){l(n),O({title:`Could not save settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{s(!1)}},T=async t=>{let n=f;p(t),s(!0);try{await e.updateWorkspaceSettings({defaultQueueWorkers:Number(t)}),O({title:`Settings updated`,description:`Evaluation workers set to ${t}.`})}catch(e){p(n),O({title:`Could not save settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{s(!1)}},E=async t=>{if(!t&&S_(m)){v(`Turn off and save, or clear, the Decision Engine before removing its backup LLM evaluation judge.`);return}let n=u;d(t),s(!0);try{await e.updateWorkspaceSettings({evaluationJudgeAgentName:t||null}),O({title:`Settings updated`,description:t?`Default evaluation judge set to ${t}.`:`Default evaluation judge cleared.`})}catch(e){d(n),O({title:`Could not save settings`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{s(!1)}},D=async()=>{await Promise.all([n(),C()])};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)($n,{className:`h-6 w-6`}),`Settings`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Workspace-level MCP Lab settings and defaults.`})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void D(),disabled:r||i||o||y,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Assistant Defaults`}),(0,I.jsx)(ey,{children:`Default assistant agent used across assistant flows. If unset, MCP Lab uses the first available agent automatically.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Default Assistant Agent`}),(0,I.jsxs)(E1,{value:S||`__none__`,onValueChange:e=>void w(e===`__none__`?``:e),disabled:o,children:[(0,I.jsx)(O1,{className:`h-9 text-sm`,children:(0,I.jsx)(D1,{placeholder:`Select assistant agent`})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`__none__`,children:`None (use first agent)`}),t.map(e=>(0,I.jsxs)(Q,{value:e.id,children:[e.name||e.id,` · `,e.model]},e.id))]})]}),(0,I.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.`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Saved in workspace settings`})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Evaluation Judge`}),(0,I.jsx)(ey,{children:`Default judge agent used by semantic agent checks during scenario evaluation runs.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{className:`text-xs`,htmlFor:`evaluation-judge`,children:`Default Evaluation Judge`}),(0,I.jsxs)(E1,{value:u||`__none__`,onValueChange:e=>void E(e===`__none__`?``:e),disabled:o,children:[(0,I.jsx)(O1,{id:`evaluation-judge`,className:`h-9 text-sm`,children:(0,I.jsx)(D1,{placeholder:`Select evaluation judge`})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`__none__`,children:`None`}),x.map(e=>(0,I.jsxs)(Q,{value:e.id,children:[e.name||e.id,` · `,e.model]},e.id))]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Used by agent checks that semantically evaluate the final answer. If unset, runs with agent checks will fail before execution.`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Saved in workspace settings`})]})]}),(0,I.jsx)(K5,{evaluationJudgeAgentName:u,llmAgents:x,savedDecision:m,decisionError:g,loadingSettings:i,savingSettings:o,librariesLoading:r,onDecisionSaved:h,onDecisionError:v,onSavingChange:s,onTestingChange:b}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Evaluation Queue`}),(0,I.jsx)(ey,{children:`Control how many queued evaluation runs may execute in parallel.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)($,{htmlFor:`evaluation-workers`,className:`text-xs`,children:`Evaluation workers`}),(0,I.jsxs)(E1,{value:f,onValueChange:e=>void T(e),disabled:o,children:[(0,I.jsx)(O1,{id:`evaluation-workers`,className:`h-9 text-sm`,children:(0,I.jsx)(D1,{placeholder:`Select worker count`})}),(0,I.jsx)(j1,{children:Array.from({length:8},(e,t)=>String(t+1)).map(e=>(0,I.jsx)(Q,{value:e,children:e},e))})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Number of queued evaluation runs that may execute in parallel.`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Saved in workspace settings`})]})]})]})},J5=Wt(`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`}}),Y5=_.forwardRef(({className:e,variant:t,...n},r)=>(0,I.jsx)(`div`,{ref:r,role:`alert`,className:U(J5({variant:t}),e),...n}));Y5.displayName=`Alert`;var X5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`h5`,{ref:n,className:U(`mb-1 font-medium leading-none tracking-tight`,e),...t}));X5.displayName=`AlertTitle`;var Z5=_.forwardRef(({className:e,...t},n)=>(0,I.jsx)(`div`,{ref:n,className:U(`text-sm [&_p]:leading-relaxed`,e),...t}));Z5.displayName=`AlertDescription`;var Q5=`http://127.0.0.1:3011/mcp`;function $5(e){return navigator.clipboard.writeText(e)}function e7({text:e,label:t}){let[n,r]=(0,_.useState)(!1),i=async()=>{try{await $5(e),r(!0),O({title:`Copied`,description:`${t} copied to clipboard.`}),window.setTimeout(()=>r(!1),1500)}catch(e){O({title:`Copy failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}};return(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void i(),children:[(0,I.jsx)(hn,{className:`mr-2 h-3.5 w-3.5`}),n?`Copied`:`Copy`]})}function t7({label:e,value:t,copyText:n,valueClassName:r=``}){return(0,I.jsx)(`div`,{className:`rounded-lg border bg-muted/20 p-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e}),(0,I.jsx)(`div`,{className:`mt-1 break-all text-sm font-medium ${r}`,children:t})]}),n&&(0,I.jsx)(e7,{text:n,label:e})]})})}function n7({title:e,description:t,code:n,iconSrc:r}){return(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsxs)($v,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(`img`,{src:r,alt:``,"aria-hidden":`true`,className:`h-4 w-4`}),e]}),(0,I.jsx)(ey,{children:t})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.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}),(0,I.jsx)(`div`,{className:`flex justify-end`,children:(0,I.jsx)(e7,{text:n,label:e})})]})]})}var r7=()=>{let{source:e}=Rv(),[t,n]=(0,_.useState)(!0),[r,i]=(0,_.useState)(null),a=(0,_.useCallback)(async()=>{n(!0);try{let t=await e.health();i(t)}catch(e){i(null),O({title:`Could not load MCP connection info`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{n(!1)}},[e]);(0,_.useEffect)(()=>{a()},[a]);let o=r?.mcp?.enabled?r.mcp:null,s=o?.directUrl??Q5,c=o?.transport??`streamable-http`,l=(0,_.useMemo)(()=>JSON.stringify({mcpServers:{mcplab:{command:`npx`,args:[`mcp-remote`,s]}}},null,2),[s]),u=(0,_.useMemo)(()=>JSON.stringify({name:`mcplab`,transport:c,url:s},null,2),[s,c]);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Pn,{className:`h-6 w-6`}),`MCP Connection Info`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Copy the local MCPLab MCP server details into Claude Desktop or any MCP-capable client.`})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:t,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh`]})]}),!o&&(0,I.jsxs)(Y5,{children:[(0,I.jsx)(Pn,{className:`h-4 w-4`}),(0,I.jsx)(X5,{children:`MCP server not reported`}),(0,I.jsx)(Z5,{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.`})]}),(0,I.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[1.1fr_0.9fr]`,children:[(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Connection Details`}),(0,I.jsx)(ey,{children:`The local server is exposed over streamable HTTP.`})]}),(0,I.jsx)(q,{className:`space-y-3`,children:(0,I.jsxs)(`div`,{className:`grid gap-3`,children:[(0,I.jsx)(t7,{label:`Direct MCP URL`,value:s,copyText:s}),(0,I.jsx)(t7,{label:`Transport`,value:c}),(0,I.jsx)(t7,{label:`Authentication`,value:`none`})]})})]}),(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(n7,{title:`Claude Desktop`,description:`Use mcp-remote to bridge Claude Desktop to the local streamable HTTP MCP server.`,code:l,iconSrc:`/icons/claude-color.svg`}),(0,I.jsx)(n7,{title:`OpenAI / MCP-capable client`,description:`Use this endpoint block in any client or adapter that accepts a single MCP-over-HTTP server.`,code:u,iconSrc:`/icons/openai.svg`})]})]})]})};function i7(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,I.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,a7(i,...t)]}function a7(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var o7=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Cp(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),s7=`Progress`,c7=100,[l7,Ete]=i7(s7),[u7,d7]=l7(s7),f7=_.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=h7,...o}=e;(i||i===0)&&!v7(i)&&console.error(b7(`${i}`,`Progress`));let s=v7(i)?i:c7;r!==null&&!y7(r,s)&&console.error(x7(`${r}`,`Progress`));let c=y7(r,s)?r:null,l=_7(c)?a(c,s):void 0;return(0,I.jsx)(u7,{scope:n,value:c,max:s,children:(0,I.jsx)(o7.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":_7(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":g7(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});f7.displayName=s7;var p7=`ProgressIndicator`,m7=_.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=d7(p7,n);return(0,I.jsx)(o7.div,{"data-state":g7(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});m7.displayName=p7;function h7(e,t){return`${Math.round(e/t*100)}%`}function g7(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function _7(e){return typeof e==`number`}function v7(e){return _7(e)&&!isNaN(e)&&e>0}function y7(e,t){return _7(e)&&!isNaN(e)&&e<=t&&e>=0}function b7(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${c7}\`.`}function x7(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
134
|
-
- a positive number
|
|
135
|
-
- less than the value passed to \`max\` (or ${c7} if no \`max\` prop is set)
|
|
136
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
137
|
-
|
|
138
|
-
Defaulting to \`null\`.`}var S7=f7,C7=m7,w7=_.forwardRef(({className:e,value:t,...n},r)=>(0,I.jsx)(S7,{ref:r,className:U(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...n,children:(0,I.jsx)(C7,{className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})}));w7.displayName=S7.displayName;function T7(e){let t=e.toLowerCase();return t.includes(`side-effectful prefix`)||t.includes(`destructive behavior`)||t.includes(`destructivehint`)||t.includes(`non-read-only behavior`)||t.includes(`readonlyhint: false`)||t.includes(`additive behavior`)}function E7(e){try{return JSON.stringify(e,null,2)}catch{return`[schema not serializable]`}}function D7(e){return typeof e.type==`string`?e.type:Array.isArray(e.type)?e.type.join(` | `):e.properties&&typeof e.properties==`object`?`object`:e.items&&typeof e.items==`object`?`array`:`any`}function O7(e,t=new Set){if(!e||typeof e!=`object`||Array.isArray(e))return 0;let n=e;if(t.has(n))return 0;let r=new Set(t);r.add(n);let i=n.properties&&typeof n.properties==`object`&&!Array.isArray(n.properties)?n.properties:void 0,a=i?Object.values(i).reduce((e,t)=>e+O7(t,r),0):0,o=O7(n.items,r),s=[...Array.isArray(n.oneOf)?n.oneOf:[],...Array.isArray(n.anyOf)?n.anyOf:[]].reduce((e,t)=>e+O7(t,r),0);return(i?Object.keys(i).length:0)+a+o+s}function k7({name:e,schema:t,required:n=!1,depth:r=0,seen:i=new Set,expandAll:a=null}){let[o,s]=(0,_.useState)(r===0);if((0,_.useEffect)(()=>{a!==null&&s(a)},[a]),!t||typeof t!=`object`||Array.isArray(t))return(0,I.jsx)(`div`,{className:`text-xs`,children:e});let c=t;if(i.has(c))return(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e,` (circular)`]});let l=new Set(i);l.add(c);let u=c.properties&&typeof c.properties==`object`&&!Array.isArray(c.properties)?c.properties:void 0,d=new Set(Array.isArray(c.required)?c.required.filter(e=>typeof e==`string`):[]),f=c.items&&typeof c.items==`object`?c.items:void 0,p=[...Array.isArray(c.oneOf)?c.oneOf:[],...Array.isArray(c.anyOf)?c.anyOf:[]],m=u&&Object.keys(u).length>0||!!f||p.length>0;return(0,I.jsxs)(`div`,{className:`min-w-0 space-y-1`,style:{marginLeft:r*12},children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 text-xs`,children:[m?(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-center gap-1 text-left font-medium hover:underline`,"aria-label":`${o?`Collapse`:`Expand`} ${e}`,"aria-expanded":o,onClick:()=>s(e=>!e),children:[o?(0,I.jsx)(rn,{className:`h-3 w-3 shrink-0`}):(0,I.jsx)(an,{className:`h-3 w-3 shrink-0`}),(0,I.jsx)(`span`,{className:`wrap-break-word`,children:e})]}):(0,I.jsx)(`span`,{className:`wrap-break-word font-medium`,children:e}),(0,I.jsx)(Y,{variant:`outline`,className:`text-[10px]`,children:D7(c)}),n&&(0,I.jsx)(`span`,{className:`text-[10px] text-rose-600`,children:`required`})]}),typeof c.description==`string`&&(0,I.jsx)(`div`,{className:`max-w-full wrap-break-word text-[11px] text-muted-foreground`,children:c.description}),Array.isArray(c.enum)&&(0,I.jsxs)(`div`,{className:`max-w-full wrap-break-word text-[11px] text-muted-foreground`,children:[`Enum: `,c.enum.map(e=>String(e)).join(`, `)]}),c.default!==void 0&&(0,I.jsxs)(`div`,{className:`max-w-full wrap-break-word text-[11px] text-muted-foreground`,children:[`Default: `,E7(c.default)]}),o&&m&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 border-l pl-2`,children:[u&&Object.keys(u).length>0&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Properties`}),Object.entries(u).map(([e,t])=>(0,I.jsx)(k7,{name:e,schema:t,required:d.has(e),depth:r+1,seen:l,expandAll:a},e))]}),f&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Items`}),(0,I.jsx)(k7,{name:`item`,schema:f,depth:r+1,seen:l,expandAll:a})]}),p.length>0&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:`Variants`}),p.map((e,t)=>(0,I.jsx)(k7,{name:`variant ${t+1}`,schema:e,depth:r+1,seen:l,expandAll:a},t))]})]})]})}function A7({propertyCount:e,onExpandAll:t,onCollapseAll:n}){return(0,I.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1`,children:[(0,I.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[e,` Properties`]}),(0,I.jsx)(`button`,{type:`button`,className:`rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:t,children:`Expand All`}),(0,I.jsx)(`button`,{type:`button`,className:`rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:n,children:`Collapse All`})]})}function j7({title:e,schema:t,explorerControls:n}){let r=e.toLowerCase(),i=async()=>{try{await navigator.clipboard.writeText(E7(t)),O({title:`${e} copied`})}catch(t){O({title:`Could not copy ${e.toLowerCase()}`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}};return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] font-medium text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-1.5`,children:[n,(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex shrink-0 items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,"aria-label":`Copy ${r} JSON`,title:`Copy ${r} JSON`,onClick:()=>void i(),children:[(0,I.jsx)(hn,{className:`h-3 w-3`}),`Copy JSON`]})]})]})}function M7({inputSchema:e,outputSchema:t,mode:n,onModeChange:r}){let[i,a]=(0,_.useState)(`explorer`),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),u=n??i,d=e=>{r?.(e),n||a(e)};return e===void 0&&t===void 0?null:(0,I.jsxs)(`details`,{className:`group/schema min-w-0 max-w-full overflow-hidden rounded border bg-muted/10 p-2`,onClick:e=>e.stopPropagation(),children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 text-xs font-medium`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[`Schemas`,e!==void 0&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`input`}),t!==void 0&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`output`})]}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`inline-flex rounded-md border bg-muted p-0.5`,role:`tablist`,"aria-label":`Schema view mode`,children:[`json`,`explorer`].map(e=>(0,I.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":u===e,className:`rounded px-2 py-0.5 text-[11px] font-medium capitalize data-[active=true]:bg-background data-[active=true]:shadow-xs`,"data-active":u===e,onClick:t=>{t.preventDefault(),t.stopPropagation(),d(e)},children:e.toUpperCase()},e))}),(0,I.jsx)(rn,{className:`h-4 w-4 text-muted-foreground transition-transform group-open/schema:rotate-180`})]})]}),(0,I.jsxs)(`div`,{className:`mt-2`,children:[u===`json`&&(0,I.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[e!==void 0&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(j7,{title:`Input schema`,schema:e}),(0,I.jsx)(`pre`,{className:`max-h-52 max-w-full overflow-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/20 p-2 text-[11px]`,children:E7(e)})]}),t!==void 0&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(j7,{title:`Output schema`,schema:t}),(0,I.jsx)(`pre`,{className:`max-h-52 max-w-full overflow-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/20 p-2 text-[11px]`,children:E7(t)})]})]}),u===`explorer`&&(0,I.jsxs)(`div`,{className:`mt-2 min-w-0 space-y-2`,children:[e!==void 0&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 rounded border bg-muted/10 p-2`,children:[(0,I.jsx)(j7,{title:`Input schema`,schema:e,explorerControls:(0,I.jsx)(A7,{propertyCount:O7(e),onExpandAll:()=>s(!0),onCollapseAll:()=>s(!1)})}),(0,I.jsx)(k7,{name:`root`,schema:e,expandAll:o})]}),t!==void 0&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 rounded border bg-muted/10 p-2`,children:[(0,I.jsx)(j7,{title:`Output schema`,schema:t,explorerControls:(0,I.jsx)(A7,{propertyCount:O7(t),onExpandAll:()=>l(!0),onCollapseAll:()=>l(!1)})}),(0,I.jsx)(k7,{name:`root`,schema:t,expandAll:c})]})]})]})]})}function N7(e,t){let n=t??(typeof navigator<`u`?navigator.language:void 0);return e.toLocaleString(n)}function P7(e,t){let n=0,r=!1;for(let i of e){let e=i.tokenEstimate;if(!e)continue;r=!0;let a=new Set(t[i.serverName]??[]);n+=e.tools.filter(e=>a.has(e.name)).reduce((e,t)=>e+t.total,0)}return r?n:void 0}function F7({total:e,title:t=`Estimated tokens for this tool definition and its schemas`,className:n}){return typeof e==`number`?(0,I.jsxs)(Y,{variant:`outline`,className:U(`bg-background font-mono text-xs font-normal`,n),title:t,children:[`~`,N7(e),`tok`]}):null}var I7=[`critical`,`high`,`medium`,`low`,`info`];function L7(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 R7(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 z7(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`tool`}async function B7(e,t){let n=typeof t==`string`?t:JSON.stringify(t,null,2);try{await navigator.clipboard.writeText(n),O({title:`${e} copied`})}catch(t){O({title:`Could not copy ${e.toLowerCase()}`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}}function V7({text:e}){return(0,I.jsxs)(`div`,{className:`mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800`,children:[(0,I.jsxs)(`div`,{className:`mb-1 inline-flex items-center gap-1 font-medium text-slate-700`,children:[(0,I.jsx)(Nn,{className:`h-3.5 w-3.5`}),`Suggested improvement`]}),(0,I.jsx)(`p`,{children:e})]})}function Dte({label:e,reason:t,variantClassName:n}){return(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,className:n,children:e})}),(0,I.jsx)(hl,{className:`max-w-sm text-xs`,children:(0,I.jsx)(`p`,{children:t})})]})})}function H7(e){let t=[],n=(e,n)=>{t.push(`#### ${e}`),t.push("```json");try{t.push(JSON.stringify(n,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){let n=Object.entries(e.mcpServerVersions).map(([e,t])=>`${e}: ${t??`unknown`}`).join(`, `);t.push(`- MCP Server Versions: ${n}`)}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(let r of e.servers){t.push(`## Server: ${r.serverName}`),r.warnings.length>0&&t.push(...r.warnings.map(e=>`- Warning: ${e}`),``);for(let e of r.tools){if(t.push(`### ${e.publicToolName}`),e.title&&t.push(`- Title: ${e.title}`),t.push(`- Safety: ${e.safetyClassification} (${e.classificationReason})`),e.inputSchema!==void 0&&n(`Input schema`,e.inputSchema),e.outputSchema!==void 0&&n(`Output schema`,e.outputSchema),e.metadataReview?.issues.length){t.push(`#### Metadata issues`);for(let n of e.metadataReview.issues)t.push(` - [${n.severity}] ${n.title}: ${n.detail}`)}if(e.deeperAnalysis){if(!e.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${e.deeperAnalysis.skippedReason??`unknown`})`);else{t.push(`- Deeper analysis sample calls: ${e.deeperAnalysis.sampleCalls.length}`);for(let n of e.deeperAnalysis.sampleCalls){t.push(` - Call ${n.callIndex}: ${n.ok?`ok`:`error`}${n.durationMs?` (${n.durationMs}ms)`:``}`),n.error&&t.push(` - Error: ${n.error}`);for(let e of n.observations)t.push(` - ${e}`)}}}if(e.overallRecommendations.length>0){t.push(`#### Recommendations`);for(let n of e.overallRecommendations)t.push(` - ${n}`)}if(e.metadataReview?.evalReadinessNotes.length){t.push(`#### Agent/Eval readiness notes`);for(let n of e.metadataReview.evalReadinessNotes)t.push(` - ${n}`)}t.push(``)}}return`${t.join(`
|
|
139
|
-
`)}\n`}function U7({report:e,schemaMode:t,onSchemaModeChange:n}){let[r,i]=pp(),[a,o]=(0,_.useState)([...I7]),[s,c]=(0,_.useState)(new Set),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(`explorer`),h=t??p,g=e=>{n?.(e),t||m(e)},v=r.get(`groupBy`)===`severity`?`severity`:`tool`,y=(0,_.useRef)(null),b=l.trim().toLowerCase(),x=(0,_.useMemo)(()=>new Set(a),[a]),S=e=>{o(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return n.length===0?[...I7]:n})},C=e=>{let t=new URLSearchParams(r);e===`severity`?t.set(`groupBy`,`severity`):t.delete(`groupBy`),i(t,{replace:!0})},w=(0,_.useMemo)(()=>{let t={critical:[],high:[],medium:[],low:[],info:[]};for(let n of e.servers)for(let e of n.tools){let r=`tool-${z7(`${n.serverName}-${e.publicToolName}`)}`,i=`${n.serverName}::${e.publicToolName}`,a=e.publicToolName.split(`::`).pop()??e.publicToolName;for(let n of e.metadataReview?.issues??[]){let e=n.severity;t[e].push({key:`${i}-metadata-${n.id}`,toolAnchorId:r,toolLabel:i,toolDisplayName:a,sourceLabel:`Metadata review`,issue:{id:n.id,title:n.title,detail:n.detail,severity:e,suggestion:n.suggestion}})}for(let n of e.deeperAnalysis?.sampleCalls??[])for(let e of n.issues){let o=e.severity;t[o].push({key:`${i}-call-${n.callIndex}-${e.id}`,toolAnchorId:r,toolLabel:i,toolDisplayName:a,sourceLabel:`Sample call ${n.callIndex}`,issue:{id:e.id,title:e.title,detail:e.detail,severity:o,suggestion:e.suggestion}})}}return t},[e.servers]),T=(0,_.useMemo)(()=>Array.from(new Set(e.servers.flatMap(e=>e.tools.map(e=>e.publicToolName)).map(e=>e.split(`::`).pop()??e))).sort((e,t)=>e.localeCompare(t)),[e.servers]),E=e=>b.length===0||(e.toLowerCase().split(`::`).pop()??e.toLowerCase()).includes(b),D=e=>{y.current&&y.current.querySelectorAll(`details`).forEach(t=>{t.open=e})},O=()=>c(new Set(I7)),k=()=>c(new Set),A=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Tools analyzed`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold`,children:e.summary.toolsAnalyzed})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Tools skipped`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold`,children:e.summary.toolsSkipped})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Findings`}),(0,I.jsx)(`div`,{className:`text-2xl font-semibold`,children:e.findings.length})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Analysis Overview`}),(0,I.jsx)(ey,{children:`Visual breakdown of findings by severity. Click badges to filter the report.`})]}),(0,I.jsx)(q,{children:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[I7.filter(t=>e.summary.issueCounts[t]>0).map(t=>{let n=x.has(t);return(0,I.jsx)(`button`,{type:`button`,onClick:()=>S(t),className:`rounded-full`,"aria-pressed":n,children:(0,I.jsxs)(Y,{variant:`outline`,className:`capitalize font-normal ${n?L7(t):R7(t)} ${n?`ring-1 ring-current`:`opacity-70`}`,children:[t,`: `,e.summary.issueCounts[t]]})},t)}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>o([...I7]),className:`h-7 px-2 text-xs`,children:`Reset`})]})})]}),(0,I.jsxs)(`div`,{className:`space-y-0`,children:[(0,I.jsx)(x0,{value:v,onValueChange:e=>{(e===`tool`||e===`severity`)&&C(e)},className:`min-w-0 px-3 pt-1`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-2 border-b`,children:[(0,I.jsxs)(S0,{className:`h-auto justify-start rounded-none bg-transparent p-0`,children:[(0,I.jsx)(C0,{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`}),(0,I.jsx)(C0,{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`})]}),(0,I.jsxs)(`div`,{className:`mb-2 flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`whitespace-nowrap text-xs text-muted-foreground`,children:`Filter tools`}),(0,I.jsxs)(S8,{open:d,onOpenChange:f,children:[(0,I.jsx)(C8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":d,"aria-controls":`tool-filter-command-list`,className:`h-8 w-[320px] max-w-full justify-between text-xs font-normal`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:l||`All tools`}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(w8,{className:`w-[320px] p-0`,align:`end`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search tools...`}),(0,I.jsxs)(S5,{id:`tool-filter-command-list`,children:[(0,I.jsx)(C5,{children:`No tools found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(E5,{value:`all tools`,onSelect:()=>{u(``),f(!1)},children:`All tools`}),T.map(e=>(0,I.jsx)(E5,{value:e,onSelect:()=>{u(e),f(!1)},children:e},e))]})]})]})})]}),v===`severity`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:k,children:`Expand all`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:O,children:`Collapse all`})]}),v===`tool`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:()=>D(!0),children:`Expand all`}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:()=>D(!1),children:`Collapse all`})]})]})]})}),v===`severity`?(0,I.jsx)(`div`,{className:`space-y-4`,children:I7.filter(e=>x.has(e)).map(e=>{let t=w[e].filter(e=>E(e.toolLabel));if(t.length===0)return null;let n=s.has(e);return(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)($v,{className:`text-base capitalize`,children:e}),(0,I.jsxs)(ey,{children:[t.length,` finding(s)`]})]}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 text-xs`,onClick:()=>A(e),children:n?`Expand`:`Collapse`})})]})}),!n&&(0,I.jsx)(q,{className:`space-y-2`,children:t.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded border p-2 text-xs`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.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:t+1}),(0,I.jsx)(`span`,{className:`min-w-0 font-bold leading-tight`,children:e.issue.title})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${L7(e.issue.severity)}`,children:e.issue.severity})]}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,e.issue.detail]}),(0,I.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-[11px]`,children:[(0,I.jsx)(Y,{variant:`secondary`,className:`font-normal`,children:e.sourceLabel}),(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`h-6 px-2 font-mono text-[11px]`,title:e.toolLabel,onClick:()=>{C(`tool`),requestAnimationFrame(()=>{document.getElementById(e.toolAnchorId)?.scrollIntoView({behavior:`smooth`,block:`start`})})},children:e.toolDisplayName})]}),e.issue.suggestion&&(0,I.jsx)(V7,{text:e.issue.suggestion})]},e.key))})]},e)})}):(0,I.jsx)(`div`,{ref:y,className:`space-y-4`,children:e.servers.map(e=>{let t=e.tokenEstimate,n=e.tools.filter(t=>{let n=`${e.serverName}::${t.publicToolName}`;if(!E(n))return!1;let r=[...t.metadataReview?.issues??[],...t.deeperAnalysis?.sampleCalls.flatMap(e=>e.issues)??[]];return r.length===0?a.length===I7.length:r.some(e=>x.has(e.severity))});return n.length===0?null:(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsxs)($v,{className:`flex items-center gap-2 text-base`,children:[e.serverName,(0,I.jsx)(F7,{total:t?.total,title:`Estimated tokens for the analyzed tool definitions and their schemas`})]}),(0,I.jsxs)(ey,{children:[`Discovered `,e.toolCountDiscovered,` · Showing `,n.length,` of`,` `,e.toolCountAnalyzed,` analyzed · Skipped `,e.toolCountSkipped]})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[e.warnings.length>0&&(0,I.jsxs)(Y5,{children:[(0,I.jsx)(X5,{children:`Warnings`}),(0,I.jsx)(Z5,{children:(0,I.jsx)(`ul`,{className:`ml-4 list-disc space-y-1`,children:e.warnings.map(t=>(0,I.jsx)(`li`,{children:t},`${e.serverName}-${t}`))})})]}),n.map(n=>{let r=t?.tools.find(e=>e.name===n.toolName),i=n.publicToolName.split(`::`).pop()??n.publicToolName,a=T7(n.classificationReason),o=n.safetyClassification===`read_only`?`read-only`:a?`write/delete`:`unsafe/unknown`,s=n.safetyClassification===`read_only`?`border-emerald-200 bg-emerald-50 text-emerald-700`:a?`border-amber-300 bg-amber-50 text-amber-800`:`border-slate-300 bg-slate-100 text-slate-700`;return(0,I.jsxs)(`details`,{id:`tool-${z7(`${e.serverName}-${n.publicToolName}`)}`,className:`group rounded-md border p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer list-none`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0 truncate font-mono text-sm`,title:n.publicToolName,children:i}),(0,I.jsx)(Dte,{label:o,reason:n.classificationReason,variantClassName:s}),(0,I.jsx)(F7,{total:r?.total,className:`text-[10px]`})]}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),n.title&&(0,I.jsx)(`p`,{className:`text-sm text-foreground/85`,children:n.title}),n.description&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.description})]})}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-[11px]`,onClick:()=>void B7(`Tool info`,{server:e.serverName,name:n.publicToolName,title:n.title,description:n.description}),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Tool Info`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-[11px]`,onClick:()=>void B7(`Schemas`,{server:e.serverName,name:n.publicToolName,inputSchema:n.inputSchema,outputSchema:n.outputSchema}),disabled:n.inputSchema===void 0&&n.outputSchema===void 0,children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Schemas`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-[11px]`,onClick:()=>void B7(`Metadata review`,{server:e.serverName,name:n.publicToolName,metadataReview:n.metadataReview}),disabled:!n.metadataReview,children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Metadata Review`]})]}),(0,I.jsx)(M7,{inputSchema:n.inputSchema,outputSchema:n.outputSchema,mode:h,onModeChange:g}),n.metadataReview&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Metadata review`}),n.metadataReview.issues.filter(e=>x.has(e.severity)).length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No metadata issues reported.`}):(0,I.jsx)(`div`,{className:`space-y-1`,children:n.metadataReview.issues.filter(e=>x.has(e.severity)).map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded border p-2 text-xs`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.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:t+1}),(0,I.jsx)(`span`,{className:`min-w-0 font-bold leading-tight`,children:e.title})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${L7(e.severity)}`,children:e.severity})]}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,e.detail]}),e.suggestion&&(0,I.jsx)(V7,{text:e.suggestion})]},e.id))})]}),n.deeperAnalysis&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Deeper analysis`}),n.deeperAnalysis.attempted?(0,I.jsx)(`div`,{className:`space-y-2`,children:n.deeperAnalysis.sampleCalls.map(e=>(0,I.jsxs)(`div`,{className:`rounded border p-2 text-xs`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,I.jsx)(Y,{variant:e.ok?`secondary`:`destructive`,className:`text-[10px]`,children:e.ok?`ok`:`error`}),(0,I.jsxs)(`span`,{children:[`Call `,e.callIndex]}),e.durationMs!==void 0&&(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.durationMs,`ms`]})]}),e.error&&(0,I.jsx)(`p`,{className:`text-destructive`,children:e.error}),e.observations.length>0&&(0,I.jsxs)(`div`,{className:`mt-2`,children:[(0,I.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`}),(0,I.jsx)(`ul`,{className:`ml-4 list-disc space-y-1`,children:e.observations.map((t,r)=>(0,I.jsx)(`li`,{children:t},`${n.publicToolName}-obs-${e.callIndex}-${r}`))})]}),e.issues.filter(e=>x.has(e.severity)).length>0&&(0,I.jsx)(`div`,{className:`mt-2 space-y-1`,children:e.issues.filter(e=>x.has(e.severity)).map((t,n)=>(0,I.jsxs)(`div`,{className:`rounded border p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.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:n+1}),(0,I.jsx)(`span`,{className:`min-w-0 font-bold leading-tight`,children:t.title})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${L7(t.severity)}`,children:t.severity})]}),(0,I.jsxs)(`p`,{children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,t.detail]}),t.suggestion&&(0,I.jsx)(V7,{text:t.suggestion})]},`${e.callIndex}-${t.id}`))})]},`${n.publicToolName}-call-${e.callIndex}`))}):(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.deeperAnalysis.skippedReason??`Skipped`})]})]})]},n.publicToolName)})]})]},e.serverName)})})]})]})}function W7(e){return{reportId:e.reportId,createdAt:e.createdAt,tools:e.report.servers.flatMap(e=>e.tools.map(t=>({server:e.serverName,name:t.publicToolName,title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema})))}}function Ote(e){let t=e.selectedToolNames?.length?new Set(e.selectedToolNames):null;return{serverName:e.serverName,tools:e.tools.filter(e=>!t||t.has(e.name)).map(e=>({name:e.name,title:e.title,description:e.description,inputSchema:e.inputSchema,outputSchema:e.outputSchema}))}}function G7(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``)}function kte(e,t){let n=[`tool-info`,G7(e)],r=t?.trim();return r&&n.push(`v${G7(r)}`),`${n.filter(Boolean).join(`-`)}.json`}function Ate(e){let t=0,n=new Set,r=new Set;for(let i of e){let e=typeof i.payload?.message==`string`?i.payload.message:``;if(!e)continue;let a=e.match(/\((\d+)\s+selected\s+of\s+\d+\s+discovered\)/i);a&&(t=Math.max(t,Number(a[1])||0));let o=e.match(/^Started\s+(.+)$/);o&&n.add(o[1]);let s=e.match(/^Finished\s+(.+)$/);s&&r.add(s[1])}let i=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:i}}var K7=`mcplab.toolAnalysis.activeJobId`;function q7(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}async function jte(e,t){try{await navigator.clipboard.writeText(t),O({title:`${e} copied`})}catch(t){O({title:`Could not copy ${e.toLowerCase()}`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}}function J7({text:e}){return(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,className:`inline-flex h-4 w-4 items-center justify-center rounded text-muted-foreground hover:text-foreground`,onClick:e=>e.preventDefault(),"aria-label":e,children:(0,I.jsx)(un,{className:`h-3.5 w-3.5`})})}),(0,I.jsx)(hl,{className:`max-w-xs text-xs`,children:(0,I.jsx)(`p`,{children:e})})]})}function Mte(e,t){let 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 Nte({label:e,reason:t,variantClassName:n}){return(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,className:n,children:e})}),(0,I.jsx)(hl,{className:`max-w-sm text-xs`,children:(0,I.jsx)(`p`,{children:t})})]})})}var Pte=()=>{let e=e=>`tool-analysis-${Date.now()}.${e}`,{source:t}=Rv(),{servers:n,agents:r,loading:i,reload:a}=Zv(),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)([]),[m,h]=(0,_.useState)({}),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(!0),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(2),[T,E]=(0,_.useState)(1),[D,k]=(0,_.useState)(1e4),[A,j]=(0,_.useState)(null),[M,N]=(0,_.useState)([]),[P,F]=(0,_.useState)(null),[L,R]=(0,_.useState)(null),[z,B]=(0,_.useState)(!1),[ee,te]=(0,_.useState)(`configure`),[ne,re]=(0,_.useState)(`explorer`),[ie,ae]=(0,_.useState)(`idle`),[oe,se]=(0,_.useState)(!1),V=(0,_.useRef)(null),ce=(0,_.useRef)(null),le=o||r[0]?.name||``,ue=(0,_.useMemo)(()=>Ate(M),[M]);(0,_.useEffect)(()=>{let e=!0;return t.getWorkspaceSettings().then(t=>{e&&t&&s(t.scenarioAssistantAgentName??``)}).catch(()=>{e&&s(``)}),()=>{e=!1}},[t]),(0,_.useEffect)(()=>()=>{V.current?.()},[]),(0,_.useEffect)(()=>{let e=ce.current;e&&requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight})},[M.length]);let H=()=>{try{sessionStorage.removeItem(K7)}catch{}},de=e=>{try{sessionStorage.setItem(K7,e)}catch{}},fe=e=>{V.current?.(),V.current=t.subscribeToolAnalysisJob(e,n=>{if(N(e=>[...e,n]),n.type===`completed`)t.getToolAnalysisResult(e).then(e=>{F(e.report),R(e.savedReportId??null)}).catch(e=>O({title:`Could not load analysis report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})).finally(()=>{H(),j(null),B(!1),ae(`idle`),te(`run`)});else if(n.type===`error`){let e=String(n.payload?.message??``);H(),ae(e.toLowerCase().includes(`abort`)?`stopped`:`error`),j(null),B(!1)}})};(0,_.useEffect)(()=>{if(A||P)return;let e=``;try{e=sessionStorage.getItem(K7)??``}catch{e=``}if(e)return te(`run`),ae(`running`),B(!0),j(e),N([]),fe(e),()=>{}},[t,A,P]);let pe=async()=>{if(c.length===0){p([]),h({});return}let e=c.filter(e=>n.find(t=>t.id===e)?.authType===`oauth2`);try{e.length>0&&(se(!0),await x4({serverNames:e,source:t,onServerAuthStart:e=>{O({title:`OAuth login required for ${e}`,description:`Complete login in the opened browser tab. Discovery will continue automatically.`})}}))}catch(e){O({title:`OAuth login failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`}),se(!1);return}finally{se(!1)}d(!0);try{let e=await t.discoverToolsForAnalysis({serverNames:c});p(e.servers),h(t=>{let n={};for(let r of e.servers){let e=t[r.serverName]??[],i=r.tools.map(e=>e.name),a=e.filter(e=>i.includes(e));n[r.serverName]=a.length>0?a:i}return n})}catch(e){O({title:`Could not discover MCP tools`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{d(!1)}};(0,_.useEffect)(()=>{pe()},[c.join(`|`)]);let me=(0,_.useMemo)(()=>{let e=g.trim().toLowerCase();return e?f.map(t=>({...t,tools:t.tools.filter(t=>t.name.toLowerCase().includes(e)||(t.description||``).toLowerCase().includes(e))})).filter(e=>e.tools.length>0):f},[f,g]),he=(0,_.useMemo)(()=>Object.values(m).reduce((e,t)=>e+t.length,0),[m]),ge=(0,_.useMemo)(()=>P7(f,m),[f,m]),_e=c[0]??``,ve=async()=>{if(!y&&!x)O({title:`Select at least one mode`,variant:`destructive`});else if(c.length!==1)O({title:`Select exactly one server`,variant:`destructive`});else if(he===0)O({title:`Select at least one tool`,variant:`destructive`});else{B(!0),N([]),F(null),R(null),te(`run`),ae(`running`);try{let e=c[0];n.find(t=>t.id===e)?.authType===`oauth2`&&(se(!0),await x4({serverNames:[e],source:t,onServerAuthStart:e=>{O({title:`OAuth login required for ${e}`,description:`Complete login in the opened browser tab. Analysis will continue automatically.`})}}));let{jobId:r}=await t.startToolAnalysis({serverNames:c,selectedToolsByServer:m,maxParallelTools:C,modes:{metadataReview:y,deeperAnalysis:x},deeperAnalysisOptions:{autoRunPolicy:`read_only_allowlist`,sampleCallsPerTool:T,toolCallTimeoutMs:D}});j(r),de(r),fe(r)}catch(e){B(!1),ae(`error`),te(`run`),O({title:`Could not start tool analysis`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{se(!1)}}},ye=()=>{let e=c[0],t=f.find(t=>t.serverName===e);if(!e||!t){O({title:`No discovered tool info available`,description:`Select a server and discover tools before downloading tool info.`,variant:`destructive`});return}let n=Ote({serverName:t.serverName,tools:t.tools,selectedToolNames:m[t.serverName]});q7(kte(t.serverName,t.mcpServerVersion),`${JSON.stringify(n,null,2)}\n`,`application/json`)},be=async()=>{if(!A)return;let e=A;try{let n=await t.stopToolAnalysis(e);if(n.status===`completed`){V.current?.(),V.current=null;let n=await t.getToolAnalysisResult(e);F(n.report),R(n.savedReportId??null),H(),j(null),B(!1),ae(`idle`),te(`run`),O({title:`Analysis already finished`,description:`Showing the result overview.`});return}if(n.status===`stopped`){V.current?.(),V.current=null,H(),j(null),B(!1),ae(`stopped`),O({title:`Analysis stopped`});return}if(n.status===`error`){V.current?.(),V.current=null,H(),j(null),B(!1),ae(`error`),O({title:`Analysis already ended with an error`,description:`Review the progress log and return to Configure Analysis.`});return}O({title:`Stopping analysis...`})}catch(e){O({title:`Could not stop analysis`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},xe=()=>{te(`configure`),ae(`idle`),j(null)},Se=(e,t)=>{l(n=>t?[e]:n.filter(t=>t!==e))},Ce=(e,t,n)=>{h(r=>{let i=new Set(r[e]??[]);return n?i.add(t):i.delete(t),{...r,[e]:Array.from(i)}})},we=(e,t)=>{h(n=>({...n,[e]:t}))},Te=A!==null||M.length>0||ie===`stopped`||ie===`error`,Ee=!!P,De=e=>{e===`configure`?te(`configure`):e===`run`&&Te?te(`run`):e===`report`&&Ee&&te(`report`)};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Ln,{className:`h-6 w-6`}),`Analyze MCP Tools`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Review MCP tools for schema quality, ergonomics, and agent/eval readiness.`})]}),(0,I.jsxs)(`div`,{className:`hidden flex-wrap items-center gap-2 md:flex`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>De(`configure`),className:`rounded-full`,"aria-label":`Open Configure Analysis`,children:(0,I.jsx)(Y,{variant:ee===`configure`?`default`:`outline-solid`,className:`cursor-pointer`,children:`Configure Analysis`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>De(`run`),disabled:!Te,className:`rounded-full disabled:cursor-not-allowed disabled:opacity-60`,"aria-label":`Open Run Analysis`,children:(0,I.jsx)(Y,{variant:ee===`run`?`default`:`outline-solid`,className:Te?`cursor-pointer`:`cursor-not-allowed`,children:`Run Analysis`})}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>De(`report`),disabled:!Ee,className:`rounded-full disabled:cursor-not-allowed disabled:opacity-60`,"aria-label":`Open Report`,children:(0,I.jsx)(Y,{variant:ee===`report`?`default`:`outline-solid`,className:Ee?`cursor-pointer`:`cursor-not-allowed`,children:`Report`})})]})]}),ee===`configure`&&(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{children:[(0,I.jsx)($v,{className:`text-base`,children:`Run MCP analysis`}),(0,I.jsx)(ey,{children:`Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report.`})]}),(0,I.jsxs)(q,{className:`space-y-5`,children:[!le&&(0,I.jsxs)(Y5,{children:[(0,I.jsx)(X5,{children:`No assistant agent available`}),(0,I.jsxs)(Z5,{children:[`Add a library agent in`,` `,(0,I.jsx)(sp,{to:`/libraries/agents`,className:`underline`,children:`Agents`}),` `,`and optionally set the default Scenario Assistant Agent in`,` `,(0,I.jsx)(sp,{to:`/settings`,className:`underline`,children:`Settings`}),`.`]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Servers`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:i||oe,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Refresh Servers`]})]}),(0,I.jsx)(`div`,{className:`grid gap-2 rounded-md border p-3 md:grid-cols-2`,children:n.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No library servers configured.`}):n.map(e=>{let t=c.includes(e.id);return(0,I.jsxs)(`label`,{className:`flex items-start gap-2 rounded-md border p-2 text-sm`,children:[(0,I.jsx)(W0,{checked:t,onCheckedChange:t=>Se(e.id,!!t)}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.name||e.id}),e.url&&(0,I.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.url})]})]},e.id)})}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Select exactly one MCP server for analysis.`})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Filter visible tools`}),(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(Zn,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground`}),(0,I.jsx)(Np,{className:`h-9 pl-8`,placeholder:`Filter tools by name or description...`,value:g,onChange:e=>v(e.target.value)})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Filtering only changes what is shown; selected tools remain selected.`})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)($,{className:`text-xs`,children:_e?`Tools for ${_e}`:`Tools`}),(0,I.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:ye,disabled:u||oe||c.length===0||f.length===0,children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Download Tool Info`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void pe(),disabled:u||oe||c.length===0,children:[u&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),`Discover Tools`]})]})]}),(0,I.jsx)(`div`,{className:`space-y-3 rounded-md border p-3`,children:c.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Select a server to discover tools.`}):u&&f.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading tools...`}):me.length===0&&!u?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No discovered tools match the current filters.`}):me.map(e=>{let t=new Set(m[e.serverName]??[]);return(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`font-medium`,children:e.serverName}),(0,I.jsx)(F7,{total:e.tokenEstimate?.total,title:`Estimated tokens for all discovered tool definitions and their schemas`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>void jte(`Tool list`,`${JSON.stringify({server:e.serverName,tools:e.tools.map(e=>({name:e.name,title:e.title,description:e.description}))},null,2)}\n`),children:[(0,I.jsx)(hn,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>we(e.serverName,e.tools.map(e=>e.name)),children:`Select all`}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>we(e.serverName,[]),children:`Clear`})]})]}),e.warnings.length>0&&(0,I.jsx)(`div`,{className:`mb-2 space-y-1`,children:e.warnings.map(t=>(0,I.jsx)(`div`,{className:`text-xs text-amber-700`,children:Mte(e.serverName,t)},`${e.serverName}-${t}`))}),(0,I.jsx)(`div`,{className:`grid gap-2`,children:e.tools.map(n=>{let r=e.tokenEstimate?.tools.find(e=>e.name===n.name),i=T7(n.classificationReason),a=n.safetyClassification===`read_only`?`read-only`:i?`write/delete`:`unsafe/unknown`,o=n.safetyClassification===`read_only`?`border-emerald-200 bg-emerald-50 text-emerald-700`:i?`border-amber-300 bg-amber-50 text-amber-800`:`border-slate-300 bg-slate-100 text-slate-700`;return(0,I.jsxs)(`label`,{className:`flex items-start gap-2 rounded border p-2`,children:[(0,I.jsx)(W0,{checked:t.has(n.name),onCheckedChange:t=>Ce(e.serverName,n.name,!!t)}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:n.name}),n.title&&(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.title}),(0,I.jsx)(Nte,{label:a,reason:n.classificationReason,variantClassName:o}),n.inputSchema&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`schema: input`}),n.outputSchema&&(0,I.jsx)(Y,{variant:`outline`,className:`border-border text-[10px] text-muted-foreground`,children:`schema: output`}),(0,I.jsx)(F7,{total:r?.total,className:`text-[10px]`})]}),n.description&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:n.description}),(0,I.jsx)(M7,{inputSchema:n.inputSchema,outputSchema:n.outputSchema,mode:ne,onModeChange:re})]})]},`${e.serverName}-${n.name}`)})})]},e.serverName)})}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Selected tools: `,he,ge!==void 0&&` · estimated context: ~${N7(ge)} tokens`]})]}),(0,I.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Analysis Modes`}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(W0,{checked:y,onCheckedChange:e=>b(!!e)}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Metadata / schema review`,(0,I.jsx)(J7,{text:`No tool execution. Reviews tool names, descriptions, and schemas only.`})]})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(W0,{checked:x,onCheckedChange:e=>S(!!e)}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`Deeper analysis`,(0,I.jsx)(J7,{text:`Runs sample MCP tool calls automatically for read-only tools only (based on the safety allowlist).`})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-3 rounded-md border bg-muted/20 p-3 md:grid-cols-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Max parallel tools`}),(0,I.jsx)(Np,{type:`number`,min:1,max:8,value:C,onChange:e=>w(Math.max(1,Math.min(8,Number(e.target.value)||2))),className:`h-8`})]}),x?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Safety profile`}),(0,I.jsx)(`div`,{className:`text-sm`,children:`Read-only allowlist only`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Sample calls per tool`}),(0,I.jsx)(Np,{type:`number`,min:1,max:5,value:T,onChange:e=>E(Math.max(1,Math.min(5,Number(e.target.value)||1))),className:`h-8`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Tool call timeout (ms)`}),(0,I.jsx)(Np,{type:`number`,min:1e3,max:6e4,step:500,value:D,onChange:e=>k(Math.max(1e3,Math.min(6e4,Number(e.target.value)||1e4))),className:`h-8`})]}),(0,I.jsx)(`div`,{className:`md:col-span-3 text-xs text-amber-700`,children:`Deeper analysis may execute read-only MCP tools automatically.`})]}):null]})]}),(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:(0,I.jsxs)(W,{type:`button`,onClick:()=>void ve(),disabled:z||oe||!!A,children:[(z||!!A)&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),`Analyze Tools`]})})]})]}),ee===`run`&&(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)($v,{className:`flex items-center gap-2 text-base`,children:(0,I.jsx)(`span`,{children:`Progress`})}),(0,I.jsx)(ey,{children:A?`Live tool-analysis job events:`:P?`Analysis finished. Review the summary below or open the saved report details.`:ie===`stopped`?`Analysis was stopped. You can return to Configure Analysis.`:ie===`error`?`Analysis ended with an error. Review the log and go back to Configure Analysis.`:`Analysis finished.`})]}),A?(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void be(),children:`Stop Analysis`}):(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:xe,children:`Back to Configure Analysis`})]})}),(0,I.jsxs)(q,{className:`space-y-2`,children:[A&&(0,I.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:[(0,I.jsx)(In,{className:`h-3.5 w-3.5 animate-spin`}),`Analysis is still running...`]}),(ue.totalTools>0||A)&&(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:ue.totalTools>0?`${ue.finishedTools}/${ue.totalTools} tools finished`:`Preparing analysis...`}),(0,I.jsx)(`span`,{children:ue.totalTools>0?`${ue.percent}%`:`0%`})]}),(0,I.jsx)(w7,{value:ue.totalTools>0?ue.percent:0,className:`h-2`})]}),M.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:A?`Starting analysis...`:`No progress events captured.`}):(0,I.jsx)(`div`,{ref:ce,className:`max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2`,children:M.map((e,t)=>(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsx)(`span`,{className:`mr-2 font-mono text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,I.jsx)(Y,{variant:`outline`,className:`mr-2 text-[10px]`,children:e.type}),(0,I.jsx)(`span`,{className:`break-all`,children:typeof e.payload.message==`string`?e.payload.message:JSON.stringify(e.payload)})]},`${e.ts}-${t}`))}),!A&&P&&(0,I.jsx)(K,{className:`mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10`,children:(0,I.jsxs)(q,{className:`pt-4 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-sm font-semibold`,children:`Result overview`}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[P.summary.toolsAnalyzed,` tools analyzed, `,P.summary.toolsSkipped,` `,`skipped, across `,P.summary.serversAnalyzed,` server`,P.summary.serversAnalyzed===1?``:`s`,`.`]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[L&&(0,I.jsx)(W,{asChild:!0,size:`sm`,children:(0,I.jsx)(sp,{to:`/tool-analysis-results/${L}`,children:`Open result details`})}),(0,I.jsx)(W,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)(sp,{to:`/tool-analysis-results`,children:`View all results`})}),(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>De(`report`),children:`View inline report`})]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[P.summary.issueCounts.critical>0&&(0,I.jsxs)(Y,{className:`bg-red-600 text-white hover:bg-red-600`,children:[`Critical: `,P.summary.issueCounts.critical]}),P.summary.issueCounts.high>0&&(0,I.jsxs)(Y,{className:`bg-orange-500 text-white hover:bg-orange-500`,children:[`High: `,P.summary.issueCounts.high]}),P.summary.issueCounts.medium>0&&(0,I.jsxs)(Y,{className:`bg-amber-500 text-white hover:bg-amber-500`,children:[`Medium: `,P.summary.issueCounts.medium]}),P.summary.issueCounts.low>0&&(0,I.jsxs)(Y,{className:`bg-blue-500 text-white hover:bg-blue-500`,children:[`Low: `,P.summary.issueCounts.low]}),P.summary.issueCounts.info>0&&(0,I.jsxs)(Y,{variant:`outline`,children:[`Info: `,P.summary.issueCounts.info]}),Object.values(P.summary.issueCounts).every(e=>e===0)&&(0,I.jsx)(Y,{className:`bg-green-600 text-white hover:bg-green-600`,children:`No findings`})]})]})})]})]}),ee===`report`&&P&&(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold`,children:`Report`}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[P.summary.toolsAnalyzed,` tools analyzed across`,` `,P.summary.serversAnalyzed,` server`,P.summary.serversAnalyzed===1?``:`s`,`.`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:xe,children:`Back to Configure Analysis`}),L&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsx)(sp,{to:`/tool-analysis-results/${L}`,children:`Open saved report`})}),(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsx)(sp,{to:`/tool-analysis-results`,children:`View all reports`})})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>q7(e(`json`),`${JSON.stringify(P,null,2)}\n`,`application/json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export JSON`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>q7(e(`md`),H7(P),`text/markdown`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]})]})]}),(0,I.jsx)(U7,{report:P,schemaMode:ne,onSchemaModeChange:re})]})]})};function Y7({versions:e,showPrefix:t=!0,className:n}){let r=Object.entries(e??{}).sort((e,t)=>e[0].localeCompare(t[0])).map(([e,t])=>`${e}@${t??`unknown`}`).join(`, `);return r?(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsxs)(`span`,{tabIndex:0,className:U(`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] leading-none text-muted-foreground`,n),children:[t?(0,I.jsx)(`span`,{className:`font-medium`,children:`MCP:`}):null,(0,I.jsx)(`span`,{className:U(t?`ml-1`:``,`min-w-0 truncate font-mono`),children:r})]})}),(0,I.jsx)(hl,{className:`max-w-md wrap-break-word text-xs`,children:(0,I.jsx)(`span`,{className:`font-mono`,children:r})})]})}):null}function X7(e){let[t,n]=(0,_.useState)(0),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(0),s=(0,_.useCallback)(()=>{n(t=>Math.max(0,t-e))},[e]),c=(0,_.useCallback)(()=>{n(t=>t+e)},[e]),l=(0,_.useCallback)(()=>n(0),[]),u=(0,_.useCallback)(e=>{i(e.has_more),o(e.total_count)},[]),d=(0,_.useCallback)(e=>a<=0||e<=0?`Showing 0 of 0`:`Showing ${t+1}-${Math.min(t+e,a)} of ${a}`,[t,a]);return(0,_.useMemo)(()=>({limit:e,offset:t,hasMore:r,totalCount:a,setOffset:n,setHasMore:i,setTotalCount:o,prev:s,next:c,reset:l,updateMeta:u,rangeLabel:d}),[r,e,c,t,s,d,l,a,u])}function Z7(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}function Fte(){let{source:e}=Rv(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(`all`),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)([]),h=X7(100),{offset:g,hasMore:v}=h,y=async()=>{i(!0);try{if(e.listToolAnalysisResultsPage){let t=await e.listToolAnalysisResultsPage({limit:100,offset:g,server:l===`all`?void 0:l});n(t.data),h.updateMeta(t)}else n(await e.listToolAnalysisResults({limit:100,offset:g,server:l===`all`?void 0:l}))}catch(e){O({title:`Could not load tool analysis results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{i(!1)}};(0,_.useEffect)(()=>{y()},[g,l]),(0,_.useEffect)(()=>{e.listToolAnalysisServers&&e.listToolAnalysisServers().then(e=>m(e)).catch(()=>{m([])})},[e]),(0,_.useEffect)(()=>{e.listToolAnalysisServers||m(Array.from(new Set(t.flatMap(e=>e.serverNames))).sort((e,t)=>e.localeCompare(t)))},[t,e]),(0,_.useEffect)(()=>{h.reset()},[h.reset,l]);let b=(0,_.useMemo)(()=>t.find(e=>e.reportId===a)??null,[t,a]),x=async()=>{if(a){c(!0);try{await e.deleteToolAnalysisSavedResult(a),n(e=>e.filter(e=>e.reportId!==a)),O({title:`Tool analysis report deleted`}),o(null)}catch(e){O({title:`Could not delete report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{c(!1)}}},S=async(t,n)=>{try{let r=await e.getToolAnalysisSavedResult(t);n===`json`?Z7(`${t}.json`,`${JSON.stringify(r,null,2)}\n`,`application/json`):n===`tool_schemas`?Z7(`${t}-tool-schemas.json`,`${JSON.stringify(W7(r),null,2)}\n`,`application/json`):Z7(`${t}.md`,H7(r.report),`text/markdown`)}catch(e){O({title:`Could not export saved report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(zn,{className:`h-6 w-6`}),`Tool Analysis Results`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Browse persisted Analyze MCP Tools reports.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`MCP server`}),(0,I.jsxs)(S8,{open:d,onOpenChange:f,children:[(0,I.jsx)(C8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":d,"aria-controls":`tool-analysis-server-command-list`,className:`h-9 w-[240px] justify-between font-normal ${l===`all`?``:`border-primary/40`}`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:l===`all`?`All servers`:l}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(w8,{className:`w-[240px] p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search MCP servers...`}),(0,I.jsxs)(S5,{id:`tool-analysis-server-command-list`,children:[(0,I.jsx)(C5,{children:`No servers found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(E5,{value:`all servers`,onSelect:()=>{u(`all`),f(!1)},children:`All servers`}),p.map(e=>(0,I.jsx)(E5,{value:e,onSelect:()=>{u(e),f(!1)},children:e},e))]})]})]})})]})]}),(0,I.jsx)(W,{variant:`outline`,onClick:()=>void y(),disabled:r,children:r?`Refreshing...`:`Refresh`}),(0,I.jsx)(W,{variant:`outline`,onClick:h.prev,disabled:r||g===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:h.next,disabled:r||!v,children:`Next`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(sp,{to:`/tool-analysis`,children:`Analyze MCP Tools`})})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h.rangeLabel(t.length)}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:r?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`Loading tool analysis results...`}):t.length===0?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`No saved tool analysis reports yet.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Showing `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:t.length}),` `,`reports`]})}),t.length===0?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`No reports for the selected MCP server.`}):(0,I.jsxs)(ny,{children:[(0,I.jsx)(ry,{children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{children:`Report ID`}),(0,I.jsx)(sy,{children:`Evaluated`}),(0,I.jsx)(sy,{children:`Timestamp`}),(0,I.jsx)(sy,{children:`Issues`}),(0,I.jsx)(sy,{children:`Modes`}),(0,I.jsx)(sy,{className:`w-10`})]})}),(0,I.jsx)(iy,{children:t.map(e=>(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(sp,{to:`/tool-analysis-results/${e.reportId}`,className:`font-mono text-xs text-primary hover:underline`,children:e.reportId}),(0,I.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:e.assistantAgentName})]})}),(0,I.jsx)(J,{className:`text-[11px] text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{children:[`Servers:`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.serverNames.length}),` `,`· Tools:`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.summary.toolsAnalyzed}),` · `,`Skipped:`,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.summary.toolsSkipped})]}),Object.keys(e.mcpServerVersions??{}).length>0?(0,I.jsx)(Y7,{versions:e.mcpServerVersions,showPrefix:!1}):(0,I.jsxs)(`div`,{className:`font-mono text-xs text-foreground/80`,children:[e.serverNames.slice(0,2).join(`, `),e.serverNames.length>2?` +${e.serverNames.length-2}`:``]})]})}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.createdAt).toLocaleString()]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[[`critical`,`high`,`medium`,`low`,`info`].map(t=>e.summary.issueCounts[t]>0?(0,I.jsxs)(Y,{variant:`outline`,className:`capitalize`,children:[t,`: `,e.summary.issueCounts[t]]},`${e.reportId}-${t}`):null),Object.values(e.summary.issueCounts).every(e=>e===0)&&(0,I.jsx)(Y,{variant:`outline`,children:`No issues`})]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.modes.metadataReview&&(0,I.jsx)(Y,{variant:`outline`,children:`metadata`}),e.modes.deeperAnalysis&&(0,I.jsx)(Y,{variant:`outline`,children:`deeper`})]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(LQ,{children:[(0,I.jsx)(RQ,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,I.jsx)(vn,{className:`h-4 w-4`})})}),(0,I.jsxs)(VQ,{align:`end`,children:[(0,I.jsx)(HQ,{asChild:!0,children:(0,I.jsx)(sp,{to:`/tool-analysis-results/${e.reportId}`,children:`View`})}),(0,I.jsxs)(HQ,{onSelect:()=>void S(e.reportId,`json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-3.5 w-3.5`}),` Export JSON`]}),(0,I.jsxs)(HQ,{onSelect:()=>void S(e.reportId,`markdown`),children:[(0,I.jsx)(gn,{className:`mr-2 h-3.5 w-3.5`}),` Export Markdown`]}),(0,I.jsxs)(HQ,{className:`text-destructive`,onSelect:t=>{t.preventDefault(),o(e.reportId)},children:[(0,I.jsx)(ar,{className:`mr-2 h-3.5 w-3.5`}),` Delete`]}),(0,I.jsxs)(HQ,{onSelect:()=>void S(e.reportId,`tool_schemas`),children:[(0,I.jsx)(gn,{className:`mr-2 h-3.5 w-3.5`}),` Export MCP Info`]})]})]})})]},e.reportId))})]})]})})}),(0,I.jsx)(z3,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete tool analysis report?`}),(0,I.jsx)(K3,{children:b?`Delete saved report '${b.reportId}' from disk? This cannot be undone.`:`Delete this saved report from disk? This cannot be undone.`})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{disabled:s,children:`Cancel`}),(0,I.jsx)(q3,{onClick:e=>{e.preventDefault(),x()},disabled:s,children:s?`Deleting...`:`Delete`})]})]})})]})}function Q7(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),URL.revokeObjectURL(i)}function Ite(){let{id:e=``}=qd(),t=Ud(),{source:n}=Rv(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!0),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let t=!0;return o(!0),c(!1),n.getToolAnalysisSavedResult(e).then(e=>{t&&i(e)}).catch(e=>{if(!t)return;let n=e instanceof Error?e.message:String(e);n.includes(`(404)`)?(c(!0),i(null)):O({title:`Could not load saved tool analysis report`,description:n,variant:`destructive`})}).finally(()=>{t&&o(!1)}),()=>{t=!1}},[e,n]);let p=async()=>{f(!0);try{await n.deleteToolAnalysisSavedResult(e),O({title:`Tool analysis report deleted`}),t(`/tool-analysis-results`)}catch(e){O({title:`Could not delete report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{f(!1),u(!1)}};return a?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading saved tool analysis report...`}):s||!r?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Tool Analysis Result`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Saved report not found.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(sp,{to:`/tool-analysis-results`,children:`Back to Tool Analysis Results`})})]}):(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`font-mono text-xl font-semibold`,children:r.reportId}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 align-middle`,children:[(0,I.jsx)(mn,{className:`h-3 w-3 shrink-0`}),new Date(r.createdAt).toLocaleString()]}),` `,`·`,` `,[r.report.assistantAgentProvider?E0(r.report.assistantAgentProvider):null,r.report.assistantAgentModel].filter(Boolean).join(` · `)||r.serverNames.join(`, `)||`—`]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(Y7,{versions:r.report.mcpServerVersions}),(0,I.jsx)(W,{asChild:!0,size:`sm`,variant:`outline`,children:(0,I.jsx)(sp,{to:`/tool-analysis-results`,children:`Back to results`})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Q7(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}\n`,`application/json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export JSON`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Q7(`${r.reportId}.md`,H7(r.report),`text/markdown`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>Q7(`${r.reportId}-tool-schemas.json`,`${JSON.stringify(W7(r),null,2)}\n`,`application/json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export MCP info`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>u(!0),children:[(0,I.jsx)(ar,{className:`mr-2 h-4 w-4`}),`Delete`]})]})]}),(0,I.jsx)(U7,{report:r.report}),(0,I.jsx)(z3,{open:l,onOpenChange:u,children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete tool analysis report?`}),(0,I.jsxs)(K3,{children:[`Delete saved report '`,r.reportId,`' from disk? This cannot be undone.`]})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{disabled:d,children:`Cancel`}),(0,I.jsx)(q3,{onClick:e=>{e.preventDefault(),p()},disabled:d,children:d?`Deleting...`:`Delete`})]})]})})]})}var Lte=[{id:`configure`,label:`Configure Debug Session`},{id:`run`,label:`Run / Inspect Flow`},{id:`report`,label:`Report / Export`}],Rte=`resolve_target_metadata`,zte=`token_exchange`,Bte=`resource_probe`;function $7({text:e}){return(0,I.jsx)(fl,{delayDuration:200,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{type:`button`,className:`inline-flex shrink-0 items-center`,onClick:e=>e.preventDefault(),children:(0,I.jsx)(An,{className:`h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground`})}),(0,I.jsx)(hl,{className:`max-w-xs text-xs leading-relaxed`,children:e})]})})}function e9(e){return navigator.clipboard.writeText(e)}function t9(){return typeof window>`u`?``:window.location.port===`8685`?`http://127.0.0.1:8787`:``}function n9(e){if(!e)return`No metadata payload captured.`;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return`Non-JSON response body:\n${e}`}}function Vte(e,t){let 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(let t of e.stepStates)n.push(`- ${t.title}: ${t.status}${t.outcomeSummary?` — ${t.outcomeSummary}`:``}`);if(n.push(``),n.push(`## Validation Findings`),e.validations.length===0)n.push(`- None`);else for(let t of e.validations)n.push(`- [${t.severity}] ${t.title} (${t.stepId})`),n.push(` - ${t.detail}`),t.recommendation&&n.push(` - Recommendation: ${t.recommendation}`);n.push(``),n.push(`## Event Log`);for(let e of t){let t=typeof e.payload.message==`string`?e.payload.message:JSON.stringify(e.payload);n.push(`- ${new Date(e.ts).toLocaleTimeString()} [${e.type}] ${t}`)}return`${n.join(`
|
|
140
|
-
`)}\n`}function Hte(){let{source:e}=Rv(),{servers:t,reload:n,loading:r}=Zv(),[i,a]=(0,_.useState)(`configure`),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(`pre_registered`),[u,d]=(0,_.useState)(`local_callback`),[f,p]=(0,_.useState)(!0),[m,h]=(0,_.useState)(!0),[g,v]=(0,_.useState)(!0),[y,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(``),[T,E]=(0,_.useState)(``),[D,k]=(0,_.useState)(`__default__`),[A,j]=(0,_.useState)(`{}`),[M,N]=(0,_.useState)(``),[P,F]=(0,_.useState)(``),[L,R]=(0,_.useState)(``),[z,B]=(0,_.useState)(``),[ee,te]=(0,_.useState)(``),[ne,re]=(0,_.useState)(``),[ie,ae]=(0,_.useState)(``),[oe,se]=(0,_.useState)(``),[V,ce]=(0,_.useState)(null),[le,ue]=(0,_.useState)(null),[H,de]=(0,_.useState)([]),[fe,pe]=(0,_.useState)(!1),[me,he]=(0,_.useState)(!1),[ge,_e]=(0,_.useState)(!1),[ve,ye]=(0,_.useState)(`all`),[be,xe]=(0,_.useState)(`all`),[Se,Ce]=(0,_.useState)(`inspector`),we=(0,_.useRef)(null),Te=(0,_.useRef)(null),Ee=(0,_.useRef)(!1),De=(0,_.useRef)(m);(0,_.useEffect)(()=>{De.current=m},[m]),(0,_.useEffect)(()=>()=>{we.current?.(),we.current=null},[]),(0,_.useEffect)(()=>{Te.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[H.length]);let Oe=(0,_.useMemo)(()=>t.filter(e=>e.authType===`oauth2`).slice().sort((e,t)=>(e.name||e.id).localeCompare(t.name||t.id,void 0,{sensitivity:`base`})),[t]),ke=Oe.find(e=>e.id===o);(0,_.useEffect)(()=>{o&&(Oe.some(e=>e.id===o)||s(``))},[Oe,o]),(0,_.useEffect)(()=>{ke&&(ke.oauthMode===`dcr`?(l(`dcr`),w(``),E(``)):(l(`pre_registered`),w(ke.oauthClientId??``),E(ke.oauthClientSecret??``)),b(ke.oauthScope??``),B(ke.oauthAuthorizationUrl??``),te(ke.oauthTokenEndpoint??``))},[ke?.id]);let Ae=(0,_.useMemo)(()=>{let e=V?.stepStates.length??0,t=V?.stepStates.filter(e=>e.status===`completed`||e.status===`skipped`).length??0,n=V?.stepStates.filter(e=>e.status===`failed`).length??0;return{total:e,completed:t,failed:n,percent:e>0?Math.round((t+n)/e*100):0}},[V]),je=(0,_.useMemo)(()=>{let e=V?.network??[],t=new Map,n=[],r=e=>`${e.stepId}::${e.label}::${e.url}`;for(let i of e){if(i.phase===`request`){let e=n.length;n.push({key:i.id,stepId:i.stepId,label:i.label,method:i.method,url:i.url,request:i});let a=r(i),o=t.get(a)??[];o.push(e),t.set(a,o);continue}let e=r(i),a=t.get(e),o=a?.shift();typeof o==`number`?(n[o]={...n[o],response:i},a&&a.length>0?t.set(e,a):t.delete(e)):n.push({key:i.id,stepId:i.stepId,label:i.label,method:i.method,url:i.url,response:i})}return n.filter(e=>ve!==`all`&&e.stepId!==ve?!1:be===`error`?typeof e.response?.status==`number`&&e.response.status>=400:be!==`ok`||typeof e.response?.status==`number`&&e.response.status<400)},[V?.network,ve,be]),Me=!!le,Ne=!(!V||V.status!==`completed`&&V.status!==`error`&&V.status!==`stopped`),Pe=(0,_.useMemo)(()=>{let e=new Map;return(V?.stepStates??[]).forEach((t,n)=>{e.set(t.id,n+1)}),e},[V?.stepStates]),Fe=(0,_.useMemo)(()=>{let e=(V?.network??[]).filter(e=>e.phase===`response`),t=t=>{let n=e.filter(e=>e.label===t);return[...n].reverse().find(e=>typeof e.status==`number`&&e.status<400)??[...n].reverse()[0]};return{resourceMetadata:t(`Protected Resource Metadata`),authorizationServerMetadata:t(`Authorization Server Metadata`)}},[V?.network]),Ie=(0,_.useMemo)(()=>{let e=new Map;for(let t of V?.network??[]){let n=e.get(t.stepId)??{requests:[],responses:[]};t.phase===`request`&&n.requests.push(t),t.phase===`response`&&n.responses.push(t),e.set(t.stepId,n)}return e},[V?.network]),Le=e=>{if(e===`configure`||e===`run`&&Me||e===`report`&&Ne)return a(e)},Re=()=>{let e;if(c===`dcr`&&A.trim())try{e=JSON.parse(A)}catch{throw Error(`DCR metadata JSON is invalid`)}if(!ke)throw Error(`Select an MCP server`);return{profile:`latest`,target:{serverName:ke.id,overrides:{authorizationServerMetadataUrl:L||void 0,authorizationEndpoint:z||void 0,tokenEndpoint:ee||void 0,registrationEndpoint:ne||void 0,cimdUrl:M||void 0,resourceBaseUrl:ie||void 0}},registrationMethod:c,clientConfig:{preRegistered:c===`pre_registered`?{clientId:C.trim(),clientSecret:T.trim()||void 0,tokenEndpointAuthMethod:D===`__default__`?void 0:D||void 0}:void 0,dcr:c===`dcr`?{metadata:e,tokenEndpointAuthMethod:D===`__default__`?void 0:D||void 0}:void 0,cimd:c===`cimd`?{cimdUrl:M||void 0,expectedClientId:P||void 0}:void 0},runtime:{redirectMode:u,scopes:y.split(/[,\s]+/).map(e=>e.trim()).filter(Boolean),resource:x.trim()||void 0,usePkce:g,codeChallengeMethod:`S256`},display:{showSensitiveValues:f}}},ze=t=>{we.current?.(),we.current=e.subscribeOAuthDebuggerSession(t,n=>{de(e=>[...e,n]),(n.type===`completed`||n.type===`error`||n.type===`stopped`)&&pe(!1),e.getOAuthDebuggerSession(t).then(e=>{ce(e.session),e.session.uiHints.authorizationUrl&&Be(`${t9()}/api/oauth-debugger/sessions/${t}/authorize`),e.session.status===`completed`&&a(`report`)}).catch(()=>{})})},Be=e=>{De.current&&!Ee.current&&e&&(Ee.current=!0,window.open(e,`_blank`,`noopener,noreferrer`))},Ve=async()=>{he(!0),Ee.current=!1;try{let t=Re(),n=await e.createOAuthDebuggerSession(t);ue(n.sessionId),ce(n.session),de([]),a(`run`),ze(n.sessionId);let r=await e.startOAuthDebuggerSession(n.sessionId);ce(r.session),pe(!0),(r.session.status===`waiting_for_user`||r.session.status===`waiting_for_browser_callback`)&&(pe(!1),r.session.uiHints.authorizationUrl&&Be(`${t9()}/api/oauth-debugger/sessions/${n.sessionId}/authorize`))}catch(e){O({title:`Could not start OAuth Debugger session`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{he(!1)}},He=async()=>{if(le)try{he(!0);let t=await e.submitOAuthDebuggerManualCallback(le,{redirectUrl:oe.trim()||void 0});ce(t.session),se(``),pe(!0)}catch(e){O({title:`Could not submit callback`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{he(!1)}},Ue=async()=>{if(le){_e(!0);try{let t=await e.stopOAuthDebuggerSession(le);if(pe(!1),t.status!==`running`){let t=await e.getOAuthDebuggerSession(le);ce(t.session),t.session.status===`completed`?a(`report`):a(`run`)}}catch(e){O({title:`Could not stop session`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{_e(!1)}}},We=async()=>{we.current?.(),we.current=null,ce(null),ue(null),de([]),pe(!1),_e(!1),he(!1),se(``),ye(`all`),xe(`all`),Ce(`inspector`),a(`run`),await Ve()},Ge=async t=>{if(le&&V)try{let n=await e.exportOAuthDebuggerSession(le,t),r=``,i=t===`json`?`json`:t===`raw`?`txt`:`md`;r=typeof n==`string`?n:`${JSON.stringify(n,null,2)}\n`;let a=new Blob([r],{type:`text/plain;charset=utf-8`}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=`oauth-debugger-${le}.${i}`,s.click(),URL.revokeObjectURL(o)}catch(e){if(t===`markdown`){let e=Vte(V,H),t=new Blob([e],{type:`text/markdown;charset=utf-8`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`oauth-debugger-${V.id}.md`,r.click(),URL.revokeObjectURL(n);return}O({title:`Export failed`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},Ke=le?`${t9()}/api/oauth-debugger/sessions/${le}/authorize`:void 0,qe=e=>e===`error`?`destructive`:e===`warning`?`outline-solid`:`secondary`;return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`OAuth Debugger`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile).`})]}),(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:Lte.map(e=>{let t=i===e.id,n=e.id===`configure`||e.id===`run`&&Me||e.id===`report`&&Ne;return(0,I.jsx)(`button`,{type:`button`,onClick:()=>n&&Le(e.id),disabled:!n,className:`rounded-full`,children:(0,I.jsx)(Y,{variant:t?`default`:`outline-solid`,className:n?``:`opacity-50`,children:e.label})},e.id)})})]}),i===`configure`&&(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)($v,{className:`text-base`,children:`Target MCP Server`}),(0,I.jsx)(ey,{children:`Select one MCP server from Libraries and optionally override endpoints.`})]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void n(),disabled:r,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4 ${r?`animate-spin`:``}`}),`Refresh Servers`]})]})}),(0,I.jsx)(q,{className:`space-y-3`,children:(0,I.jsxs)(`div`,{className:`max-w-xl space-y-2`,children:[(0,I.jsx)($,{children:`MCP Server`}),(0,I.jsxs)(E1,{value:o,onValueChange:s,children:[(0,I.jsx)(O1,{children:(0,I.jsx)(D1,{placeholder:`Select an MCP server`})}),(0,I.jsx)(j1,{children:Oe.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.name||e.id},e.id))})]}),Oe.length===0&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`No MCP servers with OAuth configured found. Add OAuth 2.0 auth in`,` `,(0,I.jsx)(`a`,{href:`/libraries/servers`,className:`underline text-primary`,children:`Manage Servers`}),`.`]}),ke&&(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[ke.transport,` ·`,` `,ke.url||ke.command||`No URL/command`,` · `,(0,I.jsxs)(`span`,{className:`text-primary`,children:[ke.oauthMode===`dcr`?`DCR`:`pre-registered`,` fields pre-filled`]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Client Registration Method`}),(0,I.jsx)(ey,{children:`How your OAuth client is identified with the authorization server.`})]}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.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(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),className:`rounded-md border p-3 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 shrink-0 rounded-full ${c===e.id?`bg-primary`:`bg-muted-foreground/30`}`}),(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:e.label})]}),(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-xs text-muted-foreground`,children:e.hint})]},e.id))}),(0,I.jsx)(`div`,{className:`grid gap-3 md:grid-cols-1`,children:(0,I.jsxs)(`div`,{className:`max-w-md space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Redirect mode`,(0,I.jsx)($7,{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.`})]}),(0,I.jsxs)(E1,{value:u,onValueChange:e=>d(e),children:[(0,I.jsx)(O1,{children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`local_callback`,children:`Local callback (recommended)`}),(0,I.jsx)(Q,{value:`manual`,children:`Manual paste redirect URL`})]})]})]})}),c===`pre_registered`&&(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`client_id`,(0,I.jsx)($7,{text:`The unique identifier for your application, issued by the authorization server when you registered the client.`})]}),(0,I.jsx)(Np,{value:C,onChange:e=>w(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`client_secret`,(0,I.jsx)($7,{text:`Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint.`})]}),(0,I.jsx)(X3,{value:T,onChange:e=>E(e.target.value),placeholder:`optional`})]})]}),c===`cimd`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`CIMD URL`,(0,I.jsx)($7,{text:`A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client.`})]}),(0,I.jsx)(Np,{value:M,onChange:e=>N(e.target.value),placeholder:`https://.../client-metadata.json`})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsxs)(Qv,{className:`pb-3`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Runtime OAuth Inputs`}),(0,I.jsx)(ey,{children:`Parameters sent in the authorization request.`})]}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Scopes`}),(0,I.jsx)(Np,{value:y,onChange:e=>b(e.target.value),placeholder:`openid profile email`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Space or comma separated. Leave empty to use scopes auto-discovered from the server metadata.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 md:col-span-2`,children:[(0,I.jsx)(W0,{checked:g,onCheckedChange:e=>v(!!e)}),(0,I.jsxs)($,{className:`flex items-center gap-1`,children:[`Use PKCE (S256)`,(0,I.jsx)($7,{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.`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 md:col-span-2`,children:[(0,I.jsx)(W0,{checked:m,onCheckedChange:e=>h(!!e)}),(0,I.jsx)($,{children:`Auto-open browser when authorization URL is ready`})]})]})]}),(0,I.jsxs)(`details`,{className:`rounded-md border bg-card p-3 shadow-xs`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:`Advanced`}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Token endpoint auth method`,(0,I.jsx)($7,{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.`})]}),(0,I.jsxs)(E1,{value:D,onValueChange:k,children:[(0,I.jsx)(O1,{children:(0,I.jsx)(D1,{placeholder:`Server default (recommended)`})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`__default__`,children:`Server default (let the server decide)`}),(0,I.jsx)(Q,{value:`client_secret_basic`,children:`client_secret_basic — credentials in Authorization header`}),(0,I.jsx)(Q,{value:`client_secret_post`,children:`client_secret_post — credentials in request body`}),(0,I.jsx)(Q,{value:`none`,children:`none — public client, no secret`}),(0,I.jsx)(Q,{value:`private_key_jwt`,children:`private_key_jwt — signed JWT assertion`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Use "server default" unless the server requires a specific method.`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Resource / audience`,(0,I.jsx)($7,{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.`})]}),(0,I.jsx)(Np,{value:x,onChange:e=>S(e.target.value),placeholder:`https://api.example.com`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Optional. Only needed for servers that use resource indicators.`})]})]}),c===`dcr`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`DCR metadata JSON`,(0,I.jsx)($7,{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.`})]}),(0,I.jsx)(n0,{value:A,onChange:e=>j(e.target.value),className:`min-h-32 font-mono text-xs`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Optional extra fields for the registration request body.`})]}),c===`cimd`&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Expected client_id`,(0,I.jsx)($7,{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.`})]}),(0,I.jsx)(Np,{value:P,onChange:e=>F(e.target.value),placeholder:`optional`})]}),(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-3`,children:[(0,I.jsx)(`div`,{className:`mb-1 text-sm font-medium`,children:`Endpoint overrides`}),(0,I.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.`}),(0,I.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Authorization server metadata URL`,(0,I.jsx)($7,{text:`The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path.`})]}),(0,I.jsx)(Np,{value:L,onChange:e=>R(e.target.value),placeholder:`https://.../.well-known/oauth-authorization-server`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Resource server base URL`,(0,I.jsx)($7,{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.`})]}),(0,I.jsx)(Np,{value:ie,onChange:e=>ae(e.target.value),placeholder:`https://resource.example.com`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Authorization endpoint`,(0,I.jsx)($7,{text:`The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata.`})]}),(0,I.jsx)(Np,{value:z,onChange:e=>B(e.target.value),placeholder:`https://.../authorize`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Token endpoint`,(0,I.jsx)($7,{text:`The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically.`})]}),(0,I.jsx)(Np,{value:ee,onChange:e=>te(e.target.value),placeholder:`https://.../token`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`Registration endpoint (DCR)`,(0,I.jsx)($7,{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.`})]}),(0,I.jsx)(Np,{value:ne,onChange:e=>re(e.target.value),placeholder:`https://.../register`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)($,{className:`text-xs flex items-center gap-1`,children:[`CIMD URL override`,(0,I.jsx)($7,{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.`})]}),(0,I.jsx)(Np,{value:M,onChange:e=>N(e.target.value),placeholder:`https://.../client-metadata.json`})]})]})]}),(0,I.jsxs)(Y5,{children:[(0,I.jsx)(cn,{className:`h-4 w-4`}),(0,I.jsx)(X5,{children:`Secrets display`}),(0,I.jsxs)(Z5,{className:`space-y-2`,children:[(0,I.jsx)(`p`,{children:`By default, full tokens and secrets are visible in the network inspector and exports — useful for debugging but not for sharing.`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W0,{checked:!f,onCheckedChange:e=>p(e===!1)}),(0,I.jsx)($,{children:`Hide sensitive values in inspector`})]})]})]})]})]}),(0,I.jsx)(`div`,{className:`flex justify-end`,children:(0,I.jsxs)(W,{type:`button`,onClick:()=>void Ve(),disabled:me,children:[me&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),`Start OAuth Debug Session`]})})]}),i===`run`&&(0,I.jsx)(`div`,{className:`space-y-4`,children:(0,I.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[1.2fr_1fr]`,children:[(0,I.jsxs)(K,{className:`xl:col-span-1 min-w-0`,children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)($v,{className:`text-base`,children:`Progress`}),(0,I.jsx)(ey,{children:`Visual OAuth flow guide with live session events and next-step actions.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V?.uiHints.authorizationUrl&&Ke&&(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsxs)(`a`,{href:Ke,target:`_blank`,rel:`noopener noreferrer`,children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Open Authorization URL`]})}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void We(),disabled:me,children:[(0,I.jsx)(Yn,{className:`mr-2 h-4 w-4`}),`Restart`]}),le&&(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ue(),disabled:ge||!le,children:[(ge||fe)&&ge&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),(0,I.jsx)(rr,{className:`mr-2 h-4 w-4`}),`Stop Debug Session`]})]})]})}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{children:[Ae.completed+Ae.failed,`/`,Ae.total,` steps`]}),(0,I.jsxs)(`span`,{children:[Ae.percent,`%`]})]}),(0,I.jsx)(w7,{value:Ae.percent,className:`h-2`})]}),V?.status===`waiting_for_user`&&(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4 space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:`Manual callback required`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open the authorization URL, complete authentication, then paste the final redirect URL here.`}),(0,I.jsx)(n0,{value:oe,onChange:e=>se(e.target.value),placeholder:`Paste the final redirect URL (with code and state)`,className:`min-h-24 text-xs font-mono`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsxs)(W,{type:`button`,size:`sm`,onClick:()=>void He(),disabled:me||!oe.trim(),children:[me&&(0,I.jsx)(In,{className:`mr-2 h-4 w-4 animate-spin`}),`Continue`]}),V.uiHints.authorizationUrl&&Ke&&(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsx)(`a`,{href:Ke,target:`_blank`,rel:`noopener noreferrer`,children:`Open Authorization URL`})})]})]})}),V?.status===`waiting_for_browser_callback`&&(0,I.jsxs)(Y5,{children:[(0,I.jsx)(cn,{className:`h-4 w-4`}),(0,I.jsx)(X5,{children:`Waiting for browser callback`}),(0,I.jsxs)(Z5,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs`,children:`Complete the authorization flow in your browser. MCP Lab is listening for the callback at:`}),(0,I.jsx)(`p`,{className:`text-xs font-mono break-all`,children:V.uiHints.callbackUrl}),V.uiHints.authorizationUrl&&Ke&&(0,I.jsx)(`div`,{className:`pt-2`,children:(0,I.jsx)(W,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,I.jsxs)(`a`,{href:Ke,target:`_blank`,rel:`noopener noreferrer`,children:[(0,I.jsx)(yn,{className:`mr-2 h-4 w-4`}),`Open Authorization URL`]})})})]})]}),(0,I.jsx)(`div`,{className:`space-y-2`,children:V?.stepStates.map(e=>{let t=Pe.get(e.id),n=Ie.get(e.id),r=e.id===zte||e.id===Bte,i=!!(n&&(n.requests.length>0||n.responses.length>0)),a=r&&e.status!==`pending`&&i;return(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-start gap-2`,children:[(0,I.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:t}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-1 text-sm font-medium`,children:[(0,I.jsx)(`span`,{children:e.title}),e.status===`completed`&&(0,I.jsx)(ln,{className:`h-4 w-4 shrink-0 text-emerald-600`,"aria-hidden":`true`})]}),(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.description})]})]}),(0,I.jsx)(Y,{variant:e.status===`failed`?`destructive`:e.status===`completed`?`outline-solid`:e.status===`active`?`secondary`:`outline-solid`,className:e.status===`completed`?`border-emerald-300 bg-emerald-50 text-emerald-700`:void 0,children:e.status})]}),e.outcomeSummary&&(0,I.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground break-all whitespace-pre-line`,children:e.outcomeSummary}),e.id===Rte&&(0,I.jsxs)(`details`,{className:`mt-3 rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold text-muted-foreground`,children:`OAuth Metadata Sources`}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Resource Metadata`}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[`From `,Fe.resourceMetadata?.url??`not captured`]}),(0,I.jsx)(`pre`,{className:`max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs`,children:n9(Fe.resourceMetadata?.bodyText)})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:`Authorization Server Metadata`}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[`From`,` `,Fe.authorizationServerMetadata?.url??`not captured`]}),(0,I.jsx)(`pre`,{className:`max-h-56 overflow-x-auto rounded-md bg-muted p-2 text-xs`,children:n9(Fe.authorizationServerMetadata?.bodyText)})]})]})]}),a&&n&&(0,I.jsxs)(`details`,{className:`mt-3 rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-semibold text-muted-foreground`,children:`Captured exchange details`}),(0,I.jsx)(`div`,{className:`mt-3 space-y-3`,children:Array.from({length:Math.max(n.requests.length,n.responses.length)}).map((t,r)=>{let i=n.requests[r],a=n.responses[r];return(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-2`,children:[(0,I.jsx)(`div`,{className:`text-xs font-medium`,children:i?.label??a?.label??`Exchange ${r+1}`}),(0,I.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground break-all`,children:[i?.method?`${i.method} `:``,i?.url??a?.url??`-`]}),typeof a?.status==`number`&&(0,I.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`HTTP `,a.status]}),i?.bodyText&&(0,I.jsx)(`pre`,{className:`mt-2 max-h-40 overflow-auto rounded bg-muted p-2 text-xs`,children:i.bodyText}),a?.bodyText&&(0,I.jsx)(`pre`,{className:`mt-2 max-h-48 overflow-auto rounded bg-muted p-2 text-xs`,children:n9(a.bodyText)})]},`${e.id}-exchange-${r}`)})})]})]},e.id)})||(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No steps yet.`})})]})]}),(0,I.jsx)(`div`,{className:`space-y-4 xl:col-span-1 min-w-0`,children:(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)($v,{className:`text-base`,children:`Inspect`}),(0,I.jsx)(ey,{children:`Live events and network requests/responses for the OAuth flow.`})]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ge(`raw`),disabled:!le||!V,children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Copy/Export Raw Trace`]})]})}),(0,I.jsx)(q,{className:`space-y-3`,children:(0,I.jsxs)(x0,{value:Se,onValueChange:e=>Ce(e),className:`min-w-0`,children:[(0,I.jsxs)(S0,{className:`grid grid-cols-2`,children:[(0,I.jsx)(C0,{value:`inspector`,children:`Network Inspector`}),(0,I.jsx)(C0,{value:`events`,children:`Live Debug`})]}),(0,I.jsx)(w0,{value:`events`,className:`mt-3`,children:(0,I.jsxs)(`div`,{className:`max-h-64 space-y-1 overflow-auto rounded-md border bg-muted/10 p-3 text-xs`,children:[H.length===0?(0,I.jsx)(`p`,{className:`text-muted-foreground`,children:`No events yet.`}):H.map((e,t)=>(0,I.jsxs)(`div`,{className:`break-all`,children:[(0,I.jsx)(`span`,{className:`mr-2 font-mono text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,I.jsx)(Y,{variant:`outline`,className:`mr-2 text-[10px]`,children:e.type}),typeof e.payload.message==`string`?e.payload.message:JSON.stringify(e.payload)]},`${e.ts}-${t}`)),(0,I.jsx)(`div`,{ref:Te})]})}),(0,I.jsxs)(w0,{value:`inspector`,className:`space-y-3 mt-3`,children:[(0,I.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Filter by step`}),(0,I.jsxs)(E1,{value:ve,onValueChange:ye,children:[(0,I.jsx)(O1,{className:`h-8`,children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`all`,children:`All steps`}),(V?.stepStates??[]).map(e=>(0,I.jsxs)(Q,{value:e.id,children:[Pe.get(e.id),`. `,e.title]},e.id))]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Filter by status`}),(0,I.jsxs)(E1,{value:be,onValueChange:xe,children:[(0,I.jsx)(O1,{className:`h-8`,children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`all`,children:`All`}),(0,I.jsx)(Q,{value:`ok`,children:`Successful responses`}),(0,I.jsx)(Q,{value:`error`,children:`Error responses`})]})]})]})]}),(0,I.jsx)(`div`,{className:`max-h-136 min-w-0 space-y-2 overflow-auto`,children:je.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No network exchanges captured yet.`}):je.map(e=>(0,I.jsxs)(`details`,{className:`rounded-md border p-3`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer list-none`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-start gap-2`,children:[(0,I.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:Pe.get(e.stepId)}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-sm font-medium`,children:e.label}),(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground break-all`,children:[e.method?`${e.method} `:``,e.url]})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(Y,{variant:`outline`,children:`request`}),(0,I.jsx)(Y,{variant:`outline`,children:`response`}),typeof e.response?.status==`number`&&(0,I.jsx)(Y,{variant:e.response.status>=400?`destructive`:`secondary`,children:e.response.status})]})]})}),(0,I.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Request Headers`}),(0,I.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(e.request?.headers??{},null,2)})]}),e.request?.bodyText&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Request Body`}),(0,I.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:e.request.bodyText})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Response Headers`}),(0,I.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(e.response?.headers??{},null,2)})]}),e.response?.bodyText&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`mb-1 text-xs font-medium`,children:`Response Body`}),(0,I.jsx)(`pre`,{className:`max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2 text-xs`,children:e.response.bodyText})]}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void e9(JSON.stringify(e,null,2)),children:[(0,I.jsx)(hn,{className:`mr-2 h-4 w-4`}),`Copy JSON`]})})]})]},e.key))})]})]})})]})})]})}),i===`report`&&V&&(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold`,children:`Report / Export`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`OAuth debug session summary, validations, and trace exports.`})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>a(`configure`),children:`Back to Configure`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ge(`json`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export JSON`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ge(`markdown`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Export Markdown`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>void Ge(`raw`),children:[(0,I.jsx)(gn,{className:`mr-2 h-4 w-4`}),`Copy/Export Raw Trace`]})]})]}),(0,I.jsxs)(Y5,{children:[(0,I.jsx)(cn,{className:`h-4 w-4`}),(0,I.jsx)(X5,{children:`Secrets display mode`}),(0,I.jsx)(Z5,{children:V.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.`})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-4`,children:[(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Status`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:V.status})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Requests`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:V.networkSummary.requestCount})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Network errors`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:V.networkSummary.errorCount})]})}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-4`,children:[(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Validation findings`}),(0,I.jsx)(`div`,{className:`text-lg font-semibold`,children:V.validations.length})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Key values`})}),(0,I.jsxs)(q,{className:`grid gap-3 md:grid-cols-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Issuer`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:V.summary?.issuer||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Client ID`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:V.summary?.clientId||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Redirect URI`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:V.summary?.redirectUri||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Token endpoint status`}),(0,I.jsx)(`p`,{className:`text-sm`,children:V.summary?.tokenEndpointStatus??`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Token type`}),(0,I.jsx)(`p`,{className:`text-sm`,children:V.summary?.tokenType||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Scopes granted`}),(0,I.jsx)(`p`,{className:`text-sm break-all`,children:(V.summary?.grantedScopes??[]).join(`, `)||`-`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Token validity`}),(0,I.jsxs)(`p`,{className:`text-sm`,children:[typeof V.summary?.accessTokenValidForSeconds==`number`?`${M4(V.summary.accessTokenValidForSeconds)} remaining`:typeof V.summary?.accessTokenExpiresInSeconds==`number`?`${M4(V.summary.accessTokenExpiresInSeconds)} from issuance`:`No expiry advertised by token endpoint`,V.summary?.accessTokenExpiresAt?(0,I.jsxs)(I.Fragment,{children:[` (until `,(0,I.jsx)(`span`,{children:new Date(V.summary.accessTokenExpiresAt).toLocaleTimeString()}),`)`]}):``]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Source:`,` `,V.summary?.accessTokenExpirySource===`expires_in`?`token endpoint expires_in`:V.summary?.accessTokenExpirySource===`jwt_exp`?`JWT exp claim`:`not available`]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)($,{className:`text-xs`,children:`Refresh option`}),(0,I.jsx)(`p`,{className:`text-sm`,children:V.summary?.refreshTokenAvailable?`Refresh token available (silent refresh possible)`:`No refresh token in response (full login likely required after expiry)`})]}),V.summary?.accessToken&&(0,I.jsxs)(`div`,{className:`md:col-span-2 space-y-1`,children:[(0,I.jsx)($,{className:`text-xs`,children:`Access token`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1 text-xs font-mono text-muted-foreground`,children:[V.summary.accessToken.slice(0,48),`…`]}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`shrink-0 h-7 px-2 text-xs`,onClick:()=>void e9(V.summary.accessToken),children:[(0,I.jsx)(hn,{className:`mr-1 h-3 w-3`}),`Copy token`]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Visible because "Hide sensitive values" is off. Use this token with the CLI via`,` `,(0,I.jsx)(`code`,{className:`font-mono`,children:`--oauth-token`}),`.`]})]})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Validation findings`})}),(0,I.jsx)(q,{className:`space-y-2`,children:V.validations.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No validation findings recorded.`}):V.validations.map((e,t)=>(0,I.jsxs)(`div`,{className:`rounded-md border p-3`,children:[(0,I.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.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:t+1}),(0,I.jsx)(`span`,{className:`font-bold`,children:e.title})]}),(0,I.jsx)(Y,{variant:qe(e.severity),children:e.severity})]}),(0,I.jsxs)(`p`,{className:`text-sm`,children:[(0,I.jsx)(`span`,{className:`font-bold`,children:`Finding:`}),` `,e.detail]}),e.recommendation&&(0,I.jsxs)(`div`,{className:`mt-2 rounded-md border px-2.5 py-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`mb-1 font-medium text-muted-foreground`,children:`Suggested improvement`}),(0,I.jsx)(`p`,{children:e.recommendation})]}),(0,I.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Step: `,e.stepId,e.specReference&&(0,I.jsxs)(I.Fragment,{children:[` · `,(0,I.jsx)(`a`,{href:e.specReference,target:`_blank`,rel:`noreferrer`,className:`text-primary underline`,children:`Spec reference`})]})]})]},e.id))})]})]})]})}function Ute(e){let t=e.filter(e=>typeof e.sourcePath==`string`&&e.sourcePath.trim().length>0&&typeof e.relativePath==`string`&&e.relativePath.trim().length>0).map(e=>[e.sourcePath,e.relativePath]);return new Map(t)}function Wte(e){let t=e.filter(e=>typeof e.sourcePath==`string`&&e.sourcePath.trim().length>0).map(e=>[e.sourcePath,e.configName?.trim()||e.name]);return new Map(t)}function Gte(e,t){let n=new Map;for(let r of e){if(!r.sourcePath)continue;let e=new Map,i=r.scenarioEntries&&r.scenarioEntries.length>0?r.scenarioEntries:r.scenarios.map(e=>({kind:`inline`,scenario:e}));for(let n of i){if(n.kind===`inline`){e.set(n.scenario.id,n.scenario.name?.trim()||n.scenario.id);continue}let r=t.find(e=>e.id===n.ref);e.set(n.ref,r?.name?.trim()||n.ref)}n.set(r.sourcePath,e)}return n}function r9(e,t){let n=t.get(e);if(n)return n;let r=e.replace(/\\/g,`/`),i=r.lastIndexOf(`/evals/`);if(i>=0)return r.slice(i+7);let a=r.split(`/`).filter(Boolean);return a.length<=1?r:a.slice(-3).join(`/`)}function i9(e,t,n){let r=t.get(n);if(!e||e.length===0){if(r&&r.size===1){let e=r.values().next().value;if(e)return e}return`All scenarios`}if(!r)return e.length===1?e[0]:`${e[0]} +${e.length-1}`;let i=e.map(e=>r.get(e)??e);return i.length===1?i[0]:`${i[0]} +${i.length-1}`}var a9=`mcplab.runEvaluation.activeJobId`;function Kte(e){return e.configName?.trim()||e.name}function qte(e){if(e.suitePath?.trim())return e.suitePath.trim();if(e.relativePath?.includes(`/`)){let t=e.relativePath.lastIndexOf(`/`);return e.relativePath.slice(0,t)}return null}function o9(){return new Date().toLocaleTimeString()}function s9(e){return e.executionType===`rover`&&[`queued`,`waiting_for_rover`,`running`,`paused_rover`].includes(e.status)}function Jte(e){return e.jobs.flatMap(e=>e.childProgress?.length?e.childProgress.map(t=>({job:e,child:t})):[{job:e}])}var Yte=()=>{let[e]=pp(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(`1`),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(0),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)(null),[w,T]=(0,_.useState)([]),[E,D]=(0,_.useState)(`agent_default`),[k,A]=(0,_.useState)([]),[j,M]=(0,_.useState)(!1),[N,P]=(0,_.useState)([]),[F,L]=(0,_.useState)({}),[R,z]=(0,_.useState)({}),[B,ee]=(0,_.useState)(``),[te,ne]=(0,_.useState)([]),[re,ie]=(0,_.useState)([]),[ae,oe]=(0,_.useState)([]),[se,V]=(0,_.useState)([]),[ce,le]=(0,_.useState)(null),[ue,H]=(0,_.useState)(null),[de,fe]=(0,_.useState)(!1),[pe,me]=(0,_.useState)(null),he=(0,_.useRef)(null),ge=(0,_.useRef)(null),_e=(0,_.useRef)(null),ve=(0,_.useRef)(new Map),ye=(0,_.useRef)(!1),{configs:be,reload:xe}=Jv(),{source:Se}=Rv(),{agents:Ce,scenarios:we,servers:Te,reload:Ee}=Zv(),De=b.trim(),Oe=De?`/results/${encodeURIComponent(De)}${t?`?configId=${encodeURIComponent(t)}`:``}`:`/results`,ke=be.find(e=>e.id===t),Ae=(0,_.useMemo)(()=>Ute(be),[be]),je=(0,_.useMemo)(()=>Wte(be),[be]),Me=(0,_.useMemo)(()=>Gte(be,we),[be,we]),Ne=re[0]??null,Pe=(0,_.useMemo)(()=>se.find(e=>e.jobs.some(e=>e.jobId===S))??null,[se,S]),Fe=Pe?Math.max(s,Pe.totalJobs>0?Math.round(Pe.completedJobs/Pe.totalJobs*100):0):s,Ie=e.get(`configId`),Le=(0,_.useMemo)(()=>{if(!ke)return[];let e=new Map,t=ke.agentEntries&&ke.agentEntries.length>0?ke.agentEntries:ke.agents.map(e=>({kind:`inline`,agent:e}));for(let n of t){if(n.kind===`inline`){let t=n.agent.id;e.has(t)||e.set(t,n.agent);continue}let t=Ce.find(e=>e.id===n.ref);t&&!e.has(t.id)&&e.set(t.id,t)}for(let t of Ce)e.has(t.id)||e.set(t.id,t);return Array.from(e.values())},[ke,Ce]),Re=(0,_.useMemo)(()=>{if(!ke)return[];let e=new Map,t=ke.scenarioEntries&&ke.scenarioEntries.length>0?ke.scenarioEntries:ke.scenarios.map(e=>({kind:`inline`,scenario:e}));for(let n of t){if(n.kind===`inline`){e.has(n.scenario.id)||e.set(n.scenario.id,n.scenario);continue}let t=we.find(e=>e.id===n.ref);t&&!e.has(t.id)&&e.set(t.id,t)}return Array.from(e.values())},[ke,we]),ze=(0,_.useMemo)(()=>Le.filter(e=>e.type===`browser`&&w.includes(e.id)),[Le,w]),Be=ze.length>0?1:Number(r),Ve=(0,_.useMemo)(()=>[{label:`LLM Agents`,agents:Le.filter(e=>e.type!==`browser`)},{label:`Browser Agents`,agents:Le.filter(e=>e.type===`browser`)}],[Le]),He=(0,_.useMemo)(()=>{let e=new Map;for(let t of Te)e.has(t.id)||e.set(t.id,{id:t.id,name:t.name});for(let t of ke?.servers??[])e.set(t.id,{id:t.id,name:t.name});return Array.from(e.values()).sort((e,t)=>e.id.localeCompare(t.id))},[ke?.servers,Te]);(0,_.useEffect)(()=>{Ie&&be.some(e=>e.id===Ie)&&n(Ie)},[Ie,be]);let Ue=(0,_.useRef)(``);(0,_.useEffect)(()=>{let e=ke?`${ke.id}::${ke.sourcePath??``}`:``;if(e===Ue.current)return;if(Ue.current=e,!ke){T([]),D(`agent_default`),A([]),M(!1),P([]),L({}),z({});return}let t=P1(ke);T(t.length>0?t:Le.map(e=>e.id)),D(`agent_default`),A(Re.map(e=>e.id)),M(!1),P([]),L({}),z({})},[ke?.id,ke?.sourcePath,Le,Re]);let We=async()=>{if(!ke?.sourcePath){u(e=>[...e,`[${o9()}] Missing source path for selected config.`]);return}let e=Le.filter(e=>w.includes(e.id));if(e.length===0){u(e=>[...e,`[${o9()}] Select at least one agent.`]);return}let t=Re.filter(e=>k.includes(e.id)),n=new Set(t.map(e=>e.id)),r=j||Object.values(F).some(Boolean),i=Object.fromEntries(Object.entries(R).filter(([e])=>n.has(e)&&F[e])),a=t.map(e=>{let t=i[e.id]??(j?N:e.serverIds||[]);return`${e.id}=[${t.join(`, `)}]`}).join(`; `);if(t.length===0){u(e=>[...e,`[${o9()}] Select at least one test.`]);return}if(j&&N.length===0){u(e=>[...e,`[${o9()}] Select at least one server for "Override MCP Servers for Selected Tests", or turn that override off.`]);return}let s=Object.entries(i).filter(([,e])=>!Array.isArray(e)||e.length===0).map(([e])=>e);if(s.length>0){u(e=>[...e,`[${o9()}] Select at least one server for per-scenario overrides on: ${s.join(`, `)}, or turn those overrides off.`]);return}let l=Array.from(new Set(t.flatMap(e=>r?i[e.id]?i[e.id]??[]:j?N:e.serverIds||[]:e.serverIds||[]).filter(e=>{let t=(ke.servers??[]).find(t=>t.id===e),n=Te.find(t=>t.id===e);return(t||n)?.authType===`oauth2`})));try{l.length>0&&(fe(!0),await x4({serverNames:l,source:Se,onServerAuthStart:e=>{u(t=>[...t,`[${o9()}] OAuth login required for '${e}'. Complete the browser sign-in flow...`])}}),u(e=>[...e,`[${o9()}] OAuth login completed for required server(s): ${l.join(`, `)}.`]))}catch(e){let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${o9()}] OAuth error: ${t}`]),fe(!1);return}finally{fe(!1)}o(!0),f(!1),y(!1),x(``);let d=(ke.serverEntries??[]).some(e=>e.kind===`referenced`)||(ke.agentEntries??[]).some(e=>e.kind===`referenced`)||(ke.scenarioEntries??[]).some(e=>e.kind===`referenced`)?`refs-composed`:`single-file/inline`,p={...ze.length>0&&E!==`agent_default`?{newConversationBeforeStart:E===`new`,newConversationBetweenScenarios:E===`new`}:{}};u([`[${o9()}] Starting evaluation run...`,`[${o9()}] Config=${ke.name} mode=${d} agents=${e.map(e=>e.name||e.id).join(`, `)} tests=${t.map(e=>e.id).join(`, `)} runs=${Be}${ze.length>0?` newConversationBeforeStart=${p.newConversationBeforeStart??`agent_default`} newConversationBetweenScenarios=${p.newConversationBetweenScenarios??`agent_default`}`:``}${B.trim()?` note=${B.trim()}`:``}`,`[${o9()}] Effective MCP servers per selected test: ${a||`(none)`}`]),c(10);try{let{jobId:n}=await Se.startRun({configPath:ke.sourcePath,runsPerScenario:Be,agents:e.map(e=>e.id),scenarioIds:t.map(e=>e.id),...p,...r&&j?{serverOverrideAll:N}:{},...r&&Object.keys(i).length>0?{scenarioServerOverrides:i}:{},runNote:B.trim()?B.trim():void 0});C(n),Je(n),nt(n),Ye()}catch(e){let t=e instanceof Error?e.message:String(e),n=t.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.`:``;u(e=>[...e,`[${o9()}] Error: ${t}${n}`]),o(!1),c(0),C(null),fe(!1)}},Ge=()=>{We()},Ke=()=>{_e.current=null,S&&Se.stopRun(S),ge.current?.(),ge.current=null,qe(),C(null),o(!1),f(!1),y(!0),u(e=>[...e,`[${o9()}] Run aborted by user.`]),Ye()};(0,_.useEffect)(()=>{he.current&&(he.current.scrollTop=he.current.scrollHeight)},[l]),(0,_.useEffect)(()=>()=>{_e.current=null,ge.current?.()},[]),(0,_.useEffect)(()=>{if(S||d)return;let e=``;try{e=sessionStorage.getItem(a9)??``}catch{e=``}if(e)return C(e),o(!0),f(!1),y(!1),u(e=>e.length>0?e:[`[${o9()}] Reattached to in-progress evaluation run...`]),nt(e),()=>{}},[S,d]);let qe=()=>{try{sessionStorage.removeItem(a9)}catch{}},Je=e=>{try{sessionStorage.setItem(a9,e)}catch{}},Ye=async(e=!1)=>{try{let t=await Se.getRunQueue(),n=t.evaluations??[],r=new Set(n.map(e=>e.evaluationRunId)),i=ve.current;if(e&&!_e.current){let e=Array.from(i.values()).find(e=>[`queued`,`running`].includes(e.status)&&!r.has(e.evaluationRunId));e&&Se.getResult(e.evaluationRunId).then(t=>{if(!t||_e.current)return;let n=(t.outcomes?.stopped??0)>0||(t.outcomes?.incomplete??0)>0;o(!1),c(100),x(e.evaluationRunId),g(null),m((t.outcomes?.error??0)>0),y(n),f(!n)}).catch(()=>{})}ve.current=new Map(n.map(e=>[e.evaluationRunId,e])),ne(t.queued),ie(t.active_jobs??(t.active?[t.active]:[])),oe(t.admitting_jobs??[]),V((t.evaluations??[]).filter(e=>![`completed`,`partial`,`failed`].includes(e.status)));let a=S==null?void 0:t.queued.find(e=>e.jobId===S&&e.status===`blocked_auth`&&e.blockedReason===`oauth_required`);a&&(a.requiredServers??[]).length>0?me(e=>e?.jobId===a.jobId?e:{jobId:a.jobId,servers:a.requiredServers}):(pe?.jobId&&pe.jobId!==S||S!=null&&!t.queued.some(e=>e.jobId===S&&e.status===`blocked_auth`&&e.blockedReason===`oauth_required`))&&me(null)}catch{}},Xe=()=>{xe(),Ee()};(0,_.useEffect)(()=>{Xe(),Ye();let e=Se.subscribeRunQueue(e=>{e.type===`queue_event`&&Ye(!0)}),t=()=>{Xe(),Ye()},n=()=>{Ye()};return window.addEventListener(`focus`,t),window.addEventListener(`mcplab:run-queue-changed`,n),()=>{window.removeEventListener(`focus`,t),window.removeEventListener(`mcplab:run-queue-changed`,n),e()}},[xe,Ee,Se]);let Ze=async e=>{try{await Se.removeQueuedRun(e),ne(t=>t.filter(t=>t.jobId!==e))}catch(t){let n=t instanceof Error?t.message:String(t);if(n.includes(`Use the /stop endpoint`))try{await Se.stopRun(e)}catch{}else O({title:`Could not remove queued run`,description:n,variant:`destructive`})}Ye()},Qe=async e=>{let t=Array.from(new Set(e.jobs.flatMap(e=>e.requiredServers??[])));if(!(t.length===0||ye.current)){ye.current=!0,fe(!0);try{await x4({serverNames:t,source:Se}),await Se.resumeQueue()}catch(e){O({title:`Could not connect OAuth`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ye.current=!1,fe(!1),Ye()}}},$e=async e=>{if(ue!==e){H(e);try{await Se.stopEvaluationRun(e),await Ye()}catch(e){O({title:`Could not stop run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{H(null)}}},et=async e=>{try{await Se.removeEvaluationRun(e),await Ye()}catch(e){O({title:`Could not remove run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},tt=async e=>{try{await Se.openRover(e),await Ye()}catch(e){O({title:`Could not open browser agent`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},nt=e=>{S===e&&ge.current||(ge.current?.(),_e.current=e,ge.current=Se.subscribeRunJob(e,t=>{let n=new Date(t.ts).toLocaleTimeString();if(t.type===`queued`)u(e=>{let r=t.payload.position?` (position ${t.payload.position})`:``,i=`[${n}] Run queued${r}. Waiting for active run to finish...`;return e.includes(i)?e:[...e,i]}),c(5);else if(t.type===`oauth_required`){let e=Array.isArray(t.payload.servers)?t.payload.servers:[],r=String(t.payload.jobId??``);me({jobId:r,servers:e}),u(t=>{let r=`[${n}] OAuth required for server(s): ${e.join(`, `)}. Click "Connect & Resume" to authenticate.`;return t.includes(r)?t:[...t,r]})}else{if(t.type===`started`&&(me(null),ye.current=!1,o(!0),f(!1),y(!1),u(e=>{let t=`[${n}] Run started.`;return e.includes(t)?e:[...e,t]}),c(e=>Math.max(e,30)),Ye()),t.type===`log`){let e=String(t.payload.message??``).trim();e&&(u(t=>{let r=`[${n}] ${e}`;return t.includes(r)?t:[...t,r]}),c(t=>{let n=e.toLowerCase();if(n.startsWith(`loading mcp evaluation config`))return Math.max(t,15);if(n.startsWith(`loaded config`))return Math.max(t,20);if(n.startsWith(`selected `))return Math.max(t,30);if(n.startsWith(`using requested agents`)||n.startsWith(`using run default agents`)||n.startsWith(`using config-declared agents`))return Math.max(t,35);if(n.startsWith(`expanded to `))return Math.max(t,45);if(n.startsWith(`running evaluation`))return Math.max(t,50);let r=n.match(/^scenario (\d+)\/(\d+) finished:/);if(r){let e=Number(r[1]),n=Number(r[2]);return Math.max(t,50+Math.round(e/n*25))}return n.startsWith(`evaluation execution finished`)?Math.max(t,78):n.startsWith(`writing results to `)?Math.max(t,94):n.startsWith(`run finished:`)?Math.max(t,98):t}))}if(t.type===`completed`||t.type===`error`){let r=t.type===`error`,i=String(t.payload.runId??``).trim(),a=n=>t.payload.status===`stopped`||[`Run stopped by user`,`Run aborted by user`].includes(String(t.payload.message))||n?.status===`stopped`||n?.jobs.find(t=>t.jobId===e)?.status===`stopped`,s=e=>{if(!r||a(e))return;let i=String(t.payload.message??`Unknown error`),o=i.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.`:``;u(e=>[...e,`[${n}] Error: ${i}${o}`])},l=e=>{s(e);let t=r&&!a(e)||(e?.failedJobs??0)-(e?.stoppedJobs??0)>0,l=a(e)&&!t&&!e?.completedJobs&&!i;me(null),ye.current=!1,u(r=>{let i=`[${n}] ${t?`Run completed with errors.`:a(e)?`Run stopped.`:`Run completed.`}`;return r.includes(i)?r:[...r,i]}),c(100),o(!1),f(!l),m(t),g(e??null),y(l),x(e?.completedJobs?e.evaluationRunId:r&&!a(e)?``:i),qe(),C(null),_e.current=null,ge.current?.(),ge.current=null,Ye()};Se.getRunQueue().then(t=>{if(_e.current!==e)return;let r=t.evaluations?.find(t=>t.jobs.some(t=>t.jobId===e))??t.evaluations?.find(e=>e.evaluationRunId===i),a=r?.jobs.find(t=>t.jobId!==e&&[`queued`,`waiting_for_rover`,`paused_rover`,`running`].includes(t.status))??r?.jobs.find(t=>t.jobId!==e&&t.status===`blocked_auth`);if(a&&r){s(r);let e=r.completedJobs+r.failedJobs,t=`[${n}] Subtask finished. ${e}/${r.totalJobs} finished. Continuing with the remaining run tasks...`;u(e=>e.includes(t)?e:[...e,t]),c(t=>Math.max(t,r.totalJobs>0?Math.round(e/r.totalJobs*100):t)),me(a.status===`blocked_auth`?{jobId:a.jobId,servers:a.requiredServers??[]}:null),ye.current=!1,o(!0),f(!1),y(!1),C(a.jobId),Je(a.jobId),Ye(),nt(a.jobId)}else l(r)}).catch(()=>{_e.current===e&&l()})}}}))},rt=e=>{S===e&&ge.current||(C(e),Je(e),o(!0),f(!1),y(!1),u([`[${o9()}] Attached to running job ${e}...`]),c(10),nt(e))};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Kn,{className:`h-6 w-6`}),`Run Evaluation`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Execute evaluation scenarios against MCP servers`})]}),(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`pt-6 space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{children:`MCP Evaluation`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(E1,{value:t,onValueChange:n,children:[(0,I.jsx)(O1,{children:(0,I.jsx)(D1,{placeholder:`Select a config`})}),(0,I.jsx)(j1,{children:be.map(e=>{let t=qte(e);return(0,I.jsxs)(Q,{value:e.id,children:[(0,I.jsx)(`span`,{children:Kte(e)}),t&&(0,I.jsxs)(`span`,{className:`ml-2 text-muted-foreground`,children:[`(`,t,`)`]})]},e.id)})})]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`icon`,className:`h-10 w-10 shrink-0`,onClick:Xe,"aria-label":`Refresh configs`,title:`Refresh configs`,children:(0,I.jsx)(Yn,{className:`h-4 w-4`})})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`variance-runs`,children:`Variance Runs`}),(0,I.jsx)(Np,{id:`variance-runs`,type:`number`,min:`1`,max:`10`,value:ze.length>0?`1`:r,onChange:e=>i(e.target.value),disabled:ze.length>0}),ze.length>0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Browser agents support one run per scenario.`})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{htmlFor:`run-note`,children:`Run Note`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[B.length,`/500`]})]}),(0,I.jsx)(n0,{id:`run-note`,value:B,onChange:e=>ee(e.target.value.slice(0,500)),placeholder:`Optional context for this run (for example: mcp-server v1.8.2 #staging)`,rows:2})]}),ke&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{children:`Agents`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>T(Le.map(e=>e.id)),children:`Select all`}),(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>T([]),children:`Clear`})]})]}),(0,I.jsx)(`div`,{className:`space-y-3`,children:Ve.map(e=>e.agents.length>0?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:e.label}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,"aria-label":`Select all ${e.label}`,onClick:()=>{let t=new Set(e.agents.map(e=>e.id));T(e=>[...e.filter(e=>!t.has(e)),...t])},children:`Select all`}),(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,"aria-label":`Clear ${e.label}`,onClick:()=>{let t=new Set(e.agents.map(e=>e.id));T(e=>e.filter(e=>!t.has(e)))},children:`Clear`})]})]}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.agents.map(e=>{let t=w.includes(e.id);return(0,I.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border p-2 text-sm`,children:[(0,I.jsx)(W0,{checked:t,onCheckedChange:t=>{let n=t===!0;T(t=>n?[...t,e.id]:t.filter(t=>t!==e.id))}}),(0,I.jsx)(`span`,{children:e.name||e.id})]},e.id)})})]},e.label):null)}),ze.length>0&&(0,I.jsxs)(`div`,{className:`space-y-1.5 rounded-md border bg-muted/20 p-3`,children:[(0,I.jsx)($,{htmlFor:`conversation-behavior`,children:`Conversation behavior`}),(0,I.jsxs)(E1,{value:E,onValueChange:e=>D(e),children:[(0,I.jsx)(O1,{id:`conversation-behavior`,children:(0,I.jsx)(D1,{})}),(0,I.jsxs)(j1,{children:[(0,I.jsx)(Q,{value:`agent_default`,children:`Use agent default`}),(0,I.jsx)(Q,{value:`new`,children:`Start a new conversation`}),(0,I.jsx)(Q,{value:`same`,children:`Continue the same conversation`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This setting is frozen into the Rover job. Rover cannot change it locally.`})]}),Le.length===0&&(0,I.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.`})]}),ke&&(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{children:`Tests`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>A(Re.map(e=>e.id)),children:`Select all`}),(0,I.jsx)(`button`,{type:`button`,className:`text-primary hover:underline`,onClick:()=>A([]),children:`Clear`})]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[k.length,` of `,Re.length,` selected`]}),(0,I.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:Re.map(e=>{let t=k.includes(e.id),n=R[e.id],r=!!F[e.id],i=r&&Array.isArray(n),a=new Set(e.serverIds||[]);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 text-sm rounded-md border p-2 cursor-pointer`,onClick:n=>{let r=n.target;r&&(r.closest(`button, a, input, select, textarea, [role='button']`)||A(n=>t?n.filter(t=>t!==e.id):[...n,e.id]))},children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(W0,{checked:t,onCheckedChange:t=>{let n=t===!0;A(t=>n?[...t,e.id]:t.filter(t=>t!==e.id))}}),(0,I.jsxs)(`span`,{className:`min-w-0`,children:[(0,I.jsxs)(`span`,{className:`block font-medium`,children:[e.name||e.id,` `,i&&(0,I.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary`,children:`Override`})]}),(0,I.jsx)(`span`,{className:`block font-mono text-xs text-muted-foreground truncate`,children:e.id})]})]}),t&&(0,I.jsxs)(`div`,{className:`pl-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($,{className:`text-[11px] text-muted-foreground`,children:`Per-scenario: "Override MCP Servers"`}),(0,I.jsx)(G5,{checked:r,onCheckedChange:t=>{if(L(n=>({...n,[e.id]:t})),!t)z(t=>{let n={...t};return delete n[e.id],n});else if(!R[e.id]){let t=j&&N.length>0?[...N]:[...e.serverIds||[]];z(n=>({...n,[e.id]:t}))}}})]}),r&&(0,I.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:He.map(t=>{let r=t.id,i=(n??[]).includes(r),o=a.has(r);return(0,I.jsx)(Y,{variant:i?`default`:`outline-solid`,className:`cursor-pointer text-xs ${i?``:`opacity-60 hover:opacity-100`}`,style:!i&&o?{borderColor:`hsl(var(--primary))`}:void 0,onClick:t=>{t.stopPropagation(),z(t=>{let n=t[e.id]??[],i=n.includes(r)?n.filter(e=>e!==r):[...n,r];return{...t,[e.id]:i}})},children:t.name?.trim()?t.name:r},r)})})]})]},e.id)})}),(0,I.jsxs)(`div`,{className:`space-y-1 rounded-md border p-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsx)(`span`,{children:`Override MCP Servers for selected Tests `}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`Selected tests run against the servers you choose here. Applies only to this run.`})]}),(0,I.jsx)(G5,{checked:j,onCheckedChange:M})]}),j&&(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:He.map(e=>{let t=e.id,n=N.includes(t);return(0,I.jsx)(Y,{variant:n?`default`:`outline-solid`,className:`cursor-pointer text-xs ${n?``:`opacity-60 hover:opacity-100`}`,onClick:()=>P(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]),children:e.name?.trim()?e.name:t},t)})})]})]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsxs)(W,{onClick:Ge,disabled:!t||de||Le.length>0&&w.length===0||Re.length>0&&k.length===0,children:[(0,I.jsx)(Kn,{className:`mr-2 h-4 w-4`}),Ne?`Queue Run`:`Run`]}),a&&(0,I.jsxs)(W,{variant:`destructive`,onClick:Ke,children:[(0,I.jsx)(rr,{className:`mr-2 h-4 w-4`}),`Stop`]})]})]})}),(a||l.length>0)&&(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Progress`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground font-mono`,children:[Math.round(Fe),`%`]})]})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsx)(w7,{value:Fe,className:`h-2`}),(Pe||Ne)&&(0,I.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground`,children:Pe?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{children:[Pe.completedJobs,`/`,Pe.totalJobs,` subtasks complete`]}),Pe.failedJobs-Pe.stoppedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-destructive`,children:[Pe.failedJobs-Pe.stoppedJobs,` failed`]}),Pe.stoppedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-muted-foreground`,children:[Pe.stoppedJobs,` stopped`]}),Pe.pausedJobs>0&&(0,I.jsxs)(`span`,{className:`font-medium text-yellow-700 dark:text-yellow-400`,children:[Pe.pausedJobs,` paused`]}),(0,I.jsx)(Y,{variant:`outline`,className:`capitalize`,children:Pe.status})]}):(0,I.jsx)(`span`,{children:Ne?.roverProgress?`${Ne.roverProgress.completed}/${Ne.roverProgress.total} scenarios complete`:`Attached to active run`})}),pe&&(0,I.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-yellow-500/40 bg-yellow-500/10 px-3 py-2 text-sm`,children:[(0,I.jsxs)(`span`,{className:`text-yellow-700 dark:text-yellow-400`,children:[`OAuth required for: `,(0,I.jsx)(`strong`,{children:pe.servers.join(`, `)})]}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,disabled:de,onClick:()=>{ye.current||(ye.current=!0,fe(!0),x4({serverNames:pe.servers,source:Se,onServerAuthStart:e=>{u(t=>[...t,`[${o9()}] OAuth sign-in opened for '${e}'...`])}}).then(()=>Se.resumeQueue()).then(()=>{let e=pe?.jobId;u(e=>[...e,`[${o9()}] OAuth complete. Resuming run...`]),e&&(C(e),Je(e),o(!0),f(!1),nt(e))}).catch(e=>{let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${o9()}] OAuth error: ${t}`]),ye.current=!1}).finally(()=>{fe(!1)}))},children:de?`Connecting...`:`Connect & Resume`})]}),(0,I.jsx)(`div`,{ref:he,className:`h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5`,children:l.map((e,t)=>(0,I.jsx)(`div`,{className:e.includes(`✓`)?`text-success`:e.includes(`aborted`)?`text-destructive`:`text-foreground`,children:e},t))})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)($v,{className:`inline-flex items-center gap-2 text-base`,children:[(0,I.jsx)(mn,{className:`h-4 w-4`}),`Run Queue`]}),(0,I.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>void Ye(),children:(0,I.jsx)(Yn,{className:`h-3 w-3`})})]})}),(0,I.jsx)(q,{children:!Ne&&ae.length===0&&te.length===0&&se.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No active or queued runs. Start a run above.`}):(0,I.jsxs)(`div`,{className:`space-y-2`,children:[se.map(e=>(0,I.jsxs)(`div`,{onClick:()=>{let t=e.jobs.find(e=>e.status===`running`||e.status===`waiting_for_rover`||e.status===`paused_rover`);t&&rt(t.jobId)},className:`rounded-md border p-3 text-sm ${e.status===`failed`?`border-destructive/40 bg-destructive/5`:e.status===`stopped`?`border-muted-foreground/30 bg-muted/40`:e.status===`partial`?`border-yellow-500/40 bg-yellow-500/5`:e.status===`running`?`border-primary/20 bg-primary/5`:`border-border bg-background`}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`font-semibold`,children:e.evaluationName||`Evaluation`}),(0,I.jsx)(Y,{variant:`outline`,className:`capitalize ${e.status===`running`?`border-emerald-500/40 bg-emerald-500/15 text-emerald-700 dark:text-emerald-400`:``}`,children:e.status}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.completedJobs,`/`,e.totalJobs,` scenario-agent runs complete`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[e.jobs.some(e=>e.status===`blocked_auth`)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs border-yellow-500/50 text-yellow-700 dark:text-yellow-400`,disabled:de,onClick:()=>void Qe(e),children:de?`Connecting...`:`Connect OAuth`}),e.jobs.some(s9)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs`,onClick:()=>{let t=e.jobs.find(s9);t&&tt(t.jobId)},title:`Open the browser-agent URL, then activate the Rover extension`,children:`Open browser agent`}),(0,I.jsx)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:()=>le(t=>t===e.evaluationRunId?null:e.evaluationRunId),"aria-label":`${ce===e.evaluationRunId?`Collapse`:`Expand`} evaluation details`,children:ce===e.evaluationRunId?`Hide`:`Details`}),e.jobs.length>0&&(e.jobs.every(e=>[`queued`,`blocked_auth`,`waiting_for_rover`,`stopped`].includes(e.status))||e.status===`stopped`&&e.jobs.every(e=>[`completed`,`error`,`stopped`].includes(e.status)))&&(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-destructive`,onClick:()=>void et(e.evaluationRunId),title:e.status===`stopped`?`Remove stopped run from the queue`:`Remove evaluation from queue`,"aria-label":e.status===`stopped`?`Remove stopped run from queue`:`Remove evaluation from queue`,children:[(0,I.jsx)(dr,{className:`mr-1 h-3 w-3`}),e.status===`stopped`?`Remove run`:`Remove`]}),e.jobs.some(e=>[`blocked_auth`,`waiting_for_rover`,`paused_rover`,`running`].includes(e.status))&&(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10`,disabled:ue===e.evaluationRunId,onClick:()=>void $e(e.evaluationRunId),title:`Stop this evaluation run and its queued or running tasks`,children:[(0,I.jsx)(rr,{className:`mr-1 h-3 w-3`}),ue===e.evaluationRunId?`Stopping run...`:`Stop run`]})]})]}),ce===e.evaluationRunId&&(0,I.jsx)(`div`,{className:`mt-2 space-y-1 text-xs text-muted-foreground`,children:Jte(e).map(({job:e,child:t},n)=>(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded px-2 py-1 ${t?.status===`completed`?`border border-emerald-500/30 bg-emerald-500/10 text-emerald-800 dark:text-emerald-300`:t?.status===`error`||t?.status===`stopped`?`border border-destructive/30 bg-destructive/5`:`bg-background`}`,onClick:()=>rt(e.jobId),children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 truncate`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[n+1,`.`]}),(t?t.status===`running`:e.status===`running`)&&(0,I.jsx)(i_,{label:`Subjob running`}),t?.status===`completed`&&(0,I.jsx)(ln,{className:`h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400`}),(t?.status===`error`||t?.status===`stopped`)&&(0,I.jsx)(dr,{className:`h-3.5 w-3.5 shrink-0 text-destructive`}),t?`${t.scenarioId} · ${t.agentName}: `:`${e.roverAgent?.name??e.runParams.agents?.join(`, `)??`Agent`}: `,t?.status===`queued`?`queued`:t?.status===`running`?`running`:t?.status===`completed`?`completed`:t?.status===`error`?`error`:t?.status===`stopped`?`stopped`:e.status===`waiting_for_rover`?`waiting for Rover`:e.status===`paused_rover`?`paused`:e.status.replaceAll(`_`,` `),t?` (${t.completed}/${t.total} attempts)`:e.roverProgress&&` (${e.roverProgress.completed}/${e.roverProgress.total} scenarios)`,!t&&e.roverProgress?.lastDurationMs!=null&&` · ${Math.round(e.roverProgress.lastDurationMs/1e3)}s`,t?.error&&` · ${t.error}`,!t&&e.roverProgress?.error&&` · ${e.roverProgress.error}`]}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1`,onClick:e=>e.stopPropagation(),children:[s9(e)&&(!t||e.childProgress?.[0]?.scenarioId===t.scenarioId)&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-6 px-1.5 text-[11px]`,onClick:()=>void tt(e.jobId),children:`Open browser agent`}),!t&&e.executionType===`rover`&&e.status===`paused_rover`&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-6 px-1.5 text-[11px]`,onClick:()=>{Se.resumeRover(e.jobId).then(()=>void Ye())},children:`Resume`}),(t&&(t.status===`running`||t.status===`queued`)||!t&&e.status===`queued`||!t&&e.executionType===`rover`&&(e.status===`waiting_for_rover`||e.status===`paused_rover`||e.status===`running`))&&(0,I.jsx)(W,{size:`sm`,variant:`ghost`,className:`h-6 px-1.5 text-[11px] text-destructive`,onClick:()=>{(t?Se.stopScenario(e.jobId,t.scenarioId,t.agentName):Se.stopRun(e.jobId)).then(()=>void Ye())},children:t?.status===`queued`||e.status===`queued`?`Remove`:`Stop`})]})]},`${e.jobId}:${t?.scenarioId??`job`}:${t?.agentName??`job`}`))})]},e.evaluationRunId)),re.filter(e=>!e.evaluationRunId).map(e=>(0,I.jsxs)(`div`,{role:`button`,tabIndex:0,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===e.jobId?`ring-2 ring-primary/40`:``}`,onClick:()=>{S!==e.jobId&&(C(e.jobId),Je(e.jobId),o(!0),f(!1),y(!1),u([`[${o9()}] Attached to running job ${e.jobId}...`]),c(10),nt(e.jobId))},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&S!==e.jobId&&(t.preventDefault(),C(e.jobId),Je(e.jobId),o(!0),f(!1),y(!1),u([`[${o9()}] Attached to running job ${e.jobId}...`]),c(10),nt(e.jobId))},title:`Click to view progress`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2`,children:[(0,I.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`}),(0,I.jsx)(`span`,{className:`text-xs font-bold`,children:je.get(e.runParams.configPath)||i9(e.runParams.scenarioIds,Me,e.runParams.configPath)}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:r9(e.runParams.configPath,Ae)}),e.runParams.agents&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`agents: `,e.runParams.agents.join(`, `)]}),e.runParams.runNote&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate`,children:[`note: `,e.runParams.runNote]})]}),(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10`,onClick:t=>{t.stopPropagation(),Se.stopRun(e.jobId),Ye()},title:`Stop running job`,children:[(0,I.jsx)(rr,{className:`mr-1 h-3 w-3`}),`Stop`]})]},e.jobId)),ae.filter(e=>!e.evaluationRunId).map(e=>{let t=r9(e.runParams.configPath,Ae),n=i9(e.runParams.scenarioIds,Me,e.runParams.configPath),r=je.get(e.runParams.configPath)||n,i=e.status===`blocked_auth`;return(0,I.jsx)(`div`,{className:`flex items-center justify-between rounded-md border p-2 text-sm ${i?`border-yellow-500/40 bg-yellow-500/5`:`border-border bg-background`}`,children:(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${i?`bg-yellow-500/15 text-yellow-700 dark:text-yellow-400`:`bg-primary/10 text-primary`}`,children:i?`Retrying OAuth`:`Starting`}),(0,I.jsx)(`span`,{className:`text-xs font-bold`,children:r}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:t}),i&&(e.requiredServers??[]).length>0&&(0,I.jsxs)(`span`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:[`OAuth: `,e.requiredServers.join(`, `)]})]})},e.jobId)}),te.filter(e=>!e.evaluationRunId).map((e,t)=>{let n=r9(e.runParams.configPath,Ae),r=i9(e.runParams.scenarioIds,Me,e.runParams.configPath),i=je.get(e.runParams.configPath)||r,a=e.status===`blocked_auth`;return(0,I.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-2 text-sm ${a?`border-yellow-500/40 bg-yellow-500/5`:``}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2 flex-wrap`,children:[a?(0,I.jsxs)(`span`,{className:`inline-flex items-center rounded-full bg-yellow-500/15 px-2 py-0.5 text-xs font-medium text-yellow-700 dark:text-yellow-400`,children:[`#`,t+1,` Blocked`]}):(0,I.jsxs)(`span`,{className:`inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground`,children:[`#`,t+1,` Queued`]}),(0,I.jsx)(`span`,{className:`text-xs font-bold`,children:i}),(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:n}),a&&(e.requiredServers??[]).length>0&&(0,I.jsxs)(`span`,{className:`text-xs text-yellow-700 dark:text-yellow-400`,children:[`OAuth: `,e.requiredServers.join(`, `)]}),!a&&e.runParams.agents&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`agents: `,e.runParams.agents.join(`, `)]}),e.runParams.runNote&&(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate`,children:[`note: `,e.runParams.runNote]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[a&&(0,I.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7 text-xs border-yellow-500/50 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/10`,disabled:de,onClick:()=>{if(ye.current)return;let t=e.requiredServers??[];t.length!==0&&(ye.current=!0,me({jobId:e.jobId,servers:t}),fe(!0),x4({serverNames:t,source:Se,onServerAuthStart:e=>{u(t=>[...t,`[${o9()}] OAuth sign-in opened for '${e}'...`])}}).then(()=>Se.resumeQueue()).then(()=>{u(e=>[...e,`[${o9()}] OAuth complete. Resuming run...`]),C(e.jobId),Je(e.jobId),o(!0),f(!1),nt(e.jobId)}).catch(e=>{let t=e instanceof Error?e.message:String(e);u(e=>[...e,`[${o9()}] OAuth error: ${t}`]),ye.current=!1}).finally(()=>{fe(!1)}))},children:de&&pe?.jobId===e.jobId?`Connecting...`:`Connect & Resume`}),(0,I.jsx)(W,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>void Ze(e.jobId),title:`Remove from queue`,children:(0,I.jsx)(dr,{className:`h-4 w-4`})})]})]},e.jobId)})]})})]}),v&&!a&&!d&&(0,I.jsx)(K,{className:`border-amber-300/60 bg-amber-50/40`,children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,I.jsx)(rr,{className:`h-5 w-5 text-amber-700`}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`font-medium`,children:`Run stopped`}),(0,I.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.`})]}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,I.jsx)(W,{type:`button`,variant:`outline`,onClick:()=>{u([]),c(0),y(!1)},children:`Clear Progress`}),(0,I.jsxs)(W,{type:`button`,onClick:Ge,disabled:!t,children:[(0,I.jsx)(Kn,{className:`mr-2 h-4 w-4`}),`Run Again`]})]})]})})}),d&&(0,I.jsx)(K,{className:p?`border-amber-500/50`:h?.stoppedJobs?`border-border`:`border-success/50`,children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[p?(0,I.jsx)(dr,{className:`h-6 w-6 text-destructive`}):h?.stoppedJobs?(0,I.jsx)(mn,{className:`h-6 w-6 text-muted-foreground`}):(0,I.jsx)(ln,{className:`h-6 w-6 text-success`}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`font-medium`,children:p?`Completed with errors`:h?.stoppedJobs?h.completedJobs?`Completed with stopped scenarios`:`Run stopped`:`Evaluation Complete`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:h?`${h.totalJobs}/${h.totalJobs} finished, ${h.completedJobs} completed, ${Math.max(0,h.failedJobs-h.stoppedJobs)} error(s), ${h.stoppedJobs} stopped.`:p?`The evaluation ended with errors. Review the log for details.`:`All scenarios have finished. Review the results for their outcomes.`})]}),(0,I.jsx)(W,{asChild:!0,className:`ml-auto`,children:(0,I.jsx)(sp,{to:Oe,children:De?`View Results`:`View Runs`})})]})})})]})};function c9({title:e,description:t,expanded:n,onToggleExpanded:r,onHide:i,messages:a,pendingToolCalls:o,loading:s,input:c,onInputChange:l,onSend:u,onCancel:d,inputPlaceholder:f,snippets:p,snippetsLabel:m=`Result Assistant Snippets`,onSnippetSelect:h,onApproveToolCall:g,onDenyToolCall:_,chatEndRef:v,inputRef:y,renderMessage:b,renderMessageExtras:x,className:S=`min-w-0 overflow-hidden xl:flex xl:h-full xl:min-h-0 xl:flex-col`,contentClassName:C=`flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1`}){return(0,I.jsxs)(K,{className:S,children:[(0,I.jsx)(Qv,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)($v,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),e]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:r,children:[n?(0,I.jsx)(Hn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Un,{className:`h-3.5 w-3.5`}),n?`Compact`:`Expand`]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:i,children:`Hide`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]})}),(0,I.jsxs)(q,{className:C,children:[(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-muted/15 px-4 py-4`,children:(0,I.jsxs)(`div`,{className:`space-y-3 pr-2`,children:[a.map((e,t)=>{let n=e.role===`user`,r=e.role===`assistant`,i=e.role===`system`,a=e.role===`tool`,c=e.pendingToolCallId?o.find(t=>t.id===e.pendingToolCallId):void 0;return b?b({message:e,index:t,linkedPendingToolCall:c,isUser:n,isAssistant:r,isSystem:i,isTool:a}):r&&e.pendingToolCallId?(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-3`,children:[(0,I.jsx)(o2,{text:e.text,className:`text-sm`}),c&&(0,I.jsx)(p2,{call:c,loading:s,onApprove:g,onDeny:_,className:`mt-3`})]},`${e.id??`${e.role}-${t}`}-tool`):(0,I.jsx)(f2,{message:e},e.id??`${e.role}-${t}`)}),x,s&&(0,I.jsx)(m2,{}),(0,I.jsx)(`div`,{ref:v})]})}),(0,I.jsx)(`div`,{className:`border-t bg-background px-4 py-3`,children:(0,I.jsx)(g2,{input:c,onInputChange:l,onSend:u,onCancel:d,inputPlaceholder:f,snippets:p,snippetsLabel:m,onSnippetSelect:h,loading:s,inputRef:y})})]})]})}function l9(e,t){if(!Number.isFinite(e)||e<=0)return`0ms`;if(e<1e3)return`${Math.round(e)}ms`;if(t?.preciseUnderTenSeconds&&e<1e4){let t=e/1e3,n=Math.round(t*10)/10;return`${Number.isInteger(n)?n.toFixed(0):n.toFixed(1)}s`}let n=Math.floor(e/1e3),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60;return r>0?`${r}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${a}s`}function u9(e){return e.runs.length>0?e.runs.reduce((e,t)=>e+t.duration,0):e.avgDuration}function d9(e){return e.scenarios.some(e=>e.runs.length>0)?e.scenarios.reduce((e,t)=>e+u9(t),0):typeof e.totalDurationMs==`number`&&e.totalDurationMs>=0?e.totalDurationMs:null}function f9(e){return e.runs.length>0?e.runs.reduce((e,t)=>e+t.toolCalls.reduce((e,t)=>e+t.duration,0),0):0}function p9(e){return e.scenarios.some(e=>e.runs.length>0)?e.scenarios.reduce((e,t)=>e+f9(t),0):typeof e.totalToolDurationMs==`number`&&e.totalToolDurationMs>=0?e.totalToolDurationMs:null}var m9=`hsl(152, 69%, 40%)`,h9=`hsl(0, 72%, 51%)`,g9=`hsl(215, 16%, 47%)`,_9=`hsl(38, 92%, 50%)`,v9=`hsl(38, 92%, 50%)`,y9=`hsl(270, 55%, 50%)`,b9=`hsl(215, 16%, 47%)`;function x9(e,t=0){return e.toLocaleString(void 0,{maximumFractionDigits:t,minimumFractionDigits:t})}function S9({title:e,passed:t,failed:n,incomplete:r=0,error:i=0,stopped:a=0,notEvaluated:o=0,notExecuted:s=0}){let c=[{name:`Passed`,value:t,color:m9},{name:`Failed`,value:n,color:h9},...r>0?[{name:`Incomplete`,value:r,color:v9}]:[],...i>0?[{name:`Error`,value:i,color:y9}]:[],...a>0?[{name:`Stopped`,value:a,color:b9}]:[],...o>0?[{name:`Not evaluated`,value:o,color:g9}]:[],...s>0?[{name:`Not executed`,value:s,color:_9}]:[]];return(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`p-2.5 pb-0`,children:(0,I.jsx)($v,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:e})}),(0,I.jsxs)(q,{className:`flex h-[92px] items-center justify-center gap-2 p-0`,children:[(0,I.jsx)(`div`,{className:`h-[82px] w-[82px] shrink-0`,children:(0,I.jsx)(qE,{width:`100%`,height:`100%`,children:(0,I.jsxs)(kY,{children:[(0,I.jsx)(qH,{data:c,dataKey:`value`,nameKey:`name`,innerRadius:`55%`,outerRadius:`78%`,paddingAngle:3,children:c.map(e=>(0,I.jsx)(JE,{fill:e.color},e.name))}),(0,I.jsx)(OE,{})]})})}),(0,I.jsxs)(`div`,{className:`space-y-0.5 text-xs`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:m9}}),x9(t),` passed`]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:h9}}),x9(n),` failed`]}),r>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:v9}}),x9(r),` incomplete`]}),i>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:y9}}),x9(i),` error`]}),a>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:b9}}),x9(a),` stopped`]}),o>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:g9}}),x9(o),` not evaluated`]}),s>0&&(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full`,style:{backgroundColor:_9}}),x9(s),` not executed`]})]})]})]})}function Xte({runs:e,loading:t}){let n=(0,_.useMemo)(()=>{let t=e.reduce((e,t)=>e+Math.max(0,t.totalRuns),0),n=e.reduce((e,t)=>e+(t.outcomes?.passed??Math.round(Math.max(0,t.totalRuns)*(t.overallPassRate??0))),0),r=e.reduce((e,t)=>e+(t.outcomes?.incomplete??0),0),i=e.reduce((e,t)=>e+(t.outcomes?.error??0),0),a=e.reduce((e,t)=>e+(t.outcomes?.stopped??0),0),o=e.reduce((e,t)=>e+(t.outcomes?.failed??Math.max(0,t.totalRuns-Math.round(Math.max(0,t.totalRuns)*(t.overallPassRate??0))-(t.outcomes?.incomplete??0)-(t.outcomes?.error??0)-(t.outcomes?.stopped??0))),0),s=e.reduce((e,t)=>e+Math.max(0,t.totalScenarios),0),c=e.reduce((e,t)=>(e.passed+=t.checkCounts?.passed??0,e.failed+=t.checkCounts?.failed??0,e.not_evaluated+=t.checkCounts?.not_evaluated??0,e.not_executed+=t.checkCounts?.not_executed??0,e.total+=t.checkCounts?.total??0,e),{passed:0,failed:0,not_evaluated:0,not_executed:0,total:0}),l=n=>t===0?0:e.reduce((e,t)=>e+n(t)*Math.max(0,t.totalRuns),0)/t,u=e.reduce((e,t)=>e+(t.toolTokenUsage?.totalTokens??0),0),d=e.reduce((e,t)=>e+(t.totalDurationMs??0),0),f=e.reduce((e,t)=>e+(t.totalToolDurationMs??0),0);return{totalRuns:t,passedRuns:n,failedRuns:o,incompleteRuns:r,errorRuns:i,stoppedRuns:a,checkCounts:c,totalScenarios:s,passRate:K_(n,t,a),avgToolCalls:l(e=>e.avgToolCalls),avgLatency:l(e=>e.avgLatency),totalTokens:u,totalDurationMs:d,totalToolDurationMs:f}},[e]);return t?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-6 text-sm text-muted-foreground`,children:`Calculating dashboard…`})}):e.length===0?(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-6 text-sm text-muted-foreground`,children:`No results in the selected range.`})}):(0,I.jsx)(`div`,{className:`space-y-2`,"data-testid":`results-dashboard`,children:(0,I.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-4`,children:[(0,I.jsx)(S9,{title:`Runs Pass / Fail / Incomplete / Error / Stopped`,passed:n.passedRuns,failed:n.failedRuns,incomplete:n.incompleteRuns,error:n.errorRuns,stopped:n.stoppedRuns}),(0,I.jsx)(S9,{title:`Checks Pass / Fail / Not evaluated / Not executed`,passed:n.checkCounts.passed,failed:n.checkCounts.failed,notEvaluated:n.checkCounts.not_evaluated,notExecuted:n.checkCounts.not_executed}),(0,I.jsxs)(`div`,{className:`grid self-start content-start gap-3 sm:grid-cols-2 lg:col-span-2 lg:grid-cols-4`,children:[(0,I.jsx)(ly,{compact:!0,title:`Scenarios`,value:x9(n.totalScenarios),icon:jn}),(0,I.jsx)(ly,{compact:!0,title:`Total Runs`,value:x9(n.totalRuns),icon:Xt}),(0,I.jsx)(ly,{compact:!0,title:`Pass Rate`,value:n.passRate===null?`–`:`${x9(n.passRate*100,1)}%`,icon:tn}),(0,I.jsx)(ly,{compact:!0,title:`Avg Tool Calls`,value:x9(n.avgToolCalls,1),icon:ln}),(0,I.jsx)(ly,{compact:!0,title:`Avg Latency`,value:`${x9(n.avgLatency)}ms`,icon:ir}),(0,I.jsx)(ly,{compact:!0,title:`Tool Tokens`,value:x9(n.totalTokens),icon:ur}),n.totalDurationMs>0?(0,I.jsx)(ly,{compact:!0,title:`Total Time`,value:l9(n.totalDurationMs),icon:mn}):null,n.totalToolDurationMs>0?(0,I.jsx)(ly,{compact:!0,title:`Tool Duration`,value:l9(n.totalToolDurationMs),icon:mn}):null]})]})})}function Zte(e){let t=[];for(let n of e.scenarios)for(let e of n.runs)e.error&&t.push(e.error),t.push(...e.failureReasons);return t.map(e=>String(e??``).trim()).filter(Boolean)}function Qte(e){let t=e.toLowerCase();return t.includes(`invalid_token`)||t.includes(`authentication failed`)||t.includes(`bearer token`)||t.includes(`oauth`)?`auth`:t.includes(`429`)||t.includes(`too many requests`)||t.includes(`rate limit`)?`rate_limit`:t.includes(`scenario error:`)||t.includes(`failed to list tools`)||t.includes(`failed to connect to mcp server`)||t.includes(`tool call failed`)||t.includes(`fetch failed`)||t.includes(`streamable http error`)?`infra`:null}function $te(e){return e===`auth`?`Auth error`:e===`rate_limit`?`Rate limited`:`Infra error`}function ene(e){let t=Zte(e);for(let e of[`auth`,`rate_limit`,`infra`]){let n=t.find(t=>Qte(t)===e);if(n)return{kind:e,label:$te(e),detail:n}}return null}function tne(e){return e===`auth`?`border-amber-500/30 bg-amber-500/10 text-amber-700`:e===`rate_limit`?`border-orange-500/30 bg-orange-500/10 text-orange-700`:`border-slate-500/30 bg-slate-500/10 text-slate-700`}function nne({run:e}){let t=ene(e);return t?(0,I.jsx)(fl,{delayDuration:0,children:(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsx)(Y,{variant:`outline`,className:`h-5 text-[10px] ${tne(t.kind)}`,children:t.label})}),(0,I.jsx)(hl,{className:`max-w-sm text-xs`,children:(0,I.jsx)(`p`,{children:t.detail})})]})}):null}function C9(e){return e instanceof Dv&&e.status===404}function w9(e){let{source:t,open:n,scope:r,runId:i,onSessionSync:a}=e,[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)([]),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),y=(0,_.useRef)(null),b=(0,_.useRef)(null),x=(0,_.useRef)(0),S=(0,_.useRef)(t),C=(0,_.useRef)(a),w=(0,_.useRef)(null),T=(0,_.useRef)(null);(0,_.useEffect)(()=>{y.current=o},[o]),(0,_.useEffect)(()=>{S.current=t},[t]),(0,_.useEffect)(()=>{C.current=a},[a]);let E=(0,_.useCallback)(()=>{let e=b.current;e&&e.controller.abort()},[]),D=(0,_.useCallback)((e,t)=>{s(t??e.id),l(t=>t.length>e.messages.length?t:e.messages),d(e.pendingToolCalls),C.current?.(e)},[]),k=(0,_.useCallback)(async(e,t)=>{let n=t.session.id||e;D(t.session,n)},[D]),A=(0,_.useCallback)(()=>{let e=b.current;e&&(E(),p(e.prompt),h(!1),v(!1))},[E]),j=(0,_.useCallback)(async()=>{let e=f.trim();if(!e||r===`run`&&!i)return;let n=++x.current,a=new AbortController,s=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,c={id:s,role:`user`,text:e,createdAt:new Date().toISOString()};b.current={id:n,controller:a,prompt:e},v(!0),p(``),l(e=>[...e,c]),h(!0);try{let u=o;if(!u){let e=r===`run`&&i?await t.createResultAssistantSession({runId:i,scope:`run`},a.signal):await t.createResultAssistantSession({scope:`all_runs`},a.signal);if(a.signal.aborted||b.current?.id!==n)return;u=e.sessionId||e.session.id,D(e.session,u),l(t=>t.some(e=>e.id===s)?[...e.session.messages,c]:e.session.messages)}try{let r=await t.sendResultAssistantMessage(u,e,a.signal);if(a.signal.aborted||b.current?.id!==n)return;await k(u,r)}catch(o){if(u4(o)||a.signal.aborted||b.current?.id!==n)return;if(!C9(o))throw o;let u=r===`run`&&i?await t.createResultAssistantSession({runId:i,scope:`run`},a.signal):await t.createResultAssistantSession({scope:`all_runs`},a.signal);if(a.signal.aborted||b.current?.id!==n)return;let d=u.sessionId||u.session.id;if(D(u.session,d),l(e=>e.some(e=>e.id===s)?[...u.session.messages,c]:u.session.messages),a.signal.aborted||b.current?.id!==n)return;let f=await t.sendResultAssistantMessage(d,e,a.signal);if(a.signal.aborted||b.current?.id!==n)return;await k(d,f)}}catch(e){if(u4(e)||a.signal.aborted||b.current?.id!==n)return;l(e=>e.filter(e=>e.id!==s)),O({title:`MCP Lab Assistant error`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{b.current?.id===n&&(b.current=null,h(!1),v(!1))}},[f,r,i,o,t,D,k]),M=(0,_.useCallback)(async e=>{if(o){v(!1),h(!0);try{let n=await t.approveResultAssistantToolCall(o,e);await k(o,n)}catch(e){C9(e)&&(s(null),d([])),O({title:`Could not approve assistant action`,description:C9(e)?`Assistant session expired. Ask a new question to start a fresh session.`:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{h(!1)}}},[o,t,k]),N=(0,_.useCallback)(async e=>{if(o){v(!1),h(!0);try{let n=await t.denyResultAssistantToolCall(o,e);await k(o,n)}catch(e){C9(e)&&(s(null),d([])),O({title:`Could not deny assistant action`,description:C9(e)?`Assistant session expired. Ask a new question to start a fresh session.`:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{h(!1)}}},[o,t,k]),P=(0,_.useCallback)(()=>{E();let e=y.current;e&&t.closeResultAssistantSession(e).catch(()=>void 0),y.current=null,s(null),l([]),d([]),p(``),v(!1)},[E,t]),F=(0,_.useCallback)(e=>{l(t=>t.length>0?t:[{id:`msg-${Date.now()}`,role:`assistant`,text:e,createdAt:new Date().toISOString()}])},[]),I=(0,_.useCallback)(e=>{p(e),requestAnimationFrame(()=>T.current?.focus())},[]);return(0,_.useEffect)(()=>{if(!n)return;let e=window.setTimeout(()=>{w.current?.scrollIntoView({behavior:`smooth`,block:`end`})},0);return()=>window.clearTimeout(e)},[n,c.length,m]),(0,_.useEffect)(()=>{let e=T.current;if(!e)return;e.style.height=`0px`;let t=Math.min(e.scrollHeight,160);e.style.height=`${Math.max(40,t)}px`},[f,n]),(0,_.useEffect)(()=>{if(n&&o)return S.current.subscribeResultAssistantSessionEvents(o,e=>{D(e.payload.session,e.payload.sessionId)})},[n,o,D]),(0,_.useEffect)(()=>()=>{E();let e=y.current;e&&S.current.closeResultAssistantSession(e).catch(()=>void 0)},[E]),{assistantSessionId:o,assistantMessages:c,assistantPendingToolCalls:u,assistantInput:f,assistantLoading:m,assistantTurnCancelable:g,cancelAssistantTurn:A,assistantChatEndRef:w,assistantInputRef:T,setAssistantInput:p,setAssistantMessages:l,askAssistant:j,approveResultAssistantToolCall:M,denyResultAssistantToolCall:N,applyResultAssistantSnippet:I,ensureIntroMessage:F,resetAssistantSession:P}}function T9(e){let t=String(e??``).trim();return t&&(t.split(`::`).pop()??t).replace(/^mcplab__/,``).replace(/^mcplab_/,``).replace(/_/g,` `).replace(/\s+/g,` `).trim()||`unknown_tool`}async function E9(e,t){let n=t.configPath?.trim();if(!n)throw Error(`This run has no config path in metadata.`);let r=await e.getResult(t.id)??t,i=r.rerunAgents&&r.rerunAgents.length>0?r.rerunAgents:Array.from(new Set(r.scenarios.map(e=>e.agentId).filter(Boolean)));await e.startRun({configPath:n,runsPerScenario:1,scenarioIds:r.rerunScenarioIds,agents:i.length>0?i:void 0,runNote:r.runNote,serverOverrideAll:r.rerunServerOverrideAll,scenarioServerOverrides:r.rerunScenarioServerOverrides,newConversationBeforeStart:r.rerunNewConversationBeforeStart,newConversationBetweenScenarios:r.rerunNewConversationBetweenScenarios})}var D9=[{value:`15min`,label:`Last 15min`,durationMs:9e5},{value:`30min`,label:`Last 30min`,durationMs:18e5},{value:`1h`,label:`Last hour`,durationMs:36e5},{value:`2h`,label:`Last 2 hours`,durationMs:72e5},{value:`4h`,label:`Last 4 hours`,durationMs:144e5},{value:`8h`,label:`Last 8 hours`,durationMs:288e5},{value:`24h`,label:`Last 24 hours`,durationMs:864e5},{value:`7d`,label:`Last 7 days`,durationMs:6048e5},{value:`14d`,label:`Last 14 days`,durationMs:12096e5},{value:`30d`,label:`Last 30 days`,durationMs:2592e6}];function O9(e){return e===`all`||e===`last`||e===`custom`}function k9(e){return e===`15min`||e===`30min`||e===`1h`||e===`2h`||e===`4h`||e===`8h`||e===`24h`||e===`7d`||e===`14d`||e===`30d`}function A9(e){let t=e.get(`time_filter`),n=e.get(`time_preset`);return{mode:O9(t)?t:`all`,preset:k9(n)?n:`15min`,start:e.get(`time_start`)??``,end:e.get(`time_end`)??``}}var j9=8,M9=`mcplab:results:time-filter`,N9=`mcplab:results:dashboard-visible`;function P9(e){if(!e.trim())return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function F9(e,t,n,r){if(e===`all`)return{};if(e===`last`){let e=D9.find(e=>e.value===t)??D9[0],n=new Date(Date.now());return{since:new Date(n.getTime()-e.durationMs).toISOString(),until:n.toISOString()}}let i=P9(n),a=P9(r);return i&&a?i.getTime()<=a.getTime()?{since:i.toISOString(),until:a.toISOString()}:{since:a.toISOString(),until:i.toISOString()}:i?{since:i.toISOString()}:a?{until:a.toISOString()}:{}}function I9(e){let t=P9(e);return t?t.toLocaleString():``}function rne(e){let t=P9(e);return t?`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`:e}function ine(e){let t=P9(e);return t?t.toLocaleDateString(void 0,{weekday:`long`,month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):`Unknown day`}function ane(e){return e.has(`time_filter`)||e.has(`time_preset`)||e.has(`time_start`)||e.has(`time_end`)}function one(){try{let e=localStorage.getItem(M9);if(!e)return null;let t=JSON.parse(e);return{mode:O9(typeof t.mode==`string`?t.mode:null)?t.mode:`all`,preset:k9(typeof t.preset==`string`?t.preset:null)?t.preset:`15min`,start:typeof t.start==`string`?t.start:``,end:typeof t.end==`string`?t.end:``}}catch{return null}}function sne(){try{let e=localStorage.getItem(N9);return e===null||e===`true`}catch{return!0}}var cne=[{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.`}],L9=100,lne=()=>{let[e,t]=pp(),{source:n}=Rv(),[r]=(0,_.useState)(()=>ane(e)?A9(e):one()??A9(e)),[i,a]=(0,_.useState)([]),[o,s]=(0,_.useState)([]),c=(0,_.useRef)(0),[l,u]=(0,_.useState)(!0),[d,f]=(0,_.useState)(sne),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(`timestamp`),[S,C]=(0,_.useState)(`desc`),[w,T]=(0,_.useState)(`all`),[E,D]=(0,_.useState)(!1),[k,A]=(0,_.useState)(r.mode),[j,M]=(0,_.useState)(r.preset),[N,P]=(0,_.useState)(r.start),[F,L]=(0,_.useState)(r.end),[R,z]=(0,_.useState)(!1),[B,ee]=(0,_.useState)(!1),[te,ne]=(0,_.useState)(!1),{completionVersion:re}=Uv(),ie=X7(L9),{offset:ae,totalCount:oe,hasMore:se}=ie,[V,ce]=(0,_.useState)(null),le=w===`all`?void 0:w,ue=e=>{b===e?C(e=>e===`asc`?`desc`:`asc`):(x(e),C(e===`timestamp`?`desc`:`asc`))},H=(0,_.useCallback)(async()=>{if(!d||!n.listRunSummaries)return;let e=++c.current;u(!0);try{let t=await n.listRunSummaries({...F9(k,j,N,F),scenario:le});c.current===e&&s(t.map(MY))}catch{c.current===e&&s([])}finally{c.current===e&&u(!1)}},[le,d,n,F,k,j,N]),de=async()=>{m(!0);try{let e=F9(k,j,N,F);if(n.listRunSummariesPage){let t=await n.listRunSummariesPage({...e,scenario:le,limit:L9,offset:ae});ie.updateMeta(t),a(t.data.map(MY))}else if(n.listRunSummaries){let t=await n.listRunSummaries({...e,scenario:le,limit:L9,offset:ae});ie.setTotalCount(t.length),ie.setHasMore(!1),a(t.map(MY))}else ie.setTotalCount(0),ie.setHasMore(!1),a(await n.listResults());H()}catch(e){O({title:`Could not load results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{m(!1)}};(0,_.useEffect)(()=>{let e=!0;m(!0);let t=F9(k,j,N,F);return(n.listRunSummariesPage?n.listRunSummariesPage({...t,scenario:le,limit:L9,offset:ae}).then(t=>(e&&ie.updateMeta(t),t.data.map(MY))):n.listRunSummaries?n.listRunSummaries({...t,scenario:le,limit:L9,offset:ae}).then(t=>(e&&(ie.setTotalCount(t.length),ie.setHasMore(!1)),t.map(MY))):n.listResults()).then(t=>{e&&a(t)}).catch(t=>{e&&O({title:`Could not load results`,description:t instanceof Error?t.message:String(t),variant:`destructive`})}).finally(()=>{e&&m(!1)}),()=>{e=!1}},[le,re,ae,n,F,k,j,N]),(0,_.useEffect)(()=>{try{localStorage.setItem(N9,String(d))}catch{}},[d]),(0,_.useEffect)(()=>{H()},[re,H]),(0,_.useEffect)(()=>{d&&n.listRunSummaries||(d&&s(i),u(!1))},[d,i,n]);let{assistantMessages:fe,assistantPendingToolCalls:pe,assistantInput:me,assistantLoading:he,assistantTurnCancelable:ge,cancelAssistantTurn:_e,assistantChatEndRef:ve,assistantInputRef:ye,setAssistantInput:be,askAssistant:xe,approveResultAssistantToolCall:Se,denyResultAssistantToolCall:Ce,applyResultAssistantSnippet:we,ensureIntroMessage:Te}=w9({source:n,open:B,scope:`all_runs`}),Ee=(0,_.useMemo)(()=>{let e=new Map;return i.forEach(t=>{t.scenarios.forEach(t=>{let n=String(t.scenarioName??``).trim(),r=String(t.scenarioId??``).trim();r?e.set(r,n||r):n&&e.set(n,n)})}),Array.from(e.entries()).map(([e,t])=>({value:e,label:t})).sort((e,t)=>e.label.localeCompare(t.label))},[i]);(0,_.useEffect)(()=>{let t=(e.get(`scenario`)??``).trim();t&&(Ee.some(e=>e.value===t||e.label===t)?T(t):i.length>0&&T(`all`))},[e,Ee,i.length]),(0,_.useEffect)(()=>{let n=new URLSearchParams(e);k===`all`?(n.delete(`time_filter`),n.delete(`time_preset`),n.delete(`time_start`),n.delete(`time_end`)):k===`last`?(n.set(`time_filter`,`last`),n.set(`time_preset`,j),n.delete(`time_start`),n.delete(`time_end`)):(n.set(`time_filter`,`custom`),n.delete(`time_preset`),N.trim()?n.set(`time_start`,N.trim()):n.delete(`time_start`),F.trim()?n.set(`time_end`,F.trim()):n.delete(`time_end`)),n.toString()!==e.toString()&&t(n,{replace:!0})},[e,t,F,k,j,N]),(0,_.useEffect)(()=>{try{if(k===`all`){localStorage.removeItem(M9);return}let e={mode:k,preset:j,start:N,end:F};localStorage.setItem(M9,JSON.stringify(e))}catch{}},[F,k,j,N]);let De=(0,_.useMemo)(()=>{if(n.listRunSummariesPage)return i;let e=w===`all`?i:i.filter(e=>e.scenarios.some(e=>{let t=String(e.scenarioName??``).trim(),n=String(e.scenarioId??``).trim();return t===w||n===w}));if(k===`all`)return e;let t=Date.now();if(k===`last`){let n=t-(D9.find(e=>e.value===j)??D9[0]).durationMs;return e.filter(e=>{let r=new Date(e.timestamp).getTime();return r>=n&&r<=t})}let r=P9(N)?.getTime()??null,a=P9(F)?.getTime()??null,o=r!==null&&a!==null?Math.min(r,a):r??null,s=r!==null&&a!==null?Math.max(r,a):a??null;return e.filter(e=>{let t=new Date(e.timestamp).getTime();return!(Number.isNaN(t)||o!==null&&t<o||s!==null&&t>s)})},[i,w,n.listRunSummariesPage,F,k,j,N]);(0,_.useEffect)(()=>{ie.reset()},[le,ie.reset,F,k,j,N]);let Oe=(0,_.useMemo)(()=>w===`all`?`All scenarios`:Ee.find(e=>e.value===w||e.label===w)?.label??w,[w,Ee]),ke=(0,_.useMemo)(()=>{if(k===`all`)return`All time`;if(k===`last`)return D9.find(e=>e.value===j)?.label??`Last range`;let e=!!N.trim(),t=!!F.trim();return!e&&!t?`Custom range`:e&&t?`${I9(N)} - ${I9(F)}`:e?`From ${I9(N)}`:`Until ${I9(F)}`},[F,k,j,N]),Ae=(0,_.useMemo)(()=>{let e=(e,t)=>e===null&&t===null?0:e===null?1:t===null?-1:S===`asc`?e-t:t-e;return[...De].sort((t,n)=>{if(b===`toolTokens`)return e(t.toolTokenUsage?.totalTokens??null,n.toolTokenUsage?.totalTokens??null);let r=0;return b===`id`&&(r=t.id.localeCompare(n.id)),b===`timestamp`&&(r=new Date(t.timestamp).getTime()-new Date(n.timestamp).getTime()),b===`passRate`&&(r=(t.overallPassRate??-1)-(n.overallPassRate??-1)),b===`scenarios`&&(r=t.totalScenarios-n.totalScenarios),b===`avgToolCalls`&&(r=t.avgToolCalls-n.avgToolCalls),S===`asc`?r:-r})},[De,b,S]),je=(0,_.useMemo)(()=>{let e=[],t=null;for(let n of Ae){let r=rne(n.timestamp);r!==t&&(e.push({type:`day-separator`,dayKey:r,dayLabel:ine(n.timestamp)}),t=r),e.push({type:`run`,run:n})}return e},[Ae]),Me=e=>b===e?S===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`}),Ne=e=>{let t=e.toolTokenUsage?.totalTokens;return typeof t==`number`?t.toLocaleString():`n/a`},Pe=()=>{A(`all`),M(`15min`),P(``),L(``)},Fe=(0,_.useMemo)(()=>{let e=new Map;for(let t of Ae){if(t.scenarios.length>0){e.set(t.id,jY(t));continue}let n=t.configName?.trim()||``,r=t.configPath?.trim()||``,i=n||r;e.set(t.id,{scenarioCount:t.totalScenarios,agentCount:0,scopePreview:i||`n/a`,modelSummary:``})}return e},[Ae]),Ie=()=>{ee(!0),Te(`Ask me to compare runs, explain regressions over time, or summarize historical drift patterns.`)},Le=async e=>{y(!0);try{await n.deleteResult(e),a(t=>t.filter(t=>t.id!==e)),s(t=>t.filter(t=>t.id!==e)),ie.setTotalCount(e=>Math.max(0,e-1)),O({title:`Run deleted`,description:e}),g(null)}catch(e){O({title:`Could not delete run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{y(!1)}},Re=async e=>{if(!e.configPath?.trim())O({title:`Cannot rerun`,description:`This run has no config path in metadata.`,variant:`destructive`});else{ce(e.id);try{await E9(n,e),O({title:`Rerun queued`,description:`${e.id} queued with previous run settings.`})}catch(e){O({title:`Could not rerun`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ce(t=>t===e.id?null:t)}}};return(0,I.jsxs)(`div`,{className:`flex flex-col`,children:[(0,I.jsx)(z3,{open:h!==null,onOpenChange:e=>{!e&&!v&&g(null)},children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete run?`}),(0,I.jsxs)(K3,{children:[`This will permanently remove the run artifacts from disk for`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:h??``}),`.`]})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{disabled:v,children:`Cancel`}),(0,I.jsx)(q3,{disabled:v||!h,onClick:e=>{e.preventDefault(),h&&Le(h)},className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:v?`Deleting...`:`Delete run`})]})]})}),(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(tn,{className:`h-6 w-6`}),`Results`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Browse evaluation runs and open detailed results`})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(S8,{open:E,onOpenChange:D,children:[(0,I.jsx)(C8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":E,"aria-controls":`results-scenario-command-list`,className:`w-[260px] justify-between font-normal ${w===`all`?``:`border-primary/40`}`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:Oe}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(w8,{className:`w-[260px] p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(S5,{id:`results-scenario-command-list`,children:[(0,I.jsx)(C5,{children:`No scenarios found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(E5,{value:`all scenarios`,onSelect:()=>{T(`all`),D(!1)},children:`All scenarios`}),Ee.map(e=>(0,I.jsx)(E5,{value:`${e.label} ${e.value}`,onSelect:()=>{T(e.value),D(!1)},children:e.label},e.value))]})]})]})})]}),(0,I.jsxs)(S8,{open:R,onOpenChange:z,children:[(0,I.jsx)(C8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":R,"aria-controls":`results-time-command-list`,className:`w-[320px] justify-between font-normal ${k===`all`?``:`border-primary/40`}`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 truncate text-left`,children:[(0,I.jsx)(en,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`truncate`,children:ke})]}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsxs)(w8,{className:`w-[360px] p-0`,align:`start`,children:[(0,I.jsxs)(`div`,{className:`border-b px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Date and time filter`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Filter runs by timestamp.`})]}),(0,I.jsxs)(`div`,{id:`results-time-command-list`,className:`grid gap-1 p-2`,children:[(0,I.jsx)(W,{type:`button`,variant:k===`all`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{Pe(),z(!1)},children:`All time`}),D9.map(e=>(0,I.jsx)(W,{type:`button`,variant:k===`last`&&j===e.value?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{A(`last`),M(e.value),z(!1)},children:e.label},e.value)),(0,I.jsx)(W,{type:`button`,variant:k===`custom`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>A(`custom`),children:`Custom date time range`})]}),k===`custom`&&(0,I.jsxs)(`div`,{className:`space-y-3 border-t p-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`results-time-filter-start`,children:`Start`}),(0,I.jsx)(Np,{id:`results-time-filter-start`,type:`datetime-local`,value:N,onChange:e=>P(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`results-time-filter-end`,children:`End`}),(0,I.jsx)(Np,{id:`results-time-filter-end`,type:`datetime-local`,value:F,onChange:e=>L(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`px-2`,onClick:Pe,children:[(0,I.jsx)(dr,{className:`mr-1.5 h-3.5 w-3.5`}),`Clear`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,onClick:()=>z(!1),children:`Done`})]})]})]})]}),(0,I.jsx)(W,{variant:`outline`,onClick:()=>void de(),disabled:p,children:p?`Refreshing...`:`Refresh`}),(0,I.jsx)(W,{variant:`outline`,onClick:ie.prev,disabled:p||ae===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:ie.next,disabled:p||!se,children:`Next`}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,className:`gap-1.5`,onClick:Ie,children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`MCP Lab Assistant`]})]})]}),(0,I.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-3`,children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ie.rangeLabel(i.length)}),(0,I.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs text-muted-foreground`,onClick:()=>f(e=>!e),"aria-pressed":d,children:[(0,I.jsx)(Mn,{className:`h-3 w-3`}),d?`Hide dashboard`:`Show dashboard`]})]}),d?(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Xte,{runs:o,loading:l})}):null,(0,I.jsxs)(`div`,{className:`mt-4 grid gap-6 ${B?te?`xl:grid-cols-[minmax(0,1fr)_52rem]`:`xl:grid-cols-[minmax(0,1fr)_30rem]`:`grid-cols-1`}`,children:[(0,I.jsx)(K,{"data-testid":`results-table`,className:`results-table-container`,children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(ny,{className:`table-auto`,children:[(0,I.jsx)(ry,{children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{className:`results-table-column-run-id w-120 max-w-120`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>ue(`id`),children:[`Run ID`,Me(`id`)]})}),(0,I.jsx)(sy,{className:`results-table-column-evaluation w-[20rem] max-w-[20rem] min-w-0`,children:`Evaluation`}),(0,I.jsx)(sy,{className:`results-table-column-timestamp w-44 min-w-44 max-w-44`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>ue(`timestamp`),children:[`Timestamp`,Me(`timestamp`)]})}),(0,I.jsx)(sy,{className:`results-table-column-pass-rate w-30 min-w-30 max-w-30 text-center`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex w-full items-center justify-end gap-1 hover:text-foreground`,onClick:()=>ue(`passRate`),children:[`Pass Rate`,Me(`passRate`)]})}),(0,I.jsx)(sy,{className:`results-table-column-scenarios w-22 min-w-22 max-w-22 text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>ue(`scenarios`),children:[`Scenarios`,Me(`scenarios`)]})}),(0,I.jsx)(sy,{className:`results-table-column-avg-tools w-30 min-w-30 max-w-30 text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>ue(`avgToolCalls`),children:[`Avg Tools`,Me(`avgToolCalls`)]})}),(0,I.jsx)(sy,{className:`results-table-column-tool-tokens w-36 min-w-36 max-w-36 text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>ue(`toolTokens`),children:[`Tool Tokens`,Me(`toolTokens`)]})}),(0,I.jsx)(sy,{className:`results-table-column-actions w-36 min-w-36 max-w-36`})]})}),(0,I.jsx)(iy,{children:je.length===0?(0,I.jsx)(oy,{children:(0,I.jsx)(J,{colSpan:j9,className:`px-4 py-10 text-center text-sm text-muted-foreground`,children:k===`all`&&w===`all`?`No runs yet.`:`No runs match current filters.`})}):je.map((e,t)=>e.type===`day-separator`?(0,I.jsx)(oy,{className:`bg-muted/30 hover:bg-muted/30`,children:(0,I.jsx)(J,{colSpan:j9,className:`px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`}),(0,I.jsx)(`span`,{className:`shrink-0 rounded-full border border-border bg-background px-2.5 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.dayLabel}),(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`})]})})},`day-${e.dayKey}-${t}`):(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`results-table-column-run-id w-120 max-w-120`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(sp,{to:`/results/${e.run.id}`,className:`font-mono text-xs text-primary hover:underline`,children:e.run.id}),(0,I.jsx)(`div`,{className:`min-w-0 truncate font-mono text-xs text-foreground/80`,title:Fe.get(e.run.id)?.scopePreview??`n/a`,children:Fe.get(e.run.id)?.scopePreview??`n/a`}),e.run.runNote?(0,I.jsxs)(`div`,{className:`text-[11px] text-muted-foreground wrap-break-word`,children:[`Note: `,e.run.runNote]}):null]})}),(0,I.jsx)(J,{className:`results-table-column-evaluation w-[20rem] max-w-[20rem] min-w-0 text-[11px] text-muted-foreground`,children:(()=>{let t=Fe.get(e.run.id)??{scenarioCount:0,agentCount:0,scopePreview:`n/a`,modelSummary:``};return(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap`,children:[t.scenarioCount,` scenario`,t.scenarioCount===1?``:`s`,` · `,t.agentCount,` `,`agent`,t.agentCount===1?``:`s`]}),t.modelSummary?(0,I.jsxs)(`span`,{className:`min-w-0 truncate`,title:t.modelSummary,children:[`· `,t.modelSummary]}):null]}),(0,I.jsx)(Y7,{versions:e.run.mcpServerVersions,showPrefix:!1,className:`max-w-[18rem]`})]})})()}),(0,I.jsx)(J,{className:`results-table-column-timestamp w-44 min-w-44 max-w-44 text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.run.timestamp).toLocaleString()]}),(()=>{let t=d9(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Total time: `,l9(t)]})})()]})}),(0,I.jsx)(J,{className:`results-table-column-pass-rate w-30 min-w-30 max-w-30 text-right`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,I.jsx)(dy,{rate:e.run.overallPassRate}),e.run.checkCounts&&e.run.checkCounts.total>0?(0,I.jsxs)(`span`,{className:`font-mono text-[11px] leading-none`,"aria-label":`${e.run.checkCounts.passed} checks passed, ${e.run.checkCounts.failed} checks failed${e.run.checkCounts.not_evaluated>0?`, ${e.run.checkCounts.not_evaluated} not evaluated`:``}${(e.run.checkCounts.not_executed??0)>0?`, ${e.run.checkCounts.not_executed} not executed`:``}`,title:`${e.run.checkCounts.passed} passed · ${e.run.checkCounts.failed} failed${e.run.checkCounts.not_evaluated>0?` · ${e.run.checkCounts.not_evaluated} not evaluated`:``}${(e.run.checkCounts.not_executed??0)>0?` · ${e.run.checkCounts.not_executed} not executed`:``}`,children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[e.run.checkCounts.passed,` ✓`]}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,I.jsxs)(`span`,{className:`text-destructive`,children:[e.run.checkCounts.failed,` ✕`]})]}):null,(0,I.jsx)(nne,{run:e.run})]})}),(0,I.jsx)(J,{className:`results-table-column-scenarios w-22 min-w-22 max-w-22 text-right font-mono text-sm`,children:e.run.totalScenarios}),(0,I.jsx)(J,{className:`results-table-column-avg-tools w-30 min-w-30 max-w-30 text-center font-mono text-sm`,children:e.run.avgToolCalls.toFixed(0)}),(0,I.jsx)(J,{className:`results-table-column-tool-tokens w-36 min-w-36 max-w-36 text-right`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`font-mono text-sm`,children:Ne(e.run)}),(()=>{let t=p9(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Tool time: `,l9(t)]})})()]})}),(0,I.jsx)(J,{className:`results-table-column-actions w-36 min-w-36 max-w-36`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsxs)(W,{size:`sm`,variant:`outline`,disabled:V===e.run.id,onClick:()=>void Re(e.run),children:[(0,I.jsx)(Kn,{className:`mr-1.5 h-3.5 w-3.5`}),V===e.run.id?`Queueing...`:`Rerun`]}),(0,I.jsxs)(LQ,{children:[(0,I.jsx)(RQ,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":`More actions`,children:(0,I.jsx)(vn,{className:`h-4 w-4`})})}),(0,I.jsxs)(VQ,{align:`end`,children:[(0,I.jsx)(HQ,{asChild:!0,children:(0,I.jsxs)(sp,{to:`/results/${e.run.id}`,children:[(0,I.jsx)(xn,{className:`mr-2 h-3.5 w-3.5`}),`View`]})}),Object.entries(e.run.langsmithTraceUrls??{}).map(([e,t])=>(0,I.jsx)(HQ,{asChild:!0,children:(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(yn,{className:`mr-2 h-3.5 w-3.5`}),`LangSmith trace`]})},e)),(0,I.jsxs)(HQ,{children:[(0,I.jsx)(gn,{className:`mr-2 h-3.5 w-3.5`}),`Export JSON`]}),(0,I.jsxs)(HQ,{className:`text-destructive`,onSelect:t=>{t.preventDefault();let n=document.activeElement;n instanceof HTMLElement&&n.blur(),g(e.run.id)},children:[(0,I.jsx)(ar,{className:`mr-2 h-3.5 w-3.5`}),`Delete`]})]})]})]})})]},e.run.id))})]})})}),B&&(0,I.jsx)(c9,{title:`MCP Lab Assistant`,description:`Analyze historical differences and trends across all result runs.`,expanded:te,onToggleExpanded:()=>ne(e=>!e),onHide:()=>ee(!1),messages:fe,pendingToolCalls:pe,loading:he,onCancel:ge?_e:void 0,input:me,onInputChange:be,onSend:()=>void xe(),inputPlaceholder:`Ask about historical run differences...`,snippets:cne,onSnippetSelect:e=>{ee(!0),we(e)},onApproveToolCall:e=>void Se(e),onDenyToolCall:e=>void Ce(e),chatEndRef:ve,inputRef:ye,className:`min-w-0 overflow-hidden xl:flex xl:h-[calc(100vh-14rem)] xl:min-h-0 xl:flex-col`,renderMessage:({message:e,index:t,linkedPendingToolCall:n,isUser:r,isAssistant:i,isSystem:a,isTool:o})=>{let s=i&&!!e.pendingToolCallId;if(o&&/^(Approved|Denied) tool call\b/i.test(String(e.text??``).trim()))return null;if(s){let r=T9(n?.tool??e.toolRequestName??n?.publicToolName??e.toolRequestPublicName??`unknown_tool`);return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.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:(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`details`,{open:!!n,className:`group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background`,children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:`Tool call ${r}`}),(0,I.jsx)(`span`,{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${n?`bg-amber-100 text-amber-900`:`bg-muted text-muted-foreground`}`,children:n?`Needs approval`:`Completed`})]})}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,I.jsx)(`div`,{className:`min-w-0 space-y-2 border-t border-border/50 px-3 py-2`,children:(0,I.jsx)(o2,{text:e.text,className:`text-sm`})})]})]},`${e.id??`${e.role}-${t}`}:tool`)}return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 ${r?`justify-end`:`justify-start`}`,children:[!r&&(0,I.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:a?(0,I.jsx)(Jn,{className:`h-3 w-3`}):(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsx)(`div`,{className:`min-w-0 max-w-[92%] wrap-break-word rounded-md border p-3 text-sm ${r?`border-primary/20 bg-primary/10`:a?`border-amber-400/30 bg-amber-50/70`:o?`border-blue-300/30 bg-blue-50/50`:`border-border/80 bg-background shadow-xs`}`,children:r?(0,I.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.text}):(0,I.jsx)(o2,{text:e.text,className:`text-sm`})}),r&&(0,I.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:(0,I.jsx)(cr,{className:`h-3 w-3`})})]},e.id??`${e.role}-${t}`)}})]})]})};function une(e){let t=e.scenarios.reduce((e,t)=>e+t.runs.filter(e=>e.passed).length,0),n=e.outcomes?.stopped??e.scenarios.reduce((e,t)=>e+t.runs.filter(e=>e.outcome===`stopped`).length,0),r=Math.max(0,e.totalRuns-t-n),i=K_(t,e.totalRuns,n),a={};e.scenarios.forEach(e=>e.runs.forEach(e=>e.toolCalls.forEach(e=>{a[e.name]=(a[e.name]||0)+1})));let o=Object.keys(a),s=Object.values(a),c=e.scenarios.map(e=>{let t=K_(e.runs.filter(e=>e.passed).length,e.runs.length,e.runs.filter(e=>e.outcome===`stopped`).length);return`
|
|
141
|
-
<div class="scenario-card">
|
|
142
|
-
<div class="scenario-header" onclick="this.parentElement.classList.toggle('open')">
|
|
143
|
-
<span class="chevron">▶</span>
|
|
144
|
-
<span class="scenario-name">${R9(e.scenarioName)}</span>
|
|
145
|
-
<span class="scenario-agent">${R9(e.agentName)}</span>
|
|
146
|
-
<span class="mono">${e.runs.length} runs</span>
|
|
147
|
-
<span class="badge ${t===null?`badge-neutral`:t>=.8?`badge-pass`:t>=.5?`badge-warn`:`badge-fail`}">${Bi(t)}</span>
|
|
148
|
-
<span class="mono">${e.avgToolCalls.toFixed(1)} avg tools</span>
|
|
149
|
-
</div>
|
|
150
|
-
<div class="scenario-detail">
|
|
151
|
-
${e.runs.map(e=>`
|
|
152
|
-
<div class="run-row">
|
|
153
|
-
<span class="run-status ${e.outcome===`stopped`?`stopped`:e.passed?`pass`:`fail`}" title="${e.outcome===`stopped`?`Stopped`:e.passed?`Passed`:`Failed`}">${e.outcome===`stopped`?`◷`:e.passed?`✓`:`✗`}</span>
|
|
154
|
-
<span class="mono run-label">Run #${e.runIndex+1}</span>
|
|
155
|
-
<span class="mono run-duration">${e.duration}ms</span>
|
|
156
|
-
<div class="tool-pills">
|
|
157
|
-
${e.toolCalls.map(e=>`<span class="pill">${R9(e.name)} <small>${e.duration}ms</small></span>`).join(``)}
|
|
158
|
-
</div>
|
|
159
|
-
${e.failureReasons.length?`<div class="failure-reasons">${e.failureReasons.map(e=>R9(e)).join(`, `)}</div>`:``}
|
|
160
|
-
</div>`).join(``)}
|
|
161
|
-
</div>
|
|
162
|
-
</div>`}).join(``);return`<!DOCTYPE html>
|
|
163
|
-
<html lang="en">
|
|
164
|
-
<head>
|
|
165
|
-
<meta charset="UTF-8">
|
|
166
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
167
|
-
<title>MCPLab Report — ${R9(e.id)}</title>
|
|
168
|
-
<script src="https://cdn.jsdelivr.net/npm/chart.js@4"><\/script>
|
|
169
|
-
<style>
|
|
170
|
-
*{box-sizing:border-box;margin:0;padding:0}
|
|
171
|
-
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f9fafb;color:#1f2937;padding:2rem;max-width:1100px;margin:0 auto}
|
|
172
|
-
h1{font-size:1.5rem;font-weight:700}
|
|
173
|
-
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.8rem}
|
|
174
|
-
.header{display:flex;align-items:center;gap:1rem;margin-bottom:.25rem}
|
|
175
|
-
.sub{font-size:.75rem;color:#6b7280;margin-bottom:1.5rem}
|
|
176
|
-
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin-bottom:2rem}
|
|
177
|
-
.stat{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
178
|
-
.stat-label{font-size:.7rem;color:#6b7280;text-transform:uppercase;letter-spacing:.05em}
|
|
179
|
-
.stat-value{font-size:1.5rem;font-weight:700;margin-top:.25rem}
|
|
180
|
-
.charts{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-bottom:2rem}
|
|
181
|
-
.chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
182
|
-
.chart-card h3{font-size:.85rem;font-weight:600;margin-bottom:.75rem}
|
|
183
|
-
canvas{max-height:220px}
|
|
184
|
-
.scenario-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;margin-bottom:.75rem;overflow:hidden}
|
|
185
|
-
.scenario-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;cursor:pointer;font-size:.85rem}
|
|
186
|
-
.scenario-header:hover{background:#f9fafb}
|
|
187
|
-
.chevron{font-size:.6rem;transition:transform .15s;color:#9ca3af}
|
|
188
|
-
.scenario-card.open .chevron{transform:rotate(90deg)}
|
|
189
|
-
.scenario-name{font-weight:600;flex:1}
|
|
190
|
-
.scenario-agent{color:#6b7280;font-size:.8rem}
|
|
191
|
-
.scenario-detail{display:none;border-top:1px solid #e5e7eb;padding:.75rem 1rem;background:#fafafa}
|
|
192
|
-
.scenario-card.open .scenario-detail{display:block}
|
|
193
|
-
.run-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:.8rem}
|
|
194
|
-
.run-row:last-child{border-bottom:none}
|
|
195
|
-
.run-status{font-weight:700;font-size:1rem}
|
|
196
|
-
.run-status.pass{color:#059669}
|
|
197
|
-
.run-status.fail{color:#dc2626}
|
|
198
|
-
.run-status.stopped{color:#6b7280}
|
|
199
|
-
.run-duration{color:#6b7280}
|
|
200
|
-
.tool-pills{display:flex;flex-wrap:wrap;gap:.25rem}
|
|
201
|
-
.pill{background:#fef3c7;color:#92400e;padding:2px 8px;border-radius:9999px;font-size:.7rem;font-family:'JetBrains Mono',monospace}
|
|
202
|
-
.pill small{color:#b45309;margin-left:2px}
|
|
203
|
-
.failure-reasons{width:100%;color:#dc2626;font-size:.75rem;margin-top:.25rem}
|
|
204
|
-
.badge{padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:600}
|
|
205
|
-
.badge-pass{background:#d1fae5;color:#065f46}
|
|
206
|
-
.badge-warn{background:#fef3c7;color:#92400e}
|
|
207
|
-
.badge-fail{background:#fee2e2;color:#991b1b}
|
|
208
|
-
.badge-neutral{background:#f3f4f6;color:#6b7280}
|
|
209
|
-
.footer{text-align:center;color:#9ca3af;font-size:.7rem;margin-top:2rem;padding-top:1rem;border-top:1px solid #e5e7eb}
|
|
210
|
-
</style>
|
|
211
|
-
</head>
|
|
212
|
-
<body>
|
|
213
|
-
<div class="header">
|
|
214
|
-
<h1 class="mono">${R9(e.id)}</h1>
|
|
215
|
-
<span class="badge ${i===null?`badge-neutral`:i>=.8?`badge-pass`:i>=.5?`badge-warn`:`badge-fail`}">${Bi(i)}${i===null?``:` pass`}</span>
|
|
216
|
-
</div>
|
|
217
|
-
<p class="sub">${new Date(e.timestamp).toLocaleString()} · Config hash: <span class="mono">${R9(e.configHash)}</span></p>
|
|
218
|
-
|
|
219
|
-
<div class="stats">
|
|
220
|
-
<div class="stat"><div class="stat-label">Scenarios</div><div class="stat-value">${e.totalScenarios}</div></div>
|
|
221
|
-
<div class="stat"><div class="stat-label">Total Runs</div><div class="stat-value">${e.totalRuns}</div></div>
|
|
222
|
-
<div class="stat"><div class="stat-label">Pass Rate</div><div class="stat-value">${Bi(i)}</div></div>
|
|
223
|
-
<div class="stat"><div class="stat-label">Avg Tool Calls</div><div class="stat-value">${e.avgToolCalls.toFixed(1)}</div></div>
|
|
224
|
-
<div class="stat"><div class="stat-label">Avg Latency</div><div class="stat-value">${e.avgLatency}ms</div></div>
|
|
225
|
-
</div>
|
|
226
|
-
|
|
227
|
-
<div class="charts">
|
|
228
|
-
<div class="chart-card"><h3>Run outcomes</h3><canvas id="pieChart"></canvas></div>
|
|
229
|
-
<div class="chart-card"><h3>Tool Usage</h3><canvas id="barChart"></canvas></div>
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
<h2 style="font-size:1rem;font-weight:600;margin-bottom:.75rem">Scenarios</h2>
|
|
233
|
-
${c}
|
|
234
|
-
|
|
235
|
-
<div class="footer">Generated by MCPLab · ${new Date().toISOString()}</div>
|
|
236
|
-
|
|
237
|
-
<script>
|
|
238
|
-
new Chart(document.getElementById('pieChart'),{type:'doughnut',data:{labels:['Pass','Fail','Stopped'],datasets:[{data:[${t},${r},${n}],backgroundColor:['#059669','#dc2626','#6b7280'],borderWidth:0}]},options:{cutout:'60%',plugins:{legend:{position:'bottom',labels:{font:{size:11}}}}}});
|
|
239
|
-
new Chart(document.getElementById('barChart'),{type:'bar',data:{labels:${JSON.stringify(o)},datasets:[{data:${JSON.stringify(s)},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}}}}}});
|
|
240
|
-
<\/script>
|
|
241
|
-
</body>
|
|
242
|
-
</html>`}function R9(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var dne=`mcplab.resultAssistantScenarioHandoff`,fne=[{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 z9(e){return`mcplab/reports/result-assistant/${e}-${new Date().toISOString().replace(/[:]/g,`-`).replace(/\..+/,``)}.md`}function B9(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}var pne=()=>{let{id:e}=qd(),t=Ud(),[n]=pp(),{source:r}=Rv(),i=n.get(`embed`)===`1`,{configs:a}=Jv(),{scenarios:o}=Zv(),[s,c]=(0,_.useState)(void 0),[l,u]=(0,_.useState)(!0),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(``),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(new Set),[b,x]=(0,_.useState)(new Set),[S,C]=(0,_.useState)(``),[w,T]=(0,_.useState)(!1),[E,D]=(0,_.useState)(!1),[k,A]=(0,_.useState)(`assistant`),[j,M]=(0,_.useState)(null),[N,P]=(0,_.useState)(!1),[F,L]=(0,_.useState)(``),[R,z]=(0,_.useState)(``),[B,ee]=(0,_.useState)(!1),[te,ne]=(0,_.useState)(!1),[re,ie]=(0,_.useState)(!1),[ae,oe]=(0,_.useState)([]),[se,V]=(0,_.useState)(!1),[ce,le]=(0,_.useState)(``),[ue,H]=(0,_.useState)(null),[de,fe]=(0,_.useState)(!1),[pe,me]=(0,_.useState)(null),[he,ge]=(0,_.useState)(!1),[_e,ve]=(0,_.useState)(!1),[ye,be]=(0,_.useState)(!1),xe=(0,_.useRef)(null),[Se,Ce]=(0,_.useState)(!1),{assistantMessages:we,assistantPendingToolCalls:Te,assistantInput:Ee,assistantLoading:De,assistantTurnCancelable:Oe,cancelAssistantTurn:ke,assistantChatEndRef:Ae,assistantInputRef:je,setAssistantInput:Me,askAssistant:Ne,approveResultAssistantToolCall:Pe,denyResultAssistantToolCall:Fe,applyResultAssistantSnippet:Ie,ensureIntroMessage:Le,resetAssistantSession:Re}=w9({source:r,open:w,scope:`run`,runId:e,onSessionSync:void 0}),ze=(0,_.useCallback)(async(e,t)=>{V(!0);try{let n=(await r.listMarkdownReports()).filter(t=>{let n=String(t.relativePath??``),r=String(t.name??``);return n.includes(e)||r.includes(e)});if(oe(n),t&&n.length>0){let e=n.find(e=>e.relativePath===t||e.path===t||e.relativePath.endsWith(t)||e.path.endsWith(t));e&&le(e.relativePath)}return n}catch{return oe([]),[]}finally{V(!1)}},[r]);(0,_.useEffect)(()=>{if(!e)return;let t=!0;return Re(),u(!0),r.getResult(e).then(e=>{t&&(c(e),m(e?.runNote??``),f(!1),u(!1))}),()=>{t=!1}},[e,r,Re]),(0,_.useEffect)(()=>{let e=xe.current;if(!e)return;let t=()=>{Ce(e.clientWidth<800)};if(t(),typeof ResizeObserver<`u`){let n=new ResizeObserver(()=>t());return n.observe(e),()=>n.disconnect()}return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[l]),(0,_.useEffect)(()=>{if(!s?.id)oe([]);else return(async()=>{await ze(s.id)})(),()=>{}},[s?.id,ze]),(0,_.useEffect)(()=>{ae.length===0?(le(``),H(null),me(null)):(!ce||!ae.some(e=>e.relativePath===ce))&&le(ae[0].relativePath)},[ae,ce]),(0,_.useEffect)(()=>{if(!w||k!==`reports`)return;if(!ce){H(null),me(null);return}let e=!0;return fe(!0),me(null),r.getMarkdownReport(ce).then(t=>{e&&H(t)}).catch(t=>{e&&(H(null),me(t instanceof Error?t.message:String(t)))}).finally(()=>{e&&fe(!1)}),()=>{e=!1}},[w,k,ce,r]);let Be=n.get(`configId`)??``,Ve=(n.get(`agent`)??``).trim(),He=(0,_.useMemo)(()=>{let e=Be?a.find(e=>e.id===Be):void 0;if(e)return e;if(!s)return;let t=s.configPath?.trim(),n=s.configName?.trim(),r=a.find(e=>e.id===s.configId);if(r)return r;let i=e=>[e.relativePath,e.sourcePath,e.suitePath];return(t?a.find(e=>i(e).some(e=>e?.trim()===t)):void 0)||(t?a.find(e=>i(e).some(e=>e?.endsWith(`/${t}`)===!0)):void 0)||a.find(e=>n?e.name===n||e.configName===n:!1)},[a,Be,s]),Ue=(0,_.useMemo)(()=>s?.configName?.trim()||s?.configPath?.trim()||He?.relativePath?.trim()||He?.name?.trim()||s?.configId?.trim()||``,[s,He]),We=(0,_.useMemo)(()=>s?.configName?.trim()||He?.name?.trim()||``,[s,He]),Ge=(0,_.useMemo)(()=>s?.configPath?.trim()||He?.relativePath?.trim()||``,[s,He]),Ke=(0,_.useMemo)(()=>{let e=new Map;if(He){for(let t of He.scenarios)e.set(t.id,t),t.name&&!e.has(t.name)&&e.set(t.name,t);for(let t of He.scenarioEntries??[]){if(t.kind!==`referenced`)continue;let n=o.find(e=>e.id===t.ref);n&&(e.set(n.id,n),n.name&&e.set(n.name,n),e.has(t.ref)||e.set(t.ref,n))}}for(let t of o)e.has(t.id)||e.set(t.id,t),t.name&&!e.has(t.name)&&e.set(t.name,t);return e},[He,o]),qe=(0,_.useMemo)(()=>``,[]);(0,_.useEffect)(()=>{Be&&a.some(e=>e.id===Be)?C(Be):qe&&C(e=>e||qe)},[Be,a,qe]);let{filteredScenarios:Je,filteredTotalRuns:Ye,filteredPassCount:Xe,displayPassRate:Ze,displayAvgToolCalls:Qe,displayAvgLatency:$e,displayDurationMs:et,displayToolTimeMs:tt,displayToolTokenUsage:nt,filteredStoppedRuns:rt}=(0,_.useMemo)(()=>{if(!s)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayDurationMs:null,displayToolTimeMs:null,displayToolTokenUsage:null,filteredStoppedRuns:0};let e=Ve?s.scenarios.filter(e=>e.agentId===Ve||e.agentName===Ve):s.scenarios,t=e.reduce((e,t)=>e+t.runs.length,0),n=e.reduce((e,t)=>e+t.runs.filter(e=>e.passed).length,0),r=e.reduce((e,t)=>e+t.runs.filter(e=>e.outcome===`stopped`).length,0),i=!Ve&&s.outcomes?s.totalRuns:t,a=!Ve&&s.outcomes?.passed!==void 0?s.outcomes.passed:n,o=!Ve&&s.outcomes?.stopped!==void 0?s.outcomes.stopped:r,c=e.reduce((e,t)=>e+t.runs.reduce((e,t)=>e+t.toolCalls.length,0),0),l=d9({...s,scenarios:e}),u=p9({...s,scenarios:e});return{filteredScenarios:e,filteredTotalRuns:i,filteredPassCount:a,displayPassRate:K_(a,i,o),displayAvgToolCalls:i===0?0:c/i,displayAvgLatency:i===0||l===null?0:Math.round(l/i),displayDurationMs:l,displayToolTimeMs:u,displayToolTokenUsage:m_(e.map(e=>e.toolTokenUsage)),filteredStoppedRuns:o}},[s,Ve]),it=(0,_.useMemo)(()=>{let e={};return Je.forEach(t=>t.runs.forEach(t=>t.toolCalls.forEach(t=>{e[t.name]=(e[t.name]||0)+1}))),Object.entries(e).map(([e,t])=>({name:e,count:t})).sort((e,t)=>t.count-e.count)},[Je]);if(l)return(0,I.jsx)(`div`,{className:`p-8 text-center text-muted-foreground`,children:`Loading result...`});if(!s)return(0,I.jsx)(`div`,{className:`p-8 text-center text-muted-foreground`,children:`Result not found`});let at=y_(Je.flatMap(e=>e.runs.flatMap(e=>e.checkResults??[]))),ot=Je.flatMap(e=>e.runs),st=!Ve&&s.outcomes?.incomplete!==void 0?s.outcomes.incomplete:ot.filter(e=>e.outcome===`incomplete`).length,ct=!Ve&&s.outcomes?.error!==void 0?s.outcomes.error:ot.filter(e=>e.outcome===`error`).length,lt=rt,ut=e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},dt=(e,t,n,r)=>`${e}:${t}:${n}:${r}`,ft=(e,t)=>`${e}::${t}`,pt=e=>{x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},mt=(e,t=!e.endsWith(`:conversation`))=>b.has(e)?!t:t,ht=(e,t)=>{A(`assistant`),T(!0),M(t?.scenarioId??null),Le(`Ask me to explain failures, tool usage, or suggest what to inspect next in this result.`),e&&Me(e)},gt=Te.filter(e=>e.status===`pending`&&!we.some(t=>t.pendingToolCallId===e.id)),_t=e=>{e&&le(e),A(`reports`),T(!0)},vt=()=>{A(`note`),T(!0)},yt=e=>{if(!s)return;if(!j){O({title:`No scenario context`,description:`Ask about a specific scenario or run first, then send the suggestion.`,variant:`destructive`});return}let n=o.find(e=>e.id===j)??o.find(e=>e.name===j);if(!n){O({title:`Scenario not found in library`,description:`Could not find library scenario '${j}' to open in Scenario Assistant.`,variant:`destructive`});return}let r=[`I am sending a suggestion from the Result Assistant for scenario '${j}' based on run '${s.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:`,e].join(`
|
|
243
|
-
`);try{window.sessionStorage.setItem(dne,JSON.stringify({type:`result-assistant-handoff-v1`,runId:s.id,configId:Be||s.configId||``,scenarioId:n.id,prompt:r,sourceReply:e})),t(`/libraries/test-cases/${encodeURIComponent(n.id)}?assistantHandoff=1`)}catch(e){O({title:`Could not create handoff`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},bt=e=>{s&&(ie(!1),L(e),z(z9(s.id)),ee(!1),P(!0))},xt=()=>{s&&(ie(!0),L(``),z(z9(s.id)),ee(!1),P(!0))},St=async()=>{if(s){if(!F.trim())O({title:`No markdown to write`,description:`The selected assistant response is empty.`,variant:`destructive`});else{ne(!0);try{let e=await r.applyResultAssistantReport({runId:s.id,markdown:F,outputPath:R.trim()||void 0,overwrite:B});O({title:`Markdown report written`,description:typeof e.path==`string`&&e.path?e.path:e.outputPath}),await ze(s.id,typeof e.path==`string`&&e.path||e.outputPath||void 0),w&&A(`reports`),P(!1)}catch(e){O({title:`Could not write markdown report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ne(!1)}}}},Ct=async e=>{try{await navigator.clipboard.writeText(e),O({title:`Copied`})}catch(e){O({title:`Could not copy`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}},wt=async()=>{if(s){g(!0);try{let e=p.trim();await r.updateRunNote(s.id,e||void 0),c(t=>t&&{...t,runNote:e||void 0}),m(e),f(!1),O({title:`Run note saved`})}catch(e){O({title:`Could not save run note`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{g(!1)}}},Tt=async()=>{if(s?.id){ve(!0);try{await r.deleteResult(s.id),O({title:`Run deleted`,description:s.id}),t(`/results`)}catch(e){O({title:`Could not delete run`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{ve(!1),ge(!1)}}},Et=async()=>{if(!s?.id)return;let e=Ge.trim();if(!e)O({title:`Cannot rerun`,description:`This run has no config path in metadata.`,variant:`destructive`});else{be(!0);try{await E9(r,{...s,configPath:e}),O({title:`Rerun queued`,description:`${s.id} queued with previous run settings.`})}catch(e){O({title:`Could not rerun`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{be(!1)}}};return(0,I.jsxs)(`div`,{className:`${w?`xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden`:``}`,children:[(0,I.jsx)(`div`,{className:`${w?`xl:shrink-0 xl:pb-6`:`mb-6`}`,children:(0,I.jsxs)(`div`,{ref:xe,className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[!i&&(0,I.jsx)(W,{variant:`ghost`,size:`icon`,asChild:!0,children:(0,I.jsx)(sp,{to:`/results`,children:(0,I.jsx)(Qt,{className:`h-4 w-4`})})}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold font-mono`,children:s.id}),(0,I.jsx)(dy,{rate:Ze})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 align-middle`,children:[(0,I.jsx)(pn,{className:`h-3 w-3 shrink-0`}),new Date(s.timestamp).toLocaleString()]}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),Ve?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Agent: `,Ve]}),(0,I.jsx)(`span`,{className:`mx-1`,children:`·`})]}):null,We?(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Eval: `,(0,I.jsx)(`span`,{className:`ml-1 font-medium`,children:We})]}):null,We&&Ge?(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}):null,Ge?(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Path: `,(0,I.jsx)(`span`,{className:`ml-1 font-mono`,children:Ge})]}):null,!We&&!Ge&&Ue?(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Config: `,(0,I.jsx)(`span`,{className:`ml-1 font-mono`,children:Ue})]}):null,s.executionSource?(0,I.jsxs)(I.Fragment,{children:[(We||Ge||Ue)&&(0,I.jsx)(`span`,{className:`mx-1`,children:`·`}),(0,I.jsxs)(`span`,{className:`inline-flex items-center align-middle`,children:[`Source: `,(0,I.jsx)(`span`,{className:`ml-1 font-medium`,children:s.executionSource}),s.executionClient?(0,I.jsxs)(`span`,{className:`ml-1`,children:[`(`,s.executionClient,`)`]}):null]})]}):null]})]})]}),(0,I.jsxs)(`div`,{className:`flex w-full min-w-0 items-center justify-between gap-2 sm:ml-auto sm:w-auto`,children:[(0,I.jsx)(Y7,{versions:s.mcpServerVersions}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-2`,children:[Object.entries(s.langsmithTraceUrls??{}).map(([e,t])=>(0,I.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-input bg-background px-3 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground`,"aria-label":`LangSmith trace`,title:`Open LangSmith trace`,children:[(0,I.jsx)(yn,{className:`h-3.5 w-3.5`}),!i&&`LangSmith trace`]},e)),(0,I.jsxs)(W,{variant:`outline`,size:`sm`,className:`max-w-full gap-1.5 ${i?`px-2`:``}`,onClick:()=>{let e=une(s),t=new Blob([e],{type:`text/html`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`mcplab-report-${s.id}.html`,r.click(),URL.revokeObjectURL(n)},"aria-label":`Download Report`,title:`Download Report`,children:[(0,I.jsx)(gn,{className:`h-3.5 w-3.5`}),!i&&`Download Report`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,onClick:()=>_t(),disabled:se,children:[(0,I.jsx)(Bn,{className:`h-3.5 w-3.5`}),se?`Reports...`:`Reports${ae.length?` (${ae.length})`:``}`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,"aria-label":`Run Note`,onClick:()=>vt(),children:[(0,I.jsx)(Bn,{className:`h-3.5 w-3.5`}),Se?`Note`:`Run Note`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,"aria-label":`MCP Lab Assistant`,onClick:()=>ht(),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),Se?`Assistant`:`MCP Lab Assistant`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5`,onClick:()=>void Et(),disabled:ye||!Ge.trim(),children:[(0,I.jsx)(Kn,{className:`h-3.5 w-3.5`}),ye?`Queueing...`:`Rerun`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`max-w-full gap-1.5 text-destructive`,onClick:()=>ge(!0),disabled:_e,"aria-label":_e?`Deleting run`:`Delete run`,children:[_e?(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}):(0,I.jsx)(dn,{className:`h-4 w-4`}),Se?null:_e?`Deleting...`:`Delete`]})]})]})]})}),(0,I.jsxs)(`div`,{className:`grid gap-6 items-start ${w?E?`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:[(0,I.jsxs)(`div`,{className:`min-w-0 space-y-6 ${w?`xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2`:``}`,children:[(0,I.jsxs)(`div`,{className:`grid gap-4 ${w?`grid-cols-3`:`sm:grid-cols-2 lg:grid-cols-8`}`,children:[(0,I.jsx)(ly,{title:`Scenarios`,value:Je.length,icon:jn}),(0,I.jsx)(ly,{title:`Total Runs`,value:Ye,icon:Xt}),(0,I.jsx)(ly,{title:`Pass Rate`,value:Bi(Ze),icon:tn}),(0,I.jsx)(ly,{title:`Avg Tool Calls`,value:B9(Qe),icon:ln}),(0,I.jsx)(ly,{title:`Avg Latency`,value:`${$e}ms`,icon:ir}),et===null?null:(0,I.jsx)(ly,{title:`Total Time`,value:l9(et),icon:mn}),tt===null?null:(0,I.jsx)(ly,{title:`Tool Duration`,value:l9(tt),icon:mn}),(0,I.jsx)(ly,{title:`Tool Tokens`,value:j4(nt?.totalTokens),icon:ur})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-4`,children:[(0,I.jsx)(S9,{title:`Runs Pass / Fail`,passed:Xe,failed:Math.max(0,Ye-Xe-st-ct-lt),incomplete:st,error:ct,stopped:lt}),(0,I.jsx)(S9,{title:`Checks Pass / Fail`,passed:at.passed,failed:at.failed,notEvaluated:at.not_evaluated,notExecuted:at.not_executed}),(0,I.jsxs)(K,{className:`lg:col-span-2`,children:[(0,I.jsx)(Qv,{className:`p-2.5 pb-0`,children:(0,I.jsx)($v,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:`Tool Usage`})}),(0,I.jsx)(q,{children:(0,I.jsx)(qE,{width:`100%`,height:120,children:(0,I.jsxs)(OY,{data:it,layout:`vertical`,children:[(0,I.jsx)(zq,{type:`number`,tick:{fontSize:11}}),(0,I.jsx)(nJ,{type:`category`,dataKey:`name`,tick:{fontSize:11},width:120}),(0,I.jsx)(OE,{}),(0,I.jsx)(hW,{dataKey:`count`,fill:`hsl(38, 92%, 50%)`,radius:[0,4,4,0]})]})})})]})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)($v,{className:`text-base`,children:`Scenarios`}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-8 gap-1.5 px-2 text-xs`,onClick:()=>ht(`Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values.`),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`Ask Assistant`]})]})}),(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(ny,{children:[(0,I.jsx)(ry,{children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{className:`w-8`}),(0,I.jsx)(sy,{children:`Scenario`}),(0,I.jsx)(sy,{children:`Agent`}),(0,I.jsx)(sy,{children:`Runs`}),(0,I.jsx)(sy,{children:`Pass Rate`}),(0,I.jsx)(sy,{children:`Checks`}),(0,I.jsx)(sy,{className:`text-right`,children:`Total Time`}),(0,I.jsx)(sy,{className:`text-right`,children:`Tool Calls`}),(0,I.jsx)(sy,{className:`text-right`,children:`Tool Tokens`}),(0,I.jsx)(sy,{className:`text-right`,children:`Tool Duration`})]})}),(0,I.jsx)(iy,{children:Je.map(t=>{let n=ft(t.scenarioId,t.agentName),r=t.scenarioName||t.scenarioId,i=y_(t.runs.flatMap(e=>e.checkResults??[])),a=t.runs.some(e=>(e.checkResults?.length??0)>0),c=He?.id||s?.configId?.trim(),l=c?`/mcp-evaluations/${encodeURIComponent(c)}/scenarios`:null,u=o.find(e=>e.id===t.scenarioId),d=u?`/libraries/test-cases/${encodeURIComponent(u.id)}?returnTo=${encodeURIComponent(`/results/${s?.id??e}`)}`:null;return(0,I.jsx)(n2,{open:v.has(n),onOpenChange:()=>ut(n),asChild:!0,children:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsxs)(oy,{className:`cursor-pointer hover:bg-muted/50`,children:[(0,I.jsx)(J,{children:(0,I.jsx)(rn,{className:`h-4 w-4 transition-transform ${v.has(n)?`rotate-180`:``}`})}),(0,I.jsx)(J,{className:`font-medium text-sm`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`span`,{children:t.scenarioName}),l?(0,I.jsx)(sp,{to:l,"aria-label":`Edit scenario`,title:`Edit scenario`,className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground`,onClick:e=>e.stopPropagation(),children:(0,I.jsx)(Gn,{className:`h-3.5 w-3.5`})}):null]})}),(0,I.jsxs)(J,{className:`text-sm`,children:[(0,I.jsx)(`div`,{children:t.agentName}),t.provider||t.model?(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:[t.provider?E0(t.provider):null,t.model].filter(Boolean).join(` · `)}):null]}),(0,I.jsx)(J,{className:`font-mono text-sm`,children:t.runs.length}),(0,I.jsx)(J,{children:(0,I.jsx)(dy,{rate:t.passRate})}),(0,I.jsx)(J,{className:`font-mono text-sm`,children:a?(0,I.jsxs)(`span`,{title:`${i.passed} passed · ${i.failed} failed${i.not_evaluated?` · ${i.not_evaluated} not evaluated`:``}${i.not_executed?` · ${i.not_executed} not executed`:``}`,"aria-label":`${i.passed} checks passed, ${i.failed} checks failed${i.not_evaluated?`, ${i.not_evaluated} not evaluated`:``}${i.not_executed?`, ${i.not_executed} not executed`:``}`,children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[i.passed,` ✓`]}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{className:`text-destructive`,children:[i.failed,` ✕`]}),i.not_evaluated>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[i.not_evaluated,` ○`]})]}),i.not_executed>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[i.not_executed,` ⊘`]})]})]}):`—`}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:l9(u9(t),{preciseUnderTenSeconds:!0})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:B9(t.avgToolCalls)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:j4(t.toolTokenUsage?.totalTokens)}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:l9(f9(t),{preciseUnderTenSeconds:!0})})]})}),(0,I.jsx)(i2,{asChild:!0,children:(0,I.jsx)(`tr`,{children:(0,I.jsx)(`td`,{colSpan:10,className:`p-0`,children:(0,I.jsxs)(`div`,{className:`bg-muted/30 p-4 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`p`,{className:`text-xs font-semibold`,children:`Scenario details`}),(0,I.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[r,` · `,t.agentName,` ·`,` `,Bi(t.passRate),` pass rate ·`,` `,a?`Checks ${i.passed} ✓ · ${i.failed} ✕${i.not_evaluated?` · ${i.not_evaluated} ○`:``}${i.not_executed?` · ${i.not_executed} ⊘`:``} · `:``,j4(t.toolTokenUsage?.totalTokens),` tool tokens ·`,` `,l9(u9(t),{preciseUnderTenSeconds:!0}),` `,`total time ·`,` `,l9(f9(t),{preciseUnderTenSeconds:!0}),` `,`tool time`]})]}),(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[d?(0,I.jsx)(W,{asChild:!0,type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1 px-2 text-xs text-muted-foreground`,children:(0,I.jsxs)(sp,{to:d,"aria-label":`Edit test case`,children:[(0,I.jsx)(Sn,{className:`h-3.5 w-3.5`}),`Edit test case`]})}):null,(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>ht(`Explain why scenario '${r}' failed (agent: ${t.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:t.scenarioId}),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`Ask Assistant`]})]})]}),t.runs.map(e=>(0,I.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border bg-card p-3 text-sm`,children:[(0,I.jsx)(`div`,{className:`mt-0.5`,children:e.outcome===`incomplete`||e.outcome===`stopped`?(0,I.jsx)(pn,{className:`h-4 w-4 text-amber-500`}):e.passed?(0,I.jsx)(ln,{className:`h-4 w-4 text-success`}):(0,I.jsx)(dn,{className:`h-4 w-4 text-destructive`})}),(0,I.jsxs)(`div`,{className:`flex-1 space-y-1`,children:[(()=>{let n=Ke.get(t.scenarioId),r=n?gne(n.evalRules,e.failureReasons,e.error,e.checkResults):[],i=r.filter(e=>e.status===`failed`),a=r.filter(e=>e.status===`passed`),o=r.filter(e=>e.status===`not_evaluated`),s=r.filter(e=>e.status===`not_executed`);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsxs)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:[`Run #`,e.runIndex+1]}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`·`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.duration,`ms`]}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`·`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[j4(e.toolTokenUsage?.totalTokens),` `,`tool tokens`]}),e.outcome===`incomplete`?(0,I.jsx)(Y,{variant:`outline`,className:`h-5 border-amber-500/30 bg-amber-500/10 text-amber-600 text-[10px]`,children:`Incomplete`}):e.outcome===`stopped`?(0,I.jsx)(Y,{variant:`outline`,className:`h-5 border-muted-foreground/30 bg-muted text-muted-foreground text-[10px]`,children:`Stopped`}):e.passed?null:(0,I.jsx)(Y,{variant:`outline`,className:`h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]`,children:`Failed`})]}),e.failureReasons.length>0&&(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-2`,children:[(0,I.jsxs)(`p`,{className:`mb-1 flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-destructive`,children:[(0,I.jsx)(dn,{className:`h-3.5 w-3.5`}),`Failure reasons`]}),(0,I.jsx)(`ul`,{className:`space-y-1 text-xs text-destructive`,children:e.failureReasons.map((e,t)=>(0,I.jsxs)(`li`,{children:[`• `,G9(e)]},t))})]}),e.outcome===`stopped`&&e.stopReason?(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-muted/40 p-2`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Stop reason`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.stopReason})]}):null,r.length>0&&(0,I.jsx)(n2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`checks`)),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`checks`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-2`,children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full flex-wrap items-center gap-2 text-left`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`checks`))?`rotate-180`:``}`}),(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Checks`}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-success/30 bg-success/10 text-success text-[10px]`,children:[a.length,` passed`]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px] ${i.length>0?`border-destructive/30 bg-destructive/10 text-destructive`:``}`,children:[i.length,` failed`]}),o.length>0&&(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-muted-foreground/30 bg-muted text-[10px] text-muted-foreground`,children:[o.length,` not evaluated`]}),s.length>0&&(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 border-amber-500/30 bg-amber-500/10 text-[10px] text-amber-600`,children:[s.length,` not executed`]})]})}),(0,I.jsxs)(i2,{children:[s.length>0&&(0,I.jsx)(`p`,{className:`mb-2 text-[11px] text-muted-foreground`,children:`Checks were not executed because this run ended before evaluation.`}),(0,I.jsx)(`div`,{className:`space-y-1`,children:r.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${e.status===`failed`?`border-destructive/20 bg-destructive/5`:e.status===`not_executed`?`border-amber-500/20 bg-amber-500/5`:e.status===`not_evaluated`?`border-muted-foreground/20 bg-muted/40`:`border-success/20 bg-success/5`}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.status===`failed`?(0,I.jsx)(dn,{className:`h-3.5 w-3.5 shrink-0 text-destructive`}):e.status===`not_executed`?(0,I.jsx)(pn,{className:`h-3.5 w-3.5 shrink-0 text-amber-600`}):e.status===`not_evaluated`?(0,I.jsx)(pn,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,I.jsx)(ln,{className:`h-3.5 w-3.5 shrink-0 text-success`}),(0,I.jsx)(`span`,{className:`font-medium`,children:g4(e.rule)})]}),e.decisionInput&&(0,I.jsxs)(`p`,{className:`mt-1 pl-5 text-[11px] text-muted-foreground whitespace-pre-wrap break-words`,children:[`Assertion prompt:`,` `,e.decisionInput]}),!e.decisionInput&&e.failureReason&&(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-[11px] text-muted-foreground`,children:G9(e.failureReason)}),e.decisionDetails&&(0,I.jsx)(`p`,{className:`mt-1 pl-5 text-[9px] text-muted-foreground`,children:e.decisionDetails})]}),(0,I.jsx)(Y,{variant:`outline`,className:`shrink-0 text-[10px] ${e.status===`failed`?`border-destructive/30 text-destructive`:e.status===`not_executed`?`border-amber-500/30 text-amber-600`:e.status===`not_evaluated`?`border-muted-foreground/30 text-muted-foreground`:`border-success/30 text-success`}`,children:m4(e.status)})]},`${e.rule.type}-${e.rule.value??e.rule.path??``}-${t}`))})]})]})})]})})(),(0,I.jsx)(n2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`extracts`),Object.keys(e.extractedValues??{}).length>0),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`extracts`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border border-violet-500/20 bg-violet-500/5 p-2`,children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`extracts`),Object.keys(e.extractedValues??{}).length>0)?`rotate-180`:``}`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(jn,{className:`h-3.5 w-3.5 text-violet-600`}),`Extracted values`]})]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:[Object.keys(e.extractedValues??{}).length,` `,`total`]})]})}),(0,I.jsx)(i2,{children:Object.keys(e.extractedValues??{}).length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No extracted values captured for this run.`}):(0,I.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:Object.entries(e.extractedValues??{}).map(([e,t])=>(0,I.jsxs)(`div`,{className:`rounded-md border bg-background px-2 py-1.5 text-xs`,children:[(0,I.jsx)(`div`,{className:`mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,I.jsx)(`div`,{className:`font-mono break-all text-foreground`,children:t===null?`null`:String(t)})]},e))})})]})}),(0,I.jsx)(n2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`tools`),e.toolCalls.length>0),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`tools`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border border-sky-500/20 bg-sky-500/5 p-2`,children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`tools`),e.toolCalls.length>0)?`rotate-180`:``}`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5 text-sky-600`}),`Tool call sequence`]})]}),(0,I.jsxs)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:[e.toolCalls.length,` total`]})]})}),(0,I.jsx)(i2,{children:e.toolCalls.length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No tool calls captured for this run.`}):(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:(0,I.jsx)(fl,{delayDuration:0,children:e.toolCalls.map((t,n)=>{let r=e.conversation.filter(e=>e.kind===`tool_call`)[n]?.estimatedTokens,i=typeof r?.totalTokens==`number`;return(0,I.jsxs)(pl,{children:[(0,I.jsx)(ml,{asChild:!0,children:(0,I.jsxs)(Y,{variant:`outline`,className:`font-mono text-xs bg-background`,children:[(0,I.jsxs)(`span`,{className:`mr-1 text-muted-foreground`,children:[`#`,n+1]}),t.name,(0,I.jsxs)(`span`,{className:`ml-1 text-muted-foreground`,children:[t.duration,`ms`]}),i&&(0,I.jsxs)(`span`,{className:`ml-1 text-muted-foreground`,children:[`·`,` `,j4(r?.totalTokens),`tok`]})]})}),i&&(0,I.jsx)(hl,{className:`text-xs`,children:`${t.name} · tokens total: ${j4(r?.totalTokens)} · in: ${j4(r?.inputTokens)} · out: ${j4(r?.outputTokens)}`})]},n)})})}),(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Tool token estimate`}),(0,I.jsx)(Y,{variant:`outline`,className:`h-5 text-[10px]`,children:`estimated`})]}),Object.keys(e.toolTokenUsageByTool??{}).length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`n/a`}):(0,I.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:Object.entries(e.toolTokenUsageByTool??{}).map(([e,t])=>(0,I.jsxs)(`div`,{className:`rounded border bg-muted/30 px-2 py-1.5 text-xs`,children:[(0,I.jsx)(`div`,{className:`font-mono text-[11px]`,children:e}),(0,I.jsxs)(`div`,{className:`text-muted-foreground`,children:[`total:`,` `,j4(t.totalTokens),` `,`· in:`,` `,j4(t.inputTokens),` `,`· out:`,` `,j4(t.outputTokens)]})]},e))})]})]})})]})}),(0,I.jsx)(n2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`final`)),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`final`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border border-muted-foreground/20 bg-card p-2`,children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`mb-2 flex w-full items-center gap-2 text-left`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`final`))?`rotate-180`:``}`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,I.jsx)($t,{className:`h-3.5 w-3.5`}),`Final answer`]})]})}),(0,I.jsx)(i2,{children:(0,I.jsx)(W9,{text:e.finalAnswer||`No final answer captured.`,maxLength:1200,className:`text-xs text-foreground`})})]})}),(0,I.jsx)(n2,{open:mt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`)),onOpenChange:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`)),children:(0,I.jsxs)(`div`,{className:`rounded-md border bg-muted/10 p-2`,children:[(0,I.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 text-left`,children:[(0,I.jsx)(rn,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${mt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`))?`rotate-180`:``}`}),(0,I.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Conversation trace`})]})}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>ht(`Explain Run #${e.runIndex+1} for scenario '${r}'. Its outcome was ${e.outcome??(e.passed?`passed`:`failed`)} in ${e.duration}ms. Focus on the tool sequence and evaluated checks.`,{scenarioId:t.scenarioId}),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`Ask Assistant`]})})]}),(0,I.jsx)(i2,{children:(0,I.jsx)(`div`,{className:`space-y-2 rounded-md border bg-muted/20 p-2`,children:e.conversation.length===0?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No conversation trace captured.`}):e.conversation.map(e=>(0,I.jsx)(mne,{item:e,fallbackUserPrompt:Ke.get(t.scenarioId)?.prompt},e.id))})}),!mt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`))&&(0,I.jsx)(`button`,{type:`button`,className:`text-xs text-muted-foreground underline decoration-dotted underline-offset-2 hover:text-foreground`,onClick:()=>pt(dt(t.scenarioId,t.agentName,e.runIndex,`conversation`)),children:`Expand to inspect user/assistant/tool messages for this run.`})]})})]})]},e.runIndex))]})})})})]})},n)})})]})})]})]}),w&&(0,I.jsxs)(`div`,{className:`min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,I.jsx)(x0,{value:k,onValueChange:e=>A(e),className:`min-w-0 -mb-px px-3 pt-1`,children:(0,I.jsxs)(S0,{className:`h-auto w-full justify-start rounded-none border-b bg-transparent p-0`,children:[(0,I.jsx)(C0,{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`}),(0,I.jsx)(C0,{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`}),(0,I.jsx)(C0,{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`})]})}),k===`assistant`?(0,I.jsx)(c9,{title:`MCP Lab Assistant`,description:`Ask questions about this run result, failures, and tool usage.`,expanded:E,onToggleExpanded:()=>D(e=>!e),onHide:()=>T(!1),messages:we,pendingToolCalls:Te,loading:De,onCancel:Oe?ke:void 0,input:Ee,onInputChange:Me,onSend:()=>void Ne(),inputPlaceholder:`Ask about this result...`,snippets:fne,onSnippetSelect:Ie,onApproveToolCall:e=>void Pe(e),onDenyToolCall:e=>void Fe(e),chatEndRef:Ae,inputRef:je,className:`min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col`,renderMessage:({message:e,index:t,linkedPendingToolCall:n,isUser:r,isAssistant:i,isSystem:a,isTool:o})=>{let s=i&&!!e.pendingToolCallId;if(o&&/^(Approved|Denied) tool call\\b/i.test(String(e.text??``).trim()))return null;let c=n?.tool??e.toolRequestName,l=n?.publicToolName??e.toolRequestPublicName,u=i&&!s&&hne(e.text,!!j);if(s){let r=n?.status===`pending`,i=T9(c??l??`unknown_tool`);return(0,I.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,I.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:(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`details`,{open:!!n,className:`group min-w-0 w-full max-w-[92%] overflow-hidden rounded-md border border-border/60 bg-background`,children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2`,children:[(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:`Tool call ${i}`}),(0,I.jsx)(`span`,{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${r?`bg-amber-100 text-amber-900`:`bg-muted text-muted-foreground`}`,children:r?`Needs approval`:`Completed`})]})}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,I.jsxs)(`div`,{className:`min-w-0 space-y-2 border-t border-border/50 px-3 py-2`,children:[(0,I.jsx)(o2,{text:e.text,className:`text-sm`}),r&&n&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`pre`,{className:`max-h-40 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/50 p-2 text-xs`,children:(0,I.jsx)(`code`,{className:`wrap-break-word`,children:JSON.stringify(n.arguments??{},null,2)})}),(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:De,onClick:()=>void Fe(n.id),children:`Deny`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:De,onClick:()=>void Pe(n.id),children:`Approve`})]})]})]})]})]},`${e.id??`${e.role}-${t}`}:${n?`pending`:`completed`}`)}let d=r||i&&!o&&!a;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 ${r?`justify-end`:`justify-start`}`,children:[!r&&(0,I.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:a?(0,I.jsx)(Jn,{className:`h-3 w-3`}):(0,I.jsx)($t,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`relative max-w-[92%]`,children:[(0,I.jsxs)(`div`,{className:`max-w-full rounded-md border p-3 text-sm ${r?`border-primary/20 bg-primary/10`:a?`border-amber-400/30 bg-amber-50/70`:o?`border-blue-300/30 bg-blue-50/50`:`border-border/80 bg-background shadow-xs`}`,children:[!(r||a)&&(0,I.jsx)(`p`,{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${r?`text-right`:``}`,children:o?`Tool`:`Assistant`}),r?(0,I.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.text}):(0,I.jsx)(o2,{text:e.text,className:`text-sm`}),u&&(0,I.jsxs)(`div`,{className:`mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>yt(e.text),children:[(0,I.jsx)(tr,{className:`h-4 w-4 text-amber-500`}),`Send to Scenario Assistant`]}),(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>bt(e.text),children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),`Apply: Write Markdown Report`]})]}),!u&&i&&!s&&(0,I.jsx)(`div`,{className:`mt-3 flex max-w-full justify-end overflow-x-auto pb-1`,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>bt(e.text),children:[(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),`Apply: Write Markdown Report`]})})]}),d&&(0,I.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground`,onClick:()=>void Ct(e.text),"aria-label":`Copy message`,title:`Copy message`,children:(0,I.jsx)(hn,{className:`h-3.5 w-3.5`})})]}),r&&(0,I.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:(0,I.jsx)(cr,{className:`h-3 w-3`})})]},e.id??`${e.role}-${t}`)},renderMessageExtras:gt.length>0?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:`Pending actions (approve/deny)`}),gt.map(e=>(0,I.jsxs)(`details`,{open:!0,className:`group min-w-0 rounded-md border bg-background`,children:[(0,I.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 p-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`p`,{className:`break-all font-mono text-xs font-semibold`,children:T9(e.publicToolName)}),(0,I.jsxs)(`p`,{className:`break-all text-xs text-muted-foreground`,children:[e.server,`::`,T9(e.tool)]})]}),(0,I.jsx)(rn,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,I.jsxs)(`div`,{className:`border-t px-3 pb-3 pt-2`,children:[(0,I.jsx)(`pre`,{className:`max-h-48 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap wrap-break-word rounded border bg-muted/50 p-2 text-xs`,children:(0,I.jsx)(`code`,{className:`wrap-break-word`,children:JSON.stringify(e.arguments??{},null,2)})}),(0,I.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 px-2 text-xs`,disabled:De,onClick:()=>void Fe(e.id),children:`Deny`}),(0,I.jsx)(W,{type:`button`,size:`sm`,className:`h-7 px-2 text-xs`,disabled:De,onClick:()=>void Pe(e.id),children:`Approve`})]})]})]},e.id))]}):null}):k===`reports`?(0,I.jsxs)(K,{className:`min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,I.jsx)(Qv,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)($v,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(Bn,{className:`h-4 w-4 text-muted-foreground`}),`Reports`]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:()=>D(e=>!e),children:[E?(0,I.jsx)(Hn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Un,{className:`h-3.5 w-3.5`}),E?`Compact`:`Expand`]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:()=>T(!1),children:`Hide`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Review markdown reports for this run while keeping the result visible.`})]})}),(0,I.jsxs)(q,{className:`flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1`,children:[(se||ae.length===0||ae.length>1)&&(0,I.jsx)(`div`,{className:`border-b px-4 py-3`,children:se?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading reference reports...`}):ae.length===0?(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No reference reports for this run yet.`}),(0,I.jsxs)(W,{type:`button`,size:`sm`,variant:`outline`,className:`shrink-0 gap-1.5`,onClick:()=>xt(),children:[(0,I.jsx)(qn,{className:`h-3.5 w-3.5`}),`New Report`]})]}):(0,I.jsx)(`div`,{className:`space-y-2`,children:ae.length>1?(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Selected report`}),(0,I.jsxs)(E1,{value:ce,onValueChange:le,children:[(0,I.jsx)(O1,{className:`h-8`,children:(0,I.jsx)(D1,{placeholder:`Select a report`})}),(0,I.jsx)(j1,{children:ae.map(e=>(0,I.jsx)(Q,{value:e.relativePath,children:e.name},e.path))})]})]}):null})}),(0,I.jsx)(c4,{className:`min-h-0 flex-1 bg-muted/15 px-4 py-4`,children:ae.length===0?(0,I.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`No report selected.`}):de?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(In,{className:`h-4 w-4 animate-spin`}),`Loading report...`]}):pe?(0,I.jsxs)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive`,children:[`Could not load report: `,pe]}):ue?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`rounded-md border bg-background p-3`,children:[(0,I.jsx)(`p`,{className:`font-mono text-xs font-semibold`,children:ue.name}),(0,I.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:ue.relativePath}),(0,I.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:new Date(ue.mtime).toLocaleString()})]}),(0,I.jsx)(`div`,{className:`rounded-md border bg-background p-3`,children:(0,I.jsx)(o2,{text:ue.content,className:`text-sm`})})]}):(0,I.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Select a report to preview.`})})]})]}):(0,I.jsxs)(K,{className:`min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col`,children:[(0,I.jsx)(Qv,{className:`border-b px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)($v,{className:`flex items-center gap-2 text-base`,children:[(0,I.jsx)(Bn,{className:`h-4 w-4 text-muted-foreground`}),`Run Note`]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,I.jsxs)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 gap-1 px-2 text-xs`,onClick:()=>D(e=>!e),children:[E?(0,I.jsx)(Hn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(Un,{className:`h-3.5 w-3.5`}),E?`Compact`:`Expand`]}),(0,I.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2 text-xs`,onClick:()=>T(!1),children:`Hide`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add context for this run, such as server version or environment details.`})]})}),(0,I.jsx)(q,{className:`flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1`,children:d?(0,I.jsxs)(`div`,{className:`w-full max-w-xl space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium`,children:`Run note`}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[p.length,`/500`]})]}),(0,I.jsx)(n0,{value:p,onChange:e=>m(e.target.value.slice(0,500)),placeholder:`Optional context for this run`,rows:3,className:`min-h-20 resize`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{size:`sm`,onClick:()=>void wt(),disabled:h,children:h?`Saving...`:`Save note`}),(0,I.jsx)(W,{size:`sm`,variant:`outline`,onClick:()=>{m(s.runNote??``),f(!1)},disabled:h,children:`Cancel`})]})]}):(0,I.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:[(0,I.jsxs)(`div`,{className:`min-w-0 flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`Run note:`}),(0,I.jsx)(`span`,{className:`wrap-break-word ${s.runNote?`text-foreground`:`text-muted-foreground`}`,children:s.runNote||`none`})]}),(0,I.jsx)(W,{size:`sm`,variant:`ghost`,className:`ml-auto h-6 px-2 text-xs`,onClick:()=>f(!0),children:s.runNote?`Edit`:`Add note`})]})})]})]}),(0,I.jsx)(z3,{open:N,onOpenChange:e=>!te&&P(e),children:(0,I.jsxs)(H3,{className:`max-w-2xl`,children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:re?`Create markdown report`:`Approve MCP action: write markdown report`}),(0,I.jsx)(K3,{children:re?`Write a custom markdown report and save it to the workspace.`:(0,I.jsxs)(I.Fragment,{children:[`This will call `,(0,I.jsx)(`code`,{children:`mcplab_write_markdown_report`}),` via the local MCPLab MCP server.`]})})]}),(0,I.jsxs)(`div`,{className:`space-y-3`,children:[!re&&(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Output path`}),(0,I.jsx)(Np,{value:R,onChange:e=>z(e.target.value),placeholder:`mcplab/reports/result-assistant/my-report.md`,disabled:te})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(W0,{checked:B,onCheckedChange:e=>ee(e===!0),disabled:te}),(0,I.jsx)(`span`,{children:`Overwrite if file exists`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:re?`Markdown content`:`Markdown preview (to be written)`}),(0,I.jsx)(n0,{value:F,onChange:e=>L(e.target.value),rows:10,className:`font-mono text-xs`,disabled:te})]})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{disabled:te,children:`Cancel`}),(0,I.jsx)(q3,{onClick:e=>{e.preventDefault(),St()},disabled:te,children:te?`Writing...`:re?`Save Report`:`Approve & Write`})]})]})}),(0,I.jsx)(z3,{open:he,onOpenChange:ge,children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete run?`}),(0,I.jsxs)(K3,{children:[`This will permanently remove run `,(0,I.jsx)(`span`,{className:`font-mono`,children:s?.id}),`. This action cannot be undone.`]})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{disabled:_e,children:`Cancel`}),(0,I.jsx)(q3,{disabled:_e||!s?.id,onClick:e=>{e.preventDefault(),Tt()},className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:_e?`Deleting...`:`Delete`})]})]})})]})]})};function mne({item:e,fallbackUserPrompt:t}){if(e.kind===`tool_call`){let t=V9(e,`input`);return(0,I.jsx)(U9,{variant:`call`,title:`Tool call · ${e.toolName||`unknown`}${t}`,text:e.text})}if(e.kind===`tool_result`){let t=V9(e,`output`),n=e.ok?(0,I.jsx)(ln,{className:`h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300`}):(0,I.jsx)(dn,{className:`h-3.5 w-3.5 text-rose-700 dark:text-rose-300`});return(0,I.jsx)(U9,{variant:e.ok?`result_ok`:`result_error`,title:`Tool result · ${e.toolName||`unknown`} · ${e.ok?`ok`:`error`}${typeof e.durationMs==`number`?` · ${e.durationMs}ms`:``}${t}`,text:e.text,icon:n})}let n=e.kind===`user_prompt`,r=H9(e.text,e.kind),i=t?H9(t,`user_prompt`):``,a=n&&!r&&i?i:r,o=n?`User prompt`:e.kind===`assistant_final`?`Agent final`:`Agent`,s=n?cr:$t;return(0,I.jsxs)(`div`,{className:`flex items-start gap-2 text-xs ${n?`justify-end`:`justify-start`}`,children:[!n&&(0,I.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:(0,I.jsx)(s,{className:`h-3 w-3`})}),(0,I.jsxs)(`div`,{className:`max-w-[90%] rounded-md p-2 ${n?`bg-primary/10`:`bg-muted/50`}`,children:[(0,I.jsx)(`p`,{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?`text-right`:``}`,children:o}),n?(0,I.jsx)(W9,{text:a,maxLength:280,className:`text-xs`}):(0,I.jsx)(W9,{text:a,maxLength:500,className:`text-xs`})]}),n&&(0,I.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:(0,I.jsx)(s,{className:`h-3 w-3`})})]})}function V9(e,t){let n=t===`input`?e.estimatedTokens?.inputTokens:e.estimatedTokens?.outputTokens;return typeof n==`number`?` · ${j4(n)} tokens`:``}function H9(e,t){let n=String(e??``).replace(/^\s+/,``);return t===`user_prompt`?n.replace(/^user:\s*/i,``):t===`assistant_final`||t===`assistant_thought`?n.replace(/^assistant:\s*/i,``):n}function hne(e,t){if(!t)return!1;let n=String(e??``).toLowerCase();if(!n.trim())return!1;let r=[`check`,`checks`,`rule`,`rules`,`regex`,`pattern`,`value capture`,`extract rule`,`update`,`change`,`replace`,`modify`,`adjust`,`use `,`set `],i=[`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(e=>n.includes(e))&&!i.some(e=>n.includes(e)))return!1;let a=r.some(e=>n.includes(e)),o=i.some(e=>n.includes(e)),s=/(^|\n)\s*[-*]\s+/.test(e)||/(^|\n)\s*\d+\.\s+/.test(e),c=/["'`][^"'`\n]{2,}["'`]/.test(e);return a&&(o||s||c)}function U9({variant:e,title:t,text:n,icon:r}){let[i,a]=(0,_.useState)(!1);return(0,I.jsx)(n2,{open:i,onOpenChange:a,children:(0,I.jsxs)(`div`,{className:`rounded-md border p-2 text-xs ${{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`}[e]}`,children:[(0,I.jsx)(r2,{asChild:!0,children:(0,I.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 text-left`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5 font-mono text-[11px]`,children:[r??(0,I.jsx)(ur,{className:`h-3.5 w-3.5`}),(0,I.jsx)(`span`,{children:t})]}),(0,I.jsx)(`span`,{className:`text-[11px] font-semibold`,children:i?`Hide content`:`Show content`})]})}),(0,I.jsx)(i2,{children:(0,I.jsx)(`p`,{className:`mt-2 font-mono whitespace-pre-wrap text-foreground`,children:n})})]})})}function W9({text:e,maxLength:t,className:n}){let[r,i]=(0,_.useState)(!1),a=e.length>t,o=r||!a?e:`${e.slice(0,t)}...`;return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(o2,{text:o,className:n}),a&&(0,I.jsx)(`button`,{type:`button`,className:`mt-1 text-[11px] font-medium text-primary hover:underline`,onClick:()=>i(e=>!e),children:r?`Show less`:`Show all`})]})}function gne(e,t,n,r){return h4({evalRules:e,failureReasons:t,runError:n,checkResults:r})}function G9(e){let t=String(e??``).trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}var K9=[`hsl(38, 92%, 50%)`,`hsl(200, 80%, 50%)`,`hsl(152, 69%, 40%)`,`hsl(280, 60%, 50%)`,`hsl(0, 72%, 51%)`],_ne=9,q9=`mcplab.compare.showDaySeparators`;function J9(e){if(!e.trim())return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function Y9(e){let t=J9(e);return t?t.toLocaleString():``}function vne(e){let t=J9(e);return t?`${t.getUTCFullYear()}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`:e}function yne(e){let t=J9(e);return t?t.toLocaleDateString(void 0,{weekday:`long`,month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}):`Unknown day`}function X9({counts:e}){return!e||e.total===0?(0,I.jsx)(I.Fragment,{children:`—`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`text-success`,children:[e.passed,` ✓`]}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,I.jsxs)(`span`,{className:`text-destructive`,children:[e.failed,` ✕`]}),e.not_evaluated>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[e.not_evaluated,` ○`]})]}),e.not_executed>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` `}),(0,I.jsxs)(`span`,{children:[e.not_executed,` ⊘`]})]})]})}function bne(e){return e.configName?.trim()||AY(e).slice(0,2).join(`, `)||`n/a`}function xne(e){return e.configPath?.trim()||void 0}function Z9({run:e,className:t}){let n=bne(e),r=xne(e);return(0,I.jsx)(`div`,{className:t,title:r,children:n})}function Sne(e){let t=e.checkCounts;if(!t||t.total===0)return`—`;let n=t.passed+t.failed;return n===0?`—`:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(X9,{counts:t}),(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,I.jsxs)(`span`,{children:[Math.round(t.passed/n*100),`%`]})]})}function Cne(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function wne(e){let t=e.find(e=>e.provider&&e.model)??e.find(e=>e.provider||e.model);return{provider:t?.provider,model:t?.model}}var Tne=()=>{let{source:e}=Rv(),[t,n]=pp(),r=A9(t),i=t.get(`mode`)===`within-run`?`within-run`:`runs`,[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)({}),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(new Set),[p,m]=(0,_.useState)(`timestamp`),[h,g]=(0,_.useState)(`desc`),[v,y]=(0,_.useState)(`all`),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(()=>{if(typeof window>`u`)return!1;try{return window.localStorage.getItem(q9)===`1`}catch{return!1}}),[w,T]=(0,_.useState)(r.mode),[E,D]=(0,_.useState)(r.preset),[k,A]=(0,_.useState)(r.start),[j,M]=(0,_.useState)(r.end),[N,P]=(0,_.useState)(!1),F=X7(100),{offset:L,hasMore:R,totalCount:z}=F,B=t.get(`runId`)??``,ee=(t.get(`agents`)??``).split(`,`).map(e=>e.trim()).filter(Boolean),te=t.get(`scenario`)??`all`,[ne,re]=(0,_.useState)(B),[ie,ae]=(0,_.useState)(ee),[oe,se]=(0,_.useState)(te),[V,ce]=(0,_.useState)(!1),le=(0,_.useRef)(0),ue=(0,_.useMemo)(()=>{if(w===`all`)return{};if(w===`last`){let e=D9.find(e=>e.value===E)??D9[0],t=new Date;return{since:new Date(t.getTime()-e.durationMs).toISOString(),until:t.toISOString()}}return{since:J9(k)?.toISOString(),until:J9(j)?.toISOString()}},[j,w,E,k]),H=async()=>{let t=le.current+1;le.current=t,u(!0);try{if(e.listRunSummariesPage){let n={limit:100,offset:L};v!==`all`&&(n.scenario=v),ue.since&&(n.since=ue.since),ue.until&&(n.until=ue.until);let r=await e.listRunSummariesPage(n);if(le.current!==t)return;F.updateMeta(r),o(r.data.map(MY))}else{let n=await e.listResults();if(le.current!==t)return;o(n)}}catch(e){O({title:`Could not load results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{le.current===t&&u(!1)}};(0,_.useEffect)(()=>{let t=!0;return le.current+=1,u(!0),(e.listRunSummariesPage?e.listRunSummariesPage({limit:100,offset:L,scenario:v===`all`?void 0:v,since:ue.since,until:ue.until}).then(e=>(t&&F.updateMeta(e),e.data.map(MY))):e.listResults()).then(e=>{t&&o(e)}).catch(e=>{t&&O({title:`Could not load results`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}).finally(()=>{t&&u(!1)}),()=>{t=!1}},[L,v,e,ue]);let de=e=>{p===e?g(e=>e===`asc`?`desc`:`asc`):(m(e),g(e===`timestamp`?`desc`:`asc`))},fe=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},pe=(0,_.useMemo)(()=>{let e=new Set;return a.forEach(t=>{t.scenarios.forEach(t=>{let n=String(t.scenarioName??``).trim(),r=String(t.scenarioId??``).trim(),i=n||r;i&&e.add(i)})}),Array.from(e).sort((e,t)=>e.localeCompare(t))},[a]),me=(0,_.useMemo)(()=>{let e=v===`all`?a:a.filter(e=>e.scenarios.some(e=>{let t=String(e.scenarioName??``).trim(),n=String(e.scenarioId??``).trim();return(t||n)===v}));if(i!==`runs`||w===`all`)return e;let t=Date.now();if(w===`last`){let n=t-(D9.find(e=>e.value===E)??D9[0]).durationMs;return e.filter(e=>{let r=new Date(e.timestamp).getTime();return r>=n&&r<=t})}let n=J9(k)?.getTime()??null,r=J9(j)?.getTime()??null,o=n!==null&&r!==null?Math.min(n,r):n??null,s=n!==null&&r!==null?Math.max(n,r):r??null;return e.filter(e=>{let t=new Date(e.timestamp).getTime();return!(Number.isNaN(t)||o!==null&&t<o||s!==null&&t>s)})},[i,a,v,j,w,E,k]),he=(0,_.useMemo)(()=>[...me].sort((e,t)=>{let n=0;return p===`id`&&(n=e.id.localeCompare(t.id)),p===`timestamp`&&(n=new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),p===`passRate`&&(n=(e.overallPassRate??-1)-(t.overallPassRate??-1)),p===`scenarios`&&(n=e.totalScenarios-t.totalScenarios),h===`asc`?n:-n}),[me,p,h]),ge=(0,_.useMemo)(()=>he.filter(e=>d.has(e.id)).map(e=>s[e.id]??e),[s,he,d]),_e=(0,_.useMemo)(()=>{if(!S)return he.map(e=>({type:`run`,run:e}));let e=[],t=null;for(let n of he){let r=vne(n.timestamp);r!==t&&(e.push({type:`day-separator`,dayKey:r,dayLabel:yne(n.timestamp)}),t=r),e.push({type:`run`,run:n})}return e},[S,he]);(0,_.useEffect)(()=>{if(typeof window<`u`)try{window.localStorage.setItem(q9,S?`1`:`0`)}catch{}},[S]);let ve=e=>p===e?h===`asc`?(0,I.jsx)(on,{className:`h-3.5 w-3.5`}):(0,I.jsx)(rn,{className:`h-3.5 w-3.5`}):(0,I.jsx)(sn,{className:`h-3.5 w-3.5 text-muted-foreground`}),ye=(0,_.useMemo)(()=>{let e=new Map;for(let t of he)e.set(t.id,jY(t));return e},[he]),be=e=>{let t=Array.from(new Set(e.scenarios.map(e=>e.agentId).filter(Boolean)));return t.slice(0,Math.min(2,t.length))},xe=e=>{let r=be(e);re(e.id),ae(r),se(`all`);let i=new URLSearchParams(t);i.set(`mode`,`within-run`),i.set(`runId`,e.id),r.length>0?i.set(`agents`,r.join(`,`)):i.delete(`agents`),i.delete(`scenario`),n(i,{replace:!0})},Se=(0,_.useMemo)(()=>[...new Set(ge.flatMap(e=>e.scenarios.map(e=>e.scenarioId)))],[ge]),Ce=(0,_.useMemo)(()=>{let e=new Map;for(let t of ge)for(let n of t.scenarios){let t=String(n.scenarioId??``).trim();if(!t)continue;let r=String(n.scenarioName??``).trim();e.set(t,r||t)}return e},[ge]),we=(0,_.useMemo)(()=>s[ne]??a.find(e=>e.id===ne),[s,a,ne]);(0,_.useEffect)(()=>{if(typeof e.getResult!=`function`||d.size===0&&!ne)return;let t=new Set([...d]);ne&&t.add(ne);for(let n of t)s[n]||e.getResult(n).then(e=>{e&&c(t=>t[n]?t:{...t,[n]:e})})},[s,d,e,ne]),(0,_.useEffect)(()=>{F.reset()},[F.reset,v,w,E,k,j]);let Te=(0,_.useMemo)(()=>{if(!we)return[];let e=new Map;for(let t of we.scenarios)e.set(t.agentId,t.agentName||t.agentId);return Array.from(e.entries()).map(([e,t])=>({id:e,name:t})).sort((e,t)=>e.name.localeCompare(t.name))},[we]),Ee=(0,_.useMemo)(()=>{if(!we)return[];let e=new Set;for(let t of we.scenarios){let n=String(t.scenarioName??``).trim(),r=String(t.scenarioId??``).trim(),i=n||r;i&&e.add(i)}return Array.from(e).sort((e,t)=>e.localeCompare(t))},[we]),De=(0,_.useMemo)(()=>ie.join(`,`),[ie]);(0,_.useEffect)(()=>{if(i===`within-run`){let e=t.get(`runId`)??``,n=(t.get(`agents`)??``).split(`,`).map(e=>e.trim()).filter(Boolean),r=t.get(`scenario`)??`all`;re(t=>t===e?t:e),ae(e=>Cne(e,n)?e:n),se(e=>e===r?e:r)}},[i,t]),(0,_.useEffect)(()=>{if(i!==`within-run`||a.length===0)return;let e=ne;(!e||!a.some(t=>t.id===e))&&(e=a[0].id);let t=a.find(t=>t.id===e),n=(()=>{if(!t)return[];let e=new Map;for(let n of t.scenarios)e.set(n.agentId,n.agentName||n.agentId);return Array.from(e.keys())})(),r=new Set(n),o=De.split(`,`).map(e=>e.trim()).filter(e=>!!e).filter(e=>r.has(e));o.length===0&&n.length>0&&(o=n.slice(0,Math.min(2,n.length)));let s=(()=>{if(!t)return new Set;let e=new Set;for(let n of t.scenarios){let t=String(n.scenarioName??``).trim(),r=String(n.scenarioId??``).trim(),i=t||r;i&&e.add(i)}return new Set(e)})(),c=oe!==`all`&&!s.has(oe)?`all`:oe;e!==ne&&re(e),o.join(`,`)!==De&&ae(o),c!==oe&&se(c)},[i,a,ne,De,oe]),(0,_.useEffect)(()=>{let e=new URLSearchParams(t);i===`within-run`?(e.set(`mode`,`within-run`),ne?e.set(`runId`,ne):e.delete(`runId`),ie.length>0?e.set(`agents`,ie.join(`,`)):e.delete(`agents`),oe===`all`?e.delete(`scenario`):e.set(`scenario`,oe),e.delete(`time_filter`),e.delete(`time_preset`),e.delete(`time_start`),e.delete(`time_end`)):(e.delete(`mode`),e.delete(`runId`),e.delete(`agents`),e.delete(`scenario`),w===`all`?(e.delete(`time_filter`),e.delete(`time_preset`),e.delete(`time_start`),e.delete(`time_end`)):w===`last`?(e.set(`time_filter`,`last`),e.set(`time_preset`,E),e.delete(`time_start`),e.delete(`time_end`)):(e.set(`time_filter`,`custom`),e.delete(`time_preset`),k.trim()?e.set(`time_start`,k.trim()):e.delete(`time_start`),j.trim()?e.set(`time_end`,j.trim()):e.delete(`time_end`))),t.toString()!==e.toString()&&n(e,{replace:!0})},[i,j,w,E,k,ne,ie,oe,t,n]);let Oe=(0,_.useMemo)(()=>{if(w===`all`)return`All time`;if(w===`last`)return D9.find(e=>e.value===E)?.label??`Last range`;let e=!!k.trim(),t=!!j.trim();return!e&&!t?`Custom range`:e&&t?`${Y9(k)} - ${Y9(j)}`:e?`From ${Y9(k)}`:`Until ${Y9(j)}`},[j,w,E,k]),ke=()=>{T(`all`),D(`15min`),A(``),M(``)},Ae=(0,_.useMemo)(()=>{if(!we)return[];let e=new Map;for(let t of we.scenarios){let n=String(t.scenarioId??``).trim(),r=String(t.scenarioName??``).trim(),i=r||n;if(!n&&!i)continue;let a=n||i,o=e.get(a);o?o.byAgent[t.agentId]=t:e.set(a,{scenarioId:n||i,scenarioName:r,displayLabel:i||n,byAgent:{[t.agentId]:t}})}let t=Array.from(e.values()).sort((e,t)=>{let n=(e.displayLabel||e.scenarioId).toLowerCase(),r=(t.displayLabel||t.scenarioId).toLowerCase();return n.localeCompare(r)});return oe===`all`?t:t.filter(e=>e.displayLabel===oe)},[we,oe]),je=(0,_.useMemo)(()=>{let e=new Map(Te.map(e=>[e.id,e]));return ie.map(t=>e.get(t)).filter(e=>!!e)},[ie,Te]),Me=(0,_.useMemo)(()=>{if(!we||je.length!==2)return null;let[e,t]=je;return{left:e,right:t,link:`/compare/results?left=${encodeURIComponent(we.id)}&right=${encodeURIComponent(we.id)}&leftConfig=${encodeURIComponent(we.configId)}&rightConfig=${encodeURIComponent(we.configId)}&leftAgent=${encodeURIComponent(e.id)}&rightAgent=${encodeURIComponent(t.id)}`}},[we,je]),Ne=(0,_.useMemo)(()=>!we||je.length===0?[]:je.map(e=>{let t=Ae.map(t=>t.byAgent[e.id]).filter(e=>!!e),n=t.flatMap(e=>e.runs),r=n.length,i=n.filter(e=>e.passed).length,a=n.reduce((e,t)=>e+t.toolCalls.length,0),o=n.reduce((e,t)=>e+t.duration,0),{provider:s,model:c}=wne(t);return{agentId:e.id,agentName:e.name,provider:s,model:c,passRate:K_(i,r,n.filter(e=>e.outcome===`stopped`).length),totalRuns:r,avgToolCalls:r===0?0:a/r,avgLatency:r===0?0:o/r}}),[we,je,Ae]),Pe=e=>{ae(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},Fe=e=>(0,I.jsxs)(`div`,{className:`min-w-0 rounded border bg-muted/20 px-2 py-1.5`,children:[(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsxs)(`span`,{className:`font-mono`,children:[`#`,e.runIndex+1]}),` `,(0,I.jsx)(`span`,{className:e.passed?`text-emerald-700`:`text-destructive`,children:e.passed?`PASS`:`FAIL`}),` `,`· tools: `,e.toolCalls.length,` · `,e.duration,`ms`]}),!e.passed&&e.failureReasons.length>0&&(0,I.jsx)(`div`,{className:`mt-1 max-h-16 overflow-y-auto whitespace-pre-wrap break-all pr-1 text-[11px] text-muted-foreground`,children:e.failureReasons.join(`; `)})]},e.runIndex);return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Dn,{className:`h-6 w-6`}),`Compare Runs`]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i===`runs`?`Select 2–5 runs to compare`:`Compare agents side-by-side within one run`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i===`within-run`&&(0,I.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>{let e=new URLSearchParams(t);e.delete(`mode`),e.delete(`runId`),e.delete(`agents`),e.delete(`scenario`),n(e,{replace:!0})},children:[(0,I.jsx)(Zt,{className:`mr-1.5 h-4 w-4`}),`Back to Compare`]}),i===`runs`&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(S8,{open:b,onOpenChange:x,children:[(0,I.jsx)(C8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":b,"aria-controls":`compare-scenario-command-list`,className:`w-[260px] justify-between font-normal ${v===`all`?``:`border-primary/40`}`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:v===`all`?`All scenarios`:v}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(w8,{className:`w-[260px] p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(S5,{id:`compare-scenario-command-list`,children:[(0,I.jsx)(C5,{children:`No scenarios found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(E5,{value:`all scenarios`,onSelect:()=>{y(`all`),x(!1)},children:`All scenarios`}),pe.map(e=>(0,I.jsx)(E5,{value:e,onSelect:()=>{y(e),x(!1)},children:e},e))]})]})]})})]}),(0,I.jsxs)(S8,{open:N,onOpenChange:P,children:[(0,I.jsx)(C8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":N,"aria-controls":`compare-time-command-list`,className:`w-[320px] justify-between font-normal ${w===`all`?``:`border-primary/40`}`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 truncate text-left`,children:[(0,I.jsx)(en,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,I.jsx)(`span`,{className:`truncate`,children:Oe})]}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsxs)(w8,{className:`w-[360px] p-0`,align:`start`,children:[(0,I.jsxs)(`div`,{className:`border-b px-3 py-2`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Date and time filter`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Filter runs by timestamp.`})]}),(0,I.jsxs)(`div`,{id:`compare-time-command-list`,className:`grid gap-1 p-2`,children:[(0,I.jsx)(W,{type:`button`,variant:w===`all`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{ke(),P(!1)},children:`All time`}),D9.map(e=>(0,I.jsx)(W,{type:`button`,variant:w===`last`&&E===e.value?`secondary`:`ghost`,className:`justify-start`,onClick:()=>{T(`last`),D(e.value),P(!1)},children:e.label},e.value)),(0,I.jsx)(W,{type:`button`,variant:w===`custom`?`secondary`:`ghost`,className:`justify-start`,onClick:()=>T(`custom`),children:`Custom date time range`})]}),w===`custom`&&(0,I.jsxs)(`div`,{className:`space-y-3 border-t p-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`compare-time-filter-start`,children:`Start`}),(0,I.jsx)(Np,{id:`compare-time-filter-start`,type:`datetime-local`,value:k,onChange:e=>A(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)($,{htmlFor:`compare-time-filter-end`,children:`End`}),(0,I.jsx)(Np,{id:`compare-time-filter-end`,type:`datetime-local`,value:j,onChange:e=>M(e.target.value)})]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,className:`px-2`,onClick:ke,children:[(0,I.jsx)(dr,{className:`mr-1.5 h-3.5 w-3.5`}),`Clear`]}),(0,I.jsx)(W,{type:`button`,size:`sm`,onClick:()=>P(!1),children:`Done`})]})]})]})]})]}),(0,I.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-md border px-3 py-2`,children:[(0,I.jsx)($,{htmlFor:`compare-day-separators-switch`,className:`text-sm font-medium`,children:`Group by day`}),(0,I.jsx)(G5,{id:`compare-day-separators-switch`,checked:S,onCheckedChange:C,"aria-label":`Group by day`})]}),(0,I.jsx)(W,{variant:`outline`,onClick:()=>void H(),disabled:l,children:l?`Refreshing...`:`Refresh`}),(0,I.jsx)(W,{variant:`outline`,onClick:F.prev,disabled:l||L===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:F.next,disabled:l||!R,children:`Next`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:F.rangeLabel(a.length)}),i===`within-run`&&(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Within One Run Controls`})}),(0,I.jsxs)(q,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Run`}),(0,I.jsxs)(E1,{value:ne,onValueChange:re,children:[(0,I.jsx)(O1,{children:(0,I.jsx)(D1,{placeholder:`Select run`})}),(0,I.jsx)(j1,{children:a.map(e=>(0,I.jsx)(Q,{value:e.id,children:e.id},e.id))})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Scenario filter`}),(0,I.jsxs)(S8,{open:V,onOpenChange:ce,children:[(0,I.jsx)(C8,{asChild:!0,children:(0,I.jsxs)(W,{type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":V,"aria-controls":`compare-within-run-scenario-command-list`,className:`w-full justify-between font-normal`,children:[(0,I.jsx)(`span`,{className:`truncate text-left`,children:oe===`all`?`All scenarios`:oe}),(0,I.jsx)(rn,{className:`ml-2 h-4 w-4 shrink-0 opacity-50`})]})}),(0,I.jsx)(w8,{className:`w-(--radix-popover-trigger-width) p-0`,align:`start`,children:(0,I.jsxs)(b5,{children:[(0,I.jsx)(x5,{placeholder:`Search scenarios...`}),(0,I.jsxs)(S5,{id:`compare-within-run-scenario-command-list`,children:[(0,I.jsx)(C5,{children:`No scenarios found.`}),(0,I.jsxs)(w5,{children:[(0,I.jsx)(E5,{value:`all scenarios`,onSelect:()=>{se(`all`),ce(!1)},children:`All scenarios`}),Ee.map(e=>(0,I.jsx)(E5,{value:e,onSelect:()=>{se(e),ce(!1)},children:e},e))]})]})]})})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`Agents (select 2+)`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-3 rounded-md border p-3`,children:[Te.length===0&&(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No agents available for selected run.`}),Te.map(e=>(0,I.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-sm`,children:[(0,I.jsx)(W0,{checked:ie.includes(e.id),onCheckedChange:()=>Pe(e.id)}),(0,I.jsx)(`span`,{children:e.name})]},e.id))]})]})]})]}),i===`runs`&&(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsxs)(ny,{containerClassName:`max-h-144 overflow-auto`,children:[(0,I.jsx)(ry,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{className:`w-10`}),(0,I.jsx)(sy,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>de(`id`),children:[`Run ID`,ve(`id`)]})}),(0,I.jsx)(sy,{children:`Evaluated`}),(0,I.jsx)(sy,{children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>de(`timestamp`),children:[`Timestamp`,ve(`timestamp`)]})}),(0,I.jsx)(sy,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex w-full items-center justify-end gap-1 hover:text-foreground`,onClick:()=>de(`passRate`),children:[`Pass Rate`,ve(`passRate`)]})}),(0,I.jsx)(sy,{className:`text-right`,children:(0,I.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 hover:text-foreground`,onClick:()=>de(`scenarios`),children:[`Scenarios`,ve(`scenarios`)]})}),(0,I.jsx)(sy,{className:`text-right`,children:`Tool Tokens`}),(0,I.jsx)(sy,{className:`text-right`,children:`Agents`}),(0,I.jsx)(sy,{className:`w-[140px] text-right`,children:`Action`})]})}),(0,I.jsx)(iy,{children:_e.map((e,t)=>e.type===`day-separator`?(0,I.jsx)(oy,{className:`bg-muted/30 hover:bg-muted/30`,children:(0,I.jsx)(J,{colSpan:_ne,className:`px-4 py-3`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`}),(0,I.jsx)(`span`,{className:`shrink-0 rounded-full border border-border bg-background px-2.5 py-0.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.dayLabel}),(0,I.jsx)(`div`,{className:`h-px flex-1 bg-border/70`})]})})},`day-${e.dayKey}-${t}`):(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{children:(0,I.jsx)(W0,{checked:d.has(e.run.id),onCheckedChange:()=>fe(e.run.id),disabled:!d.has(e.run.id)&&d.size>=5})}),(0,I.jsx)(J,{className:`font-mono text-xs`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{children:e.run.id}),(0,I.jsx)(Z9,{run:e.run,className:`truncate font-sans text-xs text-foreground/80`})]})}),(0,I.jsx)(J,{className:`text-[11px] text-muted-foreground`,children:(()=>{let t=ye.get(e.run.id)??{scenarioCount:0,agentCount:0,scopePreview:`n/a`,modelSummary:``};return(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{children:[`Evaluated: `,t.scenarioCount,` scenario`,t.scenarioCount===1?``:`s`,` · `,t.agentCount,` agent`,t.agentCount===1?``:`s`,t.modelSummary?` · ${t.modelSummary}`:``]}),(0,I.jsx)(Y7,{versions:e.run.mcpServerVersions,showPrefix:!1})]})})()}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.run.timestamp).toLocaleString()]}),(()=>{let t=d9(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Total time: `,l9(t)]})})()]})}),(0,I.jsx)(J,{className:`text-right`,children:(0,I.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,I.jsx)(dy,{rate:e.run.overallPassRate}),e.run.checkCounts&&e.run.checkCounts.total>0?(0,I.jsx)(`span`,{className:`font-mono text-[11px] leading-none`,"aria-label":`${e.run.checkCounts.passed} checks passed, ${e.run.checkCounts.failed} checks failed`,title:`${e.run.checkCounts.passed} passed · ${e.run.checkCounts.failed} failed`,children:(0,I.jsx)(X9,{counts:e.run.checkCounts})}):null]})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:e.run.totalScenarios}),(0,I.jsx)(J,{className:`text-right`,children:(0,I.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,I.jsx)(`div`,{className:`font-mono text-sm`,children:j4(e.run.toolTokenUsage?.totalTokens)}),(()=>{let t=p9(e.run);return t===null?null:(0,I.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground/90`,children:[`Tool time: `,l9(t)]})})()]})}),(0,I.jsx)(J,{className:`text-right font-mono text-sm`,children:ye.get(e.run.id)?.agentCount??0}),(0,I.jsx)(J,{className:`text-right`,children:(ye.get(e.run.id)?.agentCount??0)>1?(0,I.jsx)(W,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>xe(e.run),children:`Compare agents`}):(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})})]},e.run.id))})]})})}),i===`runs`&&ge.length<2&&(0,I.jsx)(K,{children:(0,I.jsxs)(q,{className:`py-12 text-center`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`No runs selected`}),(0,I.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Select 2–5 runs from the table above to start a comparison.`})]})}),i===`runs`&&ge.length>=2&&(0,I.jsxs)(I.Fragment,{children:[ge.length===2&&(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Need a deeper comparison?`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Open the two selected runs in a dedicated side-by-side full result compare view.`})]}),(0,I.jsx)(W,{asChild:!0,size:`sm`,children:(0,I.jsx)(sp,{to:`/compare/results?left=${encodeURIComponent(ge[0].id)}&right=${encodeURIComponent(ge[1].id)}&leftConfig=${encodeURIComponent(ge[0].configId)}&rightConfig=${encodeURIComponent(ge[1].configId)}`,children:`Compare full results`})})]})})}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Summary Comparison`})}),(0,I.jsx)(q,{className:`max-h-96 overflow-auto p-0`,children:(0,I.jsxs)(ny,{className:`table-fixed`,children:[(0,I.jsx)(ry,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{className:`w-[220px]`,children:`Metric`}),ge.map((e,t)=>(0,I.jsxs)(sy,{style:{color:K9[t]},className:`font-mono text-xs`,children:[(0,I.jsx)(`div`,{children:e.id}),(0,I.jsx)(Z9,{run:e,className:`mt-0.5 truncate text-[10px] font-normal text-muted-foreground`})]},e.id))]})}),(0,I.jsxs)(iy,{children:[(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Pass Rate`}),ge.map(e=>(0,I.jsx)(J,{children:(0,I.jsx)(dy,{rate:e.overallPassRate})},e.id))]}),(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Checks Pass Rate`}),ge.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:Sne(e)},e.id))]}),(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Runs`}),ge.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.totalRuns},e.id))]}),(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Tool Calls`}),ge.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.avgToolCalls.toFixed(1)},e.id))]}),(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Avg Latency`}),ge.map(e=>(0,I.jsxs)(J,{className:`font-mono`,children:[e.avgLatency,`ms`]},e.id))]}),(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Time`}),ge.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:(()=>{let t=d9(e);return t===null?`—`:l9(t)})()},e.id))]}),(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Tool Time`}),ge.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:(()=>{let t=p9(e);return t===null?`—`:l9(t)})()},e.id))]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Scenario Breakdown`})}),(0,I.jsx)(q,{className:`max-h-104 overflow-auto p-0`,children:(0,I.jsxs)(ny,{className:`table-fixed`,children:[(0,I.jsx)(ry,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{className:`w-[220px]`,children:`Scenario`}),ge.map((e,t)=>(0,I.jsxs)(sy,{style:{color:K9[t]},className:`font-mono text-xs`,children:[(0,I.jsx)(`div`,{children:e.id}),(0,I.jsx)(Z9,{run:e,className:`mt-0.5 truncate text-[10px] font-normal text-muted-foreground`}),(0,I.jsx)(Y7,{versions:e.mcpServerVersions,className:`mt-0.5 max-w-full border-0 bg-transparent p-0 text-[10px] font-normal`})]},e.id))]})}),(0,I.jsx)(iy,{children:Se.map(e=>(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium text-sm`,children:Ce.get(e)??e}),ge.map(t=>{let n=t.scenarios.find(t=>t.scenarioId===e);return(0,I.jsx)(J,{children:n?(0,I.jsxs)(`div`,{className:`flex items-center justify-start gap-2`,children:[(0,I.jsx)(dy,{rate:n.passRate}),n.checkCounts?.total?(0,I.jsx)(`span`,{className:`font-mono text-[11px] leading-none`,children:(0,I.jsx)(X9,{counts:n.checkCounts})}):null]}):(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})},t.id)})]},e))})]})})]})]}),i===`runs`&&ge.length>=2&&(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Pass Rate Trend`})}),(0,I.jsx)(q,{className:`h-72`,children:(0,I.jsx)(qE,{width:`100%`,height:`100%`,children:(0,I.jsxs)(DY,{data:ge.map((e,t)=>({idx:t+1,runId:e.id,passRate:e.overallPassRate===null?null:Number((e.overallPassRate*100).toFixed(1))})),children:[(0,I.jsx)(zq,{dataKey:`idx`,tickFormatter:e=>String(e)}),(0,I.jsx)(nJ,{unit:`%`,domain:[0,100]}),(0,I.jsx)(OE,{formatter:e=>[`${e}%`,`Pass Rate`],labelFormatter:e=>`Run ${e}`}),(0,I.jsx)(tT,{}),(0,I.jsx)(Sq,{type:`monotone`,dataKey:`passRate`,stroke:K9[0],strokeWidth:2.5,dot:!0})]})})})]}),i===`within-run`&&we&&je.length<2&&(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6 text-sm text-muted-foreground`,children:`Select at least 2 agents to compare side-by-side within this run.`})}),i===`within-run`&&we&&je.length>=2&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm font-medium`,children:`Need full result details?`}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Me?`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.`})]}),(0,I.jsx)(W,{asChild:!0,size:`sm`,children:Me?(0,I.jsx)(sp,{to:Me.link,children:`Compare full results`}):(0,I.jsx)(sp,{to:`/results/${encodeURIComponent(we.id)}${we.configId?`?configId=${encodeURIComponent(we.configId)}`:``}`,children:`Open full result`})})]})})}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Agent Summary`})}),(0,I.jsx)(q,{className:`max-h-96 overflow-auto p-0`,children:(0,I.jsxs)(ny,{children:[(0,I.jsx)(ry,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{children:`Metric`}),Ne.map(e=>(0,I.jsxs)(sy,{children:[(0,I.jsx)(`div`,{className:`font-medium text-sm`,children:e.agentName}),(e.provider||e.model)&&(0,I.jsx)(`div`,{className:`font-mono text-xs font-normal text-muted-foreground`,children:[e.provider?E0(e.provider):null,e.model].filter(Boolean).join(` · `)})]},e.agentId))]})}),(0,I.jsxs)(iy,{children:[(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Pass Rate`}),Ne.map(e=>(0,I.jsx)(J,{children:(0,I.jsx)(dy,{rate:e.passRate})},e.agentId))]}),(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Total Runs`}),Ne.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.totalRuns},e.agentId))]}),(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Avg Tool Calls`}),Ne.map(e=>(0,I.jsx)(J,{className:`font-mono`,children:e.avgToolCalls.toFixed(1)},e.agentId))]}),(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium`,children:`Avg Latency`}),Ne.map(e=>(0,I.jsxs)(J,{className:`font-mono`,children:[Math.round(e.avgLatency),`ms`]},e.agentId))]})]})]})})]}),(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{className:`pb-3`,children:(0,I.jsx)($v,{className:`text-base`,children:`Scenario × Agent Matrix`})}),(0,I.jsx)(q,{className:`max-h-136 overflow-auto p-0`,children:(0,I.jsxs)(ny,{className:`table-fixed`,children:[(0,I.jsx)(ry,{className:`[&_th]:sticky [&_th]:top-0 [&_th]:z-10 [&_th]:bg-background`,children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{className:`w-[260px]`,children:`Scenario`}),je.map(e=>{let t=Ne.find(t=>t.agentId===e.id);return(0,I.jsxs)(sy,{children:[(0,I.jsx)(`div`,{className:`font-medium text-sm`,children:e.name}),(t?.provider||t?.model)&&(0,I.jsx)(`div`,{className:`font-mono text-xs font-normal text-muted-foreground`,children:[t.provider?E0(t.provider):null,t.model].filter(Boolean).join(` · `)})]},e.id)})]})}),(0,I.jsx)(iy,{children:Ae.map(e=>(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{className:`font-medium text-sm`,children:e.displayLabel}),je.map(t=>{let n=e.byAgent[t.id];return n?(0,I.jsx)(J,{className:`min-w-0 align-top`,children:(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsx)(dy,{rate:n.passRate}),` `,(0,I.jsxs)(`span`,{className:`ml-2`,children:[`runs: `,n.runs.length]}),` · calls:`,` `,n.avgToolCalls.toFixed(1),` · latency:`,` `,Math.round(n.avgDuration),`ms`]}),n.runs.length>0?(0,I.jsx)(`div`,{className:`space-y-1.5`,children:n.runs.map(e=>Fe(e))}):(0,I.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`No runs captured.`})]})},t.id):(0,I.jsx)(J,{children:(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`—`})},t.id)})]},e.scenarioId))})]})})]})]})]})},Q9=(e,t,n)=>{let r=new URLSearchParams;return t&&r.set(`configId`,t),n&&r.set(`agent`,n),r.set(`embed`,`1`),`/results/${encodeURIComponent(e)}?${r.toString()}`},$9=(e,t,n)=>{let r=new URLSearchParams;t&&r.set(`configId`,t),n&&r.set(`agent`,n);let i=r.toString();return`/results/${encodeURIComponent(e)}${i?`?${i}`:``}`},Ene=()=>{let{source:e}=Rv(),[t]=pp(),n=t.get(`left`)??``,r=t.get(`right`)??``,i=t.get(`leftConfig`),a=t.get(`rightConfig`),o=t.get(`leftAgent`),s=t.get(`rightAgent`),c=o?`${n} · ${o}`:n,l=s?`${r} · ${s}`:r,[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(!n||typeof e.getResult!=`function`){d(null);return}let t=!0;return e.getResult(n).then(e=>{t&&d(e??null)}),()=>{t=!1}},[n,e]),(0,_.useEffect)(()=>{if(!r||typeof e.getResult!=`function`){p(null);return}let t=!0;return e.getResult(r).then(e=>{t&&p(e??null)}),()=>{t=!1}},[r,e]),!n||!r?(0,I.jsxs)(K,{children:[(0,I.jsx)(Qv,{children:(0,I.jsx)($v,{className:`text-base`,children:`Full Result Compare`})}),(0,I.jsxs)(q,{className:`space-y-3`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Select exactly two runs in Compare and use the “Compare full results” action.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(sp,{to:`/compare`,children:`Back to Compare`})})]})]}):(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Full Result Compare`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o||s?`Side-by-side Result Detail views for deep inspection, filtered by selected agents.`:`Side-by-side Result Detail views for deep inspection.`})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(sp,{to:`/compare`,children:[(0,I.jsx)(Zt,{className:`mr-1.5 h-4 w-4`}),`Back to Compare`]})}),(0,I.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(`a`,{href:$9(n,i,o),target:`_blank`,rel:`noreferrer`,children:[`Open Left`,(0,I.jsx)(yn,{className:`ml-1.5 h-3.5 w-3.5`})]})}),(0,I.jsx)(W,{variant:`outline`,size:`sm`,asChild:!0,children:(0,I.jsxs)(`a`,{href:$9(r,a,s),target:`_blank`,rel:`noreferrer`,children:[`Open Right`,(0,I.jsx)(yn,{className:`ml-1.5 h-3.5 w-3.5`})]})})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,I.jsxs)(K,{className:`overflow-hidden`,children:[(0,I.jsx)(Qv,{className:`py-3`,children:(0,I.jsx)($v,{className:`text-sm font-mono`,children:c})}),(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsx)(`iframe`,{title:`Result ${c}`,src:Q9(n,i,o),className:`h-[calc(100vh-12rem)] w-full border-0`})})]}),(0,I.jsxs)(K,{className:`overflow-hidden`,children:[(0,I.jsx)(Qv,{className:`py-3`,children:(0,I.jsx)($v,{className:`text-sm font-mono`,children:l})}),(0,I.jsx)(q,{className:`p-0`,children:(0,I.jsx)(`iframe`,{title:`Result ${l}`,src:Q9(r,a,s),className:`h-[calc(100vh-12rem)] w-full border-0`})})]})]})]})};function Dne(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function One(){let{source:e}=Rv(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(!0),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(!1),l=X7(100),{offset:u,hasMore:d}=l,f=async()=>{i(!0);try{if(e.listMarkdownReportsPage){let t=await e.listMarkdownReportsPage({limit:100,offset:u});n(t.data),l.updateMeta(t)}else n(await e.listMarkdownReports({limit:100,offset:u}))}catch(e){O({title:`Could not load markdown reports`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{i(!1)}};(0,_.useEffect)(()=>{f()},[u]);let p=(0,_.useMemo)(()=>t[0],[t]),m=(0,_.useMemo)(()=>t.find(e=>e.relativePath===a)??null,[t,a]),h=async()=>{if(a){c(!0);try{await e.deleteMarkdownReport(a),n(e=>e.filter(e=>e.relativePath!==a)),O({title:`Markdown report deleted`}),o(null)}catch(e){O({title:`Could not delete markdown report`,description:e instanceof Error?e.message:String(e),variant:`destructive`})}finally{c(!1)}}};return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h1`,{className:`inline-flex items-center gap-2 text-2xl font-bold`,children:[(0,I.jsx)(Bn,{className:`h-6 w-6`}),`Markdown Reports`]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Browse Markdown files under `,(0,I.jsx)(`code`,{children:`mcplab/reports`}),`.`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(W,{variant:`outline`,onClick:()=>void f(),children:`Refresh`}),p?(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(sp,{to:`/markdown-reports/view?id=${encodeURIComponent(p.reportId)}`,children:`Open latest`})}):null,(0,I.jsx)(W,{variant:`outline`,onClick:l.prev,disabled:r||u===0,children:`Prev`}),(0,I.jsx)(W,{variant:`outline`,onClick:l.next,disabled:r||!d,children:`Next`})]})]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l.rangeLabel(t.length)}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`p-0`,children:r?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`Loading markdown reports...`}):t.length===0?(0,I.jsx)(`p`,{className:`p-6 text-sm text-muted-foreground`,children:`No markdown reports found yet.`}):(0,I.jsxs)(ny,{children:[(0,I.jsx)(ry,{children:(0,I.jsxs)(oy,{children:[(0,I.jsx)(sy,{children:`Report`}),(0,I.jsx)(sy,{children:`Result`}),(0,I.jsx)(sy,{children:`Folder`}),(0,I.jsx)(sy,{children:`Timestamp`}),(0,I.jsx)(sy,{className:`w-10`})]})}),(0,I.jsx)(iy,{children:t.map(e=>(0,I.jsxs)(oy,{children:[(0,I.jsx)(J,{children:(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(sp,{to:`/markdown-reports/view?id=${encodeURIComponent(e.reportId)}`,className:`font-mono text-xs text-primary hover:underline`,children:e.name}),(0,I.jsx)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:e.relativePath})]})}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground font-mono`,children:(()=>{let t=Dne(e.relativePath);return t?(0,I.jsx)(sp,{to:`/results/${encodeURIComponent(t)}`,className:`text-primary hover:underline`,children:t}):(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`—`})})()}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground font-mono`,children:e.relativePath.includes(`/`)?e.relativePath.slice(0,e.relativePath.lastIndexOf(`/`)):`.`}),(0,I.jsx)(J,{className:`text-xs text-muted-foreground`,children:(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(mn,{className:`h-3 w-3`}),new Date(e.mtime).toLocaleString()]})}),(0,I.jsx)(J,{children:(0,I.jsxs)(LQ,{children:[(0,I.jsx)(RQ,{asChild:!0,children:(0,I.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,I.jsx)(vn,{className:`h-4 w-4`})})}),(0,I.jsxs)(VQ,{align:`end`,children:[(0,I.jsx)(HQ,{asChild:!0,children:(0,I.jsx)(sp,{to:`/markdown-reports/view?id=${encodeURIComponent(e.reportId)}`,children:`View`})}),(0,I.jsxs)(HQ,{className:`text-destructive`,onSelect:t=>{t.preventDefault(),o(e.relativePath)},children:[(0,I.jsx)(ar,{className:`mr-2 h-3.5 w-3.5`}),` Delete`]})]})]})})]},e.path))})]})})}),(0,I.jsx)(z3,{open:!!a,onOpenChange:e=>!e&&o(null),children:(0,I.jsxs)(H3,{children:[(0,I.jsxs)(U3,{children:[(0,I.jsx)(G3,{children:`Delete markdown report?`}),(0,I.jsx)(K3,{children:m?`Delete '${m.name}' from disk? This cannot be undone.`:`Delete this report from disk? This cannot be undone.`})]}),(0,I.jsxs)(W3,{children:[(0,I.jsx)(J3,{disabled:s,children:`Cancel`}),(0,I.jsx)(q3,{onClick:e=>{e.preventDefault(),h()},disabled:s,children:s?`Deleting...`:`Delete`})]})]})})]})}function kne(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Ane(e){let 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 jne(){let{source:e}=Rv(),[t]=pp(),n=(t.get(`id`)??``).trim(),r=(t.get(`path`)??``).trim(),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!0),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!1);if((0,_.useEffect)(()=>{let t=!0;if(a(null),l(!1),!n&&!r)s(!1);else return s(!0),(n&&e.getMarkdownReportById?e.getMarkdownReportById(n):e.getMarkdownReport(r)).then(e=>{t&&a(e)}).catch(e=>{if(!t)return;let n=e instanceof Error?e.message:String(e);n.includes(`(404)`)?l(!0):O({title:`Could not load markdown report`,description:n,variant:`destructive`})}).finally(()=>{t&&s(!1)}),()=>{t=!1}},[r,n,e]),!n&&!r)return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Markdown Report`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Missing report identifier.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(sp,{to:`/markdown-reports`,children:`Back to Markdown Reports`})})]});if(o)return(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading markdown report...`});if(c||!i)return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Markdown Report`}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Report not found.`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,children:(0,I.jsx)(sp,{to:`/markdown-reports`,children:`Back to Markdown Reports`})})]});let f=Ane(i);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`h1`,{className:`font-mono text-xl font-semibold`,children:i.name}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-mono`,children:i.relativePath}),(0,I.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 align-middle`,children:[(0,I.jsx)(mn,{className:`h-3 w-3 shrink-0`}),new Date(i.mtime).toLocaleString()]}),(0,I.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,I.jsx)(`span`,{children:kne(i.sizeBytes)})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>d(!0),children:`Open Result Panel`}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)(sp,{to:`/results/${encodeURIComponent(f)}`,children:`Open Result`})})]}):null,(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)(sp,{to:`/markdown-reports`,children:`Back to reports`})})]})]}),(0,I.jsx)(K,{children:(0,I.jsx)(q,{className:`pt-6`,children:(0,I.jsx)(o2,{text:i.content,variant:`assistant`})})}),f?(0,I.jsx)(fg,{open:u,onOpenChange:d,children:(0,I.jsxs)(gg,{side:`right`,className:`w-[96vw] max-w-none p-0 sm:max-w-5xl`,children:[(0,I.jsx)(_g,{className:`border-b px-4 py-3 pr-12`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(vg,{className:`text-base`,children:[`Result `,f]}),(0,I.jsx)(W,{asChild:!0,variant:`outline`,size:`sm`,children:(0,I.jsx)(sp,{to:`/results/${encodeURIComponent(f)}`,target:`_blank`,rel:`noreferrer`,children:`Open full page`})})]})}),(0,I.jsx)(`div`,{className:`h-[calc(100vh-64px)]`,children:(0,I.jsx)(`iframe`,{title:`Result ${f}`,src:`/results/${encodeURIComponent(f)}?embed=1`,className:`h-full w-full border-0`})})]})}):null]})}var Mne=()=>{let e=Bd();return(0,_.useEffect)(()=>{console.error(`404 Error: User attempted to access non-existent route:`,e.pathname)},[e.pathname]),(0,I.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-muted`,children:(0,I.jsxs)(`div`,{className:`text-center`,children:[(0,I.jsx)(`h1`,{className:`mb-4 text-4xl font-bold`,children:`404`}),(0,I.jsx)(`p`,{className:`mb-4 text-xl text-muted-foreground`,children:`Oops! Page not found`}),(0,I.jsx)(`a`,{href:`/`,className:`text-primary underline hover:text-primary/90`,children:`Return to Home`})]})})},Nne=new mu;function Pne(){let{scenarioId:e}=qd();return(0,I.jsx)(gf,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:`/libraries/test-cases`,replace:!0})}function Fne(){return(0,I.jsxs)(bf,{children:[(0,I.jsxs)(vf,{element:(0,I.jsx)(Gv,{}),children:[(0,I.jsx)(vf,{path:`/`,element:(0,I.jsx)(IY,{})}),(0,I.jsx)(vf,{path:`/mcp-evaluations`,element:(0,I.jsx)(X1,{})}),(0,I.jsx)(vf,{path:`/mcp-evaluations/:id`,element:(0,I.jsx)(i3,{})}),(0,I.jsx)(vf,{path:`/mcp-evaluations/:id/:tab`,element:(0,I.jsx)(i3,{})}),(0,I.jsx)(vf,{path:`/tool-analysis`,element:(0,I.jsx)(Pte,{})}),(0,I.jsx)(vf,{path:`/tool-analysis-results`,element:(0,I.jsx)(Fte,{})}),(0,I.jsx)(vf,{path:`/tool-analysis-results/:id`,element:(0,I.jsx)(Ite,{})}),(0,I.jsx)(vf,{path:`/oauth-debugger`,element:(0,I.jsx)(Hte,{})}),(0,I.jsx)(vf,{path:`/libraries/servers`,element:(0,I.jsx)(Y3,{})}),(0,I.jsx)(vf,{path:`/libraries/servers/:serverId`,element:(0,I.jsx)($3,{})}),(0,I.jsx)(vf,{path:`/libraries/agents`,element:(0,I.jsx)(e6,{defaultType:`llm`})}),(0,I.jsx)(vf,{path:`/libraries/agents/:agentName`,element:(0,I.jsx)(A5,{})}),(0,I.jsx)(vf,{path:`/libraries/test-cases`,element:(0,I.jsx)(M5,{})}),(0,I.jsx)(vf,{path:`/libraries/test-cases/:testCaseId`,element:(0,I.jsx)(M5,{})}),(0,I.jsx)(vf,{path:`/libraries/scenarios`,element:(0,I.jsx)(gf,{to:`/libraries/test-cases`,replace:!0})}),(0,I.jsx)(vf,{path:`/libraries/scenarios/:scenarioId`,element:(0,I.jsx)(Pne,{})}),(0,I.jsx)(vf,{path:`/settings`,element:(0,I.jsx)(q5,{})}),(0,I.jsx)(vf,{path:`/settings/mcp`,element:(0,I.jsx)(r7,{})}),(0,I.jsx)(vf,{path:`/run`,element:(0,I.jsx)(Yte,{})}),(0,I.jsx)(vf,{path:`/results`,element:(0,I.jsx)(lne,{})}),(0,I.jsx)(vf,{path:`/results/:id`,element:(0,I.jsx)(pne,{})}),(0,I.jsx)(vf,{path:`/markdown-reports`,element:(0,I.jsx)(One,{})}),(0,I.jsx)(vf,{path:`/markdown-reports/view`,element:(0,I.jsx)(jne,{})}),(0,I.jsx)(vf,{path:`/compare`,element:(0,I.jsx)(Tne,{})}),(0,I.jsx)(vf,{path:`/compare/results`,element:(0,I.jsx)(Ene,{})})]}),(0,I.jsx)(vf,{path:`*`,element:(0,I.jsx)(Mne,{})})]})}(0,g.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(()=>(0,I.jsx)(gu,{client:Nne,children:(0,I.jsx)(fl,{children:(0,I.jsx)(Lv,{children:(0,I.jsx)(Xv,{children:(0,I.jsxs)(qv,{children:[(0,I.jsx)(Xi,{}),(0,I.jsx)(ja,{}),(0,I.jsx)(op,{children:(0,I.jsx)(Fne,{})})]})})})})}),{}));
|