sandboxy 0.0.3__py3-none-any.whl → 0.0.4__py3-none-any.whl
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.
- sandboxy/api/routes/local.py +182 -19
- sandboxy/cli/main.py +292 -31
- sandboxy/mlflow/__init__.py +38 -0
- sandboxy/mlflow/artifacts.py +184 -0
- sandboxy/mlflow/config.py +90 -0
- sandboxy/mlflow/exporter.py +439 -0
- sandboxy/mlflow/metrics.py +115 -0
- sandboxy/mlflow/tags.py +140 -0
- sandboxy/mlflow/tracing.py +126 -0
- sandboxy/scenarios/loader.py +44 -2
- sandboxy/scenarios/runner.py +57 -2
- sandboxy/tools/yaml_tools.py +18 -0
- sandboxy/ui/dist/assets/index-CU06wBqc.js +362 -0
- sandboxy/ui/dist/assets/index-Cgg2wY2m.css +1 -0
- sandboxy/ui/dist/index.html +2 -2
- {sandboxy-0.0.3.dist-info → sandboxy-0.0.4.dist-info}/METADATA +37 -1
- {sandboxy-0.0.3.dist-info → sandboxy-0.0.4.dist-info}/RECORD +20 -13
- sandboxy/ui/dist/assets/index-CgAkYWrJ.css +0 -1
- sandboxy/ui/dist/assets/index-D4zoGFcr.js +0 -347
- {sandboxy-0.0.3.dist-info → sandboxy-0.0.4.dist-info}/WHEEL +0 -0
- {sandboxy-0.0.3.dist-info → sandboxy-0.0.4.dist-info}/entry_points.txt +0 -0
- {sandboxy-0.0.3.dist-info → sandboxy-0.0.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const a of l)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const a={};return l.integrity&&(a.integrity=l.integrity),l.referrerPolicy&&(a.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?a.credentials="include":l.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(l){if(l.ep)return;l.ep=!0;const a=n(l);fetch(l.href,a)}})();function cm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ec={exports:{}},ws={},_c={exports:{}},H={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var nl=Symbol.for("react.element"),dm=Symbol.for("react.portal"),fm=Symbol.for("react.fragment"),pm=Symbol.for("react.strict_mode"),mm=Symbol.for("react.profiler"),hm=Symbol.for("react.provider"),xm=Symbol.for("react.context"),gm=Symbol.for("react.forward_ref"),vm=Symbol.for("react.suspense"),ym=Symbol.for("react.memo"),jm=Symbol.for("react.lazy"),Bo=Symbol.iterator;function Nm(e){return e===null||typeof e!="object"?null:(e=Bo&&e[Bo]||e["@@iterator"],typeof e=="function"?e:null)}var Rc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Tc=Object.assign,Ac={};function rr(e,t,n){this.props=e,this.context=t,this.refs=Ac,this.updater=n||Rc}rr.prototype.isReactComponent={};rr.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")};rr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Pc(){}Pc.prototype=rr.prototype;function ji(e,t,n){this.props=e,this.context=t,this.refs=Ac,this.updater=n||Rc}var Ni=ji.prototype=new Pc;Ni.constructor=ji;Tc(Ni,rr.prototype);Ni.isPureReactComponent=!0;var Uo=Array.isArray,Lc=Object.prototype.hasOwnProperty,wi={current:null},Mc={key:!0,ref:!0,__self:!0,__source:!0};function Fc(e,t,n){var r,l={},a=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(a=""+t.key),t)Lc.call(t,r)&&!Mc.hasOwnProperty(r)&&(l[r]=t[r]);var o=arguments.length-2;if(o===1)l.children=n;else if(1<o){for(var u=Array(o),c=0;c<o;c++)u[c]=arguments[c+2];l.children=u}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)l[r]===void 0&&(l[r]=o[r]);return{$$typeof:nl,type:e,key:a,ref:i,props:l,_owner:wi.current}}function wm(e,t){return{$$typeof:nl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ki(e){return typeof e=="object"&&e!==null&&e.$$typeof===nl}function km(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ho=/\/+/g;function Bs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?km(""+e.key):t.toString(36)}function Tl(e,t,n,r,l){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case nl:case dm:i=!0}}if(i)return i=e,l=l(i),e=r===""?"."+Bs(i,0):r,Uo(l)?(n="",e!=null&&(n=e.replace(Ho,"$&/")+"/"),Tl(l,t,n,"",function(c){return c})):l!=null&&(ki(l)&&(l=wm(l,n+(!l.key||i&&i.key===l.key?"":(""+l.key).replace(Ho,"$&/")+"/")+e)),t.push(l)),1;if(i=0,r=r===""?".":r+":",Uo(e))for(var o=0;o<e.length;o++){a=e[o];var u=r+Bs(a,o);i+=Tl(a,t,n,u,l)}else if(u=Nm(e),typeof u=="function")for(e=u.call(e),o=0;!(a=e.next()).done;)a=a.value,u=r+Bs(a,o++),i+=Tl(a,t,n,u,l);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function dl(e,t,n){if(e==null)return e;var r=[],l=0;return Tl(e,r,"","",function(a){return t.call(n,a,l++)}),r}function bm(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Te={current:null},Al={transition:null},Sm={ReactCurrentDispatcher:Te,ReactCurrentBatchConfig:Al,ReactCurrentOwner:wi};function Oc(){throw Error("act(...) is not supported in production builds of React.")}H.Children={map:dl,forEach:function(e,t,n){dl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return dl(e,function(){t++}),t},toArray:function(e){return dl(e,function(t){return t})||[]},only:function(e){if(!ki(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};H.Component=rr;H.Fragment=fm;H.Profiler=mm;H.PureComponent=ji;H.StrictMode=pm;H.Suspense=vm;H.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Sm;H.act=Oc;H.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Tc({},e.props),l=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=wi.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)Lc.call(t,u)&&!Mc.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&o!==void 0?o[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){o=Array(u);for(var c=0;c<u;c++)o[c]=arguments[c+2];r.children=o}return{$$typeof:nl,type:e.type,key:l,ref:a,props:r,_owner:i}};H.createContext=function(e){return e={$$typeof:xm,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:hm,_context:e},e.Consumer=e};H.createElement=Fc;H.createFactory=function(e){var t=Fc.bind(null,e);return t.type=e,t};H.createRef=function(){return{current:null}};H.forwardRef=function(e){return{$$typeof:gm,render:e}};H.isValidElement=ki;H.lazy=function(e){return{$$typeof:jm,_payload:{_status:-1,_result:e},_init:bm}};H.memo=function(e,t){return{$$typeof:ym,type:e,compare:t===void 0?null:t}};H.startTransition=function(e){var t=Al.transition;Al.transition={};try{e()}finally{Al.transition=t}};H.unstable_act=Oc;H.useCallback=function(e,t){return Te.current.useCallback(e,t)};H.useContext=function(e){return Te.current.useContext(e)};H.useDebugValue=function(){};H.useDeferredValue=function(e){return Te.current.useDeferredValue(e)};H.useEffect=function(e,t){return Te.current.useEffect(e,t)};H.useId=function(){return Te.current.useId()};H.useImperativeHandle=function(e,t,n){return Te.current.useImperativeHandle(e,t,n)};H.useInsertionEffect=function(e,t){return Te.current.useInsertionEffect(e,t)};H.useLayoutEffect=function(e,t){return Te.current.useLayoutEffect(e,t)};H.useMemo=function(e,t){return Te.current.useMemo(e,t)};H.useReducer=function(e,t,n){return Te.current.useReducer(e,t,n)};H.useRef=function(e){return Te.current.useRef(e)};H.useState=function(e){return Te.current.useState(e)};H.useSyncExternalStore=function(e,t,n){return Te.current.useSyncExternalStore(e,t,n)};H.useTransition=function(){return Te.current.useTransition()};H.version="18.3.1";_c.exports=H;var m=_c.exports;const Cm=cm(m);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Em=m,_m=Symbol.for("react.element"),Rm=Symbol.for("react.fragment"),Tm=Object.prototype.hasOwnProperty,Am=Em.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Pm={key:!0,ref:!0,__self:!0,__source:!0};function zc(e,t,n){var r,l={},a=null,i=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)Tm.call(t,r)&&!Pm.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:_m,type:e,key:a,ref:i,props:l,_owner:Am.current}}ws.Fragment=Rm;ws.jsx=zc;ws.jsxs=zc;Ec.exports=ws;var s=Ec.exports,ya={},Dc={exports:{}},Qe={},Ic={exports:{}},$c={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(w,b){var R=w.length;w.push(b);e:for(;0<R;){var M=R-1>>>1,I=w[M];if(0<l(I,b))w[M]=b,w[R]=I,R=M;else break e}}function n(w){return w.length===0?null:w[0]}function r(w){if(w.length===0)return null;var b=w[0],R=w.pop();if(R!==b){w[0]=R;e:for(var M=0,I=w.length,X=I>>>1;M<X;){var J=2*(M+1)-1,lt=w[J],Pe=J+1,st=w[Pe];if(0>l(lt,R))Pe<I&&0>l(st,lt)?(w[M]=st,w[Pe]=R,M=Pe):(w[M]=lt,w[J]=R,M=J);else if(Pe<I&&0>l(st,R))w[M]=st,w[Pe]=R,M=Pe;else break e}}return b}function l(w,b){var R=w.sortIndex-b.sortIndex;return R!==0?R:w.id-b.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var u=[],c=[],p=1,f=null,x=3,y=!1,N=!1,v=!1,j=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(w){for(var b=n(c);b!==null;){if(b.callback===null)r(c);else if(b.startTime<=w)r(c),b.sortIndex=b.expirationTime,t(u,b);else break;b=n(c)}}function S(w){if(v=!1,g(w),!N)if(n(u)!==null)N=!0,C(k);else{var b=n(c);b!==null&&E(S,b.startTime-w)}}function k(w,b){N=!1,v&&(v=!1,h(L),L=-1),y=!0;var R=x;try{for(g(b),f=n(u);f!==null&&(!(f.expirationTime>b)||w&&!U());){var M=f.callback;if(typeof M=="function"){f.callback=null,x=f.priorityLevel;var I=M(f.expirationTime<=b);b=e.unstable_now(),typeof I=="function"?f.callback=I:f===n(u)&&r(u),g(b)}else r(u);f=n(u)}if(f!==null)var X=!0;else{var J=n(c);J!==null&&E(S,J.startTime-b),X=!1}return X}finally{f=null,x=R,y=!1}}var T=!1,A=null,L=-1,O=5,F=-1;function U(){return!(e.unstable_now()-F<O)}function Y(){if(A!==null){var w=e.unstable_now();F=w;var b=!0;try{b=A(!0,w)}finally{b?re():(T=!1,A=null)}}else T=!1}var re;if(typeof d=="function")re=function(){d(Y)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,_=le.port2;le.port1.onmessage=Y,re=function(){_.postMessage(null)}}else re=function(){j(Y,0)};function C(w){A=w,T||(T=!0,re())}function E(w,b){L=j(function(){w(e.unstable_now())},b)}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(w){w.callback=null},e.unstable_continueExecution=function(){N||y||(N=!0,C(k))},e.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(w){switch(x){case 1:case 2:case 3:var b=3;break;default:b=x}var R=x;x=b;try{return w()}finally{x=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(w,b){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var R=x;x=w;try{return b()}finally{x=R}},e.unstable_scheduleCallback=function(w,b,R){var M=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?M+R:M):R=M,w){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=R+I,w={id:p++,callback:b,priorityLevel:w,startTime:R,expirationTime:I,sortIndex:-1},R>M?(w.sortIndex=R,t(c,w),n(u)===null&&w===n(c)&&(v?(h(L),L=-1):v=!0,E(S,R-M))):(w.sortIndex=I,t(u,w),N||y||(N=!0,C(k))),w},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(w){var b=x;return function(){var R=x;x=b;try{return w.apply(this,arguments)}finally{x=R}}}})($c);Ic.exports=$c;var Lm=Ic.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Mm=m,Ye=Lm;function P(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 Bc=new Set,Ar={};function wn(e,t){qn(e,t),qn(e+"Capture",t)}function qn(e,t){for(Ar[e]=t,e=0;e<t.length;e++)Bc.add(t[e])}var _t=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,Fm=/^[: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]*$/,Vo={},Wo={};function Om(e){return ja.call(Wo,e)?!0:ja.call(Vo,e)?!1:Fm.test(e)?Wo[e]=!0:(Vo[e]=!0,!1)}function zm(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Dm(e,t,n,r){if(t===null||typeof t>"u"||zm(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ae(e,t,n,r,l,a,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ye[e]=new Ae(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ye[t]=new Ae(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ye[e]=new Ae(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ye[e]=new Ae(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){ye[e]=new Ae(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ye[e]=new Ae(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ye[e]=new Ae(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ye[e]=new Ae(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ye[e]=new Ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var bi=/[\-:]([a-z])/g;function Si(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(bi,Si);ye[t]=new Ae(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(bi,Si);ye[t]=new Ae(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(bi,Si);ye[t]=new Ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ye[e]=new Ae(e,1,!1,e.toLowerCase(),null,!1,!1)});ye.xlinkHref=new Ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ye[e]=new Ae(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ci(e,t,n,r){var l=ye.hasOwnProperty(t)?ye[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Dm(t,n,l,r)&&(n=null),r||l===null?Om(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=n===null?l.type===3?!1:"":n:(t=l.attributeName,r=l.attributeNamespace,n===null?e.removeAttribute(t):(l=l.type,n=l===3||l===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Mt=Mm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,fl=Symbol.for("react.element"),_n=Symbol.for("react.portal"),Rn=Symbol.for("react.fragment"),Ei=Symbol.for("react.strict_mode"),Na=Symbol.for("react.profiler"),Uc=Symbol.for("react.provider"),Hc=Symbol.for("react.context"),_i=Symbol.for("react.forward_ref"),wa=Symbol.for("react.suspense"),ka=Symbol.for("react.suspense_list"),Ri=Symbol.for("react.memo"),Dt=Symbol.for("react.lazy"),Vc=Symbol.for("react.offscreen"),Yo=Symbol.iterator;function or(e){return e===null||typeof e!="object"?null:(e=Yo&&e[Yo]||e["@@iterator"],typeof e=="function"?e:null)}var ne=Object.assign,Us;function gr(e){if(Us===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Us=t&&t[1]||""}return`
|
|
34
|
+
`+Us+e}var Hs=!1;function Vs(e,t){if(!e||Hs)return"";Hs=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var l=c.stack.split(`
|
|
35
|
+
`),a=r.stack.split(`
|
|
36
|
+
`),i=l.length-1,o=a.length-1;1<=i&&0<=o&&l[i]!==a[o];)o--;for(;1<=i&&0<=o;i--,o--)if(l[i]!==a[o]){if(i!==1||o!==1)do if(i--,o--,0>o||l[i]!==a[o]){var u=`
|
|
37
|
+
`+l[i].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=i&&0<=o);break}}}finally{Hs=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?gr(e):""}function Im(e){switch(e.tag){case 5:return gr(e.type);case 16:return gr("Lazy");case 13:return gr("Suspense");case 19:return gr("SuspenseList");case 0:case 2:case 15:return e=Vs(e.type,!1),e;case 11:return e=Vs(e.type.render,!1),e;case 1:return e=Vs(e.type,!0),e;default:return""}}function ba(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 Rn:return"Fragment";case _n:return"Portal";case Na:return"Profiler";case Ei:return"StrictMode";case wa:return"Suspense";case ka:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Hc:return(e.displayName||"Context")+".Consumer";case Uc:return(e._context.displayName||"Context")+".Provider";case _i:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ri:return t=e.displayName||null,t!==null?t:ba(e.type)||"Memo";case Dt:t=e._payload,e=e._init;try{return ba(e(t))}catch{}}return null}function $m(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ba(t);case 8:return t===Ei?"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 Zt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bm(e){var t=Wc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pl(e){e._valueTracker||(e._valueTracker=Bm(e))}function Yc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Sa(e,t){var n=t.checked;return ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Qo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Zt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qc(e,t){t=t.checked,t!=null&&Ci(e,"checked",t,!1)}function Ca(e,t){Qc(e,t);var n=Zt(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")?Ea(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ea(e,t.type,Zt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function qo(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 Ea(e,t,n){(t!=="number"||Vl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vr=Array.isArray;function Un(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Zt(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,r&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function _a(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(P(91));return ne({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ko(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(P(92));if(vr(n)){if(1<n.length)throw Error(P(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Zt(n)}}function qc(e,t){var n=Zt(t.value),r=Zt(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 Jo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Kc(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 Ra(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Kc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ml,Jc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,l)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ml=ml||document.createElement("div"),ml.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ml.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var wr={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},Um=["Webkit","ms","Moz","O"];Object.keys(wr).forEach(function(e){Um.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wr[t]=wr[e]})});function Gc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||wr.hasOwnProperty(e)&&wr[e]?(""+t).trim():t+"px"}function Xc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Gc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Hm=ne({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 Ta(e,t){if(t){if(Hm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(P(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(P(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(P(61))}if(t.style!=null&&typeof t.style!="object")throw Error(P(62))}}function Aa(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 Pa=null;function Ti(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var La=null,Hn=null,Vn=null;function Go(e){if(e=sl(e)){if(typeof La!="function")throw Error(P(280));var t=e.stateNode;t&&(t=Es(t),La(e.stateNode,e.type,t))}}function Zc(e){Hn?Vn?Vn.push(e):Vn=[e]:Hn=e}function ed(){if(Hn){var e=Hn,t=Vn;if(Vn=Hn=null,Go(e),t)for(e=0;e<t.length;e++)Go(t[e])}}function td(e,t){return e(t)}function nd(){}var Ws=!1;function rd(e,t,n){if(Ws)return e(t,n);Ws=!0;try{return td(e,t,n)}finally{Ws=!1,(Hn!==null||Vn!==null)&&(nd(),ed())}}function Lr(e,t){var n=e.stateNode;if(n===null)return null;var r=Es(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(P(231,t,typeof n));return n}var Ma=!1;if(_t)try{var ur={};Object.defineProperty(ur,"passive",{get:function(){Ma=!0}}),window.addEventListener("test",ur,ur),window.removeEventListener("test",ur,ur)}catch{Ma=!1}function Vm(e,t,n,r,l,a,i,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(p){this.onError(p)}}var kr=!1,Wl=null,Yl=!1,Fa=null,Wm={onError:function(e){kr=!0,Wl=e}};function Ym(e,t,n,r,l,a,i,o,u){kr=!1,Wl=null,Vm.apply(Wm,arguments)}function Qm(e,t,n,r,l,a,i,o,u){if(Ym.apply(this,arguments),kr){if(kr){var c=Wl;kr=!1,Wl=null}else throw Error(P(198));Yl||(Yl=!0,Fa=c)}}function kn(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 ld(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 Xo(e){if(kn(e)!==e)throw Error(P(188))}function qm(e){var t=e.alternate;if(!t){if(t=kn(e),t===null)throw Error(P(188));return t!==e?null:e}for(var n=e,r=t;;){var l=n.return;if(l===null)break;var a=l.alternate;if(a===null){if(r=l.return,r!==null){n=r;continue}break}if(l.child===a.child){for(a=l.child;a;){if(a===n)return Xo(l),e;if(a===r)return Xo(l),t;a=a.sibling}throw Error(P(188))}if(n.return!==r.return)n=l,r=a;else{for(var i=!1,o=l.child;o;){if(o===n){i=!0,n=l,r=a;break}if(o===r){i=!0,r=l,n=a;break}o=o.sibling}if(!i){for(o=a.child;o;){if(o===n){i=!0,n=a,r=l;break}if(o===r){i=!0,r=a,n=l;break}o=o.sibling}if(!i)throw Error(P(189))}}if(n.alternate!==r)throw Error(P(190))}if(n.tag!==3)throw Error(P(188));return n.stateNode.current===n?e:t}function sd(e){return e=qm(e),e!==null?ad(e):null}function ad(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ad(e);if(t!==null)return t;e=e.sibling}return null}var id=Ye.unstable_scheduleCallback,Zo=Ye.unstable_cancelCallback,Km=Ye.unstable_shouldYield,Jm=Ye.unstable_requestPaint,ie=Ye.unstable_now,Gm=Ye.unstable_getCurrentPriorityLevel,Ai=Ye.unstable_ImmediatePriority,od=Ye.unstable_UserBlockingPriority,Ql=Ye.unstable_NormalPriority,Xm=Ye.unstable_LowPriority,ud=Ye.unstable_IdlePriority,ks=null,gt=null;function Zm(e){if(gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(ks,e,void 0,(e.current.flags&128)===128)}catch{}}var ct=Math.clz32?Math.clz32:n0,e0=Math.log,t0=Math.LN2;function n0(e){return e>>>=0,e===0?32:31-(e0(e)/t0|0)|0}var hl=64,xl=4194304;function yr(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 ql(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,a=e.pingedLanes,i=n&268435455;if(i!==0){var o=i&~l;o!==0?r=yr(o):(a&=i,a!==0&&(r=yr(a)))}else i=n&~l,i!==0?r=yr(i):a!==0&&(r=yr(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,a=t&-t,l>=a||l===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ct(t),l=1<<n,r|=e[n],t&=~l;return r}function r0(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 l0(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-ct(a),o=1<<i,u=l[i];u===-1?(!(o&n)||o&r)&&(l[i]=r0(o,t)):u<=t&&(e.expiredLanes|=o),a&=~o}}function Oa(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function cd(){var e=hl;return hl<<=1,!(hl&4194240)&&(hl=64),e}function Ys(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rl(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 s0(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 l=31-ct(n),a=1<<l;t[l]=0,r[l]=-1,e[l]=-1,n&=~a}}function Pi(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ct(n),l=1<<r;l&t|e[r]&t&&(e[r]|=t),n&=~l}}var W=0;function dd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var fd,Li,pd,md,hd,za=!1,gl=[],Vt=null,Wt=null,Yt=null,Mr=new Map,Fr=new Map,$t=[],a0="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 eu(e,t){switch(e){case"focusin":case"focusout":Vt=null;break;case"dragenter":case"dragleave":Wt=null;break;case"mouseover":case"mouseout":Yt=null;break;case"pointerover":case"pointerout":Mr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fr.delete(t.pointerId)}}function cr(e,t,n,r,l,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[l]},t!==null&&(t=sl(t),t!==null&&Li(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function i0(e,t,n,r,l){switch(t){case"focusin":return Vt=cr(Vt,e,t,n,r,l),!0;case"dragenter":return Wt=cr(Wt,e,t,n,r,l),!0;case"mouseover":return Yt=cr(Yt,e,t,n,r,l),!0;case"pointerover":var a=l.pointerId;return Mr.set(a,cr(Mr.get(a)||null,e,t,n,r,l)),!0;case"gotpointercapture":return a=l.pointerId,Fr.set(a,cr(Fr.get(a)||null,e,t,n,r,l)),!0}return!1}function xd(e){var t=un(e.target);if(t!==null){var n=kn(t);if(n!==null){if(t=n.tag,t===13){if(t=ld(n),t!==null){e.blockedOn=t,hd(e.priority,function(){pd(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 Pl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Da(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Pa=r,n.target.dispatchEvent(r),Pa=null}else return t=sl(n),t!==null&&Li(t),e.blockedOn=n,!1;t.shift()}return!0}function tu(e,t,n){Pl(e)&&n.delete(t)}function o0(){za=!1,Vt!==null&&Pl(Vt)&&(Vt=null),Wt!==null&&Pl(Wt)&&(Wt=null),Yt!==null&&Pl(Yt)&&(Yt=null),Mr.forEach(tu),Fr.forEach(tu)}function dr(e,t){e.blockedOn===t&&(e.blockedOn=null,za||(za=!0,Ye.unstable_scheduleCallback(Ye.unstable_NormalPriority,o0)))}function Or(e){function t(l){return dr(l,e)}if(0<gl.length){dr(gl[0],e);for(var n=1;n<gl.length;n++){var r=gl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Vt!==null&&dr(Vt,e),Wt!==null&&dr(Wt,e),Yt!==null&&dr(Yt,e),Mr.forEach(t),Fr.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);)xd(n),n.blockedOn===null&&$t.shift()}var Wn=Mt.ReactCurrentBatchConfig,Kl=!0;function u0(e,t,n,r){var l=W,a=Wn.transition;Wn.transition=null;try{W=1,Mi(e,t,n,r)}finally{W=l,Wn.transition=a}}function c0(e,t,n,r){var l=W,a=Wn.transition;Wn.transition=null;try{W=4,Mi(e,t,n,r)}finally{W=l,Wn.transition=a}}function Mi(e,t,n,r){if(Kl){var l=Da(e,t,n,r);if(l===null)na(e,t,r,Jl,n),eu(e,r);else if(i0(l,e,t,n,r))r.stopPropagation();else if(eu(e,r),t&4&&-1<a0.indexOf(e)){for(;l!==null;){var a=sl(l);if(a!==null&&fd(a),a=Da(e,t,n,r),a===null&&na(e,t,r,Jl,n),a===l)break;l=a}l!==null&&r.stopPropagation()}else na(e,t,r,null,n)}}var Jl=null;function Da(e,t,n,r){if(Jl=null,e=Ti(r),e=un(e),e!==null)if(t=kn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ld(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 Jl=e,null}function gd(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(Gm()){case Ai:return 1;case od:return 4;case Ql:case Xm:return 16;case ud:return 536870912;default:return 16}default:return 16}}var Ut=null,Fi=null,Ll=null;function vd(){if(Ll)return Ll;var e,t=Fi,n=t.length,r,l="value"in Ut?Ut.value:Ut.textContent,a=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===l[a-r];r++);return Ll=l.slice(e,1<r?1-r:void 0)}function Ml(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 vl(){return!0}function nu(){return!1}function qe(e){function t(n,r,l,a,i){this._reactName=n,this._targetInst=l,this.type=r,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(a):a[o]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?vl:nu,this.isPropagationStopped=nu,this}return ne(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=vl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=vl)},persist:function(){},isPersistent:vl}),t}var lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oi=qe(lr),ll=ne({},lr,{view:0,detail:0}),d0=qe(ll),Qs,qs,fr,bs=ne({},ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zi,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!==fr&&(fr&&e.type==="mousemove"?(Qs=e.screenX-fr.screenX,qs=e.screenY-fr.screenY):qs=Qs=0,fr=e),Qs)},movementY:function(e){return"movementY"in e?e.movementY:qs}}),ru=qe(bs),f0=ne({},bs,{dataTransfer:0}),p0=qe(f0),m0=ne({},ll,{relatedTarget:0}),Ks=qe(m0),h0=ne({},lr,{animationName:0,elapsedTime:0,pseudoElement:0}),x0=qe(h0),g0=ne({},lr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),v0=qe(g0),y0=ne({},lr,{data:0}),lu=qe(y0),j0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},N0={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"},w0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function k0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=w0[e])?!!t[e]:!1}function zi(){return k0}var b0=ne({},ll,{key:function(e){if(e.key){var t=j0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ml(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?N0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zi,charCode:function(e){return e.type==="keypress"?Ml(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ml(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),S0=qe(b0),C0=ne({},bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),su=qe(C0),E0=ne({},ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zi}),_0=qe(E0),R0=ne({},lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),T0=qe(R0),A0=ne({},bs,{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}),P0=qe(A0),L0=[9,13,27,32],Di=_t&&"CompositionEvent"in window,br=null;_t&&"documentMode"in document&&(br=document.documentMode);var M0=_t&&"TextEvent"in window&&!br,yd=_t&&(!Di||br&&8<br&&11>=br),au=" ",iu=!1;function jd(e,t){switch(e){case"keyup":return L0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tn=!1;function F0(e,t){switch(e){case"compositionend":return Nd(t);case"keypress":return t.which!==32?null:(iu=!0,au);case"textInput":return e=t.data,e===au&&iu?null:e;default:return null}}function O0(e,t){if(Tn)return e==="compositionend"||!Di&&jd(e,t)?(e=vd(),Ll=Fi=Ut=null,Tn=!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 yd&&t.locale!=="ko"?null:t.data;default:return null}}var z0={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 ou(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!z0[e.type]:t==="textarea"}function wd(e,t,n,r){Zc(r),t=Gl(t,"onChange"),0<t.length&&(n=new Oi("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Sr=null,zr=null;function D0(e){Ld(e,0)}function Ss(e){var t=Ln(e);if(Yc(t))return e}function I0(e,t){if(e==="change")return t}var kd=!1;if(_t){var Js;if(_t){var Gs="oninput"in document;if(!Gs){var uu=document.createElement("div");uu.setAttribute("oninput","return;"),Gs=typeof uu.oninput=="function"}Js=Gs}else Js=!1;kd=Js&&(!document.documentMode||9<document.documentMode)}function cu(){Sr&&(Sr.detachEvent("onpropertychange",bd),zr=Sr=null)}function bd(e){if(e.propertyName==="value"&&Ss(zr)){var t=[];wd(t,zr,e,Ti(e)),rd(D0,t)}}function $0(e,t,n){e==="focusin"?(cu(),Sr=t,zr=n,Sr.attachEvent("onpropertychange",bd)):e==="focusout"&&cu()}function B0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ss(zr)}function U0(e,t){if(e==="click")return Ss(t)}function H0(e,t){if(e==="input"||e==="change")return Ss(t)}function V0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ft=typeof Object.is=="function"?Object.is:V0;function Dr(e,t){if(ft(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var l=n[r];if(!ja.call(t,l)||!ft(e[l],t[l]))return!1}return!0}function du(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fu(e,t){var n=du(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=du(n)}}function Sd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cd(){for(var e=window,t=Vl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vl(e.document)}return t}function Ii(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 W0(e){var t=Cd(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Sd(n.ownerDocument.documentElement,n)){if(r!==null&&Ii(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 l=n.textContent.length,a=Math.min(r.start,l);r=r.end===void 0?a:Math.min(r.end,l),!e.extend&&a>r&&(l=r,r=a,a=l),l=fu(n,a);var i=fu(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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 Y0=_t&&"documentMode"in document&&11>=document.documentMode,An=null,Ia=null,Cr=null,$a=!1;function pu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$a||An==null||An!==Vl(r)||(r=An,"selectionStart"in r&&Ii(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}),Cr&&Dr(Cr,r)||(Cr=r,r=Gl(Ia,"onSelect"),0<r.length&&(t=new Oi("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=An)))}function yl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Pn={animationend:yl("Animation","AnimationEnd"),animationiteration:yl("Animation","AnimationIteration"),animationstart:yl("Animation","AnimationStart"),transitionend:yl("Transition","TransitionEnd")},Xs={},Ed={};_t&&(Ed=document.createElement("div").style,"AnimationEvent"in window||(delete Pn.animationend.animation,delete Pn.animationiteration.animation,delete Pn.animationstart.animation),"TransitionEvent"in window||delete Pn.transitionend.transition);function Cs(e){if(Xs[e])return Xs[e];if(!Pn[e])return e;var t=Pn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ed)return Xs[e]=t[n];return e}var _d=Cs("animationend"),Rd=Cs("animationiteration"),Td=Cs("animationstart"),Ad=Cs("transitionend"),Pd=new Map,mu="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 rn(e,t){Pd.set(e,t),wn(t,[e])}for(var Zs=0;Zs<mu.length;Zs++){var ea=mu[Zs],Q0=ea.toLowerCase(),q0=ea[0].toUpperCase()+ea.slice(1);rn(Q0,"on"+q0)}rn(_d,"onAnimationEnd");rn(Rd,"onAnimationIteration");rn(Td,"onAnimationStart");rn("dblclick","onDoubleClick");rn("focusin","onFocus");rn("focusout","onBlur");rn(Ad,"onTransitionEnd");qn("onMouseEnter",["mouseout","mouseover"]);qn("onMouseLeave",["mouseout","mouseover"]);qn("onPointerEnter",["pointerout","pointerover"]);qn("onPointerLeave",["pointerout","pointerover"]);wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wn("onBeforeInput",["compositionend","keypress","textInput","paste"]);wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jr="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(" "),K0=new Set("cancel close invalid load scroll toggle".split(" ").concat(jr));function hu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Qm(r,t,void 0,e),e.currentTarget=null}function Ld(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],l=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var o=r[i],u=o.instance,c=o.currentTarget;if(o=o.listener,u!==a&&l.isPropagationStopped())break e;hu(l,o,c),a=u}else for(i=0;i<r.length;i++){if(o=r[i],u=o.instance,c=o.currentTarget,o=o.listener,u!==a&&l.isPropagationStopped())break e;hu(l,o,c),a=u}}}if(Yl)throw e=Fa,Yl=!1,Fa=null,e}function q(e,t){var n=t[Wa];n===void 0&&(n=t[Wa]=new Set);var r=e+"__bubble";n.has(r)||(Md(t,e,2,!1),n.add(r))}function ta(e,t,n){var r=0;t&&(r|=4),Md(n,e,r,t)}var jl="_reactListening"+Math.random().toString(36).slice(2);function Ir(e){if(!e[jl]){e[jl]=!0,Bc.forEach(function(n){n!=="selectionchange"&&(K0.has(n)||ta(n,!1,e),ta(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jl]||(t[jl]=!0,ta("selectionchange",!1,t))}}function Md(e,t,n,r){switch(gd(t)){case 1:var l=u0;break;case 4:l=c0;break;default:l=Mi}n=l.bind(null,t,n,e),l=void 0,!Ma||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),r?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function na(e,t,n,r,l){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var o=r.stateNode.containerInfo;if(o===l||o.nodeType===8&&o.parentNode===l)break;if(i===4)for(i=r.return;i!==null;){var u=i.tag;if((u===3||u===4)&&(u=i.stateNode.containerInfo,u===l||u.nodeType===8&&u.parentNode===l))return;i=i.return}for(;o!==null;){if(i=un(o),i===null)return;if(u=i.tag,u===5||u===6){r=a=i;continue e}o=o.parentNode}}r=r.return}rd(function(){var c=a,p=Ti(n),f=[];e:{var x=Pd.get(e);if(x!==void 0){var y=Oi,N=e;switch(e){case"keypress":if(Ml(n)===0)break e;case"keydown":case"keyup":y=S0;break;case"focusin":N="focus",y=Ks;break;case"focusout":N="blur",y=Ks;break;case"beforeblur":case"afterblur":y=Ks;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=ru;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=p0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=_0;break;case _d:case Rd:case Td:y=x0;break;case Ad:y=T0;break;case"scroll":y=d0;break;case"wheel":y=P0;break;case"copy":case"cut":case"paste":y=v0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=su}var v=(t&4)!==0,j=!v&&e==="scroll",h=v?x!==null?x+"Capture":null:x;v=[];for(var d=c,g;d!==null;){g=d;var S=g.stateNode;if(g.tag===5&&S!==null&&(g=S,h!==null&&(S=Lr(d,h),S!=null&&v.push($r(d,S,g)))),j)break;d=d.return}0<v.length&&(x=new y(x,N,null,n,p),f.push({event:x,listeners:v}))}}if(!(t&7)){e:{if(x=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",x&&n!==Pa&&(N=n.relatedTarget||n.fromElement)&&(un(N)||N[Rt]))break e;if((y||x)&&(x=p.window===p?p:(x=p.ownerDocument)?x.defaultView||x.parentWindow:window,y?(N=n.relatedTarget||n.toElement,y=c,N=N?un(N):null,N!==null&&(j=kn(N),N!==j||N.tag!==5&&N.tag!==6)&&(N=null)):(y=null,N=c),y!==N)){if(v=ru,S="onMouseLeave",h="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(v=su,S="onPointerLeave",h="onPointerEnter",d="pointer"),j=y==null?x:Ln(y),g=N==null?x:Ln(N),x=new v(S,d+"leave",y,n,p),x.target=j,x.relatedTarget=g,S=null,un(p)===c&&(v=new v(h,d+"enter",N,n,p),v.target=g,v.relatedTarget=j,S=v),j=S,y&&N)t:{for(v=y,h=N,d=0,g=v;g;g=Sn(g))d++;for(g=0,S=h;S;S=Sn(S))g++;for(;0<d-g;)v=Sn(v),d--;for(;0<g-d;)h=Sn(h),g--;for(;d--;){if(v===h||h!==null&&v===h.alternate)break t;v=Sn(v),h=Sn(h)}v=null}else v=null;y!==null&&xu(f,x,y,v,!1),N!==null&&j!==null&&xu(f,j,N,v,!0)}}e:{if(x=c?Ln(c):window,y=x.nodeName&&x.nodeName.toLowerCase(),y==="select"||y==="input"&&x.type==="file")var k=I0;else if(ou(x))if(kd)k=H0;else{k=B0;var T=$0}else(y=x.nodeName)&&y.toLowerCase()==="input"&&(x.type==="checkbox"||x.type==="radio")&&(k=U0);if(k&&(k=k(e,c))){wd(f,k,n,p);break e}T&&T(e,x,c),e==="focusout"&&(T=x._wrapperState)&&T.controlled&&x.type==="number"&&Ea(x,"number",x.value)}switch(T=c?Ln(c):window,e){case"focusin":(ou(T)||T.contentEditable==="true")&&(An=T,Ia=c,Cr=null);break;case"focusout":Cr=Ia=An=null;break;case"mousedown":$a=!0;break;case"contextmenu":case"mouseup":case"dragend":$a=!1,pu(f,n,p);break;case"selectionchange":if(Y0)break;case"keydown":case"keyup":pu(f,n,p)}var A;if(Di)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else Tn?jd(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(yd&&n.locale!=="ko"&&(Tn||L!=="onCompositionStart"?L==="onCompositionEnd"&&Tn&&(A=vd()):(Ut=p,Fi="value"in Ut?Ut.value:Ut.textContent,Tn=!0)),T=Gl(c,L),0<T.length&&(L=new lu(L,e,null,n,p),f.push({event:L,listeners:T}),A?L.data=A:(A=Nd(n),A!==null&&(L.data=A)))),(A=M0?F0(e,n):O0(e,n))&&(c=Gl(c,"onBeforeInput"),0<c.length&&(p=new lu("onBeforeInput","beforeinput",null,n,p),f.push({event:p,listeners:c}),p.data=A))}Ld(f,t)})}function $r(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Gl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,a=l.stateNode;l.tag===5&&a!==null&&(l=a,a=Lr(e,n),a!=null&&r.unshift($r(e,a,l)),a=Lr(e,t),a!=null&&r.push($r(e,a,l))),e=e.return}return r}function Sn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xu(e,t,n,r,l){for(var a=t._reactName,i=[];n!==null&&n!==r;){var o=n,u=o.alternate,c=o.stateNode;if(u!==null&&u===r)break;o.tag===5&&c!==null&&(o=c,l?(u=Lr(n,a),u!=null&&i.unshift($r(n,u,o))):l||(u=Lr(n,a),u!=null&&i.push($r(n,u,o)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var J0=/\r\n?/g,G0=/\u0000|\uFFFD/g;function gu(e){return(typeof e=="string"?e:""+e).replace(J0,`
|
|
38
|
+
`).replace(G0,"")}function Nl(e,t,n){if(t=gu(t),gu(e)!==t&&n)throw Error(P(425))}function Xl(){}var Ba=null,Ua=null;function Ha(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 Va=typeof setTimeout=="function"?setTimeout:void 0,X0=typeof clearTimeout=="function"?clearTimeout:void 0,vu=typeof Promise=="function"?Promise:void 0,Z0=typeof queueMicrotask=="function"?queueMicrotask:typeof vu<"u"?function(e){return vu.resolve(null).then(e).catch(eh)}:Va;function eh(e){setTimeout(function(){throw e})}function ra(e,t){var n=t,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(r===0){e.removeChild(l),Or(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);Or(t)}function Qt(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 yu(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 sr=Math.random().toString(36).slice(2),xt="__reactFiber$"+sr,Br="__reactProps$"+sr,Rt="__reactContainer$"+sr,Wa="__reactEvents$"+sr,th="__reactListeners$"+sr,nh="__reactHandles$"+sr;function un(e){var t=e[xt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Rt]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=yu(e);e!==null;){if(n=e[xt])return n;e=yu(e)}return t}e=n,n=e.parentNode}return null}function sl(e){return e=e[xt]||e[Rt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ln(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(P(33))}function Es(e){return e[Br]||null}var Ya=[],Mn=-1;function ln(e){return{current:e}}function K(e){0>Mn||(e.current=Ya[Mn],Ya[Mn]=null,Mn--)}function Q(e,t){Mn++,Ya[Mn]=e.current,e.current=t}var en={},be=ln(en),ze=ln(!1),xn=en;function Kn(e,t){var n=e.type.contextTypes;if(!n)return en;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},a;for(a in n)l[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function De(e){return e=e.childContextTypes,e!=null}function Zl(){K(ze),K(be)}function ju(e,t,n){if(be.current!==en)throw Error(P(168));Q(be,t),Q(ze,n)}function Fd(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(P(108,$m(e)||"Unknown",l));return ne({},n,r)}function es(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||en,xn=be.current,Q(be,e),Q(ze,ze.current),!0}function Nu(e,t,n){var r=e.stateNode;if(!r)throw Error(P(169));n?(e=Fd(e,t,xn),r.__reactInternalMemoizedMergedChildContext=e,K(ze),K(be),Q(be,e)):K(ze),Q(ze,n)}var kt=null,_s=!1,la=!1;function Od(e){kt===null?kt=[e]:kt.push(e)}function rh(e){_s=!0,Od(e)}function sn(){if(!la&&kt!==null){la=!0;var e=0,t=W;try{var n=kt;for(W=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}kt=null,_s=!1}catch(l){throw kt!==null&&(kt=kt.slice(e+1)),id(Ai,sn),l}finally{W=t,la=!1}}return null}var Fn=[],On=0,ts=null,ns=0,Ke=[],Je=0,gn=null,bt=1,St="";function an(e,t){Fn[On++]=ns,Fn[On++]=ts,ts=e,ns=t}function zd(e,t,n){Ke[Je++]=bt,Ke[Je++]=St,Ke[Je++]=gn,gn=e;var r=bt;e=St;var l=32-ct(r)-1;r&=~(1<<l),n+=1;var a=32-ct(t)+l;if(30<a){var i=l-l%5;a=(r&(1<<i)-1).toString(32),r>>=i,l-=i,bt=1<<32-ct(t)+l|n<<l|r,St=a+e}else bt=1<<a|n<<l|r,St=e}function $i(e){e.return!==null&&(an(e,1),zd(e,1,0))}function Bi(e){for(;e===ts;)ts=Fn[--On],Fn[On]=null,ns=Fn[--On],Fn[On]=null;for(;e===gn;)gn=Ke[--Je],Ke[Je]=null,St=Ke[--Je],Ke[Je]=null,bt=Ke[--Je],Ke[Je]=null}var We=null,Ve=null,G=!1,ut=null;function Dd(e,t){var n=Ge(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 wu(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,We=e,Ve=Qt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,We=e,Ve=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=gn!==null?{id:bt,overflow:St}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ge(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,We=e,Ve=null,!0):!1;default:return!1}}function Qa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function qa(e){if(G){var t=Ve;if(t){var n=t;if(!wu(e,t)){if(Qa(e))throw Error(P(418));t=Qt(n.nextSibling);var r=We;t&&wu(e,t)?Dd(r,n):(e.flags=e.flags&-4097|2,G=!1,We=e)}}else{if(Qa(e))throw Error(P(418));e.flags=e.flags&-4097|2,G=!1,We=e}}}function ku(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;We=e}function wl(e){if(e!==We)return!1;if(!G)return ku(e),G=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ha(e.type,e.memoizedProps)),t&&(t=Ve)){if(Qa(e))throw Id(),Error(P(418));for(;t;)Dd(e,t),t=Qt(t.nextSibling)}if(ku(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ve=Qt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ve=null}}else Ve=We?Qt(e.stateNode.nextSibling):null;return!0}function Id(){for(var e=Ve;e;)e=Qt(e.nextSibling)}function Jn(){Ve=We=null,G=!1}function Ui(e){ut===null?ut=[e]:ut.push(e)}var lh=Mt.ReactCurrentBatchConfig;function pr(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(P(309));var r=n.stateNode}if(!r)throw Error(P(147,e));var l=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(i){var o=l.refs;i===null?delete o[a]:o[a]=i},t._stringRef=a,t)}if(typeof e!="string")throw Error(P(284));if(!n._owner)throw Error(P(290,e))}return e}function kl(e,t){throw e=Object.prototype.toString.call(t),Error(P(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function bu(e){var t=e._init;return t(e._payload)}function $d(e){function t(h,d){if(e){var g=h.deletions;g===null?(h.deletions=[d],h.flags|=16):g.push(d)}}function n(h,d){if(!e)return null;for(;d!==null;)t(h,d),d=d.sibling;return null}function r(h,d){for(h=new Map;d!==null;)d.key!==null?h.set(d.key,d):h.set(d.index,d),d=d.sibling;return h}function l(h,d){return h=Gt(h,d),h.index=0,h.sibling=null,h}function a(h,d,g){return h.index=g,e?(g=h.alternate,g!==null?(g=g.index,g<d?(h.flags|=2,d):g):(h.flags|=2,d)):(h.flags|=1048576,d)}function i(h){return e&&h.alternate===null&&(h.flags|=2),h}function o(h,d,g,S){return d===null||d.tag!==6?(d=da(g,h.mode,S),d.return=h,d):(d=l(d,g),d.return=h,d)}function u(h,d,g,S){var k=g.type;return k===Rn?p(h,d,g.props.children,S,g.key):d!==null&&(d.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Dt&&bu(k)===d.type)?(S=l(d,g.props),S.ref=pr(h,d,g),S.return=h,S):(S=Bl(g.type,g.key,g.props,null,h.mode,S),S.ref=pr(h,d,g),S.return=h,S)}function c(h,d,g,S){return d===null||d.tag!==4||d.stateNode.containerInfo!==g.containerInfo||d.stateNode.implementation!==g.implementation?(d=fa(g,h.mode,S),d.return=h,d):(d=l(d,g.children||[]),d.return=h,d)}function p(h,d,g,S,k){return d===null||d.tag!==7?(d=pn(g,h.mode,S,k),d.return=h,d):(d=l(d,g),d.return=h,d)}function f(h,d,g){if(typeof d=="string"&&d!==""||typeof d=="number")return d=da(""+d,h.mode,g),d.return=h,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case fl:return g=Bl(d.type,d.key,d.props,null,h.mode,g),g.ref=pr(h,null,d),g.return=h,g;case _n:return d=fa(d,h.mode,g),d.return=h,d;case Dt:var S=d._init;return f(h,S(d._payload),g)}if(vr(d)||or(d))return d=pn(d,h.mode,g,null),d.return=h,d;kl(h,d)}return null}function x(h,d,g,S){var k=d!==null?d.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return k!==null?null:o(h,d,""+g,S);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case fl:return g.key===k?u(h,d,g,S):null;case _n:return g.key===k?c(h,d,g,S):null;case Dt:return k=g._init,x(h,d,k(g._payload),S)}if(vr(g)||or(g))return k!==null?null:p(h,d,g,S,null);kl(h,g)}return null}function y(h,d,g,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return h=h.get(g)||null,o(d,h,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case fl:return h=h.get(S.key===null?g:S.key)||null,u(d,h,S,k);case _n:return h=h.get(S.key===null?g:S.key)||null,c(d,h,S,k);case Dt:var T=S._init;return y(h,d,g,T(S._payload),k)}if(vr(S)||or(S))return h=h.get(g)||null,p(d,h,S,k,null);kl(d,S)}return null}function N(h,d,g,S){for(var k=null,T=null,A=d,L=d=0,O=null;A!==null&&L<g.length;L++){A.index>L?(O=A,A=null):O=A.sibling;var F=x(h,A,g[L],S);if(F===null){A===null&&(A=O);break}e&&A&&F.alternate===null&&t(h,A),d=a(F,d,L),T===null?k=F:T.sibling=F,T=F,A=O}if(L===g.length)return n(h,A),G&&an(h,L),k;if(A===null){for(;L<g.length;L++)A=f(h,g[L],S),A!==null&&(d=a(A,d,L),T===null?k=A:T.sibling=A,T=A);return G&&an(h,L),k}for(A=r(h,A);L<g.length;L++)O=y(A,h,L,g[L],S),O!==null&&(e&&O.alternate!==null&&A.delete(O.key===null?L:O.key),d=a(O,d,L),T===null?k=O:T.sibling=O,T=O);return e&&A.forEach(function(U){return t(h,U)}),G&&an(h,L),k}function v(h,d,g,S){var k=or(g);if(typeof k!="function")throw Error(P(150));if(g=k.call(g),g==null)throw Error(P(151));for(var T=k=null,A=d,L=d=0,O=null,F=g.next();A!==null&&!F.done;L++,F=g.next()){A.index>L?(O=A,A=null):O=A.sibling;var U=x(h,A,F.value,S);if(U===null){A===null&&(A=O);break}e&&A&&U.alternate===null&&t(h,A),d=a(U,d,L),T===null?k=U:T.sibling=U,T=U,A=O}if(F.done)return n(h,A),G&&an(h,L),k;if(A===null){for(;!F.done;L++,F=g.next())F=f(h,F.value,S),F!==null&&(d=a(F,d,L),T===null?k=F:T.sibling=F,T=F);return G&&an(h,L),k}for(A=r(h,A);!F.done;L++,F=g.next())F=y(A,h,L,F.value,S),F!==null&&(e&&F.alternate!==null&&A.delete(F.key===null?L:F.key),d=a(F,d,L),T===null?k=F:T.sibling=F,T=F);return e&&A.forEach(function(Y){return t(h,Y)}),G&&an(h,L),k}function j(h,d,g,S){if(typeof g=="object"&&g!==null&&g.type===Rn&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case fl:e:{for(var k=g.key,T=d;T!==null;){if(T.key===k){if(k=g.type,k===Rn){if(T.tag===7){n(h,T.sibling),d=l(T,g.props.children),d.return=h,h=d;break e}}else if(T.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Dt&&bu(k)===T.type){n(h,T.sibling),d=l(T,g.props),d.ref=pr(h,T,g),d.return=h,h=d;break e}n(h,T);break}else t(h,T);T=T.sibling}g.type===Rn?(d=pn(g.props.children,h.mode,S,g.key),d.return=h,h=d):(S=Bl(g.type,g.key,g.props,null,h.mode,S),S.ref=pr(h,d,g),S.return=h,h=S)}return i(h);case _n:e:{for(T=g.key;d!==null;){if(d.key===T)if(d.tag===4&&d.stateNode.containerInfo===g.containerInfo&&d.stateNode.implementation===g.implementation){n(h,d.sibling),d=l(d,g.children||[]),d.return=h,h=d;break e}else{n(h,d);break}else t(h,d);d=d.sibling}d=fa(g,h.mode,S),d.return=h,h=d}return i(h);case Dt:return T=g._init,j(h,d,T(g._payload),S)}if(vr(g))return N(h,d,g,S);if(or(g))return v(h,d,g,S);kl(h,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,d!==null&&d.tag===6?(n(h,d.sibling),d=l(d,g),d.return=h,h=d):(n(h,d),d=da(g,h.mode,S),d.return=h,h=d),i(h)):n(h,d)}return j}var Gn=$d(!0),Bd=$d(!1),rs=ln(null),ls=null,zn=null,Hi=null;function Vi(){Hi=zn=ls=null}function Wi(e){var t=rs.current;K(rs),e._currentValue=t}function Ka(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Yn(e,t){ls=e,Hi=zn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fe=!0),e.firstContext=null)}function Ze(e){var t=e._currentValue;if(Hi!==e)if(e={context:e,memoizedValue:t,next:null},zn===null){if(ls===null)throw Error(P(308));zn=e,ls.dependencies={lanes:0,firstContext:e}}else zn=zn.next=e;return t}var cn=null;function Yi(e){cn===null?cn=[e]:cn.push(e)}function Ud(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Yi(t)):(n.next=l.next,l.next=n),t.interleaved=n,Tt(e,r)}function Tt(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 It=!1;function Qi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hd(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 Ct(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,V&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Tt(e,n)}return l=r.interleaved,l===null?(t.next=t,Yi(r)):(t.next=l.next,l.next=t),r.interleaved=t,Tt(e,n)}function Fl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pi(e,n)}}function Su(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?l=a=i:a=a.next=i,n=n.next}while(n!==null);a===null?l=a=t:a=a.next=t}else l=a=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ss(e,t,n,r){var l=e.updateQueue;It=!1;var a=l.firstBaseUpdate,i=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var u=o,c=u.next;u.next=null,i===null?a=c:i.next=c,i=u;var p=e.alternate;p!==null&&(p=p.updateQueue,o=p.lastBaseUpdate,o!==i&&(o===null?p.firstBaseUpdate=c:o.next=c,p.lastBaseUpdate=u))}if(a!==null){var f=l.baseState;i=0,p=c=u=null,o=a;do{var x=o.lane,y=o.eventTime;if((r&x)===x){p!==null&&(p=p.next={eventTime:y,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var N=e,v=o;switch(x=t,y=n,v.tag){case 1:if(N=v.payload,typeof N=="function"){f=N.call(y,f,x);break e}f=N;break e;case 3:N.flags=N.flags&-65537|128;case 0:if(N=v.payload,x=typeof N=="function"?N.call(y,f,x):N,x==null)break e;f=ne({},f,x);break e;case 2:It=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,x=l.effects,x===null?l.effects=[o]:x.push(o))}else y={eventTime:y,lane:x,tag:o.tag,payload:o.payload,callback:o.callback,next:null},p===null?(c=p=y,u=f):p=p.next=y,i|=x;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;x=o,o=x.next,x.next=null,l.lastBaseUpdate=x,l.shared.pending=null}}while(!0);if(p===null&&(u=f),l.baseState=u,l.firstBaseUpdate=c,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else a===null&&(l.shared.lanes=0);yn|=i,e.lanes=i,e.memoizedState=f}}function Cu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],l=r.callback;if(l!==null){if(r.callback=null,r=n,typeof l!="function")throw Error(P(191,l));l.call(r)}}}var al={},vt=ln(al),Ur=ln(al),Hr=ln(al);function dn(e){if(e===al)throw Error(P(174));return e}function qi(e,t){switch(Q(Hr,t),Q(Ur,e),Q(vt,al),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ra(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ra(t,e)}K(vt),Q(vt,t)}function Xn(){K(vt),K(Ur),K(Hr)}function Vd(e){dn(Hr.current);var t=dn(vt.current),n=Ra(t,e.type);t!==n&&(Q(Ur,e),Q(vt,n))}function Ki(e){Ur.current===e&&(K(vt),K(Ur))}var Z=ln(0);function as(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 sa=[];function Ji(){for(var e=0;e<sa.length;e++)sa[e]._workInProgressVersionPrimary=null;sa.length=0}var Ol=Mt.ReactCurrentDispatcher,aa=Mt.ReactCurrentBatchConfig,vn=0,ee=null,ce=null,pe=null,is=!1,Er=!1,Vr=0,sh=0;function je(){throw Error(P(321))}function Gi(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ft(e[n],t[n]))return!1;return!0}function Xi(e,t,n,r,l,a){if(vn=a,ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ol.current=e===null||e.memoizedState===null?uh:ch,e=n(r,l),Er){a=0;do{if(Er=!1,Vr=0,25<=a)throw Error(P(301));a+=1,pe=ce=null,t.updateQueue=null,Ol.current=dh,e=n(r,l)}while(Er)}if(Ol.current=os,t=ce!==null&&ce.next!==null,vn=0,pe=ce=ee=null,is=!1,t)throw Error(P(300));return e}function Zi(){var e=Vr!==0;return Vr=0,e}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pe===null?ee.memoizedState=pe=e:pe=pe.next=e,pe}function et(){if(ce===null){var e=ee.alternate;e=e!==null?e.memoizedState:null}else e=ce.next;var t=pe===null?ee.memoizedState:pe.next;if(t!==null)pe=t,ce=e;else{if(e===null)throw Error(P(310));ce=e,e={memoizedState:ce.memoizedState,baseState:ce.baseState,baseQueue:ce.baseQueue,queue:ce.queue,next:null},pe===null?ee.memoizedState=pe=e:pe=pe.next=e}return pe}function Wr(e,t){return typeof t=="function"?t(e):t}function ia(e){var t=et(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=ce,l=r.baseQueue,a=n.pending;if(a!==null){if(l!==null){var i=l.next;l.next=a.next,a.next=i}r.baseQueue=l=a,n.pending=null}if(l!==null){a=l.next,r=r.baseState;var o=i=null,u=null,c=a;do{var p=c.lane;if((vn&p)===p)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:p,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=f,i=r):u=u.next=f,ee.lanes|=p,yn|=p}c=c.next}while(c!==null&&c!==a);u===null?i=r:u.next=o,ft(r,t.memoizedState)||(Fe=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){l=e;do a=l.lane,ee.lanes|=a,yn|=a,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function oa(e){var t=et(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=n.dispatch,l=n.pending,a=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do a=e(a,i.action),i=i.next;while(i!==l);ft(a,t.memoizedState)||(Fe=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Wd(){}function Yd(e,t){var n=ee,r=et(),l=t(),a=!ft(r.memoizedState,l);if(a&&(r.memoizedState=l,Fe=!0),r=r.queue,eo(Kd.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||pe!==null&&pe.memoizedState.tag&1){if(n.flags|=2048,Yr(9,qd.bind(null,n,r,l,t),void 0,null),me===null)throw Error(P(349));vn&30||Qd(n,t,l)}return l}function Qd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ee.updateQueue,t===null?(t={lastEffect:null,stores:null},ee.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qd(e,t,n,r){t.value=n,t.getSnapshot=r,Jd(t)&&Gd(e)}function Kd(e,t,n){return n(function(){Jd(t)&&Gd(e)})}function Jd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ft(e,n)}catch{return!0}}function Gd(e){var t=Tt(e,1);t!==null&&dt(t,e,1,-1)}function Eu(e){var t=ht();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wr,lastRenderedState:e},t.queue=e,e=e.dispatch=oh.bind(null,ee,e),[t.memoizedState,e]}function Yr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ee.updateQueue,t===null?(t={lastEffect:null,stores:null},ee.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 Xd(){return et().memoizedState}function zl(e,t,n,r){var l=ht();ee.flags|=e,l.memoizedState=Yr(1|t,n,void 0,r===void 0?null:r)}function Rs(e,t,n,r){var l=et();r=r===void 0?null:r;var a=void 0;if(ce!==null){var i=ce.memoizedState;if(a=i.destroy,r!==null&&Gi(r,i.deps)){l.memoizedState=Yr(t,n,a,r);return}}ee.flags|=e,l.memoizedState=Yr(1|t,n,a,r)}function _u(e,t){return zl(8390656,8,e,t)}function eo(e,t){return Rs(2048,8,e,t)}function Zd(e,t){return Rs(4,2,e,t)}function ef(e,t){return Rs(4,4,e,t)}function tf(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 nf(e,t,n){return n=n!=null?n.concat([e]):null,Rs(4,4,tf.bind(null,t,e),n)}function to(){}function rf(e,t){var n=et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function lf(e,t){var n=et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function sf(e,t,n){return vn&21?(ft(n,t)||(n=cd(),ee.lanes|=n,yn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fe=!0),e.memoizedState=n)}function ah(e,t){var n=W;W=n!==0&&4>n?n:4,e(!0);var r=aa.transition;aa.transition={};try{e(!1),t()}finally{W=n,aa.transition=r}}function af(){return et().memoizedState}function ih(e,t,n){var r=Jt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},of(e))uf(t,n);else if(n=Ud(e,t,n,r),n!==null){var l=_e();dt(n,e,r,l),cf(n,t,r)}}function oh(e,t,n){var r=Jt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(of(e))uf(t,l);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,o=a(i,n);if(l.hasEagerState=!0,l.eagerState=o,ft(o,i)){var u=t.interleaved;u===null?(l.next=l,Yi(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Ud(e,t,l,r),n!==null&&(l=_e(),dt(n,e,r,l),cf(n,t,r))}}function of(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function uf(e,t){Er=is=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pi(e,n)}}var os={readContext:Ze,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},uh={readContext:Ze,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:Ze,useEffect:_u,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,zl(4194308,4,tf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zl(4194308,4,e,t)},useInsertionEffect:function(e,t){return zl(4,2,e,t)},useMemo:function(e,t){var n=ht();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ht();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ih.bind(null,ee,e),[r.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:Eu,useDebugValue:to,useDeferredValue:function(e){return ht().memoizedState=e},useTransition:function(){var e=Eu(!1),t=e[0];return e=ah.bind(null,e[1]),ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ee,l=ht();if(G){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),me===null)throw Error(P(349));vn&30||Qd(r,t,n)}l.memoizedState=n;var a={value:n,getSnapshot:t};return l.queue=a,_u(Kd.bind(null,r,a,e),[e]),r.flags|=2048,Yr(9,qd.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=ht(),t=me.identifierPrefix;if(G){var n=St,r=bt;n=(r&~(1<<32-ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Vr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=sh++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ch={readContext:Ze,useCallback:rf,useContext:Ze,useEffect:eo,useImperativeHandle:nf,useInsertionEffect:Zd,useLayoutEffect:ef,useMemo:lf,useReducer:ia,useRef:Xd,useState:function(){return ia(Wr)},useDebugValue:to,useDeferredValue:function(e){var t=et();return sf(t,ce.memoizedState,e)},useTransition:function(){var e=ia(Wr)[0],t=et().memoizedState;return[e,t]},useMutableSource:Wd,useSyncExternalStore:Yd,useId:af,unstable_isNewReconciler:!1},dh={readContext:Ze,useCallback:rf,useContext:Ze,useEffect:eo,useImperativeHandle:nf,useInsertionEffect:Zd,useLayoutEffect:ef,useMemo:lf,useReducer:oa,useRef:Xd,useState:function(){return oa(Wr)},useDebugValue:to,useDeferredValue:function(e){var t=et();return ce===null?t.memoizedState=e:sf(t,ce.memoizedState,e)},useTransition:function(){var e=oa(Wr)[0],t=et().memoizedState;return[e,t]},useMutableSource:Wd,useSyncExternalStore:Yd,useId:af,unstable_isNewReconciler:!1};function it(e,t){if(e&&e.defaultProps){t=ne({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ja(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ne({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ts={isMounted:function(e){return(e=e._reactInternals)?kn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_e(),l=Jt(e),a=Ct(r,l);a.payload=t,n!=null&&(a.callback=n),t=qt(e,a,l),t!==null&&(dt(t,e,l,r),Fl(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_e(),l=Jt(e),a=Ct(r,l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=qt(e,a,l),t!==null&&(dt(t,e,l,r),Fl(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_e(),r=Jt(e),l=Ct(n,r);l.tag=2,t!=null&&(l.callback=t),t=qt(e,l,r),t!==null&&(dt(t,e,r,n),Fl(t,e,r))}};function Ru(e,t,n,r,l,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,i):t.prototype&&t.prototype.isPureReactComponent?!Dr(n,r)||!Dr(l,a):!0}function df(e,t,n){var r=!1,l=en,a=t.contextType;return typeof a=="object"&&a!==null?a=Ze(a):(l=De(t)?xn:be.current,r=t.contextTypes,a=(r=r!=null)?Kn(e,l):en),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=l,e.__reactInternalMemoizedMaskedChildContext=a),t}function Tu(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 Ga(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},Qi(e);var a=t.contextType;typeof a=="object"&&a!==null?l.context=Ze(a):(a=De(t)?xn:be.current,l.context=Kn(e,a)),l.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Ja(e,t,a,n),l.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&Ts.enqueueReplaceState(l,l.state,null),ss(e,n,l,r),l.state=e.memoizedState),typeof l.componentDidMount=="function"&&(e.flags|=4194308)}function Zn(e,t){try{var n="",r=t;do n+=Im(r),r=r.return;while(r);var l=n}catch(a){l=`
|
|
39
|
+
Error generating stack: `+a.message+`
|
|
40
|
+
`+a.stack}return{value:e,source:t,stack:l,digest:null}}function ua(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xa(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var fh=typeof WeakMap=="function"?WeakMap:Map;function ff(e,t,n){n=Ct(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){cs||(cs=!0,oi=r),Xa(e,t)},n}function pf(e,t,n){n=Ct(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Xa(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Xa(e,t),typeof r!="function"&&(Kt===null?Kt=new Set([this]):Kt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Au(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new fh;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Ch.bind(null,e,t,n),t.then(e,e))}function Pu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Lu(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,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=Ct(-1,1),t.tag=2,qt(n,t,1))),n.lanes|=1),e)}var ph=Mt.ReactCurrentOwner,Fe=!1;function Ce(e,t,n,r){t.child=e===null?Bd(t,null,n,r):Gn(t,e.child,n,r)}function Mu(e,t,n,r,l){n=n.render;var a=t.ref;return Yn(t,l),r=Xi(e,t,n,r,a,l),n=Zi(),e!==null&&!Fe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,At(e,t,l)):(G&&n&&$i(t),t.flags|=1,Ce(e,t,r,l),t.child)}function Fu(e,t,n,r,l){if(e===null){var a=n.type;return typeof a=="function"&&!uo(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,mf(e,t,a,r,l)):(e=Bl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&l)){var i=a.memoizedProps;if(n=n.compare,n=n!==null?n:Dr,n(i,r)&&e.ref===t.ref)return At(e,t,l)}return t.flags|=1,e=Gt(a,r),e.ref=t.ref,e.return=t,t.child=e}function mf(e,t,n,r,l){if(e!==null){var a=e.memoizedProps;if(Dr(a,r)&&e.ref===t.ref)if(Fe=!1,t.pendingProps=r=a,(e.lanes&l)!==0)e.flags&131072&&(Fe=!0);else return t.lanes=e.lanes,At(e,t,l)}return Za(e,t,n,r,l)}function hf(e,t,n){var r=t.pendingProps,l=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Q(In,He),He|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Q(In,He),He|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Q(In,He),He|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Q(In,He),He|=r;return Ce(e,t,l,n),t.child}function xf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Za(e,t,n,r,l){var a=De(n)?xn:be.current;return a=Kn(t,a),Yn(t,l),n=Xi(e,t,n,r,a,l),r=Zi(),e!==null&&!Fe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,At(e,t,l)):(G&&r&&$i(t),t.flags|=1,Ce(e,t,n,l),t.child)}function Ou(e,t,n,r,l){if(De(n)){var a=!0;es(t)}else a=!1;if(Yn(t,l),t.stateNode===null)Dl(e,t),df(t,n,r),Ga(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,o=t.memoizedProps;i.props=o;var u=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Ze(c):(c=De(n)?xn:be.current,c=Kn(t,c));var p=n.getDerivedStateFromProps,f=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==r||u!==c)&&Tu(t,i,r,c),It=!1;var x=t.memoizedState;i.state=x,ss(t,r,i,l),u=t.memoizedState,o!==r||x!==u||ze.current||It?(typeof p=="function"&&(Ja(t,n,p,r),u=t.memoizedState),(o=It||Ru(t,n,o,r,x,u,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),i.props=r,i.state=u,i.context=c,r=o):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Hd(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:it(t.type,o),i.props=c,f=t.pendingProps,x=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=Ze(u):(u=De(n)?xn:be.current,u=Kn(t,u));var y=n.getDerivedStateFromProps;(p=typeof y=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==f||x!==u)&&Tu(t,i,r,u),It=!1,x=t.memoizedState,i.state=x,ss(t,r,i,l);var N=t.memoizedState;o!==f||x!==N||ze.current||It?(typeof y=="function"&&(Ja(t,n,y,r),N=t.memoizedState),(c=It||Ru(t,n,c,r,x,N,u)||!1)?(p||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,N,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,N,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=N),i.props=r,i.state=N,i.context=u,r=c):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),r=!1)}return ei(e,t,n,r,a,l)}function ei(e,t,n,r,l,a){xf(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&Nu(t,n,!1),At(e,t,a);r=t.stateNode,ph.current=t;var o=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Gn(t,e.child,null,a),t.child=Gn(t,null,o,a)):Ce(e,t,o,a),t.memoizedState=r.state,l&&Nu(t,n,!0),t.child}function gf(e){var t=e.stateNode;t.pendingContext?ju(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ju(e,t.context,!1),qi(e,t.containerInfo)}function zu(e,t,n,r,l){return Jn(),Ui(l),t.flags|=256,Ce(e,t,n,r),t.child}var ti={dehydrated:null,treeContext:null,retryLane:0};function ni(e){return{baseLanes:e,cachePool:null,transitions:null}}function vf(e,t,n){var r=t.pendingProps,l=Z.current,a=!1,i=(t.flags&128)!==0,o;if((o=i)||(o=e!==null&&e.memoizedState===null?!1:(l&2)!==0),o?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),Q(Z,l&1),e===null)return qa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,a?(r=t.mode,a=t.child,i={mode:"hidden",children:i},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=i):a=Ls(i,r,0,null),e=pn(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ni(n),t.memoizedState=ti,e):no(t,i));if(l=e.memoizedState,l!==null&&(o=l.dehydrated,o!==null))return mh(e,t,i,r,o,l,n);if(a){a=r.fallback,i=t.mode,l=e.child,o=l.sibling;var u={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Gt(l,u),r.subtreeFlags=l.subtreeFlags&14680064),o!==null?a=Gt(o,a):(a=pn(a,i,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,i=e.child.memoizedState,i=i===null?ni(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~n,t.memoizedState=ti,r}return a=e.child,e=a.sibling,r=Gt(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 no(e,t){return t=Ls({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function bl(e,t,n,r){return r!==null&&Ui(r),Gn(t,e.child,null,n),e=no(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mh(e,t,n,r,l,a,i){if(n)return t.flags&256?(t.flags&=-257,r=ua(Error(P(422))),bl(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,l=t.mode,r=Ls({mode:"visible",children:r.children},l,0,null),a=pn(a,l,i,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&Gn(t,e.child,null,i),t.child.memoizedState=ni(i),t.memoizedState=ti,a);if(!(t.mode&1))return bl(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(P(419)),r=ua(a,r,void 0),bl(e,t,i,r)}if(o=(i&e.childLanes)!==0,Fe||o){if(r=me,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=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:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|i)?0:l,l!==0&&l!==a.retryLane&&(a.retryLane=l,Tt(e,l),dt(r,e,l,-1))}return oo(),r=ua(Error(P(421))),bl(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Eh.bind(null,e),l._reactRetry=t,null):(e=a.treeContext,Ve=Qt(l.nextSibling),We=t,G=!0,ut=null,e!==null&&(Ke[Je++]=bt,Ke[Je++]=St,Ke[Je++]=gn,bt=e.id,St=e.overflow,gn=t),t=no(t,r.children),t.flags|=4096,t)}function Du(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ka(e.return,t,n)}function ca(e,t,n,r,l){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=l)}function yf(e,t,n){var r=t.pendingProps,l=r.revealOrder,a=r.tail;if(Ce(e,t,r.children,n),r=Z.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Du(e,n,t);else if(e.tag===19)Du(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Q(Z,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&as(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),ca(t,!1,l,n,a);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&as(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}ca(t,!0,n,null,a);break;case"together":ca(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Dl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function At(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),yn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(P(153));if(t.child!==null){for(e=t.child,n=Gt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hh(e,t,n){switch(t.tag){case 3:gf(t),Jn();break;case 5:Vd(t);break;case 1:De(t.type)&&es(t);break;case 4:qi(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;Q(rs,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Q(Z,Z.current&1),t.flags|=128,null):n&t.child.childLanes?vf(e,t,n):(Q(Z,Z.current&1),e=At(e,t,n),e!==null?e.sibling:null);Q(Z,Z.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return yf(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Q(Z,Z.current),r)break;return null;case 22:case 23:return t.lanes=0,hf(e,t,n)}return At(e,t,n)}var jf,ri,Nf,wf;jf=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}};ri=function(){};Nf=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,dn(vt.current);var a=null;switch(n){case"input":l=Sa(e,l),r=Sa(e,r),a=[];break;case"select":l=ne({},l,{value:void 0}),r=ne({},r,{value:void 0}),a=[];break;case"textarea":l=_a(e,l),r=_a(e,r),a=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Xl)}Ta(n,r);var i;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var o=l[c];for(i in o)o.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ar.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in r){var u=r[c];if(o=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&u!==o&&(u!=null||o!=null))if(c==="style")if(o){for(i in o)!o.hasOwnProperty(i)||u&&u.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in u)u.hasOwnProperty(i)&&o[i]!==u[i]&&(n||(n={}),n[i]=u[i])}else n||(a||(a=[]),a.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(a=a||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(a=a||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ar.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&q("scroll",e),a||o===u||(a=[])):(a=a||[]).push(c,u))}n&&(a=a||[]).push("style",n);var c=a;(t.updateQueue=c)&&(t.flags|=4)}};wf=function(e,t,n,r){n!==r&&(t.flags|=4)};function mr(e,t){if(!G)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 Ne(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xh(e,t,n){var r=t.pendingProps;switch(Bi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ne(t),null;case 1:return De(t.type)&&Zl(),Ne(t),null;case 3:return r=t.stateNode,Xn(),K(ze),K(be),Ji(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(wl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ut!==null&&(di(ut),ut=null))),ri(e,t),Ne(t),null;case 5:Ki(t);var l=dn(Hr.current);if(n=t.type,e!==null&&t.stateNode!=null)Nf(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(P(166));return Ne(t),null}if(e=dn(vt.current),wl(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[xt]=t,r[Br]=a,e=(t.mode&1)!==0,n){case"dialog":q("cancel",r),q("close",r);break;case"iframe":case"object":case"embed":q("load",r);break;case"video":case"audio":for(l=0;l<jr.length;l++)q(jr[l],r);break;case"source":q("error",r);break;case"img":case"image":case"link":q("error",r),q("load",r);break;case"details":q("toggle",r);break;case"input":Qo(r,a),q("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},q("invalid",r);break;case"textarea":Ko(r,a),q("invalid",r)}Ta(n,a),l=null;for(var i in a)if(a.hasOwnProperty(i)){var o=a[i];i==="children"?typeof o=="string"?r.textContent!==o&&(a.suppressHydrationWarning!==!0&&Nl(r.textContent,o,e),l=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&Nl(r.textContent,o,e),l=["children",""+o]):Ar.hasOwnProperty(i)&&o!=null&&i==="onScroll"&&q("scroll",r)}switch(n){case"input":pl(r),qo(r,a,!0);break;case"textarea":pl(r),Jo(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Xl)}r=l,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=l.nodeType===9?l:l.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Kc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[xt]=t,e[Br]=r,jf(e,t,!1,!1),t.stateNode=e;e:{switch(i=Aa(n,r),n){case"dialog":q("cancel",e),q("close",e),l=r;break;case"iframe":case"object":case"embed":q("load",e),l=r;break;case"video":case"audio":for(l=0;l<jr.length;l++)q(jr[l],e);l=r;break;case"source":q("error",e),l=r;break;case"img":case"image":case"link":q("error",e),q("load",e),l=r;break;case"details":q("toggle",e),l=r;break;case"input":Qo(e,r),l=Sa(e,r),q("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=ne({},r,{value:void 0}),q("invalid",e);break;case"textarea":Ko(e,r),l=_a(e,r),q("invalid",e);break;default:l=r}Ta(n,l),o=l;for(a in o)if(o.hasOwnProperty(a)){var u=o[a];a==="style"?Xc(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Jc(e,u)):a==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Pr(e,u):typeof u=="number"&&Pr(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ar.hasOwnProperty(a)?u!=null&&a==="onScroll"&&q("scroll",e):u!=null&&Ci(e,a,u,i))}switch(n){case"input":pl(e),qo(e,r,!1);break;case"textarea":pl(e),Jo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Zt(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?Un(e,!!r.multiple,a,!1):r.defaultValue!=null&&Un(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Xl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ne(t),null;case 6:if(e&&t.stateNode!=null)wf(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(P(166));if(n=dn(Hr.current),dn(vt.current),wl(t)){if(r=t.stateNode,n=t.memoizedProps,r[xt]=t,(a=r.nodeValue!==n)&&(e=We,e!==null))switch(e.tag){case 3:Nl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nl(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[xt]=t,t.stateNode=r}return Ne(t),null;case 13:if(K(Z),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(G&&Ve!==null&&t.mode&1&&!(t.flags&128))Id(),Jn(),t.flags|=98560,a=!1;else if(a=wl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(P(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(P(317));a[xt]=t}else Jn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ne(t),a=!1}else ut!==null&&(di(ut),ut=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Z.current&1?fe===0&&(fe=3):oo())),t.updateQueue!==null&&(t.flags|=4),Ne(t),null);case 4:return Xn(),ri(e,t),e===null&&Ir(t.stateNode.containerInfo),Ne(t),null;case 10:return Wi(t.type._context),Ne(t),null;case 17:return De(t.type)&&Zl(),Ne(t),null;case 19:if(K(Z),a=t.memoizedState,a===null)return Ne(t),null;if(r=(t.flags&128)!==0,i=a.rendering,i===null)if(r)mr(a,!1);else{if(fe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=as(e),i!==null){for(t.flags|=128,mr(a,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,i=a.alternate,i===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,a.type=i.type,e=i.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Q(Z,Z.current&1|2),t.child}e=e.sibling}a.tail!==null&&ie()>er&&(t.flags|=128,r=!0,mr(a,!1),t.lanes=4194304)}else{if(!r)if(e=as(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mr(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!G)return Ne(t),null}else 2*ie()-a.renderingStartTime>er&&n!==1073741824&&(t.flags|=128,r=!0,mr(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(n=a.last,n!==null?n.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=ie(),t.sibling=null,n=Z.current,Q(Z,r?n&1|2:n&1),t):(Ne(t),null);case 22:case 23:return io(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?He&1073741824&&(Ne(t),t.subtreeFlags&6&&(t.flags|=8192)):Ne(t),null;case 24:return null;case 25:return null}throw Error(P(156,t.tag))}function gh(e,t){switch(Bi(t),t.tag){case 1:return De(t.type)&&Zl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xn(),K(ze),K(be),Ji(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ki(t),null;case 13:if(K(Z),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));Jn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(Z),null;case 4:return Xn(),null;case 10:return Wi(t.type._context),null;case 22:case 23:return io(),null;case 24:return null;default:return null}}var Sl=!1,we=!1,vh=typeof WeakSet=="function"?WeakSet:Set,z=null;function Dn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ae(e,t,r)}else n.current=null}function li(e,t,n){try{n()}catch(r){ae(e,t,r)}}var Iu=!1;function yh(e,t){if(Ba=Kl,e=Cd(),Ii(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var i=0,o=-1,u=-1,c=0,p=0,f=e,x=null;t:for(;;){for(var y;f!==n||l!==0&&f.nodeType!==3||(o=i+l),f!==a||r!==0&&f.nodeType!==3||(u=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(y=f.firstChild)!==null;)x=f,f=y;for(;;){if(f===e)break t;if(x===n&&++c===l&&(o=i),x===a&&++p===r&&(u=i),(y=f.nextSibling)!==null)break;f=x,x=f.parentNode}f=y}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ua={focusedElem:e,selectionRange:n},Kl=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var N=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(N!==null){var v=N.memoizedProps,j=N.memoizedState,h=t.stateNode,d=h.getSnapshotBeforeUpdate(t.elementType===t.type?v:it(t.type,v),j);h.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(S){ae(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return N=Iu,Iu=!1,N}function _r(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var a=l.destroy;l.destroy=void 0,a!==void 0&&li(t,n,a)}l=l.next}while(l!==r)}}function As(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function si(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 kf(e){var t=e.alternate;t!==null&&(e.alternate=null,kf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xt],delete t[Br],delete t[Wa],delete t[th],delete t[nh])),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 bf(e){return e.tag===5||e.tag===3||e.tag===4}function $u(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ai(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=Xl));else if(r!==4&&(e=e.child,e!==null))for(ai(e,t,n),e=e.sibling;e!==null;)ai(e,t,n),e=e.sibling}function ii(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(ii(e,t,n),e=e.sibling;e!==null;)ii(e,t,n),e=e.sibling}var he=null,ot=!1;function zt(e,t,n){for(n=n.child;n!==null;)Sf(e,t,n),n=n.sibling}function Sf(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(ks,n)}catch{}switch(n.tag){case 5:we||Dn(n,t);case 6:var r=he,l=ot;he=null,zt(e,t,n),he=r,ot=l,he!==null&&(ot?(e=he,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):he.removeChild(n.stateNode));break;case 18:he!==null&&(ot?(e=he,n=n.stateNode,e.nodeType===8?ra(e.parentNode,n):e.nodeType===1&&ra(e,n),Or(e)):ra(he,n.stateNode));break;case 4:r=he,l=ot,he=n.stateNode.containerInfo,ot=!0,zt(e,t,n),he=r,ot=l;break;case 0:case 11:case 14:case 15:if(!we&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var a=l,i=a.destroy;a=a.tag,i!==void 0&&(a&2||a&4)&&li(n,t,i),l=l.next}while(l!==r)}zt(e,t,n);break;case 1:if(!we&&(Dn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ae(n,t,o)}zt(e,t,n);break;case 21:zt(e,t,n);break;case 22:n.mode&1?(we=(r=we)||n.memoizedState!==null,zt(e,t,n),we=r):zt(e,t,n);break;default:zt(e,t,n)}}function Bu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vh),t.forEach(function(r){var l=_h.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function at(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var l=n[r];try{var a=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 5:he=o.stateNode,ot=!1;break e;case 3:he=o.stateNode.containerInfo,ot=!0;break e;case 4:he=o.stateNode.containerInfo,ot=!0;break e}o=o.return}if(he===null)throw Error(P(160));Sf(a,i,l),he=null,ot=!1;var u=l.alternate;u!==null&&(u.return=null),l.return=null}catch(c){ae(l,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Cf(t,e),t=t.sibling}function Cf(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(at(t,e),mt(e),r&4){try{_r(3,e,e.return),As(3,e)}catch(v){ae(e,e.return,v)}try{_r(5,e,e.return)}catch(v){ae(e,e.return,v)}}break;case 1:at(t,e),mt(e),r&512&&n!==null&&Dn(n,n.return);break;case 5:if(at(t,e),mt(e),r&512&&n!==null&&Dn(n,n.return),e.flags&32){var l=e.stateNode;try{Pr(l,"")}catch(v){ae(e,e.return,v)}}if(r&4&&(l=e.stateNode,l!=null)){var a=e.memoizedProps,i=n!==null?n.memoizedProps:a,o=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{o==="input"&&a.type==="radio"&&a.name!=null&&Qc(l,a),Aa(o,i);var c=Aa(o,a);for(i=0;i<u.length;i+=2){var p=u[i],f=u[i+1];p==="style"?Xc(l,f):p==="dangerouslySetInnerHTML"?Jc(l,f):p==="children"?Pr(l,f):Ci(l,p,f,c)}switch(o){case"input":Ca(l,a);break;case"textarea":qc(l,a);break;case"select":var x=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!a.multiple;var y=a.value;y!=null?Un(l,!!a.multiple,y,!1):x!==!!a.multiple&&(a.defaultValue!=null?Un(l,!!a.multiple,a.defaultValue,!0):Un(l,!!a.multiple,a.multiple?[]:"",!1))}l[Br]=a}catch(v){ae(e,e.return,v)}}break;case 6:if(at(t,e),mt(e),r&4){if(e.stateNode===null)throw Error(P(162));l=e.stateNode,a=e.memoizedProps;try{l.nodeValue=a}catch(v){ae(e,e.return,v)}}break;case 3:if(at(t,e),mt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Or(t.containerInfo)}catch(v){ae(e,e.return,v)}break;case 4:at(t,e),mt(e);break;case 13:at(t,e),mt(e),l=e.child,l.flags&8192&&(a=l.memoizedState!==null,l.stateNode.isHidden=a,!a||l.alternate!==null&&l.alternate.memoizedState!==null||(so=ie())),r&4&&Bu(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(we=(c=we)||p,at(t,e),we=c):at(t,e),mt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!p&&e.mode&1)for(z=e,p=e.child;p!==null;){for(f=z=p;z!==null;){switch(x=z,y=x.child,x.tag){case 0:case 11:case 14:case 15:_r(4,x,x.return);break;case 1:Dn(x,x.return);var N=x.stateNode;if(typeof N.componentWillUnmount=="function"){r=x,n=x.return;try{t=r,N.props=t.memoizedProps,N.state=t.memoizedState,N.componentWillUnmount()}catch(v){ae(r,n,v)}}break;case 5:Dn(x,x.return);break;case 22:if(x.memoizedState!==null){Hu(f);continue}}y!==null?(y.return=x,z=y):Hu(f)}p=p.sibling}e:for(p=null,f=e;;){if(f.tag===5){if(p===null){p=f;try{l=f.stateNode,c?(a=l.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(o=f.stateNode,u=f.memoizedProps.style,i=u!=null&&u.hasOwnProperty("display")?u.display:null,o.style.display=Gc("display",i))}catch(v){ae(e,e.return,v)}}}else if(f.tag===6){if(p===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(v){ae(e,e.return,v)}}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 e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;p===f&&(p=null),f=f.return}p===f&&(p=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:at(t,e),mt(e),r&4&&Bu(e);break;case 21:break;default:at(t,e),mt(e)}}function mt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(bf(n)){var r=n;break e}n=n.return}throw Error(P(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(Pr(l,""),r.flags&=-33);var a=$u(e);ii(e,a,l);break;case 3:case 4:var i=r.stateNode.containerInfo,o=$u(e);ai(e,o,i);break;default:throw Error(P(161))}}catch(u){ae(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jh(e,t,n){z=e,Ef(e)}function Ef(e,t,n){for(var r=(e.mode&1)!==0;z!==null;){var l=z,a=l.child;if(l.tag===22&&r){var i=l.memoizedState!==null||Sl;if(!i){var o=l.alternate,u=o!==null&&o.memoizedState!==null||we;o=Sl;var c=we;if(Sl=i,(we=u)&&!c)for(z=l;z!==null;)i=z,u=i.child,i.tag===22&&i.memoizedState!==null?Vu(l):u!==null?(u.return=i,z=u):Vu(l);for(;a!==null;)z=a,Ef(a),a=a.sibling;z=l,Sl=o,we=c}Uu(e)}else l.subtreeFlags&8772&&a!==null?(a.return=l,z=a):Uu(e)}}function Uu(e){for(;z!==null;){var t=z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:we||As(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!we)if(n===null)r.componentDidMount();else{var l=t.elementType===t.type?n.memoizedProps:it(t.type,n.memoizedProps);r.componentDidUpdate(l,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Cu(t,a,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Cu(t,i,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var p=c.memoizedState;if(p!==null){var f=p.dehydrated;f!==null&&Or(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}we||t.flags&512&&si(t)}catch(x){ae(t,t.return,x)}}if(t===e){z=null;break}if(n=t.sibling,n!==null){n.return=t.return,z=n;break}z=t.return}}function Hu(e){for(;z!==null;){var t=z;if(t===e){z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,z=n;break}z=t.return}}function Vu(e){for(;z!==null;){var t=z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{As(4,t)}catch(u){ae(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var l=t.return;try{r.componentDidMount()}catch(u){ae(t,l,u)}}var a=t.return;try{si(t)}catch(u){ae(t,a,u)}break;case 5:var i=t.return;try{si(t)}catch(u){ae(t,i,u)}}}catch(u){ae(t,t.return,u)}if(t===e){z=null;break}var o=t.sibling;if(o!==null){o.return=t.return,z=o;break}z=t.return}}var Nh=Math.ceil,us=Mt.ReactCurrentDispatcher,ro=Mt.ReactCurrentOwner,Xe=Mt.ReactCurrentBatchConfig,V=0,me=null,oe=null,ge=0,He=0,In=ln(0),fe=0,Qr=null,yn=0,Ps=0,lo=0,Rr=null,Me=null,so=0,er=1/0,wt=null,cs=!1,oi=null,Kt=null,Cl=!1,Ht=null,ds=0,Tr=0,ui=null,Il=-1,$l=0;function _e(){return V&6?ie():Il!==-1?Il:Il=ie()}function Jt(e){return e.mode&1?V&2&&ge!==0?ge&-ge:lh.transition!==null?($l===0&&($l=cd()),$l):(e=W,e!==0||(e=window.event,e=e===void 0?16:gd(e.type)),e):1}function dt(e,t,n,r){if(50<Tr)throw Tr=0,ui=null,Error(P(185));rl(e,n,r),(!(V&2)||e!==me)&&(e===me&&(!(V&2)&&(Ps|=n),fe===4&&Bt(e,ge)),Ie(e,r),n===1&&V===0&&!(t.mode&1)&&(er=ie()+500,_s&&sn()))}function Ie(e,t){var n=e.callbackNode;l0(e,t);var r=ql(e,e===me?ge:0);if(r===0)n!==null&&Zo(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Zo(n),t===1)e.tag===0?rh(Wu.bind(null,e)):Od(Wu.bind(null,e)),Z0(function(){!(V&6)&&sn()}),n=null;else{switch(dd(r)){case 1:n=Ai;break;case 4:n=od;break;case 16:n=Ql;break;case 536870912:n=ud;break;default:n=Ql}n=Ff(n,_f.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _f(e,t){if(Il=-1,$l=0,V&6)throw Error(P(327));var n=e.callbackNode;if(Qn()&&e.callbackNode!==n)return null;var r=ql(e,e===me?ge:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=fs(e,r);else{t=r;var l=V;V|=2;var a=Tf();(me!==e||ge!==t)&&(wt=null,er=ie()+500,fn(e,t));do try{bh();break}catch(o){Rf(e,o)}while(!0);Vi(),us.current=a,V=l,oe!==null?t=0:(me=null,ge=0,t=fe)}if(t!==0){if(t===2&&(l=Oa(e),l!==0&&(r=l,t=ci(e,l))),t===1)throw n=Qr,fn(e,0),Bt(e,r),Ie(e,ie()),n;if(t===6)Bt(e,r);else{if(l=e.current.alternate,!(r&30)&&!wh(l)&&(t=fs(e,r),t===2&&(a=Oa(e),a!==0&&(r=a,t=ci(e,a))),t===1))throw n=Qr,fn(e,0),Bt(e,r),Ie(e,ie()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(P(345));case 2:on(e,Me,wt);break;case 3:if(Bt(e,r),(r&130023424)===r&&(t=so+500-ie(),10<t)){if(ql(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){_e(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=Va(on.bind(null,e,Me,wt),t);break}on(e,Me,wt);break;case 4:if(Bt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,l=-1;0<r;){var i=31-ct(r);a=1<<i,i=t[i],i>l&&(l=i),r&=~a}if(r=l,r=ie()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Nh(r/1960))-r,10<r){e.timeoutHandle=Va(on.bind(null,e,Me,wt),r);break}on(e,Me,wt);break;case 5:on(e,Me,wt);break;default:throw Error(P(329))}}}return Ie(e,ie()),e.callbackNode===n?_f.bind(null,e):null}function ci(e,t){var n=Rr;return e.current.memoizedState.isDehydrated&&(fn(e,t).flags|=256),e=fs(e,t),e!==2&&(t=Me,Me=n,t!==null&&di(t)),e}function di(e){Me===null?Me=e:Me.push.apply(Me,e)}function wh(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 l=n[r],a=l.getSnapshot;l=l.value;try{if(!ft(a(),l))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 Bt(e,t){for(t&=~lo,t&=~Ps,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 Wu(e){if(V&6)throw Error(P(327));Qn();var t=ql(e,0);if(!(t&1))return Ie(e,ie()),null;var n=fs(e,t);if(e.tag!==0&&n===2){var r=Oa(e);r!==0&&(t=r,n=ci(e,r))}if(n===1)throw n=Qr,fn(e,0),Bt(e,t),Ie(e,ie()),n;if(n===6)throw Error(P(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,on(e,Me,wt),Ie(e,ie()),null}function ao(e,t){var n=V;V|=1;try{return e(t)}finally{V=n,V===0&&(er=ie()+500,_s&&sn())}}function jn(e){Ht!==null&&Ht.tag===0&&!(V&6)&&Qn();var t=V;V|=1;var n=Xe.transition,r=W;try{if(Xe.transition=null,W=1,e)return e()}finally{W=r,Xe.transition=n,V=t,!(V&6)&&sn()}}function io(){He=In.current,K(In)}function fn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,X0(n)),oe!==null)for(n=oe.return;n!==null;){var r=n;switch(Bi(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Zl();break;case 3:Xn(),K(ze),K(be),Ji();break;case 5:Ki(r);break;case 4:Xn();break;case 13:K(Z);break;case 19:K(Z);break;case 10:Wi(r.type._context);break;case 22:case 23:io()}n=n.return}if(me=e,oe=e=Gt(e.current,null),ge=He=t,fe=0,Qr=null,lo=Ps=yn=0,Me=Rr=null,cn!==null){for(t=0;t<cn.length;t++)if(n=cn[t],r=n.interleaved,r!==null){n.interleaved=null;var l=r.next,a=n.pending;if(a!==null){var i=a.next;a.next=l,r.next=i}n.pending=r}cn=null}return e}function Rf(e,t){do{var n=oe;try{if(Vi(),Ol.current=os,is){for(var r=ee.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}is=!1}if(vn=0,pe=ce=ee=null,Er=!1,Vr=0,ro.current=null,n===null||n.return===null){fe=1,Qr=t,oe=null;break}e:{var a=e,i=n.return,o=n,u=t;if(t=ge,o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,p=o,f=p.tag;if(!(p.mode&1)&&(f===0||f===11||f===15)){var x=p.alternate;x?(p.updateQueue=x.updateQueue,p.memoizedState=x.memoizedState,p.lanes=x.lanes):(p.updateQueue=null,p.memoizedState=null)}var y=Pu(i);if(y!==null){y.flags&=-257,Lu(y,i,o,a,t),y.mode&1&&Au(a,c,t),t=y,u=c;var N=t.updateQueue;if(N===null){var v=new Set;v.add(u),t.updateQueue=v}else N.add(u);break e}else{if(!(t&1)){Au(a,c,t),oo();break e}u=Error(P(426))}}else if(G&&o.mode&1){var j=Pu(i);if(j!==null){!(j.flags&65536)&&(j.flags|=256),Lu(j,i,o,a,t),Ui(Zn(u,o));break e}}a=u=Zn(u,o),fe!==4&&(fe=2),Rr===null?Rr=[a]:Rr.push(a),a=i;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var h=ff(a,u,t);Su(a,h);break e;case 1:o=u;var d=a.type,g=a.stateNode;if(!(a.flags&128)&&(typeof d.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Kt===null||!Kt.has(g)))){a.flags|=65536,t&=-t,a.lanes|=t;var S=pf(a,o,t);Su(a,S);break e}}a=a.return}while(a!==null)}Pf(n)}catch(k){t=k,oe===n&&n!==null&&(oe=n=n.return);continue}break}while(!0)}function Tf(){var e=us.current;return us.current=os,e===null?os:e}function oo(){(fe===0||fe===3||fe===2)&&(fe=4),me===null||!(yn&268435455)&&!(Ps&268435455)||Bt(me,ge)}function fs(e,t){var n=V;V|=2;var r=Tf();(me!==e||ge!==t)&&(wt=null,fn(e,t));do try{kh();break}catch(l){Rf(e,l)}while(!0);if(Vi(),V=n,us.current=r,oe!==null)throw Error(P(261));return me=null,ge=0,fe}function kh(){for(;oe!==null;)Af(oe)}function bh(){for(;oe!==null&&!Km();)Af(oe)}function Af(e){var t=Mf(e.alternate,e,He);e.memoizedProps=e.pendingProps,t===null?Pf(e):oe=t,ro.current=null}function Pf(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=gh(n,t),n!==null){n.flags&=32767,oe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{fe=6,oe=null;return}}else if(n=xh(n,t,He),n!==null){oe=n;return}if(t=t.sibling,t!==null){oe=t;return}oe=t=e}while(t!==null);fe===0&&(fe=5)}function on(e,t,n){var r=W,l=Xe.transition;try{Xe.transition=null,W=1,Sh(e,t,n,r)}finally{Xe.transition=l,W=r}return null}function Sh(e,t,n,r){do Qn();while(Ht!==null);if(V&6)throw Error(P(327));n=e.finishedWork;var l=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(P(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(s0(e,a),e===me&&(oe=me=null,ge=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Cl||(Cl=!0,Ff(Ql,function(){return Qn(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Xe.transition,Xe.transition=null;var i=W;W=1;var o=V;V|=4,ro.current=null,yh(e,n),Cf(n,e),W0(Ua),Kl=!!Ba,Ua=Ba=null,e.current=n,jh(n),Jm(),V=o,W=i,Xe.transition=a}else e.current=n;if(Cl&&(Cl=!1,Ht=e,ds=l),a=e.pendingLanes,a===0&&(Kt=null),Zm(n.stateNode),Ie(e,ie()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)l=t[n],r(l.value,{componentStack:l.stack,digest:l.digest});if(cs)throw cs=!1,e=oi,oi=null,e;return ds&1&&e.tag!==0&&Qn(),a=e.pendingLanes,a&1?e===ui?Tr++:(Tr=0,ui=e):Tr=0,sn(),null}function Qn(){if(Ht!==null){var e=dd(ds),t=Xe.transition,n=W;try{if(Xe.transition=null,W=16>e?16:e,Ht===null)var r=!1;else{if(e=Ht,Ht=null,ds=0,V&6)throw Error(P(331));var l=V;for(V|=4,z=e.current;z!==null;){var a=z,i=a.child;if(z.flags&16){var o=a.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(z=c;z!==null;){var p=z;switch(p.tag){case 0:case 11:case 15:_r(8,p,a)}var f=p.child;if(f!==null)f.return=p,z=f;else for(;z!==null;){p=z;var x=p.sibling,y=p.return;if(kf(p),p===c){z=null;break}if(x!==null){x.return=y,z=x;break}z=y}}}var N=a.alternate;if(N!==null){var v=N.child;if(v!==null){N.child=null;do{var j=v.sibling;v.sibling=null,v=j}while(v!==null)}}z=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,z=i;else e:for(;z!==null;){if(a=z,a.flags&2048)switch(a.tag){case 0:case 11:case 15:_r(9,a,a.return)}var h=a.sibling;if(h!==null){h.return=a.return,z=h;break e}z=a.return}}var d=e.current;for(z=d;z!==null;){i=z;var g=i.child;if(i.subtreeFlags&2064&&g!==null)g.return=i,z=g;else e:for(i=d;z!==null;){if(o=z,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:As(9,o)}}catch(k){ae(o,o.return,k)}if(o===i){z=null;break e}var S=o.sibling;if(S!==null){S.return=o.return,z=S;break e}z=o.return}}if(V=l,sn(),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(ks,e)}catch{}r=!0}return r}finally{W=n,Xe.transition=t}}return!1}function Yu(e,t,n){t=Zn(n,t),t=ff(e,t,1),e=qt(e,t,1),t=_e(),e!==null&&(rl(e,1,t),Ie(e,t))}function ae(e,t,n){if(e.tag===3)Yu(e,e,n);else for(;t!==null;){if(t.tag===3){Yu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Kt===null||!Kt.has(r))){e=Zn(n,e),e=pf(t,e,1),t=qt(t,e,1),e=_e(),t!==null&&(rl(t,1,e),Ie(t,e));break}}t=t.return}}function Ch(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_e(),e.pingedLanes|=e.suspendedLanes&n,me===e&&(ge&n)===n&&(fe===4||fe===3&&(ge&130023424)===ge&&500>ie()-so?fn(e,0):lo|=n),Ie(e,t)}function Lf(e,t){t===0&&(e.mode&1?(t=xl,xl<<=1,!(xl&130023424)&&(xl=4194304)):t=1);var n=_e();e=Tt(e,t),e!==null&&(rl(e,t,n),Ie(e,n))}function Eh(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Lf(e,n)}function _h(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(P(314))}r!==null&&r.delete(t),Lf(e,n)}var Mf;Mf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ze.current)Fe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Fe=!1,hh(e,t,n);Fe=!!(e.flags&131072)}else Fe=!1,G&&t.flags&1048576&&zd(t,ns,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dl(e,t),e=t.pendingProps;var l=Kn(t,be.current);Yn(t,n),l=Xi(null,t,r,e,l,n);var a=Zi();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,De(r)?(a=!0,es(t)):a=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Qi(t),l.updater=Ts,t.stateNode=l,l._reactInternals=t,Ga(t,r,e,n),t=ei(null,t,r,!0,a,n)):(t.tag=0,G&&a&&$i(t),Ce(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Dl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Th(r),e=it(r,e),l){case 0:t=Za(null,t,r,e,n);break e;case 1:t=Ou(null,t,r,e,n);break e;case 11:t=Mu(null,t,r,e,n);break e;case 14:t=Fu(null,t,r,it(r.type,e),n);break e}throw Error(P(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),Za(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),Ou(e,t,r,l,n);case 3:e:{if(gf(t),e===null)throw Error(P(387));r=t.pendingProps,a=t.memoizedState,l=a.element,Hd(e,t),ss(t,r,null,n);var i=t.memoizedState;if(r=i.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){l=Zn(Error(P(423)),t),t=zu(e,t,r,n,l);break e}else if(r!==l){l=Zn(Error(P(424)),t),t=zu(e,t,r,n,l);break e}else for(Ve=Qt(t.stateNode.containerInfo.firstChild),We=t,G=!0,ut=null,n=Bd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jn(),r===l){t=At(e,t,n);break e}Ce(e,t,r,n)}t=t.child}return t;case 5:return Vd(t),e===null&&qa(t),r=t.type,l=t.pendingProps,a=e!==null?e.memoizedProps:null,i=l.children,Ha(r,l)?i=null:a!==null&&Ha(r,a)&&(t.flags|=32),xf(e,t),Ce(e,t,i,n),t.child;case 6:return e===null&&qa(t),null;case 13:return vf(e,t,n);case 4:return qi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Gn(t,null,r,n):Ce(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),Mu(e,t,r,l,n);case 7:return Ce(e,t,t.pendingProps,n),t.child;case 8:return Ce(e,t,t.pendingProps.children,n),t.child;case 12:return Ce(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,a=t.memoizedProps,i=l.value,Q(rs,r._currentValue),r._currentValue=i,a!==null)if(ft(a.value,i)){if(a.children===l.children&&!ze.current){t=At(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var o=a.dependencies;if(o!==null){i=a.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(a.tag===1){u=Ct(-1,n&-n),u.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?u.next=u:(u.next=p.next,p.next=u),c.pending=u}}a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Ka(a.return,n,t),o.lanes|=n;break}u=u.next}}else if(a.tag===10)i=a.type===t.type?null:a.child;else if(a.tag===18){if(i=a.return,i===null)throw Error(P(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Ka(i,n,t),i=a.sibling}else i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}Ce(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Yn(t,n),l=Ze(l),r=r(l),t.flags|=1,Ce(e,t,r,n),t.child;case 14:return r=t.type,l=it(r,t.pendingProps),l=it(r.type,l),Fu(e,t,r,l,n);case 15:return mf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),Dl(e,t),t.tag=1,De(r)?(e=!0,es(t)):e=!1,Yn(t,n),df(t,r,l),Ga(t,r,l,n),ei(null,t,r,!0,e,n);case 19:return yf(e,t,n);case 22:return hf(e,t,n)}throw Error(P(156,t.tag))};function Ff(e,t){return id(e,t)}function Rh(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 Ge(e,t,n,r){return new Rh(e,t,n,r)}function uo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Th(e){if(typeof e=="function")return uo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_i)return 11;if(e===Ri)return 14}return 2}function Gt(e,t){var n=e.alternate;return n===null?(n=Ge(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 Bl(e,t,n,r,l,a){var i=2;if(r=e,typeof e=="function")uo(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Rn:return pn(n.children,l,a,t);case Ei:i=8,l|=8;break;case Na:return e=Ge(12,n,t,l|2),e.elementType=Na,e.lanes=a,e;case wa:return e=Ge(13,n,t,l),e.elementType=wa,e.lanes=a,e;case ka:return e=Ge(19,n,t,l),e.elementType=ka,e.lanes=a,e;case Vc:return Ls(n,l,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Uc:i=10;break e;case Hc:i=9;break e;case _i:i=11;break e;case Ri:i=14;break e;case Dt:i=16,r=null;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=Ge(i,n,t,l),t.elementType=e,t.type=r,t.lanes=a,t}function pn(e,t,n,r){return e=Ge(7,e,r,t),e.lanes=n,e}function Ls(e,t,n,r){return e=Ge(22,e,r,t),e.elementType=Vc,e.lanes=n,e.stateNode={isHidden:!1},e}function da(e,t,n){return e=Ge(6,e,null,t),e.lanes=n,e}function fa(e,t,n){return t=Ge(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ah(e,t,n,r,l){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=Ys(0),this.expirationTimes=Ys(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ys(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function co(e,t,n,r,l,a,i,o,u){return e=new Ah(e,t,n,o,u),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ge(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qi(a),e}function Ph(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_n,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Of(e){if(!e)return en;e=e._reactInternals;e:{if(kn(e)!==e||e.tag!==1)throw Error(P(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(De(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(P(171))}if(e.tag===1){var n=e.type;if(De(n))return Fd(e,n,t)}return t}function zf(e,t,n,r,l,a,i,o,u){return e=co(n,r,!0,e,l,a,i,o,u),e.context=Of(null),n=e.current,r=_e(),l=Jt(n),a=Ct(r,l),a.callback=t??null,qt(n,a,l),e.current.lanes=l,rl(e,l,r),Ie(e,r),e}function Ms(e,t,n,r){var l=t.current,a=_e(),i=Jt(l);return n=Of(n),t.context===null?t.context=n:t.pendingContext=n,t=Ct(a,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=qt(l,t,i),e!==null&&(dt(e,l,i,a),Fl(e,l,i)),i}function ps(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 Qu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fo(e,t){Qu(e,t),(e=e.alternate)&&Qu(e,t)}function Lh(){return null}var Df=typeof reportError=="function"?reportError:function(e){console.error(e)};function po(e){this._internalRoot=e}Fs.prototype.render=po.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));Ms(e,t,null,null)};Fs.prototype.unmount=po.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jn(function(){Ms(null,e,null,null)}),t[Rt]=null}};function Fs(e){this._internalRoot=e}Fs.prototype.unstable_scheduleHydration=function(e){if(e){var t=md();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&&xd(e)}};function mo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Os(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function qu(){}function Mh(e,t,n,r,l){if(l){if(typeof r=="function"){var a=r;r=function(){var c=ps(i);a.call(c)}}var i=zf(t,r,e,0,null,!1,!1,"",qu);return e._reactRootContainer=i,e[Rt]=i.current,Ir(e.nodeType===8?e.parentNode:e),jn(),i}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var o=r;r=function(){var c=ps(u);o.call(c)}}var u=co(e,0,!1,null,null,!1,!1,"",qu);return e._reactRootContainer=u,e[Rt]=u.current,Ir(e.nodeType===8?e.parentNode:e),jn(function(){Ms(t,u,n,r)}),u}function zs(e,t,n,r,l){var a=n._reactRootContainer;if(a){var i=a;if(typeof l=="function"){var o=l;l=function(){var u=ps(i);o.call(u)}}Ms(t,i,e,l)}else i=Mh(n,t,e,l,r);return ps(i)}fd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=yr(t.pendingLanes);n!==0&&(Pi(t,n|1),Ie(t,ie()),!(V&6)&&(er=ie()+500,sn()))}break;case 13:jn(function(){var r=Tt(e,1);if(r!==null){var l=_e();dt(r,e,1,l)}}),fo(e,1)}};Li=function(e){if(e.tag===13){var t=Tt(e,134217728);if(t!==null){var n=_e();dt(t,e,134217728,n)}fo(e,134217728)}};pd=function(e){if(e.tag===13){var t=Jt(e),n=Tt(e,t);if(n!==null){var r=_e();dt(n,e,t,r)}fo(e,t)}};md=function(){return W};hd=function(e,t){var n=W;try{return W=e,t()}finally{W=n}};La=function(e,t,n){switch(t){case"input":if(Ca(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var l=Es(r);if(!l)throw Error(P(90));Yc(r),Ca(r,l)}}}break;case"textarea":qc(e,n);break;case"select":t=n.value,t!=null&&Un(e,!!n.multiple,t,!1)}};td=ao;nd=jn;var Fh={usingClientEntryPoint:!1,Events:[sl,Ln,Es,Zc,ed,ao]},hr={findFiberByHostInstance:un,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Oh={bundleType:hr.bundleType,version:hr.version,rendererPackageName:hr.rendererPackageName,rendererConfig:hr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Mt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=sd(e),e===null?null:e.stateNode},findFiberByHostInstance:hr.findFiberByHostInstance||Lh,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 El=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!El.isDisabled&&El.supportsFiber)try{ks=El.inject(Oh),gt=El}catch{}}Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fh;Qe.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mo(t))throw Error(P(200));return Ph(e,t,null,n)};Qe.createRoot=function(e,t){if(!mo(e))throw Error(P(299));var n=!1,r="",l=Df;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=co(e,1,!1,null,null,n,!1,r,l),e[Rt]=t.current,Ir(e.nodeType===8?e.parentNode:e),new po(t)};Qe.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(P(188)):(e=Object.keys(e).join(","),Error(P(268,e)));return e=sd(t),e=e===null?null:e.stateNode,e};Qe.flushSync=function(e){return jn(e)};Qe.hydrate=function(e,t,n){if(!Os(t))throw Error(P(200));return zs(null,e,t,!0,n)};Qe.hydrateRoot=function(e,t,n){if(!mo(e))throw Error(P(405));var r=n!=null&&n.hydratedSources||null,l=!1,a="",i=Df;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=zf(t,null,e,1,n??null,l,!1,a,i),e[Rt]=t.current,Ir(e),r)for(e=0;e<r.length;e++)n=r[e],l=n._getVersion,l=l(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,l]:t.mutableSourceEagerHydrationData.push(n,l);return new Fs(t)};Qe.render=function(e,t,n){if(!Os(t))throw Error(P(200));return zs(null,e,t,!1,n)};Qe.unmountComponentAtNode=function(e){if(!Os(e))throw Error(P(40));return e._reactRootContainer?(jn(function(){zs(null,null,e,!1,function(){e._reactRootContainer=null,e[Rt]=null})}),!0):!1};Qe.unstable_batchedUpdates=ao;Qe.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Os(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return zs(e,t,n,!1,r)};Qe.version="18.3.1-next-f1338f8080-20240426";function If(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(If)}catch(e){console.error(e)}}If(),Dc.exports=Qe;var zh=Dc.exports,Ku=zh;ya.createRoot=Ku.createRoot,ya.hydrateRoot=Ku.hydrateRoot;/**
|
|
41
|
+
* react-router v7.12.0
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/var Ju="popstate";function Dh(e={}){function t(r,l){let{pathname:a,search:i,hash:o}=r.location;return fi("",{pathname:a,search:i,hash:o},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function n(r,l){return typeof l=="string"?l:qr(l)}return $h(t,n,null,e)}function te(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function tt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ih(){return Math.random().toString(36).substring(2,10)}function Gu(e,t){return{usr:e.state,key:e.key,idx:t}}function fi(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ar(t):t,state:n,key:t&&t.key||r||Ih()}}function qr({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 ar(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 $h(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:a=!1}=r,i=l.history,o="POP",u=null,c=p();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function p(){return(i.state||{idx:null}).idx}function f(){o="POP";let j=p(),h=j==null?null:j-c;c=j,u&&u({action:o,location:v.location,delta:h})}function x(j,h){o="PUSH";let d=fi(v.location,j,h);c=p()+1;let g=Gu(d,c),S=v.createHref(d);try{i.pushState(g,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;l.location.assign(S)}a&&u&&u({action:o,location:v.location,delta:1})}function y(j,h){o="REPLACE";let d=fi(v.location,j,h);c=p();let g=Gu(d,c),S=v.createHref(d);i.replaceState(g,"",S),a&&u&&u({action:o,location:v.location,delta:0})}function N(j){return Bh(j)}let v={get action(){return o},get location(){return e(l,i)},listen(j){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Ju,f),u=j,()=>{l.removeEventListener(Ju,f),u=null}},createHref(j){return t(l,j)},createURL:N,encodeLocation(j){let h=N(j);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:x,replace:y,go(j){return i.go(j)}};return v}function Bh(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),te(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:qr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function $f(e,t,n="/"){return Uh(e,t,n,!1)}function Uh(e,t,n,r){let l=typeof t=="string"?ar(t):t,a=Pt(l.pathname||"/",n);if(a==null)return null;let i=Bf(e);Hh(i);let o=null;for(let u=0;o==null&&u<i.length;++u){let c=ex(a);o=Xh(i[u],c,r)}return o}function Bf(e,t=[],n=[],r="",l=!1){let a=(i,o,u=l,c)=>{let p={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(r)&&u)return;te(p.relativePath.startsWith(r),`Absolute route path "${p.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(r.length)}let f=Et([r,p.relativePath]),x=n.concat(p);i.children&&i.children.length>0&&(te(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Bf(i.children,t,x,f,u)),!(i.path==null&&!i.index)&&t.push({path:f,score:Jh(f,i.index),routesMeta:x})};return e.forEach((i,o)=>{var u;if(i.path===""||!((u=i.path)!=null&&u.includes("?")))a(i,o);else for(let c of Uf(i.path))a(i,o,!0,c)}),t}function Uf(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return l?[a,""]:[a];let i=Uf(r.join("/")),o=[];return o.push(...i.map(u=>u===""?a:[a,u].join("/"))),l&&o.push(...i),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function Hh(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Gh(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Vh=/^:[\w-]+$/,Wh=3,Yh=2,Qh=1,qh=10,Kh=-2,Xu=e=>e==="*";function Jh(e,t){let n=e.split("/"),r=n.length;return n.some(Xu)&&(r+=Kh),t&&(r+=Yh),n.filter(l=>!Xu(l)).reduce((l,a)=>l+(Vh.test(a)?Wh:a===""?Qh:qh),r)}function Gh(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Xh(e,t,n=!1){let{routesMeta:r}=e,l={},a="/",i=[];for(let o=0;o<r.length;++o){let u=r[o],c=o===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",f=ms({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},p),x=u.route;if(!f&&c&&n&&!r[r.length-1].route.index&&(f=ms({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!f)return null;Object.assign(l,f.params),i.push({params:l,pathname:Et([a,f.pathname]),pathnameBase:lx(Et([a,f.pathnameBase])),route:x}),f.pathnameBase!=="/"&&(a=Et([a,f.pathnameBase]))}return i}function ms(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Zh(e.path,e.caseSensitive,e.end),l=t.match(n);if(!l)return null;let a=l[0],i=a.replace(/(.)\/+$/,"$1"),o=l.slice(1);return{params:r.reduce((c,{paramName:p,isOptional:f},x)=>{if(p==="*"){let N=o[x]||"";i=a.slice(0,a.length-N.length).replace(/(.)\/+$/,"$1")}const y=o[x];return f&&!y?c[p]=void 0:c[p]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:i,pattern:e}}function Zh(e,t=!1,n=!0){tt(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=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function ex(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return tt(!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 Pt(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)||"/"}var Hf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,tx=e=>Hf.test(e);function nx(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?ar(e):e,a;if(n)if(tx(n))a=n;else{if(n.includes("//")){let i=n;n=n.replace(/\/\/+/g,"/"),tt(!1,`Pathnames cannot have embedded double slashes - normalizing ${i} -> ${n}`)}n.startsWith("/")?a=Zu(n.substring(1),"/"):a=Zu(n,t)}else a=t;return{pathname:a,search:sx(r),hash:ax(l)}}function Zu(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function pa(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 rx(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Vf(e){let t=rx(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Wf(e,t,n,r=!1){let l;typeof e=="string"?l=ar(e):(l={...e},te(!l.pathname||!l.pathname.includes("?"),pa("?","pathname","search",l)),te(!l.pathname||!l.pathname.includes("#"),pa("#","pathname","hash",l)),te(!l.search||!l.search.includes("#"),pa("#","search","hash",l)));let a=e===""||l.pathname==="",i=a?"/":l.pathname,o;if(i==null)o=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let x=i.split("/");for(;x[0]==="..";)x.shift(),f-=1;l.pathname=x.join("/")}o=f>=0?t[f]:"/"}let u=nx(l,o),c=i&&i!=="/"&&i.endsWith("/"),p=(a||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||p)&&(u.pathname+="/"),u}var Et=e=>e.join("/").replace(/\/\/+/g,"/"),lx=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sx=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ax=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ix=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 ox(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ux(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Yf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qf(e,t){let n=e;if(typeof n!="string"||!Hf.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,l=!1;if(Yf)try{let a=new URL(window.location.href),i=n.startsWith("//")?new URL(a.protocol+n):new URL(n),o=Pt(i.pathname,t);i.origin===a.origin&&o!=null?n=o+i.search+i.hash:l=!0}catch{tt(!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:l,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var qf=["POST","PUT","PATCH","DELETE"];new Set(qf);var cx=["GET",...qf];new Set(cx);var ir=m.createContext(null);ir.displayName="DataRouter";var Ds=m.createContext(null);Ds.displayName="DataRouterState";var dx=m.createContext(!1),Kf=m.createContext({isTransitioning:!1});Kf.displayName="ViewTransition";var fx=m.createContext(new Map);fx.displayName="Fetchers";var px=m.createContext(null);px.displayName="Await";var nt=m.createContext(null);nt.displayName="Navigation";var il=m.createContext(null);il.displayName="Location";var pt=m.createContext({outlet:null,matches:[],isDataRoute:!1});pt.displayName="Route";var ho=m.createContext(null);ho.displayName="RouteError";var Jf="REACT_ROUTER_ERROR",mx="REDIRECT",hx="ROUTE_ERROR_RESPONSE";function xx(e){if(e.startsWith(`${Jf}:${mx}:{`))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 gx(e){if(e.startsWith(`${Jf}:${hx}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new ix(t.status,t.statusText,t.data)}catch{}}function vx(e,{relative:t}={}){te(ol(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=m.useContext(nt),{hash:l,pathname:a,search:i}=ul(e,{relative:t}),o=a;return n!=="/"&&(o=a==="/"?n:Et([n,a])),r.createHref({pathname:o,search:i,hash:l})}function ol(){return m.useContext(il)!=null}function Ft(){return te(ol(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(il).location}var Gf="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Xf(e){m.useContext(nt).static||m.useLayoutEffect(e)}function xo(){let{isDataRoute:e}=m.useContext(pt);return e?Mx():yx()}function yx(){te(ol(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(ir),{basename:t,navigator:n}=m.useContext(nt),{matches:r}=m.useContext(pt),{pathname:l}=Ft(),a=JSON.stringify(Vf(r)),i=m.useRef(!1);return Xf(()=>{i.current=!0}),m.useCallback((u,c={})=>{if(tt(i.current,Gf),!i.current)return;if(typeof u=="number"){n.go(u);return}let p=Wf(u,JSON.parse(a),l,c.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Et([t,p.pathname])),(c.replace?n.replace:n.push)(p,c.state,c)},[t,n,a,l,e])}var jx=m.createContext(null);function Nx(e){let t=m.useContext(pt).outlet;return m.useMemo(()=>t&&m.createElement(jx.Provider,{value:e},t),[t,e])}function wx(){let{matches:e}=m.useContext(pt),t=e[e.length-1];return t?t.params:{}}function ul(e,{relative:t}={}){let{matches:n}=m.useContext(pt),{pathname:r}=Ft(),l=JSON.stringify(Vf(n));return m.useMemo(()=>Wf(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function kx(e,t){return Zf(e,t)}function Zf(e,t,n,r,l){var d;te(ol(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=m.useContext(nt),{matches:i}=m.useContext(pt),o=i[i.length-1],u=o?o.params:{},c=o?o.pathname:"/",p=o?o.pathnameBase:"/",f=o&&o.route;{let g=f&&f.path||"";tp(c,!f||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) 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.
|
|
50
|
+
|
|
51
|
+
Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let x=Ft(),y;if(t){let g=typeof t=="string"?ar(t):t;te(p==="/"||((d=g.pathname)==null?void 0:d.startsWith(p)),`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 "${p}" but pathname "${g.pathname}" was given in the \`location\` prop.`),y=g}else y=x;let N=y.pathname||"/",v=N;if(p!=="/"){let g=p.replace(/^\//,"").split("/");v="/"+N.replace(/^\//,"").split("/").slice(g.length).join("/")}let j=$f(e,{pathname:v});tt(f||j!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),tt(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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=_x(j&&j.map(g=>Object.assign({},g,{params:Object.assign({},u,g.params),pathname:Et([p,a.encodeLocation?a.encodeLocation(g.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?p:Et([p,a.encodeLocation?a.encodeLocation(g.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),i,n,r,l);return t&&h?m.createElement(il.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},h):h}function bx(){let e=Lx(),t=ox(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)",l={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:a},"ErrorBoundary")," or"," ",m.createElement("code",{style:a},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:l},n):null,i)}var Sx=m.createElement(bx,null),ep=class extends m.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?e.error:t.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"){const n=gx(e.digest);n&&(e=n)}let t=e!==void 0?m.createElement(pt.Provider,{value:this.props.routeContext},m.createElement(ho.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?m.createElement(Cx,{error:e},t):t}};ep.contextType=dx;var ma=new WeakMap;function Cx({children:e,error:t}){let{basename:n}=m.useContext(nt);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=xx(t.digest);if(r){let l=ma.get(t);if(l)throw l;let a=Qf(r.location,n);if(Yf&&!ma.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const i=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw ma.set(t,i),i}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Ex({routeContext:e,match:t,children:n}){let r=m.useContext(ir);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(pt.Provider,{value:e},n)}function _x(e,t=[],n=null,r=null,l=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,i=n==null?void 0:n.errors;if(i!=null){let p=a.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id])!==void 0);te(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,p+1))}let o=!1,u=-1;if(n)for(let p=0;p<a.length;p++){let f=a[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=p),f.route.id){let{loaderData:x,errors:y}=n,N=f.route.loader&&!x.hasOwnProperty(f.route.id)&&(!y||y[f.route.id]===void 0);if(f.route.lazy||N){o=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}let c=n&&r?(p,f)=>{var x,y;r(p,{location:n.location,params:((y=(x=n.matches)==null?void 0:x[0])==null?void 0:y.params)??{},unstable_pattern:ux(n.matches),errorInfo:f})}:void 0;return a.reduceRight((p,f,x)=>{let y,N=!1,v=null,j=null;n&&(y=i&&f.route.id?i[f.route.id]:void 0,v=f.route.errorElement||Sx,o&&(u<0&&x===0?(tp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,j=null):u===x&&(N=!0,j=f.route.hydrateFallbackElement||null)));let h=t.concat(a.slice(0,x+1)),d=()=>{let g;return y?g=v:N?g=j:f.route.Component?g=m.createElement(f.route.Component,null):f.route.element?g=f.route.element:g=p,m.createElement(Ex,{match:f,routeContext:{outlet:p,matches:h,isDataRoute:n!=null},children:g})};return n&&(f.route.ErrorBoundary||f.route.errorElement||x===0)?m.createElement(ep,{location:n.location,revalidation:n.revalidation,component:v,error:y,children:d(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:c}):d()},null)}function go(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rx(e){let t=m.useContext(ir);return te(t,go(e)),t}function Tx(e){let t=m.useContext(Ds);return te(t,go(e)),t}function Ax(e){let t=m.useContext(pt);return te(t,go(e)),t}function vo(e){let t=Ax(e),n=t.matches[t.matches.length-1];return te(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Px(){return vo("useRouteId")}function Lx(){var r;let e=m.useContext(ho),t=Tx("useRouteError"),n=vo("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Mx(){let{router:e}=Rx("useNavigate"),t=vo("useNavigate"),n=m.useRef(!1);return Xf(()=>{n.current=!0}),m.useCallback(async(l,a={})=>{tt(n.current,Gf),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...a}))},[e,t])}var ec={};function tp(e,t,n){!t&&!ec[e]&&(ec[e]=!0,tt(!1,n))}m.memo(Fx);function Fx({routes:e,future:t,state:n,onError:r}){return Zf(e,void 0,n,r,t)}function Ox(e){return Nx(e.context)}function Nt(e){te(!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 zx({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:a=!1,unstable_useTransitions:i}){te(!ol(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:o,navigator:l,static:a,unstable_useTransitions:i,future:{}}),[o,l,a,i]);typeof n=="string"&&(n=ar(n));let{pathname:c="/",search:p="",hash:f="",state:x=null,key:y="default"}=n,N=m.useMemo(()=>{let v=Pt(c,o);return v==null?null:{location:{pathname:v,search:p,hash:f,state:x,key:y},navigationType:r}},[o,c,p,f,x,y,r]);return tt(N!=null,`<Router basename="${o}"> is not able to match the URL "${c}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:m.createElement(nt.Provider,{value:u},m.createElement(il.Provider,{children:t,value:N}))}function Dx({children:e,location:t}){return kx(pi(e),t)}function pi(e,t=[]){let n=[];return m.Children.forEach(e,(r,l)=>{if(!m.isValidElement(r))return;let a=[...t,l];if(r.type===m.Fragment){n.push.apply(n,pi(r.props.children,a));return}te(r.type===Nt,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),te(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=pi(r.props.children,a)),n.push(i)}),n}var Ul="get",Hl="application/x-www-form-urlencoded";function Is(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Ix(e){return Is(e)&&e.tagName.toLowerCase()==="button"}function $x(e){return Is(e)&&e.tagName.toLowerCase()==="form"}function Bx(e){return Is(e)&&e.tagName.toLowerCase()==="input"}function Ux(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Hx(e,t){return e.button===0&&(!t||t==="_self")&&!Ux(e)}function mi(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(l=>[n,l]):[[n,r]])},[]))}function Vx(e,t){let n=mi(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(a=>{n.append(l,a)})}),n}var _l=null;function Wx(){if(_l===null)try{new FormData(document.createElement("form"),0),_l=!1}catch{_l=!0}return _l}var Yx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ha(e){return e!=null&&!Yx.has(e)?(tt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hl}"`),null):e}function Qx(e,t){let n,r,l,a,i;if($x(e)){let o=e.getAttribute("action");r=o?Pt(o,t):null,n=e.getAttribute("method")||Ul,l=ha(e.getAttribute("enctype"))||Hl,a=new FormData(e)}else if(Ix(e)||Bx(e)&&(e.type==="submit"||e.type==="image")){let o=e.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||o.getAttribute("action");if(r=u?Pt(u,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||Ul,l=ha(e.getAttribute("formenctype"))||ha(o.getAttribute("enctype"))||Hl,a=new FormData(o,e),!Wx()){let{name:c,type:p,value:f}=e;if(p==="image"){let x=c?`${c}.`:"";a.append(`${x}x`,"0"),a.append(`${x}y`,"0")}else c&&a.append(c,f)}}else{if(Is(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ul,r=null,l=Hl,i=e}return a&&l==="text/plain"&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:l,formData:a,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function yo(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qx(e,t,n,r){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${r}`:l.pathname=`${l.pathname}.${r}`:l.pathname==="/"?l.pathname=`_root.${r}`:t&&Pt(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${r}`,l}async function Kx(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Jx(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 Gx(e,t,n){let r=await Promise.all(e.map(async l=>{let a=t.routes[l.route.id];if(a){let i=await Kx(a,n);return i.links?i.links():[]}return[]}));return tg(r.flat(1).filter(Jx).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function tc(e,t,n,r,l,a){let i=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,o=(u,c)=>{var p;return n[c].pathname!==u.pathname||((p=n[c].route.path)==null?void 0:p.endsWith("*"))&&n[c].params["*"]!==u.params["*"]};return a==="assets"?t.filter((u,c)=>i(u,c)||o(u,c)):a==="data"?t.filter((u,c)=>{var f;let p=r.routes[u.route.id];if(!p||!p.hasLoader)return!1;if(i(u,c)||o(u,c))return!0;if(u.route.shouldRevalidate){let x=u.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Xx(e,t,{includeHydrateFallback:n}={}){return Zx(e.map(r=>{let l=t.routes[r.route.id];if(!l)return[];let a=[l.module];return l.clientActionModule&&(a=a.concat(l.clientActionModule)),l.clientLoaderModule&&(a=a.concat(l.clientLoaderModule)),n&&l.hydrateFallbackModule&&(a=a.concat(l.hydrateFallbackModule)),l.imports&&(a=a.concat(l.imports)),a}).flat(1))}function Zx(e){return[...new Set(e)]}function eg(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function tg(e,t){let n=new Set;return new Set(t),e.reduce((r,l)=>{let a=JSON.stringify(eg(l));return n.has(a)||(n.add(a),r.push({key:a,link:l})),r},[])}function np(){let e=m.useContext(ir);return yo(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ng(){let e=m.useContext(Ds);return yo(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var jo=m.createContext(void 0);jo.displayName="FrameworkContext";function rp(){let e=m.useContext(jo);return yo(e,"You must render this element inside a <HydratedRouter> element"),e}function rg(e,t){let n=m.useContext(jo),[r,l]=m.useState(!1),[a,i]=m.useState(!1),{onFocus:o,onBlur:u,onMouseEnter:c,onMouseLeave:p,onTouchStart:f}=t,x=m.useRef(null);m.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let v=h=>{h.forEach(d=>{i(d.isIntersecting)})},j=new IntersectionObserver(v,{threshold:.5});return x.current&&j.observe(x.current),()=>{j.disconnect()}}},[e]),m.useEffect(()=>{if(r){let v=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(v)}}},[r]);let y=()=>{l(!0)},N=()=>{l(!1),i(!1)};return n?e!=="intent"?[a,x,{}]:[a,x,{onFocus:xr(o,y),onBlur:xr(u,N),onMouseEnter:xr(c,y),onMouseLeave:xr(p,N),onTouchStart:xr(f,y)}]:[!1,x,{}]}function xr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function lg({page:e,...t}){let{router:n}=np(),r=m.useMemo(()=>$f(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(ag,{page:e,matches:r,...t}):null}function sg(e){let{manifest:t,routeModules:n}=rp(),[r,l]=m.useState([]);return m.useEffect(()=>{let a=!1;return Gx(e,t,n).then(i=>{a||l(i)}),()=>{a=!0}},[e,t,n]),r}function ag({page:e,matches:t,...n}){let r=Ft(),{future:l,manifest:a,routeModules:i}=rp(),{basename:o}=np(),{loaderData:u,matches:c}=ng(),p=m.useMemo(()=>tc(e,t,c,a,r,"data"),[e,t,c,a,r]),f=m.useMemo(()=>tc(e,t,c,a,r,"assets"),[e,t,c,a,r]),x=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,j=!1;if(t.forEach(d=>{var S;let g=a.routes[d.route.id];!g||!g.hasLoader||(!p.some(k=>k.route.id===d.route.id)&&d.route.id in u&&((S=i[d.route.id])!=null&&S.shouldRevalidate)||g.hasClientLoader?j=!0:v.add(d.route.id))}),v.size===0)return[];let h=qx(e,o,l.unstable_trailingSlashAwareDataRequests,"data");return j&&v.size>0&&h.searchParams.set("_routes",t.filter(d=>v.has(d.route.id)).map(d=>d.route.id).join(",")),[h.pathname+h.search]},[o,l.unstable_trailingSlashAwareDataRequests,u,r,a,p,t,e,i]),y=m.useMemo(()=>Xx(f,a),[f,a]),N=sg(f);return m.createElement(m.Fragment,null,x.map(v=>m.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),y.map(v=>m.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),N.map(({key:v,link:j})=>m.createElement("link",{key:v,nonce:n.nonce,...j})))}function ig(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var og=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{og&&(window.__reactRouterVersion="7.12.0")}catch{}function ug({basename:e,children:t,unstable_useTransitions:n,window:r}){let l=m.useRef();l.current==null&&(l.current=Dh({window:r,v5Compat:!0}));let a=l.current,[i,o]=m.useState({action:a.action,location:a.location}),u=m.useCallback(c=>{n===!1?o(c):m.startTransition(()=>o(c))},[n]);return m.useLayoutEffect(()=>a.listen(u),[a,u]),m.createElement(zx,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:a,unstable_useTransitions:n})}var lp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Re=m.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:l,reloadDocument:a,replace:i,state:o,target:u,to:c,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:x,...y},N){let{basename:v,unstable_useTransitions:j}=m.useContext(nt),h=typeof c=="string"&&lp.test(c),d=Qf(c,v);c=d.to;let g=vx(c,{relative:l}),[S,k,T]=rg(r,y),A=pg(c,{replace:i,state:o,target:u,preventScrollReset:p,relative:l,viewTransition:f,unstable_defaultShouldRevalidate:x,unstable_useTransitions:j});function L(F){t&&t(F),F.defaultPrevented||A(F)}let O=m.createElement("a",{...y,...T,href:d.absoluteURL||g,onClick:d.isExternal||a?t:L,ref:ig(N,k),target:u,"data-discover":!h&&n==="render"?"true":void 0});return S&&!h?m.createElement(m.Fragment,null,O,m.createElement(lg,{page:g})):O});Re.displayName="Link";var cg=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:l=!1,style:a,to:i,viewTransition:o,children:u,...c},p){let f=ul(i,{relative:c.relative}),x=Ft(),y=m.useContext(Ds),{navigator:N,basename:v}=m.useContext(nt),j=y!=null&&yg(f)&&o===!0,h=N.encodeLocation?N.encodeLocation(f).pathname:f.pathname,d=x.pathname,g=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(d=d.toLowerCase(),g=g?g.toLowerCase():null,h=h.toLowerCase()),g&&v&&(g=Pt(g,v)||g);const S=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let k=d===h||!l&&d.startsWith(h)&&d.charAt(S)==="/",T=g!=null&&(g===h||!l&&g.startsWith(h)&&g.charAt(h.length)==="/"),A={isActive:k,isPending:T,isTransitioning:j},L=k?t:void 0,O;typeof r=="function"?O=r(A):O=[r,k?"active":null,T?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let F=typeof a=="function"?a(A):a;return m.createElement(Re,{...c,"aria-current":L,className:O,ref:p,style:F,to:i,viewTransition:o},typeof u=="function"?u(A):u)});cg.displayName="NavLink";var dg=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:l,state:a,method:i=Ul,action:o,onSubmit:u,relative:c,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:x,...y},N)=>{let{unstable_useTransitions:v}=m.useContext(nt),j=gg(),h=vg(o,{relative:c}),d=i.toLowerCase()==="get"?"get":"post",g=typeof o=="string"&&lp.test(o),S=k=>{if(u&&u(k),k.defaultPrevented)return;k.preventDefault();let T=k.nativeEvent.submitter,A=(T==null?void 0:T.getAttribute("formmethod"))||i,L=()=>j(T||k.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:l,state:a,relative:c,preventScrollReset:p,viewTransition:f,unstable_defaultShouldRevalidate:x});v&&n!==!1?m.startTransition(()=>L()):L()};return m.createElement("form",{ref:N,method:d,action:h,onSubmit:r?u:S,...y,"data-discover":!g&&e==="render"?"true":void 0})});dg.displayName="Form";function fg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sp(e){let t=m.useContext(ir);return te(t,fg(e)),t}function pg(e,{target:t,replace:n,state:r,preventScrollReset:l,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:o,unstable_useTransitions:u}={}){let c=xo(),p=Ft(),f=ul(e,{relative:a});return m.useCallback(x=>{if(Hx(x,t)){x.preventDefault();let y=n!==void 0?n:qr(p)===qr(f),N=()=>c(e,{replace:y,state:r,preventScrollReset:l,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:o});u?m.startTransition(()=>N()):N()}},[p,c,f,n,r,t,e,l,a,i,o,u])}function mg(e){tt(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=m.useRef(mi(e)),n=m.useRef(!1),r=Ft(),l=m.useMemo(()=>Vx(r.search,n.current?null:t.current),[r.search]),a=xo(),i=m.useCallback((o,u)=>{const c=mi(typeof o=="function"?o(new URLSearchParams(l)):o);n.current=!0,a("?"+c,u)},[a,l]);return[l,i]}var hg=0,xg=()=>`__${String(++hg)}__`;function gg(){let{router:e}=sp("useSubmit"),{basename:t}=m.useContext(nt),n=Px(),r=e.fetch,l=e.navigate;return m.useCallback(async(a,i={})=>{let{action:o,method:u,encType:c,formData:p,body:f}=Qx(a,t);if(i.navigate===!1){let x=i.fetcherKey||xg();await r(x,n,i.action||o,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:f,formMethod:i.method||u,formEncType:i.encType||c,flushSync:i.flushSync})}else await l(i.action||o,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:f,formMethod:i.method||u,formEncType:i.encType||c,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[r,l,t,n])}function vg(e,{relative:t}={}){let{basename:n}=m.useContext(nt),r=m.useContext(pt);te(r,"useFormAction must be used inside a RouteContext");let[l]=r.matches.slice(-1),a={...ul(e||".",{relative:t})},i=Ft();if(e==null){a.search=i.search;let o=new URLSearchParams(a.search),u=o.getAll("index");if(u.some(p=>p==="")){o.delete("index"),u.filter(f=>f).forEach(f=>o.append("index",f));let p=o.toString();a.search=p?`?${p}`:""}}return(!e||e===".")&&l.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:Et([n,a.pathname])),qr(a)}function yg(e,{relative:t}={}){let n=m.useContext(Kf);te(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=sp("useViewTransitionState"),l=ul(e,{relative:t});if(!n.isTransitioning)return!1;let a=Pt(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Pt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ms(l.pathname,i)!=null||ms(l.pathname,a)!=null}/**
|
|
52
|
+
* @license lucide-react v0.468.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const jg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ap=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
57
|
+
* @license lucide-react v0.468.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*/var Ng={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"};/**
|
|
62
|
+
* @license lucide-react v0.468.0 - ISC
|
|
63
|
+
*
|
|
64
|
+
* This source code is licensed under the ISC license.
|
|
65
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
+
*/const wg=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:a,iconNode:i,...o},u)=>m.createElement("svg",{ref:u,...Ng,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ap("lucide",l),...o},[...i.map(([c,p])=>m.createElement(c,p)),...Array.isArray(a)?a:[a]]));/**
|
|
67
|
+
* @license lucide-react v0.468.0 - ISC
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the ISC license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/const B=(e,t)=>{const n=m.forwardRef(({className:r,...l},a)=>m.createElement(wg,{ref:a,iconNode:t,className:ap(`lucide-${jg(e)}`,r),...l}));return n.displayName=`${e}`,n};/**
|
|
72
|
+
* @license lucide-react v0.468.0 - ISC
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the ISC license.
|
|
75
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/const hs=B("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
77
|
+
* @license lucide-react v0.468.0 - ISC
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the ISC license.
|
|
80
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/const kg=B("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"}]]);/**
|
|
82
|
+
* @license lucide-react v0.468.0 - ISC
|
|
83
|
+
*
|
|
84
|
+
* This source code is licensed under the ISC license.
|
|
85
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
+
*/const Kr=B("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
87
|
+
* @license lucide-react v0.468.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/const Be=B("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
92
|
+
* @license lucide-react v0.468.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const rt=B("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
97
|
+
* @license lucide-react v0.468.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const Nn=B("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"}]]);/**
|
|
102
|
+
* @license lucide-react v0.468.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const No=B("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
107
|
+
* @license lucide-react v0.468.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const ip=B("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"}]]);/**
|
|
112
|
+
* @license lucide-react v0.468.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/const wo=B("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
117
|
+
* @license lucide-react v0.468.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const ko=B("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
122
|
+
* @license lucide-react v0.468.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const op=B("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"}]]);/**
|
|
127
|
+
* @license lucide-react v0.468.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const tn=B("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
132
|
+
* @license lucide-react v0.468.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const bo=B("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
137
|
+
* @license lucide-react v0.468.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const bg=B("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"}]]);/**
|
|
142
|
+
* @license lucide-react v0.468.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const up=B("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"}]]);/**
|
|
147
|
+
* @license lucide-react v0.468.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const cp=B("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"}]]);/**
|
|
152
|
+
* @license lucide-react v0.468.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const So=B("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"}]]);/**
|
|
157
|
+
* @license lucide-react v0.468.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const Sg=B("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
162
|
+
* @license lucide-react v0.468.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const nc=B("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"}]]);/**
|
|
167
|
+
* @license lucide-react v0.468.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const Cg=B("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
|
|
172
|
+
* @license lucide-react v0.468.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const Eg=B("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"}]]);/**
|
|
177
|
+
* @license lucide-react v0.468.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const rc=B("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
182
|
+
* @license lucide-react v0.468.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const dp=B("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
187
|
+
* @license lucide-react v0.468.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const _g=B("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
192
|
+
* @license lucide-react v0.468.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const fp=B("Pen",[["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"}]]);/**
|
|
197
|
+
* @license lucide-react v0.468.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const mn=B("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
202
|
+
* @license lucide-react v0.468.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const ke=B("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
207
|
+
* @license lucide-react v0.468.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const xs=B("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"}]]);/**
|
|
212
|
+
* @license lucide-react v0.468.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const Co=B("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
217
|
+
* @license lucide-react v0.468.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const Rg=B("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
222
|
+
* @license lucide-react v0.468.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const pp=B("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"}]]);/**
|
|
227
|
+
* @license lucide-react v0.468.0 - ISC
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the ISC license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const Tg=B("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"}]]);/**
|
|
232
|
+
* @license lucide-react v0.468.0 - ISC
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the ISC license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const Ag=B("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
237
|
+
* @license lucide-react v0.468.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const Pg=B("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
242
|
+
* @license lucide-react v0.468.0 - ISC
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the ISC license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const $e=B("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"}]]);/**
|
|
247
|
+
* @license lucide-react v0.468.0 - ISC
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the ISC license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const Eo=B("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
|
|
252
|
+
* @license lucide-react v0.468.0 - ISC
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the ISC license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const Lg=B("Variable",[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]);/**
|
|
257
|
+
* @license lucide-react v0.468.0 - ISC
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the ISC license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const Jr=B("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"}]]);/**
|
|
262
|
+
* @license lucide-react v0.468.0 - ISC
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the ISC license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const jt=B("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
267
|
+
* @license lucide-react v0.468.0 - ISC
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the ISC license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const tr=B("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Mg=[{path:"/",label:"Dashboard",icon:Eg},{path:"/results",label:"Results",icon:So},{path:"/builder",label:"Builder",icon:Jr},{path:"/datasets",label:"Datasets",icon:tn}];function Fg(){const e=Ft(),[t,n]=m.useState(()=>typeof window<"u"?localStorage.getItem("theme")==="light":!1);return m.useEffect(()=>{t?(document.documentElement.classList.add("light"),localStorage.setItem("theme","light")):(document.documentElement.classList.remove("light"),localStorage.setItem("theme","dark"))},[t]),s.jsxs("div",{className:"app-shell",children:[s.jsxs("aside",{className:"sidebar",children:[s.jsx("div",{className:"p-5 border-b border-slate-800/70",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--app-text)"},children:"Sandboxy Local"}),s.jsx("p",{className:"text-sm",style:{color:"var(--app-muted)"},children:"Development Server"})]}),s.jsx("button",{onClick:()=>n(!t),className:"p-2 rounded-lg transition-colors hover:bg-slate-500/20",title:t?"Switch to dark mode":"Switch to light mode",children:t?s.jsx(_g,{size:20,style:{color:"var(--app-muted)"}}):s.jsx(Ag,{size:20,style:{color:"var(--app-muted)"}})})]})}),s.jsx("nav",{className:"p-4",children:s.jsx("ul",{className:"space-y-2",children:Mg.map(({path:r,label:l,icon:a})=>s.jsx("li",{children:s.jsxs(Re,{to:r,"data-active":e.pathname===r,className:"nav-link",children:[s.jsx(a,{size:20}),l]})},r))})})]}),s.jsx("main",{className:"flex-1 overflow-auto",children:s.jsx(Ox,{})})]})}function Og(){const[e,t]=m.useState(null),[n,r]=m.useState(!0),[l,a]=m.useState(null);return m.useEffect(()=>{fetch("/api/v1/local/status").then(i=>{if(!i.ok)throw new Error("Failed to fetch status");return i.json()}).then(t).catch(i=>a(i.message)).finally(()=>r(!1))},[]),n?s.jsx("div",{className:"p-8 page",children:s.jsx("div",{className:"text-slate-400",children:"Loading..."})}):l?s.jsx("div",{className:"p-8 page",children:s.jsxs("div",{className:"text-red-400",children:["Error: ",l]})}):e?s.jsxs("div",{className:"p-8 page",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-2",children:"Dashboard"}),s.jsxs("p",{className:"text-slate-400",children:["Root: ",s.jsx("code",{className:"panel-subtle px-2 py-1 rounded",children:e.root_dir})]})]}),s.jsxs("section",{className:"mb-8",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-lg font-semibold text-slate-100 flex items-center gap-2",children:[s.jsx(cp,{size:20}),"Scenarios (",e.scenarios.length,")"]}),s.jsxs(Re,{to:"/builder",className:"flex items-center gap-1 px-3 py-1.5 bg-orange-400 hover:bg-orange-300 text-slate-900 rounded-lg text-sm font-semibold",children:[s.jsx(ke,{size:16}),"Create Scenario"]})]}),e.scenarios.length===0?s.jsx("p",{className:"text-slate-400",children:"No scenarios found in scenarios/"}):s.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.scenarios.map(i=>s.jsxs("div",{className:"panel-card p-4",children:[s.jsx("h3",{className:"font-medium text-slate-100 mb-1",children:i.name}),s.jsx("p",{className:"text-sm text-slate-400 mb-3 line-clamp-2",children:i.description||"No description"}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-slate-500",children:i.relative_path}),s.jsxs(Re,{to:`/run/${i.id}`,className:"flex items-center gap-1 px-3 py-1 bg-orange-400 text-slate-900 rounded hover:bg-orange-300 transition-colors text-sm font-medium",children:[s.jsx(mn,{size:14}),"Run"]})]})]},i.id))})]}),s.jsxs("section",{className:"mb-8",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-lg font-semibold text-slate-100 flex items-center gap-2",children:[s.jsx(Jr,{size:20}),"Tools (",e.tools.length,")"]}),s.jsxs(Re,{to:"/tool-builder",className:"flex items-center gap-1 px-3 py-1.5 bg-emerald-400 hover:bg-emerald-300 text-slate-900 rounded-lg text-sm font-semibold",children:[s.jsx(ke,{size:16}),"Create Tool"]})]}),e.tools.length===0?s.jsx("p",{className:"text-slate-400",children:"No tools found in tools/"}):s.jsx("div",{className:"flex flex-wrap gap-2",children:e.tools.map(i=>s.jsx("span",{className:"px-3 py-1 panel-subtle rounded-full text-sm text-slate-200 border border-slate-700/60",children:i.name},i.id))})]}),s.jsxs("section",{className:"mb-8",children:[s.jsxs("h2",{className:"text-lg font-semibold text-slate-100 mb-4 flex items-center gap-2",children:[s.jsx(kg,{size:20}),"Agents (",e.agents.length,")"]}),e.agents.length===0?s.jsx("p",{className:"text-slate-400",children:"No agents found in agents/"}):s.jsx("div",{className:"flex flex-wrap gap-2",children:e.agents.map(i=>s.jsx("span",{className:"px-3 py-1 panel-subtle rounded-full text-sm text-slate-200 border border-slate-700/60",children:i.name},i.id))})]})]}):null}const zg="/api/v1";class Dg{async fetch(t,n){const r=await fetch(`${zg}${t}`,{...n,headers:{"Content-Type":"application/json",...n==null?void 0:n.headers}});if(!r.ok){const l=await r.json().catch(()=>({detail:"Unknown error"}));throw new Error(l.detail||`HTTP ${r.status}`)}return r.json()}async getStatus(){return this.fetch("/local/status")}async listScenarios(){return this.fetch("/local/scenarios")}async getScenario(t){return this.fetch(`/local/scenarios/${encodeURIComponent(t)}`)}async getScenarioGoals(t){return this.fetch(`/local/scenarios/${encodeURIComponent(t)}/goals`)}async getScenarioTools(t){return this.fetch(`/local/scenarios/${encodeURIComponent(t)}/tools`)}async listTools(){return this.fetch("/local/tools")}async getTool(t){return this.fetch(`/local/tools/${encodeURIComponent(t)}`)}async listAgents(){return this.fetch("/local/agents")}async getAgent(t){return this.fetch(`/local/agents/${encodeURIComponent(t)}`)}async listModels(){return this.fetch("/local/models")}async listRuns(){return this.fetch("/local/runs")}async getRun(t){return this.fetch(`/local/runs/${encodeURIComponent(t)}`)}async runScenario(t){return this.fetch("/local/run",{method:"POST",body:JSON.stringify(t)})}async compareModels(t){return this.fetch("/local/compare",{method:"POST",body:JSON.stringify(t)})}async listDatasets(){return this.fetch("/local/datasets")}async getDataset(t){return this.fetch(`/local/datasets/${encodeURIComponent(t)}`)}async saveDataset(t,n){return this.fetch("/local/datasets",{method:"POST",body:JSON.stringify({id:t,content:n})})}async updateDataset(t,n){return this.fetch(`/local/datasets/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({id:t,content:n})})}async deleteDataset(t){return this.fetch(`/local/datasets/${encodeURIComponent(t)}`,{method:"DELETE"})}async runDataset(t){return this.fetch("/local/run-dataset",{method:"POST",body:JSON.stringify(t)})}}const xe=new Dg;function Ig(){const[e,t]=m.useState("idle"),[n,r]=m.useState(null),[l,a]=m.useState(null),[i,o]=m.useState(null),u=m.useCallback(()=>{t("idle"),r(null),a(null),o(null)},[]),c=m.useCallback(async(f,x,y,N)=>{u(),t("running");try{const v=await xe.runScenario({scenario_id:f,model:x,variables:y,mlflow_export:N==null?void 0:N.enabled,mlflow_tracking_uri:N==null?void 0:N.trackingUri,mlflow_experiment:N==null?void 0:N.experiment,mlflow_tracing:N==null?void 0:N.tracing});v.error?(t("error"),o(v.error)):(t("completed"),r(v))}catch(v){t("error"),o(v instanceof Error?v.message:"Unknown error")}},[u]),p=m.useCallback(async(f,x,y=1,N,v)=>{u(),t("running");try{const j=await xe.compareModels({scenario_id:f,models:x,runs_per_model:y,variables:N,mlflow_export:v==null?void 0:v.enabled,mlflow_tracking_uri:v==null?void 0:v.trackingUri,mlflow_experiment:v==null?void 0:v.experiment,mlflow_tracing:v==null?void 0:v.tracing});t("completed"),a(j)}catch(j){t("error"),o(j instanceof Error?j.message:"Unknown error")}},[u]);return{state:e,result:n,comparison:l,error:i,runScenario:c,compareModels:p,reset:u}}function mp(e){return e==null?"-":e<1e-4?"<$0.0001":e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function _o({result:e}){var r,l,a;const[t,n]=m.useState(!1);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:[e.evaluation&&s.jsxs("div",{className:"panel-card p-4 col-span-2 md:col-span-1",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(Eo,{className:"w-4 h-4"}),"Score"]}),s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.evaluation.percentage.toFixed(0),"%"]}),s.jsxs("div",{className:"text-xs text-slate-500",children:[e.evaluation.total_score.toFixed(0)," / ",e.evaluation.max_score.toFixed(0)," pts"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(wo,{className:"w-4 h-4"}),"Latency"]}),s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[((e.latency_ms||0)/1e3).toFixed(1),"s"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(dp,{className:"w-4 h-4"}),"Messages"]}),s.jsx("div",{className:"text-2xl font-bold text-slate-100",children:((r=e.history)==null?void 0:r.length)||0})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(tr,{className:"w-4 h-4"}),"Tool Calls"]}),s.jsx("div",{className:"text-2xl font-bold text-slate-100",children:((l=e.tool_calls)==null?void 0:l.length)||0})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(Cg,{className:"w-4 h-4"}),"Tokens"]}),s.jsx("div",{className:"text-2xl font-bold text-slate-100",children:((e.input_tokens||0)+(e.output_tokens||0)).toLocaleString()}),s.jsxs("div",{className:"text-xs text-slate-500",children:[(e.input_tokens||0).toLocaleString()," in / ",(e.output_tokens||0).toLocaleString()," out"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(bo,{className:"w-4 h-4"}),"Cost"]}),s.jsx("div",{className:"text-2xl font-bold text-emerald-300",children:mp(e.cost_usd)})]})]}),e.evaluation&&e.evaluation.goals&&e.evaluation.goals.length>0&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Goals"}),s.jsx("div",{className:"space-y-3",children:e.evaluation.goals.map(i=>s.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${i.achieved?"bg-emerald-500/10 border-emerald-400/40":"bg-slate-950/40 border-slate-800/70"}`,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[i.achieved?s.jsx(No,{className:"w-5 h-5 text-emerald-400"}):s.jsx(ip,{className:"w-5 h-5 text-slate-500"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-slate-100",children:i.name||i.id}),i.reason&&s.jsx("div",{className:"text-sm text-slate-400",children:i.reason})]})]}),s.jsxs("div",{className:`font-bold ${i.achieved?"text-emerald-300":"text-slate-500"}`,children:[i.achieved?`+${i.points}`:"0"," pts"]})]},i.id))})]}),((a=e.evaluation)==null?void 0:a.judge)&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Judge Evaluation"}),s.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[s.jsxs("div",{className:`text-3xl font-bold ${e.evaluation.judge.passed?"text-emerald-300":"text-red-400"}`,children:[(e.evaluation.judge.score*100).toFixed(0),"%"]}),s.jsx("div",{className:`px-3 py-1 rounded-full text-sm ${e.evaluation.judge.passed?"bg-emerald-500/15 text-emerald-300":"bg-red-900/50 text-red-400"}`,children:e.evaluation.judge.passed?"Passed":"Failed"})]}),s.jsx("p",{className:"text-slate-400",children:e.evaluation.judge.reasoning})]}),e.response&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Response"}),s.jsx("div",{className:"panel-subtle rounded-lg p-4 whitespace-pre-wrap text-slate-200",children:e.response||"(No response)"})]}),e.history&&e.history.length>0&&s.jsxs("div",{className:"panel-card",children:[s.jsxs("button",{onClick:()=>n(!t),className:"w-full p-4 text-left flex items-center justify-between hover:bg-slate-800/60 transition-colors rounded-lg",children:[s.jsxs("span",{className:"font-semibold text-slate-100",children:["Conversation History (",e.history.length," messages)"]}),s.jsx("span",{className:"text-slate-400",children:t?"Hide":"Show"})]}),t&&s.jsx("div",{className:"px-6 pb-6 space-y-4",children:e.history.map((i,o)=>s.jsxs("div",{className:`p-3 rounded-lg ${i.role==="user"?"bg-orange-500/10 border border-orange-400/40":i.role==="assistant"?"panel-subtle":i.role==="tool"?"bg-amber-500/10 border border-amber-400/40":"panel-subtle"}`,children:[s.jsx("div",{className:"text-xs font-medium text-slate-500 mb-1 uppercase",children:i.role}),s.jsx("div",{className:"text-slate-200 whitespace-pre-wrap text-sm",children:i.content||"(empty)"})]},o))})]}),e.tool_calls&&e.tool_calls.length>0&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsxs("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:["Tool Calls (",e.tool_calls.length,")"]}),s.jsx("div",{className:"space-y-3",children:e.tool_calls.map((i,o)=>s.jsx($g,{call:i},o))})]}),e.error&&s.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-red-500 bg-red-950/30",children:[s.jsxs("div",{className:"flex items-center gap-2 text-red-400 mb-1",children:[s.jsx(Nn,{className:"w-4 h-4"}),s.jsx("span",{className:"font-medium",children:"Error"})]}),s.jsx("p",{className:"text-sm text-red-300",children:e.error})]})]})}function lc(e){if(typeof e=="string")try{const t=JSON.parse(e);return JSON.stringify(t,null,2)}catch{return e}return JSON.stringify(e,null,2)}function $g({call:e}){const[t,n]=m.useState(!1),r=e.result!==void 0&&e.result!==null,l=e.error!==void 0&&e.error!==null;return s.jsxs("div",{className:`panel-subtle rounded-lg overflow-hidden ${e.success?"":"border border-red-500/30"}`,children:[s.jsxs("button",{onClick:()=>n(!t),className:"w-full p-4 text-left flex items-center justify-between hover:bg-slate-800/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[t?s.jsx(Be,{className:"w-4 h-4 text-slate-500"}):s.jsx(rt,{className:"w-4 h-4 text-slate-500"}),s.jsxs("code",{className:"text-orange-300",children:[e.tool,".",e.action,"()"]})]}),s.jsx("span",{className:`text-sm ${e.success?"text-emerald-300":"text-red-400"}`,children:e.success?"✓ Success":"✗ Failed"})]}),t&&s.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-medium text-slate-500 mb-1",children:"Arguments"}),s.jsx("pre",{className:"text-xs text-slate-400 overflow-auto bg-slate-950/50 rounded p-2",children:lc(e.args)})]}),r&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-medium text-emerald-400 mb-1",children:"Result"}),s.jsx("pre",{className:"text-xs text-slate-400 overflow-auto bg-emerald-950/30 rounded p-2 max-h-48",children:lc(e.result)})]}),l&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-medium text-red-400 mb-1",children:"Error"}),s.jsx("pre",{className:"text-xs text-red-300 overflow-auto bg-red-950/30 rounded p-2",children:e.error})]})]})]})}function Bg(e){var o;const t=e.ranking||[],n=[];for(const u of t){const c=(o=e.stats)==null?void 0:o[u];if(!c)continue;const p=c.avg_score||0,f=c.avg_cost_usd||0,x=c.avg_latency_ms||0,y=f>0?p/(f*100):p>0?1/0:0;n.push({modelId:u,score:p,cost:f,latency:x,efficiency:y,badges:[]})}if(n.length===0)return n;const r=n.reduce((u,c)=>u.score>c.score?u:c),l=n.reduce((u,c)=>u.efficiency>c.efficiency?u:c),a=n.filter(u=>u.score>=r.score*.7),i=a.length>0?a.reduce((u,c)=>u.latency<c.latency?u:c):null;for(const u of n)u.modelId===r.modelId&&u.badges.push("quality"),u.modelId===l.modelId&&l.cost>0&&u.badges.push("value"),i&&u.modelId===i.modelId&&u.badges.push("fast");return n}function Ug({type:e}){switch(e){case"quality":return s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-amber-500/20 text-amber-300 border border-amber-500/30",children:[s.jsx(Eo,{className:"w-3 h-3"})," Best Quality"]});case"value":return s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",children:[s.jsx(bo,{className:"w-3 h-3"})," Best Value"]});case"fast":return s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-blue-500/20 text-blue-300 border border-blue-500/30",children:[s.jsx(tr,{className:"w-3 h-3"})," Fastest"]});default:return null}}function Hg({run:e,onClose:t}){return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70",onClick:t,children:s.jsxs("div",{className:"bg-slate-900 rounded-xl max-w-4xl w-full max-h-[90vh] overflow-hidden flex flex-col",onClick:n=>n.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-800",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-100",children:"Run Details"}),s.jsx("p",{className:"text-sm text-slate-400",children:e.model})]}),s.jsx("button",{onClick:t,className:"p-2 text-slate-400 hover:text-slate-100 hover:bg-slate-800 rounded-lg",children:s.jsx(jt,{className:"w-5 h-5"})})]}),s.jsx("div",{className:"overflow-auto p-4",children:s.jsx(_o,{result:e})})]})})}function hp({comparison:e}){var p,f,x,y,N,v,j,h;const[t,n]=m.useState(null),[r,l]=m.useState(null),a=e.ranking||[],i=Bg(e),o=new Map(i.map(d=>[d.modelId,d])),u=new Map;if(e.results)for(const d of e.results){const g=u.get(d.model)||[];g.push(d),u.set(d.model,g)}const c=e.results&&e.results.length>0;return s.jsxs(s.Fragment,{children:[r&&s.jsx(Hg,{run:r,onClose:()=>l(null)}),s.jsxs("div",{className:"space-y-6",children:[i.length>0&&s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.find(d=>d.badges.includes("quality"))&&s.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-amber-400",children:[s.jsxs("div",{className:"flex items-center gap-2 text-amber-300 mb-1",children:[s.jsx(Eo,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Best Quality"})]}),s.jsx("div",{className:"text-lg font-semibold text-slate-100",children:((p=i.find(d=>d.badges.includes("quality")))==null?void 0:p.modelId.split("/")[1])||((f=i.find(d=>d.badges.includes("quality")))==null?void 0:f.modelId)}),s.jsxs("div",{className:"text-xs text-slate-400 mt-1",children:["Highest score: ",(x=i.find(d=>d.badges.includes("quality")))==null?void 0:x.score.toFixed(1)," pts"]})]}),i.find(d=>d.badges.includes("value"))&&s.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-emerald-400",children:[s.jsxs("div",{className:"flex items-center gap-2 text-emerald-300 mb-1",children:[s.jsx(bo,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Best Value"})]}),s.jsx("div",{className:"text-lg font-semibold text-slate-100",children:((y=i.find(d=>d.badges.includes("value")))==null?void 0:y.modelId.split("/")[1])||((N=i.find(d=>d.badges.includes("value")))==null?void 0:N.modelId)}),s.jsx("div",{className:"text-xs text-slate-400 mt-1",children:(()=>{const d=i.find(T=>T.badges.includes("value")),g=i.find(T=>T.badges.includes("quality"));if(!d||!g)return"";if(d.cost===0)return"Free!";if(d.modelId===g.modelId)return"Also the best quality!";const S=Math.round(d.score/g.score*100),k=g.cost>0?Math.round(d.cost/g.cost*100):0;return k===0?`${S}% quality, nearly free`:`${S}% quality at ${k}% cost`})()})]}),i.find(d=>d.badges.includes("fast"))&&s.jsxs("div",{className:"panel-card p-4 border-l-4 border-l-blue-400",children:[s.jsxs("div",{className:"flex items-center gap-2 text-blue-300 mb-1",children:[s.jsx(tr,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Fastest"})]}),s.jsx("div",{className:"text-lg font-semibold text-slate-100",children:((v=i.find(d=>d.badges.includes("fast")))==null?void 0:v.modelId.split("/")[1])||((j=i.find(d=>d.badges.includes("fast")))==null?void 0:j.modelId)}),s.jsxs("div",{className:"text-xs text-slate-400 mt-1",children:[((((h=i.find(d=>d.badges.includes("fast")))==null?void 0:h.latency)||0)/1e3).toFixed(1),"s avg latency"]})]})]}),s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"p-4 border-b border-slate-800/70",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:"Model Comparison"}),s.jsxs("p",{className:"text-sm text-slate-400",children:[e.runs_per_model," run(s) per model"]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{className:"bg-slate-950/70",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-3 text-left text-sm font-medium text-slate-400",children:"Rank"}),s.jsx("th",{className:"px-4 py-3 text-left text-sm font-medium text-slate-400",children:"Model"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Score"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Judge"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Latency"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Tokens"}),s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:"Cost"})]})}),s.jsx("tbody",{children:a.map((d,g)=>{var L,O;const S=(L=e.stats)==null?void 0:L[d],k=o.get(d),T=u.get(d)||[],A=t===d;return S?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:`border-t border-slate-800/70 hover:bg-slate-900/40 ${c?"cursor-pointer":""}`,onClick:()=>c&&n(A?null:d),children:[s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[c&&(A?s.jsx(Be,{className:"w-4 h-4 text-slate-500"}):s.jsx(rt,{className:"w-4 h-4 text-slate-500"})),s.jsxs("span",{className:`font-bold ${g===0?"text-amber-300":"text-slate-400"}`,children:["#",g+1]})]})}),s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"text-slate-100 font-medium",children:d}),k&&k.badges.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:k.badges.map(F=>s.jsx(Ug,{type:F},F))})]}),s.jsx("td",{className:"px-4 py-3 text-right text-slate-100 font-semibold",children:((O=S.avg_score)==null?void 0:O.toFixed(1))||"0"}),s.jsx("td",{className:"px-4 py-3 text-right text-slate-400",children:S.avg_judge_score!=null?`${(S.avg_judge_score*100).toFixed(0)}%`:"-"}),s.jsxs("td",{className:"px-4 py-3 text-right text-slate-400",children:[((S.avg_latency_ms||0)/1e3).toFixed(1),"s"]}),s.jsx("td",{className:"px-4 py-3 text-right text-slate-400",children:((S.total_input_tokens||0)+(S.total_output_tokens||0)).toLocaleString()}),s.jsx("td",{className:"px-4 py-3 text-right text-emerald-300 font-medium",children:mp(S.avg_cost_usd)})]},d),A&&T.length>0&&s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"px-4 py-2 bg-slate-950/50",children:s.jsxs("div",{className:"ml-8 space-y-2",children:[s.jsxs("div",{className:"text-sm font-medium text-slate-400 mb-2",children:["Individual Runs (",T.length,")"]}),T.map((F,U)=>{var Y,re,le;return s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-slate-900/50 border border-slate-800/50 hover:bg-slate-800/50 cursor-pointer",onClick:_=>{_.stopPropagation(),l(F)},children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-slate-500 text-sm",children:["Run ",U+1]}),s.jsxs("span",{className:"text-slate-100 font-medium",children:[((re=(Y=F.evaluation)==null?void 0:Y.percentage)==null?void 0:re.toFixed(0))||0,"%"]}),((le=F.evaluation)==null?void 0:le.judge)&&s.jsx("span",{className:`text-sm ${F.evaluation.judge.passed?"text-emerald-300":"text-red-400"}`,children:F.evaluation.judge.passed?"✓ Passed":"✗ Failed"}),F.error&&s.jsxs("span",{className:"text-sm text-red-400 flex items-center gap-1",children:[s.jsx(Nn,{className:"w-3 h-3"})," Error"]})]}),s.jsxs("button",{className:"flex items-center gap-1 text-sm text-orange-300 hover:text-orange-200",onClick:_=>{_.stopPropagation(),l(F)},children:[s.jsx(up,{className:"w-4 h-4"}),"View Details"]})]},U)})]})})},`${d}-runs`)]}):null})})]})})]}),e.stats&&Object.values(e.stats).some(d=>d.goal_rates&&Object.keys(d.goal_rates).length>0)&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-slate-100 mb-4",children:"Goal Achievement Rates"}),(()=>{const d=new Set;return Object.values(e.stats).forEach(g=>{g.goal_rates&&Object.keys(g.goal_rates).forEach(S=>d.add(S))}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full",children:[s.jsx("thead",{className:"bg-slate-950/70",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-3 text-left text-sm font-medium text-slate-400",children:"Model"}),Array.from(d).map(g=>s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:g},g))]})}),s.jsx("tbody",{children:a.map(g=>{var k;const S=(k=e.stats)==null?void 0:k[g];return S?s.jsxs("tr",{className:"border-t border-slate-800/70",children:[s.jsx("td",{className:"px-4 py-3 text-slate-100 font-medium",children:g}),Array.from(d).map(T=>{var L;const A=((L=S.goal_rates)==null?void 0:L[T])??0;return s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsxs("span",{className:A>=100?"text-emerald-300":A>=50?"text-amber-300":"text-red-400",children:[A.toFixed(0),"%"]})},T)})]},g):null})})]})})})()]})]})]})}function sc({models:e,value:t,onChange:n,disabled:r,placeholder:l="Select a model..."}){const[a,i]=m.useState(!1),[o,u]=m.useState(""),c=m.useRef(null),p=m.useRef(null),f=e.find(j=>j.id===t);m.useEffect(()=>{const j=h=>{c.current&&!c.current.contains(h.target)&&i(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]),m.useEffect(()=>{a&&p.current&&p.current.focus()},[a]);const x=e.filter(j=>j.name.toLowerCase().includes(o.toLowerCase())||j.id.toLowerCase().includes(o.toLowerCase())),y=x.reduce((j,h)=>{const d=h.id.split("/")[0]||"other";return j[d]||(j[d]=[]),j[d].push(h),j},{}),N=["openai","anthropic","google","x-ai","deepseek","meta-llama","mistralai","qwen","perplexity"],v=Object.keys(y).sort((j,h)=>{const d=N.indexOf(j),g=N.indexOf(h);return d===-1&&g===-1?j.localeCompare(h):d===-1?1:g===-1?-1:d-g});return s.jsxs("div",{ref:c,className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>!r&&i(!a),disabled:r,className:`w-full flex items-center justify-between gap-2 px-4 py-2.5 panel-subtle text-left transition-colors ${r?"opacity-50 cursor-not-allowed":"hover:bg-slate-800 cursor-pointer"} ${a?"ring-2 ring-orange-400":""}`,children:[f?s.jsxs("div",{className:"flex items-center justify-between flex-1 min-w-0",children:[s.jsx("span",{className:"text-slate-100 truncate",children:f.name}),s.jsx("span",{className:"text-xs text-slate-500 ml-2 shrink-0",children:f.price})]}):s.jsx("span",{className:"text-slate-500",children:l}),s.jsx(Be,{size:18,className:`text-slate-400 shrink-0 transition-transform ${a?"rotate-180":""}`})]}),a&&s.jsxs("div",{className:"absolute z-50 w-full mt-1 panel-card border border-slate-700/80 dark:border-slate-700/80 shadow-xl max-h-[28rem] overflow-hidden flex flex-col",children:[s.jsx("div",{className:"p-2 border-b border-slate-800/70",children:s.jsxs("div",{className:"relative",children:[s.jsx(Co,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),s.jsx("input",{ref:p,type:"text",value:o,onChange:j=>u(j.target.value),placeholder:"Search models...",className:"w-full pl-9 pr-3 py-2 bg-slate-900 border border-slate-800/70 rounded text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-orange-400/60"})]})}),s.jsxs("div",{className:"overflow-y-auto flex-1",children:[v.map(j=>s.jsxs("div",{children:[s.jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-slate-500 uppercase bg-slate-900 sticky top-0",children:j}),y[j].map(h=>s.jsxs("button",{type:"button",onClick:()=>{n(h.id),i(!1),u("")},className:`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${h.id===t?"bg-orange-500/20 text-orange-300":"hover:bg-slate-800 text-slate-100"}`,children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"truncate",children:h.name})}),s.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:h.price}),h.id===t&&s.jsx(Kr,{size:16,className:"text-orange-400 shrink-0"})]},h.id))]},j)),x.length===0&&s.jsx("div",{className:"px-3 py-4 text-center text-slate-500 text-sm",children:"No models found"})]})]})]})}function Vg({models:e,selected:t,onChange:n,disabled:r}){const[l,a]=m.useState(!1),[i,o]=m.useState(""),u=m.useRef(null),c=m.useRef(null);m.useEffect(()=>{const j=h=>{u.current&&!u.current.contains(h.target)&&a(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]),m.useEffect(()=>{l&&c.current&&c.current.focus()},[l]);const p=j=>{t.includes(j)?n(t.filter(h=>h!==j)):n([...t,j])},f=(j,h)=>{h.stopPropagation(),n(t.filter(d=>d!==j))},x=e.filter(j=>j.name.toLowerCase().includes(i.toLowerCase())||j.id.toLowerCase().includes(i.toLowerCase())),y=x.reduce((j,h)=>{const d=h.id.split("/")[0]||"other";return j[d]||(j[d]=[]),j[d].push(h),j},{}),N=["openai","anthropic","google","x-ai","deepseek","meta-llama","mistralai","qwen","perplexity"],v=Object.keys(y).sort((j,h)=>{const d=N.indexOf(j),g=N.indexOf(h);return d===-1&&g===-1?j.localeCompare(h):d===-1?1:g===-1?-1:d-g});return s.jsxs("div",{ref:u,className:"relative",children:[t.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(j=>{const h=e.find(d=>d.id===j);return s.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 py-1 bg-orange-500/20 border border-orange-400/40 rounded-full text-sm text-slate-100",children:[(h==null?void 0:h.name)||j,s.jsx("button",{type:"button",onClick:d=>f(j,d),className:"hover:text-red-400 transition-colors",disabled:r,children:s.jsx(jt,{size:14})})]},j)})}),s.jsxs("button",{type:"button",onClick:()=>!r&&a(!l),disabled:r,className:`w-full flex items-center justify-between gap-2 px-4 py-2.5 panel-subtle text-left transition-colors ${r?"opacity-50 cursor-not-allowed":"hover:bg-slate-800 cursor-pointer"} ${l?"ring-2 ring-orange-400":""}`,children:[s.jsx("span",{className:"text-slate-500",children:t.length===0?"Click to add models...":"Add more models..."}),s.jsx(Be,{size:18,className:`text-slate-400 shrink-0 transition-transform ${l?"rotate-180":""}`})]}),l&&s.jsxs("div",{className:"absolute z-50 w-full mt-1 panel-card border border-slate-700/80 dark:border-slate-700/80 shadow-xl max-h-[28rem] overflow-hidden flex flex-col",children:[s.jsx("div",{className:"p-2 border-b border-slate-800/70",children:s.jsxs("div",{className:"relative",children:[s.jsx(Co,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),s.jsx("input",{ref:c,type:"text",value:i,onChange:j=>o(j.target.value),placeholder:"Search models...",className:"w-full pl-9 pr-3 py-2 bg-slate-900 border border-slate-800/70 rounded text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-orange-400/60"})]})}),s.jsxs("div",{className:"overflow-y-auto flex-1",children:[v.map(j=>s.jsxs("div",{children:[s.jsx("div",{className:"px-3 py-1.5 text-xs font-medium text-slate-500 uppercase bg-slate-900 sticky top-0",children:j}),y[j].map(h=>{const d=t.includes(h.id);return s.jsxs("button",{type:"button",onClick:()=>p(h.id),className:`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${d?"bg-orange-500/20 text-orange-300":"hover:bg-slate-800 text-slate-100"}`,children:[s.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center shrink-0 ${d?"bg-orange-400 border-orange-400":"border-slate-600"}`,children:d&&s.jsx(Kr,{size:12,className:"text-slate-900"})}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"truncate",children:h.name})}),s.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:h.price})]},h.id)})]},j)),x.length===0&&s.jsx("div",{className:"px-3 py-4 text-center text-slate-500 text-sm",children:"No models found"})]})]})]})}function ac(){var zo;const{scenarioId:e}=wx(),[t]=mg(),n=t.get("dataset"),r=parseInt(t.get("parallel")||"5"),[l,a]=m.useState([]),[i,o]=m.useState(null),[u,c]=m.useState(e||""),[p,f]=m.useState([]),[x,y]=m.useState(""),[N,v]=m.useState([]),[j,h]=m.useState(n?"dataset":"single"),[d,g]=m.useState(1),[S,k]=m.useState({}),[T,A]=m.useState(!0),[L,O]=m.useState(null),[F,U]=m.useState([]),[Y,re]=m.useState(n||""),[le,_]=m.useState(null),[C,E]=m.useState(!1),[w,b]=m.useState(r),[R,M]=m.useState(!1),[I,X]=m.useState(!1),[J,lt]=m.useState(""),[Pe,st]=m.useState(""),[bn,cl]=m.useState(!0),{state:se,result:Ot,comparison:Fo,error:Oo,runScenario:sm,compareModels:am}=Ig();m.useEffect(()=>{(async()=>{try{const[Le,Ue,um]=await Promise.all([xe.listScenarios(),xe.listModels(),xe.listDatasets()]);if(a(Le),f(Ue),U(um),Ue.length>0&&y(Ue[0].id),e){c(e);const Do=await xe.getScenario(e);o(Do);const Io={};for(const $o of Do.variables||[])Io[$o.name]=$o.default??"";k(Io)}}catch(Le){O(Le instanceof Error?Le.message:"Failed to load data")}finally{A(!1)}})()},[e]),m.useEffect(()=>{u&&u!==e&&xe.getScenario(u).then($=>{o($);const Le={};for(const Ue of $.variables||[])Le[Ue.name]=Ue.default??"";k(Le)}).catch($=>O($.message))},[u,e]);const im=async()=>{const $=u||e;if(!$)return;const Le=R?{enabled:!0,trackingUri:J||void 0,experiment:Pe||void 0,tracing:bn}:void 0;if(j==="dataset"){if(!Y||!x)return;E(!0),_(null);try{const Ue=await xe.runDataset({scenario_id:$,dataset_id:Y,model:x,parallel:w,mlflow_enabled:R,mlflow_experiment:Pe||void 0});_(Ue)}catch(Ue){O(Ue instanceof Error?Ue.message:"Dataset run failed")}finally{E(!1)}}else if(j==="single"){if(!x)return;await sm($,x,S,Le)}else{if(N.length===0)return;await am($,N,d,S,Le)}},om=($,Le)=>{k(Ue=>({...Ue,[$]:Le}))};return T?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(rc,{className:"w-8 h-8 animate-spin text-orange-400"})}):L?s.jsx("div",{className:"p-8 page",children:s.jsx("div",{className:"panel-solid p-4 text-red-400 border border-red-700/60",children:L})}):s.jsxs("div",{className:"p-8 max-w-6xl mx-auto page",children:[s.jsxs(Re,{to:"/",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100 mb-6",children:[s.jsx(hs,{size:20}),"Back to Dashboard"]}),s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-2",children:(i==null?void 0:i.name)||e}),(i==null?void 0:i.description)&&s.jsx("p",{className:"text-slate-400",children:i.description})]}),s.jsxs("div",{className:"panel-card p-6 mb-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-lg font-semibold text-slate-100",children:"Run Configuration"}),s.jsxs(Re,{to:"/builder",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100 text-sm",children:[s.jsx(Tg,{size:16}),"Edit Scenario"]})]}),!e&&s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Scenario"}),s.jsxs("select",{value:u,onChange:$=>c($.target.value),disabled:se==="running"||C,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400",children:[s.jsx("option",{value:"",children:"Select a scenario..."}),l.map($=>s.jsx("option",{value:$.id,children:$.name},$.id))]})]}),s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Mode"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>h("single"),disabled:se==="running"||C,className:`px-4 py-2 rounded-lg transition-colors ${j==="single"?"bg-orange-400 text-slate-900":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:"Single Model"}),s.jsx("button",{onClick:()=>h("compare"),disabled:se==="running"||C,className:`px-4 py-2 rounded-lg transition-colors ${j==="compare"?"bg-orange-400 text-slate-900":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:"Compare Models"}),s.jsxs("button",{onClick:()=>h("dataset"),disabled:se==="running"||C||F.length===0,className:`flex items-center gap-2 px-4 py-2 rounded-lg transition-colors ${j==="dataset"?"bg-blue-500 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:[s.jsx(tn,{size:16}),"Dataset Benchmark"]})]})]}),j==="single"?s.jsxs("div",{className:"mb-6",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Model"}),s.jsx(sc,{models:p,value:x,onChange:y,disabled:se==="running"})]}):j==="compare"?s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Models to Compare"}),s.jsx(Vg,{models:p,selected:N,onChange:v,disabled:se==="running"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Runs per Model"}),s.jsx("input",{type:"number",min:1,max:10,value:d,onChange:$=>g(Math.max(1,Math.min(10,parseInt($.target.value)||1))),disabled:se==="running",className:"w-32 panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"More runs = more statistical significance"})]})]}):s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Dataset"}),s.jsxs("select",{value:Y,onChange:$=>re($.target.value),disabled:C,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-400",children:[s.jsx("option",{value:"",children:"Select a dataset..."}),F.map($=>s.jsxs("option",{value:$.id,children:[$.name," (",$.case_count," cases)"]},$.id))]}),F.length===0&&s.jsxs("p",{className:"mt-1 text-xs text-slate-500",children:["No datasets found. ",s.jsx(Re,{to:"/datasets",className:"text-blue-400 hover:underline",children:"Create one"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Model"}),s.jsx(sc,{models:p,value:x,onChange:y,disabled:C})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Parallel Runs"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"number",min:1,max:20,value:w,onChange:$=>b(Math.max(1,Math.min(20,parseInt($.target.value)||1))),disabled:C,className:"w-20 panel-subtle px-3 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-blue-400"}),s.jsx("span",{className:"text-sm text-slate-500",children:"concurrent cases"})]}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Higher = faster, but may hit rate limits"})]})]}),i&&i.variables&&i.variables.length>0&&s.jsxs("div",{className:"mb-6 p-4 panel-subtle",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(pp,{size:18,className:"text-slate-400"}),s.jsx("h3",{className:"font-medium text-slate-100",children:"Variables"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.variables.map($=>s.jsx(Yg,{variable:$,value:S[$.name],onChange:Le=>om($.name,Le),disabled:se==="running"},$.name))})]}),s.jsxs("div",{className:"mb-6 p-4 panel-subtle",children:[s.jsxs("button",{onClick:()=>X(!I),className:"flex items-center gap-2 w-full text-left",children:[I?s.jsx(Be,{size:18}):s.jsx(rt,{size:18}),s.jsx("span",{className:"font-medium text-slate-100",children:"MLflow Tracking"}),R&&s.jsx("span",{className:"ml-2 px-2 py-0.5 text-xs bg-green-500/20 text-green-400 rounded",children:"Enabled"})]}),I&&s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:R,onChange:$=>M($.target.checked),disabled:se==="running"||C,className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),s.jsx("span",{className:"text-slate-200",children:"Enable MLflow tracking"})]}),R&&s.jsxs(s.Fragment,{children:[j!=="dataset"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-1",children:"Tracking URI"}),s.jsx("input",{type:"text",value:J,onChange:$=>lt($.target.value),disabled:se==="running",placeholder:"http://127.0.0.1:5000 (uses MLFLOW_TRACKING_URI if empty)",className:"w-full panel-subtle px-3 py-2 text-slate-100 text-sm focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-1",children:"Experiment Name"}),s.jsx("input",{type:"text",value:Pe,onChange:$=>st($.target.value),disabled:se==="running"||C,placeholder:j==="dataset"?`${(i==null?void 0:i.name)||"scenario"}-dataset`:(i==null?void 0:i.name)||"Defaults to scenario name",className:"w-full panel-subtle px-3 py-2 text-slate-100 text-sm focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),j!=="dataset"&&s.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:bn,onChange:$=>cl($.target.checked),disabled:se==="running",className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-200",children:"Enable LLM Tracing"}),s.jsx("p",{className:"text-xs text-slate-500",children:"Capture detailed traces of each LLM call"})]})]}),s.jsxs("p",{className:"text-xs text-slate-500 flex items-center gap-1",children:[s.jsx(bg,{size:12}),"View results at your MLflow server after the run completes"]})]})]})]}),s.jsx("button",{onClick:im,disabled:se==="running"||C||!u||(j==="single"?!x:j==="compare"?N.length===0:!Y||!x),className:`flex items-center gap-2 ${j==="dataset"?"bg-blue-500 hover:bg-blue-400":"bg-orange-400 hover:bg-orange-300"} disabled:bg-slate-700 disabled:text-slate-400 disabled:cursor-not-allowed text-slate-900 px-6 py-2 rounded-lg transition-colors font-semibold`,children:se==="running"||C?s.jsxs(s.Fragment,{children:[s.jsx(rc,{className:"w-4 h-4 animate-spin"}),"Running..."]}):s.jsxs(s.Fragment,{children:[j==="dataset"?s.jsx(tn,{className:"w-4 h-4"}):s.jsx(mn,{className:"w-4 h-4"}),j==="single"?"Run Scenario":j==="compare"?`Compare ${N.length} Models`:`Run ${((zo=F.find($=>$.id===Y))==null?void 0:zo.case_count)||0} Cases`]})})]}),Oo&&s.jsx("div",{className:"panel-solid border border-red-700/60 p-4 mb-6 text-red-400",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ip,{className:"w-5 h-5"}),s.jsx("span",{children:Oo})]})}),Ot&&s.jsx(_o,{result:Ot}),Fo&&s.jsx(hp,{comparison:Fo}),le&&s.jsx(Wg,{result:le})]})}function Wg({result:e}){const[t,n]=m.useState(new Set),r=l=>{const a=new Set(t);a.has(l)?a.delete(l):a.add(l),n(a)};return s.jsxs("div",{className:"panel-card p-6",children:[s.jsxs("h2",{className:"text-xl font-semibold text-slate-100 mb-4 flex items-center gap-2",children:[s.jsx(tn,{size:20}),"Dataset Benchmark Results"]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[s.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.passed_cases,"/",e.total_cases]}),s.jsx("div",{className:"text-sm text-slate-400",children:"Cases Passed"})]}),s.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[s.jsxs("div",{className:`text-2xl font-bold ${e.pass_rate>=.9?"text-green-400":e.pass_rate>=.7?"text-yellow-400":"text-red-400"}`,children:[(e.pass_rate*100).toFixed(1),"%"]}),s.jsx("div",{className:"text-sm text-slate-400",children:"Pass Rate"})]}),s.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.avg_percentage.toFixed(1),"%"]}),s.jsx("div",{className:"text-sm text-slate-400",children:"Avg Score"})]}),s.jsxs("div",{className:"panel-subtle p-4 rounded-lg",children:[s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[(e.total_time_ms/1e3).toFixed(1),"s"]}),s.jsx("div",{className:"text-sm text-slate-400",children:"Total Time"})]})]}),Object.keys(e.by_expected).length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h3",{className:"font-medium text-slate-300 mb-3",children:"By Expected Outcome"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:Object.entries(e.by_expected).map(([l,a])=>{const i=a.passed+a.failed,o=i>0?a.passed/i:0;return s.jsxs("div",{className:"panel-subtle p-3 rounded",children:[s.jsx("div",{className:"font-medium text-slate-200",children:l}),s.jsxs("div",{className:"text-sm text-slate-400",children:[a.passed,"/",i," (",(o*100).toFixed(0),"%)"]})]},l)})})]}),s.jsxs("div",{children:[s.jsxs("h3",{className:"font-medium text-slate-300 mb-3",children:["Case Results (",e.failed_cases," failed)"]}),s.jsx("div",{className:"space-y-2 max-h-[40vh] overflow-y-auto",children:e.case_results.map(l=>s.jsxs("div",{className:`panel-subtle rounded-lg overflow-hidden ${l.passed?"":"border border-red-500/30"}`,children:[s.jsxs("button",{onClick:()=>r(l.case_id),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-slate-700/50 transition-colors",children:[l.passed?s.jsx(Kr,{size:16,className:"text-green-400"}):s.jsx(jt,{size:16,className:"text-red-400"}),s.jsx("span",{className:"font-medium text-slate-200",children:l.case_id}),l.expected&&s.jsxs("span",{className:"text-sm text-slate-400",children:["expected: ",l.expected]}),s.jsxs("span",{className:"ml-auto text-sm text-slate-400",children:[l.percentage.toFixed(0),"% | ",l.latency_ms,"ms"]})]}),t.has(l.case_id)&&s.jsxs("div",{className:"px-4 pb-3 pt-1 border-t border-slate-700",children:[l.failure_reason&&s.jsx("div",{className:"text-red-400 text-sm mb-2",children:l.failure_reason}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-400",children:"Expected:"})," ",s.jsx("span",{className:"text-slate-200",children:l.expected||"N/A"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-400",children:"Actual:"})," ",s.jsx("span",{className:"text-slate-200",children:l.actual_outcome||"None"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-400",children:"Score:"})," ",s.jsxs("span",{className:"text-slate-200",children:[l.goal_score,"/",l.max_score]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-400",children:"Latency:"})," ",s.jsxs("span",{className:"text-slate-200",children:[l.latency_ms,"ms"]})]})]})]})]},l.case_id))})]})]})}function Yg({variable:e,value:t,onChange:n,disabled:r}){const l="w-full panel-subtle px-3 py-2 text-slate-100 text-sm focus:outline-none focus:ring-2 focus:ring-orange-400 disabled:opacity-50";return s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-1",children:[e.label,e.required&&s.jsx("span",{className:"text-red-400 ml-1",children:"*"})]}),e.type==="select"&&e.options.length>0?s.jsxs("select",{value:String(t??""),onChange:a=>n(a.target.value),disabled:r,className:l,children:[s.jsx("option",{value:"",children:"Select..."}),e.options.map(a=>s.jsx("option",{value:a,children:a},a))]}):e.type==="boolean"?s.jsxs("select",{value:String(t??""),onChange:a=>n(a.target.value==="true"),disabled:r,className:l,children:[s.jsx("option",{value:"",children:"Select..."}),s.jsx("option",{value:"true",children:"True"}),s.jsx("option",{value:"false",children:"False"})]}):e.type==="number"?s.jsx("input",{type:"number",value:String(t??""),onChange:a=>n(a.target.value?Number(a.target.value):""),disabled:r,placeholder:e.default!==null?`Default: ${e.default}`:"",className:l}):s.jsx("input",{type:"text",value:String(t??""),onChange:a=>n(a.target.value),disabled:r,placeholder:e.default!==null?`Default: ${e.default}`:"",className:l})]})}const ic=e=>e.scenario_id.endsWith("_comparison")||e.filename.includes("_comparison_"),oc=e=>e.scenario_id.includes("_dataset_")||e.filename.includes("_dataset_"),Rl=e=>e.replace(/_comparison$/,"").replace(/_dataset_.*$/,"");function Qg(){const[e,t]=m.useState([]),[n,r]=m.useState(!0),[l,a]=m.useState(null),[i,o]=m.useState(null),[u,c]=m.useState(null),[p,f]=m.useState(!1),[x,y]=m.useState(!1),[N,v]=m.useState(""),[j,h]=m.useState("all"),[d,g]=m.useState(new Set),S=_=>{g(C=>{const E=new Set(C);return E.has(_)?E.delete(_):E.add(_),E})},{filteredResults:k,groupedResults:T,scenarioOrder:A}=m.useMemo(()=>{let _=e.filter(w=>{if(N){const b=N.toLowerCase();if(!w.scenario_id.toLowerCase().includes(b))return!1}if(j!=="all"){const b=ic(w),R=oc(w);if(j==="comparison"&&!b||j==="dataset"&&!R||j==="single"&&(b||R))return!1}return!0});_=_.sort((w,b)=>new Date(b.timestamp).getTime()-new Date(w.timestamp).getTime());const C={},E=[];for(const w of _){const b=Rl(w.scenario_id);C[b]||(C[b]=[],E.push(b)),C[b].push(w)}return{filteredResults:_,groupedResults:C,scenarioOrder:E}},[e,N,j]);m.useEffect(()=>{fetch("/api/v1/local/runs").then(_=>{if(!_.ok)throw new Error("Failed to fetch results");return _.json()}).then(t).catch(_=>a(_.message)).finally(()=>r(!1))},[]);const L=async _=>{try{const C=await fetch(`/api/v1/local/runs/${encodeURIComponent(_)}`);if(!C.ok)throw new Error("Failed to fetch result");const E=await C.json();o(E),c(_),f(!1)}catch(C){console.error("Error fetching result:",C)}},O=async()=>{if(i)try{await navigator.clipboard.writeText(JSON.stringify(i,null,2)),y(!0),setTimeout(()=>y(!1),2e3)}catch(_){console.error("Failed to copy:",_)}},F=_=>{var M,I,X,J,lt;if(!_)return"unknown";const C=_.case_results||((M=_.result)==null?void 0:M.case_results),E=_.dataset_id||((I=_.result)==null?void 0:I.dataset_id);if(C||E)return"dataset";if(_.ranking||((X=_.result)==null?void 0:X.ranking))return"comparison";const b=_.model||((J=_.result)==null?void 0:J.model),R=_.response||((lt=_.result)==null?void 0:lt.response);return b||R!==void 0?"single":"unknown"},U=_=>{const C=_.result||_;return{id:C.id||"",scenario_id:C.scenario_id||_.scenario_id||"",model:C.model||"",response:C.response||"",history:C.history||[],tool_calls:C.tool_calls||[],final_state:C.final_state||{},evaluation:C.evaluation||null,latency_ms:C.latency_ms||0,input_tokens:C.input_tokens||0,output_tokens:C.output_tokens||0,cost_usd:C.cost_usd||null,error:C.error||null}},Y=_=>{const C=_.result||_;return{scenario_id:C.scenario_id||_.scenario_id||"",scenario_name:C.scenario_name||_.scenario_id||"",models:C.models||[],runs_per_model:C.runs_per_model||1,stats:C.stats||{},ranking:C.ranking||[],winner:C.winner||null,results:C.results||[]}},re=_=>{const C=_.result||_;return{scenario_id:C.scenario_id||_.scenario_id||"",model:C.model||"",dataset_id:C.dataset_id||"",total_cases:C.total_cases||0,passed_cases:C.passed_cases||0,failed_cases:C.failed_cases||0,pass_rate:C.pass_rate||0,avg_score:C.avg_score||0,avg_percentage:C.avg_percentage||0,by_expected:C.by_expected||{},total_time_ms:C.total_time_ms||0,case_results:C.case_results||[]}};if(n)return s.jsx("div",{className:"p-8 page",children:s.jsx("div",{className:"text-slate-400",children:"Loading..."})});if(l)return s.jsx("div",{className:"p-8 page",children:s.jsxs("div",{className:"text-red-400",children:["Error: ",l]})});const le=F(i);return s.jsxs("div",{className:"p-8 page",children:[s.jsx("h1",{className:"text-2xl font-semibold text-slate-100 mb-6",children:"Run Results"}),e.length===0?s.jsxs("div",{className:"panel-card p-6 text-center",children:[s.jsx(So,{size:48,className:"mx-auto text-slate-600 mb-4"}),s.jsx("p",{className:"text-slate-400 mb-2",children:"No run results found"}),s.jsx("p",{className:"text-slate-500 text-sm mb-4",children:"Run a scenario to see results here."}),s.jsxs(Re,{to:"/",className:"inline-flex items-center gap-2 text-orange-300 hover:text-orange-200",children:[s.jsx(mn,{size:16}),"Go to Dashboard"]})]}):s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Co,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),s.jsx("input",{type:"text",placeholder:"Search scenarios...",value:N,onChange:_=>v(_.target.value),className:"w-full bg-slate-900/60 border border-slate-700/50 rounded-lg pl-10 pr-4 py-2 text-sm text-slate-100 placeholder-slate-500 focus:outline-none focus:border-orange-400/50"})]}),s.jsxs("div",{className:"flex flex-wrap gap-1 p-1 bg-slate-900/60 rounded-lg border border-slate-700/50",children:[s.jsx("button",{onClick:()=>h("all"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors ${j==="all"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:"All"}),s.jsxs("button",{onClick:()=>h("single"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center justify-center gap-1 ${j==="single"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[s.jsx(tr,{size:12}),"Single"]}),s.jsxs("button",{onClick:()=>h("comparison"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center justify-center gap-1 ${j==="comparison"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[s.jsx(nc,{size:12}),"Compare"]}),s.jsxs("button",{onClick:()=>h("dataset"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors flex items-center justify-center gap-1 ${j==="dataset"?"bg-blue-600/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[s.jsx(tn,{size:12}),"Dataset"]})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("h2",{className:"text-sm font-medium text-slate-400",children:[k.length," result",k.length!==1?"s":""," in ",A.length," scenario",A.length!==1?"s":""]}),N&&s.jsx("button",{onClick:()=>v(""),className:"text-xs text-slate-500 hover:text-slate-300",children:"Clear"})]}),s.jsx("div",{className:"space-y-2 max-h-[70vh] overflow-y-auto pr-2",children:A.length===0?s.jsxs("div",{className:"text-center py-8 text-slate-500",children:[s.jsx(Sg,{size:24,className:"mx-auto mb-2 opacity-50"}),s.jsx("p",{className:"text-sm",children:"No results match your filters"})]}):A.map(_=>{const C=T[_],E=d.has(_);return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("button",{onClick:()=>S(_),className:"w-full flex items-center justify-between p-3 hover:bg-slate-800/40 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[E?s.jsx(rt,{size:16,className:"text-slate-500"}):s.jsx(Be,{size:16,className:"text-slate-500"}),s.jsx("span",{className:"font-medium text-slate-200 text-sm",children:_})]}),s.jsx("span",{className:"text-xs text-slate-500 bg-slate-800/60 px-2 py-0.5 rounded",children:C.length})]}),!E&&s.jsx("div",{className:"border-t border-slate-800/50",children:C.map(w=>{const b=ic(w),R=oc(w);return s.jsxs("div",{className:`flex items-center justify-between p-3 cursor-pointer transition-colors border-l-2 ${u===w.filename?"bg-slate-800/60 border-l-orange-400":"hover:bg-slate-800/40 border-l-transparent"}`,onClick:()=>L(w.filename),children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[R?s.jsx(tn,{size:14,className:"text-blue-400 flex-shrink-0"}):b?s.jsx(nc,{size:14,className:"text-purple-400 flex-shrink-0"}):s.jsx(tr,{size:14,className:"text-orange-400 flex-shrink-0"}),s.jsx("div",{className:"min-w-0",children:s.jsxs("p",{className:"text-xs text-slate-400 flex items-center gap-1",children:[s.jsx(wo,{size:10}),new Date(w.timestamp).toLocaleString()]})})]}),s.jsx(Re,{to:`/run/${Rl(w.scenario_id)}`,onClick:M=>M.stopPropagation(),className:"p-1.5 text-slate-500 hover:text-orange-300 hover:bg-slate-700/60 rounded flex-shrink-0",title:"Run again",children:s.jsx(mn,{size:12})})]},w.filename)})})]},_)})})]}),s.jsx("div",{className:"lg:col-span-2",children:i?s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"panel-card p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h2",{className:"font-semibold text-slate-100 truncate",children:Rl(i.scenario_id)}),le==="single"&&U(i).model&&s.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Model: ",U(i).model]}),le==="comparison"&&s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Model Comparison"}),le==="dataset"&&s.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Dataset: ",re(i).dataset_id," | Model: ",re(i).model]})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.jsxs("button",{onClick:O,className:`flex items-center gap-1 text-xs px-2 py-1 border rounded whitespace-nowrap transition-colors ${x?"text-emerald-400 border-emerald-500/50 bg-emerald-500/10":"text-slate-400 hover:text-slate-100 border-slate-700/70"}`,children:[s.jsx(op,{size:12}),x?"Copied!":"Copy JSON"]}),s.jsx("button",{onClick:()=>f(!p),className:"text-xs text-slate-400 hover:text-slate-100 px-2 py-1 border border-slate-700/70 rounded whitespace-nowrap",children:p?"View Details":"View JSON"}),s.jsxs(Re,{to:`/run/${Rl(i.scenario_id)}`,className:"flex items-center gap-1 bg-orange-400 hover:bg-orange-300 text-slate-900 px-3 py-1 rounded text-sm font-semibold whitespace-nowrap",children:[s.jsx(mn,{size:14}),"Run Again"]})]})]})}),p?s.jsx("div",{className:"panel-card p-4",children:s.jsx("pre",{className:"text-xs text-slate-300 bg-slate-950/70 p-3 rounded overflow-auto max-h-[70vh]",children:JSON.stringify(i,null,2)})}):s.jsxs(s.Fragment,{children:[le==="single"&&s.jsx(_o,{result:U(i)}),le==="comparison"&&s.jsx(hp,{comparison:Y(i)}),le==="dataset"&&s.jsx(qg,{result:re(i)}),le==="unknown"&&s.jsx("div",{className:"panel-card p-6 text-center",children:s.jsx("p",{className:"text-slate-500",children:'Could not parse result format. Click "View JSON" to see raw data.'})})]})]}):s.jsxs("div",{className:"panel-card p-8 text-center",children:[s.jsx(up,{size:32,className:"mx-auto text-slate-600 mb-3"}),s.jsx("p",{className:"text-slate-400",children:"Select a result to view details"})]})})]})]})}function qg({result:e}){const[t,n]=m.useState(new Set),r=o=>{const u=new Set(t);u.has(o)?u.delete(o):u.add(o),n(u)},l=e.passed_cases,a=e.total_cases,i=e.pass_rate;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(tn,{className:"w-4 h-4"}),"Cases Passed"]}),s.jsxs("div",{className:`text-2xl font-bold ${i>=.9?"text-emerald-300":i>=.7?"text-amber-300":"text-red-400"}`,children:[l,"/",a]}),s.jsxs("div",{className:"text-xs text-slate-500",children:[(i*100).toFixed(1),"% pass rate"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(Kr,{className:"w-4 h-4"}),"Avg Score"]}),s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[e.avg_percentage.toFixed(1),"%"]}),s.jsxs("div",{className:"text-xs text-slate-500",children:[e.avg_score.toFixed(1)," points"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(wo,{className:"w-4 h-4"}),"Total Time"]}),s.jsxs("div",{className:"text-2xl font-bold text-slate-100",children:[(e.total_time_ms/1e3).toFixed(1),"s"]}),s.jsxs("div",{className:"text-xs text-slate-500",children:[Math.round(e.total_time_ms/Math.max(a,1)),"ms/case"]})]}),s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2",children:[s.jsx(jt,{className:"w-4 h-4"}),"Failed"]}),s.jsx("div",{className:"text-2xl font-bold text-red-400",children:e.failed_cases}),s.jsxs("div",{className:"text-xs text-slate-500",children:[a-l," case",a-l!==1?"s":""," failed"]})]})]}),Object.keys(e.by_expected).length>0&&s.jsxs("div",{className:"panel-card p-6",children:[s.jsx("h3",{className:"font-semibold text-slate-100 mb-4",children:"By Expected Outcome"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:Object.entries(e.by_expected).map(([o,u])=>{const c=u.passed+u.failed,p=c>0?u.passed/c:0;return s.jsxs("div",{className:"panel-subtle p-3 rounded-lg",children:[s.jsx("div",{className:"font-medium text-slate-200",children:o}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.jsxs("div",{className:`text-lg font-semibold ${p>=.9?"text-emerald-300":p>=.7?"text-amber-300":"text-red-400"}`,children:[u.passed,"/",c]}),s.jsxs("span",{className:"text-xs text-slate-500",children:["(",(p*100).toFixed(0),"%)"]})]})]},o)})})]}),s.jsxs("div",{className:"panel-card p-6",children:[s.jsxs("h3",{className:"font-semibold text-slate-100 mb-4",children:["Case Results (",e.failed_cases," failed, ",e.passed_cases," passed)"]}),s.jsx("div",{className:"space-y-2 max-h-[50vh] overflow-y-auto",children:e.case_results.map(o=>s.jsxs("div",{className:`panel-subtle rounded-lg overflow-hidden ${o.passed?"":"border border-red-500/30"}`,children:[s.jsxs("button",{onClick:()=>r(o.case_id),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-slate-700/50 transition-colors",children:[o.passed?s.jsx(Kr,{size:16,className:"text-emerald-400 flex-shrink-0"}):s.jsx(jt,{size:16,className:"text-red-400 flex-shrink-0"}),s.jsx("span",{className:"font-medium text-slate-200",children:o.case_id}),o.expected&&o.expected.length>0&&s.jsxs("span",{className:"text-sm text-slate-400",children:["expected: ",o.expected.join(" or ")]}),s.jsxs("span",{className:"ml-auto text-sm text-slate-400 flex-shrink-0",children:[o.percentage.toFixed(0),"% | ",o.latency_ms,"ms"]}),t.has(o.case_id)?s.jsx(Be,{size:14,className:"text-slate-500 flex-shrink-0"}):s.jsx(rt,{size:14,className:"text-slate-500 flex-shrink-0"})]}),t.has(o.case_id)&&s.jsxs("div",{className:"px-4 pb-3 pt-1 border-t border-slate-700",children:[o.failure_reason&&s.jsx("div",{className:"text-red-400 text-sm mb-2 p-2 bg-red-950/30 rounded",children:o.failure_reason}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Expected:"})," ",s.jsx("span",{className:"text-slate-200",children:o.expected&&o.expected.length>0?o.expected.join(" or "):"N/A"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Actual:"})," ",s.jsx("span",{className:"text-slate-200",children:o.actual_outcome||"None"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Score:"})," ",s.jsxs("span",{className:"text-slate-200",children:[o.goal_score,"/",o.max_score]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Latency:"})," ",s.jsxs("span",{className:"text-slate-200",children:[o.latency_ms,"ms"]})]})]})]})]},o.case_id))})]})]})}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function xp(e){return typeof e>"u"||e===null}function Kg(e){return typeof e=="object"&&e!==null}function Jg(e){return Array.isArray(e)?e:xp(e)?[]:[e]}function Gg(e,t){var n,r,l,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)l=a[n],e[l]=t[l];return e}function Xg(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Zg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var ev=xp,tv=Kg,nv=Jg,rv=Xg,lv=Zg,sv=Gg,de={isNothing:ev,isObject:tv,toArray:nv,repeat:rv,isNegativeZero:lv,extend:sv};function gp(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
|
272
|
+
|
|
273
|
+
`+e.mark.snippet),r+" "+n):r}function Gr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=gp(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Gr.prototype=Object.create(Error.prototype);Gr.prototype.constructor=Gr;Gr.prototype.toString=function(t){return this.name+": "+gp(this,t)};var Ee=Gr;function xa(e,t,n,r,l){var a="",i="",o=Math.floor(l/2)-1;return r-t>o&&(a=" ... ",t=r-o+a.length),n-r>o&&(i=" ...",n=r+o-i.length),{str:a+e.slice(t,n).replace(/\t/g,"→")+i,pos:r-t+a.length}}function ga(e,t){return de.repeat(" ",t-e.length)+e}function av(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],l=[],a,i=-1;a=n.exec(e.buffer);)l.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&i<0&&(i=r.length-2);i<0&&(i=r.length-1);var o="",u,c,p=Math.min(e.line+t.linesAfter,l.length).toString().length,f=t.maxLength-(t.indent+p+3);for(u=1;u<=t.linesBefore&&!(i-u<0);u++)c=xa(e.buffer,r[i-u],l[i-u],e.position-(r[i]-r[i-u]),f),o=de.repeat(" ",t.indent)+ga((e.line-u+1).toString(),p)+" | "+c.str+`
|
|
274
|
+
`+o;for(c=xa(e.buffer,r[i],l[i],e.position,f),o+=de.repeat(" ",t.indent)+ga((e.line+1).toString(),p)+" | "+c.str+`
|
|
275
|
+
`,o+=de.repeat("-",t.indent+p+3+c.pos)+`^
|
|
276
|
+
`,u=1;u<=t.linesAfter&&!(i+u>=l.length);u++)c=xa(e.buffer,r[i+u],l[i+u],e.position-(r[i]-r[i+u]),f),o+=de.repeat(" ",t.indent)+ga((e.line+u+1).toString(),p)+" | "+c.str+`
|
|
277
|
+
`;return o.replace(/\n$/,"")}var iv=av,ov=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],uv=["scalar","sequence","mapping"];function cv(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function dv(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(ov.indexOf(n)===-1)throw new Ee('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=cv(t.styleAliases||null),uv.indexOf(this.kind)===-1)throw new Ee('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ve=dv;function uc(e,t){var n=[];return e[t].forEach(function(r){var l=n.length;n.forEach(function(a,i){a.tag===r.tag&&a.kind===r.kind&&a.multi===r.multi&&(l=i)}),n[l]=r}),n}function fv(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(l){l.multi?(e.multi[l.kind].push(l),e.multi.fallback.push(l)):e[l.kind][l.tag]=e.fallback[l.tag]=l}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function hi(e){return this.extend(e)}hi.prototype.extend=function(t){var n=[],r=[];if(t instanceof ve)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Ee("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(a){if(!(a instanceof ve))throw new Ee("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new Ee("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new Ee("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(a){if(!(a instanceof ve))throw new Ee("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(hi.prototype);return l.implicit=(this.implicit||[]).concat(n),l.explicit=(this.explicit||[]).concat(r),l.compiledImplicit=uc(l,"implicit"),l.compiledExplicit=uc(l,"explicit"),l.compiledTypeMap=fv(l.compiledImplicit,l.compiledExplicit),l};var vp=hi,yp=new ve("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),jp=new ve("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Np=new ve("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),wp=new vp({explicit:[yp,jp,Np]});function pv(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function mv(){return null}function hv(e){return e===null}var kp=new ve("tag:yaml.org,2002:null",{kind:"scalar",resolve:pv,construct:mv,predicate:hv,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function xv(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function gv(e){return e==="true"||e==="True"||e==="TRUE"}function vv(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var bp=new ve("tag:yaml.org,2002:bool",{kind:"scalar",resolve:xv,construct:gv,predicate:vv,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function yv(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function jv(e){return 48<=e&&e<=55}function Nv(e){return 48<=e&&e<=57}function wv(e){if(e===null)return!1;var t=e.length,n=0,r=!1,l;if(!t)return!1;if(l=e[n],(l==="-"||l==="+")&&(l=e[++n]),l==="0"){if(n+1===t)return!0;if(l=e[++n],l==="b"){for(n++;n<t;n++)if(l=e[n],l!=="_"){if(l!=="0"&&l!=="1")return!1;r=!0}return r&&l!=="_"}if(l==="x"){for(n++;n<t;n++)if(l=e[n],l!=="_"){if(!yv(e.charCodeAt(n)))return!1;r=!0}return r&&l!=="_"}if(l==="o"){for(n++;n<t;n++)if(l=e[n],l!=="_"){if(!jv(e.charCodeAt(n)))return!1;r=!0}return r&&l!=="_"}}if(l==="_")return!1;for(;n<t;n++)if(l=e[n],l!=="_"){if(!Nv(e.charCodeAt(n)))return!1;r=!0}return!(!r||l==="_")}function kv(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function bv(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!de.isNegativeZero(e)}var Sp=new ve("tag:yaml.org,2002:int",{kind:"scalar",resolve:wv,construct:kv,predicate:bv,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Sv=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Cv(e){return!(e===null||!Sv.test(e)||e[e.length-1]==="_")}function Ev(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var _v=/^[-+]?[0-9]+e/;function Rv(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(de.isNegativeZero(e))return"-0.0";return n=e.toString(10),_v.test(n)?n.replace("e",".e"):n}function Tv(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||de.isNegativeZero(e))}var Cp=new ve("tag:yaml.org,2002:float",{kind:"scalar",resolve:Cv,construct:Ev,predicate:Tv,represent:Rv,defaultStyle:"lowercase"}),Ep=wp.extend({implicit:[kp,bp,Sp,Cp]}),_p=Ep,Rp=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Tp=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Av(e){return e===null?!1:Rp.exec(e)!==null||Tp.exec(e)!==null}function Pv(e){var t,n,r,l,a,i,o,u=0,c=null,p,f,x;if(t=Rp.exec(e),t===null&&(t=Tp.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,l=+t[3],!t[4])return new Date(Date.UTC(n,r,l));if(a=+t[4],i=+t[5],o=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(p=+t[10],f=+(t[11]||0),c=(p*60+f)*6e4,t[9]==="-"&&(c=-c)),x=new Date(Date.UTC(n,r,l,a,i,o,u)),c&&x.setTime(x.getTime()-c),x}function Lv(e){return e.toISOString()}var Ap=new ve("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Av,construct:Pv,instanceOf:Date,represent:Lv});function Mv(e){return e==="<<"||e===null}var Pp=new ve("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Mv}),Ro=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
278
|
+
\r`;function Fv(e){if(e===null)return!1;var t,n,r=0,l=e.length,a=Ro;for(n=0;n<l;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function Ov(e){var t,n,r=e.replace(/[\r\n=]/g,""),l=r.length,a=Ro,i=0,o=[];for(t=0;t<l;t++)t%4===0&&t&&(o.push(i>>16&255),o.push(i>>8&255),o.push(i&255)),i=i<<6|a.indexOf(r.charAt(t));return n=l%4*6,n===0?(o.push(i>>16&255),o.push(i>>8&255),o.push(i&255)):n===18?(o.push(i>>10&255),o.push(i>>2&255)):n===12&&o.push(i>>4&255),new Uint8Array(o)}function zv(e){var t="",n=0,r,l,a=e.length,i=Ro;for(r=0;r<a;r++)r%3===0&&r&&(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]),n=(n<<8)+e[r];return l=a%3,l===0?(t+=i[n>>18&63],t+=i[n>>12&63],t+=i[n>>6&63],t+=i[n&63]):l===2?(t+=i[n>>10&63],t+=i[n>>4&63],t+=i[n<<2&63],t+=i[64]):l===1&&(t+=i[n>>2&63],t+=i[n<<4&63],t+=i[64],t+=i[64]),t}function Dv(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Lp=new ve("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Fv,construct:Ov,predicate:Dv,represent:zv}),Iv=Object.prototype.hasOwnProperty,$v=Object.prototype.toString;function Bv(e){if(e===null)return!0;var t=[],n,r,l,a,i,o=e;for(n=0,r=o.length;n<r;n+=1){if(l=o[n],i=!1,$v.call(l)!=="[object Object]")return!1;for(a in l)if(Iv.call(l,a))if(!i)i=!0;else return!1;if(!i)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function Uv(e){return e!==null?e:[]}var Mp=new ve("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Bv,construct:Uv}),Hv=Object.prototype.toString;function Vv(e){if(e===null)return!0;var t,n,r,l,a,i=e;for(a=new Array(i.length),t=0,n=i.length;t<n;t+=1){if(r=i[t],Hv.call(r)!=="[object Object]"||(l=Object.keys(r),l.length!==1))return!1;a[t]=[l[0],r[l[0]]]}return!0}function Wv(e){if(e===null)return[];var t,n,r,l,a,i=e;for(a=new Array(i.length),t=0,n=i.length;t<n;t+=1)r=i[t],l=Object.keys(r),a[t]=[l[0],r[l[0]]];return a}var Fp=new ve("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Vv,construct:Wv}),Yv=Object.prototype.hasOwnProperty;function Qv(e){if(e===null)return!0;var t,n=e;for(t in n)if(Yv.call(n,t)&&n[t]!==null)return!1;return!0}function qv(e){return e!==null?e:{}}var Op=new ve("tag:yaml.org,2002:set",{kind:"mapping",resolve:Qv,construct:qv}),To=_p.extend({implicit:[Ap,Pp],explicit:[Lp,Mp,Fp,Op]}),nn=Object.prototype.hasOwnProperty,gs=1,zp=2,Dp=3,vs=4,va=1,Kv=2,cc=3,Jv=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Gv=/[\x85\u2028\u2029]/,Xv=/[,\[\]\{\}]/,Ip=/^(?:!|!!|![a-z\-]+!)$/i,$p=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function dc(e){return Object.prototype.toString.call(e)}function yt(e){return e===10||e===13}function hn(e){return e===9||e===32}function Oe(e){return e===9||e===32||e===10||e===13}function $n(e){return e===44||e===91||e===93||e===123||e===125}function Zv(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function ey(e){return e===120?2:e===117?4:e===85?8:0}function ty(e){return 48<=e&&e<=57?e-48:-1}function fc(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
279
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function ny(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Bp(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var Up=new Array(256),Hp=new Array(256);for(var Cn=0;Cn<256;Cn++)Up[Cn]=fc(Cn)?1:0,Hp[Cn]=fc(Cn);function ry(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||To,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Vp(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=iv(n),new Ee(t,n)}function D(e,t){throw Vp(e,t)}function ys(e,t){e.onWarning&&e.onWarning.call(null,Vp(e,t))}var pc={YAML:function(t,n,r){var l,a,i;t.version!==null&&D(t,"duplication of %YAML directive"),r.length!==1&&D(t,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),l===null&&D(t,"ill-formed argument of the YAML directive"),a=parseInt(l[1],10),i=parseInt(l[2],10),a!==1&&D(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=i<2,i!==1&&i!==2&&ys(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var l,a;r.length!==2&&D(t,"TAG directive accepts exactly two arguments"),l=r[0],a=r[1],Ip.test(l)||D(t,"ill-formed tag handle (first argument) of the TAG directive"),nn.call(t.tagMap,l)&&D(t,'there is a previously declared suffix for "'+l+'" tag handle'),$p.test(a)||D(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{D(t,"tag prefix is malformed: "+a)}t.tagMap[l]=a}};function Xt(e,t,n,r){var l,a,i,o;if(t<n){if(o=e.input.slice(t,n),r)for(l=0,a=o.length;l<a;l+=1)i=o.charCodeAt(l),i===9||32<=i&&i<=1114111||D(e,"expected valid JSON character");else Jv.test(o)&&D(e,"the stream contains non-printable characters");e.result+=o}}function mc(e,t,n,r){var l,a,i,o;for(de.isObject(n)||D(e,"cannot merge mappings; the provided source object is unacceptable"),l=Object.keys(n),i=0,o=l.length;i<o;i+=1)a=l[i],nn.call(t,a)||(Bp(t,a,n[a]),r[a]=!0)}function Bn(e,t,n,r,l,a,i,o,u){var c,p;if(Array.isArray(l))for(l=Array.prototype.slice.call(l),c=0,p=l.length;c<p;c+=1)Array.isArray(l[c])&&D(e,"nested arrays are not supported inside keys"),typeof l=="object"&&dc(l[c])==="[object Object]"&&(l[c]="[object Object]");if(typeof l=="object"&&dc(l)==="[object Object]"&&(l="[object Object]"),l=String(l),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(c=0,p=a.length;c<p;c+=1)mc(e,t,a[c],n);else mc(e,t,a,n);else!e.json&&!nn.call(n,l)&&nn.call(t,l)&&(e.line=i||e.line,e.lineStart=o||e.lineStart,e.position=u||e.position,D(e,"duplicated mapping key")),Bp(t,l,a),delete n[l];return t}function Ao(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):D(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ue(e,t,n){for(var r=0,l=e.input.charCodeAt(e.position);l!==0;){for(;hn(l);)l===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),l=e.input.charCodeAt(++e.position);if(t&&l===35)do l=e.input.charCodeAt(++e.position);while(l!==10&&l!==13&&l!==0);if(yt(l))for(Ao(e),l=e.input.charCodeAt(e.position),r++,e.lineIndent=0;l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&ys(e,"deficient indentation"),r}function $s(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Oe(n)))}function Po(e,t){t===1?e.result+=" ":t>1&&(e.result+=de.repeat(`
|
|
280
|
+
`,t-1))}function ly(e,t,n){var r,l,a,i,o,u,c,p,f=e.kind,x=e.result,y;if(y=e.input.charCodeAt(e.position),Oe(y)||$n(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(l=e.input.charCodeAt(e.position+1),Oe(l)||n&&$n(l)))return!1;for(e.kind="scalar",e.result="",a=i=e.position,o=!1;y!==0;){if(y===58){if(l=e.input.charCodeAt(e.position+1),Oe(l)||n&&$n(l))break}else if(y===35){if(r=e.input.charCodeAt(e.position-1),Oe(r))break}else{if(e.position===e.lineStart&&$s(e)||n&&$n(y))break;if(yt(y))if(u=e.line,c=e.lineStart,p=e.lineIndent,ue(e,!1,-1),e.lineIndent>=t){o=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=i,e.line=u,e.lineStart=c,e.lineIndent=p;break}}o&&(Xt(e,a,i,!1),Po(e,e.line-u),a=i=e.position,o=!1),hn(y)||(i=e.position+1),y=e.input.charCodeAt(++e.position)}return Xt(e,a,i,!1),e.result?!0:(e.kind=f,e.result=x,!1)}function sy(e,t){var n,r,l;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=l=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Xt(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,l=e.position;else return!0;else yt(n)?(Xt(e,r,l,!0),Po(e,ue(e,!1,t)),r=l=e.position):e.position===e.lineStart&&$s(e)?D(e,"unexpected end of the document within a single quoted scalar"):(e.position++,l=e.position);D(e,"unexpected end of the stream within a single quoted scalar")}function ay(e,t){var n,r,l,a,i,o;if(o=e.input.charCodeAt(e.position),o!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(o=e.input.charCodeAt(e.position))!==0;){if(o===34)return Xt(e,n,e.position,!0),e.position++,!0;if(o===92){if(Xt(e,n,e.position,!0),o=e.input.charCodeAt(++e.position),yt(o))ue(e,!1,t);else if(o<256&&Up[o])e.result+=Hp[o],e.position++;else if((i=ey(o))>0){for(l=i,a=0;l>0;l--)o=e.input.charCodeAt(++e.position),(i=Zv(o))>=0?a=(a<<4)+i:D(e,"expected hexadecimal character");e.result+=ny(a),e.position++}else D(e,"unknown escape sequence");n=r=e.position}else yt(o)?(Xt(e,n,r,!0),Po(e,ue(e,!1,t)),n=r=e.position):e.position===e.lineStart&&$s(e)?D(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}D(e,"unexpected end of the stream within a double quoted scalar")}function iy(e,t){var n=!0,r,l,a,i=e.tag,o,u=e.anchor,c,p,f,x,y,N=Object.create(null),v,j,h,d;if(d=e.input.charCodeAt(e.position),d===91)p=93,y=!1,o=[];else if(d===123)p=125,y=!0,o={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),d=e.input.charCodeAt(++e.position);d!==0;){if(ue(e,!0,t),d=e.input.charCodeAt(e.position),d===p)return e.position++,e.tag=i,e.anchor=u,e.kind=y?"mapping":"sequence",e.result=o,!0;n?d===44&&D(e,"expected the node content, but found ','"):D(e,"missed comma between flow collection entries"),j=v=h=null,f=x=!1,d===63&&(c=e.input.charCodeAt(e.position+1),Oe(c)&&(f=x=!0,e.position++,ue(e,!0,t))),r=e.line,l=e.lineStart,a=e.position,nr(e,t,gs,!1,!0),j=e.tag,v=e.result,ue(e,!0,t),d=e.input.charCodeAt(e.position),(x||e.line===r)&&d===58&&(f=!0,d=e.input.charCodeAt(++e.position),ue(e,!0,t),nr(e,t,gs,!1,!0),h=e.result),y?Bn(e,o,N,j,v,h,r,l,a):f?o.push(Bn(e,null,N,j,v,h,r,l,a)):o.push(v),ue(e,!0,t),d=e.input.charCodeAt(e.position),d===44?(n=!0,d=e.input.charCodeAt(++e.position)):n=!1}D(e,"unexpected end of the stream within a flow collection")}function oy(e,t){var n,r,l=va,a=!1,i=!1,o=t,u=0,c=!1,p,f;if(f=e.input.charCodeAt(e.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)va===l?l=f===43?cc:Kv:D(e,"repeat of a chomping mode identifier");else if((p=ty(f))>=0)p===0?D(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):i?D(e,"repeat of an indentation width identifier"):(o=t+p-1,i=!0);else break;if(hn(f)){do f=e.input.charCodeAt(++e.position);while(hn(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!yt(f)&&f!==0)}for(;f!==0;){for(Ao(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!i||e.lineIndent<o)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!i&&e.lineIndent>o&&(o=e.lineIndent),yt(f)){u++;continue}if(e.lineIndent<o){l===cc?e.result+=de.repeat(`
|
|
281
|
+
`,a?1+u:u):l===va&&a&&(e.result+=`
|
|
282
|
+
`);break}for(r?hn(f)?(c=!0,e.result+=de.repeat(`
|
|
283
|
+
`,a?1+u:u)):c?(c=!1,e.result+=de.repeat(`
|
|
284
|
+
`,u+1)):u===0?a&&(e.result+=" "):e.result+=de.repeat(`
|
|
285
|
+
`,u):e.result+=de.repeat(`
|
|
286
|
+
`,a?1+u:u),a=!0,i=!0,u=0,n=e.position;!yt(f)&&f!==0;)f=e.input.charCodeAt(++e.position);Xt(e,n,e.position,!1)}return!0}function hc(e,t){var n,r=e.tag,l=e.anchor,a=[],i,o=!1,u;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),u=e.input.charCodeAt(e.position);u!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,D(e,"tab characters must not be used in indentation")),!(u!==45||(i=e.input.charCodeAt(e.position+1),!Oe(i))));){if(o=!0,e.position++,ue(e,!0,-1)&&e.lineIndent<=t){a.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,nr(e,t,Dp,!1,!0),a.push(e.result),ue(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)D(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return o?(e.tag=r,e.anchor=l,e.kind="sequence",e.result=a,!0):!1}function uy(e,t,n){var r,l,a,i,o,u,c=e.tag,p=e.anchor,f={},x=Object.create(null),y=null,N=null,v=null,j=!1,h=!1,d;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),d=e.input.charCodeAt(e.position);d!==0;){if(!j&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,D(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),a=e.line,(d===63||d===58)&&Oe(r))d===63?(j&&(Bn(e,f,x,y,N,null,i,o,u),y=N=v=null),h=!0,j=!0,l=!0):j?(j=!1,l=!0):D(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,d=r;else{if(i=e.line,o=e.lineStart,u=e.position,!nr(e,n,zp,!1,!0))break;if(e.line===a){for(d=e.input.charCodeAt(e.position);hn(d);)d=e.input.charCodeAt(++e.position);if(d===58)d=e.input.charCodeAt(++e.position),Oe(d)||D(e,"a whitespace character is expected after the key-value separator within a block mapping"),j&&(Bn(e,f,x,y,N,null,i,o,u),y=N=v=null),h=!0,j=!1,l=!1,y=e.tag,N=e.result;else if(h)D(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=p,!0}else if(h)D(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=p,!0}if((e.line===a||e.lineIndent>t)&&(j&&(i=e.line,o=e.lineStart,u=e.position),nr(e,t,vs,!0,l)&&(j?N=e.result:v=e.result),j||(Bn(e,f,x,y,N,v,i,o,u),y=N=v=null),ue(e,!0,-1),d=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&d!==0)D(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return j&&Bn(e,f,x,y,N,null,i,o,u),h&&(e.tag=c,e.anchor=p,e.kind="mapping",e.result=f),h}function cy(e){var t,n=!1,r=!1,l,a,i;if(i=e.input.charCodeAt(e.position),i!==33)return!1;if(e.tag!==null&&D(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),i===60?(n=!0,i=e.input.charCodeAt(++e.position)):i===33?(r=!0,l="!!",i=e.input.charCodeAt(++e.position)):l="!",t=e.position,n){do i=e.input.charCodeAt(++e.position);while(i!==0&&i!==62);e.position<e.length?(a=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):D(e,"unexpected end of the stream within a verbatim tag")}else{for(;i!==0&&!Oe(i);)i===33&&(r?D(e,"tag suffix cannot contain exclamation marks"):(l=e.input.slice(t-1,e.position+1),Ip.test(l)||D(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),Xv.test(a)&&D(e,"tag suffix cannot contain flow indicator characters")}a&&!$p.test(a)&&D(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{D(e,"tag name is malformed: "+a)}return n?e.tag=a:nn.call(e.tagMap,l)?e.tag=e.tagMap[l]+a:l==="!"?e.tag="!"+a:l==="!!"?e.tag="tag:yaml.org,2002:"+a:D(e,'undeclared tag handle "'+l+'"'),!0}function dy(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&D(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Oe(n)&&!$n(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&D(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function fy(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Oe(r)&&!$n(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&D(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),nn.call(e.anchorMap,n)||D(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ue(e,!0,-1),!0}function nr(e,t,n,r,l){var a,i,o,u=1,c=!1,p=!1,f,x,y,N,v,j;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=i=o=vs===n||Dp===n,r&&ue(e,!0,-1)&&(c=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;cy(e)||dy(e);)ue(e,!0,-1)?(c=!0,o=a,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):o=!1;if(o&&(o=c||l),(u===1||vs===n)&&(gs===n||zp===n?v=t:v=t+1,j=e.position-e.lineStart,u===1?o&&(hc(e,j)||uy(e,j,v))||iy(e,v)?p=!0:(i&&oy(e,v)||sy(e,v)||ay(e,v)?p=!0:fy(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&D(e,"alias node should not have any properties")):ly(e,v,gs===n)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(p=o&&hc(e,j))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&D(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,x=e.implicitTypes.length;f<x;f+=1)if(N=e.implicitTypes[f],N.resolve(e.result)){e.result=N.construct(e.result),e.tag=N.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(nn.call(e.typeMap[e.kind||"fallback"],e.tag))N=e.typeMap[e.kind||"fallback"][e.tag];else for(N=null,y=e.typeMap.multi[e.kind||"fallback"],f=0,x=y.length;f<x;f+=1)if(e.tag.slice(0,y[f].tag.length)===y[f].tag){N=y[f];break}N||D(e,"unknown tag !<"+e.tag+">"),e.result!==null&&N.kind!==e.kind&&D(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+N.kind+'", not "'+e.kind+'"'),N.resolve(e.result,e.tag)?(e.result=N.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):D(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function py(e){var t=e.position,n,r,l,a=!1,i;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(i=e.input.charCodeAt(e.position))!==0&&(ue(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||i!==37));){for(a=!0,i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!Oe(i);)i=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),l=[],r.length<1&&D(e,"directive name must not be less than one character in length");i!==0;){for(;hn(i);)i=e.input.charCodeAt(++e.position);if(i===35){do i=e.input.charCodeAt(++e.position);while(i!==0&&!yt(i));break}if(yt(i))break;for(n=e.position;i!==0&&!Oe(i);)i=e.input.charCodeAt(++e.position);l.push(e.input.slice(n,e.position))}i!==0&&Ao(e),nn.call(pc,r)?pc[r](e,r,l):ys(e,'unknown document directive "'+r+'"')}if(ue(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,ue(e,!0,-1)):a&&D(e,"directives end mark is expected"),nr(e,e.lineIndent-1,vs,!1,!0),ue(e,!0,-1),e.checkLineBreaks&&Gv.test(e.input.slice(t,e.position))&&ys(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&$s(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ue(e,!0,-1));return}if(e.position<e.length-1)D(e,"end of the stream or a document separator is expected");else return}function Wp(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
287
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new ry(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,D(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)py(n);return n.documents}function my(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=Wp(e,n);if(typeof t!="function")return r;for(var l=0,a=r.length;l<a;l+=1)t(r[l])}function hy(e,t){var n=Wp(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Ee("expected a single document in the stream, but found more")}}var xy=my,gy=hy,Yp={loadAll:xy,load:gy},Qp=Object.prototype.toString,qp=Object.prototype.hasOwnProperty,Lo=65279,vy=9,Xr=10,yy=13,jy=32,Ny=33,wy=34,xi=35,ky=37,by=38,Sy=39,Cy=42,Kp=44,Ey=45,js=58,_y=61,Ry=62,Ty=63,Ay=64,Jp=91,Gp=93,Py=96,Xp=123,Ly=124,Zp=125,Se={};Se[0]="\\0";Se[7]="\\a";Se[8]="\\b";Se[9]="\\t";Se[10]="\\n";Se[11]="\\v";Se[12]="\\f";Se[13]="\\r";Se[27]="\\e";Se[34]='\\"';Se[92]="\\\\";Se[133]="\\N";Se[160]="\\_";Se[8232]="\\L";Se[8233]="\\P";var My=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Fy=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Oy(e,t){var n,r,l,a,i,o,u;if(t===null)return{};for(n={},r=Object.keys(t),l=0,a=r.length;l<a;l+=1)i=r[l],o=String(t[i]),i.slice(0,2)==="!!"&&(i="tag:yaml.org,2002:"+i.slice(2)),u=e.compiledTypeMap.fallback[i],u&&qp.call(u.styleAliases,o)&&(o=u.styleAliases[o]),n[i]=o;return n}function zy(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Ee("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+de.repeat("0",r-t.length)+t}var Dy=1,Zr=2;function Iy(e){this.schema=e.schema||To,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=de.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Oy(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Zr:Dy,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function xc(e,t){for(var n=de.repeat(" ",t),r=0,l=-1,a="",i,o=e.length;r<o;)l=e.indexOf(`
|
|
288
|
+
`,r),l===-1?(i=e.slice(r),r=o):(i=e.slice(r,l+1),r=l+1),i.length&&i!==`
|
|
289
|
+
`&&(a+=n),a+=i;return a}function gi(e,t){return`
|
|
290
|
+
`+de.repeat(" ",e.indent*t)}function $y(e,t){var n,r,l;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(l=e.implicitTypes[n],l.resolve(t))return!0;return!1}function Ns(e){return e===jy||e===vy}function el(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Lo||65536<=e&&e<=1114111}function gc(e){return el(e)&&e!==Lo&&e!==yy&&e!==Xr}function vc(e,t,n){var r=gc(e),l=r&&!Ns(e);return(n?r:r&&e!==Kp&&e!==Jp&&e!==Gp&&e!==Xp&&e!==Zp)&&e!==xi&&!(t===js&&!l)||gc(t)&&!Ns(t)&&e===xi||t===js&&l}function By(e){return el(e)&&e!==Lo&&!Ns(e)&&e!==Ey&&e!==Ty&&e!==js&&e!==Kp&&e!==Jp&&e!==Gp&&e!==Xp&&e!==Zp&&e!==xi&&e!==by&&e!==Cy&&e!==Ny&&e!==Ly&&e!==_y&&e!==Ry&&e!==Sy&&e!==wy&&e!==ky&&e!==Ay&&e!==Py}function Uy(e){return!Ns(e)&&e!==js}function Nr(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function em(e){var t=/^\n* /;return t.test(e)}var tm=1,vi=2,nm=3,rm=4,En=5;function Hy(e,t,n,r,l,a,i,o){var u,c=0,p=null,f=!1,x=!1,y=r!==-1,N=-1,v=By(Nr(e,0))&&Uy(Nr(e,e.length-1));if(t||i)for(u=0;u<e.length;c>=65536?u+=2:u++){if(c=Nr(e,u),!el(c))return En;v=v&&vc(c,p,o),p=c}else{for(u=0;u<e.length;c>=65536?u+=2:u++){if(c=Nr(e,u),c===Xr)f=!0,y&&(x=x||u-N-1>r&&e[N+1]!==" ",N=u);else if(!el(c))return En;v=v&&vc(c,p,o),p=c}x=x||y&&u-N-1>r&&e[N+1]!==" "}return!f&&!x?v&&!i&&!l(e)?tm:a===Zr?En:vi:n>9&&em(e)?En:i?a===Zr?En:vi:x?rm:nm}function Vy(e,t,n,r,l){e.dump=function(){if(t.length===0)return e.quotingType===Zr?'""':"''";if(!e.noCompatMode&&(My.indexOf(t)!==-1||Fy.test(t)))return e.quotingType===Zr?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),i=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),o=r||e.flowLevel>-1&&n>=e.flowLevel;function u(c){return $y(e,c)}switch(Hy(t,o,e.indent,i,u,e.quotingType,e.forceQuotes&&!r,l)){case tm:return t;case vi:return"'"+t.replace(/'/g,"''")+"'";case nm:return"|"+yc(t,e.indent)+jc(xc(t,a));case rm:return">"+yc(t,e.indent)+jc(xc(Wy(t,i),a));case En:return'"'+Yy(t)+'"';default:throw new Ee("impossible error: invalid scalar style")}}()}function yc(e,t){var n=em(e)?String(t):"",r=e[e.length-1]===`
|
|
291
|
+
`,l=r&&(e[e.length-2]===`
|
|
292
|
+
`||e===`
|
|
293
|
+
`),a=l?"+":r?"":"-";return n+a+`
|
|
294
|
+
`}function jc(e){return e[e.length-1]===`
|
|
295
|
+
`?e.slice(0,-1):e}function Wy(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var c=e.indexOf(`
|
|
296
|
+
`);return c=c!==-1?c:e.length,n.lastIndex=c,Nc(e.slice(0,c),t)}(),l=e[0]===`
|
|
297
|
+
`||e[0]===" ",a,i;i=n.exec(e);){var o=i[1],u=i[2];a=u[0]===" ",r+=o+(!l&&!a&&u!==""?`
|
|
298
|
+
`:"")+Nc(u,t),l=a}return r}function Nc(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,l=0,a,i=0,o=0,u="";r=n.exec(e);)o=r.index,o-l>t&&(a=i>l?i:o,u+=`
|
|
299
|
+
`+e.slice(l,a),l=a+1),i=o;return u+=`
|
|
300
|
+
`,e.length-l>t&&i>l?u+=e.slice(l,i)+`
|
|
301
|
+
`+e.slice(i+1):u+=e.slice(l),u.slice(1)}function Yy(e){for(var t="",n=0,r,l=0;l<e.length;n>=65536?l+=2:l++)n=Nr(e,l),r=Se[n],!r&&el(n)?(t+=e[l],n>=65536&&(t+=e[l+1])):t+=r||zy(n);return t}function Qy(e,t,n){var r="",l=e.tag,a,i,o;for(a=0,i=n.length;a<i;a+=1)o=n[a],e.replacer&&(o=e.replacer.call(n,String(a),o)),(Lt(e,t,o,!1,!1)||typeof o>"u"&&Lt(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=l,e.dump="["+r+"]"}function wc(e,t,n,r){var l="",a=e.tag,i,o,u;for(i=0,o=n.length;i<o;i+=1)u=n[i],e.replacer&&(u=e.replacer.call(n,String(i),u)),(Lt(e,t+1,u,!0,!0,!1,!0)||typeof u>"u"&&Lt(e,t+1,null,!0,!0,!1,!0))&&((!r||l!=="")&&(l+=gi(e,t)),e.dump&&Xr===e.dump.charCodeAt(0)?l+="-":l+="- ",l+=e.dump);e.tag=a,e.dump=l||"[]"}function qy(e,t,n){var r="",l=e.tag,a=Object.keys(n),i,o,u,c,p;for(i=0,o=a.length;i<o;i+=1)p="",r!==""&&(p+=", "),e.condenseFlow&&(p+='"'),u=a[i],c=n[u],e.replacer&&(c=e.replacer.call(n,u,c)),Lt(e,t,u,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Lt(e,t,c,!1,!1)&&(p+=e.dump,r+=p));e.tag=l,e.dump="{"+r+"}"}function Ky(e,t,n,r){var l="",a=e.tag,i=Object.keys(n),o,u,c,p,f,x;if(e.sortKeys===!0)i.sort();else if(typeof e.sortKeys=="function")i.sort(e.sortKeys);else if(e.sortKeys)throw new Ee("sortKeys must be a boolean or a function");for(o=0,u=i.length;o<u;o+=1)x="",(!r||l!=="")&&(x+=gi(e,t)),c=i[o],p=n[c],e.replacer&&(p=e.replacer.call(n,c,p)),Lt(e,t+1,c,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Xr===e.dump.charCodeAt(0)?x+="?":x+="? "),x+=e.dump,f&&(x+=gi(e,t)),Lt(e,t+1,p,!0,f)&&(e.dump&&Xr===e.dump.charCodeAt(0)?x+=":":x+=": ",x+=e.dump,l+=x));e.tag=a,e.dump=l||"{}"}function kc(e,t,n){var r,l,a,i,o,u;for(l=n?e.explicitTypes:e.implicitTypes,a=0,i=l.length;a<i;a+=1)if(o=l[a],(o.instanceOf||o.predicate)&&(!o.instanceOf||typeof t=="object"&&t instanceof o.instanceOf)&&(!o.predicate||o.predicate(t))){if(n?o.multi&&o.representName?e.tag=o.representName(t):e.tag=o.tag:e.tag="?",o.represent){if(u=e.styleMap[o.tag]||o.defaultStyle,Qp.call(o.represent)==="[object Function]")r=o.represent(t,u);else if(qp.call(o.represent,u))r=o.represent[u](t,u);else throw new Ee("!<"+o.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function Lt(e,t,n,r,l,a,i){e.tag=null,e.dump=n,kc(e,n,!1)||kc(e,n,!0);var o=Qp.call(e.dump),u=r,c;r&&(r=e.flowLevel<0||e.flowLevel>t);var p=o==="[object Object]"||o==="[object Array]",f,x;if(p&&(f=e.duplicates.indexOf(n),x=f!==-1),(e.tag!==null&&e.tag!=="?"||x||e.indent!==2&&t>0)&&(l=!1),x&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(p&&x&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),o==="[object Object]")r&&Object.keys(e.dump).length!==0?(Ky(e,t,e.dump,l),x&&(e.dump="&ref_"+f+e.dump)):(qy(e,t,e.dump),x&&(e.dump="&ref_"+f+" "+e.dump));else if(o==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!i&&t>0?wc(e,t-1,e.dump,l):wc(e,t,e.dump,l),x&&(e.dump="&ref_"+f+e.dump)):(Qy(e,t,e.dump),x&&(e.dump="&ref_"+f+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&Vy(e,e.dump,t,a,u);else{if(o==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Ee("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Jy(e,t){var n=[],r=[],l,a;for(yi(e,n,r),l=0,a=r.length;l<a;l+=1)t.duplicates.push(n[r[l]]);t.usedDuplicates=new Array(a)}function yi(e,t,n){var r,l,a;if(e!==null&&typeof e=="object")if(l=t.indexOf(e),l!==-1)n.indexOf(l)===-1&&n.push(l);else if(t.push(e),Array.isArray(e))for(l=0,a=e.length;l<a;l+=1)yi(e[l],t,n);else for(r=Object.keys(e),l=0,a=r.length;l<a;l+=1)yi(e[r[l]],t,n)}function Gy(e,t){t=t||{};var n=new Iy(t);n.noRefs||Jy(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Lt(n,0,r,!0,!0)?n.dump+`
|
|
302
|
+
`:""}var Xy=Gy,Zy={dump:Xy};function Mo(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var e1=ve,t1=vp,n1=wp,r1=Ep,l1=_p,s1=To,a1=Yp.load,i1=Yp.loadAll,o1=Zy.dump,u1=Ee,c1={binary:Lp,float:Cp,map:Np,null:kp,pairs:Fp,set:Op,timestamp:Ap,bool:bp,int:Sp,merge:Pp,omap:Mp,seq:jp,str:yp},d1=Mo("safeLoad","load"),f1=Mo("safeLoadAll","loadAll"),p1=Mo("safeDump","dump"),tl={Type:e1,Schema:t1,FAILSAFE_SCHEMA:n1,JSON_SCHEMA:r1,CORE_SCHEMA:l1,DEFAULT_SCHEMA:s1,load:a1,loadAll:i1,dump:o1,YAMLException:u1,types:c1,safeLoad:d1,safeLoadAll:f1,safeDump:p1};const bc={id:"",name:"",description:"",category:"",tags:[],variables:[],interactionMode:"prompt",prompt:"",style:"",systemPrompt:"",steps:[],toolsFrom:[],inlineTools:{},initialState:{},goals:[],judge:null,maxScore:null};function m1(){const[e,t]=m.useState(bc),n=m.useMemo(()=>{const _={};e.id&&(_.id=e.id),e.name&&(_.name=e.name),e.description&&(_.description=e.description),e.category&&(_.category=e.category),e.tags.length>0&&(_.tags=e.tags),e.variables.length>0&&(_.variables=e.variables.map(E=>{const w={name:E.name,type:E.type};return E.label&&(w.label=E.label),E.default!==""&&E.default!==void 0&&(w.default=E.default),E.type==="select"&&E.options.length>0&&(w.options=E.options),E.required||(w.required=!1),w})),e.systemPrompt&&(_.system_prompt=e.systemPrompt),e.interactionMode==="prompt"?(e.prompt&&(_.prompt=e.prompt),e.style&&(_.style=e.style)):e.steps.length>0&&(_.steps=e.steps.map(E=>({id:E.id,action:E.action,params:E.params}))),e.toolsFrom.length>0&&(_.tools_from=e.toolsFrom),Object.keys(e.inlineTools).length>0&&(_.tools=e.inlineTools),Object.keys(e.initialState).length>0&&(_.initial_state=e.initialState);const C={};return e.goals.length>0&&(C.goals=e.goals.map(E=>({id:E.id,name:E.name,description:E.description,points:E.points,detection:E.detection}))),e.judge&&(C.judge=e.judge),e.maxScore!==null&&(C.max_score=e.maxScore),Object.keys(C).length>0&&(_.evaluation=C),tl.dump(_,{lineWidth:-1,noRefs:!0})},[e]),r=m.useMemo(()=>{const _=[];return e.id?/^[a-z0-9-]+$/.test(e.id)||_.push("ID must be lowercase letters, numbers, and hyphens only"):_.push("Scenario ID is required"),e.interactionMode==="prompt"&&!e.prompt&&_.push("Prompt is required for single-turn scenarios"),e.interactionMode==="steps"&&e.steps.length===0&&_.push("At least one step is required for multi-turn scenarios"),e.steps.forEach((C,E)=>{C.id||_.push(`Step ${E+1}: ID is required`),C.action==="inject_user"&&!C.params.content&&_.push(`Step ${E+1}: Content is required for inject_user`)}),e.goals.forEach((C,E)=>{C.id||_.push(`Goal ${E+1}: ID is required`),C.detection.type||_.push(`Goal ${E+1}: Detection type is required`)}),_},[e]),l=r.length===0,a=m.useCallback(_=>{t(C=>({...C,id:_}))},[]),i=m.useCallback(_=>{t(C=>({...C,name:_}))},[]),o=m.useCallback(_=>{t(C=>({...C,description:_}))},[]),u=m.useCallback(_=>{t(C=>({...C,category:_}))},[]),c=m.useCallback(_=>{t(C=>({...C,tags:_}))},[]),p=m.useCallback(_=>{t(C=>({...C,variables:[...C.variables,_]}))},[]),f=m.useCallback((_,C)=>{t(E=>({...E,variables:E.variables.map((w,b)=>b===_?C:w)}))},[]),x=m.useCallback(_=>{t(C=>({...C,variables:C.variables.filter((E,w)=>w!==_)}))},[]),y=m.useCallback(_=>{t(C=>({...C,interactionMode:_}))},[]),N=m.useCallback(_=>{t(C=>({...C,prompt:_}))},[]),v=m.useCallback(_=>{t(C=>({...C,style:_}))},[]),j=m.useCallback(_=>{t(C=>({...C,systemPrompt:_}))},[]),h=m.useCallback(_=>{t(C=>({...C,steps:[...C.steps,_]}))},[]),d=m.useCallback((_,C)=>{t(E=>({...E,steps:E.steps.map((w,b)=>b===_?C:w)}))},[]),g=m.useCallback(_=>{t(C=>({...C,steps:C.steps.filter((E,w)=>w!==_)}))},[]),S=m.useCallback((_,C)=>{t(E=>{const w=[...E.steps],[b]=w.splice(_,1);return w.splice(C,0,b),{...E,steps:w}})},[]),k=m.useCallback(_=>{t(C=>({...C,toolsFrom:_}))},[]),T=m.useCallback(_=>{t(C=>({...C,inlineTools:_}))},[]),A=m.useCallback(_=>{t(C=>({...C,initialState:_}))},[]),L=m.useCallback(_=>{t(C=>({...C,goals:[...C.goals,_]}))},[]),O=m.useCallback((_,C)=>{t(E=>({...E,goals:E.goals.map((w,b)=>b===_?C:w)}))},[]),F=m.useCallback(_=>{t(C=>({...C,goals:C.goals.filter((E,w)=>w!==_)}))},[]),U=m.useCallback(_=>{t(C=>({...C,judge:_}))},[]),Y=m.useCallback(_=>{t(C=>({...C,maxScore:_}))},[]),re=m.useCallback(()=>{t(bc)},[]),le=m.useCallback(_=>{var C,E,w,b;try{const R=tl.load(_);t({id:R.id||"",name:R.name||"",description:R.description||"",category:R.category||"",tags:R.tags||[],variables:(R.variables||[]).map(M=>({name:M.name||"",label:M.label||"",type:M.type||"string",default:M.default??"",options:M.options||[],required:M.required!==!1})),interactionMode:R.steps?"steps":"prompt",prompt:R.prompt||"",style:R.style||"",systemPrompt:R.system_prompt||"",steps:(R.steps||[]).map((M,I)=>({id:M.id||`step_${I}`,action:M.action||"await_agent",params:M.params||{}})),toolsFrom:R.tools_from||[],inlineTools:R.tools||{},initialState:R.initial_state||{},goals:((E=((C=R.evaluation)==null?void 0:C.goals)||R.goals)==null?void 0:E.map((M,I)=>({id:M.id||`goal_${I}`,name:M.name||"",description:M.description||"",points:M.points||0,detection:M.detection||{type:""}})))||[],judge:((w=R.evaluation)==null?void 0:w.judge)||null,maxScore:((b=R.evaluation)==null?void 0:b.max_score)||null})}catch(R){console.error("Failed to parse YAML:",R)}},[]);return{state:e,yamlPreview:n,isValid:l,validationErrors:r,setId:a,setName:i,setDescription:o,setCategory:u,setTags:c,addVariable:p,updateVariable:f,removeVariable:x,setInteractionMode:y,setPrompt:N,setStyle:v,setSystemPrompt:j,addStep:h,updateStep:d,removeStep:g,reorderSteps:S,setToolsFrom:k,setInlineTools:T,setInitialState:A,addGoal:L,updateGoal:O,removeGoal:F,setJudge:U,setMaxScore:Y,reset:re,loadFromYaml:le}}const h1=["","brief","spicy","professional","formal","wholesome","chaotic","poetic"],x1=[{value:"tool_called",label:"Tool Called"},{value:"env_state",label:"Environment State"},{value:"agent_contains",label:"Agent Contains"},{value:"any_tool_called",label:"Any Tool Called"}];function g1(){const e=xo(),[t,n]=m.useState("basic"),[r,l]=m.useState(!0),[a,i]=m.useState([]),[o,u]=m.useState(!1),[c,p]=m.useState(null),f=m1();m.useEffect(()=>{xe.listTools().then(v=>{i(v.map(j=>j.id))}).catch(()=>{})},[]);const x=async()=>{if(!f.isValid)return!1;u(!0),p(null);try{const v=await fetch("/api/v1/local/scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:f.state.id,content:f.yamlPreview})});if(v.ok)return p({type:"success",text:"Scenario saved successfully!"}),!0;{const j=await v.json();return p({type:"error",text:j.detail||"Failed to save"}),!1}}catch(v){return p({type:"error",text:v instanceof Error?v.message:"Failed to save"}),!1}finally{u(!1)}},y=async()=>{await x()&&e(`/run/${f.state.id}`)},N=[{id:"basic",label:"Basic Info",icon:So},{id:"variables",label:"Variables",icon:Lg},{id:"interaction",label:"Interaction",icon:dp},{id:"tools",label:"Tools",icon:Jr},{id:"evaluation",label:"Evaluation",icon:Pg}];return s.jsxs("div",{className:"flex h-full page",children:[s.jsxs("div",{className:`flex-1 flex flex-col ${r?"lg:mr-96":""}`,children:[s.jsxs("div",{className:"p-4 sm:p-6 border-b border-slate-800/70",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(Re,{to:"/",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100",children:s.jsx(hs,{size:20})}),s.jsx("h1",{className:"text-xl sm:text-2xl font-semibold text-slate-100",children:"Scenario Builder"})]}),s.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[s.jsxs("button",{onClick:()=>l(!r),className:"px-3 py-2 text-slate-400 hover:text-slate-100 border border-slate-700/70 rounded-lg text-sm",children:[s.jsxs("span",{className:"hidden sm:inline",children:[r?"Hide":"Show"," "]}),"YAML"]}),s.jsxs("button",{onClick:()=>x(),disabled:!f.isValid||o,className:"flex items-center gap-2 bg-slate-800 hover:bg-slate-700 disabled:bg-slate-900 disabled:text-slate-500 disabled:cursor-not-allowed text-slate-100 px-3 py-2 rounded-lg text-sm",children:[s.jsx(xs,{size:18}),s.jsx("span",{className:"hidden sm:inline",children:"Save"})]}),s.jsxs("button",{onClick:y,disabled:!f.isValid||o,className:"flex items-center gap-2 bg-emerald-400 hover:bg-emerald-300 disabled:bg-slate-700 disabled:text-slate-400 disabled:cursor-not-allowed text-slate-900 px-3 py-2 rounded-lg font-semibold text-sm",children:[s.jsx(mn,{size:18}),s.jsx("span",{className:"hidden sm:inline",children:o?"Saving...":"Save & Run"})]})]})]}),c&&s.jsxs("div",{className:`mt-4 p-3 rounded-lg flex items-center gap-2 text-sm ${c.type==="success"?"bg-emerald-500/10 text-emerald-300 border border-emerald-400/40":"bg-red-900/30 text-red-400 border border-red-700/60"}`,children:[c.type==="success"?s.jsx(No,{size:18}):s.jsx(Nn,{size:18}),c.text]}),f.validationErrors.length>0&&s.jsxs("div",{className:"mt-4 p-3 bg-amber-500/10 border border-amber-400/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 text-amber-300 font-medium mb-2 text-sm",children:[s.jsx(Nn,{size:18}),"Validation Issues"]}),s.jsx("ul",{className:"list-disc list-inside text-amber-200/80 text-xs sm:text-sm space-y-1",children:f.validationErrors.map((v,j)=>s.jsx("li",{children:v},j))})]})]}),s.jsx("div",{className:"flex overflow-x-auto border-b border-slate-800/70 scrollbar-hide",children:N.map(v=>s.jsxs("button",{onClick:()=>n(v.id),className:`flex items-center gap-2 px-4 sm:px-6 py-3 font-medium transition-colors whitespace-nowrap ${t===v.id?"text-orange-300 border-b-2 border-orange-300":"text-slate-400 hover:text-slate-100"}`,children:[s.jsx(v.icon,{size:18}),s.jsx("span",{className:"hidden sm:inline",children:v.label})]},v.id))}),s.jsxs("div",{className:"flex-1 overflow-auto p-4 sm:p-6",children:[t==="basic"&&s.jsx(v1,{builder:f}),t==="variables"&&s.jsx(j1,{builder:f}),t==="interaction"&&s.jsx(w1,{builder:f}),t==="tools"&&s.jsx(S1,{builder:f,availableTools:a}),t==="evaluation"&&s.jsx(C1,{builder:f})]})]}),r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"fixed inset-0 bg-black/50 lg:hidden z-40",onClick:()=>l(!1)}),s.jsxs("div",{className:"fixed right-0 top-0 bottom-0 w-full sm:w-96 bg-slate-950 border-l border-slate-800/70 flex flex-col z-50",children:[s.jsxs("div",{className:"p-4 border-b border-slate-800/70 flex items-center justify-between",children:[s.jsx("h2",{className:"font-semibold text-slate-100",children:"YAML Preview"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>navigator.clipboard.writeText(f.yamlPreview),className:"text-slate-400 hover:text-slate-100 text-sm",children:"Copy"}),s.jsx("button",{onClick:()=>l(!1),className:"lg:hidden text-slate-400 hover:text-slate-100 p-1",children:s.jsx(hs,{size:18})})]})]}),s.jsx("pre",{className:"flex-1 overflow-auto p-4 text-xs sm:text-sm text-slate-300 font-mono",children:f.yamlPreview})]})]})]})}function v1({builder:e}){return s.jsxs("div",{className:"space-y-6 max-w-2xl",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Scenario ID ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.state.id,onChange:t=>e.setId(t.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-")),placeholder:"my-scenario",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Lowercase letters, numbers, and hyphens only"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Display Name"}),s.jsx("input",{type:"text",value:e.state.name,onChange:t=>e.setName(t.target.value),placeholder:"My Scenario",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Description"}),s.jsx("textarea",{value:e.state.description,onChange:t=>e.setDescription(t.target.value),placeholder:"Describe what this scenario tests...",rows:3,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Category"}),s.jsx("input",{type:"text",value:e.state.category,onChange:t=>e.setCategory(t.target.value),placeholder:"e.g., customer-service, coding, reasoning",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Tags"}),s.jsx("input",{type:"text",value:e.state.tags.join(", "),onChange:t=>e.setTags(t.target.value.split(",").map(n=>n.trim()).filter(Boolean)),placeholder:"tag1, tag2, tag3",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Comma-separated tags"})]})]})}const y1=[{value:"string",label:"Text"},{value:"number",label:"Number"},{value:"boolean",label:"Yes/No"},{value:"select",label:"Dropdown"}];function j1({builder:e}){const t=()=>{e.addVariable({name:`var_${e.state.variables.length+1}`,label:"",type:"string",default:"",options:[],required:!0})};return s.jsxs("div",{className:"space-y-6 max-w-2xl",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium text-slate-400",children:"Scenario Variables"}),s.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Define variables that can be filled in when running the scenario. Use ",s.jsx("code",{className:"text-orange-300",children:"{variable_name}"})," in prompts."]})]}),s.jsxs("button",{onClick:t,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold shrink-0",children:[s.jsx(ke,{size:14})," Add Variable"]})]}),e.state.variables.length===0?s.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:"No variables defined. Add a variable to make your scenario parameterizable."}):s.jsx("div",{className:"space-y-4",children:e.state.variables.map((n,r)=>s.jsx(N1,{variable:n,onUpdate:l=>e.updateVariable(r,l),onRemove:()=>e.removeVariable(r)},r))}),e.state.variables.length>0&&s.jsxs("div",{className:"p-4 panel-subtle rounded-lg",children:[s.jsx("h4",{className:"text-xs font-medium text-slate-400 mb-2",children:"Usage Example"}),s.jsx("code",{className:"text-sm text-orange-300",children:e.state.variables.map(n=>`{${n.name}}`).join(", ")}),s.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Use these placeholders in your prompts, system prompt, or step content."})]})]})}function N1({variable:e,onUpdate:t,onRemove:n}){const[r,l]=m.useState(!0);return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Be,{size:18}):s.jsx(rt,{size:18}),s.jsx("code",{className:"text-orange-300",children:`{${e.name}}`}),s.jsx("span",{className:"text-slate-400 text-sm flex-1",children:e.label||e.name}),s.jsx("span",{className:"text-xs text-slate-500 px-2 py-0.5 bg-slate-800 rounded",children:e.type}),s.jsx("button",{onClick:a=>{a.stopPropagation(),n()},className:"text-slate-500 hover:text-red-400",children:s.jsx($e,{size:16})})]}),r&&s.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Variable Name"}),s.jsx("input",{type:"text",value:e.name,onChange:a=>t({...e,name:a.target.value.replace(/[^a-z0-9_]/gi,"_").toLowerCase()}),placeholder:"variable_name",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Type"}),s.jsx("select",{value:e.type,onChange:a=>t({...e,type:a.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:y1.map(a=>s.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Display Label"}),s.jsx("input",{type:"text",value:e.label,onChange:a=>t({...e,label:a.target.value}),placeholder:"Human-readable label",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Default Value"}),e.type==="boolean"?s.jsxs("select",{value:String(e.default),onChange:a=>t({...e,default:a.target.value==="true"}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:[s.jsx("option",{value:"true",children:"Yes"}),s.jsx("option",{value:"false",children:"No"})]}):e.type==="number"?s.jsx("input",{type:"number",value:e.default,onChange:a=>t({...e,default:Number(a.target.value)}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"}):e.type==="select"&&e.options.length>0?s.jsx("select",{value:String(e.default),onChange:a=>t({...e,default:a.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:e.options.map(a=>s.jsx("option",{value:a,children:a},a))}):s.jsx("input",{type:"text",value:String(e.default),onChange:a=>t({...e,default:a.target.value}),placeholder:"Default value",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsx("div",{className:"flex items-center sm:pt-5",children:s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:e.required,onChange:a=>t({...e,required:a.target.checked}),className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),s.jsx("span",{className:"text-sm text-slate-400",children:"Required"})]})})]}),e.type==="select"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Options (comma-separated)"}),s.jsx("input",{type:"text",value:e.options.join(", "),onChange:a=>t({...e,options:a.target.value.split(",").map(i=>i.trim()).filter(Boolean)}),placeholder:"option1, option2, option3",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})]})}function w1({builder:e}){return s.jsxs("div",{className:"space-y-6 max-w-2xl",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Interaction Mode"}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[s.jsxs("button",{onClick:()=>e.setInteractionMode("prompt"),className:`flex-1 p-3 sm:p-4 rounded-lg border transition-colors ${e.state.interactionMode==="prompt"?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[s.jsx("div",{className:"font-medium text-slate-100",children:"Single-Turn"}),s.jsx("div",{className:"text-xs sm:text-sm text-slate-400",children:"Simple prompt → response"})]}),s.jsxs("button",{onClick:()=>e.setInteractionMode("steps"),className:`flex-1 p-3 sm:p-4 rounded-lg border transition-colors ${e.state.interactionMode==="steps"?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[s.jsx("div",{className:"font-medium text-slate-100",children:"Multi-Turn"}),s.jsx("div",{className:"text-xs sm:text-sm text-slate-400",children:"Conversation steps with tools"})]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"System Prompt"}),s.jsx("textarea",{value:e.state.systemPrompt,onChange:t=>e.setSystemPrompt(t.target.value),placeholder:"Instructions for the AI agent...",rows:4,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono text-sm"})]}),e.state.interactionMode==="prompt"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Prompt ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("textarea",{value:e.state.prompt,onChange:t=>e.setPrompt(t.target.value),placeholder:"Enter the prompt for the AI...",rows:4,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Response Style"}),s.jsx("select",{value:e.state.style,onChange:t=>e.setStyle(t.target.value),className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400",children:h1.map(t=>s.jsx("option",{value:t,children:t||"(None)"},t))})]})]}):s.jsx(k1,{builder:e})]})}function k1({builder:e}){const t=n=>{const r={id:`step_${e.state.steps.length+1}`,action:n,params:n==="inject_user"?{content:""}:{}};e.addStep(r)};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Conversation Steps"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:()=>t("inject_user"),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold",children:[s.jsx(ke,{size:14})," User"]}),s.jsxs("button",{onClick:()=>t("await_agent"),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-emerald-400 hover:bg-emerald-300 text-slate-900 rounded font-semibold",children:[s.jsx(ke,{size:14})," Agent"]})]})]}),e.state.steps.length===0?s.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:"No steps yet. Add a step to start building your conversation."}):s.jsx("div",{className:"space-y-3",children:e.state.steps.map((n,r)=>s.jsx(b1,{step:n,onUpdate:l=>e.updateStep(r,l),onRemove:()=>e.removeStep(r)},r))})]})}function b1({step:e,onUpdate:t,onRemove:n}){const[r,l]=m.useState(!0),a={inject_user:"bg-orange-400 text-slate-900",await_agent:"bg-emerald-400 text-slate-900",await_user:"bg-amber-300 text-slate-900"};return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Be,{size:18}):s.jsx(rt,{size:18}),s.jsx("span",{className:`px-2 py-0.5 rounded text-xs text-white ${a[e.action]||"bg-slate-700 text-slate-200"}`,children:e.action}),s.jsx("span",{className:"text-slate-400 text-sm flex-1",children:e.id}),s.jsx("button",{onClick:i=>{i.stopPropagation(),n()},className:"text-slate-500 hover:text-red-400",children:s.jsx($e,{size:16})})]}),r&&s.jsxs("div",{className:"p-3 border-t border-slate-800/70 space-y-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Step ID"}),s.jsx("input",{type:"text",value:e.id,onChange:i=>t({...e,id:i.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),e.action==="inject_user"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Content"}),s.jsx("textarea",{value:e.params.content||"",onChange:i=>t({...e,params:{...e.params,content:i.target.value}}),rows:3,className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})]})}function S1({builder:e,availableTools:t}){const[n,r]=m.useState(()=>JSON.stringify(e.state.initialState,null,2)||"{}"),[l,a]=m.useState(null),i=u=>{e.state.toolsFrom.includes(u)?e.setToolsFrom(e.state.toolsFrom.filter(c=>c!==u)):e.setToolsFrom([...e.state.toolsFrom,u])},o=u=>{r(u);try{const c=JSON.parse(u);e.setInitialState(c),a(null)}catch{a("Invalid JSON")}};return s.jsxs("div",{className:"space-y-6 max-w-2xl",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Import Tool Libraries"}),t.length===0?s.jsx("div",{className:"text-slate-500 text-sm",children:"No tool libraries found in tools/ directory."}):s.jsx("div",{className:"space-y-2",children:t.map(u=>s.jsxs("label",{className:"flex items-center gap-3 p-3 panel-subtle rounded-lg cursor-pointer hover:border-slate-600/70",children:[s.jsx("input",{type:"checkbox",checked:e.state.toolsFrom.includes(u),onChange:()=>i(u),className:"w-4 h-4 rounded border-slate-600 text-orange-400 focus:ring-orange-400"}),s.jsx("code",{className:"text-orange-300",children:u})]},u))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Initial State (JSON)"}),s.jsx("textarea",{value:n,onChange:u=>o(u.target.value),placeholder:'{"key": "value"}',rows:4,className:`w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 font-mono text-sm ${l?"focus:ring-red-400 border-red-500/50":"focus:ring-orange-400"}`}),l&&s.jsx("p",{className:"mt-1 text-xs text-red-400",children:l})]})]})}function C1({builder:e}){return s.jsxs("div",{className:"space-y-6 max-w-3xl",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Goals (Rule-Based Scoring)"}),s.jsxs("button",{onClick:()=>e.addGoal({id:`goal_${e.state.goals.length+1}`,name:"",description:"",points:10,detection:{type:""}}),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold shrink-0",children:[s.jsx(ke,{size:14})," Add Goal"]})]}),e.state.goals.length===0?s.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:"No goals defined. Add a goal to enable rule-based scoring."}):s.jsx("div",{className:"space-y-4",children:e.state.goals.map((t,n)=>s.jsx(E1,{goal:t,onUpdate:r=>e.updateGoal(n,r),onRemove:()=>e.removeGoal(n)},n))})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-4",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"Judge (LLM-Based Scoring)"}),e.state.judge?s.jsxs("button",{onClick:()=>e.setJudge(null),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-red-500 hover:bg-red-400 text-slate-900 rounded font-semibold shrink-0",children:[s.jsx($e,{size:14})," Remove Judge"]}):s.jsxs("button",{onClick:()=>e.setJudge({type:"llm",model:"gpt-4o-mini",rubric:"",pass_threshold:.5}),className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-emerald-400 hover:bg-emerald-300 text-slate-900 rounded font-semibold shrink-0",children:[s.jsx(ke,{size:14})," Add Judge"]})]}),e.state.judge&&s.jsx(_1,{judge:e.state.judge,onUpdate:t=>e.setJudge(t)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Max Score (Optional)"}),s.jsx("input",{type:"number",value:e.state.maxScore??"",onChange:t=>e.setMaxScore(t.target.value?Number(t.target.value):null),placeholder:"Auto-calculated from goals",className:"w-48 panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]})]})}function E1({goal:e,onUpdate:t,onRemove:n}){const[r,l]=m.useState(!0);return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-3 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Be,{size:18}):s.jsx(rt,{size:18}),s.jsx("span",{className:"text-slate-100 font-medium flex-1",children:e.name||e.id}),s.jsxs("span",{className:"text-emerald-300 text-sm",children:["+",e.points," pts"]}),s.jsx("button",{onClick:a=>{a.stopPropagation(),n()},className:"text-slate-500 hover:text-red-400",children:s.jsx($e,{size:16})})]}),r&&s.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Goal ID"}),s.jsx("input",{type:"text",value:e.id,onChange:a=>t({...e,id:a.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Points"}),s.jsx("input",{type:"number",value:e.points,onChange:a=>t({...e,points:Number(a.target.value)}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Name"}),s.jsx("input",{type:"text",value:e.name,onChange:a=>t({...e,name:a.target.value}),placeholder:"Human-readable name",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Detection Type"}),s.jsxs("select",{value:e.detection.type,onChange:a=>t({...e,detection:{type:a.target.value}}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:[s.jsx("option",{value:"",children:"Select type..."}),x1.map(a=>s.jsx("option",{value:a.value,children:a.label},a.value))]})]}),e.detection.type==="tool_called"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Tool Name"}),s.jsx("input",{type:"text",value:e.detection.tool||"",onChange:a=>t({...e,detection:{...e.detection,tool:a.target.value}}),placeholder:"e.g., check_status",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),e.detection.type==="env_state"&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"State Key"}),s.jsx("input",{type:"text",value:e.detection.key||"",onChange:a=>t({...e,detection:{...e.detection,key:a.target.value}}),placeholder:"e.g., order_complete",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Expected Value"}),s.jsx("input",{type:"text",value:String(e.detection.value??""),onChange:a=>{let i=a.target.value;i==="true"?i=!0:i==="false"?i=!1:isNaN(Number(i))||(i=Number(i)),t({...e,detection:{...e.detection,value:i}})},placeholder:"true, false, or value",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),e.detection.type==="agent_contains"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Patterns (comma-separated)"}),s.jsx("input",{type:"text",value:(e.detection.patterns||[]).join(", "),onChange:a=>t({...e,detection:{...e.detection,patterns:a.target.value.split(",").map(i=>i.trim()).filter(Boolean)}}),placeholder:"sorry, apologize, my mistake",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})]})}function _1({judge:e,onUpdate:t}){return s.jsxs("div",{className:"panel-card p-4 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Judge Type"}),s.jsxs("select",{value:e.type,onChange:n=>t({...e,type:n.target.value}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100",children:[s.jsx("option",{value:"llm",children:"LLM Judge"}),s.jsx("option",{value:"contains",children:"Contains"}),s.jsx("option",{value:"regex",children:"Regex"}),s.jsx("option",{value:"exact",children:"Exact Match"}),s.jsx("option",{value:"length",children:"Length"})]})]}),e.type==="llm"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Judge Model"}),s.jsx("input",{type:"text",value:e.model||"",onChange:n=>t({...e,model:n.target.value}),placeholder:"gpt-4o-mini",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),e.type==="llm"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Rubric"}),s.jsx("textarea",{value:e.rubric||"",onChange:n=>t({...e,rubric:n.target.value}),placeholder:"Score the response from 0.0 to 1.0 based on...",rows:4,className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),(e.type==="contains"||e.type==="regex"||e.type==="exact")&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Pattern"}),s.jsx("input",{type:"text",value:e.pattern||"",onChange:n=>t({...e,pattern:n.target.value}),placeholder:e.type==="regex"?"\\d+":"expected text",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),e.type==="length"&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Min Length"}),s.jsx("input",{type:"number",value:e.min_length??"",onChange:n=>t({...e,min_length:n.target.value?Number(n.target.value):void 0}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Max Length"}),s.jsx("input",{type:"number",value:e.max_length??"",onChange:n=>t({...e,max_length:n.target.value?Number(n.target.value):void 0}),className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Pass Threshold (0.0 - 1.0)"}),s.jsx("input",{type:"number",step:"0.1",min:"0",max:"1",value:e.pass_threshold??.5,onChange:n=>t({...e,pass_threshold:Number(n.target.value)}),className:"w-32 panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]})}const Sc={toolType:"yaml",name:"",description:"",actions:[],pythonClassName:"",pythonActions:[],mcpTransport:"stdio",mcpCommand:"",mcpArgs:[],mcpUrl:"",mcpEnv:[]};function R1(){const[e,t]=m.useState(Sc),n=m.useMemo(()=>e.toolType==="yaml"?T1(e):e.toolType==="python"?A1(e):P1(e),[e]),r=m.useMemo(()=>{const E=[];return e.name?/^[a-z0-9_]+$/.test(e.name)||E.push("Name must be lowercase letters, numbers, and underscores only"):E.push("Tool name is required"),e.toolType==="yaml"?(e.actions.length===0&&E.push("At least one action is required"),e.actions.forEach((w,b)=>{w.name?/^[a-z0-9_]+$/.test(w.name)||E.push(`Action ${b+1}: Name must be lowercase letters, numbers, and underscores`):E.push(`Action ${b+1}: Name is required`),w.params.forEach((R,M)=>{R.name||E.push(`Action ${b+1}, Param ${M+1}: Name is required`)})})):e.toolType==="python"?(e.pythonClassName?/^[A-Z][a-zA-Z0-9]*Tool$/.test(e.pythonClassName)||E.push('Class name should be PascalCase ending with "Tool" (e.g., MyCustomTool)'):E.push("Class name is required"),e.pythonActions.length===0&&E.push("At least one action is required")):e.toolType==="mcp"&&(e.mcpTransport==="stdio"&&!e.mcpCommand&&E.push("Command is required for stdio transport"),(e.mcpTransport==="sse"||e.mcpTransport==="http")&&!e.mcpUrl&&E.push("URL is required for HTTP/SSE transport")),E},[e]),l=r.length===0,a=m.useCallback(E=>{t(w=>({...w,toolType:E}))},[]),i=m.useCallback(E=>{t(w=>({...w,name:E}))},[]),o=m.useCallback(E=>{t(w=>({...w,description:E}))},[]),u=m.useCallback(()=>{t(E=>({...E,actions:[...E.actions,{id:`action_${Date.now()}`,name:`action_${E.actions.length+1}`,description:"",params:[],returns:"",returnsType:"simple",sideEffects:[]}]}))},[]),c=m.useCallback((E,w)=>{t(b=>({...b,actions:b.actions.map((R,M)=>M===E?w:R)}))},[]),p=m.useCallback(E=>{t(w=>({...w,actions:w.actions.filter((b,R)=>R!==E)}))},[]),f=m.useCallback(E=>{t(w=>({...w,actions:w.actions.map((b,R)=>R!==E?b:{...b,params:[...b.params,{name:`param_${b.params.length+1}`,type:"string",required:!0,description:""}]})}))},[]),x=m.useCallback((E,w,b)=>{t(R=>({...R,actions:R.actions.map((M,I)=>I!==E?M:{...M,params:M.params.map((X,J)=>J===w?b:X)})}))},[]),y=m.useCallback((E,w)=>{t(b=>({...b,actions:b.actions.map((R,M)=>M!==E?R:{...R,params:R.params.filter((I,X)=>X!==w)})}))},[]),N=m.useCallback(E=>{t(w=>({...w,actions:w.actions.map((b,R)=>R!==E?b:{...b,sideEffects:[...b.sideEffects,{set:"",value:""}]})}))},[]),v=m.useCallback((E,w,b)=>{t(R=>({...R,actions:R.actions.map((M,I)=>I!==E?M:{...M,sideEffects:M.sideEffects.map((X,J)=>J===w?b:X)})}))},[]),j=m.useCallback((E,w)=>{t(b=>({...b,actions:b.actions.map((R,M)=>M!==E?R:{...R,sideEffects:R.sideEffects.filter((I,X)=>X!==w)})}))},[]),h=m.useCallback(E=>{t(w=>({...w,actions:w.actions.map((b,R)=>{if(R!==E)return b;const M=Array.isArray(b.returns)?b.returns:[];return{...b,returnsType:"conditional",returns:[...M,{when:"",value:""}]}})}))},[]),d=m.useCallback((E,w,b)=>{t(R=>({...R,actions:R.actions.map((M,I)=>I!==E||!Array.isArray(M.returns)?M:{...M,returns:M.returns.map((X,J)=>J===w?b:X)})}))},[]),g=m.useCallback((E,w)=>{t(b=>({...b,actions:b.actions.map((R,M)=>{if(M!==E||!Array.isArray(R.returns))return R;const I=R.returns.filter((X,J)=>J!==w);return{...R,returnsType:I.length>0?"conditional":"simple",returns:I.length>0?I:""}})}))},[]),S=m.useCallback(E=>{t(w=>({...w,pythonClassName:E}))},[]),k=m.useCallback(()=>{t(E=>({...E,pythonActions:[...E.pythonActions,{name:`action_${E.pythonActions.length+1}`,description:"",params:[]}]}))},[]),T=m.useCallback((E,w)=>{t(b=>({...b,pythonActions:b.pythonActions.map((R,M)=>M===E?w:R)}))},[]),A=m.useCallback(E=>{t(w=>({...w,pythonActions:w.pythonActions.filter((b,R)=>R!==E)}))},[]),L=m.useCallback(E=>{t(w=>({...w,mcpTransport:E}))},[]),O=m.useCallback(E=>{t(w=>({...w,mcpCommand:E}))},[]),F=m.useCallback(E=>{t(w=>({...w,mcpArgs:E}))},[]),U=m.useCallback(E=>{t(w=>({...w,mcpUrl:E}))},[]),Y=m.useCallback(()=>{t(E=>({...E,mcpEnv:[...E.mcpEnv,{key:"",value:""}]}))},[]),re=m.useCallback((E,w)=>{t(b=>({...b,mcpEnv:b.mcpEnv.map((R,M)=>M===E?w:R)}))},[]),le=m.useCallback(E=>{t(w=>({...w,mcpEnv:w.mcpEnv.filter((b,R)=>R!==E)}))},[]),_=m.useCallback(()=>{t(Sc)},[]),C=m.useCallback(E=>{try{const w=tl.load(E),b=[],R=w.tools;if(R)for(const[M,I]of Object.entries(R)){const X=[],J=I.params;if(J)for(const[se,Ot]of Object.entries(J))X.push({name:se,type:Ot.type||"string",required:Ot.required!==!1,default:Ot.default,description:Ot.description||"",enum:Ot.enum});const lt=[],Pe=I.side_effects;if(Pe)for(const se of Pe)lt.push({set:se.set,value:se.value});const st=I.returns;let bn="",cl="simple";Array.isArray(st)?(cl="conditional",bn=st.map(se=>({when:se.when,value:se.value}))):typeof st=="string"&&(bn=st),b.push({id:`action_${Date.now()}_${M}`,name:M,description:I.description||"",params:X,returns:bn,returnsType:cl,errorWhen:I.error_when,returnsError:I.returns_error,sideEffects:lt})}t(M=>({...M,toolType:"yaml",name:w.name||"",description:w.description||"",actions:b}))}catch(w){console.error("Failed to parse YAML:",w)}},[]);return{state:e,preview:n,isValid:l,validationErrors:r,setToolType:a,setName:i,setDescription:o,addAction:u,updateAction:c,removeAction:p,addParam:f,updateParam:x,removeParam:y,addSideEffect:N,updateSideEffect:v,removeSideEffect:j,addConditionalReturn:h,updateConditionalReturn:d,removeConditionalReturn:g,setPythonClassName:S,addPythonAction:k,updatePythonAction:T,removePythonAction:A,setMcpTransport:L,setMcpCommand:O,setMcpArgs:F,setMcpUrl:U,addMcpEnvVar:Y,updateMcpEnvVar:re,removeMcpEnvVar:le,reset:_,loadFromYaml:C}}function T1(e){const t={};if(e.name&&(t.name=e.name),e.description&&(t.description=e.description),e.actions.length>0){const n={};for(const r of e.actions){const l={};if(r.description&&(l.description=r.description),r.params.length>0){const a={};for(const i of r.params){const o={type:i.type};i.required&&(o.required=!0),i.default!==void 0&&i.default!==""&&(o.default=i.default),i.description&&(o.description=i.description),i.enum&&i.enum.length>0&&(o.enum=i.enum),a[i.name]=o}l.params=a}r.errorWhen&&(l.error_when=r.errorWhen),r.returnsError&&(l.returns_error=r.returnsError),r.returnsType==="conditional"&&Array.isArray(r.returns)?l.returns=r.returns.map(a=>({when:a.when,value:a.value})):typeof r.returns=="string"&&r.returns&&(l.returns=r.returns),r.sideEffects.length>0&&(l.side_effects=r.sideEffects.map(a=>({set:a.set,value:a.value}))),n[r.name]=l}t.tools=n}return tl.dump(t,{lineWidth:-1,noRefs:!0})}function A1(e){const t=e.pythonClassName||"MyCustomTool",n=e.name||"my_custom_tool";let r=`"""${e.description||"Custom tool implementation."}
|
|
303
|
+
|
|
304
|
+
Tool name: ${n}
|
|
305
|
+
"""
|
|
306
|
+
|
|
307
|
+
from sandboxy.tools.base import BaseTool, ToolConfig, ToolResult
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
class ${t}(BaseTool):
|
|
311
|
+
"""${e.description||"Custom tool implementation."}"""
|
|
312
|
+
|
|
313
|
+
def __init__(self, config: ToolConfig) -> None:
|
|
314
|
+
super().__init__(config)
|
|
315
|
+
# Add your initialization here
|
|
316
|
+
self.data: dict = {}
|
|
317
|
+
|
|
318
|
+
def invoke(self, action: str, args: dict, env_state: dict) -> ToolResult:
|
|
319
|
+
"""Handle tool actions."""
|
|
320
|
+
handlers = {
|
|
321
|
+
`;for(const l of e.pythonActions)r+=` "${l.name}": self._${l.name},
|
|
322
|
+
`;r+=` }
|
|
323
|
+
|
|
324
|
+
handler = handlers.get(action)
|
|
325
|
+
if not handler:
|
|
326
|
+
return ToolResult(success=False, error=f"Unknown action: {action}")
|
|
327
|
+
|
|
328
|
+
return handler(args, env_state)
|
|
329
|
+
`;for(const l of e.pythonActions){const a=l.params.map(i=>` ${i.name}: ${i.description||i.type}`).join(`
|
|
330
|
+
`);r+=`
|
|
331
|
+
def _${l.name}(self, args: dict, env_state: dict) -> ToolResult:
|
|
332
|
+
"""${l.description||"TODO: Add description"}
|
|
333
|
+
|
|
334
|
+
Args:
|
|
335
|
+
${a||" (no parameters)"}
|
|
336
|
+
"""
|
|
337
|
+
# TODO: Implement this action
|
|
338
|
+
${l.params.map(i=>`${i.name} = args.get("${i.name}")`).join(`
|
|
339
|
+
`)}
|
|
340
|
+
|
|
341
|
+
return ToolResult(success=True, data={"result": "TODO"})
|
|
342
|
+
`}r+=`
|
|
343
|
+
def get_actions(self) -> list[dict]:
|
|
344
|
+
"""Define available actions with their schemas."""
|
|
345
|
+
return [
|
|
346
|
+
`;for(const l of e.pythonActions){r+=` {
|
|
347
|
+
"name": "${l.name}",
|
|
348
|
+
"description": "${l.description||""}",
|
|
349
|
+
"parameters": {
|
|
350
|
+
"type": "object",
|
|
351
|
+
"properties": {
|
|
352
|
+
`;for(const a of l.params)r+=` "${a.name}": {"type": "${a.type}", "description": "${a.description||""}"},
|
|
353
|
+
`;r+=` },
|
|
354
|
+
"required": [${l.params.map(a=>`"${a.name}"`).join(", ")}],
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
`}return r+=` ]
|
|
358
|
+
`,r}function P1(e){const t={name:e.name||"my_mcp_server",type:"mcp",transport:e.mcpTransport};if(e.description&&(t.description=e.description),e.mcpTransport==="stdio"?(e.mcpCommand&&(t.command=e.mcpCommand),e.mcpArgs.length>0&&(t.args=e.mcpArgs)):e.mcpUrl&&(t.url=e.mcpUrl),e.mcpEnv.length>0){const n={};for(const r of e.mcpEnv)r.key&&(n[r.key]=r.value);Object.keys(n).length>0&&(t.env=n)}return tl.dump(t,{lineWidth:-1,noRefs:!0})}const L1=[{value:"string",label:"String"},{value:"boolean",label:"Boolean"},{value:"integer",label:"Integer"},{value:"number",label:"Number"},{value:"array",label:"Array"}],M1=[{value:"yaml",label:"Mock (YAML)",icon:cp,description:"Declarative tools with params, returns, and side effects"},{value:"python",label:"Python",icon:ko,description:"Code-based tools for complex logic"},{value:"mcp",label:"MCP Server",icon:Rg,description:"Connect to an external MCP server"}];function F1(){const[e,t]=m.useState(!0),[n,r]=m.useState(!1),[l,a]=m.useState(null),i=R1(),o=async()=>{if(!i.isValid)return!1;r(!0),a(null);try{const c=await fetch("/api/v1/local/tools",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.state.name,toolType:i.state.toolType,content:i.preview})});if(c.ok)return a({type:"success",text:"Tool saved successfully!"}),!0;{const p=await c.json();return a({type:"error",text:p.detail||"Failed to save"}),!1}}catch(c){return a({type:"error",text:c instanceof Error?c.message:"Failed to save"}),!1}finally{r(!1)}},u=i.state.toolType==="python"?"python":"yaml";return s.jsxs("div",{className:"flex h-full page",children:[s.jsxs("div",{className:`flex-1 flex flex-col ${e?"mr-[28rem]":""}`,children:[s.jsxs("div",{className:"p-6 border-b border-slate-800/70",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(Re,{to:"/",className:"flex items-center gap-2 text-slate-400 hover:text-slate-100",children:s.jsx(hs,{size:20})}),s.jsx("h1",{className:"text-2xl font-semibold text-slate-100",children:"Tool Builder"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("button",{onClick:()=>t(!e),className:"px-4 py-2 text-slate-400 hover:text-slate-100 border border-slate-700/70 rounded-lg",children:[e?"Hide":"Show"," Preview"]}),s.jsxs("button",{onClick:()=>o(),disabled:!i.isValid||n,className:"flex items-center gap-2 bg-orange-400 hover:bg-orange-300 disabled:bg-slate-700 disabled:text-slate-400 disabled:cursor-not-allowed text-slate-900 px-4 py-2 rounded-lg font-semibold",children:[s.jsx(xs,{size:18}),n?"Saving...":"Save Tool"]})]})]}),l&&s.jsxs("div",{className:`mt-4 p-3 rounded-lg flex items-center gap-2 ${l.type==="success"?"bg-emerald-500/10 text-emerald-300 border border-emerald-400/40":"bg-red-900/30 text-red-400 border border-red-700/60"}`,children:[l.type==="success"?s.jsx(No,{size:18}):s.jsx(Nn,{size:18}),l.text]}),i.validationErrors.length>0&&s.jsxs("div",{className:"mt-4 p-3 bg-amber-500/10 border border-amber-400/50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 text-amber-300 font-medium mb-2",children:[s.jsx(Nn,{size:18}),"Validation Issues"]}),s.jsx("ul",{className:"list-disc list-inside text-amber-200/80 text-sm space-y-1",children:i.validationErrors.map((c,p)=>s.jsx("li",{children:c},p))})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-6",children:s.jsxs("div",{className:"space-y-8 max-w-3xl",children:[s.jsxs("section",{children:[s.jsx("h2",{className:"text-lg font-medium text-slate-100 mb-4",children:"Tool Type"}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:M1.map(c=>s.jsxs("button",{onClick:()=>i.setToolType(c.value),className:`p-4 rounded-lg border text-left transition-colors ${i.state.toolType===c.value?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[s.jsx(c.icon,{size:24,className:i.state.toolType===c.value?"text-orange-400":"text-slate-400"}),s.jsx("div",{className:"font-medium text-slate-100 mt-2",children:c.label}),s.jsx("div",{className:"text-xs text-slate-400 mt-1",children:c.description})]},c.value))})]}),s.jsxs("section",{children:[s.jsxs("h2",{className:"text-lg font-medium text-slate-100 mb-4 flex items-center gap-2",children:[s.jsx(pp,{size:20}),"Basic Info"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Tool Name ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:i.state.name,onChange:c=>i.setName(c.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")),placeholder:"my_custom_tool",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Lowercase letters, numbers, and underscores only"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Description"}),s.jsx("textarea",{value:i.state.description,onChange:c=>i.setDescription(c.target.value),placeholder:"Describe what this tool does...",rows:2,className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"})]})]})]}),i.state.toolType==="yaml"&&s.jsx(O1,{builder:i}),i.state.toolType==="python"&&s.jsx(B1,{builder:i}),i.state.toolType==="mcp"&&s.jsx(H1,{builder:i})]})})]}),e&&s.jsxs("div",{className:"fixed right-0 top-0 bottom-0 w-[28rem] bg-slate-950/80 border-l border-slate-800/70 flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b border-slate-800/70 flex items-center justify-between",children:[s.jsxs("h2",{className:"font-semibold text-slate-100",children:[u==="python"?"Python Code":"YAML"," Preview"]}),s.jsx("button",{onClick:()=>navigator.clipboard.writeText(i.preview),className:"text-slate-400 hover:text-slate-100 text-sm",children:"Copy"})]}),s.jsx("pre",{className:`flex-1 overflow-auto p-4 text-sm text-slate-300 font-mono ${u==="python"?"text-xs":""}`,children:i.preview})]})]})}function O1({builder:e}){return s.jsxs("section",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h2",{className:"text-lg font-medium text-slate-100 flex items-center gap-2",children:[s.jsx(Jr,{size:20}),"Actions"]}),s.jsxs("button",{onClick:e.addAction,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold",children:[s.jsx(ke,{size:14})," Add Action"]})]}),e.state.actions.length===0?s.jsxs("div",{className:"text-center py-12 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:[s.jsx(Jr,{size:32,className:"mx-auto mb-3 opacity-50"}),s.jsx("p",{children:"No actions defined yet."}),s.jsx("p",{className:"text-sm mt-1",children:"Add an action to define what this tool can do."})]}):s.jsx("div",{className:"space-y-4",children:e.state.actions.map((t,n)=>s.jsx(z1,{action:t,index:n,builder:e},t.id))})]})}function z1({action:e,index:t,builder:n}){const[r,l]=m.useState(!0),a=(i,o)=>{n.updateAction(t,{...e,[i]:o})};return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-4 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Be,{size:18}):s.jsx(rt,{size:18}),s.jsx("code",{className:"text-orange-300 font-medium",children:e.name||"unnamed_action"}),s.jsx("span",{className:"text-slate-500 text-sm flex-1 truncate",children:e.description||"No description"}),s.jsxs("span",{className:"text-xs text-slate-500 px-2 py-0.5 bg-slate-800 rounded",children:[e.params.length," params"]}),s.jsx("button",{onClick:i=>{i.stopPropagation(),n.removeAction(t)},className:"text-slate-500 hover:text-red-400",children:s.jsx($e,{size:16})})]}),r&&s.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action Name *"}),s.jsx("input",{type:"text",value:e.name,onChange:i=>a("name",i.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")),placeholder:"action_name",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),s.jsx("input",{type:"text",value:e.description,onChange:i=>a("description",i.target.value),placeholder:"What does this action do?",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Parameters"}),s.jsxs("button",{onClick:()=>n.addParam(t),className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add Param"]})]}),e.params.length===0?s.jsx("p",{className:"text-xs text-slate-500 italic",children:"No parameters"}):s.jsx("div",{className:"space-y-2",children:e.params.map((i,o)=>s.jsx(D1,{param:i,onUpdate:u=>n.updateParam(t,o,u),onRemove:()=>n.removeParam(t,o)},o))})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Returns"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>a("returnsType","simple"),className:`px-2 py-0.5 text-xs rounded ${e.returnsType==="simple"?"bg-orange-400 text-slate-900":"bg-slate-700 text-slate-300"}`,children:"Simple"}),s.jsx("button",{onClick:()=>{a("returnsType","conditional"),Array.isArray(e.returns)||a("returns",[])},className:`px-2 py-0.5 text-xs rounded ${e.returnsType==="conditional"?"bg-orange-400 text-slate-900":"bg-slate-700 text-slate-300"}`,children:"Conditional"})]})]}),e.returnsType==="simple"?s.jsx("textarea",{value:typeof e.returns=="string"?e.returns:"",onChange:i=>a("returns",i.target.value),placeholder:"Return value with {param} interpolation",rows:2,className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100 font-mono"}):s.jsxs("div",{className:"space-y-2",children:[Array.isArray(e.returns)&&e.returns.map((i,o)=>s.jsx($1,{ret:i,onUpdate:u=>n.updateConditionalReturn(t,o,u),onRemove:()=>n.removeConditionalReturn(t,o)},o)),s.jsxs("button",{onClick:()=>n.addConditionalReturn(t),className:"flex items-center gap-1 px-2 py-1 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add Condition"]})]}),s.jsxs("p",{className:"mt-1 text-xs text-slate-500",children:["Use ",s.jsx("code",{className:"text-orange-300",children:"{param_name}"})," or ",s.jsx("code",{className:"text-orange-300",children:"{state.key}"})," for interpolation"]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-2 block",children:"Error Handling (Optional)"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx("input",{type:"text",value:e.errorWhen||"",onChange:i=>a("errorWhen",i.target.value),placeholder:"error_when condition",className:"panel-subtle rounded px-3 py-1.5 text-xs text-slate-100 font-mono"}),s.jsx("input",{type:"text",value:e.returnsError||"",onChange:i=>a("returnsError",i.target.value),placeholder:"Error message",className:"panel-subtle rounded px-3 py-1.5 text-xs text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("label",{className:"text-xs font-medium text-slate-400 flex items-center gap-1",children:[s.jsx(tr,{size:12}),"Side Effects"]}),s.jsxs("button",{onClick:()=>n.addSideEffect(t),className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add Effect"]})]}),e.sideEffects.length===0?s.jsx("p",{className:"text-xs text-slate-500 italic",children:"No side effects (tool doesn't modify state)"}):s.jsx("div",{className:"space-y-2",children:e.sideEffects.map((i,o)=>s.jsx(I1,{effect:i,onUpdate:u=>n.updateSideEffect(t,o,u),onRemove:()=>n.removeSideEffect(t,o)},o))})]})]})]})}function D1({param:e,onUpdate:t,onRemove:n}){const[r,l]=m.useState(e.enum&&e.enum.length>0);return s.jsxs("div",{className:"p-2 bg-slate-900/50 rounded space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-start",children:[s.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-2",children:[s.jsx("input",{type:"text",value:e.name,onChange:a=>t({...e,name:a.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")}),placeholder:"name",className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),s.jsx("select",{value:e.type,onChange:a=>t({...e,type:a.target.value}),className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100",children:L1.map(a=>s.jsx("option",{value:a.value,children:a.label},a.value))}),s.jsx("input",{type:"text",value:e.description,onChange:a=>t({...e,description:a.target.value}),placeholder:"description",className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("label",{className:"flex items-center gap-1 text-xs text-slate-400",children:[s.jsx("input",{type:"checkbox",checked:e.required,onChange:a=>t({...e,required:a.target.checked}),className:"w-3 h-3"}),"Req"]}),e.type==="string"&&s.jsxs("label",{className:"flex items-center gap-1 text-xs text-slate-400",children:[s.jsx("input",{type:"checkbox",checked:r,onChange:a=>{l(a.target.checked),a.target.checked||t({...e,enum:void 0})},className:"w-3 h-3"}),"Enum"]})]})]}),s.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx($e,{size:14})})]}),r&&e.type==="string"&&s.jsx("input",{type:"text",value:(e.enum||[]).join(", "),onChange:a=>t({...e,enum:a.target.value.split(",").map(i=>i.trim()).filter(Boolean)}),placeholder:"option1, option2, option3",className:"w-full panel-subtle rounded px-2 py-1 text-xs text-slate-100"})]})}function I1({effect:e,onUpdate:t,onRemove:n}){return s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("span",{className:"text-xs text-slate-500",children:"set"}),s.jsx("input",{type:"text",value:e.set,onChange:r=>t({...e,set:r.target.value}),placeholder:"state_key",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),s.jsx("span",{className:"text-xs text-slate-500",children:"="}),s.jsx("input",{type:"text",value:String(e.value),onChange:r=>{let l=r.target.value;l==="true"?l=!0:l==="false"?l=!1:!isNaN(Number(l))&&l!==""&&(l=Number(l)),t({...e,value:l})},placeholder:"value",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),s.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx($e,{size:14})})]})}function $1({ret:e,onUpdate:t,onRemove:n}){return s.jsxs("div",{className:"flex gap-2 items-start p-2 bg-slate-900/50 rounded",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("span",{className:"text-xs text-slate-500 w-12",children:"when:"}),s.jsx("input",{type:"text",value:e.when,onChange:r=>t({...e,when:r.target.value}),placeholder:"condition or 'default'",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"})]}),s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("span",{className:"text-xs text-slate-500 w-12",children:"value:"}),s.jsx("input",{type:"text",value:e.value,onChange:r=>t({...e,value:r.target.value}),placeholder:"Return value",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"})]})]}),s.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx($e,{size:14})})]})}function B1({builder:e}){return s.jsxs("section",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Class Name ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.state.pythonClassName,onChange:t=>e.setPythonClassName(t.target.value),placeholder:"MyCustomTool",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400"}),s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:'PascalCase class name ending with "Tool"'})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("h3",{className:"text-lg font-medium text-slate-100 flex items-center gap-2",children:[s.jsx(ko,{size:20}),"Actions"]}),s.jsxs("button",{onClick:e.addPythonAction,className:"flex items-center gap-1 px-3 py-1.5 text-sm bg-orange-400 hover:bg-orange-300 text-slate-900 rounded font-semibold",children:[s.jsx(ke,{size:14})," Add Action"]})]}),e.state.pythonActions.length===0?s.jsx("div",{className:"text-center py-8 text-slate-500 border border-dashed border-slate-800/70 rounded-lg",children:s.jsx("p",{children:"Define the actions your Python tool will support."})}):s.jsx("div",{className:"space-y-4",children:e.state.pythonActions.map((t,n)=>s.jsx(U1,{action:t,index:n,builder:e},n))})]}),s.jsxs("div",{className:"p-4 panel-subtle rounded-lg",children:[s.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-2",children:"What happens when you save:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 list-disc list-inside",children:[s.jsxs("li",{children:["A Python file will be created in your ",s.jsx("code",{className:"text-orange-300",children:"tools/"})," directory"]}),s.jsx("li",{children:"The file includes TODO comments where you need to add your logic"}),s.jsx("li",{children:"The tool will be automatically discovered and available to use"})]})]})]})}function U1({action:e,index:t,builder:n}){const[r,l]=m.useState(!0),a=c=>{n.updatePythonAction(t,{...e,...c})},i=()=>{a({params:[...e.params,{name:"",type:"string",description:""}]})},o=(c,p)=>{a({params:e.params.map((f,x)=>x===c?{...f,...p}:f)})},u=c=>{a({params:e.params.filter((p,f)=>f!==c)})};return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 p-4 cursor-pointer hover:bg-slate-800/60",onClick:()=>l(!r),children:[r?s.jsx(Be,{size:18}):s.jsx(rt,{size:18}),s.jsx("code",{className:"text-orange-300 font-medium",children:e.name||"unnamed"}),s.jsx("span",{className:"text-slate-500 text-sm flex-1 truncate",children:e.description||"No description"}),s.jsx("button",{onClick:c=>{c.stopPropagation(),n.removePythonAction(t)},className:"text-slate-500 hover:text-red-400",children:s.jsx($e,{size:16})})]}),r&&s.jsxs("div",{className:"p-4 border-t border-slate-800/70 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action Name"}),s.jsx("input",{type:"text",value:e.name,onChange:c=>a({name:c.target.value.toLowerCase().replace(/[^a-z0-9_]/g,"_")}),placeholder:"do_something",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Description"}),s.jsx("input",{type:"text",value:e.description,onChange:c=>a({description:c.target.value}),placeholder:"What does this do?",className:"w-full panel-subtle rounded px-3 py-1.5 text-sm text-slate-100"})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Parameters"}),s.jsxs("button",{onClick:i,className:"flex items-center gap-1 px-2 py-0.5 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add"]})]}),e.params.length===0?s.jsx("p",{className:"text-xs text-slate-500 italic",children:"No parameters"}):s.jsx("div",{className:"space-y-2",children:e.params.map((c,p)=>s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("input",{type:"text",value:c.name,onChange:f=>o(p,{name:f.target.value}),placeholder:"name",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),s.jsxs("select",{value:c.type,onChange:f=>o(p,{type:f.target.value}),className:"panel-subtle rounded px-2 py-1 text-xs text-slate-100",children:[s.jsx("option",{value:"string",children:"string"}),s.jsx("option",{value:"number",children:"number"}),s.jsx("option",{value:"boolean",children:"boolean"}),s.jsx("option",{value:"dict",children:"dict"}),s.jsx("option",{value:"list",children:"list"})]}),s.jsx("input",{type:"text",value:c.description,onChange:f=>o(p,{description:f.target.value}),placeholder:"description",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100"}),s.jsx("button",{onClick:()=>u(p),className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx($e,{size:14})})]},p))})]})]})]})}function H1({builder:e}){return s.jsxs("section",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Transport Type"}),s.jsx("div",{className:"flex gap-4",children:["stdio","sse","http"].map(t=>s.jsxs("button",{onClick:()=>e.setMcpTransport(t),className:`flex-1 p-3 rounded-lg border text-center transition-colors ${e.state.mcpTransport===t?"border-orange-400/60 bg-orange-500/10":"border-slate-800/70 hover:border-slate-700"}`,children:[s.jsx("div",{className:"font-medium text-slate-100",children:t.toUpperCase()}),s.jsx("div",{className:"text-xs text-slate-400 mt-1",children:t==="stdio"?"Local process":t==="sse"?"Server-sent events":"HTTP endpoint"})]},t))})]}),e.state.mcpTransport==="stdio"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["Command ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.state.mcpCommand,onChange:t=>e.setMcpCommand(t.target.value),placeholder:"python -m my_mcp_server",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Arguments (optional)"}),s.jsx("input",{type:"text",value:e.state.mcpArgs.join(" "),onChange:t=>e.setMcpArgs(t.target.value.split(" ").filter(Boolean)),placeholder:"--port 8080 --debug",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono"})]})]}):s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:["URL ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.state.mcpUrl,onChange:t=>e.setMcpUrl(t.target.value),placeholder:"https://api.example.com/mcp",className:"w-full panel-subtle px-4 py-2 text-slate-100 focus:outline-none focus:ring-2 focus:ring-orange-400 font-mono"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-400",children:"Environment Variables"}),s.jsxs("button",{onClick:e.addMcpEnvVar,className:"flex items-center gap-1 px-2 py-1 text-xs bg-slate-700 hover:bg-slate-600 text-slate-200 rounded",children:[s.jsx(ke,{size:12})," Add"]})]}),e.state.mcpEnv.length===0?s.jsx("p",{className:"text-xs text-slate-500 italic",children:"No environment variables"}):s.jsx("div",{className:"space-y-2",children:e.state.mcpEnv.map((t,n)=>s.jsx(V1,{envVar:t,onUpdate:r=>e.updateMcpEnvVar(n,r),onRemove:()=>e.removeMcpEnvVar(n)},n))}),s.jsxs("p",{className:"mt-2 text-xs text-slate-500",children:["Use ",s.jsx("code",{className:"text-orange-300",children:"${ENV_VAR}"})," to reference system environment variables"]})]}),s.jsxs("div",{className:"p-4 panel-subtle rounded-lg",children:[s.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-2",children:"How MCP tools work:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 list-disc list-inside",children:[s.jsx("li",{children:"MCP servers expose tools via the Model Context Protocol"}),s.jsx("li",{children:"The server will be started/connected when the tool is used"}),s.jsx("li",{children:"Tools are automatically discovered from the server"})]})]})]})}function V1({envVar:e,onUpdate:t,onRemove:n}){return s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("input",{type:"text",value:e.key,onChange:r=>t({...e,key:r.target.value}),placeholder:"KEY",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),s.jsx("span",{className:"text-slate-500",children:"="}),s.jsx("input",{type:"text",value:e.value,onChange:r=>t({...e,value:r.target.value}),placeholder:"value or ${ENV_VAR}",className:"flex-1 panel-subtle rounded px-2 py-1 text-xs text-slate-100 font-mono"}),s.jsx("button",{onClick:n,className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx($e,{size:14})})]})}function W1(){const[e,t]=m.useState([]),[n,r]=m.useState([]),[l,a]=m.useState(null),[i,o]=m.useState(null),[u,c]=m.useState(new Set),[p,f]=m.useState(!0),[x,y]=m.useState(null),[N,v]=m.useState(!1),[j,h]=m.useState(!1),[d,g]=m.useState(null),[S,k]=m.useState(!1),[T,A]=m.useState([]),[L,O]=m.useState([]),[F,U]=m.useState(!1);m.useEffect(()=>{Y()},[]),m.useEffect(()=>{if(!(d!=null&&d.scenarioId)){A([]),O([]);return}xe.getScenarioGoals(d.scenarioId).then(b=>{const R=b.filter(M=>M.outcome);A(R.length>0?R:b)}).catch(()=>A([])),xe.getScenarioTools(d.scenarioId).then(O).catch(()=>O([]))},[d==null?void 0:d.scenarioId]),m.useEffect(()=>{l?xe.getDataset(l).then(b=>{o(b),y(null)}).catch(b=>y(b.message)):o(null)},[l]);async function Y(){f(!0);try{const[b,R]=await Promise.all([xe.listDatasets(),xe.listScenarios()]);t(b),r(R),y(null)}catch(b){y(b instanceof Error?b.message:"Failed to load datasets")}finally{f(!1)}}function re(b){const R=new Set(u);R.has(b)?R.delete(b):R.add(b),c(R)}function le(){i&&(g(J1(i)),h(!0))}function _(){g({id:"",name:"",description:"",scenarioId:"",cases:[{id:"case_001",expected:[],variables:[{key:"",value:""}],toolResponses:[],tags:[]}]}),U(!0),h(!0)}async function C(){if(!d)return;const b=F?d.id:l;if(!b){y("Dataset ID is required");return}if(!/^[a-z0-9_-]+$/.test(b)){y("Dataset ID must contain only lowercase letters, numbers, hyphens, and underscores");return}v(!0);try{const R=lm(d);F?await xe.saveDataset(b,R):await xe.updateDataset(b,R),h(!1),U(!1),g(null),await Y(),a(b),y(null)}catch(R){y(R instanceof Error?R.message:"Failed to save dataset")}finally{v(!1)}}async function E(b){if(confirm(`Delete dataset "${b}"?`))try{await xe.deleteDataset(b),l===b&&(a(null),o(null)),await Y(),y(null)}catch(R){y(R instanceof Error?R.message:"Failed to delete dataset")}}function w(){h(!1),U(!1),g(null)}return p?s.jsx("div",{className:"p-8 page",children:s.jsx("div",{className:"text-slate-400",children:"Loading datasets..."})}):s.jsxs("div",{className:"p-8 page",children:[s.jsxs("div",{className:"mb-6",children:[s.jsxs("h1",{className:"text-2xl font-semibold text-slate-100 mb-2 flex items-center gap-2",children:[s.jsx(tn,{size:24}),"Datasets"]}),s.jsx("p",{className:"text-slate-400",children:"Manage test case datasets for multi-case benchmarking"})]}),x&&s.jsxs("div",{className:"mb-4 p-3 bg-red-500/20 border border-red-500/50 rounded-lg flex items-center gap-2 text-red-300",children:[s.jsx(Nn,{size:16}),x,s.jsx("button",{onClick:()=>y(null),className:"ml-auto",children:s.jsx(jt,{size:16})})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"panel-card p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"font-semibold text-slate-200",children:"Datasets"}),s.jsxs("button",{onClick:_,className:"flex items-center gap-1 px-2 py-1 bg-blue-500 hover:bg-blue-400 text-white rounded text-sm",children:[s.jsx(ke,{size:14}),"New"]})]}),e.length===0?s.jsx("p",{className:"text-slate-500 text-sm",children:"No datasets found. Create one to get started."}):s.jsx("div",{className:"space-y-2",children:e.map(b=>s.jsxs("div",{className:`p-3 rounded-lg cursor-pointer transition-colors ${l===b.id?"bg-blue-500/20 border border-blue-500/50":"panel-subtle hover:bg-slate-700/50"}`,onClick:()=>{a(b.id),h(!1),U(!1)},children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-medium text-slate-200",children:b.name}),s.jsxs("span",{className:"text-xs text-slate-500",children:[b.case_count," cases"]})]}),b.description&&s.jsx("p",{className:"text-sm text-slate-400 mt-1 line-clamp-1",children:b.description})]},b.id))})]}),s.jsx("div",{className:"lg:col-span-2 panel-card p-4 overflow-auto max-h-[80vh]",children:j&&d?s.jsx(Y1,{data:d,isNew:F,saving:N,showYaml:S,scenarios:n,outcomeGoals:T,scenarioTools:L,onDataChange:g,onToggleYaml:()=>k(!S),onSave:C,onCancel:w}):i?s.jsx(q1,{dataset:i,expandedCases:u,onToggleCase:re,onEdit:le,onDelete:()=>E(i.id)}):s.jsx("div",{className:"text-center text-slate-500 py-12",children:"Select a dataset or create a new one"})})]})]})}function Y1({data:e,isNew:t,saving:n,showYaml:r,scenarios:l,outcomeGoals:a,scenarioTools:i,onDataChange:o,onToggleYaml:u,onSave:c,onCancel:p}){const f=(v,j)=>{const h=[...e.cases];h[v]={...h[v],...j},o({...e,cases:h})},x=()=>{const v=`case_${String(e.cases.length+1).padStart(3,"0")}`;o({...e,cases:[...e.cases,{id:v,expected:[],variables:[{key:"",value:""}],toolResponses:[],tags:[]}]})},y=v=>{e.cases.length<=1||o({...e,cases:e.cases.filter((j,h)=>h!==v)})},N=v=>{const j=e.cases[v],h=`${j.id}_copy`,d={...j,id:h,variables:[...j.variables.map(g=>({...g}))],toolResponses:j.toolResponses.map(g=>({...g,fields:[...g.fields.map(S=>({...S}))],rawJson:g.rawJson})),tags:[...j.tags]};o({...e,cases:[...e.cases.slice(0,v+1),d,...e.cases.slice(v+1)]})};return r?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-slate-100",children:t?"New Dataset":`Edit: ${e.name}`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:u,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",children:[s.jsx(fp,{size:14}),"Form View"]}),s.jsxs("button",{onClick:p,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",disabled:n,children:[s.jsx(jt,{size:14}),"Cancel"]}),s.jsxs("button",{onClick:c,className:"flex items-center gap-1 px-3 py-1.5 bg-green-500 hover:bg-green-400 text-white rounded text-sm",disabled:n,children:[s.jsx(xs,{size:14}),n?"Saving...":"Save"]})]})]}),s.jsx("pre",{className:"p-4 bg-slate-800 rounded-lg text-sm text-slate-300 overflow-auto max-h-[60vh]",children:lm(e)})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-slate-100",children:t?"New Dataset":`Edit: ${e.name}`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:u,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",children:[s.jsx(ko,{size:14}),"YAML"]}),s.jsxs("button",{onClick:p,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",disabled:n,children:[s.jsx(jt,{size:14}),"Cancel"]}),s.jsxs("button",{onClick:c,className:"flex items-center gap-1 px-3 py-1.5 bg-green-500 hover:bg-green-400 text-white rounded text-sm",disabled:n,children:[s.jsx(xs,{size:14}),n?"Saving...":"Save"]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[t&&s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:["Dataset ID ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:e.id,onChange:v=>o({...e,id:v.target.value.toLowerCase().replace(/[^a-z0-9_-]/g,"-")}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"my-test-cases"})]}),s.jsxs("div",{className:t?"":"col-span-2",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Name"}),s.jsx("input",{type:"text",value:e.name,onChange:v=>o({...e,name:v.target.value}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"My Test Cases"})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsxs("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:["Scenario ",s.jsx("span",{className:"text-slate-500",children:"(for goal dropdown)"})]}),s.jsxs("select",{value:e.scenarioId,onChange:v=>o({...e,scenarioId:v.target.value}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",children:[s.jsx("option",{value:"",children:"Select a scenario..."}),l.map(v=>s.jsx("option",{value:v.id,children:v.name},v.id))]}),!e.scenarioId&&s.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"Link to a scenario to enable outcome goal dropdown in case editor"})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("label",{className:"block text-sm font-medium text-slate-300 mb-1",children:"Description"}),s.jsx("textarea",{value:e.description,onChange:v=>o({...e,description:v.target.value}),className:"w-full px-3 py-2 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",rows:2,placeholder:"Test cases for evaluating..."})]})]}),s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsxs("h3",{className:"font-medium text-slate-200",children:["Test Cases (",e.cases.length,")"]}),s.jsxs("button",{onClick:x,className:"flex items-center gap-1 px-2 py-1 bg-blue-500/20 hover:bg-blue-500/30 text-blue-300 rounded text-sm",children:[s.jsx(ke,{size:14}),"Add Case"]})]}),s.jsx("div",{className:"space-y-4",children:e.cases.map((v,j)=>s.jsx(Q1,{case_:v,index:j,outcomeGoals:a,scenarioTools:i,onChange:h=>f(j,h),onRemove:()=>y(j),onDuplicate:()=>N(j),canRemove:e.cases.length>1},j))})]})}function Q1({case_:e,index:t,outcomeGoals:n,scenarioTools:r,onChange:l,onRemove:a,onDuplicate:i,canRemove:o}){const[u,c]=m.useState(!0),p=k=>{e.expected.includes(k)?l({expected:e.expected.filter(T=>T!==k)}):l({expected:[...e.expected,k]})},f=()=>{l({variables:[...e.variables,{key:"",value:""}]})},x=(k,T,A)=>{const L=[...e.variables];L[k]={key:T,value:A},l({variables:L})},y=k=>{l({variables:e.variables.filter((T,A)=>A!==k)})},N=()=>{l({toolResponses:[...e.toolResponses,{tool:"",action:"",mode:"fields",fields:[{key:"",value:""}],rawJson:`{
|
|
359
|
+
|
|
360
|
+
}`}]})},v=(k,T)=>{const A=[...e.toolResponses];A[k]={...A[k],...T},l({toolResponses:A})},j=k=>{l({toolResponses:e.toolResponses.filter((T,A)=>A!==k)})},h=k=>{const T=[...e.toolResponses];T[k]={...T[k],fields:[...T[k].fields,{key:"",value:""}]},l({toolResponses:T})},d=(k,T,A,L)=>{const O=[...e.toolResponses],F=[...O[k].fields];F[T]={key:A,value:L},O[k]={...O[k],fields:F},l({toolResponses:O})},g=(k,T)=>{const A=[...e.toolResponses];A[k]={...A[k],fields:A[k].fields.filter((L,O)=>O!==T)},l({toolResponses:A})},S=k=>{const T=k.split(",").map(A=>A.trim()).filter(Boolean);l({tags:T})};return s.jsxs("div",{className:"panel-subtle rounded-lg overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-slate-700/50",onClick:()=>c(!u),children:[u?s.jsx(Be,{size:16}):s.jsx(rt,{size:16}),s.jsxs("span",{className:"font-medium text-slate-200",children:["Case ",t+1,": ",e.id]}),e.expected.length>0&&s.jsxs("span",{className:"text-sm text-blue-400",children:["expected: ",e.expected.join(" or ")]}),s.jsxs("div",{className:"ml-auto flex gap-1",onClick:k=>k.stopPropagation(),children:[s.jsx("button",{onClick:i,className:"p-1 text-slate-400 hover:text-slate-200",title:"Duplicate case",children:s.jsx(op,{size:14})}),o&&s.jsx("button",{onClick:a,className:"p-1 text-red-400 hover:text-red-300",title:"Remove case",children:s.jsx($e,{size:14})})]})]}),u&&s.jsxs("div",{className:"px-4 pb-4 pt-2 border-t border-slate-700 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"Case ID"}),s.jsx("input",{type:"text",value:e.id,onChange:k=>l({id:k.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"case_001"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:["Expected Outcome(s) ",e.expected.length>1&&s.jsx("span",{className:"text-blue-400",children:"(any)"})]}),n.length>0?s.jsx("div",{className:"space-y-1.5 max-h-32 overflow-y-auto p-2 bg-slate-800 border border-slate-700 rounded",children:n.map(k=>s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer hover:bg-slate-700/50 p-1 rounded",children:[s.jsx("input",{type:"checkbox",checked:e.expected.includes(k.id),onChange:()=>p(k.id),className:"w-4 h-4 rounded border-slate-600 bg-slate-800 text-blue-500 focus:ring-blue-500"}),s.jsx("span",{className:"text-sm text-slate-200",children:k.name||k.id}),k.description&&s.jsx("span",{className:"text-xs text-slate-500 truncate",children:k.description})]},k.id))}):s.jsx("input",{type:"text",value:e.expected.join(", "),onChange:k=>l({expected:k.target.value.split(",").map(T=>T.trim()).filter(Boolean)}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"goal_id (link scenario for dropdown)"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"Tags (comma-separated)"}),s.jsx("input",{type:"text",value:e.tags.join(", "),onChange:k=>S(k.target.value),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"basic, edge-case, high-value"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Variables"}),s.jsx("button",{onClick:f,className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Variable"})]}),s.jsx("div",{className:"space-y-2",children:e.variables.map((k,T)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:k.key,onChange:A=>x(T,A.target.value,k.value),className:"w-1/3 px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"key"}),s.jsx("input",{type:"text",value:k.value,onChange:A=>x(T,k.key,A.target.value),className:"flex-1 px-2 py-1.5 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm",placeholder:"value"}),s.jsx("button",{onClick:()=>y(T),className:"p-1.5 text-red-400 hover:text-red-300",children:s.jsx(jt,{size:14})})]},T))})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400",children:"Tool Response Overrides"}),s.jsx("button",{onClick:N,className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Override"})]}),s.jsxs("div",{className:"space-y-3",children:[e.toolResponses.map((k,T)=>{const A=r.find(O=>O.name===k.tool),L=(A==null?void 0:A.actions)||[];return s.jsxs("div",{className:"p-3 bg-slate-800/50 rounded-lg border border-slate-700 space-y-3",children:[s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2",children:[r.length>0?s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Tool"}),s.jsxs("select",{value:k.tool,onChange:O=>{const F=O.target.value,U=r.find(re=>re.name===F),Y=(U==null?void 0:U.actions.length)===1&&U.actions[0].name==="call"?"call":"";v(T,{tool:F,action:Y})},className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",children:[s.jsx("option",{value:"",children:"Select tool..."}),r.map(O=>s.jsx("option",{value:O.name,children:O.name},O.name))]})]}):s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Tool"}),s.jsx("input",{type:"text",value:k.tool,onChange:O=>v(T,{tool:O.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"tool_name"})]}),L.length===1&&L[0].name==="call"?s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),s.jsxs("div",{className:"px-2 py-1.5 bg-slate-900 border border-slate-600 rounded text-slate-400 text-sm",children:["call ",s.jsx("span",{className:"text-xs",children:"(single-action)"})]})]}):L.length>0?s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),s.jsxs("select",{value:k.action,onChange:O=>v(T,{action:O.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",children:[s.jsx("option",{value:"",children:"Select action..."}),L.map(O=>s.jsx("option",{value:O.name,children:O.name},O.name))]})]}):s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),s.jsx("input",{type:"text",value:k.action,onChange:O=>v(T,{action:O.target.value}),className:"w-full px-2 py-1.5 bg-slate-800 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"call"})]})]}),s.jsx("button",{onClick:()=>j(T),className:"p-1.5 text-red-400 hover:text-red-300 self-end mb-1",title:"Remove override",children:s.jsx($e,{size:14})})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("label",{className:"text-xs text-slate-500",children:"Response Data"}),s.jsxs("div",{className:"flex text-xs bg-slate-900 rounded overflow-hidden border border-slate-600",children:[s.jsx("button",{onClick:()=>v(T,{mode:"fields"}),className:`px-2 py-1 ${k.mode==="fields"?"bg-blue-500 text-white":"text-slate-400 hover:text-slate-200"}`,children:"Fields"}),s.jsx("button",{onClick:()=>v(T,{mode:"json"}),className:`px-2 py-1 ${k.mode==="json"?"bg-blue-500 text-white":"text-slate-400 hover:text-slate-200"}`,children:"JSON"})]})]}),k.mode==="fields"&&s.jsx("button",{onClick:()=>h(T),className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Field"})]}),k.mode==="fields"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-2",children:k.fields.map((O,F)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:O.key,onChange:U=>d(T,F,U.target.value,O.value),className:"w-1/3 px-2 py-1.5 bg-slate-900 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"field_name"}),s.jsx("input",{type:"text",value:O.value,onChange:U=>d(T,F,O.key,U.target.value),className:"flex-1 px-2 py-1.5 bg-slate-900 border border-slate-600 rounded text-slate-200 text-sm",placeholder:"value (strings, numbers, or JSON)"}),k.fields.length>1&&s.jsx("button",{onClick:()=>g(T,F),className:"p-1.5 text-red-400 hover:text-red-300",children:s.jsx(jt,{size:14})})]},F))}),s.jsx("p",{className:"mt-2 text-xs text-slate-500",children:"Each field becomes a key in the response object. Values are auto-parsed (numbers, booleans, JSON)."})]}):s.jsxs(s.Fragment,{children:[s.jsx("textarea",{value:k.rawJson,onChange:O=>v(T,{rawJson:O.target.value}),className:"w-full px-3 py-2 bg-slate-900 border border-slate-600 rounded text-slate-200 text-sm font-mono",rows:6,placeholder:'{"status": "open", "priority": "high", "items": [1, 2, 3]}'}),s.jsx("p",{className:"mt-2 text-xs text-slate-500",children:"Enter the complete JSON response object. This replaces the tool's normal return value."})]})]})]},T)}),e.toolResponses.length===0&&s.jsx("p",{className:"text-xs text-slate-500 p-3 bg-slate-800/30 rounded-lg border border-dashed border-slate-700",children:r.length>0?"Add overrides to inject custom tool responses for this test case":"Link a scenario above to enable tool dropdowns, or add overrides manually"})]})]})]})]})}function q1({dataset:e,expandedCases:t,onToggleCase:n,onEdit:r,onDelete:l}){const[a,i]=m.useState(5);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold text-slate-100",children:e.name}),s.jsx("p",{className:"text-slate-400 text-sm",children:e.description})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("button",{onClick:r,className:"flex items-center gap-1 px-3 py-1.5 bg-slate-700 hover:bg-slate-600 text-slate-200 rounded text-sm",children:[s.jsx(fp,{size:14}),"Edit"]}),s.jsxs("button",{onClick:l,className:"flex items-center gap-1 px-3 py-1.5 bg-red-500/20 hover:bg-red-500/30 text-red-300 rounded text-sm",children:[s.jsx($e,{size:14}),"Delete"]})]})]}),s.jsxs("div",{className:"mb-4 text-sm text-slate-400",children:[e.cases.length," test case",e.cases.length!==1?"s":"",e.generator&&" (generated)"]}),s.jsx("div",{className:"space-y-2 max-h-[50vh] overflow-y-auto",children:e.cases.map(o=>s.jsx(K1,{case_:o,expanded:t.has(o.id),onToggle:()=>n(o.id)},o.id))}),e.cases.length>0&&s.jsx("div",{className:"mt-4 pt-4 border-t border-slate-700",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs(Re,{to:`/run?dataset=${e.id}¶llel=${a}`,className:"flex items-center gap-2 px-4 py-2 bg-orange-400 hover:bg-orange-300 text-slate-900 rounded-lg font-medium",children:[s.jsx(mn,{size:16}),"Run All Cases"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("label",{className:"text-sm text-slate-400",children:"Parallel:"}),s.jsx("input",{type:"number",min:1,max:20,value:a,onChange:o=>i(Math.max(1,Math.min(20,parseInt(o.target.value)||1))),className:"w-16 px-2 py-1 bg-slate-800 border border-slate-700 rounded text-slate-200 text-sm"}),s.jsx("span",{className:"text-xs text-slate-500",children:"concurrent runs"})]})]})})]})}function K1({case_:e,expanded:t,onToggle:n}){return s.jsxs("div",{className:"panel-subtle rounded-lg overflow-hidden",children:[s.jsxs("button",{onClick:n,className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-slate-700/50 transition-colors",children:[t?s.jsx(Be,{size:16}):s.jsx(rt,{size:16}),s.jsx("span",{className:"font-medium text-slate-200",children:e.id}),e.expected.length>0&&s.jsxs("span",{className:"text-sm text-blue-400",children:["expected: ",e.expected.join(" or ")]}),e.tags.length>0&&s.jsx("div",{className:"flex gap-1 ml-auto",children:e.tags.map(r=>s.jsx("span",{className:"px-2 py-0.5 bg-slate-700 rounded text-xs text-slate-400",children:r},r))})]}),t&&s.jsxs("div",{className:"px-4 pb-3 pt-1 border-t border-slate-700",children:[Object.keys(e.variables).length>0&&s.jsxs("div",{className:"mb-3",children:[s.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase mb-2",children:"Variables"}),s.jsx("pre",{className:"text-sm text-slate-300 bg-slate-800 p-2 rounded overflow-x-auto",children:JSON.stringify(e.variables,null,2)})]}),Object.keys(e.tool_responses).length>0&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-xs font-semibold text-slate-400 uppercase mb-2",children:"Tool Response Overrides"}),s.jsx("pre",{className:"text-sm text-slate-300 bg-slate-800 p-2 rounded overflow-x-auto",children:JSON.stringify(e.tool_responses,null,2)})]})]})]})}function J1(e){return{id:e.id,name:e.name,description:e.description,scenarioId:e.scenario_id||"",cases:e.cases.map(t=>({id:t.id,expected:t.expected||[],variables:Object.entries(t.variables).map(([n,r])=>({key:n,value:typeof r=="string"?r:JSON.stringify(r)})),toolResponses:Object.entries(t.tool_responses).map(([n,r])=>{const l=n.split("."),a=l[0]||n,i=l.slice(1).join(".")||"",o=[];let u=!1;if(typeof r=="object"&&r!==null)for(const[c,p]of Object.entries(r))typeof p=="object"&&p!==null&&(u=!0),o.push({key:c,value:typeof p=="string"?p:JSON.stringify(p)});return o.length===0&&o.push({key:"",value:""}),{tool:a,action:i,mode:u?"json":"fields",fields:o,rawJson:JSON.stringify(r,null,2)}}),tags:t.tags}))}}function lm(e){const t=[];e.name&&t.push(`name: "${e.name}"`),e.description&&(t.push("description: |"),e.description.split(`
|
|
361
|
+
`).forEach(n=>{t.push(` ${n}`)})),e.scenarioId&&t.push(`scenario_id: ${e.scenarioId}`),t.push(""),t.push("cases:");for(const n of e.cases){t.push(` - id: ${n.id}`),n.expected.length===1?t.push(` expected: ${n.expected[0]}`):n.expected.length>1&&t.push(` expected: [${n.expected.join(", ")}]`);const r=n.variables.filter(a=>a.key.trim());if(r.length>0){t.push(" variables:");for(const a of r){const i=Cc(a.value);typeof i=="string"?t.push(` ${a.key}: "${i}"`):t.push(` ${a.key}: ${JSON.stringify(i)}`)}}const l=n.toolResponses.filter(a=>a.tool.trim()?a.mode==="json"?a.rawJson.trim().length>0:a.fields.some(i=>i.key.trim()):!1);if(l.length>0){t.push(" tool_responses:");for(const a of l){const i=a.action?`${a.tool}.${a.action}`:a.tool;if(t.push(` ${i}:`),a.mode==="json")try{const o=JSON.parse(a.rawJson);if(typeof o=="object"&&o!==null)for(const[u,c]of Object.entries(o))typeof c=="string"?t.push(` ${u}: "${c}"`):t.push(` ${u}: ${JSON.stringify(c)}`)}catch{t.push(" # Invalid JSON")}else for(const o of a.fields){if(!o.key.trim())continue;const u=Cc(o.value);typeof u=="string"?t.push(` ${o.key}: "${u}"`):t.push(` ${o.key}: ${JSON.stringify(u)}`)}}}n.tags.length>0&&t.push(` tags: [${n.tags.join(", ")}]`)}return t.join(`
|
|
362
|
+
`)}function Cc(e){try{return JSON.parse(e)}catch{const t=Number(e);return!isNaN(t)&&e.trim()!==""?t:e.toLowerCase()==="true"?!0:e.toLowerCase()==="false"?!1:e}}function G1(){return s.jsx(Dx,{children:s.jsxs(Nt,{path:"/",element:s.jsx(Fg,{}),children:[s.jsx(Nt,{index:!0,element:s.jsx(Og,{})}),s.jsx(Nt,{path:"run/:scenarioId",element:s.jsx(ac,{})}),s.jsx(Nt,{path:"run",element:s.jsx(ac,{})}),s.jsx(Nt,{path:"results",element:s.jsx(Qg,{})}),s.jsx(Nt,{path:"builder",element:s.jsx(g1,{})}),s.jsx(Nt,{path:"tool-builder",element:s.jsx(F1,{})}),s.jsx(Nt,{path:"datasets",element:s.jsx(W1,{})})]})})}ya.createRoot(document.getElementById("root")).render(s.jsx(Cm.StrictMode,{children:s.jsx(ug,{children:s.jsx(G1,{})})}));
|