sandboxy 0.0.5__py3-none-any.whl → 0.0.7__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/app.py +13 -0
- sandboxy/api/routes/local.py +12 -2
- sandboxy/cli/main.py +3 -1
- sandboxy/providers/__init__.py +2 -0
- sandboxy/providers/registry.py +26 -5
- sandboxy/ui/dist/assets/index-DfKu4uXt.js +377 -0
- sandboxy/ui/dist/assets/index-Qf7gGJk_.css +1 -0
- sandboxy/ui/dist/index.html +2 -2
- {sandboxy-0.0.5.dist-info → sandboxy-0.0.7.dist-info}/METADATA +1 -1
- {sandboxy-0.0.5.dist-info → sandboxy-0.0.7.dist-info}/RECORD +13 -13
- sandboxy/ui/dist/assets/index-CLxxjJuD.js +0 -367
- sandboxy/ui/dist/assets/index-DBB7ehs6.css +0 -1
- {sandboxy-0.0.5.dist-info → sandboxy-0.0.7.dist-info}/WHEEL +0 -0
- {sandboxy-0.0.5.dist-info → sandboxy-0.0.7.dist-info}/entry_points.txt +0 -0
- {sandboxy-0.0.5.dist-info → sandboxy-0.0.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,367 +0,0 @@
|
|
|
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 pm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rc={exports:{}},bs={},Tc={exports:{}},V={};/**
|
|
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 rl=Symbol.for("react.element"),mm=Symbol.for("react.portal"),hm=Symbol.for("react.fragment"),xm=Symbol.for("react.strict_mode"),gm=Symbol.for("react.profiler"),vm=Symbol.for("react.provider"),ym=Symbol.for("react.context"),jm=Symbol.for("react.forward_ref"),Nm=Symbol.for("react.suspense"),wm=Symbol.for("react.memo"),bm=Symbol.for("react.lazy"),Ho=Symbol.iterator;function km(e){return e===null||typeof e!="object"?null:(e=Ho&&e[Ho]||e["@@iterator"],typeof e=="function"?e:null)}var Pc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ac=Object.assign,Lc={};function rr(e,t,n){this.props=e,this.context=t,this.refs=Lc,this.updater=n||Pc}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 Mc(){}Mc.prototype=rr.prototype;function wi(e,t,n){this.props=e,this.context=t,this.refs=Lc,this.updater=n||Pc}var bi=wi.prototype=new Mc;bi.constructor=wi;Ac(bi,rr.prototype);bi.isPureReactComponent=!0;var Vo=Array.isArray,Fc=Object.prototype.hasOwnProperty,ki={current:null},Oc={key:!0,ref:!0,__self:!0,__source:!0};function zc(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)Fc.call(t,r)&&!Oc.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:rl,type:e,key:a,ref:i,props:l,_owner:ki.current}}function Sm(e,t){return{$$typeof:rl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Si(e){return typeof e=="object"&&e!==null&&e.$$typeof===rl}function Cm(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Wo=/\/+/g;function Hs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Cm(""+e.key):t.toString(36)}function Pl(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 rl:case mm:i=!0}}if(i)return i=e,l=l(i),e=r===""?"."+Hs(i,0):r,Vo(l)?(n="",e!=null&&(n=e.replace(Wo,"$&/")+"/"),Pl(l,t,n,"",function(c){return c})):l!=null&&(Si(l)&&(l=Sm(l,n+(!l.key||i&&i.key===l.key?"":(""+l.key).replace(Wo,"$&/")+"/")+e)),t.push(l)),1;if(i=0,r=r===""?".":r+":",Vo(e))for(var o=0;o<e.length;o++){a=e[o];var u=r+Hs(a,o);i+=Pl(a,t,n,u,l)}else if(u=km(e),typeof u=="function")for(e=u.call(e),o=0;!(a=e.next()).done;)a=a.value,u=r+Hs(a,o++),i+=Pl(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 fl(e,t,n){if(e==null)return e;var r=[],l=0;return Pl(e,r,"","",function(a){return t.call(n,a,l++)}),r}function Em(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 Pe={current:null},Al={transition:null},_m={ReactCurrentDispatcher:Pe,ReactCurrentBatchConfig:Al,ReactCurrentOwner:ki};function Dc(){throw Error("act(...) is not supported in production builds of React.")}V.Children={map:fl,forEach:function(e,t,n){fl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return fl(e,function(){t++}),t},toArray:function(e){return fl(e,function(t){return t})||[]},only:function(e){if(!Si(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};V.Component=rr;V.Fragment=hm;V.Profiler=gm;V.PureComponent=wi;V.StrictMode=xm;V.Suspense=Nm;V.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_m;V.act=Dc;V.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=Ac({},e.props),l=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=ki.current),t.key!==void 0&&(l=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(u in t)Fc.call(t,u)&&!Oc.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:rl,type:e.type,key:l,ref:a,props:r,_owner:i}};V.createContext=function(e){return e={$$typeof:ym,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vm,_context:e},e.Consumer=e};V.createElement=zc;V.createFactory=function(e){var t=zc.bind(null,e);return t.type=e,t};V.createRef=function(){return{current:null}};V.forwardRef=function(e){return{$$typeof:jm,render:e}};V.isValidElement=Si;V.lazy=function(e){return{$$typeof:bm,_payload:{_status:-1,_result:e},_init:Em}};V.memo=function(e,t){return{$$typeof:wm,type:e,compare:t===void 0?null:t}};V.startTransition=function(e){var t=Al.transition;Al.transition={};try{e()}finally{Al.transition=t}};V.unstable_act=Dc;V.useCallback=function(e,t){return Pe.current.useCallback(e,t)};V.useContext=function(e){return Pe.current.useContext(e)};V.useDebugValue=function(){};V.useDeferredValue=function(e){return Pe.current.useDeferredValue(e)};V.useEffect=function(e,t){return Pe.current.useEffect(e,t)};V.useId=function(){return Pe.current.useId()};V.useImperativeHandle=function(e,t,n){return Pe.current.useImperativeHandle(e,t,n)};V.useInsertionEffect=function(e,t){return Pe.current.useInsertionEffect(e,t)};V.useLayoutEffect=function(e,t){return Pe.current.useLayoutEffect(e,t)};V.useMemo=function(e,t){return Pe.current.useMemo(e,t)};V.useReducer=function(e,t,n){return Pe.current.useReducer(e,t,n)};V.useRef=function(e){return Pe.current.useRef(e)};V.useState=function(e){return Pe.current.useState(e)};V.useSyncExternalStore=function(e,t,n){return Pe.current.useSyncExternalStore(e,t,n)};V.useTransition=function(){return Pe.current.useTransition()};V.version="18.3.1";Tc.exports=V;var h=Tc.exports;const Rm=pm(h);/**
|
|
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 Tm=h,Pm=Symbol.for("react.element"),Am=Symbol.for("react.fragment"),Lm=Object.prototype.hasOwnProperty,Mm=Tm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Fm={key:!0,ref:!0,__self:!0,__source:!0};function Ic(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)Lm.call(t,r)&&!Fm.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:Pm,type:e,key:a,ref:i,props:l,_owner:Mm.current}}bs.Fragment=Am;bs.jsx=Ic;bs.jsxs=Ic;Rc.exports=bs;var s=Rc.exports,Na={},$c={exports:{}},Qe={},Uc={exports:{}},Bc={};/**
|
|
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,k){var T=w.length;w.push(k);e:for(;0<T;){var F=T-1>>>1,U=w[F];if(0<l(U,k))w[F]=k,w[T]=U,T=F;else break e}}function n(w){return w.length===0?null:w[0]}function r(w){if(w.length===0)return null;var k=w[0],T=w.pop();if(T!==k){w[0]=T;e:for(var F=0,U=w.length,ee=U>>>1;F<ee;){var X=2*(F+1)-1,lt=w[X],Le=X+1,st=w[Le];if(0>l(lt,T))Le<U&&0>l(st,lt)?(w[F]=st,w[Le]=T,F=Le):(w[F]=lt,w[X]=T,F=X);else if(Le<U&&0>l(st,T))w[F]=st,w[Le]=T,F=Le;else break e}}return k}function l(w,k){var T=w.sortIndex-k.sortIndex;return T!==0?T:w.id-k.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=[],m=1,f=null,g=3,y=!1,j=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,p=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 x(w){for(var k=n(c);k!==null;){if(k.callback===null)r(c);else if(k.startTime<=w)r(c),k.sortIndex=k.expirationTime,t(u,k);else break;k=n(c)}}function S(w){if(v=!1,x(w),!j)if(n(u)!==null)j=!0,C(N);else{var k=n(c);k!==null&&E(S,k.startTime-w)}}function N(w,k){j=!1,v&&(v=!1,p(M),M=-1),y=!0;var T=g;try{for(x(k),f=n(u);f!==null&&(!(f.expirationTime>k)||w&&!A());){var F=f.callback;if(typeof F=="function"){f.callback=null,g=f.priorityLevel;var U=F(f.expirationTime<=k);k=e.unstable_now(),typeof U=="function"?f.callback=U:f===n(u)&&r(u),x(k)}else r(u);f=n(u)}if(f!==null)var ee=!0;else{var X=n(c);X!==null&&E(S,X.startTime-k),ee=!1}return ee}finally{f=null,g=T,y=!1}}var _=!1,P=null,M=-1,z=5,O=-1;function A(){return!(e.unstable_now()-O<z)}function $(){if(P!==null){var w=e.unstable_now();O=w;var k=!0;try{k=P(!0,w)}finally{k?Y():(_=!1,P=null)}}else _=!1}var Y;if(typeof d=="function")Y=function(){d($)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,R=K.port2;K.port1.onmessage=$,Y=function(){R.postMessage(null)}}else Y=function(){b($,0)};function C(w){P=w,_||(_=!0,Y())}function E(w,k){M=b(function(){w(e.unstable_now())},k)}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(){j||y||(j=!0,C(N))},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"):z=0<w?Math.floor(1e3/w):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(w){switch(g){case 1:case 2:case 3:var k=3;break;default:k=g}var T=g;g=k;try{return w()}finally{g=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(w,k){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var T=g;g=w;try{return k()}finally{g=T}},e.unstable_scheduleCallback=function(w,k,T){var F=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?F+T:F):T=F,w){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=T+U,w={id:m++,callback:k,priorityLevel:w,startTime:T,expirationTime:U,sortIndex:-1},T>F?(w.sortIndex=T,t(c,w),n(u)===null&&w===n(c)&&(v?(p(M),M=-1):v=!0,E(S,T-F))):(w.sortIndex=U,t(u,w),j||y||(j=!0,C(N))),w},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(w){var k=g;return function(){var T=g;g=k;try{return w.apply(this,arguments)}finally{g=T}}}})(Bc);Uc.exports=Bc;var Om=Uc.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 zm=h,Ye=Om;function L(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 Hc=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++)Hc.add(t[e])}var _t=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wa=Object.prototype.hasOwnProperty,Dm=/^[: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]*$/,Yo={},Qo={};function Im(e){return wa.call(Qo,e)?!0:wa.call(Yo,e)?!1:Dm.test(e)?Qo[e]=!0:(Yo[e]=!0,!1)}function $m(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 Um(e,t,n,r){if(t===null||typeof t>"u"||$m(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 je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[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];je[t]=new Ae(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new Ae(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[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){je[e]=new Ae(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new Ae(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new Ae(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new Ae(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new Ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ci=/[\-:]([a-z])/g;function Ei(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(Ci,Ei);je[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(Ci,Ei);je[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(Ci,Ei);je[t]=new Ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new Ae(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new Ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new Ae(e,1,!1,e.toLowerCase(),null,!0,!0)});function _i(e,t,n,r){var l=je.hasOwnProperty(t)?je[t]:null;(l!==null?l.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Um(t,n,l,r)&&(n=null),r||l===null?Im(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=zm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,pl=Symbol.for("react.element"),_n=Symbol.for("react.portal"),Rn=Symbol.for("react.fragment"),Ri=Symbol.for("react.strict_mode"),ba=Symbol.for("react.profiler"),Vc=Symbol.for("react.provider"),Wc=Symbol.for("react.context"),Ti=Symbol.for("react.forward_ref"),ka=Symbol.for("react.suspense"),Sa=Symbol.for("react.suspense_list"),Pi=Symbol.for("react.memo"),Dt=Symbol.for("react.lazy"),Yc=Symbol.for("react.offscreen"),qo=Symbol.iterator;function or(e){return e===null||typeof e!="object"?null:(e=qo&&e[qo]||e["@@iterator"],typeof e=="function"?e:null)}var le=Object.assign,Vs;function gr(e){if(Vs===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Vs=t&&t[1]||""}return`
|
|
34
|
-
`+Vs+e}var Ws=!1;function Ys(e,t){if(!e||Ws)return"";Ws=!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{Ws=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?gr(e):""}function Bm(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=Ys(e.type,!1),e;case 11:return e=Ys(e.type.render,!1),e;case 1:return e=Ys(e.type,!0),e;default:return""}}function Ca(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 ba:return"Profiler";case Ri:return"StrictMode";case ka:return"Suspense";case Sa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Wc:return(e.displayName||"Context")+".Consumer";case Vc:return(e._context.displayName||"Context")+".Provider";case Ti:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pi:return t=e.displayName||null,t!==null?t:Ca(e.type)||"Memo";case Dt:t=e._payload,e=e._init;try{return Ca(e(t))}catch{}}return null}function Hm(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 Ca(t);case 8:return t===Ri?"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 Qc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Vm(e){var t=Qc(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 ml(e){e._valueTracker||(e._valueTracker=Vm(e))}function qc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Qc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Wl(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 Ea(e,t){var n=t.checked;return le({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ko(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 Kc(e,t){t=t.checked,t!=null&&_i(e,"checked",t,!1)}function _a(e,t){Kc(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")?Ra(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ra(e,t.type,Zt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Jo(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 Ra(e,t,n){(t!=="number"||Wl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vr=Array.isArray;function Bn(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 Ta(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(L(91));return le({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Go(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(L(92));if(vr(n)){if(1<n.length)throw Error(L(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Zt(n)}}function Jc(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 Xo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Gc(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 Pa(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Gc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var hl,Xc=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(hl=hl||document.createElement("div"),hl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=hl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Lr(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},Wm=["Webkit","ms","Moz","O"];Object.keys(wr).forEach(function(e){Wm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wr[t]=wr[e]})});function Zc(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 ed(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Zc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Ym=le({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 Aa(e,t){if(t){if(Ym[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function La(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 Ma=null;function Ai(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fa=null,Hn=null,Vn=null;function Zo(e){if(e=al(e)){if(typeof Fa!="function")throw Error(L(280));var t=e.stateNode;t&&(t=_s(t),Fa(e.stateNode,e.type,t))}}function td(e){Hn?Vn?Vn.push(e):Vn=[e]:Hn=e}function nd(){if(Hn){var e=Hn,t=Vn;if(Vn=Hn=null,Zo(e),t)for(e=0;e<t.length;e++)Zo(t[e])}}function rd(e,t){return e(t)}function ld(){}var Qs=!1;function sd(e,t,n){if(Qs)return e(t,n);Qs=!0;try{return rd(e,t,n)}finally{Qs=!1,(Hn!==null||Vn!==null)&&(ld(),nd())}}function Mr(e,t){var n=e.stateNode;if(n===null)return null;var r=_s(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(L(231,t,typeof n));return n}var Oa=!1;if(_t)try{var ur={};Object.defineProperty(ur,"passive",{get:function(){Oa=!0}}),window.addEventListener("test",ur,ur),window.removeEventListener("test",ur,ur)}catch{Oa=!1}function Qm(e,t,n,r,l,a,i,o,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(m){this.onError(m)}}var br=!1,Yl=null,Ql=!1,za=null,qm={onError:function(e){br=!0,Yl=e}};function Km(e,t,n,r,l,a,i,o,u){br=!1,Yl=null,Qm.apply(qm,arguments)}function Jm(e,t,n,r,l,a,i,o,u){if(Km.apply(this,arguments),br){if(br){var c=Yl;br=!1,Yl=null}else throw Error(L(198));Ql||(Ql=!0,za=c)}}function bn(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 ad(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 eu(e){if(bn(e)!==e)throw Error(L(188))}function Gm(e){var t=e.alternate;if(!t){if(t=bn(e),t===null)throw Error(L(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 eu(l),e;if(a===r)return eu(l),t;a=a.sibling}throw Error(L(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(L(189))}}if(n.alternate!==r)throw Error(L(190))}if(n.tag!==3)throw Error(L(188));return n.stateNode.current===n?e:t}function id(e){return e=Gm(e),e!==null?od(e):null}function od(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=od(e);if(t!==null)return t;e=e.sibling}return null}var ud=Ye.unstable_scheduleCallback,tu=Ye.unstable_cancelCallback,Xm=Ye.unstable_shouldYield,Zm=Ye.unstable_requestPaint,oe=Ye.unstable_now,e0=Ye.unstable_getCurrentPriorityLevel,Li=Ye.unstable_ImmediatePriority,cd=Ye.unstable_UserBlockingPriority,ql=Ye.unstable_NormalPriority,t0=Ye.unstable_LowPriority,dd=Ye.unstable_IdlePriority,ks=null,gt=null;function n0(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:s0,r0=Math.log,l0=Math.LN2;function s0(e){return e>>>=0,e===0?32:31-(r0(e)/l0|0)|0}var xl=64,gl=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 Kl(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 a0(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 i0(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]=a0(o,t)):u<=t&&(e.expiredLanes|=o),a&=~o}}function Da(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function fd(){var e=xl;return xl<<=1,!(xl&4194240)&&(xl=64),e}function qs(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ll(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 o0(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 Mi(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 Q=0;function pd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var md,Fi,hd,xd,gd,Ia=!1,vl=[],Vt=null,Wt=null,Yt=null,Fr=new Map,Or=new Map,$t=[],u0="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 nu(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":Fr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Or.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=al(t),t!==null&&Fi(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function c0(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 Fr.set(a,cr(Fr.get(a)||null,e,t,n,r,l)),!0;case"gotpointercapture":return a=l.pointerId,Or.set(a,cr(Or.get(a)||null,e,t,n,r,l)),!0}return!1}function vd(e){var t=cn(e.target);if(t!==null){var n=bn(t);if(n!==null){if(t=n.tag,t===13){if(t=ad(n),t!==null){e.blockedOn=t,gd(e.priority,function(){hd(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 Ll(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=$a(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ma=r,n.target.dispatchEvent(r),Ma=null}else return t=al(n),t!==null&&Fi(t),e.blockedOn=n,!1;t.shift()}return!0}function ru(e,t,n){Ll(e)&&n.delete(t)}function d0(){Ia=!1,Vt!==null&&Ll(Vt)&&(Vt=null),Wt!==null&&Ll(Wt)&&(Wt=null),Yt!==null&&Ll(Yt)&&(Yt=null),Fr.forEach(ru),Or.forEach(ru)}function dr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ia||(Ia=!0,Ye.unstable_scheduleCallback(Ye.unstable_NormalPriority,d0)))}function zr(e){function t(l){return dr(l,e)}if(0<vl.length){dr(vl[0],e);for(var n=1;n<vl.length;n++){var r=vl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Vt!==null&&dr(Vt,e),Wt!==null&&dr(Wt,e),Yt!==null&&dr(Yt,e),Fr.forEach(t),Or.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);)vd(n),n.blockedOn===null&&$t.shift()}var Wn=Mt.ReactCurrentBatchConfig,Jl=!0;function f0(e,t,n,r){var l=Q,a=Wn.transition;Wn.transition=null;try{Q=1,Oi(e,t,n,r)}finally{Q=l,Wn.transition=a}}function p0(e,t,n,r){var l=Q,a=Wn.transition;Wn.transition=null;try{Q=4,Oi(e,t,n,r)}finally{Q=l,Wn.transition=a}}function Oi(e,t,n,r){if(Jl){var l=$a(e,t,n,r);if(l===null)la(e,t,r,Gl,n),nu(e,r);else if(c0(l,e,t,n,r))r.stopPropagation();else if(nu(e,r),t&4&&-1<u0.indexOf(e)){for(;l!==null;){var a=al(l);if(a!==null&&md(a),a=$a(e,t,n,r),a===null&&la(e,t,r,Gl,n),a===l)break;l=a}l!==null&&r.stopPropagation()}else la(e,t,r,null,n)}}var Gl=null;function $a(e,t,n,r){if(Gl=null,e=Ai(r),e=cn(e),e!==null)if(t=bn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ad(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 Gl=e,null}function yd(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(e0()){case Li:return 1;case cd:return 4;case ql:case t0:return 16;case dd:return 536870912;default:return 16}default:return 16}}var Bt=null,zi=null,Ml=null;function jd(){if(Ml)return Ml;var e,t=zi,n=t.length,r,l="value"in Bt?Bt.value:Bt.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 Ml=l.slice(e,1<r?1-r:void 0)}function Fl(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 yl(){return!0}function lu(){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)?yl:lu,this.isPropagationStopped=lu,this}return le(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=yl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=yl)},persist:function(){},isPersistent:yl}),t}var lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Di=qe(lr),sl=le({},lr,{view:0,detail:0}),m0=qe(sl),Ks,Js,fr,Ss=le({},sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ii,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"?(Ks=e.screenX-fr.screenX,Js=e.screenY-fr.screenY):Js=Ks=0,fr=e),Ks)},movementY:function(e){return"movementY"in e?e.movementY:Js}}),su=qe(Ss),h0=le({},Ss,{dataTransfer:0}),x0=qe(h0),g0=le({},sl,{relatedTarget:0}),Gs=qe(g0),v0=le({},lr,{animationName:0,elapsedTime:0,pseudoElement:0}),y0=qe(v0),j0=le({},lr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),N0=qe(j0),w0=le({},lr,{data:0}),au=qe(w0),b0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},k0={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"},S0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function C0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=S0[e])?!!t[e]:!1}function Ii(){return C0}var E0=le({},sl,{key:function(e){if(e.key){var t=b0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?k0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ii,charCode:function(e){return e.type==="keypress"?Fl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_0=qe(E0),R0=le({},Ss,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iu=qe(R0),T0=le({},sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ii}),P0=qe(T0),A0=le({},lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),L0=qe(A0),M0=le({},Ss,{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}),F0=qe(M0),O0=[9,13,27,32],$i=_t&&"CompositionEvent"in window,kr=null;_t&&"documentMode"in document&&(kr=document.documentMode);var z0=_t&&"TextEvent"in window&&!kr,Nd=_t&&(!$i||kr&&8<kr&&11>=kr),ou=" ",uu=!1;function wd(e,t){switch(e){case"keyup":return O0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Tn=!1;function D0(e,t){switch(e){case"compositionend":return bd(t);case"keypress":return t.which!==32?null:(uu=!0,ou);case"textInput":return e=t.data,e===ou&&uu?null:e;default:return null}}function I0(e,t){if(Tn)return e==="compositionend"||!$i&&wd(e,t)?(e=jd(),Ml=zi=Bt=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 Nd&&t.locale!=="ko"?null:t.data;default:return null}}var $0={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 cu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$0[e.type]:t==="textarea"}function kd(e,t,n,r){td(r),t=Xl(t,"onChange"),0<t.length&&(n=new Di("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Sr=null,Dr=null;function U0(e){Fd(e,0)}function Cs(e){var t=Ln(e);if(qc(t))return e}function B0(e,t){if(e==="change")return t}var Sd=!1;if(_t){var Xs;if(_t){var Zs="oninput"in document;if(!Zs){var du=document.createElement("div");du.setAttribute("oninput","return;"),Zs=typeof du.oninput=="function"}Xs=Zs}else Xs=!1;Sd=Xs&&(!document.documentMode||9<document.documentMode)}function fu(){Sr&&(Sr.detachEvent("onpropertychange",Cd),Dr=Sr=null)}function Cd(e){if(e.propertyName==="value"&&Cs(Dr)){var t=[];kd(t,Dr,e,Ai(e)),sd(U0,t)}}function H0(e,t,n){e==="focusin"?(fu(),Sr=t,Dr=n,Sr.attachEvent("onpropertychange",Cd)):e==="focusout"&&fu()}function V0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cs(Dr)}function W0(e,t){if(e==="click")return Cs(t)}function Y0(e,t){if(e==="input"||e==="change")return Cs(t)}function Q0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ft=typeof Object.is=="function"?Object.is:Q0;function Ir(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(!wa.call(t,l)||!ft(e[l],t[l]))return!1}return!0}function pu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mu(e,t){var n=pu(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=pu(n)}}function Ed(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ed(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _d(){for(var e=window,t=Wl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wl(e.document)}return t}function Ui(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 q0(e){var t=_d(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ed(n.ownerDocument.documentElement,n)){if(r!==null&&Ui(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=mu(n,a);var i=mu(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 K0=_t&&"documentMode"in document&&11>=document.documentMode,Pn=null,Ua=null,Cr=null,Ba=!1;function hu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ba||Pn==null||Pn!==Wl(r)||(r=Pn,"selectionStart"in r&&Ui(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&&Ir(Cr,r)||(Cr=r,r=Xl(Ua,"onSelect"),0<r.length&&(t=new Di("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Pn)))}function jl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var An={animationend:jl("Animation","AnimationEnd"),animationiteration:jl("Animation","AnimationIteration"),animationstart:jl("Animation","AnimationStart"),transitionend:jl("Transition","TransitionEnd")},ea={},Rd={};_t&&(Rd=document.createElement("div").style,"AnimationEvent"in window||(delete An.animationend.animation,delete An.animationiteration.animation,delete An.animationstart.animation),"TransitionEvent"in window||delete An.transitionend.transition);function Es(e){if(ea[e])return ea[e];if(!An[e])return e;var t=An[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rd)return ea[e]=t[n];return e}var Td=Es("animationend"),Pd=Es("animationiteration"),Ad=Es("animationstart"),Ld=Es("transitionend"),Md=new Map,xu="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 ln(e,t){Md.set(e,t),wn(t,[e])}for(var ta=0;ta<xu.length;ta++){var na=xu[ta],J0=na.toLowerCase(),G0=na[0].toUpperCase()+na.slice(1);ln(J0,"on"+G0)}ln(Td,"onAnimationEnd");ln(Pd,"onAnimationIteration");ln(Ad,"onAnimationStart");ln("dblclick","onDoubleClick");ln("focusin","onFocus");ln("focusout","onBlur");ln(Ld,"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(" "),X0=new Set("cancel close invalid load scroll toggle".split(" ").concat(jr));function gu(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Jm(r,t,void 0,e),e.currentTarget=null}function Fd(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;gu(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;gu(l,o,c),a=u}}}if(Ql)throw e=za,Ql=!1,za=null,e}function J(e,t){var n=t[Qa];n===void 0&&(n=t[Qa]=new Set);var r=e+"__bubble";n.has(r)||(Od(t,e,2,!1),n.add(r))}function ra(e,t,n){var r=0;t&&(r|=4),Od(n,e,r,t)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function $r(e){if(!e[Nl]){e[Nl]=!0,Hc.forEach(function(n){n!=="selectionchange"&&(X0.has(n)||ra(n,!1,e),ra(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nl]||(t[Nl]=!0,ra("selectionchange",!1,t))}}function Od(e,t,n,r){switch(yd(t)){case 1:var l=f0;break;case 4:l=p0;break;default:l=Oi}n=l.bind(null,t,n,e),l=void 0,!Oa||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 la(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=cn(o),i===null)return;if(u=i.tag,u===5||u===6){r=a=i;continue e}o=o.parentNode}}r=r.return}sd(function(){var c=a,m=Ai(n),f=[];e:{var g=Md.get(e);if(g!==void 0){var y=Di,j=e;switch(e){case"keypress":if(Fl(n)===0)break e;case"keydown":case"keyup":y=_0;break;case"focusin":j="focus",y=Gs;break;case"focusout":j="blur",y=Gs;break;case"beforeblur":case"afterblur":y=Gs;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=su;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=x0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=P0;break;case Td:case Pd:case Ad:y=y0;break;case Ld:y=L0;break;case"scroll":y=m0;break;case"wheel":y=F0;break;case"copy":case"cut":case"paste":y=N0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=iu}var v=(t&4)!==0,b=!v&&e==="scroll",p=v?g!==null?g+"Capture":null:g;v=[];for(var d=c,x;d!==null;){x=d;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,p!==null&&(S=Mr(d,p),S!=null&&v.push(Ur(d,S,x)))),b)break;d=d.return}0<v.length&&(g=new y(g,j,null,n,m),f.push({event:g,listeners:v}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",g&&n!==Ma&&(j=n.relatedTarget||n.fromElement)&&(cn(j)||j[Rt]))break e;if((y||g)&&(g=m.window===m?m:(g=m.ownerDocument)?g.defaultView||g.parentWindow:window,y?(j=n.relatedTarget||n.toElement,y=c,j=j?cn(j):null,j!==null&&(b=bn(j),j!==b||j.tag!==5&&j.tag!==6)&&(j=null)):(y=null,j=c),y!==j)){if(v=su,S="onMouseLeave",p="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(v=iu,S="onPointerLeave",p="onPointerEnter",d="pointer"),b=y==null?g:Ln(y),x=j==null?g:Ln(j),g=new v(S,d+"leave",y,n,m),g.target=b,g.relatedTarget=x,S=null,cn(m)===c&&(v=new v(p,d+"enter",j,n,m),v.target=x,v.relatedTarget=b,S=v),b=S,y&&j)t:{for(v=y,p=j,d=0,x=v;x;x=Sn(x))d++;for(x=0,S=p;S;S=Sn(S))x++;for(;0<d-x;)v=Sn(v),d--;for(;0<x-d;)p=Sn(p),x--;for(;d--;){if(v===p||p!==null&&v===p.alternate)break t;v=Sn(v),p=Sn(p)}v=null}else v=null;y!==null&&vu(f,g,y,v,!1),j!==null&&b!==null&&vu(f,b,j,v,!0)}}e:{if(g=c?Ln(c):window,y=g.nodeName&&g.nodeName.toLowerCase(),y==="select"||y==="input"&&g.type==="file")var N=B0;else if(cu(g))if(Sd)N=Y0;else{N=V0;var _=H0}else(y=g.nodeName)&&y.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(N=W0);if(N&&(N=N(e,c))){kd(f,N,n,m);break e}_&&_(e,g,c),e==="focusout"&&(_=g._wrapperState)&&_.controlled&&g.type==="number"&&Ra(g,"number",g.value)}switch(_=c?Ln(c):window,e){case"focusin":(cu(_)||_.contentEditable==="true")&&(Pn=_,Ua=c,Cr=null);break;case"focusout":Cr=Ua=Pn=null;break;case"mousedown":Ba=!0;break;case"contextmenu":case"mouseup":case"dragend":Ba=!1,hu(f,n,m);break;case"selectionchange":if(K0)break;case"keydown":case"keyup":hu(f,n,m)}var P;if($i)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Tn?wd(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(Nd&&n.locale!=="ko"&&(Tn||M!=="onCompositionStart"?M==="onCompositionEnd"&&Tn&&(P=jd()):(Bt=m,zi="value"in Bt?Bt.value:Bt.textContent,Tn=!0)),_=Xl(c,M),0<_.length&&(M=new au(M,e,null,n,m),f.push({event:M,listeners:_}),P?M.data=P:(P=bd(n),P!==null&&(M.data=P)))),(P=z0?D0(e,n):I0(e,n))&&(c=Xl(c,"onBeforeInput"),0<c.length&&(m=new au("onBeforeInput","beforeinput",null,n,m),f.push({event:m,listeners:c}),m.data=P))}Fd(f,t)})}function Ur(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Xl(e,t){for(var n=t+"Capture",r=[];e!==null;){var l=e,a=l.stateNode;l.tag===5&&a!==null&&(l=a,a=Mr(e,n),a!=null&&r.unshift(Ur(e,a,l)),a=Mr(e,t),a!=null&&r.push(Ur(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 vu(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=Mr(n,a),u!=null&&i.unshift(Ur(n,u,o))):l||(u=Mr(n,a),u!=null&&i.push(Ur(n,u,o)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var Z0=/\r\n?/g,eh=/\u0000|\uFFFD/g;function yu(e){return(typeof e=="string"?e:""+e).replace(Z0,`
|
|
38
|
-
`).replace(eh,"")}function wl(e,t,n){if(t=yu(t),yu(e)!==t&&n)throw Error(L(425))}function Zl(){}var Ha=null,Va=null;function Wa(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 Ya=typeof setTimeout=="function"?setTimeout:void 0,th=typeof clearTimeout=="function"?clearTimeout:void 0,ju=typeof Promise=="function"?Promise:void 0,nh=typeof queueMicrotask=="function"?queueMicrotask:typeof ju<"u"?function(e){return ju.resolve(null).then(e).catch(rh)}:Ya;function rh(e){setTimeout(function(){throw e})}function sa(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),zr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=l}while(n);zr(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 Nu(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,Qa="__reactEvents$"+sr,lh="__reactListeners$"+sr,sh="__reactHandles$"+sr;function cn(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=Nu(e);e!==null;){if(n=e[xt])return n;e=Nu(e)}return t}e=n,n=e.parentNode}return null}function al(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(L(33))}function _s(e){return e[Br]||null}var qa=[],Mn=-1;function sn(e){return{current:e}}function G(e){0>Mn||(e.current=qa[Mn],qa[Mn]=null,Mn--)}function q(e,t){Mn++,qa[Mn]=e.current,e.current=t}var en={},ke=sn(en),De=sn(!1),gn=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 Ie(e){return e=e.childContextTypes,e!=null}function es(){G(De),G(ke)}function wu(e,t,n){if(ke.current!==en)throw Error(L(168));q(ke,t),q(De,n)}function zd(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(L(108,Hm(e)||"Unknown",l));return le({},n,r)}function ts(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||en,gn=ke.current,q(ke,e),q(De,De.current),!0}function bu(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=zd(e,t,gn),r.__reactInternalMemoizedMergedChildContext=e,G(De),G(ke),q(ke,e)):G(De),q(De,n)}var bt=null,Rs=!1,aa=!1;function Dd(e){bt===null?bt=[e]:bt.push(e)}function ah(e){Rs=!0,Dd(e)}function an(){if(!aa&&bt!==null){aa=!0;var e=0,t=Q;try{var n=bt;for(Q=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}bt=null,Rs=!1}catch(l){throw bt!==null&&(bt=bt.slice(e+1)),ud(Li,an),l}finally{Q=t,aa=!1}}return null}var Fn=[],On=0,ns=null,rs=0,Ke=[],Je=0,vn=null,kt=1,St="";function on(e,t){Fn[On++]=rs,Fn[On++]=ns,ns=e,rs=t}function Id(e,t,n){Ke[Je++]=kt,Ke[Je++]=St,Ke[Je++]=vn,vn=e;var r=kt;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,kt=1<<32-ct(t)+l|n<<l|r,St=a+e}else kt=1<<a|n<<l|r,St=e}function Bi(e){e.return!==null&&(on(e,1),Id(e,1,0))}function Hi(e){for(;e===ns;)ns=Fn[--On],Fn[On]=null,rs=Fn[--On],Fn[On]=null;for(;e===vn;)vn=Ke[--Je],Ke[Je]=null,St=Ke[--Je],Ke[Je]=null,kt=Ke[--Je],Ke[Je]=null}var We=null,Ve=null,Z=!1,ut=null;function $d(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 ku(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=vn!==null?{id:kt,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 Ka(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ja(e){if(Z){var t=Ve;if(t){var n=t;if(!ku(e,t)){if(Ka(e))throw Error(L(418));t=Qt(n.nextSibling);var r=We;t&&ku(e,t)?$d(r,n):(e.flags=e.flags&-4097|2,Z=!1,We=e)}}else{if(Ka(e))throw Error(L(418));e.flags=e.flags&-4097|2,Z=!1,We=e}}}function Su(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;We=e}function bl(e){if(e!==We)return!1;if(!Z)return Su(e),Z=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Wa(e.type,e.memoizedProps)),t&&(t=Ve)){if(Ka(e))throw Ud(),Error(L(418));for(;t;)$d(e,t),t=Qt(t.nextSibling)}if(Su(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(L(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 Ud(){for(var e=Ve;e;)e=Qt(e.nextSibling)}function Jn(){Ve=We=null,Z=!1}function Vi(e){ut===null?ut=[e]:ut.push(e)}var ih=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(L(309));var r=n.stateNode}if(!r)throw Error(L(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(L(284));if(!n._owner)throw Error(L(290,e))}return e}function kl(e,t){throw e=Object.prototype.toString.call(t),Error(L(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Cu(e){var t=e._init;return t(e._payload)}function Bd(e){function t(p,d){if(e){var x=p.deletions;x===null?(p.deletions=[d],p.flags|=16):x.push(d)}}function n(p,d){if(!e)return null;for(;d!==null;)t(p,d),d=d.sibling;return null}function r(p,d){for(p=new Map;d!==null;)d.key!==null?p.set(d.key,d):p.set(d.index,d),d=d.sibling;return p}function l(p,d){return p=Gt(p,d),p.index=0,p.sibling=null,p}function a(p,d,x){return p.index=x,e?(x=p.alternate,x!==null?(x=x.index,x<d?(p.flags|=2,d):x):(p.flags|=2,d)):(p.flags|=1048576,d)}function i(p){return e&&p.alternate===null&&(p.flags|=2),p}function o(p,d,x,S){return d===null||d.tag!==6?(d=pa(x,p.mode,S),d.return=p,d):(d=l(d,x),d.return=p,d)}function u(p,d,x,S){var N=x.type;return N===Rn?m(p,d,x.props.children,S,x.key):d!==null&&(d.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Dt&&Cu(N)===d.type)?(S=l(d,x.props),S.ref=pr(p,d,x),S.return=p,S):(S=Bl(x.type,x.key,x.props,null,p.mode,S),S.ref=pr(p,d,x),S.return=p,S)}function c(p,d,x,S){return d===null||d.tag!==4||d.stateNode.containerInfo!==x.containerInfo||d.stateNode.implementation!==x.implementation?(d=ma(x,p.mode,S),d.return=p,d):(d=l(d,x.children||[]),d.return=p,d)}function m(p,d,x,S,N){return d===null||d.tag!==7?(d=mn(x,p.mode,S,N),d.return=p,d):(d=l(d,x),d.return=p,d)}function f(p,d,x){if(typeof d=="string"&&d!==""||typeof d=="number")return d=pa(""+d,p.mode,x),d.return=p,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case pl:return x=Bl(d.type,d.key,d.props,null,p.mode,x),x.ref=pr(p,null,d),x.return=p,x;case _n:return d=ma(d,p.mode,x),d.return=p,d;case Dt:var S=d._init;return f(p,S(d._payload),x)}if(vr(d)||or(d))return d=mn(d,p.mode,x,null),d.return=p,d;kl(p,d)}return null}function g(p,d,x,S){var N=d!==null?d.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return N!==null?null:o(p,d,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case pl:return x.key===N?u(p,d,x,S):null;case _n:return x.key===N?c(p,d,x,S):null;case Dt:return N=x._init,g(p,d,N(x._payload),S)}if(vr(x)||or(x))return N!==null?null:m(p,d,x,S,null);kl(p,x)}return null}function y(p,d,x,S,N){if(typeof S=="string"&&S!==""||typeof S=="number")return p=p.get(x)||null,o(d,p,""+S,N);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case pl:return p=p.get(S.key===null?x:S.key)||null,u(d,p,S,N);case _n:return p=p.get(S.key===null?x:S.key)||null,c(d,p,S,N);case Dt:var _=S._init;return y(p,d,x,_(S._payload),N)}if(vr(S)||or(S))return p=p.get(x)||null,m(d,p,S,N,null);kl(d,S)}return null}function j(p,d,x,S){for(var N=null,_=null,P=d,M=d=0,z=null;P!==null&&M<x.length;M++){P.index>M?(z=P,P=null):z=P.sibling;var O=g(p,P,x[M],S);if(O===null){P===null&&(P=z);break}e&&P&&O.alternate===null&&t(p,P),d=a(O,d,M),_===null?N=O:_.sibling=O,_=O,P=z}if(M===x.length)return n(p,P),Z&&on(p,M),N;if(P===null){for(;M<x.length;M++)P=f(p,x[M],S),P!==null&&(d=a(P,d,M),_===null?N=P:_.sibling=P,_=P);return Z&&on(p,M),N}for(P=r(p,P);M<x.length;M++)z=y(P,p,M,x[M],S),z!==null&&(e&&z.alternate!==null&&P.delete(z.key===null?M:z.key),d=a(z,d,M),_===null?N=z:_.sibling=z,_=z);return e&&P.forEach(function(A){return t(p,A)}),Z&&on(p,M),N}function v(p,d,x,S){var N=or(x);if(typeof N!="function")throw Error(L(150));if(x=N.call(x),x==null)throw Error(L(151));for(var _=N=null,P=d,M=d=0,z=null,O=x.next();P!==null&&!O.done;M++,O=x.next()){P.index>M?(z=P,P=null):z=P.sibling;var A=g(p,P,O.value,S);if(A===null){P===null&&(P=z);break}e&&P&&A.alternate===null&&t(p,P),d=a(A,d,M),_===null?N=A:_.sibling=A,_=A,P=z}if(O.done)return n(p,P),Z&&on(p,M),N;if(P===null){for(;!O.done;M++,O=x.next())O=f(p,O.value,S),O!==null&&(d=a(O,d,M),_===null?N=O:_.sibling=O,_=O);return Z&&on(p,M),N}for(P=r(p,P);!O.done;M++,O=x.next())O=y(P,p,M,O.value,S),O!==null&&(e&&O.alternate!==null&&P.delete(O.key===null?M:O.key),d=a(O,d,M),_===null?N=O:_.sibling=O,_=O);return e&&P.forEach(function($){return t(p,$)}),Z&&on(p,M),N}function b(p,d,x,S){if(typeof x=="object"&&x!==null&&x.type===Rn&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case pl:e:{for(var N=x.key,_=d;_!==null;){if(_.key===N){if(N=x.type,N===Rn){if(_.tag===7){n(p,_.sibling),d=l(_,x.props.children),d.return=p,p=d;break e}}else if(_.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Dt&&Cu(N)===_.type){n(p,_.sibling),d=l(_,x.props),d.ref=pr(p,_,x),d.return=p,p=d;break e}n(p,_);break}else t(p,_);_=_.sibling}x.type===Rn?(d=mn(x.props.children,p.mode,S,x.key),d.return=p,p=d):(S=Bl(x.type,x.key,x.props,null,p.mode,S),S.ref=pr(p,d,x),S.return=p,p=S)}return i(p);case _n:e:{for(_=x.key;d!==null;){if(d.key===_)if(d.tag===4&&d.stateNode.containerInfo===x.containerInfo&&d.stateNode.implementation===x.implementation){n(p,d.sibling),d=l(d,x.children||[]),d.return=p,p=d;break e}else{n(p,d);break}else t(p,d);d=d.sibling}d=ma(x,p.mode,S),d.return=p,p=d}return i(p);case Dt:return _=x._init,b(p,d,_(x._payload),S)}if(vr(x))return j(p,d,x,S);if(or(x))return v(p,d,x,S);kl(p,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,d!==null&&d.tag===6?(n(p,d.sibling),d=l(d,x),d.return=p,p=d):(n(p,d),d=pa(x,p.mode,S),d.return=p,p=d),i(p)):n(p,d)}return b}var Gn=Bd(!0),Hd=Bd(!1),ls=sn(null),ss=null,zn=null,Wi=null;function Yi(){Wi=zn=ss=null}function Qi(e){var t=ls.current;G(ls),e._currentValue=t}function Ga(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){ss=e,Wi=zn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Oe=!0),e.firstContext=null)}function Ze(e){var t=e._currentValue;if(Wi!==e)if(e={context:e,memoizedValue:t,next:null},zn===null){if(ss===null)throw Error(L(308));zn=e,ss.dependencies={lanes:0,firstContext:e}}else zn=zn.next=e;return t}var dn=null;function qi(e){dn===null?dn=[e]:dn.push(e)}function Vd(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,qi(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 Ki(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wd(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,W&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,qi(r)):(t.next=l.next,l.next=t),r.interleaved=t,Tt(e,n)}function Ol(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,Mi(e,n)}}function Eu(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 as(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 m=e.alternate;m!==null&&(m=m.updateQueue,o=m.lastBaseUpdate,o!==i&&(o===null?m.firstBaseUpdate=c:o.next=c,m.lastBaseUpdate=u))}if(a!==null){var f=l.baseState;i=0,m=c=u=null,o=a;do{var g=o.lane,y=o.eventTime;if((r&g)===g){m!==null&&(m=m.next={eventTime:y,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var j=e,v=o;switch(g=t,y=n,v.tag){case 1:if(j=v.payload,typeof j=="function"){f=j.call(y,f,g);break e}f=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=v.payload,g=typeof j=="function"?j.call(y,f,g):j,g==null)break e;f=le({},f,g);break e;case 2:It=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,g=l.effects,g===null?l.effects=[o]:g.push(o))}else y={eventTime:y,lane:g,tag:o.tag,payload:o.payload,callback:o.callback,next:null},m===null?(c=m=y,u=f):m=m.next=y,i|=g;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;g=o,o=g.next,g.next=null,l.lastBaseUpdate=g,l.shared.pending=null}}while(!0);if(m===null&&(u=f),l.baseState=u,l.firstBaseUpdate=c,l.lastBaseUpdate=m,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);jn|=i,e.lanes=i,e.memoizedState=f}}function _u(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(L(191,l));l.call(r)}}}var il={},vt=sn(il),Hr=sn(il),Vr=sn(il);function fn(e){if(e===il)throw Error(L(174));return e}function Ji(e,t){switch(q(Vr,t),q(Hr,e),q(vt,il),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Pa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Pa(t,e)}G(vt),q(vt,t)}function Xn(){G(vt),G(Hr),G(Vr)}function Yd(e){fn(Vr.current);var t=fn(vt.current),n=Pa(t,e.type);t!==n&&(q(Hr,e),q(vt,n))}function Gi(e){Hr.current===e&&(G(vt),G(Hr))}var te=sn(0);function is(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 ia=[];function Xi(){for(var e=0;e<ia.length;e++)ia[e]._workInProgressVersionPrimary=null;ia.length=0}var zl=Mt.ReactCurrentDispatcher,oa=Mt.ReactCurrentBatchConfig,yn=0,ne=null,de=null,me=null,os=!1,Er=!1,Wr=0,oh=0;function Ne(){throw Error(L(321))}function Zi(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 eo(e,t,n,r,l,a){if(yn=a,ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,zl.current=e===null||e.memoizedState===null?fh:ph,e=n(r,l),Er){a=0;do{if(Er=!1,Wr=0,25<=a)throw Error(L(301));a+=1,me=de=null,t.updateQueue=null,zl.current=mh,e=n(r,l)}while(Er)}if(zl.current=us,t=de!==null&&de.next!==null,yn=0,me=de=ne=null,os=!1,t)throw Error(L(300));return e}function to(){var e=Wr!==0;return Wr=0,e}function ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return me===null?ne.memoizedState=me=e:me=me.next=e,me}function et(){if(de===null){var e=ne.alternate;e=e!==null?e.memoizedState:null}else e=de.next;var t=me===null?ne.memoizedState:me.next;if(t!==null)me=t,de=e;else{if(e===null)throw Error(L(310));de=e,e={memoizedState:de.memoizedState,baseState:de.baseState,baseQueue:de.baseQueue,queue:de.queue,next:null},me===null?ne.memoizedState=me=e:me=me.next=e}return me}function Yr(e,t){return typeof t=="function"?t(e):t}function ua(e){var t=et(),n=t.queue;if(n===null)throw Error(L(311));n.lastRenderedReducer=e;var r=de,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 m=c.lane;if((yn&m)===m)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:m,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(o=u=f,i=r):u=u.next=f,ne.lanes|=m,jn|=m}c=c.next}while(c!==null&&c!==a);u===null?i=r:u.next=o,ft(r,t.memoizedState)||(Oe=!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,ne.lanes|=a,jn|=a,l=l.next;while(l!==e)}else l===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ca(e){var t=et(),n=t.queue;if(n===null)throw Error(L(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)||(Oe=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Qd(){}function qd(e,t){var n=ne,r=et(),l=t(),a=!ft(r.memoizedState,l);if(a&&(r.memoizedState=l,Oe=!0),r=r.queue,no(Gd.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||me!==null&&me.memoizedState.tag&1){if(n.flags|=2048,Qr(9,Jd.bind(null,n,r,l,t),void 0,null),he===null)throw Error(L(349));yn&30||Kd(n,t,l)}return l}function Kd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ne.updateQueue,t===null?(t={lastEffect:null,stores:null},ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Jd(e,t,n,r){t.value=n,t.getSnapshot=r,Xd(t)&&Zd(e)}function Gd(e,t,n){return n(function(){Xd(t)&&Zd(e)})}function Xd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ft(e,n)}catch{return!0}}function Zd(e){var t=Tt(e,1);t!==null&&dt(t,e,1,-1)}function Ru(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:Yr,lastRenderedState:e},t.queue=e,e=e.dispatch=dh.bind(null,ne,e),[t.memoizedState,e]}function Qr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ne.updateQueue,t===null?(t={lastEffect:null,stores:null},ne.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 ef(){return et().memoizedState}function Dl(e,t,n,r){var l=ht();ne.flags|=e,l.memoizedState=Qr(1|t,n,void 0,r===void 0?null:r)}function Ts(e,t,n,r){var l=et();r=r===void 0?null:r;var a=void 0;if(de!==null){var i=de.memoizedState;if(a=i.destroy,r!==null&&Zi(r,i.deps)){l.memoizedState=Qr(t,n,a,r);return}}ne.flags|=e,l.memoizedState=Qr(1|t,n,a,r)}function Tu(e,t){return Dl(8390656,8,e,t)}function no(e,t){return Ts(2048,8,e,t)}function tf(e,t){return Ts(4,2,e,t)}function nf(e,t){return Ts(4,4,e,t)}function rf(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 lf(e,t,n){return n=n!=null?n.concat([e]):null,Ts(4,4,rf.bind(null,t,e),n)}function ro(){}function sf(e,t){var n=et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Zi(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function af(e,t){var n=et();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Zi(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function of(e,t,n){return yn&21?(ft(n,t)||(n=fd(),ne.lanes|=n,jn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Oe=!0),e.memoizedState=n)}function uh(e,t){var n=Q;Q=n!==0&&4>n?n:4,e(!0);var r=oa.transition;oa.transition={};try{e(!1),t()}finally{Q=n,oa.transition=r}}function uf(){return et().memoizedState}function ch(e,t,n){var r=Jt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cf(e))df(t,n);else if(n=Vd(e,t,n,r),n!==null){var l=_e();dt(n,e,r,l),ff(n,t,r)}}function dh(e,t,n){var r=Jt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cf(e))df(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,qi(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Vd(e,t,l,r),n!==null&&(l=_e(),dt(n,e,r,l),ff(n,t,r))}}function cf(e){var t=e.alternate;return e===ne||t!==null&&t===ne}function df(e,t){Er=os=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ff(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mi(e,n)}}var us={readContext:Ze,useCallback:Ne,useContext:Ne,useEffect:Ne,useImperativeHandle:Ne,useInsertionEffect:Ne,useLayoutEffect:Ne,useMemo:Ne,useReducer:Ne,useRef:Ne,useState:Ne,useDebugValue:Ne,useDeferredValue:Ne,useTransition:Ne,useMutableSource:Ne,useSyncExternalStore:Ne,useId:Ne,unstable_isNewReconciler:!1},fh={readContext:Ze,useCallback:function(e,t){return ht().memoizedState=[e,t===void 0?null:t],e},useContext:Ze,useEffect:Tu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dl(4194308,4,rf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dl(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=ch.bind(null,ne,e),[r.memoizedState,e]},useRef:function(e){var t=ht();return e={current:e},t.memoizedState=e},useState:Ru,useDebugValue:ro,useDeferredValue:function(e){return ht().memoizedState=e},useTransition:function(){var e=Ru(!1),t=e[0];return e=uh.bind(null,e[1]),ht().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ne,l=ht();if(Z){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),he===null)throw Error(L(349));yn&30||Kd(r,t,n)}l.memoizedState=n;var a={value:n,getSnapshot:t};return l.queue=a,Tu(Gd.bind(null,r,a,e),[e]),r.flags|=2048,Qr(9,Jd.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=ht(),t=he.identifierPrefix;if(Z){var n=St,r=kt;n=(r&~(1<<32-ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Wr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=oh++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ph={readContext:Ze,useCallback:sf,useContext:Ze,useEffect:no,useImperativeHandle:lf,useInsertionEffect:tf,useLayoutEffect:nf,useMemo:af,useReducer:ua,useRef:ef,useState:function(){return ua(Yr)},useDebugValue:ro,useDeferredValue:function(e){var t=et();return of(t,de.memoizedState,e)},useTransition:function(){var e=ua(Yr)[0],t=et().memoizedState;return[e,t]},useMutableSource:Qd,useSyncExternalStore:qd,useId:uf,unstable_isNewReconciler:!1},mh={readContext:Ze,useCallback:sf,useContext:Ze,useEffect:no,useImperativeHandle:lf,useInsertionEffect:tf,useLayoutEffect:nf,useMemo:af,useReducer:ca,useRef:ef,useState:function(){return ca(Yr)},useDebugValue:ro,useDeferredValue:function(e){var t=et();return de===null?t.memoizedState=e:of(t,de.memoizedState,e)},useTransition:function(){var e=ca(Yr)[0],t=et().memoizedState;return[e,t]},useMutableSource:Qd,useSyncExternalStore:qd,useId:uf,unstable_isNewReconciler:!1};function it(e,t){if(e&&e.defaultProps){t=le({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Xa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:le({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ps={isMounted:function(e){return(e=e._reactInternals)?bn(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),Ol(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),Ol(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),Ol(t,e,r))}};function Pu(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?!Ir(n,r)||!Ir(l,a):!0}function pf(e,t,n){var r=!1,l=en,a=t.contextType;return typeof a=="object"&&a!==null?a=Ze(a):(l=Ie(t)?gn:ke.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=Ps,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=a),t}function Au(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&&Ps.enqueueReplaceState(t,t.state,null)}function Za(e,t,n,r){var l=e.stateNode;l.props=n,l.state=e.memoizedState,l.refs={},Ki(e);var a=t.contextType;typeof a=="object"&&a!==null?l.context=Ze(a):(a=Ie(t)?gn:ke.current,l.context=Kn(e,a)),l.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(Xa(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&&Ps.enqueueReplaceState(l,l.state,null),as(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+=Bm(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 da(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ei(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var hh=typeof WeakMap=="function"?WeakMap:Map;function mf(e,t,n){n=Ct(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ds||(ds=!0,ci=r),ei(e,t)},n}function hf(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(){ei(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){ei(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 Lu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new hh;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=Rh.bind(null,e,t,n),t.then(e,e))}function Mu(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 Fu(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 xh=Mt.ReactCurrentOwner,Oe=!1;function Ce(e,t,n,r){t.child=e===null?Hd(t,null,n,r):Gn(t,e.child,n,r)}function Ou(e,t,n,r,l){n=n.render;var a=t.ref;return Yn(t,l),r=eo(e,t,n,r,a,l),n=to(),e!==null&&!Oe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Pt(e,t,l)):(Z&&n&&Bi(t),t.flags|=1,Ce(e,t,r,l),t.child)}function zu(e,t,n,r,l){if(e===null){var a=n.type;return typeof a=="function"&&!fo(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,xf(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:Ir,n(i,r)&&e.ref===t.ref)return Pt(e,t,l)}return t.flags|=1,e=Gt(a,r),e.ref=t.ref,e.return=t,t.child=e}function xf(e,t,n,r,l){if(e!==null){var a=e.memoizedProps;if(Ir(a,r)&&e.ref===t.ref)if(Oe=!1,t.pendingProps=r=a,(e.lanes&l)!==0)e.flags&131072&&(Oe=!0);else return t.lanes=e.lanes,Pt(e,t,l)}return ti(e,t,n,r,l)}function gf(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 vf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ti(e,t,n,r,l){var a=Ie(n)?gn:ke.current;return a=Kn(t,a),Yn(t,l),n=eo(e,t,n,r,a,l),r=to(),e!==null&&!Oe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Pt(e,t,l)):(Z&&r&&Bi(t),t.flags|=1,Ce(e,t,n,l),t.child)}function Du(e,t,n,r,l){if(Ie(n)){var a=!0;ts(t)}else a=!1;if(Yn(t,l),t.stateNode===null)Il(e,t),pf(t,n,r),Za(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=Ie(n)?gn:ke.current,c=Kn(t,c));var m=n.getDerivedStateFromProps,f=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==r||u!==c)&&Au(t,i,r,c),It=!1;var g=t.memoizedState;i.state=g,as(t,r,i,l),u=t.memoizedState,o!==r||g!==u||De.current||It?(typeof m=="function"&&(Xa(t,n,m,r),u=t.memoizedState),(o=It||Pu(t,n,o,r,g,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,Wd(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:it(t.type,o),i.props=c,f=t.pendingProps,g=i.context,u=n.contextType,typeof u=="object"&&u!==null?u=Ze(u):(u=Ie(n)?gn:ke.current,u=Kn(t,u));var y=n.getDerivedStateFromProps;(m=typeof y=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(o!==f||g!==u)&&Au(t,i,r,u),It=!1,g=t.memoizedState,i.state=g,as(t,r,i,l);var j=t.memoizedState;o!==f||g!==j||De.current||It?(typeof y=="function"&&(Xa(t,n,y,r),j=t.memoizedState),(c=It||Pu(t,n,c,r,g,j,u)||!1)?(m||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,j,u),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,j,u)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=j),i.props=r,i.state=j,i.context=u,r=c):(typeof i.componentDidUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return ni(e,t,n,r,a,l)}function ni(e,t,n,r,l,a){vf(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&bu(t,n,!1),Pt(e,t,a);r=t.stateNode,xh.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&&bu(t,n,!0),t.child}function yf(e){var t=e.stateNode;t.pendingContext?wu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wu(e,t.context,!1),Ji(e,t.containerInfo)}function Iu(e,t,n,r,l){return Jn(),Vi(l),t.flags|=256,Ce(e,t,n,r),t.child}var ri={dehydrated:null,treeContext:null,retryLane:0};function li(e){return{baseLanes:e,cachePool:null,transitions:null}}function jf(e,t,n){var r=t.pendingProps,l=te.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(te,l&1),e===null)return Ja(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=Ms(i,r,0,null),e=mn(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=li(n),t.memoizedState=ri,e):lo(t,i));if(l=e.memoizedState,l!==null&&(o=l.dehydrated,o!==null))return gh(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=mn(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?li(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~n,t.memoizedState=ri,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 lo(e,t){return t=Ms({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Sl(e,t,n,r){return r!==null&&Vi(r),Gn(t,e.child,null,n),e=lo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gh(e,t,n,r,l,a,i){if(n)return t.flags&256?(t.flags&=-257,r=da(Error(L(422))),Sl(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,l=t.mode,r=Ms({mode:"visible",children:r.children},l,0,null),a=mn(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=li(i),t.memoizedState=ri,a);if(!(t.mode&1))return Sl(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var o=r.dgst;return r=o,a=Error(L(419)),r=da(a,r,void 0),Sl(e,t,i,r)}if(o=(i&e.childLanes)!==0,Oe||o){if(r=he,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 co(),r=da(Error(L(421))),Sl(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Th.bind(null,e),l._reactRetry=t,null):(e=a.treeContext,Ve=Qt(l.nextSibling),We=t,Z=!0,ut=null,e!==null&&(Ke[Je++]=kt,Ke[Je++]=St,Ke[Je++]=vn,kt=e.id,St=e.overflow,vn=t),t=lo(t,r.children),t.flags|=4096,t)}function $u(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ga(e.return,t,n)}function fa(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 Nf(e,t,n){var r=t.pendingProps,l=r.revealOrder,a=r.tail;if(Ce(e,t,r.children,n),r=te.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&&$u(e,n,t);else if(e.tag===19)$u(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(te,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&&is(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),fa(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&&is(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}fa(t,!0,n,null,a);break;case"together":fa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Il(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),jn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(L(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 vh(e,t,n){switch(t.tag){case 3:yf(t),Jn();break;case 5:Yd(t);break;case 1:Ie(t.type)&&ts(t);break;case 4:Ji(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;q(ls,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(q(te,te.current&1),t.flags|=128,null):n&t.child.childLanes?jf(e,t,n):(q(te,te.current&1),e=Pt(e,t,n),e!==null?e.sibling:null);q(te,te.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Nf(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),q(te,te.current),r)break;return null;case 22:case 23:return t.lanes=0,gf(e,t,n)}return Pt(e,t,n)}var wf,si,bf,kf;wf=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}};si=function(){};bf=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,fn(vt.current);var a=null;switch(n){case"input":l=Ea(e,l),r=Ea(e,r),a=[];break;case"select":l=le({},l,{value:void 0}),r=le({},r,{value:void 0}),a=[];break;case"textarea":l=Ta(e,l),r=Ta(e,r),a=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Zl)}Aa(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"&&J("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)}};kf=function(e,t,n,r){n!==r&&(t.flags|=4)};function mr(e,t){if(!Z)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 we(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 yh(e,t,n){var r=t.pendingProps;switch(Hi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return we(t),null;case 1:return Ie(t.type)&&es(),we(t),null;case 3:return r=t.stateNode,Xn(),G(De),G(ke),Xi(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(bl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ut!==null&&(pi(ut),ut=null))),si(e,t),we(t),null;case 5:Gi(t);var l=fn(Vr.current);if(n=t.type,e!==null&&t.stateNode!=null)bf(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(L(166));return we(t),null}if(e=fn(vt.current),bl(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":J("cancel",r),J("close",r);break;case"iframe":case"object":case"embed":J("load",r);break;case"video":case"audio":for(l=0;l<jr.length;l++)J(jr[l],r);break;case"source":J("error",r);break;case"img":case"image":case"link":J("error",r),J("load",r);break;case"details":J("toggle",r);break;case"input":Ko(r,a),J("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},J("invalid",r);break;case"textarea":Go(r,a),J("invalid",r)}Aa(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&&wl(r.textContent,o,e),l=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(a.suppressHydrationWarning!==!0&&wl(r.textContent,o,e),l=["children",""+o]):Ar.hasOwnProperty(i)&&o!=null&&i==="onScroll"&&J("scroll",r)}switch(n){case"input":ml(r),Jo(r,a,!0);break;case"textarea":ml(r),Xo(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Zl)}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=Gc(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,wf(e,t,!1,!1),t.stateNode=e;e:{switch(i=La(n,r),n){case"dialog":J("cancel",e),J("close",e),l=r;break;case"iframe":case"object":case"embed":J("load",e),l=r;break;case"video":case"audio":for(l=0;l<jr.length;l++)J(jr[l],e);l=r;break;case"source":J("error",e),l=r;break;case"img":case"image":case"link":J("error",e),J("load",e),l=r;break;case"details":J("toggle",e),l=r;break;case"input":Ko(e,r),l=Ea(e,r),J("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=le({},r,{value:void 0}),J("invalid",e);break;case"textarea":Go(e,r),l=Ta(e,r),J("invalid",e);break;default:l=r}Aa(n,l),o=l;for(a in o)if(o.hasOwnProperty(a)){var u=o[a];a==="style"?ed(e,u):a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Xc(e,u)):a==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Lr(e,u):typeof u=="number"&&Lr(e,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ar.hasOwnProperty(a)?u!=null&&a==="onScroll"&&J("scroll",e):u!=null&&_i(e,a,u,i))}switch(n){case"input":ml(e),Jo(e,r,!1);break;case"textarea":ml(e),Xo(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?Bn(e,!!r.multiple,a,!1):r.defaultValue!=null&&Bn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Zl)}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 we(t),null;case 6:if(e&&t.stateNode!=null)kf(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(L(166));if(n=fn(Vr.current),fn(vt.current),bl(t)){if(r=t.stateNode,n=t.memoizedProps,r[xt]=t,(a=r.nodeValue!==n)&&(e=We,e!==null))switch(e.tag){case 3:wl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&wl(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 we(t),null;case 13:if(G(te),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Z&&Ve!==null&&t.mode&1&&!(t.flags&128))Ud(),Jn(),t.flags|=98560,a=!1;else if(a=bl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(L(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(L(317));a[xt]=t}else Jn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;we(t),a=!1}else ut!==null&&(pi(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||te.current&1?pe===0&&(pe=3):co())),t.updateQueue!==null&&(t.flags|=4),we(t),null);case 4:return Xn(),si(e,t),e===null&&$r(t.stateNode.containerInfo),we(t),null;case 10:return Qi(t.type._context),we(t),null;case 17:return Ie(t.type)&&es(),we(t),null;case 19:if(G(te),a=t.memoizedState,a===null)return we(t),null;if(r=(t.flags&128)!==0,i=a.rendering,i===null)if(r)mr(a,!1);else{if(pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=is(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(te,te.current&1|2),t.child}e=e.sibling}a.tail!==null&&oe()>er&&(t.flags|=128,r=!0,mr(a,!1),t.lanes=4194304)}else{if(!r)if(e=is(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&&!Z)return we(t),null}else 2*oe()-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=oe(),t.sibling=null,n=te.current,q(te,r?n&1|2:n&1),t):(we(t),null);case 22:case 23:return uo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?He&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function jh(e,t){switch(Hi(t),t.tag){case 1:return Ie(t.type)&&es(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xn(),G(De),G(ke),Xi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gi(t),null;case 13:if(G(te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));Jn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(te),null;case 4:return Xn(),null;case 10:return Qi(t.type._context),null;case 22:case 23:return uo(),null;case 24:return null;default:return null}}var Cl=!1,be=!1,Nh=typeof WeakSet=="function"?WeakSet:Set,D=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 ai(e,t,n){try{n()}catch(r){ae(e,t,r)}}var Uu=!1;function wh(e,t){if(Ha=Jl,e=_d(),Ui(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,m=0,f=e,g=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;)g=f,f=y;for(;;){if(f===e)break t;if(g===n&&++c===l&&(o=i),g===a&&++m===r&&(u=i),(y=f.nextSibling)!==null)break;f=g,g=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(Va={focusedElem:e,selectionRange:n},Jl=!1,D=t;D!==null;)if(t=D,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,D=e;else for(;D!==null;){t=D;try{var j=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var v=j.memoizedProps,b=j.memoizedState,p=t.stateNode,d=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:it(t.type,v),b);p.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(S){ae(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,D=e;break}D=t.return}return j=Uu,Uu=!1,j}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&&ai(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 ii(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 Sf(e){var t=e.alternate;t!==null&&(e.alternate=null,Sf(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[Qa],delete t[lh],delete t[sh])),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 Cf(e){return e.tag===5||e.tag===3||e.tag===4}function Bu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cf(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 oi(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=Zl));else if(r!==4&&(e=e.child,e!==null))for(oi(e,t,n),e=e.sibling;e!==null;)oi(e,t,n),e=e.sibling}function ui(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(ui(e,t,n),e=e.sibling;e!==null;)ui(e,t,n),e=e.sibling}var xe=null,ot=!1;function zt(e,t,n){for(n=n.child;n!==null;)Ef(e,t,n),n=n.sibling}function Ef(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(ks,n)}catch{}switch(n.tag){case 5:be||Dn(n,t);case 6:var r=xe,l=ot;xe=null,zt(e,t,n),xe=r,ot=l,xe!==null&&(ot?(e=xe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xe.removeChild(n.stateNode));break;case 18:xe!==null&&(ot?(e=xe,n=n.stateNode,e.nodeType===8?sa(e.parentNode,n):e.nodeType===1&&sa(e,n),zr(e)):sa(xe,n.stateNode));break;case 4:r=xe,l=ot,xe=n.stateNode.containerInfo,ot=!0,zt(e,t,n),xe=r,ot=l;break;case 0:case 11:case 14:case 15:if(!be&&(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)&&ai(n,t,i),l=l.next}while(l!==r)}zt(e,t,n);break;case 1:if(!be&&(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?(be=(r=be)||n.memoizedState!==null,zt(e,t,n),be=r):zt(e,t,n);break;default:zt(e,t,n)}}function Hu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Nh),t.forEach(function(r){var l=Ph.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:xe=o.stateNode,ot=!1;break e;case 3:xe=o.stateNode.containerInfo,ot=!0;break e;case 4:xe=o.stateNode.containerInfo,ot=!0;break e}o=o.return}if(xe===null)throw Error(L(160));Ef(a,i,l),xe=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;)_f(t,e),t=t.sibling}function _f(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{Lr(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&&Kc(l,a),La(o,i);var c=La(o,a);for(i=0;i<u.length;i+=2){var m=u[i],f=u[i+1];m==="style"?ed(l,f):m==="dangerouslySetInnerHTML"?Xc(l,f):m==="children"?Lr(l,f):_i(l,m,f,c)}switch(o){case"input":_a(l,a);break;case"textarea":Jc(l,a);break;case"select":var g=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!a.multiple;var y=a.value;y!=null?Bn(l,!!a.multiple,y,!1):g!==!!a.multiple&&(a.defaultValue!=null?Bn(l,!!a.multiple,a.defaultValue,!0):Bn(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(L(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{zr(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||(io=oe())),r&4&&Hu(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?(be=(c=be)||m,at(t,e),be=c):at(t,e),mt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!m&&e.mode&1)for(D=e,m=e.child;m!==null;){for(f=D=m;D!==null;){switch(g=D,y=g.child,g.tag){case 0:case 11:case 14:case 15:_r(4,g,g.return);break;case 1:Dn(g,g.return);var j=g.stateNode;if(typeof j.componentWillUnmount=="function"){r=g,n=g.return;try{t=r,j.props=t.memoizedProps,j.state=t.memoizedState,j.componentWillUnmount()}catch(v){ae(r,n,v)}}break;case 5:Dn(g,g.return);break;case 22:if(g.memoizedState!==null){Wu(f);continue}}y!==null?(y.return=g,D=y):Wu(f)}m=m.sibling}e:for(m=null,f=e;;){if(f.tag===5){if(m===null){m=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=Zc("display",i))}catch(v){ae(e,e.return,v)}}}else if(f.tag===6){if(m===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;m===f&&(m=null),f=f.return}m===f&&(m=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:at(t,e),mt(e),r&4&&Hu(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(Cf(n)){var r=n;break e}n=n.return}throw Error(L(160))}switch(r.tag){case 5:var l=r.stateNode;r.flags&32&&(Lr(l,""),r.flags&=-33);var a=Bu(e);ui(e,a,l);break;case 3:case 4:var i=r.stateNode.containerInfo,o=Bu(e);oi(e,o,i);break;default:throw Error(L(161))}}catch(u){ae(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bh(e,t,n){D=e,Rf(e)}function Rf(e,t,n){for(var r=(e.mode&1)!==0;D!==null;){var l=D,a=l.child;if(l.tag===22&&r){var i=l.memoizedState!==null||Cl;if(!i){var o=l.alternate,u=o!==null&&o.memoizedState!==null||be;o=Cl;var c=be;if(Cl=i,(be=u)&&!c)for(D=l;D!==null;)i=D,u=i.child,i.tag===22&&i.memoizedState!==null?Yu(l):u!==null?(u.return=i,D=u):Yu(l);for(;a!==null;)D=a,Rf(a),a=a.sibling;D=l,Cl=o,be=c}Vu(e)}else l.subtreeFlags&8772&&a!==null?(a.return=l,D=a):Vu(e)}}function Vu(e){for(;D!==null;){var t=D;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:be||As(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!be)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&&_u(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}_u(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 m=c.memoizedState;if(m!==null){var f=m.dehydrated;f!==null&&zr(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(L(163))}be||t.flags&512&&ii(t)}catch(g){ae(t,t.return,g)}}if(t===e){D=null;break}if(n=t.sibling,n!==null){n.return=t.return,D=n;break}D=t.return}}function Wu(e){for(;D!==null;){var t=D;if(t===e){D=null;break}var n=t.sibling;if(n!==null){n.return=t.return,D=n;break}D=t.return}}function Yu(e){for(;D!==null;){var t=D;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{ii(t)}catch(u){ae(t,a,u)}break;case 5:var i=t.return;try{ii(t)}catch(u){ae(t,i,u)}}}catch(u){ae(t,t.return,u)}if(t===e){D=null;break}var o=t.sibling;if(o!==null){o.return=t.return,D=o;break}D=t.return}}var kh=Math.ceil,cs=Mt.ReactCurrentDispatcher,so=Mt.ReactCurrentOwner,Xe=Mt.ReactCurrentBatchConfig,W=0,he=null,ue=null,ge=0,He=0,In=sn(0),pe=0,qr=null,jn=0,Ls=0,ao=0,Rr=null,Fe=null,io=0,er=1/0,wt=null,ds=!1,ci=null,Kt=null,El=!1,Ht=null,fs=0,Tr=0,di=null,$l=-1,Ul=0;function _e(){return W&6?oe():$l!==-1?$l:$l=oe()}function Jt(e){return e.mode&1?W&2&&ge!==0?ge&-ge:ih.transition!==null?(Ul===0&&(Ul=fd()),Ul):(e=Q,e!==0||(e=window.event,e=e===void 0?16:yd(e.type)),e):1}function dt(e,t,n,r){if(50<Tr)throw Tr=0,di=null,Error(L(185));ll(e,n,r),(!(W&2)||e!==he)&&(e===he&&(!(W&2)&&(Ls|=n),pe===4&&Ut(e,ge)),$e(e,r),n===1&&W===0&&!(t.mode&1)&&(er=oe()+500,Rs&&an()))}function $e(e,t){var n=e.callbackNode;i0(e,t);var r=Kl(e,e===he?ge:0);if(r===0)n!==null&&tu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&tu(n),t===1)e.tag===0?ah(Qu.bind(null,e)):Dd(Qu.bind(null,e)),nh(function(){!(W&6)&&an()}),n=null;else{switch(pd(r)){case 1:n=Li;break;case 4:n=cd;break;case 16:n=ql;break;case 536870912:n=dd;break;default:n=ql}n=zf(n,Tf.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Tf(e,t){if($l=-1,Ul=0,W&6)throw Error(L(327));var n=e.callbackNode;if(Qn()&&e.callbackNode!==n)return null;var r=Kl(e,e===he?ge:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ps(e,r);else{t=r;var l=W;W|=2;var a=Af();(he!==e||ge!==t)&&(wt=null,er=oe()+500,pn(e,t));do try{Eh();break}catch(o){Pf(e,o)}while(!0);Yi(),cs.current=a,W=l,ue!==null?t=0:(he=null,ge=0,t=pe)}if(t!==0){if(t===2&&(l=Da(e),l!==0&&(r=l,t=fi(e,l))),t===1)throw n=qr,pn(e,0),Ut(e,r),$e(e,oe()),n;if(t===6)Ut(e,r);else{if(l=e.current.alternate,!(r&30)&&!Sh(l)&&(t=ps(e,r),t===2&&(a=Da(e),a!==0&&(r=a,t=fi(e,a))),t===1))throw n=qr,pn(e,0),Ut(e,r),$e(e,oe()),n;switch(e.finishedWork=l,e.finishedLanes=r,t){case 0:case 1:throw Error(L(345));case 2:un(e,Fe,wt);break;case 3:if(Ut(e,r),(r&130023424)===r&&(t=io+500-oe(),10<t)){if(Kl(e,0)!==0)break;if(l=e.suspendedLanes,(l&r)!==r){_e(),e.pingedLanes|=e.suspendedLanes&l;break}e.timeoutHandle=Ya(un.bind(null,e,Fe,wt),t);break}un(e,Fe,wt);break;case 4:if(Ut(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=oe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kh(r/1960))-r,10<r){e.timeoutHandle=Ya(un.bind(null,e,Fe,wt),r);break}un(e,Fe,wt);break;case 5:un(e,Fe,wt);break;default:throw Error(L(329))}}}return $e(e,oe()),e.callbackNode===n?Tf.bind(null,e):null}function fi(e,t){var n=Rr;return e.current.memoizedState.isDehydrated&&(pn(e,t).flags|=256),e=ps(e,t),e!==2&&(t=Fe,Fe=n,t!==null&&pi(t)),e}function pi(e){Fe===null?Fe=e:Fe.push.apply(Fe,e)}function Sh(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 Ut(e,t){for(t&=~ao,t&=~Ls,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 Qu(e){if(W&6)throw Error(L(327));Qn();var t=Kl(e,0);if(!(t&1))return $e(e,oe()),null;var n=ps(e,t);if(e.tag!==0&&n===2){var r=Da(e);r!==0&&(t=r,n=fi(e,r))}if(n===1)throw n=qr,pn(e,0),Ut(e,t),$e(e,oe()),n;if(n===6)throw Error(L(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,un(e,Fe,wt),$e(e,oe()),null}function oo(e,t){var n=W;W|=1;try{return e(t)}finally{W=n,W===0&&(er=oe()+500,Rs&&an())}}function Nn(e){Ht!==null&&Ht.tag===0&&!(W&6)&&Qn();var t=W;W|=1;var n=Xe.transition,r=Q;try{if(Xe.transition=null,Q=1,e)return e()}finally{Q=r,Xe.transition=n,W=t,!(W&6)&&an()}}function uo(){He=In.current,G(In)}function pn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,th(n)),ue!==null)for(n=ue.return;n!==null;){var r=n;switch(Hi(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&es();break;case 3:Xn(),G(De),G(ke),Xi();break;case 5:Gi(r);break;case 4:Xn();break;case 13:G(te);break;case 19:G(te);break;case 10:Qi(r.type._context);break;case 22:case 23:uo()}n=n.return}if(he=e,ue=e=Gt(e.current,null),ge=He=t,pe=0,qr=null,ao=Ls=jn=0,Fe=Rr=null,dn!==null){for(t=0;t<dn.length;t++)if(n=dn[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}dn=null}return e}function Pf(e,t){do{var n=ue;try{if(Yi(),zl.current=us,os){for(var r=ne.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}os=!1}if(yn=0,me=de=ne=null,Er=!1,Wr=0,so.current=null,n===null||n.return===null){pe=1,qr=t,ue=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,m=o,f=m.tag;if(!(m.mode&1)&&(f===0||f===11||f===15)){var g=m.alternate;g?(m.updateQueue=g.updateQueue,m.memoizedState=g.memoizedState,m.lanes=g.lanes):(m.updateQueue=null,m.memoizedState=null)}var y=Mu(i);if(y!==null){y.flags&=-257,Fu(y,i,o,a,t),y.mode&1&&Lu(a,c,t),t=y,u=c;var j=t.updateQueue;if(j===null){var v=new Set;v.add(u),t.updateQueue=v}else j.add(u);break e}else{if(!(t&1)){Lu(a,c,t),co();break e}u=Error(L(426))}}else if(Z&&o.mode&1){var b=Mu(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Fu(b,i,o,a,t),Vi(Zn(u,o));break e}}a=u=Zn(u,o),pe!==4&&(pe=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 p=mf(a,u,t);Eu(a,p);break e;case 1:o=u;var d=a.type,x=a.stateNode;if(!(a.flags&128)&&(typeof d.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Kt===null||!Kt.has(x)))){a.flags|=65536,t&=-t,a.lanes|=t;var S=hf(a,o,t);Eu(a,S);break e}}a=a.return}while(a!==null)}Mf(n)}catch(N){t=N,ue===n&&n!==null&&(ue=n=n.return);continue}break}while(!0)}function Af(){var e=cs.current;return cs.current=us,e===null?us:e}function co(){(pe===0||pe===3||pe===2)&&(pe=4),he===null||!(jn&268435455)&&!(Ls&268435455)||Ut(he,ge)}function ps(e,t){var n=W;W|=2;var r=Af();(he!==e||ge!==t)&&(wt=null,pn(e,t));do try{Ch();break}catch(l){Pf(e,l)}while(!0);if(Yi(),W=n,cs.current=r,ue!==null)throw Error(L(261));return he=null,ge=0,pe}function Ch(){for(;ue!==null;)Lf(ue)}function Eh(){for(;ue!==null&&!Xm();)Lf(ue)}function Lf(e){var t=Of(e.alternate,e,He);e.memoizedProps=e.pendingProps,t===null?Mf(e):ue=t,so.current=null}function Mf(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=jh(n,t),n!==null){n.flags&=32767,ue=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{pe=6,ue=null;return}}else if(n=yh(n,t,He),n!==null){ue=n;return}if(t=t.sibling,t!==null){ue=t;return}ue=t=e}while(t!==null);pe===0&&(pe=5)}function un(e,t,n){var r=Q,l=Xe.transition;try{Xe.transition=null,Q=1,_h(e,t,n,r)}finally{Xe.transition=l,Q=r}return null}function _h(e,t,n,r){do Qn();while(Ht!==null);if(W&6)throw Error(L(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(L(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(o0(e,a),e===he&&(ue=he=null,ge=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||El||(El=!0,zf(ql,function(){return Qn(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Xe.transition,Xe.transition=null;var i=Q;Q=1;var o=W;W|=4,so.current=null,wh(e,n),_f(n,e),q0(Va),Jl=!!Ha,Va=Ha=null,e.current=n,bh(n),Zm(),W=o,Q=i,Xe.transition=a}else e.current=n;if(El&&(El=!1,Ht=e,fs=l),a=e.pendingLanes,a===0&&(Kt=null),n0(n.stateNode),$e(e,oe()),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(ds)throw ds=!1,e=ci,ci=null,e;return fs&1&&e.tag!==0&&Qn(),a=e.pendingLanes,a&1?e===di?Tr++:(Tr=0,di=e):Tr=0,an(),null}function Qn(){if(Ht!==null){var e=pd(fs),t=Xe.transition,n=Q;try{if(Xe.transition=null,Q=16>e?16:e,Ht===null)var r=!1;else{if(e=Ht,Ht=null,fs=0,W&6)throw Error(L(331));var l=W;for(W|=4,D=e.current;D!==null;){var a=D,i=a.child;if(D.flags&16){var o=a.deletions;if(o!==null){for(var u=0;u<o.length;u++){var c=o[u];for(D=c;D!==null;){var m=D;switch(m.tag){case 0:case 11:case 15:_r(8,m,a)}var f=m.child;if(f!==null)f.return=m,D=f;else for(;D!==null;){m=D;var g=m.sibling,y=m.return;if(Sf(m),m===c){D=null;break}if(g!==null){g.return=y,D=g;break}D=y}}}var j=a.alternate;if(j!==null){var v=j.child;if(v!==null){j.child=null;do{var b=v.sibling;v.sibling=null,v=b}while(v!==null)}}D=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,D=i;else e:for(;D!==null;){if(a=D,a.flags&2048)switch(a.tag){case 0:case 11:case 15:_r(9,a,a.return)}var p=a.sibling;if(p!==null){p.return=a.return,D=p;break e}D=a.return}}var d=e.current;for(D=d;D!==null;){i=D;var x=i.child;if(i.subtreeFlags&2064&&x!==null)x.return=i,D=x;else e:for(i=d;D!==null;){if(o=D,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:As(9,o)}}catch(N){ae(o,o.return,N)}if(o===i){D=null;break e}var S=o.sibling;if(S!==null){S.return=o.return,D=S;break e}D=o.return}}if(W=l,an(),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(ks,e)}catch{}r=!0}return r}finally{Q=n,Xe.transition=t}}return!1}function qu(e,t,n){t=Zn(n,t),t=mf(e,t,1),e=qt(e,t,1),t=_e(),e!==null&&(ll(e,1,t),$e(e,t))}function ae(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(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=hf(t,e,1),t=qt(t,e,1),e=_e(),t!==null&&(ll(t,1,e),$e(t,e));break}}t=t.return}}function Rh(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_e(),e.pingedLanes|=e.suspendedLanes&n,he===e&&(ge&n)===n&&(pe===4||pe===3&&(ge&130023424)===ge&&500>oe()-io?pn(e,0):ao|=n),$e(e,t)}function Ff(e,t){t===0&&(e.mode&1?(t=gl,gl<<=1,!(gl&130023424)&&(gl=4194304)):t=1);var n=_e();e=Tt(e,t),e!==null&&(ll(e,t,n),$e(e,n))}function Th(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ff(e,n)}function Ph(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(L(314))}r!==null&&r.delete(t),Ff(e,n)}var Of;Of=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||De.current)Oe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Oe=!1,vh(e,t,n);Oe=!!(e.flags&131072)}else Oe=!1,Z&&t.flags&1048576&&Id(t,rs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Il(e,t),e=t.pendingProps;var l=Kn(t,ke.current);Yn(t,n),l=eo(null,t,r,e,l,n);var a=to();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,Ie(r)?(a=!0,ts(t)):a=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ki(t),l.updater=Ps,t.stateNode=l,l._reactInternals=t,Za(t,r,e,n),t=ni(null,t,r,!0,a,n)):(t.tag=0,Z&&a&&Bi(t),Ce(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Il(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Lh(r),e=it(r,e),l){case 0:t=ti(null,t,r,e,n);break e;case 1:t=Du(null,t,r,e,n);break e;case 11:t=Ou(null,t,r,e,n);break e;case 14:t=zu(null,t,r,it(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),ti(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),Du(e,t,r,l,n);case 3:e:{if(yf(t),e===null)throw Error(L(387));r=t.pendingProps,a=t.memoizedState,l=a.element,Wd(e,t),as(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(L(423)),t),t=Iu(e,t,r,n,l);break e}else if(r!==l){l=Zn(Error(L(424)),t),t=Iu(e,t,r,n,l);break e}else for(Ve=Qt(t.stateNode.containerInfo.firstChild),We=t,Z=!0,ut=null,n=Hd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jn(),r===l){t=Pt(e,t,n);break e}Ce(e,t,r,n)}t=t.child}return t;case 5:return Yd(t),e===null&&Ja(t),r=t.type,l=t.pendingProps,a=e!==null?e.memoizedProps:null,i=l.children,Wa(r,l)?i=null:a!==null&&Wa(r,a)&&(t.flags|=32),vf(e,t),Ce(e,t,i,n),t.child;case 6:return e===null&&Ja(t),null;case 13:return jf(e,t,n);case 4:return Ji(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),Ou(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(ls,r._currentValue),r._currentValue=i,a!==null)if(ft(a.value,i)){if(a.children===l.children&&!De.current){t=Pt(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 m=c.pending;m===null?u.next=u:(u.next=m.next,m.next=u),c.pending=u}}a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Ga(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(L(341));i.lanes|=n,o=i.alternate,o!==null&&(o.lanes|=n),Ga(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),zu(e,t,r,l,n);case 15:return xf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:it(r,l),Il(e,t),t.tag=1,Ie(r)?(e=!0,ts(t)):e=!1,Yn(t,n),pf(t,r,l),Za(t,r,l,n),ni(null,t,r,!0,e,n);case 19:return Nf(e,t,n);case 22:return gf(e,t,n)}throw Error(L(156,t.tag))};function zf(e,t){return ud(e,t)}function Ah(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 Ah(e,t,n,r)}function fo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Lh(e){if(typeof e=="function")return fo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ti)return 11;if(e===Pi)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")fo(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Rn:return mn(n.children,l,a,t);case Ri:i=8,l|=8;break;case ba:return e=Ge(12,n,t,l|2),e.elementType=ba,e.lanes=a,e;case ka:return e=Ge(13,n,t,l),e.elementType=ka,e.lanes=a,e;case Sa:return e=Ge(19,n,t,l),e.elementType=Sa,e.lanes=a,e;case Yc:return Ms(n,l,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Vc:i=10;break e;case Wc:i=9;break e;case Ti:i=11;break e;case Pi:i=14;break e;case Dt:i=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=Ge(i,n,t,l),t.elementType=e,t.type=r,t.lanes=a,t}function mn(e,t,n,r){return e=Ge(7,e,r,t),e.lanes=n,e}function Ms(e,t,n,r){return e=Ge(22,e,r,t),e.elementType=Yc,e.lanes=n,e.stateNode={isHidden:!1},e}function pa(e,t,n){return e=Ge(6,e,null,t),e.lanes=n,e}function ma(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 Mh(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=qs(0),this.expirationTimes=qs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qs(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function po(e,t,n,r,l,a,i,o,u){return e=new Mh(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},Ki(a),e}function Fh(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 Df(e){if(!e)return en;e=e._reactInternals;e:{if(bn(e)!==e||e.tag!==1)throw Error(L(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ie(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(L(171))}if(e.tag===1){var n=e.type;if(Ie(n))return zd(e,n,t)}return t}function If(e,t,n,r,l,a,i,o,u){return e=po(n,r,!0,e,l,a,i,o,u),e.context=Df(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,ll(e,l,r),$e(e,r),e}function Fs(e,t,n,r){var l=t.current,a=_e(),i=Jt(l);return n=Df(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),Ol(e,l,i)),i}function ms(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 Ku(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mo(e,t){Ku(e,t),(e=e.alternate)&&Ku(e,t)}function Oh(){return null}var $f=typeof reportError=="function"?reportError:function(e){console.error(e)};function ho(e){this._internalRoot=e}Os.prototype.render=ho.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(L(409));Fs(e,t,null,null)};Os.prototype.unmount=ho.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nn(function(){Fs(null,e,null,null)}),t[Rt]=null}};function Os(e){this._internalRoot=e}Os.prototype.unstable_scheduleHydration=function(e){if(e){var t=xd();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&&vd(e)}};function xo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function zs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ju(){}function zh(e,t,n,r,l){if(l){if(typeof r=="function"){var a=r;r=function(){var c=ms(i);a.call(c)}}var i=If(t,r,e,0,null,!1,!1,"",Ju);return e._reactRootContainer=i,e[Rt]=i.current,$r(e.nodeType===8?e.parentNode:e),Nn(),i}for(;l=e.lastChild;)e.removeChild(l);if(typeof r=="function"){var o=r;r=function(){var c=ms(u);o.call(c)}}var u=po(e,0,!1,null,null,!1,!1,"",Ju);return e._reactRootContainer=u,e[Rt]=u.current,$r(e.nodeType===8?e.parentNode:e),Nn(function(){Fs(t,u,n,r)}),u}function Ds(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=ms(i);o.call(u)}}Fs(t,i,e,l)}else i=zh(n,t,e,l,r);return ms(i)}md=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=yr(t.pendingLanes);n!==0&&(Mi(t,n|1),$e(t,oe()),!(W&6)&&(er=oe()+500,an()))}break;case 13:Nn(function(){var r=Tt(e,1);if(r!==null){var l=_e();dt(r,e,1,l)}}),mo(e,1)}};Fi=function(e){if(e.tag===13){var t=Tt(e,134217728);if(t!==null){var n=_e();dt(t,e,134217728,n)}mo(e,134217728)}};hd=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)}mo(e,t)}};xd=function(){return Q};gd=function(e,t){var n=Q;try{return Q=e,t()}finally{Q=n}};Fa=function(e,t,n){switch(t){case"input":if(_a(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=_s(r);if(!l)throw Error(L(90));qc(r),_a(r,l)}}}break;case"textarea":Jc(e,n);break;case"select":t=n.value,t!=null&&Bn(e,!!n.multiple,t,!1)}};rd=oo;ld=Nn;var Dh={usingClientEntryPoint:!1,Events:[al,Ln,_s,td,nd,oo]},hr={findFiberByHostInstance:cn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ih={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=id(e),e===null?null:e.stateNode},findFiberByHostInstance:hr.findFiberByHostInstance||Oh,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 _l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_l.isDisabled&&_l.supportsFiber)try{ks=_l.inject(Ih),gt=_l}catch{}}Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Dh;Qe.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xo(t))throw Error(L(200));return Fh(e,t,null,n)};Qe.createRoot=function(e,t){if(!xo(e))throw Error(L(299));var n=!1,r="",l=$f;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=po(e,1,!1,null,null,n,!1,r,l),e[Rt]=t.current,$r(e.nodeType===8?e.parentNode:e),new ho(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(L(188)):(e=Object.keys(e).join(","),Error(L(268,e)));return e=id(t),e=e===null?null:e.stateNode,e};Qe.flushSync=function(e){return Nn(e)};Qe.hydrate=function(e,t,n){if(!zs(t))throw Error(L(200));return Ds(null,e,t,!0,n)};Qe.hydrateRoot=function(e,t,n){if(!xo(e))throw Error(L(405));var r=n!=null&&n.hydratedSources||null,l=!1,a="",i=$f;if(n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=If(t,null,e,1,n??null,l,!1,a,i),e[Rt]=t.current,$r(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 Os(t)};Qe.render=function(e,t,n){if(!zs(t))throw Error(L(200));return Ds(null,e,t,!1,n)};Qe.unmountComponentAtNode=function(e){if(!zs(e))throw Error(L(40));return e._reactRootContainer?(Nn(function(){Ds(null,null,e,!1,function(){e._reactRootContainer=null,e[Rt]=null})}),!0):!1};Qe.unstable_batchedUpdates=oo;Qe.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!zs(n))throw Error(L(200));if(e==null||e._reactInternals===void 0)throw Error(L(38));return Ds(e,t,n,!1,r)};Qe.version="18.3.1-next-f1338f8080-20240426";function Uf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Uf)}catch(e){console.error(e)}}Uf(),$c.exports=Qe;var $h=$c.exports,Gu=$h;Na.createRoot=Gu.createRoot,Na.hydrateRoot=Gu.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 Xu="popstate";function Uh(e={}){function t(r,l){let{pathname:a,search:i,hash:o}=r.location;return mi("",{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:Kr(l)}return Hh(t,n,null,e)}function re(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 Bh(){return Math.random().toString(36).substring(2,10)}function Zu(e,t){return{usr:e.state,key:e.key,idx:t}}function mi(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||Bh()}}function Kr({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 Hh(e,t,n,r={}){let{window:l=document.defaultView,v5Compat:a=!1}=r,i=l.history,o="POP",u=null,c=m();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function m(){return(i.state||{idx:null}).idx}function f(){o="POP";let b=m(),p=b==null?null:b-c;c=b,u&&u({action:o,location:v.location,delta:p})}function g(b,p){o="PUSH";let d=mi(v.location,b,p);c=m()+1;let x=Zu(d,c),S=v.createHref(d);try{i.pushState(x,"",S)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;l.location.assign(S)}a&&u&&u({action:o,location:v.location,delta:1})}function y(b,p){o="REPLACE";let d=mi(v.location,b,p);c=m();let x=Zu(d,c),S=v.createHref(d);i.replaceState(x,"",S),a&&u&&u({action:o,location:v.location,delta:0})}function j(b){return Vh(b)}let v={get action(){return o},get location(){return e(l,i)},listen(b){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Xu,f),u=b,()=>{l.removeEventListener(Xu,f),u=null}},createHref(b){return t(l,b)},createURL:j,encodeLocation(b){let p=j(b);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:g,replace:y,go(b){return i.go(b)}};return v}function Vh(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),re(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Kr(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Bf(e,t,n="/"){return Wh(e,t,n,!1)}function Wh(e,t,n,r){let l=typeof t=="string"?ar(t):t,a=At(l.pathname||"/",n);if(a==null)return null;let i=Hf(e);Yh(i);let o=null;for(let u=0;o==null&&u<i.length;++u){let c=rx(a);o=tx(i[u],c,r)}return o}function Hf(e,t=[],n=[],r="",l=!1){let a=(i,o,u=l,c)=>{let m={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&u)return;re(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let f=Et([r,m.relativePath]),g=n.concat(m);i.children&&i.children.length>0&&(re(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Hf(i.children,t,g,f,u)),!(i.path==null&&!i.index)&&t.push({path:f,score:Zh(f,i.index),routesMeta:g})};return e.forEach((i,o)=>{var u;if(i.path===""||!((u=i.path)!=null&&u.includes("?")))a(i,o);else for(let c of Vf(i.path))a(i,o,!0,c)}),t}function Vf(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=Vf(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 Yh(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ex(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Qh=/^:[\w-]+$/,qh=3,Kh=2,Jh=1,Gh=10,Xh=-2,ec=e=>e==="*";function Zh(e,t){let n=e.split("/"),r=n.length;return n.some(ec)&&(r+=Xh),t&&(r+=Kh),n.filter(l=>!ec(l)).reduce((l,a)=>l+(Qh.test(a)?qh:a===""?Jh:Gh),r)}function ex(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 tx(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,m=a==="/"?t:t.slice(a.length)||"/",f=hs({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},m),g=u.route;if(!f&&c&&n&&!r[r.length-1].route.index&&(f=hs({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},m)),!f)return null;Object.assign(l,f.params),i.push({params:l,pathname:Et([a,f.pathname]),pathnameBase:ix(Et([a,f.pathnameBase])),route:g}),f.pathnameBase!=="/"&&(a=Et([a,f.pathnameBase]))}return i}function hs(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=nx(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:m,isOptional:f},g)=>{if(m==="*"){let j=o[g]||"";i=a.slice(0,a.length-j.length).replace(/(.)\/+$/,"$1")}const y=o[g];return f&&!y?c[m]=void 0:c[m]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:i,pattern:e}}function nx(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 rx(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 At(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 Wf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lx=e=>Wf.test(e);function sx(e,t="/"){let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?ar(e):e,a;if(n)if(lx(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=tc(n.substring(1),"/"):a=tc(n,t)}else a=t;return{pathname:a,search:ox(r),hash:ux(l)}}function tc(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 ha(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 ax(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Yf(e){let t=ax(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Qf(e,t,n,r=!1){let l;typeof e=="string"?l=ar(e):(l={...e},re(!l.pathname||!l.pathname.includes("?"),ha("?","pathname","search",l)),re(!l.pathname||!l.pathname.includes("#"),ha("#","pathname","hash",l)),re(!l.search||!l.search.includes("#"),ha("#","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 g=i.split("/");for(;g[0]==="..";)g.shift(),f-=1;l.pathname=g.join("/")}o=f>=0?t[f]:"/"}let u=sx(l,o),c=i&&i!=="/"&&i.endsWith("/"),m=(a||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||m)&&(u.pathname+="/"),u}var Et=e=>e.join("/").replace(/\/\/+/g,"/"),ix=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ox=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ux=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,cx=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 dx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function fx(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var qf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Kf(e,t){let n=e;if(typeof n!="string"||!Wf.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,l=!1;if(qf)try{let a=new URL(window.location.href),i=n.startsWith("//")?new URL(a.protocol+n):new URL(n),o=At(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 Jf=["POST","PUT","PATCH","DELETE"];new Set(Jf);var px=["GET",...Jf];new Set(px);var ir=h.createContext(null);ir.displayName="DataRouter";var Is=h.createContext(null);Is.displayName="DataRouterState";var mx=h.createContext(!1),Gf=h.createContext({isTransitioning:!1});Gf.displayName="ViewTransition";var hx=h.createContext(new Map);hx.displayName="Fetchers";var xx=h.createContext(null);xx.displayName="Await";var nt=h.createContext(null);nt.displayName="Navigation";var ol=h.createContext(null);ol.displayName="Location";var pt=h.createContext({outlet:null,matches:[],isDataRoute:!1});pt.displayName="Route";var go=h.createContext(null);go.displayName="RouteError";var Xf="REACT_ROUTER_ERROR",gx="REDIRECT",vx="ROUTE_ERROR_RESPONSE";function yx(e){if(e.startsWith(`${Xf}:${gx}:{`))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 jx(e){if(e.startsWith(`${Xf}:${vx}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new cx(t.status,t.statusText,t.data)}catch{}}function Nx(e,{relative:t}={}){re(ul(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=h.useContext(nt),{hash:l,pathname:a,search:i}=cl(e,{relative:t}),o=a;return n!=="/"&&(o=a==="/"?n:Et([n,a])),r.createHref({pathname:o,search:i,hash:l})}function ul(){return h.useContext(ol)!=null}function Ft(){return re(ul(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(ol).location}var Zf="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ep(e){h.useContext(nt).static||h.useLayoutEffect(e)}function vo(){let{isDataRoute:e}=h.useContext(pt);return e?zx():wx()}function wx(){re(ul(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(ir),{basename:t,navigator:n}=h.useContext(nt),{matches:r}=h.useContext(pt),{pathname:l}=Ft(),a=JSON.stringify(Yf(r)),i=h.useRef(!1);return ep(()=>{i.current=!0}),h.useCallback((u,c={})=>{if(tt(i.current,Zf),!i.current)return;if(typeof u=="number"){n.go(u);return}let m=Qf(u,JSON.parse(a),l,c.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Et([t,m.pathname])),(c.replace?n.replace:n.push)(m,c.state,c)},[t,n,a,l,e])}var bx=h.createContext(null);function kx(e){let t=h.useContext(pt).outlet;return h.useMemo(()=>t&&h.createElement(bx.Provider,{value:e},t),[t,e])}function Sx(){let{matches:e}=h.useContext(pt),t=e[e.length-1];return t?t.params:{}}function cl(e,{relative:t}={}){let{matches:n}=h.useContext(pt),{pathname:r}=Ft(),l=JSON.stringify(Yf(n));return h.useMemo(()=>Qf(e,JSON.parse(l),r,t==="path"),[e,l,r,t])}function Cx(e,t){return tp(e,t)}function tp(e,t,n,r,l){var d;re(ul(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=h.useContext(nt),{matches:i}=h.useContext(pt),o=i[i.length-1],u=o?o.params:{},c=o?o.pathname:"/",m=o?o.pathnameBase:"/",f=o&&o.route;{let x=f&&f.path||"";rp(c,!f||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${x}">) 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="${x}"> to <Route path="${x==="/"?"*":`${x}/*`}">.`)}let g=Ft(),y;if(t){let x=typeof t=="string"?ar(t):t;re(m==="/"||((d=x.pathname)==null?void 0:d.startsWith(m)),`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 "${m}" but pathname "${x.pathname}" was given in the \`location\` prop.`),y=x}else y=g;let j=y.pathname||"/",v=j;if(m!=="/"){let x=m.replace(/^\//,"").split("/");v="/"+j.replace(/^\//,"").split("/").slice(x.length).join("/")}let b=Bf(e,{pathname:v});tt(f||b!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),tt(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.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 p=Px(b&&b.map(x=>Object.assign({},x,{params:Object.assign({},u,x.params),pathname:Et([m,a.encodeLocation?a.encodeLocation(x.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?m:Et([m,a.encodeLocation?a.encodeLocation(x.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathnameBase])})),i,n,r,l);return t&&p?h.createElement(ol.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...y},navigationType:"POP"}},p):p}function Ex(){let e=Ox(),t=dx(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=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:a},"ErrorBoundary")," or"," ",h.createElement("code",{style:a},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:l},n):null,i)}var _x=h.createElement(Ex,null),np=class extends h.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=jx(e.digest);n&&(e=n)}let t=e!==void 0?h.createElement(pt.Provider,{value:this.props.routeContext},h.createElement(go.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(Rx,{error:e},t):t}};np.contextType=mx;var xa=new WeakMap;function Rx({children:e,error:t}){let{basename:n}=h.useContext(nt);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=yx(t.digest);if(r){let l=xa.get(t);if(l)throw l;let a=Kf(r.location,n);if(qf&&!xa.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 xa.set(t,i),i}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function Tx({routeContext:e,match:t,children:n}){let r=h.useContext(ir);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(pt.Provider,{value:e},n)}function Px(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 m=a.findIndex(f=>f.route.id&&(i==null?void 0:i[f.route.id])!==void 0);re(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,m+1))}let o=!1,u=-1;if(n)for(let m=0;m<a.length;m++){let f=a[m];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=m),f.route.id){let{loaderData:g,errors:y}=n,j=f.route.loader&&!g.hasOwnProperty(f.route.id)&&(!y||y[f.route.id]===void 0);if(f.route.lazy||j){o=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}let c=n&&r?(m,f)=>{var g,y;r(m,{location:n.location,params:((y=(g=n.matches)==null?void 0:g[0])==null?void 0:y.params)??{},unstable_pattern:fx(n.matches),errorInfo:f})}:void 0;return a.reduceRight((m,f,g)=>{let y,j=!1,v=null,b=null;n&&(y=i&&f.route.id?i[f.route.id]:void 0,v=f.route.errorElement||_x,o&&(u<0&&g===0?(rp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,b=null):u===g&&(j=!0,b=f.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,g+1)),d=()=>{let x;return y?x=v:j?x=b:f.route.Component?x=h.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=m,h.createElement(Tx,{match:f,routeContext:{outlet:m,matches:p,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?h.createElement(np,{location:n.location,revalidation:n.revalidation,component:v,error:y,children:d(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:c}):d()},null)}function yo(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ax(e){let t=h.useContext(ir);return re(t,yo(e)),t}function Lx(e){let t=h.useContext(Is);return re(t,yo(e)),t}function Mx(e){let t=h.useContext(pt);return re(t,yo(e)),t}function jo(e){let t=Mx(e),n=t.matches[t.matches.length-1];return re(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Fx(){return jo("useRouteId")}function Ox(){var r;let e=h.useContext(go),t=Lx("useRouteError"),n=jo("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function zx(){let{router:e}=Ax("useNavigate"),t=jo("useNavigate"),n=h.useRef(!1);return ep(()=>{n.current=!0}),h.useCallback(async(l,a={})=>{tt(n.current,Zf),n.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:t,...a}))},[e,t])}var nc={};function rp(e,t,n){!t&&!nc[e]&&(nc[e]=!0,tt(!1,n))}h.memo(Dx);function Dx({routes:e,future:t,state:n,onError:r}){return tp(e,void 0,n,r,t)}function Ix(e){return kx(e.context)}function Nt(e){re(!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 $x({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:l,static:a=!1,unstable_useTransitions:i}){re(!ul(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),u=h.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:m="",hash:f="",state:g=null,key:y="default"}=n,j=h.useMemo(()=>{let v=At(c,o);return v==null?null:{location:{pathname:v,search:m,hash:f,state:g,key:y},navigationType:r}},[o,c,m,f,g,y,r]);return tt(j!=null,`<Router basename="${o}"> is not able to match the URL "${c}${m}${f}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:h.createElement(nt.Provider,{value:u},h.createElement(ol.Provider,{children:t,value:j}))}function Ux({children:e,location:t}){return Cx(hi(e),t)}function hi(e,t=[]){let n=[];return h.Children.forEach(e,(r,l)=>{if(!h.isValidElement(r))return;let a=[...t,l];if(r.type===h.Fragment){n.push.apply(n,hi(r.props.children,a));return}re(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>`),re(!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=hi(r.props.children,a)),n.push(i)}),n}var Hl="get",Vl="application/x-www-form-urlencoded";function $s(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Bx(e){return $s(e)&&e.tagName.toLowerCase()==="button"}function Hx(e){return $s(e)&&e.tagName.toLowerCase()==="form"}function Vx(e){return $s(e)&&e.tagName.toLowerCase()==="input"}function Wx(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Yx(e,t){return e.button===0&&(!t||t==="_self")&&!Wx(e)}function xi(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 Qx(e,t){let n=xi(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(a=>{n.append(l,a)})}),n}var Rl=null;function qx(){if(Rl===null)try{new FormData(document.createElement("form"),0),Rl=!1}catch{Rl=!0}return Rl}var Kx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ga(e){return e!=null&&!Kx.has(e)?(tt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vl}"`),null):e}function Jx(e,t){let n,r,l,a,i;if(Hx(e)){let o=e.getAttribute("action");r=o?At(o,t):null,n=e.getAttribute("method")||Hl,l=ga(e.getAttribute("enctype"))||Vl,a=new FormData(e)}else if(Bx(e)||Vx(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?At(u,t):null,n=e.getAttribute("formmethod")||o.getAttribute("method")||Hl,l=ga(e.getAttribute("formenctype"))||ga(o.getAttribute("enctype"))||Vl,a=new FormData(o,e),!qx()){let{name:c,type:m,value:f}=e;if(m==="image"){let g=c?`${c}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else c&&a.append(c,f)}}else{if($s(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Hl,r=null,l=Vl,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 No(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gx(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&&At(l.pathname,t)==="/"?l.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${r}`,l}async function Xx(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 Zx(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 eg(e,t,n){let r=await Promise.all(e.map(async l=>{let a=t.routes[l.route.id];if(a){let i=await Xx(a,n);return i.links?i.links():[]}return[]}));return lg(r.flat(1).filter(Zx).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function rc(e,t,n,r,l,a){let i=(u,c)=>n[c]?u.route.id!==n[c].route.id:!0,o=(u,c)=>{var m;return n[c].pathname!==u.pathname||((m=n[c].route.path)==null?void 0:m.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 m=r.routes[u.route.id];if(!m||!m.hasLoader)return!1;if(i(u,c)||o(u,c))return!0;if(u.route.shouldRevalidate){let g=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 g=="boolean")return g}return!0}):[]}function tg(e,t,{includeHydrateFallback:n}={}){return ng(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 ng(e){return[...new Set(e)]}function rg(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function lg(e,t){let n=new Set;return new Set(t),e.reduce((r,l)=>{let a=JSON.stringify(rg(l));return n.has(a)||(n.add(a),r.push({key:a,link:l})),r},[])}function lp(){let e=h.useContext(ir);return No(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function sg(){let e=h.useContext(Is);return No(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var wo=h.createContext(void 0);wo.displayName="FrameworkContext";function sp(){let e=h.useContext(wo);return No(e,"You must render this element inside a <HydratedRouter> element"),e}function ag(e,t){let n=h.useContext(wo),[r,l]=h.useState(!1),[a,i]=h.useState(!1),{onFocus:o,onBlur:u,onMouseEnter:c,onMouseLeave:m,onTouchStart:f}=t,g=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let v=p=>{p.forEach(d=>{i(d.isIntersecting)})},b=new IntersectionObserver(v,{threshold:.5});return g.current&&b.observe(g.current),()=>{b.disconnect()}}},[e]),h.useEffect(()=>{if(r){let v=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(v)}}},[r]);let y=()=>{l(!0)},j=()=>{l(!1),i(!1)};return n?e!=="intent"?[a,g,{}]:[a,g,{onFocus:xr(o,y),onBlur:xr(u,j),onMouseEnter:xr(c,y),onMouseLeave:xr(m,j),onTouchStart:xr(f,y)}]:[!1,g,{}]}function xr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ig({page:e,...t}){let{router:n}=lp(),r=h.useMemo(()=>Bf(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?h.createElement(ug,{page:e,matches:r,...t}):null}function og(e){let{manifest:t,routeModules:n}=sp(),[r,l]=h.useState([]);return h.useEffect(()=>{let a=!1;return eg(e,t,n).then(i=>{a||l(i)}),()=>{a=!0}},[e,t,n]),r}function ug({page:e,matches:t,...n}){let r=Ft(),{future:l,manifest:a,routeModules:i}=sp(),{basename:o}=lp(),{loaderData:u,matches:c}=sg(),m=h.useMemo(()=>rc(e,t,c,a,r,"data"),[e,t,c,a,r]),f=h.useMemo(()=>rc(e,t,c,a,r,"assets"),[e,t,c,a,r]),g=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,b=!1;if(t.forEach(d=>{var S;let x=a.routes[d.route.id];!x||!x.hasLoader||(!m.some(N=>N.route.id===d.route.id)&&d.route.id in u&&((S=i[d.route.id])!=null&&S.shouldRevalidate)||x.hasClientLoader?b=!0:v.add(d.route.id))}),v.size===0)return[];let p=Gx(e,o,l.unstable_trailingSlashAwareDataRequests,"data");return b&&v.size>0&&p.searchParams.set("_routes",t.filter(d=>v.has(d.route.id)).map(d=>d.route.id).join(",")),[p.pathname+p.search]},[o,l.unstable_trailingSlashAwareDataRequests,u,r,a,m,t,e,i]),y=h.useMemo(()=>tg(f,a),[f,a]),j=og(f);return h.createElement(h.Fragment,null,g.map(v=>h.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),y.map(v=>h.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),j.map(({key:v,link:b})=>h.createElement("link",{key:v,nonce:n.nonce,...b})))}function cg(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var dg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{dg&&(window.__reactRouterVersion="7.12.0")}catch{}function fg({basename:e,children:t,unstable_useTransitions:n,window:r}){let l=h.useRef();l.current==null&&(l.current=Uh({window:r,v5Compat:!0}));let a=l.current,[i,o]=h.useState({action:a.action,location:a.location}),u=h.useCallback(c=>{n===!1?o(c):h.startTransition(()=>o(c))},[n]);return h.useLayoutEffect(()=>a.listen(u),[a,u]),h.createElement($x,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:a,unstable_useTransitions:n})}var ap=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Re=h.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:l,reloadDocument:a,replace:i,state:o,target:u,to:c,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:g,...y},j){let{basename:v,unstable_useTransitions:b}=h.useContext(nt),p=typeof c=="string"&&ap.test(c),d=Kf(c,v);c=d.to;let x=Nx(c,{relative:l}),[S,N,_]=ag(r,y),P=xg(c,{replace:i,state:o,target:u,preventScrollReset:m,relative:l,viewTransition:f,unstable_defaultShouldRevalidate:g,unstable_useTransitions:b});function M(O){t&&t(O),O.defaultPrevented||P(O)}let z=h.createElement("a",{...y,..._,href:d.absoluteURL||x,onClick:d.isExternal||a?t:M,ref:cg(j,N),target:u,"data-discover":!p&&n==="render"?"true":void 0});return S&&!p?h.createElement(h.Fragment,null,z,h.createElement(ig,{page:x})):z});Re.displayName="Link";var pg=h.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:l=!1,style:a,to:i,viewTransition:o,children:u,...c},m){let f=cl(i,{relative:c.relative}),g=Ft(),y=h.useContext(Is),{navigator:j,basename:v}=h.useContext(nt),b=y!=null&&wg(f)&&o===!0,p=j.encodeLocation?j.encodeLocation(f).pathname:f.pathname,d=g.pathname,x=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(d=d.toLowerCase(),x=x?x.toLowerCase():null,p=p.toLowerCase()),x&&v&&(x=At(x,v)||x);const S=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let N=d===p||!l&&d.startsWith(p)&&d.charAt(S)==="/",_=x!=null&&(x===p||!l&&x.startsWith(p)&&x.charAt(p.length)==="/"),P={isActive:N,isPending:_,isTransitioning:b},M=N?t:void 0,z;typeof r=="function"?z=r(P):z=[r,N?"active":null,_?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let O=typeof a=="function"?a(P):a;return h.createElement(Re,{...c,"aria-current":M,className:z,ref:m,style:O,to:i,viewTransition:o},typeof u=="function"?u(P):u)});pg.displayName="NavLink";var mg=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:l,state:a,method:i=Hl,action:o,onSubmit:u,relative:c,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:g,...y},j)=>{let{unstable_useTransitions:v}=h.useContext(nt),b=jg(),p=Ng(o,{relative:c}),d=i.toLowerCase()==="get"?"get":"post",x=typeof o=="string"&&ap.test(o),S=N=>{if(u&&u(N),N.defaultPrevented)return;N.preventDefault();let _=N.nativeEvent.submitter,P=(_==null?void 0:_.getAttribute("formmethod"))||i,M=()=>b(_||N.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:l,state:a,relative:c,preventScrollReset:m,viewTransition:f,unstable_defaultShouldRevalidate:g});v&&n!==!1?h.startTransition(()=>M()):M()};return h.createElement("form",{ref:j,method:d,action:p,onSubmit:r?u:S,...y,"data-discover":!x&&e==="render"?"true":void 0})});mg.displayName="Form";function hg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ip(e){let t=h.useContext(ir);return re(t,hg(e)),t}function xg(e,{target:t,replace:n,state:r,preventScrollReset:l,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:o,unstable_useTransitions:u}={}){let c=vo(),m=Ft(),f=cl(e,{relative:a});return h.useCallback(g=>{if(Yx(g,t)){g.preventDefault();let y=n!==void 0?n:Kr(m)===Kr(f),j=()=>c(e,{replace:y,state:r,preventScrollReset:l,relative:a,viewTransition:i,unstable_defaultShouldRevalidate:o});u?h.startTransition(()=>j()):j()}},[m,c,f,n,r,t,e,l,a,i,o,u])}function gg(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=h.useRef(xi(e)),n=h.useRef(!1),r=Ft(),l=h.useMemo(()=>Qx(r.search,n.current?null:t.current),[r.search]),a=vo(),i=h.useCallback((o,u)=>{const c=xi(typeof o=="function"?o(new URLSearchParams(l)):o);n.current=!0,a("?"+c,u)},[a,l]);return[l,i]}var vg=0,yg=()=>`__${String(++vg)}__`;function jg(){let{router:e}=ip("useSubmit"),{basename:t}=h.useContext(nt),n=Fx(),r=e.fetch,l=e.navigate;return h.useCallback(async(a,i={})=>{let{action:o,method:u,encType:c,formData:m,body:f}=Jx(a,t);if(i.navigate===!1){let g=i.fetcherKey||yg();await r(g,n,i.action||o,{unstable_defaultShouldRevalidate:i.unstable_defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:m,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:m,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 Ng(e,{relative:t}={}){let{basename:n}=h.useContext(nt),r=h.useContext(pt);re(r,"useFormAction must be used inside a RouteContext");let[l]=r.matches.slice(-1),a={...cl(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(m=>m==="")){o.delete("index"),u.filter(f=>f).forEach(f=>o.append("index",f));let m=o.toString();a.search=m?`?${m}`:""}}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])),Kr(a)}function wg(e,{relative:t}={}){let n=h.useContext(Gf);re(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ip("useViewTransitionState"),l=cl(e,{relative:t});if(!n.isTransitioning)return!1;let a=At(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=At(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hs(l.pathname,i)!=null||hs(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 bg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),op=(...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 kg={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 Sg=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:l="",children:a,iconNode:i,...o},u)=>h.createElement("svg",{ref:u,...kg,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:op("lucide",l),...o},[...i.map(([c,m])=>h.createElement(c,m)),...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 H=(e,t)=>{const n=h.forwardRef(({className:r,...l},a)=>h.createElement(Sg,{ref:a,iconNode:t,className:op(`lucide-${bg(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 xs=H("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 Jr=H("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 Ue=H("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 rt=H("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 tn=H("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"}]]);/**
|
|
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 Us=H("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
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 bo=H("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"}]]);/**
|
|
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 ko=H("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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 So=H("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
|
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 up=H("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"}]]);/**
|
|
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 nn=H("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"}]]);/**
|
|
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 Co=H("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"}]]);/**
|
|
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 Cg=H("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"}]]);/**
|
|
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 cp=H("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"}]]);/**
|
|
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 dp=H("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"}]]);/**
|
|
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 Eo=H("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"}]]);/**
|
|
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 Eg=H("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
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 lc=H("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"}]]);/**
|
|
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 _g=H("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"}]]);/**
|
|
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 Rg=H("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"}]]);/**
|
|
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 sc=H("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 fp=H("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"}]]);/**
|
|
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 pp=H("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
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 Tg=H("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 mp=H("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 hn=H("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 ve=H("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 Pg=H("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
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 gs=H("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"}]]);/**
|
|
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 _o=H("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 hp=H("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"}]]);/**
|
|
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 xp=H("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"}]]);/**
|
|
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=H("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"}]]);/**
|
|
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 Lg=H("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"}]]);/**
|
|
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 Mg=H("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"}]]);/**
|
|
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 Te=H("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"}]]);/**
|
|
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 Ro=H("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"}]]);/**
|
|
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 Fg=H("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"}]]);/**
|
|
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 Gr=H("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"}]]);/**
|
|
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 jt=H("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
272
|
-
* @license lucide-react v0.468.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const tr=H("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"}]]),Og=[{path:"/",label:"Dashboard",icon:Rg},{path:"/results",label:"Results",icon:Eo},{path:"/builder",label:"Builder",icon:Gr},{path:"/datasets",label:"Datasets",icon:nn}];function zg(){const e=Ft(),[t,n]=h.useState(()=>typeof window<"u"?localStorage.getItem("theme")==="light":!1);return h.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(Tg,{size:20,style:{color:"var(--app-muted)"}}):s.jsx(Lg,{size:20,style:{color:"var(--app-muted)"}})})]})}),s.jsx("nav",{className:"p-4",children:s.jsx("ul",{className:"space-y-2",children:Og.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(Ix,{})})]})}const Dg="/api/v1";class Ig{async fetch(t,n){const r=await fetch(`${Dg}${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)})}}class $g extends Ig{async listProviders(){return(await this.fetch("/providers")).providers}async addProvider(t){return this.fetch("/providers",{method:"POST",body:JSON.stringify(t)})}async getProvider(t){return this.fetch(`/providers/${encodeURIComponent(t)}`)}async deleteProvider(t){await this.fetch(`/providers/${encodeURIComponent(t)}`,{method:"DELETE"})}async testProvider(t){return this.fetch(`/providers/${encodeURIComponent(t)}/test`,{method:"POST"})}}const ie=new $g;function Ug(){const[e,t]=h.useState(null),[n,r]=h.useState(!0),[l,a]=h.useState(null),[i,o]=h.useState([]),[u,c]=h.useState(!0),[m,f]=h.useState(!1),[g,y]=h.useState(null),[j,v]=h.useState({}),[b,p]=h.useState({name:"",type:"ollama",base_url:"http://localhost:11434/v1"}),[d,x]=h.useState(null),[S,N]=h.useState(!1),_=async()=>{try{const A=await ie.listProviders();o(A)}catch{o([])}finally{c(!1)}},P=async A=>{A.preventDefault(),x(null),N(!0);try{await ie.addProvider(b),await _(),f(!1),p({name:"",type:"ollama",base_url:"http://localhost:11434/v1"})}catch($){x($ instanceof Error?$.message:"Failed to add provider")}finally{N(!1)}},M=async A=>{y(A);try{const $=await ie.testProvider(A);v(Y=>({...Y,[A]:{success:$.success,message:$.success?`Connected! Found ${$.models_found.length} models (${$.latency_ms}ms)`:$.error||"Connection failed"}}))}catch($){v(Y=>({...Y,[A]:{success:!1,message:$ instanceof Error?$.message:"Test failed"}}))}finally{y(null)}},z=async A=>{if(confirm(`Delete provider "${A}"?`))try{await ie.deleteProvider(A),await _(),v($=>{const Y={...$};return delete Y[A],Y})}catch($){alert($ instanceof Error?$.message:"Failed to delete provider")}},O=A=>{switch(A){case"ollama":return"http://localhost:11434/v1";case"lmstudio":return"http://localhost:1234/v1";case"vllm":return"http://localhost:8000/v1";default:return"http://localhost:8000/v1"}};return h.useEffect(()=>{fetch("/api/v1/local/status").then(A=>{if(!A.ok)throw new Error("Failed to fetch status");return A.json()}).then(t).catch(A=>a(A.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(dp,{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(ve,{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(A=>s.jsxs("div",{className:"panel-card p-4",children:[s.jsx("h3",{className:"font-medium text-slate-100 mb-1",children:A.name}),s.jsx("p",{className:"text-sm text-slate-400 mb-3 line-clamp-2",children:A.description||"No description"}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-slate-500",children:A.relative_path}),s.jsxs(Re,{to:`/run/${A.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(hn,{size:14}),"Run"]})]})]},A.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(Gr,{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(ve,{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(A=>s.jsx("span",{className:"px-3 py-1 panel-subtle rounded-full text-sm text-slate-200 border border-slate-700/60",children:A.name},A.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(hp,{size:20}),"Local Providers (",i.length,")"]}),s.jsxs("button",{onClick:()=>f(!m),className:"flex items-center gap-1 px-3 py-1.5 bg-purple-500 hover:bg-purple-400 text-white rounded-lg text-sm font-semibold",children:[s.jsx(ve,{size:16}),"Add Provider"]})]}),m&&s.jsxs("div",{className:"panel-card p-4 mb-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-slate-200 mb-3",children:"Add Local Provider"}),s.jsxs("form",{onSubmit:P,className:"space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-400 mb-1",children:"Name"}),s.jsx("input",{type:"text",value:b.name,onChange:A=>p({...b,name:A.target.value}),placeholder:"ollama-local",className:"w-full px-3 py-1.5 bg-slate-800 border border-slate-700 rounded text-sm text-slate-100 placeholder-slate-500",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-400 mb-1",children:"Type"}),s.jsxs("select",{value:b.type,onChange:A=>{const $=A.target.value;p({...b,type:$,base_url:O($)})},className:"w-full px-3 py-1.5 bg-slate-800 border border-slate-700 rounded text-sm text-slate-100",children:[s.jsx("option",{value:"ollama",children:"Ollama"}),s.jsx("option",{value:"lmstudio",children:"LM Studio"}),s.jsx("option",{value:"vllm",children:"vLLM"}),s.jsx("option",{value:"openai-compatible",children:"OpenAI Compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-400 mb-1",children:"Base URL"}),s.jsx("input",{type:"url",value:b.base_url,onChange:A=>p({...b,base_url:A.target.value}),placeholder:"http://localhost:11434/v1",className:"w-full px-3 py-1.5 bg-slate-800 border border-slate-700 rounded text-sm text-slate-100 placeholder-slate-500",required:!0})]}),d&&s.jsx("p",{className:"text-red-400 text-xs",children:d}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx("button",{type:"button",onClick:()=>f(!1),className:"px-3 py-1.5 text-slate-400 hover:text-slate-200 text-sm",children:"Cancel"}),s.jsx("button",{type:"submit",disabled:S,className:"px-3 py-1.5 bg-purple-500 hover:bg-purple-400 text-white rounded text-sm font-medium disabled:opacity-50",children:S?"Adding...":"Add Provider"})]})]})]}),u?s.jsx("p",{className:"text-slate-400",children:"Loading providers..."}):i.length===0?s.jsxs("div",{className:"text-slate-400",children:[s.jsx("p",{className:"mb-2",children:"No local providers configured."}),s.jsx("p",{className:"text-sm",children:"Add a provider to use local models like Ollama, LM Studio, or vLLM."})]}):s.jsx("div",{className:"grid gap-3",children:i.map(A=>{var $,Y;return s.jsxs("div",{className:"panel-card p-4 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[A.status==="connected"?s.jsx(Us,{size:18,className:"text-green-400"}):A.status==="error"?s.jsx(bo,{size:18,className:"text-red-400"}):s.jsx(tn,{size:18,className:"text-slate-500"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium text-slate-100",children:A.name}),s.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-slate-700 rounded text-slate-300",children:A.type}),A.enabled&&s.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-green-900/50 text-green-400 rounded",children:"enabled"})]}),s.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:A.base_url}),(($=A.models)==null?void 0:$.length)>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:A.models.map(K=>s.jsx("span",{className:"text-xs px-2 py-0.5 bg-emerald-900/40 border border-emerald-700/50 rounded text-emerald-300",children:K},K))}),(((Y=A.models)==null?void 0:Y.length)===0||!A.models)&&A.status==="connected"&&s.jsx("div",{className:"text-xs text-slate-500 mt-1",children:"No models available"}),j[A.name]&&s.jsx("div",{className:`text-xs mt-1 ${j[A.name].success?"text-green-400":"text-red-400"}`,children:j[A.name].message})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>M(A.name),disabled:g===A.name,className:"p-1.5 text-slate-400 hover:text-slate-200 hover:bg-slate-700 rounded disabled:opacity-50",title:"Test connection",children:s.jsx(Pg,{size:16,className:g===A.name?"animate-spin":""})}),s.jsx("button",{onClick:()=>z(A.name),className:"p-1.5 text-slate-400 hover:text-red-400 hover:bg-slate-700 rounded",title:"Delete provider",children:s.jsx(Te,{size:16})})]})]},A.name)})})]})]}):null}function Bg(){const[e,t]=h.useState("idle"),[n,r]=h.useState(null),[l,a]=h.useState(null),[i,o]=h.useState(null),u=h.useCallback(()=>{t("idle"),r(null),a(null),o(null)},[]),c=h.useCallback(async(f,g,y,j)=>{u(),t("running");try{const v=await ie.runScenario({scenario_id:f,model:g,variables:y,mlflow_export:j==null?void 0:j.enabled,mlflow_tracking_uri:j==null?void 0:j.trackingUri,mlflow_experiment:j==null?void 0:j.experiment,mlflow_tracing:j==null?void 0:j.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]),m=h.useCallback(async(f,g,y=1,j,v)=>{u(),t("running");try{const b=await ie.compareModels({scenario_id:f,models:g,runs_per_model:y,variables:j,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(b)}catch(b){t("error"),o(b instanceof Error?b.message:"Unknown error")}},[u]);return{state:e,result:n,comparison:l,error:i,runScenario:c,compareModels:m,reset:u}}function gp(e){return e==null?"-":e<1e-4?"<$0.0001":e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function To({result:e}){var r,l,a;const[t,n]=h.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(Ro,{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(ko,{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(fp,{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(_g,{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(Co,{className:"w-4 h-4"}),"Cost"]}),s.jsx("div",{className:"text-2xl font-bold text-emerald-300",children:gp(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(Us,{className:"w-5 h-5 text-emerald-400"}):s.jsx(bo,{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(Hg,{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(tn,{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 ac(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 Hg({call:e}){const[t,n]=h.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(Ue,{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:ac(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:ac(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 Vg(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 m=c.avg_score||0,f=c.avg_cost_usd||0,g=c.avg_latency_ms||0,y=f>0?m/(f*100):m>0?1/0:0;n.push({modelId:u,score:m,cost:f,latency:g,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 Wg({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(Ro,{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(Co,{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 Yg({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(To,{result:e})})]})})}function vp({comparison:e}){var m,f,g,y,j,v,b,p;const[t,n]=h.useState(null),[r,l]=h.useState(null),a=e.ranking||[],i=Vg(e),o=new Map(i.map(d=>[d.modelId,d])),u=new Map;if(e.results)for(const d of e.results){const x=u.get(d.model)||[];x.push(d),u.set(d.model,x)}const c=e.results&&e.results.length>0;return s.jsxs(s.Fragment,{children:[r&&s.jsx(Yg,{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(Ro,{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:((m=i.find(d=>d.badges.includes("quality")))==null?void 0:m.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: ",(g=i.find(d=>d.badges.includes("quality")))==null?void 0:g.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(Co,{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])||((j=i.find(d=>d.badges.includes("value")))==null?void 0:j.modelId)}),s.jsx("div",{className:"text-xs text-slate-400 mt-1",children:(()=>{const d=i.find(_=>_.badges.includes("value")),x=i.find(_=>_.badges.includes("quality"));if(!d||!x)return"";if(d.cost===0)return"Free!";if(d.modelId===x.modelId)return"Also the best quality!";const S=Math.round(d.score/x.score*100),N=x.cost>0?Math.round(d.cost/x.cost*100):0;return N===0?`${S}% quality, nearly free`:`${S}% quality at ${N}% 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])||((b=i.find(d=>d.badges.includes("fast")))==null?void 0:b.modelId)}),s.jsxs("div",{className:"text-xs text-slate-400 mt-1",children:[((((p=i.find(d=>d.badges.includes("fast")))==null?void 0:p.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,x)=>{var M,z;const S=(M=e.stats)==null?void 0:M[d],N=o.get(d),_=u.get(d)||[],P=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(P?null:d),children:[s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[c&&(P?s.jsx(Ue,{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 ${x===0?"text-amber-300":"text-slate-400"}`,children:["#",x+1]})]})}),s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"text-slate-100 font-medium",children:d}),N&&N.badges.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:N.badges.map(O=>s.jsx(Wg,{type:O},O))})]}),s.jsx("td",{className:"px-4 py-3 text-right text-slate-100 font-semibold",children:((z=S.avg_score)==null?void 0:z.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:gp(S.avg_cost_usd)})]},d),P&&_.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 (",_.length,")"]}),_.map((O,A)=>{var $,Y,K;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:R=>{R.stopPropagation(),l(O)},children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-slate-500 text-sm",children:["Run ",A+1]}),s.jsxs("span",{className:"text-slate-100 font-medium",children:[((Y=($=O.evaluation)==null?void 0:$.percentage)==null?void 0:Y.toFixed(0))||0,"%"]}),((K=O.evaluation)==null?void 0:K.judge)&&s.jsx("span",{className:`text-sm ${O.evaluation.judge.passed?"text-emerald-300":"text-red-400"}`,children:O.evaluation.judge.passed?"✓ Passed":"✗ Failed"}),O.error&&s.jsxs("span",{className:"text-sm text-red-400 flex items-center gap-1",children:[s.jsx(tn,{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:R=>{R.stopPropagation(),l(O)},children:[s.jsx(cp,{className:"w-4 h-4"}),"View Details"]})]},A)})]})})},`${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(x=>{x.goal_rates&&Object.keys(x.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(x=>s.jsx("th",{className:"px-4 py-3 text-right text-sm font-medium text-slate-400",children:x},x))]})}),s.jsx("tbody",{children:a.map(x=>{var N;const S=(N=e.stats)==null?void 0:N[x];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:x}),Array.from(d).map(_=>{var M;const P=((M=S.goal_rates)==null?void 0:M[_])??0;return s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsxs("span",{className:P>=100?"text-emerald-300":P>=50?"text-amber-300":"text-red-400",children:[P.toFixed(0),"%"]})},_)})]},x):null})})]})})})()]})]})]})}function Pr(){return s.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 bg-emerald-500/20 border border-emerald-500/40 rounded text-xs text-emerald-400",children:[s.jsx(pp,{size:10}),"Local"]})}function ic({models:e,value:t,onChange:n,disabled:r,placeholder:l="Select a model..."}){const[a,i]=h.useState(!1),[o,u]=h.useState(""),c=h.useRef(null),m=h.useRef(null),f=e.find(p=>p.id===t);h.useEffect(()=>{const p=d=>{c.current&&!c.current.contains(d.target)&&i(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),h.useEffect(()=>{a&&m.current&&m.current.focus()},[a]);const g=e.filter(p=>p.name.toLowerCase().includes(o.toLowerCase())||p.id.toLowerCase().includes(o.toLowerCase())),y=g.reduce((p,d)=>{const x=d.provider_name||d.id.split("/")[0]||"other";return p[x]||(p[x]=[]),p[x].push(d),p},{}),j=["openai","anthropic","google","x-ai","deepseek","meta-llama","mistralai","qwen","perplexity"],v=p=>{var d;return(d=y[p])==null?void 0:d.some(x=>x.is_local)},b=Object.keys(y).sort((p,d)=>{const x=v(p),S=v(d);if(x&&!S)return-1;if(!x&&S)return 1;const N=j.indexOf(p),_=j.indexOf(d);return N===-1&&_===-1?p.localeCompare(d):N===-1?1:_===-1?-1:N-_});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 gap-2",children:[s.jsx("span",{className:"text-slate-100 truncate",children:f.name}),f.is_local&&s.jsx(Pr,{}),s.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:f.price})]}):s.jsx("span",{className:"text-slate-500",children:l}),s.jsx(Ue,{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(_o,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),s.jsx("input",{ref:m,type:"text",value:o,onChange:p=>u(p.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:[b.map(p=>s.jsxs("div",{children:[s.jsxs("div",{className:"px-3 py-1.5 text-xs font-medium text-slate-500 uppercase bg-slate-900 sticky top-0 flex items-center gap-2",children:[p,v(p)&&s.jsx(Pr,{})]}),y[p].map(d=>s.jsxs("button",{type:"button",onClick:()=>{n(d.id),i(!1),u("")},className:`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${d.id===t?"bg-orange-500/20 text-orange-300":"hover:bg-slate-800 text-slate-100"}`,children:[s.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[s.jsx("div",{className:"truncate",children:d.name}),d.is_local&&!v(p)&&s.jsx(Pr,{})]}),s.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:d.price}),d.id===t&&s.jsx(Jr,{size:16,className:"text-orange-400 shrink-0"})]},d.id))]},p)),g.length===0&&s.jsx("div",{className:"px-3 py-4 text-center text-slate-500 text-sm",children:"No models found"})]})]})]})}function Qg({models:e,selected:t,onChange:n,disabled:r}){const[l,a]=h.useState(!1),[i,o]=h.useState(""),u=h.useRef(null),c=h.useRef(null);h.useEffect(()=>{const p=d=>{u.current&&!u.current.contains(d.target)&&a(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),h.useEffect(()=>{l&&c.current&&c.current.focus()},[l]);const m=p=>{t.includes(p)?n(t.filter(d=>d!==p)):n([...t,p])},f=(p,d)=>{d.stopPropagation(),n(t.filter(x=>x!==p))},g=e.filter(p=>p.name.toLowerCase().includes(i.toLowerCase())||p.id.toLowerCase().includes(i.toLowerCase())),y=g.reduce((p,d)=>{const x=d.provider_name||d.id.split("/")[0]||"other";return p[x]||(p[x]=[]),p[x].push(d),p},{}),j=["openai","anthropic","google","x-ai","deepseek","meta-llama","mistralai","qwen","perplexity"],v=p=>{var d;return(d=y[p])==null?void 0:d.some(x=>x.is_local)},b=Object.keys(y).sort((p,d)=>{const x=v(p),S=v(d);if(x&&!S)return-1;if(!x&&S)return 1;const N=j.indexOf(p),_=j.indexOf(d);return N===-1&&_===-1?p.localeCompare(d):N===-1?1:_===-1?-1:N-_});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(p=>{const d=e.find(x=>x.id===p);return s.jsxs("span",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full text-sm text-slate-100 ${d!=null&&d.is_local?"bg-emerald-500/20 border border-emerald-400/40":"bg-orange-500/20 border border-orange-400/40"}`,children:[(d==null?void 0:d.is_local)&&s.jsx(pp,{size:12,className:"text-emerald-400"}),(d==null?void 0:d.name)||p,s.jsx("button",{type:"button",onClick:x=>f(p,x),className:"hover:text-red-400 transition-colors",disabled:r,children:s.jsx(jt,{size:14})})]},p)})}),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(Ue,{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(_o,{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:p=>o(p.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:[b.map(p=>s.jsxs("div",{children:[s.jsxs("div",{className:"px-3 py-1.5 text-xs font-medium text-slate-500 uppercase bg-slate-900 sticky top-0 flex items-center gap-2",children:[p,v(p)&&s.jsx(Pr,{})]}),y[p].map(d=>{const x=t.includes(d.id);return s.jsxs("button",{type:"button",onClick:()=>m(d.id),className:`w-full flex items-center gap-3 px-3 py-2 text-left transition-colors ${x?"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 ${x?"bg-orange-400 border-orange-400":"border-slate-600"}`,children:x&&s.jsx(Jr,{size:12,className:"text-slate-900"})}),s.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[s.jsx("div",{className:"truncate",children:d.name}),d.is_local&&!v(p)&&s.jsx(Pr,{})]}),s.jsx("span",{className:"text-xs text-slate-500 shrink-0",children:d.price})]},d.id)})]},p)),g.length===0&&s.jsx("div",{className:"px-3 py-4 text-center text-slate-500 text-sm",children:"No models found"})]})]})]})}function oc(){var Io;const{scenarioId:e}=Sx(),[t]=gg(),n=t.get("dataset"),r=parseInt(t.get("parallel")||"5"),[l,a]=h.useState([]),[i,o]=h.useState(null),[u,c]=h.useState(e||""),[m,f]=h.useState([]),[g,y]=h.useState(""),[j,v]=h.useState([]),[b,p]=h.useState(n?"dataset":"single"),[d,x]=h.useState(1),[S,N]=h.useState({}),[_,P]=h.useState(!0),[M,z]=h.useState(null),[O,A]=h.useState([]),[$,Y]=h.useState(n||""),[K,R]=h.useState(null),[C,E]=h.useState(!1),[w,k]=h.useState(r),[T,F]=h.useState(!1),[U,ee]=h.useState(!1),[X,lt]=h.useState(""),[Le,st]=h.useState(""),[kn,dl]=h.useState(!0),{state:se,result:Ot,comparison:zo,error:Do,runScenario:om,compareModels:um}=Bg();h.useEffect(()=>{(async()=>{try{const[Me,Be,fm]=await Promise.all([ie.listScenarios(),ie.listModels(),ie.listDatasets()]);if(a(Me),f(Be),A(fm),Be.length>0&&y(Be[0].id),e){c(e);const $o=await ie.getScenario(e);o($o);const Uo={};for(const Bo of $o.variables||[])Uo[Bo.name]=Bo.default??"";N(Uo)}}catch(Me){z(Me instanceof Error?Me.message:"Failed to load data")}finally{P(!1)}})()},[e]),h.useEffect(()=>{u&&u!==e&&ie.getScenario(u).then(B=>{o(B);const Me={};for(const Be of B.variables||[])Me[Be.name]=Be.default??"";N(Me)}).catch(B=>z(B.message))},[u,e]);const cm=async()=>{const B=u||e;if(!B)return;const Me=T?{enabled:!0,trackingUri:X||void 0,experiment:Le||void 0,tracing:kn}:void 0;if(b==="dataset"){if(!$||!g)return;E(!0),R(null);try{const Be=await ie.runDataset({scenario_id:B,dataset_id:$,model:g,parallel:w,mlflow_enabled:T,mlflow_experiment:Le||void 0});R(Be)}catch(Be){z(Be instanceof Error?Be.message:"Dataset run failed")}finally{E(!1)}}else if(b==="single"){if(!g)return;await om(B,g,S,Me)}else{if(j.length===0)return;await um(B,j,d,S,Me)}},dm=(B,Me)=>{N(Be=>({...Be,[B]:Me}))};return _?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(sc,{className:"w-8 h-8 animate-spin text-orange-400"})}):M?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:M})}):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(xs,{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(Ag,{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:B=>c(B.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(B=>s.jsx("option",{value:B.id,children:B.name},B.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:()=>p("single"),disabled:se==="running"||C,className:`px-4 py-2 rounded-lg transition-colors ${b==="single"?"bg-orange-400 text-slate-900":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:"Single Model"}),s.jsx("button",{onClick:()=>p("compare"),disabled:se==="running"||C,className:`px-4 py-2 rounded-lg transition-colors ${b==="compare"?"bg-orange-400 text-slate-900":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:"Compare Models"}),s.jsxs("button",{onClick:()=>p("dataset"),disabled:se==="running"||C||O.length===0,className:`flex items-center gap-2 px-4 py-2 rounded-lg transition-colors ${b==="dataset"?"bg-blue-500 text-white":"bg-slate-800 text-slate-300 hover:bg-slate-700"}`,children:[s.jsx(nn,{size:16}),"Dataset Benchmark"]})]})]}),b==="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(ic,{models:m,value:g,onChange:y,disabled:se==="running"})]}):b==="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(Qg,{models:m,selected:j,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:B=>x(Math.max(1,Math.min(10,parseInt(B.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:$,onChange:B=>Y(B.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..."}),O.map(B=>s.jsxs("option",{value:B.id,children:[B.name," (",B.case_count," cases)"]},B.id))]}),O.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(ic,{models:m,value:g,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=>k(Math.max(1,Math.min(20,parseInt(B.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(xp,{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(B=>s.jsx(Kg,{variable:B,value:S[B.name],onChange:Me=>dm(B.name,Me),disabled:se==="running"},B.name))})]}),s.jsxs("div",{className:"mb-6 p-4 panel-subtle",children:[s.jsxs("button",{onClick:()=>ee(!U),className:"flex items-center gap-2 w-full text-left",children:[U?s.jsx(Ue,{size:18}):s.jsx(rt,{size:18}),s.jsx("span",{className:"font-medium text-slate-100",children:"MLflow Tracking"}),T&&s.jsx("span",{className:"ml-2 px-2 py-0.5 text-xs bg-green-500/20 text-green-400 rounded",children:"Enabled"})]}),U&&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:T,onChange:B=>F(B.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"})]}),T&&s.jsxs(s.Fragment,{children:[b!=="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:X,onChange:B=>lt(B.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:Le,onChange:B=>st(B.target.value),disabled:se==="running"||C,placeholder:b==="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"})]}),b!=="dataset"&&s.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:kn,onChange:B=>dl(B.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(Cg,{size:12}),"View results at your MLflow server after the run completes"]})]})]})]}),s.jsx("button",{onClick:cm,disabled:se==="running"||C||!u||(b==="single"?!g:b==="compare"?j.length===0:!$||!g),className:`flex items-center gap-2 ${b==="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(sc,{className:"w-4 h-4 animate-spin"}),"Running..."]}):s.jsxs(s.Fragment,{children:[b==="dataset"?s.jsx(nn,{className:"w-4 h-4"}):s.jsx(hn,{className:"w-4 h-4"}),b==="single"?"Run Scenario":b==="compare"?`Compare ${j.length} Models`:`Run ${((Io=O.find(B=>B.id===$))==null?void 0:Io.case_count)||0} Cases`]})})]}),Do&&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(bo,{className:"w-5 h-5"}),s.jsx("span",{children:Do})]})}),Ot&&s.jsx(To,{result:Ot}),zo&&s.jsx(vp,{comparison:zo}),K&&s.jsx(qg,{result:K})]})}function qg({result:e}){const[t,n]=h.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(nn,{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(Jr,{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 Kg({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 uc=e=>e.scenario_id.endsWith("_comparison")||e.filename.includes("_comparison_"),cc=e=>e.scenario_id.includes("_dataset_")||e.filename.includes("_dataset_"),Tl=e=>e.replace(/_comparison$/,"").replace(/_dataset_.*$/,"");function Jg(){const[e,t]=h.useState([]),[n,r]=h.useState(!0),[l,a]=h.useState(null),[i,o]=h.useState(null),[u,c]=h.useState(null),[m,f]=h.useState(!1),[g,y]=h.useState(!1),[j,v]=h.useState(""),[b,p]=h.useState("all"),[d,x]=h.useState(new Set),S=R=>{x(C=>{const E=new Set(C);return E.has(R)?E.delete(R):E.add(R),E})},{filteredResults:N,groupedResults:_,scenarioOrder:P}=h.useMemo(()=>{let R=e.filter(w=>{if(j){const k=j.toLowerCase();if(!w.scenario_id.toLowerCase().includes(k))return!1}if(b!=="all"){const k=uc(w),T=cc(w);if(b==="comparison"&&!k||b==="dataset"&&!T||b==="single"&&(k||T))return!1}return!0});R=R.sort((w,k)=>new Date(k.timestamp).getTime()-new Date(w.timestamp).getTime());const C={},E=[];for(const w of R){const k=Tl(w.scenario_id);C[k]||(C[k]=[],E.push(k)),C[k].push(w)}return{filteredResults:R,groupedResults:C,scenarioOrder:E}},[e,j,b]);h.useEffect(()=>{fetch("/api/v1/local/runs").then(R=>{if(!R.ok)throw new Error("Failed to fetch results");return R.json()}).then(t).catch(R=>a(R.message)).finally(()=>r(!1))},[]);const M=async R=>{try{const C=await fetch(`/api/v1/local/runs/${encodeURIComponent(R)}`);if(!C.ok)throw new Error("Failed to fetch result");const E=await C.json();o(E),c(R),f(!1)}catch(C){console.error("Error fetching result:",C)}},z=async()=>{if(i)try{await navigator.clipboard.writeText(JSON.stringify(i,null,2)),y(!0),setTimeout(()=>y(!1),2e3)}catch(R){console.error("Failed to copy:",R)}},O=R=>{var F,U,ee,X,lt;if(!R)return"unknown";const C=R.case_results||((F=R.result)==null?void 0:F.case_results),E=R.dataset_id||((U=R.result)==null?void 0:U.dataset_id);if(C||E)return"dataset";if(R.ranking||((ee=R.result)==null?void 0:ee.ranking))return"comparison";const k=R.model||((X=R.result)==null?void 0:X.model),T=R.response||((lt=R.result)==null?void 0:lt.response);return k||T!==void 0?"single":"unknown"},A=R=>{const C=R.result||R;return{id:C.id||"",scenario_id:C.scenario_id||R.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}},$=R=>{const C=R.result||R;return{scenario_id:C.scenario_id||R.scenario_id||"",scenario_name:C.scenario_name||R.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||[]}},Y=R=>{const C=R.result||R;return{scenario_id:C.scenario_id||R.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 K=O(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(Eo,{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(hn,{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(_o,{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:j,onChange:R=>v(R.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:()=>p("all"),className:`flex-1 min-w-0 px-2 py-1.5 text-xs font-medium rounded-md transition-colors ${b==="all"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:"All"}),s.jsxs("button",{onClick:()=>p("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 ${b==="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:()=>p("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 ${b==="comparison"?"bg-slate-700/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[s.jsx(lc,{size:12}),"Compare"]}),s.jsxs("button",{onClick:()=>p("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 ${b==="dataset"?"bg-blue-600/80 text-slate-100":"text-slate-400 hover:text-slate-200"}`,children:[s.jsx(nn,{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:[N.length," result",N.length!==1?"s":""," in ",P.length," scenario",P.length!==1?"s":""]}),j&&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:P.length===0?s.jsxs("div",{className:"text-center py-8 text-slate-500",children:[s.jsx(Eg,{size:24,className:"mx-auto mb-2 opacity-50"}),s.jsx("p",{className:"text-sm",children:"No results match your filters"})]}):P.map(R=>{const C=_[R],E=d.has(R);return s.jsxs("div",{className:"panel-card overflow-hidden",children:[s.jsxs("button",{onClick:()=>S(R),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(Ue,{size:16,className:"text-slate-500"}),s.jsx("span",{className:"font-medium text-slate-200 text-sm",children:R})]}),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 k=uc(w),T=cc(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:()=>M(w.filename),children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[T?s.jsx(nn,{size:14,className:"text-blue-400 flex-shrink-0"}):k?s.jsx(lc,{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(ko,{size:10}),new Date(w.timestamp).toLocaleString()]})})]}),s.jsx(Re,{to:`/run/${Tl(w.scenario_id)}`,onClick:F=>F.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(hn,{size:12})})]},w.filename)})})]},R)})})]}),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:Tl(i.scenario_id)}),K==="single"&&A(i).model&&s.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Model: ",A(i).model]}),K==="comparison"&&s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Model Comparison"}),K==="dataset"&&s.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Dataset: ",Y(i).dataset_id," | Model: ",Y(i).model]})]}),s.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.jsxs("button",{onClick:z,className:`flex items-center gap-1 text-xs px-2 py-1 border rounded whitespace-nowrap transition-colors ${g?"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(up,{size:12}),g?"Copied!":"Copy JSON"]}),s.jsx("button",{onClick:()=>f(!m),className:"text-xs text-slate-400 hover:text-slate-100 px-2 py-1 border border-slate-700/70 rounded whitespace-nowrap",children:m?"View Details":"View JSON"}),s.jsxs(Re,{to:`/run/${Tl(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(hn,{size:14}),"Run Again"]})]})]})}),m?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:[K==="single"&&s.jsx(To,{result:A(i)}),K==="comparison"&&s.jsx(vp,{comparison:$(i)}),K==="dataset"&&s.jsx(Gg,{result:Y(i)}),K==="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(cp,{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 Gg({result:e}){const[t,n]=h.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(nn,{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(Jr,{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(ko,{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,m=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 ${m>=.9?"text-emerald-300":m>=.7?"text-amber-300":"text-red-400"}`,children:[u.passed,"/",c]}),s.jsxs("span",{className:"text-xs text-slate-500",children:["(",(m*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(Jr,{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(Ue,{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 yp(e){return typeof e>"u"||e===null}function Xg(e){return typeof e=="object"&&e!==null}function Zg(e){return Array.isArray(e)?e:yp(e)?[]:[e]}function ev(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 tv(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function nv(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var rv=yp,lv=Xg,sv=Zg,av=tv,iv=nv,ov=ev,fe={isNothing:rv,isObject:lv,toArray:sv,repeat:av,isNegativeZero:iv,extend:ov};function jp(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+=`
|
|
277
|
-
|
|
278
|
-
`+e.mark.snippet),r+" "+n):r}function Xr(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=jp(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Xr.prototype=Object.create(Error.prototype);Xr.prototype.constructor=Xr;Xr.prototype.toString=function(t){return this.name+": "+jp(this,t)};var Ee=Xr;function va(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 ya(e,t){return fe.repeat(" ",t-e.length)+e}function uv(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,m=Math.min(e.line+t.linesAfter,l.length).toString().length,f=t.maxLength-(t.indent+m+3);for(u=1;u<=t.linesBefore&&!(i-u<0);u++)c=va(e.buffer,r[i-u],l[i-u],e.position-(r[i]-r[i-u]),f),o=fe.repeat(" ",t.indent)+ya((e.line-u+1).toString(),m)+" | "+c.str+`
|
|
279
|
-
`+o;for(c=va(e.buffer,r[i],l[i],e.position,f),o+=fe.repeat(" ",t.indent)+ya((e.line+1).toString(),m)+" | "+c.str+`
|
|
280
|
-
`,o+=fe.repeat("-",t.indent+m+3+c.pos)+`^
|
|
281
|
-
`,u=1;u<=t.linesAfter&&!(i+u>=l.length);u++)c=va(e.buffer,r[i+u],l[i+u],e.position-(r[i]-r[i+u]),f),o+=fe.repeat(" ",t.indent)+ya((e.line+u+1).toString(),m)+" | "+c.str+`
|
|
282
|
-
`;return o.replace(/\n$/,"")}var cv=uv,dv=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],fv=["scalar","sequence","mapping"];function pv(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function mv(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(dv.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=pv(t.styleAliases||null),fv.indexOf(this.kind)===-1)throw new Ee('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ye=mv;function dc(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 hv(){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 gi(e){return this.extend(e)}gi.prototype.extend=function(t){var n=[],r=[];if(t instanceof ye)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 ye))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 ye))throw new Ee("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(gi.prototype);return l.implicit=(this.implicit||[]).concat(n),l.explicit=(this.explicit||[]).concat(r),l.compiledImplicit=dc(l,"implicit"),l.compiledExplicit=dc(l,"explicit"),l.compiledTypeMap=hv(l.compiledImplicit,l.compiledExplicit),l};var Np=gi,wp=new ye("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),bp=new ye("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),kp=new ye("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Sp=new Np({explicit:[wp,bp,kp]});function xv(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function gv(){return null}function vv(e){return e===null}var Cp=new ye("tag:yaml.org,2002:null",{kind:"scalar",resolve:xv,construct:gv,predicate:vv,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function yv(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 jv(e){return e==="true"||e==="True"||e==="TRUE"}function Nv(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Ep=new ye("tag:yaml.org,2002:bool",{kind:"scalar",resolve:yv,construct:jv,predicate:Nv,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 wv(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function bv(e){return 48<=e&&e<=55}function kv(e){return 48<=e&&e<=57}function Sv(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(!wv(e.charCodeAt(n)))return!1;r=!0}return r&&l!=="_"}if(l==="o"){for(n++;n<t;n++)if(l=e[n],l!=="_"){if(!bv(e.charCodeAt(n)))return!1;r=!0}return r&&l!=="_"}}if(l==="_")return!1;for(;n<t;n++)if(l=e[n],l!=="_"){if(!kv(e.charCodeAt(n)))return!1;r=!0}return!(!r||l==="_")}function Cv(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 Ev(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!fe.isNegativeZero(e)}var _p=new ye("tag:yaml.org,2002:int",{kind:"scalar",resolve:Sv,construct:Cv,predicate:Ev,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"]}}),_v=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Rv(e){return!(e===null||!_v.test(e)||e[e.length-1]==="_")}function Tv(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 Pv=/^[-+]?[0-9]+e/;function Av(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(fe.isNegativeZero(e))return"-0.0";return n=e.toString(10),Pv.test(n)?n.replace("e",".e"):n}function Lv(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||fe.isNegativeZero(e))}var Rp=new ye("tag:yaml.org,2002:float",{kind:"scalar",resolve:Rv,construct:Tv,predicate:Lv,represent:Av,defaultStyle:"lowercase"}),Tp=Sp.extend({implicit:[Cp,Ep,_p,Rp]}),Pp=Tp,Ap=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Lp=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 Mv(e){return e===null?!1:Ap.exec(e)!==null||Lp.exec(e)!==null}function Fv(e){var t,n,r,l,a,i,o,u=0,c=null,m,f,g;if(t=Ap.exec(e),t===null&&(t=Lp.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]&&(m=+t[10],f=+(t[11]||0),c=(m*60+f)*6e4,t[9]==="-"&&(c=-c)),g=new Date(Date.UTC(n,r,l,a,i,o,u)),c&&g.setTime(g.getTime()-c),g}function Ov(e){return e.toISOString()}var Mp=new ye("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Mv,construct:Fv,instanceOf:Date,represent:Ov});function zv(e){return e==="<<"||e===null}var Fp=new ye("tag:yaml.org,2002:merge",{kind:"scalar",resolve:zv}),Po=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
283
|
-
\r`;function Dv(e){if(e===null)return!1;var t,n,r=0,l=e.length,a=Po;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 Iv(e){var t,n,r=e.replace(/[\r\n=]/g,""),l=r.length,a=Po,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 $v(e){var t="",n=0,r,l,a=e.length,i=Po;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 Uv(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Op=new ye("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Dv,construct:Iv,predicate:Uv,represent:$v}),Bv=Object.prototype.hasOwnProperty,Hv=Object.prototype.toString;function Vv(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,Hv.call(l)!=="[object Object]")return!1;for(a in l)if(Bv.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 Wv(e){return e!==null?e:[]}var zp=new ye("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Vv,construct:Wv}),Yv=Object.prototype.toString;function Qv(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],Yv.call(r)!=="[object Object]"||(l=Object.keys(r),l.length!==1))return!1;a[t]=[l[0],r[l[0]]]}return!0}function qv(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 Dp=new ye("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Qv,construct:qv}),Kv=Object.prototype.hasOwnProperty;function Jv(e){if(e===null)return!0;var t,n=e;for(t in n)if(Kv.call(n,t)&&n[t]!==null)return!1;return!0}function Gv(e){return e!==null?e:{}}var Ip=new ye("tag:yaml.org,2002:set",{kind:"mapping",resolve:Jv,construct:Gv}),Ao=Pp.extend({implicit:[Mp,Fp],explicit:[Op,zp,Dp,Ip]}),rn=Object.prototype.hasOwnProperty,vs=1,$p=2,Up=3,ys=4,ja=1,Xv=2,fc=3,Zv=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ey=/[\x85\u2028\u2029]/,ty=/[,\[\]\{\}]/,Bp=/^(?:!|!!|![a-z\-]+!)$/i,Hp=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function pc(e){return Object.prototype.toString.call(e)}function yt(e){return e===10||e===13}function xn(e){return e===9||e===32}function ze(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 ny(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function ry(e){return e===120?2:e===117?4:e===85?8:0}function ly(e){return 48<=e&&e<=57?e-48:-1}function mc(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
284
|
-
`: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 sy(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Vp(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var Wp=new Array(256),Yp=new Array(256);for(var Cn=0;Cn<256;Cn++)Wp[Cn]=mc(Cn)?1:0,Yp[Cn]=mc(Cn);function ay(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ao,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 Qp(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=cv(n),new Ee(t,n)}function I(e,t){throw Qp(e,t)}function js(e,t){e.onWarning&&e.onWarning.call(null,Qp(e,t))}var hc={YAML:function(t,n,r){var l,a,i;t.version!==null&&I(t,"duplication of %YAML directive"),r.length!==1&&I(t,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),l===null&&I(t,"ill-formed argument of the YAML directive"),a=parseInt(l[1],10),i=parseInt(l[2],10),a!==1&&I(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=i<2,i!==1&&i!==2&&js(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var l,a;r.length!==2&&I(t,"TAG directive accepts exactly two arguments"),l=r[0],a=r[1],Bp.test(l)||I(t,"ill-formed tag handle (first argument) of the TAG directive"),rn.call(t.tagMap,l)&&I(t,'there is a previously declared suffix for "'+l+'" tag handle'),Hp.test(a)||I(t,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{I(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||I(e,"expected valid JSON character");else Zv.test(o)&&I(e,"the stream contains non-printable characters");e.result+=o}}function xc(e,t,n,r){var l,a,i,o;for(fe.isObject(n)||I(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],rn.call(t,a)||(Vp(t,a,n[a]),r[a]=!0)}function Un(e,t,n,r,l,a,i,o,u){var c,m;if(Array.isArray(l))for(l=Array.prototype.slice.call(l),c=0,m=l.length;c<m;c+=1)Array.isArray(l[c])&&I(e,"nested arrays are not supported inside keys"),typeof l=="object"&&pc(l[c])==="[object Object]"&&(l[c]="[object Object]");if(typeof l=="object"&&pc(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,m=a.length;c<m;c+=1)xc(e,t,a[c],n);else xc(e,t,a,n);else!e.json&&!rn.call(n,l)&&rn.call(t,l)&&(e.line=i||e.line,e.lineStart=o||e.lineStart,e.position=u||e.position,I(e,"duplicated mapping key")),Vp(t,l,a),delete n[l];return t}function Lo(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++):I(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ce(e,t,n){for(var r=0,l=e.input.charCodeAt(e.position);l!==0;){for(;xn(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(Lo(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&&js(e,"deficient indentation"),r}function Bs(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||ze(n)))}function Mo(e,t){t===1?e.result+=" ":t>1&&(e.result+=fe.repeat(`
|
|
285
|
-
`,t-1))}function iy(e,t,n){var r,l,a,i,o,u,c,m,f=e.kind,g=e.result,y;if(y=e.input.charCodeAt(e.position),ze(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),ze(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),ze(l)||n&&$n(l))break}else if(y===35){if(r=e.input.charCodeAt(e.position-1),ze(r))break}else{if(e.position===e.lineStart&&Bs(e)||n&&$n(y))break;if(yt(y))if(u=e.line,c=e.lineStart,m=e.lineIndent,ce(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=m;break}}o&&(Xt(e,a,i,!1),Mo(e,e.line-u),a=i=e.position,o=!1),xn(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=g,!1)}function oy(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),Mo(e,ce(e,!1,t)),r=l=e.position):e.position===e.lineStart&&Bs(e)?I(e,"unexpected end of the document within a single quoted scalar"):(e.position++,l=e.position);I(e,"unexpected end of the stream within a single quoted scalar")}function uy(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))ce(e,!1,t);else if(o<256&&Wp[o])e.result+=Yp[o],e.position++;else if((i=ry(o))>0){for(l=i,a=0;l>0;l--)o=e.input.charCodeAt(++e.position),(i=ny(o))>=0?a=(a<<4)+i:I(e,"expected hexadecimal character");e.result+=sy(a),e.position++}else I(e,"unknown escape sequence");n=r=e.position}else yt(o)?(Xt(e,n,r,!0),Mo(e,ce(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Bs(e)?I(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}I(e,"unexpected end of the stream within a double quoted scalar")}function cy(e,t){var n=!0,r,l,a,i=e.tag,o,u=e.anchor,c,m,f,g,y,j=Object.create(null),v,b,p,d;if(d=e.input.charCodeAt(e.position),d===91)m=93,y=!1,o=[];else if(d===123)m=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(ce(e,!0,t),d=e.input.charCodeAt(e.position),d===m)return e.position++,e.tag=i,e.anchor=u,e.kind=y?"mapping":"sequence",e.result=o,!0;n?d===44&&I(e,"expected the node content, but found ','"):I(e,"missed comma between flow collection entries"),b=v=p=null,f=g=!1,d===63&&(c=e.input.charCodeAt(e.position+1),ze(c)&&(f=g=!0,e.position++,ce(e,!0,t))),r=e.line,l=e.lineStart,a=e.position,nr(e,t,vs,!1,!0),b=e.tag,v=e.result,ce(e,!0,t),d=e.input.charCodeAt(e.position),(g||e.line===r)&&d===58&&(f=!0,d=e.input.charCodeAt(++e.position),ce(e,!0,t),nr(e,t,vs,!1,!0),p=e.result),y?Un(e,o,j,b,v,p,r,l,a):f?o.push(Un(e,null,j,b,v,p,r,l,a)):o.push(v),ce(e,!0,t),d=e.input.charCodeAt(e.position),d===44?(n=!0,d=e.input.charCodeAt(++e.position)):n=!1}I(e,"unexpected end of the stream within a flow collection")}function dy(e,t){var n,r,l=ja,a=!1,i=!1,o=t,u=0,c=!1,m,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)ja===l?l=f===43?fc:Xv:I(e,"repeat of a chomping mode identifier");else if((m=ly(f))>=0)m===0?I(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):i?I(e,"repeat of an indentation width identifier"):(o=t+m-1,i=!0);else break;if(xn(f)){do f=e.input.charCodeAt(++e.position);while(xn(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!yt(f)&&f!==0)}for(;f!==0;){for(Lo(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===fc?e.result+=fe.repeat(`
|
|
286
|
-
`,a?1+u:u):l===ja&&a&&(e.result+=`
|
|
287
|
-
`);break}for(r?xn(f)?(c=!0,e.result+=fe.repeat(`
|
|
288
|
-
`,a?1+u:u)):c?(c=!1,e.result+=fe.repeat(`
|
|
289
|
-
`,u+1)):u===0?a&&(e.result+=" "):e.result+=fe.repeat(`
|
|
290
|
-
`,u):e.result+=fe.repeat(`
|
|
291
|
-
`,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 gc(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,I(e,"tab characters must not be used in indentation")),!(u!==45||(i=e.input.charCodeAt(e.position+1),!ze(i))));){if(o=!0,e.position++,ce(e,!0,-1)&&e.lineIndent<=t){a.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,nr(e,t,Up,!1,!0),a.push(e.result),ce(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)I(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 fy(e,t,n){var r,l,a,i,o,u,c=e.tag,m=e.anchor,f={},g=Object.create(null),y=null,j=null,v=null,b=!1,p=!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(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,I(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),a=e.line,(d===63||d===58)&&ze(r))d===63?(b&&(Un(e,f,g,y,j,null,i,o,u),y=j=v=null),p=!0,b=!0,l=!0):b?(b=!1,l=!0):I(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,$p,!1,!0))break;if(e.line===a){for(d=e.input.charCodeAt(e.position);xn(d);)d=e.input.charCodeAt(++e.position);if(d===58)d=e.input.charCodeAt(++e.position),ze(d)||I(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Un(e,f,g,y,j,null,i,o,u),y=j=v=null),p=!0,b=!1,l=!1,y=e.tag,j=e.result;else if(p)I(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=m,!0}else if(p)I(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=m,!0}if((e.line===a||e.lineIndent>t)&&(b&&(i=e.line,o=e.lineStart,u=e.position),nr(e,t,ys,!0,l)&&(b?j=e.result:v=e.result),b||(Un(e,f,g,y,j,v,i,o,u),y=j=v=null),ce(e,!0,-1),d=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&d!==0)I(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&Un(e,f,g,y,j,null,i,o,u),p&&(e.tag=c,e.anchor=m,e.kind="mapping",e.result=f),p}function py(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&&I(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)):I(e,"unexpected end of the stream within a verbatim tag")}else{for(;i!==0&&!ze(i);)i===33&&(r?I(e,"tag suffix cannot contain exclamation marks"):(l=e.input.slice(t-1,e.position+1),Bp.test(l)||I(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),ty.test(a)&&I(e,"tag suffix cannot contain flow indicator characters")}a&&!Hp.test(a)&&I(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{I(e,"tag name is malformed: "+a)}return n?e.tag=a:rn.call(e.tagMap,l)?e.tag=e.tagMap[l]+a:l==="!"?e.tag="!"+a:l==="!!"?e.tag="tag:yaml.org,2002:"+a:I(e,'undeclared tag handle "'+l+'"'),!0}function my(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&I(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!ze(n)&&!$n(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&I(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function hy(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&&!ze(r)&&!$n(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&I(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),rn.call(e.anchorMap,n)||I(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],ce(e,!0,-1),!0}function nr(e,t,n,r,l){var a,i,o,u=1,c=!1,m=!1,f,g,y,j,v,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=i=o=ys===n||Up===n,r&&ce(e,!0,-1)&&(c=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;py(e)||my(e);)ce(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||ys===n)&&(vs===n||$p===n?v=t:v=t+1,b=e.position-e.lineStart,u===1?o&&(gc(e,b)||fy(e,b,v))||cy(e,v)?m=!0:(i&&dy(e,v)||oy(e,v)||uy(e,v)?m=!0:hy(e)?(m=!0,(e.tag!==null||e.anchor!==null)&&I(e,"alias node should not have any properties")):iy(e,v,vs===n)&&(m=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(m=o&&gc(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&I(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,g=e.implicitTypes.length;f<g;f+=1)if(j=e.implicitTypes[f],j.resolve(e.result)){e.result=j.construct(e.result),e.tag=j.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(rn.call(e.typeMap[e.kind||"fallback"],e.tag))j=e.typeMap[e.kind||"fallback"][e.tag];else for(j=null,y=e.typeMap.multi[e.kind||"fallback"],f=0,g=y.length;f<g;f+=1)if(e.tag.slice(0,y[f].tag.length)===y[f].tag){j=y[f];break}j||I(e,"unknown tag !<"+e.tag+">"),e.result!==null&&j.kind!==e.kind&&I(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+j.kind+'", not "'+e.kind+'"'),j.resolve(e.result,e.tag)?(e.result=j.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):I(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||m}function xy(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&&(ce(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&&!ze(i);)i=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),l=[],r.length<1&&I(e,"directive name must not be less than one character in length");i!==0;){for(;xn(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&&!ze(i);)i=e.input.charCodeAt(++e.position);l.push(e.input.slice(n,e.position))}i!==0&&Lo(e),rn.call(hc,r)?hc[r](e,r,l):js(e,'unknown document directive "'+r+'"')}if(ce(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,ce(e,!0,-1)):a&&I(e,"directives end mark is expected"),nr(e,e.lineIndent-1,ys,!1,!0),ce(e,!0,-1),e.checkLineBreaks&&ey.test(e.input.slice(t,e.position))&&js(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Bs(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,ce(e,!0,-1));return}if(e.position<e.length-1)I(e,"end of the stream or a document separator is expected");else return}function qp(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
292
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new ay(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,I(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;)xy(n);return n.documents}function gy(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=qp(e,n);if(typeof t!="function")return r;for(var l=0,a=r.length;l<a;l+=1)t(r[l])}function vy(e,t){var n=qp(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 yy=gy,jy=vy,Kp={loadAll:yy,load:jy},Jp=Object.prototype.toString,Gp=Object.prototype.hasOwnProperty,Fo=65279,Ny=9,Zr=10,wy=13,by=32,ky=33,Sy=34,vi=35,Cy=37,Ey=38,_y=39,Ry=42,Xp=44,Ty=45,Ns=58,Py=61,Ay=62,Ly=63,My=64,Zp=91,em=93,Fy=96,tm=123,Oy=124,nm=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 zy=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Dy=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Iy(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&&Gp.call(u.styleAliases,o)&&(o=u.styleAliases[o]),n[i]=o;return n}function $y(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+fe.repeat("0",r-t.length)+t}var Uy=1,el=2;function By(e){this.schema=e.schema||Ao,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=fe.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Iy(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==='"'?el:Uy,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 vc(e,t){for(var n=fe.repeat(" ",t),r=0,l=-1,a="",i,o=e.length;r<o;)l=e.indexOf(`
|
|
293
|
-
`,r),l===-1?(i=e.slice(r),r=o):(i=e.slice(r,l+1),r=l+1),i.length&&i!==`
|
|
294
|
-
`&&(a+=n),a+=i;return a}function yi(e,t){return`
|
|
295
|
-
`+fe.repeat(" ",e.indent*t)}function Hy(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 ws(e){return e===by||e===Ny}function tl(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Fo||65536<=e&&e<=1114111}function yc(e){return tl(e)&&e!==Fo&&e!==wy&&e!==Zr}function jc(e,t,n){var r=yc(e),l=r&&!ws(e);return(n?r:r&&e!==Xp&&e!==Zp&&e!==em&&e!==tm&&e!==nm)&&e!==vi&&!(t===Ns&&!l)||yc(t)&&!ws(t)&&e===vi||t===Ns&&l}function Vy(e){return tl(e)&&e!==Fo&&!ws(e)&&e!==Ty&&e!==Ly&&e!==Ns&&e!==Xp&&e!==Zp&&e!==em&&e!==tm&&e!==nm&&e!==vi&&e!==Ey&&e!==Ry&&e!==ky&&e!==Oy&&e!==Py&&e!==Ay&&e!==_y&&e!==Sy&&e!==Cy&&e!==My&&e!==Fy}function Wy(e){return!ws(e)&&e!==Ns}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 rm(e){var t=/^\n* /;return t.test(e)}var lm=1,ji=2,sm=3,am=4,En=5;function Yy(e,t,n,r,l,a,i,o){var u,c=0,m=null,f=!1,g=!1,y=r!==-1,j=-1,v=Vy(Nr(e,0))&&Wy(Nr(e,e.length-1));if(t||i)for(u=0;u<e.length;c>=65536?u+=2:u++){if(c=Nr(e,u),!tl(c))return En;v=v&&jc(c,m,o),m=c}else{for(u=0;u<e.length;c>=65536?u+=2:u++){if(c=Nr(e,u),c===Zr)f=!0,y&&(g=g||u-j-1>r&&e[j+1]!==" ",j=u);else if(!tl(c))return En;v=v&&jc(c,m,o),m=c}g=g||y&&u-j-1>r&&e[j+1]!==" "}return!f&&!g?v&&!i&&!l(e)?lm:a===el?En:ji:n>9&&rm(e)?En:i?a===el?En:ji:g?am:sm}function Qy(e,t,n,r,l){e.dump=function(){if(t.length===0)return e.quotingType===el?'""':"''";if(!e.noCompatMode&&(zy.indexOf(t)!==-1||Dy.test(t)))return e.quotingType===el?'"'+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 Hy(e,c)}switch(Yy(t,o,e.indent,i,u,e.quotingType,e.forceQuotes&&!r,l)){case lm:return t;case ji:return"'"+t.replace(/'/g,"''")+"'";case sm:return"|"+Nc(t,e.indent)+wc(vc(t,a));case am:return">"+Nc(t,e.indent)+wc(vc(qy(t,i),a));case En:return'"'+Ky(t)+'"';default:throw new Ee("impossible error: invalid scalar style")}}()}function Nc(e,t){var n=rm(e)?String(t):"",r=e[e.length-1]===`
|
|
296
|
-
`,l=r&&(e[e.length-2]===`
|
|
297
|
-
`||e===`
|
|
298
|
-
`),a=l?"+":r?"":"-";return n+a+`
|
|
299
|
-
`}function wc(e){return e[e.length-1]===`
|
|
300
|
-
`?e.slice(0,-1):e}function qy(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var c=e.indexOf(`
|
|
301
|
-
`);return c=c!==-1?c:e.length,n.lastIndex=c,bc(e.slice(0,c),t)}(),l=e[0]===`
|
|
302
|
-
`||e[0]===" ",a,i;i=n.exec(e);){var o=i[1],u=i[2];a=u[0]===" ",r+=o+(!l&&!a&&u!==""?`
|
|
303
|
-
`:"")+bc(u,t),l=a}return r}function bc(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+=`
|
|
304
|
-
`+e.slice(l,a),l=a+1),i=o;return u+=`
|
|
305
|
-
`,e.length-l>t&&i>l?u+=e.slice(l,i)+`
|
|
306
|
-
`+e.slice(i+1):u+=e.slice(l),u.slice(1)}function Ky(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&&tl(n)?(t+=e[l],n>=65536&&(t+=e[l+1])):t+=r||$y(n);return t}function Jy(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 kc(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+=yi(e,t)),e.dump&&Zr===e.dump.charCodeAt(0)?l+="-":l+="- ",l+=e.dump);e.tag=a,e.dump=l||"[]"}function Gy(e,t,n){var r="",l=e.tag,a=Object.keys(n),i,o,u,c,m;for(i=0,o=a.length;i<o;i+=1)m="",r!==""&&(m+=", "),e.condenseFlow&&(m+='"'),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&&(m+="? "),m+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Lt(e,t,c,!1,!1)&&(m+=e.dump,r+=m));e.tag=l,e.dump="{"+r+"}"}function Xy(e,t,n,r){var l="",a=e.tag,i=Object.keys(n),o,u,c,m,f,g;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)g="",(!r||l!=="")&&(g+=yi(e,t)),c=i[o],m=n[c],e.replacer&&(m=e.replacer.call(n,c,m)),Lt(e,t+1,c,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Zr===e.dump.charCodeAt(0)?g+="?":g+="? "),g+=e.dump,f&&(g+=yi(e,t)),Lt(e,t+1,m,!0,f)&&(e.dump&&Zr===e.dump.charCodeAt(0)?g+=":":g+=": ",g+=e.dump,l+=g));e.tag=a,e.dump=l||"{}"}function Sc(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,Jp.call(o.represent)==="[object Function]")r=o.represent(t,u);else if(Gp.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,Sc(e,n,!1)||Sc(e,n,!0);var o=Jp.call(e.dump),u=r,c;r&&(r=e.flowLevel<0||e.flowLevel>t);var m=o==="[object Object]"||o==="[object Array]",f,g;if(m&&(f=e.duplicates.indexOf(n),g=f!==-1),(e.tag!==null&&e.tag!=="?"||g||e.indent!==2&&t>0)&&(l=!1),g&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(m&&g&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),o==="[object Object]")r&&Object.keys(e.dump).length!==0?(Xy(e,t,e.dump,l),g&&(e.dump="&ref_"+f+e.dump)):(Gy(e,t,e.dump),g&&(e.dump="&ref_"+f+" "+e.dump));else if(o==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!i&&t>0?kc(e,t-1,e.dump,l):kc(e,t,e.dump,l),g&&(e.dump="&ref_"+f+e.dump)):(Jy(e,t,e.dump),g&&(e.dump="&ref_"+f+" "+e.dump));else if(o==="[object String]")e.tag!=="?"&&Qy(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 Zy(e,t){var n=[],r=[],l,a;for(Ni(e,n,r),l=0,a=r.length;l<a;l+=1)t.duplicates.push(n[r[l]]);t.usedDuplicates=new Array(a)}function Ni(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)Ni(e[l],t,n);else for(r=Object.keys(e),l=0,a=r.length;l<a;l+=1)Ni(e[r[l]],t,n)}function e1(e,t){t=t||{};var n=new By(t);n.noRefs||Zy(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Lt(n,0,r,!0,!0)?n.dump+`
|
|
307
|
-
`:""}var t1=e1,n1={dump:t1};function Oo(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 r1=ye,l1=Np,s1=Sp,a1=Tp,i1=Pp,o1=Ao,u1=Kp.load,c1=Kp.loadAll,d1=n1.dump,f1=Ee,p1={binary:Op,float:Rp,map:kp,null:Cp,pairs:Dp,set:Ip,timestamp:Mp,bool:Ep,int:_p,merge:Fp,omap:zp,seq:bp,str:wp},m1=Oo("safeLoad","load"),h1=Oo("safeLoadAll","loadAll"),x1=Oo("safeDump","dump"),nl={Type:r1,Schema:l1,FAILSAFE_SCHEMA:s1,JSON_SCHEMA:a1,CORE_SCHEMA:i1,DEFAULT_SCHEMA:o1,load:u1,loadAll:c1,dump:d1,YAMLException:f1,types:p1,safeLoad:m1,safeLoadAll:h1,safeDump:x1};const Cc={id:"",name:"",description:"",category:"",tags:[],variables:[],interactionMode:"prompt",prompt:"",style:"",systemPrompt:"",steps:[],toolsFrom:[],inlineTools:{},initialState:{},goals:[],judge:null,maxScore:null};function g1(){const[e,t]=h.useState(Cc),n=h.useMemo(()=>{const R={};e.id&&(R.id=e.id),e.name&&(R.name=e.name),e.description&&(R.description=e.description),e.category&&(R.category=e.category),e.tags.length>0&&(R.tags=e.tags),e.variables.length>0&&(R.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&&(R.system_prompt=e.systemPrompt),e.interactionMode==="prompt"?(e.prompt&&(R.prompt=e.prompt),e.style&&(R.style=e.style)):e.steps.length>0&&(R.steps=e.steps.map(E=>({id:E.id,action:E.action,params:E.params}))),e.toolsFrom.length>0&&(R.tools_from=e.toolsFrom),Object.keys(e.inlineTools).length>0&&(R.tools=e.inlineTools),Object.keys(e.initialState).length>0&&(R.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&&(R.evaluation=C),nl.dump(R,{lineWidth:-1,noRefs:!0})},[e]),r=h.useMemo(()=>{const R=[];return e.id?/^[a-z0-9-]+$/.test(e.id)||R.push("ID must be lowercase letters, numbers, and hyphens only"):R.push("Scenario ID is required"),e.interactionMode==="prompt"&&!e.prompt&&R.push("Prompt is required for single-turn scenarios"),e.interactionMode==="steps"&&e.steps.length===0&&R.push("At least one step is required for multi-turn scenarios"),e.steps.forEach((C,E)=>{C.id||R.push(`Step ${E+1}: ID is required`),C.action==="inject_user"&&!C.params.content&&R.push(`Step ${E+1}: Content is required for inject_user`)}),e.goals.forEach((C,E)=>{C.id||R.push(`Goal ${E+1}: ID is required`),C.detection.type||R.push(`Goal ${E+1}: Detection type is required`)}),R},[e]),l=r.length===0,a=h.useCallback(R=>{t(C=>({...C,id:R}))},[]),i=h.useCallback(R=>{t(C=>({...C,name:R}))},[]),o=h.useCallback(R=>{t(C=>({...C,description:R}))},[]),u=h.useCallback(R=>{t(C=>({...C,category:R}))},[]),c=h.useCallback(R=>{t(C=>({...C,tags:R}))},[]),m=h.useCallback(R=>{t(C=>({...C,variables:[...C.variables,R]}))},[]),f=h.useCallback((R,C)=>{t(E=>({...E,variables:E.variables.map((w,k)=>k===R?C:w)}))},[]),g=h.useCallback(R=>{t(C=>({...C,variables:C.variables.filter((E,w)=>w!==R)}))},[]),y=h.useCallback(R=>{t(C=>({...C,interactionMode:R}))},[]),j=h.useCallback(R=>{t(C=>({...C,prompt:R}))},[]),v=h.useCallback(R=>{t(C=>({...C,style:R}))},[]),b=h.useCallback(R=>{t(C=>({...C,systemPrompt:R}))},[]),p=h.useCallback(R=>{t(C=>({...C,steps:[...C.steps,R]}))},[]),d=h.useCallback((R,C)=>{t(E=>({...E,steps:E.steps.map((w,k)=>k===R?C:w)}))},[]),x=h.useCallback(R=>{t(C=>({...C,steps:C.steps.filter((E,w)=>w!==R)}))},[]),S=h.useCallback((R,C)=>{t(E=>{const w=[...E.steps],[k]=w.splice(R,1);return w.splice(C,0,k),{...E,steps:w}})},[]),N=h.useCallback(R=>{t(C=>({...C,toolsFrom:R}))},[]),_=h.useCallback(R=>{t(C=>({...C,inlineTools:R}))},[]),P=h.useCallback(R=>{t(C=>({...C,initialState:R}))},[]),M=h.useCallback(R=>{t(C=>({...C,goals:[...C.goals,R]}))},[]),z=h.useCallback((R,C)=>{t(E=>({...E,goals:E.goals.map((w,k)=>k===R?C:w)}))},[]),O=h.useCallback(R=>{t(C=>({...C,goals:C.goals.filter((E,w)=>w!==R)}))},[]),A=h.useCallback(R=>{t(C=>({...C,judge:R}))},[]),$=h.useCallback(R=>{t(C=>({...C,maxScore:R}))},[]),Y=h.useCallback(()=>{t(Cc)},[]),K=h.useCallback(R=>{var C,E,w,k;try{const T=nl.load(R);t({id:T.id||"",name:T.name||"",description:T.description||"",category:T.category||"",tags:T.tags||[],variables:(T.variables||[]).map(F=>({name:F.name||"",label:F.label||"",type:F.type||"string",default:F.default??"",options:F.options||[],required:F.required!==!1})),interactionMode:T.steps?"steps":"prompt",prompt:T.prompt||"",style:T.style||"",systemPrompt:T.system_prompt||"",steps:(T.steps||[]).map((F,U)=>({id:F.id||`step_${U}`,action:F.action||"await_agent",params:F.params||{}})),toolsFrom:T.tools_from||[],inlineTools:T.tools||{},initialState:T.initial_state||{},goals:((E=((C=T.evaluation)==null?void 0:C.goals)||T.goals)==null?void 0:E.map((F,U)=>({id:F.id||`goal_${U}`,name:F.name||"",description:F.description||"",points:F.points||0,detection:F.detection||{type:""}})))||[],judge:((w=T.evaluation)==null?void 0:w.judge)||null,maxScore:((k=T.evaluation)==null?void 0:k.max_score)||null})}catch(T){console.error("Failed to parse YAML:",T)}},[]);return{state:e,yamlPreview:n,isValid:l,validationErrors:r,setId:a,setName:i,setDescription:o,setCategory:u,setTags:c,addVariable:m,updateVariable:f,removeVariable:g,setInteractionMode:y,setPrompt:j,setStyle:v,setSystemPrompt:b,addStep:p,updateStep:d,removeStep:x,reorderSteps:S,setToolsFrom:N,setInlineTools:_,setInitialState:P,addGoal:M,updateGoal:z,removeGoal:O,setJudge:A,setMaxScore:$,reset:Y,loadFromYaml:K}}const v1=["","brief","spicy","professional","formal","wholesome","chaotic","poetic"],y1=[{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 j1(){const e=vo(),[t,n]=h.useState("basic"),[r,l]=h.useState(!0),[a,i]=h.useState([]),[o,u]=h.useState(!1),[c,m]=h.useState(null),f=g1();h.useEffect(()=>{ie.listTools().then(v=>{i(v.map(b=>b.id))}).catch(()=>{})},[]);const g=async()=>{if(!f.isValid)return!1;u(!0),m(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 m({type:"success",text:"Scenario saved successfully!"}),!0;{const b=await v.json();return m({type:"error",text:b.detail||"Failed to save"}),!1}}catch(v){return m({type:"error",text:v instanceof Error?v.message:"Failed to save"}),!1}finally{u(!1)}},y=async()=>{await g()&&e(`/run/${f.state.id}`)},j=[{id:"basic",label:"Basic Info",icon:Eo},{id:"variables",label:"Variables",icon:Fg},{id:"interaction",label:"Interaction",icon:fp},{id:"tools",label:"Tools",icon:Gr},{id:"evaluation",label:"Evaluation",icon:Mg}];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(xs,{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:()=>g(),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(gs,{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(hn,{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(Us,{size:18}):s.jsx(tn,{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(tn,{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,b)=>s.jsx("li",{children:v},b))})]})]}),s.jsx("div",{className:"flex overflow-x-auto border-b border-slate-800/70 scrollbar-hide",children:j.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(N1,{builder:f}),t==="variables"&&s.jsx(b1,{builder:f}),t==="interaction"&&s.jsx(S1,{builder:f}),t==="tools"&&s.jsx(_1,{builder:f,availableTools:a}),t==="evaluation"&&s.jsx(R1,{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(xs,{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 N1({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 w1=[{value:"string",label:"Text"},{value:"number",label:"Number"},{value:"boolean",label:"Yes/No"},{value:"select",label:"Dropdown"}];function b1({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(ve,{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(k1,{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 k1({variable:e,onUpdate:t,onRemove:n}){const[r,l]=h.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(Ue,{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(Te,{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:w1.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 S1({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:v1.map(t=>s.jsx("option",{value:t,children:t||"(None)"},t))})]})]}):s.jsx(C1,{builder:e})]})}function C1({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(ve,{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(ve,{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(E1,{step:n,onUpdate:l=>e.updateStep(r,l),onRemove:()=>e.removeStep(r)},r))})]})}function E1({step:e,onUpdate:t,onRemove:n}){const[r,l]=h.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(Ue,{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(Te,{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 _1({builder:e,availableTools:t}){const[n,r]=h.useState(()=>JSON.stringify(e.state.initialState,null,2)||"{}"),[l,a]=h.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 R1({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(ve,{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(T1,{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(Te,{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(ve,{size:14})," Add Judge"]})]}),e.state.judge&&s.jsx(P1,{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 T1({goal:e,onUpdate:t,onRemove:n}){const[r,l]=h.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(Ue,{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(Te,{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..."}),y1.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 P1({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 Ec={toolType:"yaml",name:"",description:"",actions:[],pythonClassName:"",pythonActions:[],mcpTransport:"stdio",mcpCommand:"",mcpArgs:[],mcpUrl:"",mcpEnv:[]};function A1(){const[e,t]=h.useState(Ec),n=h.useMemo(()=>e.toolType==="yaml"?L1(e):e.toolType==="python"?M1(e):F1(e),[e]),r=h.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,k)=>{w.name?/^[a-z0-9_]+$/.test(w.name)||E.push(`Action ${k+1}: Name must be lowercase letters, numbers, and underscores`):E.push(`Action ${k+1}: Name is required`),w.params.forEach((T,F)=>{T.name||E.push(`Action ${k+1}, Param ${F+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=h.useCallback(E=>{t(w=>({...w,toolType:E}))},[]),i=h.useCallback(E=>{t(w=>({...w,name:E}))},[]),o=h.useCallback(E=>{t(w=>({...w,description:E}))},[]),u=h.useCallback(()=>{t(E=>({...E,actions:[...E.actions,{id:`action_${Date.now()}`,name:`action_${E.actions.length+1}`,description:"",params:[],returns:"",returnsType:"simple",sideEffects:[]}]}))},[]),c=h.useCallback((E,w)=>{t(k=>({...k,actions:k.actions.map((T,F)=>F===E?w:T)}))},[]),m=h.useCallback(E=>{t(w=>({...w,actions:w.actions.filter((k,T)=>T!==E)}))},[]),f=h.useCallback(E=>{t(w=>({...w,actions:w.actions.map((k,T)=>T!==E?k:{...k,params:[...k.params,{name:`param_${k.params.length+1}`,type:"string",required:!0,description:""}]})}))},[]),g=h.useCallback((E,w,k)=>{t(T=>({...T,actions:T.actions.map((F,U)=>U!==E?F:{...F,params:F.params.map((ee,X)=>X===w?k:ee)})}))},[]),y=h.useCallback((E,w)=>{t(k=>({...k,actions:k.actions.map((T,F)=>F!==E?T:{...T,params:T.params.filter((U,ee)=>ee!==w)})}))},[]),j=h.useCallback(E=>{t(w=>({...w,actions:w.actions.map((k,T)=>T!==E?k:{...k,sideEffects:[...k.sideEffects,{set:"",value:""}]})}))},[]),v=h.useCallback((E,w,k)=>{t(T=>({...T,actions:T.actions.map((F,U)=>U!==E?F:{...F,sideEffects:F.sideEffects.map((ee,X)=>X===w?k:ee)})}))},[]),b=h.useCallback((E,w)=>{t(k=>({...k,actions:k.actions.map((T,F)=>F!==E?T:{...T,sideEffects:T.sideEffects.filter((U,ee)=>ee!==w)})}))},[]),p=h.useCallback(E=>{t(w=>({...w,actions:w.actions.map((k,T)=>{if(T!==E)return k;const F=Array.isArray(k.returns)?k.returns:[];return{...k,returnsType:"conditional",returns:[...F,{when:"",value:""}]}})}))},[]),d=h.useCallback((E,w,k)=>{t(T=>({...T,actions:T.actions.map((F,U)=>U!==E||!Array.isArray(F.returns)?F:{...F,returns:F.returns.map((ee,X)=>X===w?k:ee)})}))},[]),x=h.useCallback((E,w)=>{t(k=>({...k,actions:k.actions.map((T,F)=>{if(F!==E||!Array.isArray(T.returns))return T;const U=T.returns.filter((ee,X)=>X!==w);return{...T,returnsType:U.length>0?"conditional":"simple",returns:U.length>0?U:""}})}))},[]),S=h.useCallback(E=>{t(w=>({...w,pythonClassName:E}))},[]),N=h.useCallback(()=>{t(E=>({...E,pythonActions:[...E.pythonActions,{name:`action_${E.pythonActions.length+1}`,description:"",params:[]}]}))},[]),_=h.useCallback((E,w)=>{t(k=>({...k,pythonActions:k.pythonActions.map((T,F)=>F===E?w:T)}))},[]),P=h.useCallback(E=>{t(w=>({...w,pythonActions:w.pythonActions.filter((k,T)=>T!==E)}))},[]),M=h.useCallback(E=>{t(w=>({...w,mcpTransport:E}))},[]),z=h.useCallback(E=>{t(w=>({...w,mcpCommand:E}))},[]),O=h.useCallback(E=>{t(w=>({...w,mcpArgs:E}))},[]),A=h.useCallback(E=>{t(w=>({...w,mcpUrl:E}))},[]),$=h.useCallback(()=>{t(E=>({...E,mcpEnv:[...E.mcpEnv,{key:"",value:""}]}))},[]),Y=h.useCallback((E,w)=>{t(k=>({...k,mcpEnv:k.mcpEnv.map((T,F)=>F===E?w:T)}))},[]),K=h.useCallback(E=>{t(w=>({...w,mcpEnv:w.mcpEnv.filter((k,T)=>T!==E)}))},[]),R=h.useCallback(()=>{t(Ec)},[]),C=h.useCallback(E=>{try{const w=nl.load(E),k=[],T=w.tools;if(T)for(const[F,U]of Object.entries(T)){const ee=[],X=U.params;if(X)for(const[se,Ot]of Object.entries(X))ee.push({name:se,type:Ot.type||"string",required:Ot.required!==!1,default:Ot.default,description:Ot.description||"",enum:Ot.enum});const lt=[],Le=U.side_effects;if(Le)for(const se of Le)lt.push({set:se.set,value:se.value});const st=U.returns;let kn="",dl="simple";Array.isArray(st)?(dl="conditional",kn=st.map(se=>({when:se.when,value:se.value}))):typeof st=="string"&&(kn=st),k.push({id:`action_${Date.now()}_${F}`,name:F,description:U.description||"",params:ee,returns:kn,returnsType:dl,errorWhen:U.error_when,returnsError:U.returns_error,sideEffects:lt})}t(F=>({...F,toolType:"yaml",name:w.name||"",description:w.description||"",actions:k}))}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:m,addParam:f,updateParam:g,removeParam:y,addSideEffect:j,updateSideEffect:v,removeSideEffect:b,addConditionalReturn:p,updateConditionalReturn:d,removeConditionalReturn:x,setPythonClassName:S,addPythonAction:N,updatePythonAction:_,removePythonAction:P,setMcpTransport:M,setMcpCommand:z,setMcpArgs:O,setMcpUrl:A,addMcpEnvVar:$,updateMcpEnvVar:Y,removeMcpEnvVar:K,reset:R,loadFromYaml:C}}function L1(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 nl.dump(t,{lineWidth:-1,noRefs:!0})}function M1(e){const t=e.pythonClassName||"MyCustomTool",n=e.name||"my_custom_tool";let r=`"""${e.description||"Custom tool implementation."}
|
|
308
|
-
|
|
309
|
-
Tool name: ${n}
|
|
310
|
-
"""
|
|
311
|
-
|
|
312
|
-
from sandboxy.tools.base import BaseTool, ToolConfig, ToolResult
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
class ${t}(BaseTool):
|
|
316
|
-
"""${e.description||"Custom tool implementation."}"""
|
|
317
|
-
|
|
318
|
-
def __init__(self, config: ToolConfig) -> None:
|
|
319
|
-
super().__init__(config)
|
|
320
|
-
# Add your initialization here
|
|
321
|
-
self.data: dict = {}
|
|
322
|
-
|
|
323
|
-
def invoke(self, action: str, args: dict, env_state: dict) -> ToolResult:
|
|
324
|
-
"""Handle tool actions."""
|
|
325
|
-
handlers = {
|
|
326
|
-
`;for(const l of e.pythonActions)r+=` "${l.name}": self._${l.name},
|
|
327
|
-
`;r+=` }
|
|
328
|
-
|
|
329
|
-
handler = handlers.get(action)
|
|
330
|
-
if not handler:
|
|
331
|
-
return ToolResult(success=False, error=f"Unknown action: {action}")
|
|
332
|
-
|
|
333
|
-
return handler(args, env_state)
|
|
334
|
-
`;for(const l of e.pythonActions){const a=l.params.map(i=>` ${i.name}: ${i.description||i.type}`).join(`
|
|
335
|
-
`);r+=`
|
|
336
|
-
def _${l.name}(self, args: dict, env_state: dict) -> ToolResult:
|
|
337
|
-
"""${l.description||"TODO: Add description"}
|
|
338
|
-
|
|
339
|
-
Args:
|
|
340
|
-
${a||" (no parameters)"}
|
|
341
|
-
"""
|
|
342
|
-
# TODO: Implement this action
|
|
343
|
-
${l.params.map(i=>`${i.name} = args.get("${i.name}")`).join(`
|
|
344
|
-
`)}
|
|
345
|
-
|
|
346
|
-
return ToolResult(success=True, data={"result": "TODO"})
|
|
347
|
-
`}r+=`
|
|
348
|
-
def get_actions(self) -> list[dict]:
|
|
349
|
-
"""Define available actions with their schemas."""
|
|
350
|
-
return [
|
|
351
|
-
`;for(const l of e.pythonActions){r+=` {
|
|
352
|
-
"name": "${l.name}",
|
|
353
|
-
"description": "${l.description||""}",
|
|
354
|
-
"parameters": {
|
|
355
|
-
"type": "object",
|
|
356
|
-
"properties": {
|
|
357
|
-
`;for(const a of l.params)r+=` "${a.name}": {"type": "${a.type}", "description": "${a.description||""}"},
|
|
358
|
-
`;r+=` },
|
|
359
|
-
"required": [${l.params.map(a=>`"${a.name}"`).join(", ")}],
|
|
360
|
-
},
|
|
361
|
-
},
|
|
362
|
-
`}return r+=` ]
|
|
363
|
-
`,r}function F1(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 nl.dump(t,{lineWidth:-1,noRefs:!0})}const O1=[{value:"string",label:"String"},{value:"boolean",label:"Boolean"},{value:"integer",label:"Integer"},{value:"number",label:"Number"},{value:"array",label:"Array"}],z1=[{value:"yaml",label:"Mock (YAML)",icon:dp,description:"Declarative tools with params, returns, and side effects"},{value:"python",label:"Python",icon:So,description:"Code-based tools for complex logic"},{value:"mcp",label:"MCP Server",icon:hp,description:"Connect to an external MCP server"}];function D1(){const[e,t]=h.useState(!0),[n,r]=h.useState(!1),[l,a]=h.useState(null),i=A1(),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 m=await c.json();return a({type:"error",text:m.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(xs,{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(gs,{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(Us,{size:18}):s.jsx(tn,{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(tn,{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,m)=>s.jsx("li",{children:c},m))})]})]}),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:z1.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(xp,{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(I1,{builder:i}),i.state.toolType==="python"&&s.jsx(V1,{builder:i}),i.state.toolType==="mcp"&&s.jsx(Y1,{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 I1({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(Gr,{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(ve,{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(Gr,{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($1,{action:t,index:n,builder:e},t.id))})]})}function $1({action:e,index:t,builder:n}){const[r,l]=h.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(Ue,{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(Te,{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(ve,{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(U1,{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(H1,{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(ve,{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(ve,{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(B1,{effect:i,onUpdate:u=>n.updateSideEffect(t,o,u),onRemove:()=>n.removeSideEffect(t,o)},o))})]})]})]})}function U1({param:e,onUpdate:t,onRemove:n}){const[r,l]=h.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:O1.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(Te,{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 B1({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(Te,{size:14})})]})}function H1({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(Te,{size:14})})]})}function V1({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(So,{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(ve,{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(W1,{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 W1({action:e,index:t,builder:n}){const[r,l]=h.useState(!0),a=c=>{n.updatePythonAction(t,{...e,...c})},i=()=>{a({params:[...e.params,{name:"",type:"string",description:""}]})},o=(c,m)=>{a({params:e.params.map((f,g)=>g===c?{...f,...m}:f)})},u=c=>{a({params:e.params.filter((m,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(Ue,{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(Te,{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(ve,{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,m)=>s.jsxs("div",{className:"flex gap-2 items-center",children:[s.jsx("input",{type:"text",value:c.name,onChange:f=>o(m,{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(m,{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(m,{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(m),className:"text-slate-500 hover:text-red-400 p-1",children:s.jsx(Te,{size:14})})]},m))})]})]})]})}function Y1({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(ve,{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(Q1,{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 Q1({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(Te,{size:14})})]})}function q1(){const[e,t]=h.useState([]),[n,r]=h.useState([]),[l,a]=h.useState(null),[i,o]=h.useState(null),[u,c]=h.useState(new Set),[m,f]=h.useState(!0),[g,y]=h.useState(null),[j,v]=h.useState(!1),[b,p]=h.useState(!1),[d,x]=h.useState(null),[S,N]=h.useState(!1),[_,P]=h.useState([]),[M,z]=h.useState([]),[O,A]=h.useState(!1);h.useEffect(()=>{$()},[]),h.useEffect(()=>{if(!(d!=null&&d.scenarioId)){P([]),z([]);return}ie.getScenarioGoals(d.scenarioId).then(k=>{const T=k.filter(F=>F.outcome);P(T.length>0?T:k)}).catch(()=>P([])),ie.getScenarioTools(d.scenarioId).then(z).catch(()=>z([]))},[d==null?void 0:d.scenarioId]),h.useEffect(()=>{l?ie.getDataset(l).then(k=>{o(k),y(null)}).catch(k=>y(k.message)):o(null)},[l]);async function $(){f(!0);try{const[k,T]=await Promise.all([ie.listDatasets(),ie.listScenarios()]);t(k),r(T),y(null)}catch(k){y(k instanceof Error?k.message:"Failed to load datasets")}finally{f(!1)}}function Y(k){const T=new Set(u);T.has(k)?T.delete(k):T.add(k),c(T)}function K(){i&&(x(Z1(i)),p(!0))}function R(){x({id:"",name:"",description:"",scenarioId:"",cases:[{id:"case_001",expected:[],variables:[{key:"",value:""}],toolResponses:[],tags:[]}]}),A(!0),p(!0)}async function C(){if(!d)return;const k=O?d.id:l;if(!k){y("Dataset ID is required");return}if(!/^[a-z0-9_-]+$/.test(k)){y("Dataset ID must contain only lowercase letters, numbers, hyphens, and underscores");return}v(!0);try{const T=im(d);O?await ie.saveDataset(k,T):await ie.updateDataset(k,T),p(!1),A(!1),x(null),await $(),a(k),y(null)}catch(T){y(T instanceof Error?T.message:"Failed to save dataset")}finally{v(!1)}}async function E(k){if(confirm(`Delete dataset "${k}"?`))try{await ie.deleteDataset(k),l===k&&(a(null),o(null)),await $(),y(null)}catch(T){y(T instanceof Error?T.message:"Failed to delete dataset")}}function w(){p(!1),A(!1),x(null)}return m?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(nn,{size:24}),"Datasets"]}),s.jsx("p",{className:"text-slate-400",children:"Manage test case datasets for multi-case benchmarking"})]}),g&&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(tn,{size:16}),g,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:R,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(ve,{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(k=>s.jsxs("div",{className:`p-3 rounded-lg cursor-pointer transition-colors ${l===k.id?"bg-blue-500/20 border border-blue-500/50":"panel-subtle hover:bg-slate-700/50"}`,onClick:()=>{a(k.id),p(!1),A(!1)},children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"font-medium text-slate-200",children:k.name}),s.jsxs("span",{className:"text-xs text-slate-500",children:[k.case_count," cases"]})]}),k.description&&s.jsx("p",{className:"text-sm text-slate-400 mt-1 line-clamp-1",children:k.description})]},k.id))})]}),s.jsx("div",{className:"lg:col-span-2 panel-card p-4 overflow-auto max-h-[80vh]",children:b&&d?s.jsx(K1,{data:d,isNew:O,saving:j,showYaml:S,scenarios:n,outcomeGoals:_,scenarioTools:M,onDataChange:x,onToggleYaml:()=>N(!S),onSave:C,onCancel:w}):i?s.jsx(G1,{dataset:i,expandedCases:u,onToggleCase:Y,onEdit:K,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 K1({data:e,isNew:t,saving:n,showYaml:r,scenarios:l,outcomeGoals:a,scenarioTools:i,onDataChange:o,onToggleYaml:u,onSave:c,onCancel:m}){const f=(v,b)=>{const p=[...e.cases];p[v]={...p[v],...b},o({...e,cases:p})},g=()=>{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((b,p)=>p!==v)})},j=v=>{const b=e.cases[v],p=`${b.id}_copy`,d={...b,id:p,variables:[...b.variables.map(x=>({...x}))],toolResponses:b.toolResponses.map(x=>({...x,fields:[...x.fields.map(S=>({...S}))],rawJson:x.rawJson})),tags:[...b.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(mp,{size:14}),"Form View"]}),s.jsxs("button",{onClick:m,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(gs,{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:im(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(So,{size:14}),"YAML"]}),s.jsxs("button",{onClick:m,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(gs,{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:g,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(ve,{size:14}),"Add Case"]})]}),s.jsx("div",{className:"space-y-4",children:e.cases.map((v,b)=>s.jsx(J1,{case_:v,index:b,outcomeGoals:a,scenarioTools:i,onChange:p=>f(b,p),onRemove:()=>y(b),onDuplicate:()=>j(b),canRemove:e.cases.length>1},b))})]})}function J1({case_:e,index:t,outcomeGoals:n,scenarioTools:r,onChange:l,onRemove:a,onDuplicate:i,canRemove:o}){const[u,c]=h.useState(!0),m=N=>{e.expected.includes(N)?l({expected:e.expected.filter(_=>_!==N)}):l({expected:[...e.expected,N]})},f=()=>{l({variables:[...e.variables,{key:"",value:""}]})},g=(N,_,P)=>{const M=[...e.variables];M[N]={key:_,value:P},l({variables:M})},y=N=>{l({variables:e.variables.filter((_,P)=>P!==N)})},j=()=>{l({toolResponses:[...e.toolResponses,{tool:"",action:"",mode:"fields",fields:[{key:"",value:""}],rawJson:`{
|
|
364
|
-
|
|
365
|
-
}`}]})},v=(N,_)=>{const P=[...e.toolResponses];P[N]={...P[N],..._},l({toolResponses:P})},b=N=>{l({toolResponses:e.toolResponses.filter((_,P)=>P!==N)})},p=N=>{const _=[...e.toolResponses];_[N]={..._[N],fields:[..._[N].fields,{key:"",value:""}]},l({toolResponses:_})},d=(N,_,P,M)=>{const z=[...e.toolResponses],O=[...z[N].fields];O[_]={key:P,value:M},z[N]={...z[N],fields:O},l({toolResponses:z})},x=(N,_)=>{const P=[...e.toolResponses];P[N]={...P[N],fields:P[N].fields.filter((M,z)=>z!==_)},l({toolResponses:P})},S=N=>{const _=N.split(",").map(P=>P.trim()).filter(Boolean);l({tags:_})};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(Ue,{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:N=>N.stopPropagation(),children:[s.jsx("button",{onClick:i,className:"p-1 text-slate-400 hover:text-slate-200",title:"Duplicate case",children:s.jsx(up,{size:14})}),o&&s.jsx("button",{onClick:a,className:"p-1 text-red-400 hover:text-red-300",title:"Remove case",children:s.jsx(Te,{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:N=>l({id:N.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(N=>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(N.id),onChange:()=>m(N.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:N.name||N.id}),N.description&&s.jsx("span",{className:"text-xs text-slate-500 truncate",children:N.description})]},N.id))}):s.jsx("input",{type:"text",value:e.expected.join(", "),onChange:N=>l({expected:N.target.value.split(",").map(_=>_.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:N=>S(N.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((N,_)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:N.key,onChange:P=>g(_,P.target.value,N.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:N.value,onChange:P=>g(_,N.key,P.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(_),className:"p-1.5 text-red-400 hover:text-red-300",children:s.jsx(jt,{size:14})})]},_))})]}),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:j,className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Override"})]}),s.jsxs("div",{className:"space-y-3",children:[e.toolResponses.map((N,_)=>{const P=r.find(z=>z.name===N.tool),M=(P==null?void 0:P.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:N.tool,onChange:z=>{const O=z.target.value,A=r.find(Y=>Y.name===O),$=(A==null?void 0:A.actions.length)===1&&A.actions[0].name==="call"?"call":"";v(_,{tool:O,action:$})},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(z=>s.jsx("option",{value:z.name,children:z.name},z.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:N.tool,onChange:z=>v(_,{tool:z.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"})]}),M.length===1&&M[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)"})]})]}):M.length>0?s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Action"}),s.jsxs("select",{value:N.action,onChange:z=>v(_,{action:z.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..."}),M.map(z=>s.jsx("option",{value:z.name,children:z.name},z.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:N.action,onChange:z=>v(_,{action:z.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:()=>b(_),className:"p-1.5 text-red-400 hover:text-red-300 self-end mb-1",title:"Remove override",children:s.jsx(Te,{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(_,{mode:"fields"}),className:`px-2 py-1 ${N.mode==="fields"?"bg-blue-500 text-white":"text-slate-400 hover:text-slate-200"}`,children:"Fields"}),s.jsx("button",{onClick:()=>v(_,{mode:"json"}),className:`px-2 py-1 ${N.mode==="json"?"bg-blue-500 text-white":"text-slate-400 hover:text-slate-200"}`,children:"JSON"})]})]}),N.mode==="fields"&&s.jsx("button",{onClick:()=>p(_),className:"text-xs text-blue-400 hover:text-blue-300",children:"+ Add Field"})]}),N.mode==="fields"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"space-y-2",children:N.fields.map((z,O)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:z.key,onChange:A=>d(_,O,A.target.value,z.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:z.value,onChange:A=>d(_,O,z.key,A.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)"}),N.fields.length>1&&s.jsx("button",{onClick:()=>x(_,O),className:"p-1.5 text-red-400 hover:text-red-300",children:s.jsx(jt,{size:14})})]},O))}),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:N.rawJson,onChange:z=>v(_,{rawJson:z.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."})]})]})]},_)}),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 G1({dataset:e,expandedCases:t,onToggleCase:n,onEdit:r,onDelete:l}){const[a,i]=h.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(mp,{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(Te,{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(X1,{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(hn,{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 X1({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(Ue,{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 Z1(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,m]of Object.entries(r))typeof m=="object"&&m!==null&&(u=!0),o.push({key:c,value:typeof m=="string"?m:JSON.stringify(m)});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 im(e){const t=[];e.name&&t.push(`name: "${e.name}"`),e.description&&(t.push("description: |"),e.description.split(`
|
|
366
|
-
`).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=_c(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=_c(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(`
|
|
367
|
-
`)}function _c(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 ej(){return s.jsx(Ux,{children:s.jsxs(Nt,{path:"/",element:s.jsx(zg,{}),children:[s.jsx(Nt,{index:!0,element:s.jsx(Ug,{})}),s.jsx(Nt,{path:"run/:scenarioId",element:s.jsx(oc,{})}),s.jsx(Nt,{path:"run",element:s.jsx(oc,{})}),s.jsx(Nt,{path:"results",element:s.jsx(Jg,{})}),s.jsx(Nt,{path:"builder",element:s.jsx(j1,{})}),s.jsx(Nt,{path:"tool-builder",element:s.jsx(D1,{})}),s.jsx(Nt,{path:"datasets",element:s.jsx(q1,{})})]})})}Na.createRoot(document.getElementById("root")).render(s.jsx(Rm.StrictMode,{children:s.jsx(fg,{children:s.jsx(ej,{})})}));
|